|
@@ -17,34 +17,34 @@ angular.module('camotionAdmin')
|
17
|
17
|
Description: "",
|
18
|
18
|
Data: null,
|
19
|
19
|
HostId: null,
|
20
|
|
- EntityTypeId: null
|
|
20
|
+ CameraTypeId: null
|
21
|
21
|
};
|
22
|
22
|
$scope.permission = "CAMOTION_CAMERA_ADD";
|
23
|
23
|
}
|
24
|
24
|
|
25
|
25
|
$scope.hosts = {};
|
26
|
|
- $scope.entityTypes = {};
|
|
26
|
+ $scope.cameraTypes = {};
|
27
|
27
|
var promiseLoadForeign = {
|
28
|
28
|
id: "promiseLoadForeign",
|
29
|
29
|
groups: ["modal"]
|
30
|
30
|
};
|
31
|
31
|
|
32
|
|
- HelperService.getForeignEntities(promiseLoadForeign).then(function(data)
|
|
32
|
+ HelperService.getForeignEntities(CamerasService, promiseLoadForeign).then(function(data)
|
33
|
33
|
{
|
34
|
34
|
$scope.hosts = data.hosts;
|
35
|
|
- $scope.entityTypes = data.entityTypes;
|
|
35
|
+ $scope.cameraTypes = data.types;
|
36
|
36
|
if ($scope.camera.Id == null) {
|
37
|
37
|
var keys = Object.keys($scope.hosts);
|
38
|
38
|
if (keys.length != 0) {
|
39
|
39
|
$scope.camera.HostId = $scope.hosts[keys[0]].Id;
|
40
|
|
- }keys = Object.keys($scope.entityTypes);
|
|
40
|
+ }keys = Object.keys($scope.cameraTypes);
|
41
|
41
|
if (keys.length != 0) {
|
42
|
|
- $scope.camera.EntityTypeId = $scope.entityTypes[keys[0]].Id;
|
43
|
|
- $scope.setEntityType($scope.entityTypes[keys[0]]);
|
|
42
|
+ $scope.camera.CameraTypeId = $scope.cameraTypes[keys[0]].Id;
|
|
43
|
+ $scope.setCamerayType($scope.cameraTypes[keys[0]]);
|
44
|
44
|
}
|
45
|
45
|
}
|
46
|
46
|
else if ($scope.camera.Data == null) {
|
47
|
|
- $scope.setEntityType($scope.entityTypes[$scope.camera.EntityTypeId]);
|
|
47
|
+ $scope.setCameraType($scope.cameraTypes[$scope.camera.CameraTypeId]);
|
48
|
48
|
}
|
49
|
49
|
});
|
50
|
50
|
|
|
@@ -74,9 +74,9 @@ angular.module('camotionAdmin')
|
74
|
74
|
}
|
75
|
75
|
};
|
76
|
76
|
|
77
|
|
- $scope.setEntityType = function(entityType)
|
|
77
|
+ $scope.setCameraType = function(cameraType)
|
78
|
78
|
{
|
79
|
|
- $scope.camera.EntityTypeId = entityType.Id;
|
80
|
|
- $scope.camera.Data = JSON.parse($scope.entityTypes[$scope.camera.EntityTypeId].DefaultData);
|
|
79
|
+ $scope.camera.CameraTypeId = cameraType.Id;
|
|
80
|
+ $scope.camera.Data = JSON.parse($scope.cameraTypes[$scope.camera.CameraTypeId].DefaultData);
|
81
|
81
|
};
|
82
|
82
|
}]);
|