diff --git a/web/js/app.js b/web/js/app.js
index c0a190150..a7b98c758 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -83,6 +83,38 @@ ZoneMinder.config(function($stateProvider, $urlRouterProvider) {
templateUrl: '/views/monitor.detail.misc.html'
})
+ ///////////////////////////
+ // Zones - Edit and List //
+ ///////////////////////////
+ .state('zones', {
+ url: '/zones/{mid:[0-9]{1,4}}',
+ templateUrl: '/views/zones.html',
+ resolve: {
+ mid: function($stateParams) {
+ return { value: $stateParams.mid };
+ },
+ zones: function(Zones, $stateParams) {
+ return Zones.getZones($stateParams.mid);
+ }
+ },
+ controller: function($scope, mid, zones) {
+ $scope.mid = mid.value;
+ $scope.zones = zones.data.zones;
+ }
+ })
+ .state('zones.edit', {
+ url: '/edit/{zid:[0-9]{1,4}}',
+ templateUrl: '/views/zones.edit.html',
+ resolve: {
+ zone: function(Zones, $stateParams) {
+ return Zones.getZone($stateParams.zid);
+ }
+ },
+ controller: function($scope, zone) {
+ $scope.zone = zone.data.zone.Zone;
+ }
+ })
+
.state('events', {
url: '/events',
@@ -242,6 +274,20 @@ ZoneMinder.factory('Config', function($http) {
};
});
+ZoneMinder.factory('Zones', function($http) {
+ return {
+ getZones: function(mid) {
+ return $http.get('/api/zones/forMonitor/'+mid+'.json')
+ },
+ getZone: function(zid) {
+ return $http.get('/api/zones/'+zid+'.json')
+ },
+ createZoneImage: function(mid) {
+ return $http.post('/api/zones/createZoneImage/'+mid+'.json');
+ }
+ };
+});
+
ZoneMinder.directive('angularHtmlBind', function($compile) {
return function(scope, elm, attrs) {
scope.$watch(attrs.angularHtmlBind, function(newValue, oldValue) {
diff --git a/web/js/controllers.js b/web/js/controllers.js
index 8f0b07bf8..41d45f71a 100644
--- a/web/js/controllers.js
+++ b/web/js/controllers.js
@@ -426,3 +426,6 @@ ZoneMinder.controller('HostController', function($scope, Host) {
});
});
+
+ZoneMinder.controller('ZonesController', function($scope, Zones) {
+});
diff --git a/web/views/monitor.list.html b/web/views/monitor.list.html
index 0ad6be0d4..aa60e8702 100644
--- a/web/views/monitor.list.html
+++ b/web/views/monitor.list.html
@@ -50,7 +50,8 @@
-
+
+
Id |
Name |
@@ -77,7 +78,9 @@
|
|
- |
+
+ Edit
+ |
|
@@ -86,7 +89,7 @@
-
+
diff --git a/web/views/zones.edit.html b/web/views/zones.edit.html
new file mode 100644
index 000000000..e6a97fe07
--- /dev/null
+++ b/web/views/zones.edit.html
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/views/zones.html b/web/views/zones.html
new file mode 100644
index 000000000..9c3fd8f70
--- /dev/null
+++ b/web/views/zones.html
@@ -0,0 +1,19 @@
+
+
+
+ Name |
+ Type |
+ Area |
+ Delete |
+
+
+ {{ zone.Zone.Name }} |
+ {{ zone.Zone.Type }} |
+ {{ zone.Zone.Area }} |
+ |
+
+
+
+
+
+