Browse Source

command exec dialog

develop
Robin Thoni 9 years ago
parent
commit
e5f796025d

+ 8
- 4
camotion/controllers/commands.controller.js View File

1
 angular.module('camotion')
1
 angular.module('camotion')
2
-    .controller('CommandsController', ['$scope', 'CommandsService',
3
-        function($scope, CommandsService) {
2
+    .controller('CommandsController', ['$scope', 'CommandsService', 'dialogs',
3
+        function($scope, CommandsService, dialogs) {
4
 
4
 
5
             $scope.luTable = {
5
             $scope.luTable = {
6
                 columns: [
6
                 columns: [
30
 
30
 
31
                 onItemClicked: function(command)
31
                 onItemClicked: function(command)
32
                 {
32
                 {
33
-                    CommandsService.exec({command_id: command.Id});
34
-                    console.log(command);
33
+                    dialogs.create('views/modals/commandexec.html', 'CommandExecController', command)
34
+                        .result.then(function (data) {
35
+
36
+                    });
37
+                    /*CommandsService.exec({command_id: command.Id});
38
+                    console.log(command);*/
35
                 }
39
                 }
36
             };
40
             };
37
     }]);
41
     }]);

+ 14
- 0
camotion/controllers/modals/camandexec.controller.js View File

1
+angular.module('camotion')
2
+    .controller('CommandExecController', ['$scope', '$state', 'data', 'CommandsService',
3
+        function($scope, $state, data, CommandsService) {
4
+            $scope.command = data;
5
+
6
+            $scope.submitForm = function()
7
+            {
8
+                var promiseExec = {
9
+                    id: "promiseExec",
10
+                    loaderGroups: ["modal"]
11
+                };
12
+                return CommandsService.exec({command_id: $scope.command.Id}, promiseExec);
13
+            };
14
+    }]);

+ 1
- 0
camotion/index.html View File

40
     <script src="controllers/commands.controller.js"></script>
40
     <script src="controllers/commands.controller.js"></script>
41
 
41
 
42
     <!-- Modal Controller -->
42
     <!-- Modal Controller -->
43
+    <script src="controllers/modals/camandexec.controller.js"></script>
43
 
44
 
44
     <!-- SDK -->
45
     <!-- SDK -->
45
     <script src="../sdk/sdk.js"></script>
46
     <script src="../sdk/sdk.js"></script>

+ 5
- 0
camotion/views/modals/commandexec.html View File

1
+<dialog-ok-cancel title="Execute action">
2
+    <div class="col-md-offset-1">
3
+        Execute action '{{ command.Name }}'?
4
+    </div>
5
+</dialog-ok-cancel>

Loading…
Cancel
Save