mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 21:21:15 -07:00
Template the stream modal
Template the history table Add history history to metadata info screens Fix some more datatables stuff More webserve housekeeping
This commit is contained in:
parent
58a1442fe9
commit
c4504d8be0
8 changed files with 564 additions and 301 deletions
|
@ -28,6 +28,7 @@ class DataTables(object):
|
|||
def __init__(self):
|
||||
self.ssp_db = db.DBConnection()
|
||||
|
||||
# TODO: Pass all parameters via kwargs
|
||||
def ssp_query(self, table_name,
|
||||
columns=[],
|
||||
start=0,
|
||||
|
@ -53,16 +54,26 @@ class DataTables(object):
|
|||
|
||||
# TODO: custom_where is ugly and causes issues with reported total results
|
||||
if custom_where != '':
|
||||
where += 'AND (' + custom_where + ')'
|
||||
custom_where = 'WHERE (' + custom_where + ')'
|
||||
|
||||
if grouping:
|
||||
query = 'SELECT * FROM (SELECT %s FROM %s GROUP BY %s) %s %s' \
|
||||
% (column_data['column_string'], table_name, group_by,
|
||||
where, order)
|
||||
if custom_where == '':
|
||||
query = 'SELECT * FROM (SELECT %s FROM %s GROUP BY %s) %s %s' \
|
||||
% (column_data['column_string'], table_name, group_by,
|
||||
where, order)
|
||||
else:
|
||||
query = 'SELECT * FROM (SELECT * FROM (SELECT %s FROM %s GROUP BY %s) %s %s) %s' \
|
||||
% (column_data['column_string'], table_name, group_by,
|
||||
where, order, custom_where)
|
||||
else:
|
||||
query = 'SELECT %s FROM %s %s %s' \
|
||||
% (column_data['column_string'], table_name, where,
|
||||
order)
|
||||
if custom_where == '':
|
||||
query = 'SELECT %s FROM %s %s %s' \
|
||||
% (column_data['column_string'], table_name, where,
|
||||
order)
|
||||
else:
|
||||
query = 'SELECT * FROM (SELECT %s FROM %s %s %s) %s' \
|
||||
% (column_data['column_string'], table_name, where,
|
||||
order, custom_where)
|
||||
|
||||
filtered = self.ssp_db.select(query)
|
||||
if search_value == '':
|
||||
|
@ -122,7 +133,9 @@ class DataTables(object):
|
|||
|
||||
return where
|
||||
else:
|
||||
return ''
|
||||
where = ''
|
||||
|
||||
return where
|
||||
|
||||
@staticmethod
|
||||
def extract_columns(columns=[]):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue