Bläddra i källkod

command exec dialog

develop
Robin Thoni 9 år sedan
förälder
incheckning
e5f796025d

+ 8
- 4
camotion/controllers/commands.controller.js Visa fil

@@ -1,6 +1,6 @@
1 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 5
             $scope.luTable = {
6 6
                 columns: [
@@ -30,8 +30,12 @@ angular.module('camotion')
30 30
 
31 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 Visa fil

@@ -0,0 +1,14 @@
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 Visa fil

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

+ 5
- 0
camotion/views/modals/commandexec.html Visa fil

@@ -0,0 +1,5 @@
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>

Laddar…
Avbryt
Spara