mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
centralized execution ph2
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
/* Java script code to create database */
|
||||
app.controller('createDatabase', function($scope,$http) {
|
||||
app.controller('createDatabase', function ($scope, $http) {
|
||||
|
||||
$scope.createDatabaseLoading = true;
|
||||
$scope.dbDetails = true;
|
||||
@@ -14,103 +14,99 @@ app.controller('createDatabase', function($scope,$http) {
|
||||
$scope.generatedPasswordView = true;
|
||||
|
||||
|
||||
$scope.showDetailsBoxes = function(){
|
||||
$scope.showDetailsBoxes = function () {
|
||||
$scope.dbDetails = false;
|
||||
};
|
||||
|
||||
$scope.createDatabase = function(){
|
||||
$scope.createDatabase = function () {
|
||||
|
||||
$scope.createDatabaseLoading = false;
|
||||
$scope.createDatabaseLoading = false;
|
||||
$scope.dbDetails = false;
|
||||
$scope.databaseCreationFailed = true;
|
||||
$scope.databaseCreated = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
var databaseWebsite = $scope.databaseWebsite;
|
||||
var dbName = $scope.dbName;
|
||||
var dbUsername = $scope.dbUsername;
|
||||
var dbPassword = $scope.dbPassword;
|
||||
var webUserName = "";
|
||||
|
||||
// getting website username
|
||||
|
||||
webUserName = databaseWebsite.replace(/-/g, '');
|
||||
webUserName = webUserName.split(".")[0];
|
||||
|
||||
if (webUserName.length > 5) {
|
||||
webUserName = webUserName.substring(0, 4);
|
||||
}
|
||||
|
||||
var url = "/dataBases/submitDBCreation";
|
||||
|
||||
|
||||
var data = {
|
||||
webUserName: webUserName,
|
||||
databaseWebsite: databaseWebsite,
|
||||
dbName: dbName,
|
||||
dbUsername: dbUsername,
|
||||
dbPassword: dbPassword
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.createDBStatus == 1) {
|
||||
|
||||
$scope.createDatabaseLoading = true;
|
||||
$scope.dbDetails = false;
|
||||
$scope.databaseCreationFailed = true;
|
||||
$scope.databaseCreated = true;
|
||||
$scope.databaseCreated = false;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
var databaseWebsite = $scope.databaseWebsite;
|
||||
var dbName = $scope.dbName;
|
||||
var dbUsername = $scope.dbUsername;
|
||||
var dbPassword = $scope.dbPassword;
|
||||
var webUserName = "";
|
||||
}
|
||||
|
||||
// getting website username
|
||||
|
||||
webUserName = databaseWebsite.replace(/-/g, '');
|
||||
webUserName = webUserName.split(".")[0];
|
||||
|
||||
if(webUserName.length > 5){
|
||||
webUserName = webUserName.substring(0,4);
|
||||
}
|
||||
|
||||
var url = "/dataBases/submitDBCreation";
|
||||
else {
|
||||
|
||||
|
||||
var data = {
|
||||
webUserName:webUserName,
|
||||
databaseWebsite:databaseWebsite,
|
||||
dbName:dbName,
|
||||
dbUsername:dbUsername,
|
||||
dbPassword:dbPassword
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers : {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
$scope.createDatabaseLoading = true;
|
||||
$scope.dbDetails = false;
|
||||
$scope.databaseCreationFailed = false;
|
||||
$scope.databaseCreated = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
}
|
||||
|
||||
|
||||
if(response.data.createDBStatus == 1){
|
||||
|
||||
$scope.createDatabaseLoading = true;
|
||||
$scope.dbDetails = false;
|
||||
$scope.databaseCreationFailed = true;
|
||||
$scope.databaseCreated = false;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
$scope.createDatabaseLoading = true;
|
||||
$scope.dbDetails = false;
|
||||
$scope.databaseCreationFailed = false;
|
||||
$scope.databaseCreated = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.createDatabaseLoading = true;
|
||||
$scope.dbDetails = true;
|
||||
$scope.databaseCreationFailed = true;
|
||||
$scope.databaseCreated = true;
|
||||
$scope.couldNotConnect = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.createDatabaseLoading = true;
|
||||
$scope.dbDetails = true;
|
||||
$scope.databaseCreationFailed = true;
|
||||
$scope.databaseCreated = true;
|
||||
$scope.couldNotConnect = false;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
$scope.generatePassword = function () {
|
||||
$scope.generatedPasswordView = false;
|
||||
$scope.dbPassword = randomPassword(12);
|
||||
$scope.generatedPasswordView = false;
|
||||
$scope.dbPassword = randomPassword(12);
|
||||
};
|
||||
|
||||
$scope.usePassword = function () {
|
||||
@@ -122,7 +118,7 @@ app.controller('createDatabase', function($scope,$http) {
|
||||
|
||||
/* Java script code to delete database */
|
||||
|
||||
app.controller('deleteDatabase', function($scope,$http) {
|
||||
app.controller('deleteDatabase', function ($scope, $http) {
|
||||
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = true;
|
||||
@@ -131,153 +127,147 @@ app.controller('deleteDatabase', function($scope,$http) {
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
$scope.fetchDatabases = function(){
|
||||
$scope.fetchDatabases = function () {
|
||||
|
||||
$scope.deleteDatabaseLoading = false;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.deleteDatabaseLoading = false;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.databaseDeletionFailed = true;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
var databaseWebsite = $scope.databaseWebsite;
|
||||
|
||||
var url = "/dataBases/fetchDatabases";
|
||||
|
||||
|
||||
var data = {
|
||||
databaseWebsite: databaseWebsite,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.fetchStatus == 1) {
|
||||
|
||||
|
||||
$scope.dbnames = JSON.parse(response.data.data);
|
||||
|
||||
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = false;
|
||||
$scope.databaseDeletionFailed = true;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
var databaseWebsite = $scope.databaseWebsite;
|
||||
}
|
||||
|
||||
var url = "/dataBases/fetchDatabases";
|
||||
else {
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.databaseDeletionFailed = false;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
var data = {
|
||||
databaseWebsite:databaseWebsite,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers : {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
}
|
||||
|
||||
|
||||
if(response.data.fetchStatus == 1){
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.databaseDeletionFailed = true;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = false;
|
||||
|
||||
|
||||
$scope.dbnames = JSON.parse(response.data.data);
|
||||
|
||||
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = false;
|
||||
$scope.databaseDeletionFailed = true;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.databaseDeletionFailed = false;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.databaseDeletionFailed = true;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.deleteDatabase = function(){
|
||||
$scope.deleteDatabase = function () {
|
||||
|
||||
$scope.deleteDatabaseLoading = false;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.deleteDatabaseLoading = false;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.databaseDeletionFailed = true;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
var databaseWebsite = $scope.databaseWebsite;
|
||||
|
||||
var url = "/dataBases/submitDatabaseDeletion";
|
||||
|
||||
|
||||
var data = {
|
||||
dbName: $scope.selectedDB,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.deleteStatus == 1) {
|
||||
|
||||
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = false;
|
||||
$scope.databaseDeletionFailed = true;
|
||||
$scope.databaseDeleted = false;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.databaseDeletionFailed = false;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
var databaseWebsite = $scope.databaseWebsite;
|
||||
|
||||
var url = "/dataBases/submitDatabaseDeletion";
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
|
||||
var data = {
|
||||
dbName:$scope.selectedDB,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers : {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
}
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.databaseDeletionFailed = true;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = false;
|
||||
|
||||
|
||||
if(response.data.deleteStatus == 1){
|
||||
|
||||
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = false;
|
||||
$scope.databaseDeletionFailed = true;
|
||||
$scope.databaseDeleted = false;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.databaseDeletionFailed = false;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.deleteDatabaseLoading = true;
|
||||
$scope.fetchedDatabases = true;
|
||||
$scope.databaseDeletionFailed = true;
|
||||
$scope.databaseDeleted = true;
|
||||
$scope.couldNotConnect = false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -289,7 +279,7 @@ app.controller('deleteDatabase', function($scope,$http) {
|
||||
/* Java script code to list databases */
|
||||
|
||||
|
||||
app.controller('listDBs', function($scope,$http) {
|
||||
app.controller('listDBs', function ($scope, $http) {
|
||||
|
||||
$scope.recordsFetched = true;
|
||||
$scope.passwordChanged = true;
|
||||
@@ -303,161 +293,161 @@ app.controller('listDBs', function($scope,$http) {
|
||||
var globalDBUsername = "";
|
||||
|
||||
$scope.fetchDBs = function () {
|
||||
populateCurrentRecords();
|
||||
populateCurrentRecords();
|
||||
};
|
||||
|
||||
$scope.changePassword = function (dbUsername) {
|
||||
$scope.recordsFetched = true;
|
||||
$scope.passwordChanged = true;
|
||||
$scope.canNotChangePassword = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.dbLoading = true;
|
||||
$scope.dbAccounts = false;
|
||||
$scope.changePasswordBox = false;
|
||||
$scope.notificationsBox = true;
|
||||
$scope.dbUsername = dbUsername;
|
||||
$scope.recordsFetched = true;
|
||||
$scope.passwordChanged = true;
|
||||
$scope.canNotChangePassword = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.dbLoading = true;
|
||||
$scope.dbAccounts = false;
|
||||
$scope.changePasswordBox = false;
|
||||
$scope.notificationsBox = true;
|
||||
$scope.dbUsername = dbUsername;
|
||||
|
||||
|
||||
globalDBUsername = dbUsername;
|
||||
globalDBUsername = dbUsername;
|
||||
|
||||
};
|
||||
|
||||
$scope.changePasswordBtn = function () {
|
||||
|
||||
$scope.dbLoading = false;
|
||||
$scope.passwordChanged = true;
|
||||
$scope.dbLoading = false;
|
||||
$scope.passwordChanged = true;
|
||||
|
||||
|
||||
url = "/dataBases/changePassword";
|
||||
url = "/dataBases/changePassword";
|
||||
|
||||
var data = {
|
||||
dbUserName:globalDBUsername,
|
||||
dbPassword: $scope.dbPassword,
|
||||
};
|
||||
var data = {
|
||||
dbUserName: globalDBUsername,
|
||||
dbPassword: $scope.dbPassword,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers : {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if(response.data.changePasswordStatus == 1){
|
||||
$scope.notificationsBox = false;
|
||||
$scope.passwordChanged = false;
|
||||
$scope.dbLoading = true;
|
||||
$scope.domainFeteched = $scope.selectedDomain;
|
||||
if (response.data.changePasswordStatus == 1) {
|
||||
$scope.notificationsBox = false;
|
||||
$scope.passwordChanged = false;
|
||||
$scope.dbLoading = true;
|
||||
$scope.domainFeteched = $scope.selectedDomain;
|
||||
|
||||
}
|
||||
else{
|
||||
$scope.notificationsBox = false;
|
||||
$scope.canNotChangePassword = false;
|
||||
$scope.dbLoading = true;
|
||||
$scope.canNotChangePassword = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$scope.notificationsBox = false;
|
||||
$scope.canNotChangePassword = false;
|
||||
$scope.dbLoading = true;
|
||||
$scope.canNotChangePassword = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
}
|
||||
|
||||
}
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.notificationsBox = false;
|
||||
$scope.couldNotConnect = false;
|
||||
$scope.dbLoading = true;
|
||||
}
|
||||
|
||||
}
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.notificationsBox = false;
|
||||
$scope.couldNotConnect = false;
|
||||
$scope.dbLoading = true;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
function populateCurrentRecords(){
|
||||
$scope.recordsFetched = true;
|
||||
$scope.passwordChanged = true;
|
||||
$scope.canNotChangePassword = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.dbLoading = false;
|
||||
$scope.dbAccounts = true;
|
||||
$scope.changePasswordBox = true;
|
||||
$scope.notificationsBox = true;
|
||||
};
|
||||
|
||||
var selectedDomain = $scope.selectedDomain;
|
||||
function populateCurrentRecords() {
|
||||
$scope.recordsFetched = true;
|
||||
$scope.passwordChanged = true;
|
||||
$scope.canNotChangePassword = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.dbLoading = false;
|
||||
$scope.dbAccounts = true;
|
||||
$scope.changePasswordBox = true;
|
||||
$scope.notificationsBox = true;
|
||||
|
||||
url = "/dataBases/fetchDatabases";
|
||||
var selectedDomain = $scope.selectedDomain;
|
||||
|
||||
var data = {
|
||||
databaseWebsite:selectedDomain,
|
||||
};
|
||||
url = "/dataBases/fetchDatabases";
|
||||
|
||||
var config = {
|
||||
headers : {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
var data = {
|
||||
databaseWebsite: selectedDomain,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if(response.data.fetchStatus == 1){
|
||||
if (response.data.fetchStatus == 1) {
|
||||
|
||||
$scope.records = JSON.parse(response.data.data);
|
||||
$scope.records = JSON.parse(response.data.data);
|
||||
|
||||
|
||||
$scope.recordsFetched = false;
|
||||
$scope.passwordChanged = true;
|
||||
$scope.canNotChangePassword = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.dbLoading = true;
|
||||
$scope.dbAccounts = false;
|
||||
$scope.changePasswordBox = true;
|
||||
$scope.notificationsBox = false;
|
||||
$scope.recordsFetched = false;
|
||||
$scope.passwordChanged = true;
|
||||
$scope.canNotChangePassword = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.dbLoading = true;
|
||||
$scope.dbAccounts = false;
|
||||
$scope.changePasswordBox = true;
|
||||
$scope.notificationsBox = false;
|
||||
|
||||
$scope.domainFeteched = $scope.selectedDomain;
|
||||
$scope.domainFeteched = $scope.selectedDomain;
|
||||
|
||||
}
|
||||
else{
|
||||
$scope.recordsFetched = true;
|
||||
$scope.passwordChanged = true;
|
||||
$scope.canNotChangePassword = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.dbLoading = true;
|
||||
$scope.dbAccounts = true;
|
||||
$scope.changePasswordBox = true;
|
||||
$scope.notificationsBox = true;
|
||||
}
|
||||
else {
|
||||
$scope.recordsFetched = true;
|
||||
$scope.passwordChanged = true;
|
||||
$scope.canNotChangePassword = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.dbLoading = true;
|
||||
$scope.dbAccounts = true;
|
||||
$scope.changePasswordBox = true;
|
||||
$scope.notificationsBox = true;
|
||||
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
}
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
}
|
||||
|
||||
}
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.recordsFetched = true;
|
||||
$scope.passwordChanged = true;
|
||||
$scope.canNotChangePassword = true;
|
||||
$scope.couldNotConnect = false;
|
||||
$scope.dbLoading = true;
|
||||
$scope.dbAccounts = true;
|
||||
$scope.changePasswordBox = true;
|
||||
$scope.notificationsBox = true;
|
||||
}
|
||||
|
||||
}
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.recordsFetched = true;
|
||||
$scope.passwordChanged = true;
|
||||
$scope.canNotChangePassword = true;
|
||||
$scope.couldNotConnect = false;
|
||||
$scope.dbLoading = true;
|
||||
$scope.dbAccounts = true;
|
||||
$scope.changePasswordBox = true;
|
||||
$scope.notificationsBox = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
////
|
||||
|
||||
$scope.generatedPasswordView = true;
|
||||
|
||||
$scope.generatePassword = function () {
|
||||
$scope.generatedPasswordView = false;
|
||||
$scope.dbPassword = randomPassword(12);
|
||||
$scope.generatedPasswordView = false;
|
||||
$scope.dbPassword = randomPassword(12);
|
||||
};
|
||||
|
||||
$scope.usePassword = function () {
|
||||
@@ -467,4 +457,40 @@ app.controller('listDBs', function($scope,$http) {
|
||||
});
|
||||
|
||||
|
||||
/* Java script code to list database ends here */
|
||||
/* Java script code to list database ends here */
|
||||
|
||||
|
||||
app.controller('phpMyAdmin', function ($scope, $http, $window) {
|
||||
|
||||
function setupPHPMYAdminSession() {
|
||||
|
||||
url = "/dataBases/setupPHPMYAdminSession";
|
||||
|
||||
var data = {};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if (response.data.status === 1) {
|
||||
$window.location.href = '/phpmyadmin';
|
||||
}
|
||||
else {}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {}
|
||||
|
||||
}
|
||||
setupPHPMYAdminSession();
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user