From a10040ea1c9915587632c1ffe948d26e6df8d5ae Mon Sep 17 00:00:00 2001 From: SJ Date: Thu, 1 Aug 2013 22:28:42 +0200 Subject: [PATCH] gui improvements --- webui/controller/search/remove.php | 4 ++- webui/model/health/health.php | 6 ++--- webui/model/saas/customer.php | 2 ++ webui/model/search/search.php | 8 +++--- webui/view/javascript/piler-in.js | 25 +++++++++++++------ .../templates/common/layout-search.tpl | 1 - .../theme/default/templates/customer/list.tpl | 2 +- .../theme/default/templates/health/worker.tpl | 2 +- .../theme/default/templates/search/load.tpl | 2 +- .../theme/default/templates/user/settings.tpl | 2 +- .../theme/mobile/stylesheet/style-mobile.css | 2 ++ .../mobile/templates/common/layout-search.tpl | 2 -- .../theme/mobile/templates/customer/list.tpl | 2 +- .../theme/mobile/templates/health/worker.tpl | 2 +- .../theme/mobile/templates/search/load.tpl | 2 +- .../theme/mobile/templates/user/settings.tpl | 2 +- 16 files changed, 40 insertions(+), 26 deletions(-) diff --git a/webui/controller/search/remove.php b/webui/controller/search/remove.php index 80443226..a1512281 100644 --- a/webui/controller/search/remove.php +++ b/webui/controller/search/remove.php @@ -19,7 +19,9 @@ class ControllerSearchRemove extends Controller { $this->load->model('search/message'); $this->load->model('user/user'); - $this->data['terms'] = $this->model_search_search->remove_search_terms(); + if(isset($this->request->get['ts'])) { + $this->data['terms'] = $this->model_search_search->remove_search_term($this->request->get['ts']); + } } } diff --git a/webui/model/health/health.php b/webui/model/health/health.php index af52c483..ff124422 100644 --- a/webui/model/health/health.php +++ b/webui/model/health/health.php @@ -90,9 +90,9 @@ class ModelHealthHealth extends Model { if(isset($p[5]) && in_array($p[5], $partitions)) { $shortinfo[] = array( 'partition' => $p[5], - 'freespace' => nice_size(1000*$p[3]), - 'total' => nice_size(1000*$p[1]), - 'used' => nice_size(1000*$p[2]), + 'freespace' => $p[3], + 'total' => $p[1], + 'used' => $p[2], 'utilization' => preg_replace("/\%/", "", $p[4]) ); } diff --git a/webui/model/saas/customer.php b/webui/model/saas/customer.php index ad88b28e..5b21d505 100644 --- a/webui/model/saas/customer.php +++ b/webui/model/saas/customer.php @@ -142,6 +142,8 @@ class ModelSaasCustomer extends Model public function get_online_users() { + $query = $this->db->query("DELETE FROM " . TABLE_ONLINE . " WHERE last_activity < ?", array(NOW - 3600)); + $query = $this->db->query("SELECT * FROM " . TABLE_ONLINE . " ORDER BY username ASC"); return $query->rows; diff --git a/webui/model/search/search.php b/webui/model/search/search.php index 4baf5ef2..4e98a084 100644 --- a/webui/model/search/search.php +++ b/webui/model/search/search.php @@ -269,7 +269,7 @@ class ModelSearchSearch extends Model { $data['any'] = $this->fixup_sphinx_operators($data['any']); $data['any'] = $this->fix_email_address_for_sphinx($data['any']); $fields = ''; - if($match) { $match = "($match) & "; $fields = '@subject,@body '; } $match .= "($fields " . $data['any'] . ") "; + if($match) { $match = "($match) & "; } $match .= "(@subject " . $data['any'] . " | @body " . $data['any'] . ") "; } @@ -759,7 +759,7 @@ class ModelSearchSearch extends Model { public function get_search_terms() { - $query = $this->db->query("SELECT term FROM " . TABLE_SEARCH . " WHERE email=? ORDER BY ts DESC", array($_SESSION['email'])); + $query = $this->db->query("SELECT term, ts FROM " . TABLE_SEARCH . " WHERE email=? ORDER BY ts DESC", array($_SESSION['email'])); if(isset($query->rows)) { return $query->rows; } return array(); @@ -792,8 +792,8 @@ class ModelSearchSearch extends Model { } - public function remove_search_terms() { - $query = $this->db->query("DELETE FROM " . TABLE_SEARCH . " WHERE email=?", array($_SESSION['email'])); + public function remove_search_term($ts = 0) { + $query = $this->db->query("DELETE FROM " . TABLE_SEARCH . " WHERE email=? AND ts=?", array($_SESSION['email'], $ts)); } diff --git a/webui/view/javascript/piler-in.js b/webui/view/javascript/piler-in.js index 44d26773..aff6cda1 100644 --- a/webui/view/javascript/piler-in.js +++ b/webui/view/javascript/piler-in.js @@ -221,17 +221,15 @@ var Piler = }, - remove_saved_search_terms:function(msg) + remove_saved_search_term:function(ts) { - Piler.log("[load_saved_search_terms]"); + Piler.log("[remove_saved_search_term]"); - jQuery.ajax('/index.php?route=search/remove', {}) - .done(function(a) { - $('#mailcontframe').html(a); - }) + jQuery.ajax('/index.php?route=search/remove&ts=' + ts, {}) + .done(function(a) {}) .fail(function(a, b) { alert("Problem retrieving XML data:" + b) }); - Piler.show_message('messagebox1', msg, 0.85); + Piler.load_saved_search_terms(); }, @@ -949,6 +947,19 @@ var Piler = reload_page: function() { location.reload(true); + }, + + + go_to_default_page: function() + { + document.location.href = 'search.php'; + }, + + + change_box_colour: function() + { + var colour = $('#colour').val(); + $('#cp').css('background', colour); } diff --git a/webui/view/theme/default/templates/common/layout-search.tpl b/webui/view/theme/default/templates/common/layout-search.tpl index 97e47e1b..ac19f6bd 100644 --- a/webui/view/theme/default/templates/common/layout-search.tpl +++ b/webui/view/theme/default/templates/common/layout-search.tpl @@ -63,7 +63,6 @@ diff --git a/webui/view/theme/default/templates/customer/list.tpl b/webui/view/theme/default/templates/customer/list.tpl index 69fe24de..4c58091d 100644 --- a/webui/view/theme/default/templates/customer/list.tpl +++ b/webui/view/theme/default/templates/customer/list.tpl @@ -47,7 +47,7 @@
-     +    
diff --git a/webui/view/theme/default/templates/health/worker.tpl b/webui/view/theme/default/templates/health/worker.tpl index 2a0b5099..f6362e2a 100644 --- a/webui/view/theme/default/templates/health/worker.tpl +++ b/webui/view/theme/default/templates/health/worker.tpl @@ -45,7 +45,7 @@ - => / (%)
+ => / (%)
diff --git a/webui/view/theme/default/templates/search/load.tpl b/webui/view/theme/default/templates/search/load.tpl index 1993404b..e51e4eae 100644 --- a/webui/view/theme/default/templates/search/load.tpl +++ b/webui/view/theme/default/templates/search/load.tpl @@ -10,7 +10,7 @@ if(isset($s['search'])) { ?> - + |   diff --git a/webui/view/theme/default/templates/user/settings.tpl b/webui/view/theme/default/templates/user/settings.tpl index a79c39e2..be774c34 100644 --- a/webui/view/theme/default/templates/user/settings.tpl +++ b/webui/view/theme/default/templates/user/settings.tpl @@ -87,7 +87,7 @@
- +
diff --git a/webui/view/theme/mobile/stylesheet/style-mobile.css b/webui/view/theme/mobile/stylesheet/style-mobile.css index 6b6ea885..2ecbdaa2 100644 --- a/webui/view/theme/mobile/stylesheet/style-mobile.css +++ b/webui/view/theme/mobile/stylesheet/style-mobile.css @@ -70,6 +70,7 @@ .resultrow.odd { background: #f5f5f5; } .resultrow.new { font-style: normal; } .resultrow.new a { color: #0072e6; } + .resultrow.center a { color: #0072e6; } .resultrow.new a.spam { color: #aaa; } .resultrow.selected { border: 2px solid black; } .resultrow.spam { color: #aaa; } @@ -93,6 +94,7 @@ .auditcell.header { height: 30px; font: bold 12px Arial, sans-serif; color: black; } a.auditlink { color: #0072e6; } + .menulink { color: #0072e6; } #health1 { display: table-cell; margin-top: 10px; margin-bottom: 0; } #health2 { display: table-cell; text-align: right; } diff --git a/webui/view/theme/mobile/templates/common/layout-search.tpl b/webui/view/theme/mobile/templates/common/layout-search.tpl index fc11518f..128d3946 100644 --- a/webui/view/theme/mobile/templates/common/layout-search.tpl +++ b/webui/view/theme/mobile/templates/common/layout-search.tpl @@ -55,8 +55,6 @@ - - diff --git a/webui/view/theme/mobile/templates/customer/list.tpl b/webui/view/theme/mobile/templates/customer/list.tpl index 527f7657..90567636 100644 --- a/webui/view/theme/mobile/templates/customer/list.tpl +++ b/webui/view/theme/mobile/templates/customer/list.tpl @@ -47,7 +47,7 @@
-     +    
diff --git a/webui/view/theme/mobile/templates/health/worker.tpl b/webui/view/theme/mobile/templates/health/worker.tpl index 5735c349..d6e87b73 100644 --- a/webui/view/theme/mobile/templates/health/worker.tpl +++ b/webui/view/theme/mobile/templates/health/worker.tpl @@ -72,7 +72,7 @@
-
=> / (%)
+
=> / (%)
diff --git a/webui/view/theme/mobile/templates/search/load.tpl b/webui/view/theme/mobile/templates/search/load.tpl index 2db14ead..0502974f 100644 --- a/webui/view/theme/mobile/templates/search/load.tpl +++ b/webui/view/theme/mobile/templates/search/load.tpl @@ -18,7 +18,7 @@ if(isset($s['search']) && $s['search']) { ?>
-
+ |
diff --git a/webui/view/theme/mobile/templates/user/settings.tpl b/webui/view/theme/mobile/templates/user/settings.tpl index 7a1c748b..9e72568b 100644 --- a/webui/view/theme/mobile/templates/user/settings.tpl +++ b/webui/view/theme/mobile/templates/user/settings.tpl @@ -95,7 +95,7 @@
 
-
+