mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 07:30:12 +01:00
limit folder names to the top level
This commit is contained in:
parent
46ec86a070
commit
604ff565e1
@ -85,7 +85,7 @@ class ModelFolderFolder extends Model {
|
|||||||
public function get_folders_by_string($s = '') {
|
public function get_folders_by_string($s = '') {
|
||||||
if(strlen($s) < 2) { return array(); }
|
if(strlen($s) < 2) { return array(); }
|
||||||
|
|
||||||
$query = $this->db->query("SELECT name FROM `" . TABLE_FOLDER . "` WHERE name LIKE ? ORDER BY name ASC", array($s . "%") );
|
$query = $this->db->query("SELECT name FROM `" . TABLE_FOLDER . "` WHERE parent_id=0 AND name LIKE ? ORDER BY name ASC", array($s . "%") );
|
||||||
|
|
||||||
if(isset($query->rows)) { return $query->rows; }
|
if(isset($query->rows)) { return $query->rows; }
|
||||||
|
|
||||||
|
@ -70,10 +70,10 @@ class ModelHealthHealth extends Model {
|
|||||||
if(isset($a[0]) && $a[0]) { $_m[$a[0]] = $a[1]; }
|
if(isset($a[0]) && $a[0]) { $_m[$a[0]] = $a[1]; }
|
||||||
}
|
}
|
||||||
|
|
||||||
$mem_percentage = sprintf("%.2f", 100*($_m['MemTotal:'] - $_m['MemFree:'] - $_m['Cached:']) / $_m['MemTotal:']);
|
$mem_percentage = isset($_m['MemTotal:']) ? sprintf("%.2f", 100*($_m['MemTotal:'] - $_m['MemFree:'] - $_m['Cached:']) / $_m['MemTotal:']) : "0";
|
||||||
$swap_percentage = sprintf("%.2f", 100*($_m['SwapTotal:'] - $_m['SwapFree:']) / $_m['SwapTotal:']);
|
$swap_percentage = isset($_m['SwapTotal:']) ? sprintf("%.2f", 100*($_m['SwapTotal:'] - $_m['SwapFree:']) / $_m['SwapTotal:']) : "0";
|
||||||
|
|
||||||
return array(sprintf("%.0f", $_m['MemTotal:'] / 1000), $mem_percentage, sprintf("%.0f", $_m['SwapTotal:'] / 1000), $swap_percentage);
|
return array(sprintf("%.0f", @$_m['MemTotal:'] / 1000), $mem_percentage, sprintf("%.0f", @$_m['SwapTotal:'] / 1000), $swap_percentage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user