mirror of
https://github.com/hak5/nano-tetra-modules.git
synced 2025-10-29 16:58:09 +00:00
Maintenance for a few modules (#42)
This commit is contained in:
@@ -2,17 +2,17 @@ registerController('Deauth_Controller', ['$api', '$scope', '$rootScope', '$inter
|
||||
$scope.title = "Loading...";
|
||||
$scope.version = "Loading...";
|
||||
|
||||
$scope.refreshInfo = (function() {
|
||||
$scope.refreshInfo = (function() {
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: "refreshInfo"
|
||||
}, function(response) {
|
||||
$scope.title = response.title;
|
||||
$scope.version = "v"+response.version;
|
||||
})
|
||||
});
|
||||
module: 'Deauth',
|
||||
action: "refreshInfo"
|
||||
}, function(response) {
|
||||
$scope.title = response.title;
|
||||
$scope.version = "v" + response.version;
|
||||
})
|
||||
});
|
||||
|
||||
$scope.refreshInfo();
|
||||
$scope.refreshInfo();
|
||||
|
||||
}]);
|
||||
|
||||
@@ -37,32 +37,32 @@ registerController('Deauth_ControlsController', ['$api', '$scope', '$rootScope',
|
||||
$scope.sdAvailable = false;
|
||||
|
||||
$rootScope.status = {
|
||||
installed : false,
|
||||
refreshOutput : false
|
||||
installed: false,
|
||||
refreshOutput: false
|
||||
};
|
||||
|
||||
$scope.refreshStatus = (function() {
|
||||
$scope.refreshStatus = (function() {
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: "refreshStatus"
|
||||
}, function(response) {
|
||||
$scope.status = response.status;
|
||||
$scope.statusLabel = response.statusLabel;
|
||||
module: 'Deauth',
|
||||
action: "refreshStatus"
|
||||
}, function(response) {
|
||||
$scope.status = response.status;
|
||||
$scope.statusLabel = response.statusLabel;
|
||||
|
||||
$rootScope.status.installed = response.installed;
|
||||
$scope.device = response.device;
|
||||
$scope.sdAvailable = response.sdAvailable;
|
||||
if(response.processing) $scope.processing = true;
|
||||
$scope.install = response.install;
|
||||
$scope.installLabel = response.installLabel;
|
||||
$rootScope.status.installed = response.installed;
|
||||
$scope.device = response.device;
|
||||
$scope.sdAvailable = response.sdAvailable;
|
||||
if (response.processing) $scope.processing = true;
|
||||
$scope.install = response.install;
|
||||
$scope.installLabel = response.installLabel;
|
||||
|
||||
$scope.bootLabelON = response.bootLabelON;
|
||||
$scope.bootLabelOFF = response.bootLabelOFF;
|
||||
})
|
||||
});
|
||||
$scope.bootLabelON = response.bootLabelON;
|
||||
$scope.bootLabelOFF = response.bootLabelOFF;
|
||||
})
|
||||
});
|
||||
|
||||
$scope.togglemdk3 = (function() {
|
||||
if($scope.status != "Stop")
|
||||
$scope.togglemdk3 = (function() {
|
||||
if ($scope.status != "Stop")
|
||||
$scope.status = "Starting...";
|
||||
else
|
||||
$scope.status = "Stopping...";
|
||||
@@ -73,146 +73,142 @@ registerController('Deauth_ControlsController', ['$api', '$scope', '$rootScope',
|
||||
$rootScope.status.refreshOutput = false;
|
||||
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'togglemdk3',
|
||||
interface: $scope.selectedInterface
|
||||
}, function(response) {
|
||||
$timeout(function(){
|
||||
$rootScope.status.refreshOutput = true;
|
||||
module: 'Deauth',
|
||||
action: 'togglemdk3',
|
||||
interface: $scope.selectedInterface
|
||||
}, function(response) {
|
||||
$timeout(function() {
|
||||
$rootScope.status.refreshOutput = true;
|
||||
|
||||
$scope.starting = false;
|
||||
$scope.refreshStatus();
|
||||
$scope.getInterfaces();
|
||||
$scope.starting = false;
|
||||
$scope.refreshStatus();
|
||||
$scope.getInterfaces();
|
||||
|
||||
}, 3000);
|
||||
})
|
||||
}, 3000);
|
||||
})
|
||||
});
|
||||
|
||||
$scope.saveAutostartSettings = (function() {
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'saveAutostartSettings',
|
||||
settings: { interface : $scope.selectedInterface }
|
||||
}, function(response) {
|
||||
$scope.saveSettingsLabel = "success";
|
||||
$timeout(function(){
|
||||
$scope.saveSettingsLabel = "default";
|
||||
}, 2000);
|
||||
})
|
||||
});
|
||||
module: 'Deauth',
|
||||
action: 'saveAutostartSettings',
|
||||
settings: {
|
||||
interface: $scope.selectedInterface
|
||||
}
|
||||
}, function(response) {
|
||||
$scope.saveSettingsLabel = "success";
|
||||
$timeout(function() {
|
||||
$scope.saveSettingsLabel = "default";
|
||||
}, 2000);
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
$scope.togglemdk3OnBoot = (function() {
|
||||
if($scope.bootLabelON == "default")
|
||||
{
|
||||
$scope.togglemdk3OnBoot = (function() {
|
||||
if ($scope.bootLabelON == "default") {
|
||||
$scope.bootLabelON = "success";
|
||||
$scope.bootLabelOFF = "default";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.bootLabelON = "default";
|
||||
$scope.bootLabelOFF = "danger";
|
||||
}
|
||||
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'togglemdk3OnBoot',
|
||||
}, function(response) {
|
||||
$scope.refreshStatus();
|
||||
})
|
||||
});
|
||||
module: 'Deauth',
|
||||
action: 'togglemdk3OnBoot',
|
||||
}, function(response) {
|
||||
$scope.refreshStatus();
|
||||
})
|
||||
});
|
||||
|
||||
$scope.handleDependencies = (function(param) {
|
||||
if(!$rootScope.status.installed)
|
||||
$scope.handleDependencies = (function(param) {
|
||||
if (!$rootScope.status.installed)
|
||||
$scope.install = "Installing...";
|
||||
else
|
||||
$scope.install = "Removing...";
|
||||
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'handleDependencies',
|
||||
destination: param
|
||||
}, function(response){
|
||||
if (response.success === true) {
|
||||
module: 'Deauth',
|
||||
action: 'handleDependencies',
|
||||
destination: param
|
||||
}, function(response) {
|
||||
if (response.success === true) {
|
||||
$scope.installLabel = "warning";
|
||||
$scope.processing = true;
|
||||
|
||||
$scope.handleDependenciesInterval = $interval(function(){
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'handleDependenciesStatus'
|
||||
}, function(response) {
|
||||
if (response.success === true){
|
||||
$scope.processing = false;
|
||||
$interval.cancel($scope.handleDependenciesInterval);
|
||||
$scope.refreshStatus();
|
||||
}
|
||||
});
|
||||
}, 5000);
|
||||
}
|
||||
});
|
||||
});
|
||||
$scope.handleDependenciesInterval = $interval(function() {
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'handleDependenciesStatus'
|
||||
}, function(response) {
|
||||
if (response.success === true) {
|
||||
$scope.processing = false;
|
||||
$interval.cancel($scope.handleDependenciesInterval);
|
||||
$scope.refreshStatus();
|
||||
}
|
||||
});
|
||||
}, 5000);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$scope.getInterfaces = (function() {
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'getInterfaces'
|
||||
}, function(response) {
|
||||
$scope.interfaces = response.interfaces;
|
||||
if(response.selected != "")
|
||||
$scope.selectedInterface = response.selected;
|
||||
else
|
||||
$scope.selectedInterface = $scope.interfaces[0];
|
||||
});
|
||||
});
|
||||
$scope.getInterfaces = (function() {
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'getInterfaces'
|
||||
}, function(response) {
|
||||
$scope.interfaces = response.interfaces;
|
||||
if (response.selected != "")
|
||||
$scope.selectedInterface = response.selected;
|
||||
else
|
||||
$scope.selectedInterface = $scope.interfaces[0];
|
||||
});
|
||||
});
|
||||
|
||||
$scope.refreshStatus();
|
||||
$scope.getInterfaces();
|
||||
$scope.refreshStatus();
|
||||
$scope.getInterfaces();
|
||||
|
||||
}]);
|
||||
|
||||
registerController('Deauth_OutputController', ['$api', '$scope', '$rootScope', '$interval', function($api, $scope, $rootScope, $interval) {
|
||||
$scope.output = 'Loading...';
|
||||
$scope.output = 'Loading...';
|
||||
$scope.filter = '';
|
||||
|
||||
$scope.refreshLabelON = "default";
|
||||
$scope.refreshLabelOFF = "danger";
|
||||
|
||||
$scope.refreshOutput = (function() {
|
||||
$scope.refreshOutput = (function() {
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: "refreshOutput"
|
||||
}, function(response) {
|
||||
$scope.output = response;
|
||||
})
|
||||
});
|
||||
module: 'Deauth',
|
||||
action: "refreshOutput"
|
||||
}, function(response) {
|
||||
$scope.output = response;
|
||||
})
|
||||
});
|
||||
|
||||
$scope.toggleAutoRefresh = (function() {
|
||||
if($scope.autoRefreshInterval)
|
||||
{
|
||||
$scope.toggleAutoRefresh = (function() {
|
||||
if ($scope.autoRefreshInterval) {
|
||||
$interval.cancel($scope.autoRefreshInterval);
|
||||
$scope.autoRefreshInterval = null;
|
||||
$scope.refreshLabelON = "default";
|
||||
$scope.refreshLabelOFF = "danger";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.refreshLabelON = "success";
|
||||
$scope.refreshLabelOFF = "default";
|
||||
|
||||
$scope.autoRefreshInterval = $interval(function(){
|
||||
$scope.autoRefreshInterval = $interval(function() {
|
||||
$scope.refreshOutput();
|
||||
}, 5000);
|
||||
}, 5000);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$scope.refreshOutput();
|
||||
$scope.refreshOutput();
|
||||
|
||||
$rootScope.$watch('status.refreshOutput', function(param) {
|
||||
if(param) {
|
||||
$scope.refreshOutput();
|
||||
}
|
||||
});
|
||||
$rootScope.$watch('status.refreshOutput', function(param) {
|
||||
if (param) {
|
||||
$scope.refreshOutput();
|
||||
}
|
||||
});
|
||||
|
||||
}]);
|
||||
|
||||
@@ -260,116 +256,116 @@ registerController('Deauth_EditorController', ['$api', '$scope', '$rootScope', '
|
||||
blacklistData: $scope.blacklistData,
|
||||
whitelistData: $scope.whitelistData
|
||||
}, function(response) {
|
||||
$scope.saveListsLabel = "success";
|
||||
$scope.saveLists = "Saved";
|
||||
$scope.saveListsLabel = "success";
|
||||
$scope.saveLists = "Saved";
|
||||
|
||||
$timeout(function(){
|
||||
$scope.saveListsLabel = "primary";
|
||||
$scope.saveLists = "Save";
|
||||
$scope.saving = false;
|
||||
}, 2000);
|
||||
$timeout(function() {
|
||||
$scope.saveListsLabel = "primary";
|
||||
$scope.saveLists = "Save";
|
||||
$scope.saving = false;
|
||||
}, 2000);
|
||||
});
|
||||
});
|
||||
|
||||
$scope.addWhitelist = (function() {
|
||||
if($scope.whitelistData != "")
|
||||
if ($scope.whitelistData != "")
|
||||
$scope.whitelistData = $scope.whitelistData + '\n' + '# ' + $scope.selectedAP.ssid + '\n' + $scope.selectedAP.mac;
|
||||
else
|
||||
$scope.whitelistData = '# ' + $scope.selectedAP.ssid + '\n' + $scope.selectedAP.mac;
|
||||
});
|
||||
|
||||
$scope.addBlacklist = (function() {
|
||||
if($scope.blacklistData != "")
|
||||
if ($scope.blacklistData != "")
|
||||
$scope.blacklistData = $scope.blacklistData + '\n' + '# ' + $scope.selectedAP.ssid + '\n' + $scope.selectedAP.mac;
|
||||
else
|
||||
$scope.blacklistData = '# ' + $scope.selectedAP.ssid + '\n' + $scope.selectedAP.mac;
|
||||
});
|
||||
|
||||
$scope.scanForNetworks = (function() {
|
||||
$scope.scanLabel = "warning";
|
||||
$scope.scan = "Scanning...";
|
||||
$scope.scanning = true;
|
||||
$scope.scanLabel = "warning";
|
||||
$scope.scan = "Scanning...";
|
||||
$scope.scanning = true;
|
||||
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'scanForNetworks',
|
||||
interface: $scope.selectedInterface
|
||||
}, function(response) {
|
||||
$scope.scanLabel = "success";
|
||||
$scope.scan = "Done";
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'scanForNetworks',
|
||||
interface: $scope.selectedInterface
|
||||
}, function(response) {
|
||||
$scope.scanLabel = "success";
|
||||
$scope.scan = "Done";
|
||||
|
||||
$timeout(function(){
|
||||
$scope.scanLabel = "default";
|
||||
$scope.scan = "Scan";
|
||||
$scope.scanning = false;
|
||||
}, 2000);
|
||||
$timeout(function() {
|
||||
$scope.scanLabel = "default";
|
||||
$scope.scan = "Scan";
|
||||
$scope.scanning = false;
|
||||
}, 2000);
|
||||
|
||||
$scope.accessPoints = response;
|
||||
$scope.selectedAP = $scope.accessPoints[0];
|
||||
});
|
||||
$scope.accessPoints = response;
|
||||
$scope.selectedAP = $scope.accessPoints[0];
|
||||
});
|
||||
});
|
||||
|
||||
$scope.getInterfaces = (function() {
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'getInterfaces'
|
||||
}, function(response) {
|
||||
$scope.interfaces = response.interfaces;
|
||||
if(response.selected != "")
|
||||
$scope.selectedInterface = response.selected;
|
||||
else
|
||||
$scope.selectedInterface = $scope.interfaces[0];
|
||||
});
|
||||
module: 'Deauth',
|
||||
action: 'getInterfaces'
|
||||
}, function(response) {
|
||||
$scope.interfaces = response.interfaces;
|
||||
if (response.selected != "")
|
||||
$scope.selectedInterface = response.selected;
|
||||
else
|
||||
$scope.selectedInterface = $scope.interfaces[0];
|
||||
});
|
||||
});
|
||||
|
||||
$scope.getInterfaces();
|
||||
$scope.getListsData();
|
||||
$scope.getInterfaces();
|
||||
$scope.getListsData();
|
||||
|
||||
}]);
|
||||
|
||||
registerController('Deauth_SettingsController', ['$api', '$scope', '$rootScope', '$timeout', function($api, $scope, $rootScope, $timeout) {
|
||||
$scope.settings = {
|
||||
speed : "",
|
||||
channels : "",
|
||||
mode : "whitelist"
|
||||
};
|
||||
$scope.settings = {
|
||||
speed: "",
|
||||
channels: "",
|
||||
mode: "whitelist"
|
||||
};
|
||||
|
||||
$scope.saveSettingsLabel = "primary";
|
||||
$scope.saveSettings = "Save";
|
||||
$scope.saving = false;
|
||||
$scope.saveSettingsLabel = "primary";
|
||||
$scope.saveSettings = "Save";
|
||||
$scope.saving = false;
|
||||
|
||||
$scope.getSettings = function() {
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'getSettings'
|
||||
}, function(response) {
|
||||
$scope.settings = response.settings;
|
||||
});
|
||||
};
|
||||
$scope.getSettings = function() {
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'getSettings'
|
||||
}, function(response) {
|
||||
$scope.settings = response.settings;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.setSettings = function() {
|
||||
$scope.saveSettingsLabel = "warning";
|
||||
$scope.saveSettings = "Saving...";
|
||||
$scope.saving = true;
|
||||
$scope.setSettings = function() {
|
||||
$scope.saveSettingsLabel = "warning";
|
||||
$scope.saveSettings = "Saving...";
|
||||
$scope.saving = true;
|
||||
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'setSettings',
|
||||
settings: $scope.settings
|
||||
}, function(response) {
|
||||
$scope.getSettings();
|
||||
$api.request({
|
||||
module: 'Deauth',
|
||||
action: 'setSettings',
|
||||
settings: $scope.settings
|
||||
}, function(response) {
|
||||
$scope.getSettings();
|
||||
|
||||
$scope.saveSettingsLabel = "success";
|
||||
$scope.saveSettings = "Saved";
|
||||
$scope.saveSettingsLabel = "success";
|
||||
$scope.saveSettings = "Saved";
|
||||
|
||||
$timeout(function(){
|
||||
$scope.saveSettingsLabel = "primary";
|
||||
$scope.saveSettings = "Save";
|
||||
$scope.saving = false;
|
||||
}, 2000);
|
||||
});
|
||||
};
|
||||
$timeout(function() {
|
||||
$scope.saveSettingsLabel = "primary";
|
||||
$scope.saveSettings = "Save";
|
||||
$scope.saving = false;
|
||||
}, 2000);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getSettings();
|
||||
$scope.getSettings();
|
||||
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user