-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rescue mode, usage update functionality
- Loading branch information
Ivan Gavryliuk
committed
Feb 26, 2018
1 parent
3c014b3
commit 75fea0b
Showing
15 changed files
with
561 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.0.9-4 | ||
4.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
$(function () { | ||
window.solusvmpro_rescuemode = function (vserverid, lang, token, area) { | ||
token = typeof token !== 'undefined' ? token : ""; | ||
if (typeof vserverid === 'undefined') { | ||
return false; | ||
} | ||
|
||
$('.changerescuemode').on('click', function () { | ||
var button = $(this); | ||
var rescueAction = 'rescueenable'; | ||
var rescueValue = $('#rescueImage').val(); | ||
|
||
if(typeof rescueValue === "undefined"){ | ||
rescueValue = true; | ||
rescueAction = 'rescuedisable'; | ||
} | ||
|
||
var msgSuccess = $('#rescuemodeMsgSuccess'); | ||
var msgError = $('#rescuemodedMsgError'); | ||
msgSuccess.hide(); | ||
msgError.hide(); | ||
var showSuccessOrErrorMsg = function (success, msg) { | ||
msgSuccess.hide(); | ||
msgError.hide(); | ||
if (success) { | ||
msgSuccess.html(msg); | ||
msgSuccess.show(); | ||
} else { | ||
msgError.html(msg); | ||
msgError.show(); | ||
} | ||
}; | ||
|
||
button.html('<span class="glyphicon glyphicon-refresh spinning"></span> ' + lang['solusvmpro_processing']); | ||
button.prop('disabled', true); | ||
var ajaxData = { | ||
vserverid: vserverid, | ||
modop: 'custom', | ||
a: 'ChangeRescueMode', | ||
rescueAction: rescueAction, | ||
rescueValue: rescueValue, | ||
ajax: 1, | ||
ac: 'Custom_ChangeRescueMode' | ||
}; | ||
|
||
$.ajax({ | ||
url: document.location.href + token, | ||
data: ajaxData, | ||
cache: false, | ||
dataType: 'json'/*, | ||
timeout: 2000*/ | ||
}).done(function (data) { | ||
|
||
var dataMsg = ''; | ||
if (data.hasOwnProperty("msg")) { | ||
dataMsg = data.msg; | ||
} | ||
|
||
var dataSuccess = false; | ||
if (data.hasOwnProperty("success")) { | ||
dataSuccess = data.success; | ||
} | ||
|
||
showSuccessOrErrorMsg(dataSuccess, dataMsg); | ||
|
||
button.html(lang['solusvmpro_refresh']); | ||
if(area == 'admin'){ | ||
button.attr('onclick', 'loadcontrol();'); | ||
$('#solusvmpro_collapseSeven .btn').removeClass('changerescuemode'); | ||
}else{ | ||
button.attr('onclick', 'location.reload();'); | ||
$('#solusvmpro_collapseSeven .btn').removeClass('changerescuemode'); | ||
} | ||
button.prop('disabled', false); | ||
|
||
}).fail(function (jqXHR, textStatus) { | ||
//console.log(jqXHR); | ||
//console.log(textStatus); | ||
}); | ||
}); | ||
|
||
return true; | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.