From 8f752f2b2042f68383f9c0e260bb278c7267e399 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Wed, 11 Feb 2015 11:32:40 -0500 Subject: [PATCH] Add row / column layout options to console grid --- web/skins/bootstrap/css/skin.css | 5 --- web/skins/bootstrap/js/controllers.js | 12 ++++++ web/skins/bootstrap/views/console.php | 60 +++++++++++++++++---------- 3 files changed, 49 insertions(+), 28 deletions(-) diff --git a/web/skins/bootstrap/css/skin.css b/web/skins/bootstrap/css/skin.css index f44793701..3b6b7f67f 100644 --- a/web/skins/bootstrap/css/skin.css +++ b/web/skins/bootstrap/css/skin.css @@ -412,11 +412,6 @@ th.table-th-sort-rev span.table-th-sort-span { align-items: baseline; } -.monitor { - width: 240px; - margin: 5px; -} - .event { float: left; width: 184px; diff --git a/web/skins/bootstrap/js/controllers.js b/web/skins/bootstrap/js/controllers.js index bfeccfaef..6acf2f62d 100644 --- a/web/skins/bootstrap/js/controllers.js +++ b/web/skins/bootstrap/js/controllers.js @@ -256,8 +256,19 @@ ZoneMinder.controller('MonitorController', function($scope, $http, $location, Mo ZoneMinder.controller('ConsoleController', function($scope, Console) { $scope.grid = true; $scope.gridButton = 'glyphicon-th'; + $scope.consoleLayout = 4; + + $scope.updateLayout = function () { + var rows = []; + var monitors = $scope.monitors; + for (var i = 0; i < monitors.length; i++) { + if (i % $scope.consoleLayout == 0) rows.push([]); + rows[rows.length-1].push(monitors[i]); } + $scope.columnSize = Math.floor(12 / $scope.consoleLayout); + return $scope.rows = rows; + }; $scope.delete = function (index) { var monitor = $scope.monitors[index]; @@ -304,6 +315,7 @@ ZoneMinder.controller('ConsoleController', function($scope, Console) { }); $scope.monitors = monitors; + $scope.updateLayout(); } }); diff --git a/web/skins/bootstrap/views/console.php b/web/skins/bootstrap/views/console.php index d9d335f32..51a887131 100644 --- a/web/skins/bootstrap/views/console.php +++ b/web/skins/bootstrap/views/console.php @@ -8,35 +8,49 @@
-
-
- -
+
+ +
+
+
-
-
-
-
+
+
+
+
-
- - - -

{{ monitor.Name }}

-
- -
- -
+
+ + + +

{{ monitor.Name }}

+
+ +
+ +
-
-
+
+
-
+