mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-07-07 05:21:48 -07:00
Service config feature
This commit is contained in:
parent
9873dfacd0
commit
b89f602f7b
47 changed files with 3499 additions and 2 deletions
41
web/js/pages/edit_server_mysql.js
Normal file
41
web/js/pages/edit_server_mysql.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
function toggleOptions(){
|
||||
if($('#advanced-options').is(':visible')){
|
||||
$.removeCookie('advanced');
|
||||
$('#advanced-options').hide();
|
||||
$('#basic-options').show();
|
||||
} else {
|
||||
$.cookie('advanced', 1);
|
||||
$('#advanced-options').show();
|
||||
$('#basic-options').hide();
|
||||
|
||||
var advance_options = $('#advanced-options textarea');
|
||||
|
||||
$('#vstobjects input[type=text]').each(function(i, elm){
|
||||
var search = $(elm).attr('regexp');
|
||||
var prev_value = $(elm).attr('prev_value');
|
||||
$(elm).attr('prev_value', $(elm).val());
|
||||
var regexp = new RegExp('^('+search+')(.+)('+prev_value+')', 'm');
|
||||
advance_options.val(advance_options.val().replace(regexp, '$1$2' + $(elm).val()));
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
$('#vstobjects').submit(function(){
|
||||
if($('#basic-options').is(':visible')){
|
||||
var advance_options = $('#advanced-options textarea');
|
||||
|
||||
$('#vstobjects input[type=text]').each(function(i, elm){
|
||||
var search = $(elm).attr('regexp');
|
||||
var prev_value = $(elm).attr('prev_value');
|
||||
$(elm).attr('prev_value', $(elm).val());
|
||||
var regexp = new RegExp('^('+search+')(.+)('+prev_value+')', 'm');
|
||||
advance_options.val(advance_options.val().replace(regexp, '$1$2' + $(elm).val()));
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
if($.cookie('advanced')){
|
||||
toggleOptions();
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue