mirror of
https://github.com/hak5/nano-tetra-modules.git
synced 2025-10-29 16:58:09 +00:00
Add modules to repository
This commit is contained in:
67
Commander/js/module.js
Normal file
67
Commander/js/module.js
Normal file
@@ -0,0 +1,67 @@
|
||||
registerController('CommanderController', ['$api', '$scope', function($api, $scope) {
|
||||
$scope.commanderRunning = false;
|
||||
|
||||
$scope.startCommander = (function() {
|
||||
$api.request({
|
||||
module: 'Commander',
|
||||
action: 'startCommander'
|
||||
}, function(response) {
|
||||
if (response.success === true) {
|
||||
$scope.commanderRunning = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$scope.stopCommander = (function() {
|
||||
$api.request({
|
||||
module: 'Commander',
|
||||
action: 'stopCommander'
|
||||
}, function(response){
|
||||
if (response.success === true) {
|
||||
$scope.commanderRunning = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
}]);
|
||||
|
||||
registerController('CommanderManageController', ['$api', '$scope', '$timeout', function($api, $scope, $timeout) {
|
||||
$scope.CommanderConfiguration = "";
|
||||
|
||||
$scope.getConfiguration = (function() {
|
||||
$api.request({
|
||||
module: 'Commander',
|
||||
action: 'getConfiguration'
|
||||
}, function(response) {
|
||||
console.log(response);
|
||||
if (response.error === undefined){
|
||||
$scope.CommanderConfiguration = response.CommanderConfiguration;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$scope.saveConfiguration = (function() {
|
||||
$api.request({
|
||||
module: 'Commander',
|
||||
action: 'saveConfiguration',
|
||||
CommanderConfiguration: $scope.CommanderConfiguration
|
||||
}, function(response) {
|
||||
console.log(response);
|
||||
if (response.success === true){
|
||||
$scope.getConfiguration();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$scope.restoreDefaultConfiguration = (function() {
|
||||
$api.request({
|
||||
module: 'Commander',
|
||||
action: 'restoreDefaultConfiguration'
|
||||
}, function(response) {
|
||||
if (response.success === true) {
|
||||
$scope.getConfiguration();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$scope.getConfiguration();
|
||||
}]);
|
||||
Reference in New Issue
Block a user