Flatta and Diman fixes

This commit is contained in:
Serghey Rodin 2016-07-06 13:53:03 +03:00
commit 3bed87ba15
98 changed files with 5260 additions and 3031 deletions

16
web/js/pages/add_cron.js Normal file
View file

@ -0,0 +1,16 @@
$(document).ready(function(){
$( "#tabs" ).tabs();
$('.context-helper').click(function(){ $('#tabs').toggle(); $('.context-helper').toggle(); });
$('.context-helper-close').click(function(){ $('#tabs').toggle(); $('.context-helper').toggle(); });
$('.helper-container form').submit(function(){
$('#vstobjects input[name=v_min]').val($(this).find(':input[name=h_min]').val()).effect('highlight');
$('#vstobjects input[name=v_hour]').val($(this).find(':input[name=h_hour]').val()).effect('highlight');
$('#vstobjects input[name=v_day]').val($(this).find(':input[name=h_day]').val()).effect('highlight');
$('#vstobjects input[name=v_month]').val($(this).find(':input[name=h_month]').val()).effect('highlight');
$('#vstobjects input[name=v_wday]').val($(this).find(':input[name=h_wday]').val()).effect('highlight');
return false;
});
})

View file

@ -68,3 +68,14 @@ App.Listeners.DB.keypress_db_databasename = function() {
// Trigger listeners
App.Listeners.DB.keypress_db_username();
App.Listeners.DB.keypress_db_databasename();
randomString = function() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_add_db.v_password.value = randomstring;
}

27
web/js/pages/add_dns.js Normal file
View file

@ -0,0 +1,27 @@
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $('input[name^=v_ns]').length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
})
$('.add-ns').show()
});
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
});

View file

@ -77,3 +77,41 @@ $('form[name="v_quota"]').bind('submit', function(evt) {
});
randomString = function() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_add_mail_acc.v_password.value = randomstring;
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text(randomstring);
else
$('#v_password').text(Array(randomstring.length+1).join('*'));
}
$(document).ready(function() {
$('#v_account').text($('input[name=v_account]').val());
$('#v_password').text($('input[name=v_password]').val());
$('input[name=v_account]').change(function(){
$('#v_account').text($(this).val());
});
$('input[name=v_password]').change(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($(this).val());
else
$('#v_password').text(Array($(this).val().length+1).join('*'));
});
$('.toggle-psw-visibility-icon').click(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($('input[name=v_password]').val());
else
$('#v_password').text(Array($('input[name=v_password]').val().length+1).join('*'));
});
});

View file

@ -77,3 +77,30 @@ $('form[name="v_add_package"]').bind('submit', function(evt) {
});
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $('input[name^=v_ns]').length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
$('.add-ns').show();
});
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
});

17
web/js/pages/add_user.js Normal file
View file

@ -0,0 +1,17 @@
$(function() {
$('#v_email').change(function() {
document.getElementById('v_notify').value = document.getElementById('v_email').value;
});
});
randomString = function() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_add_user.v_password.value = randomstring;
}

View file

@ -156,3 +156,39 @@ App.Actions.WEB.toggle_additional_ftp_accounts = function(elm) {
App.Listeners.WEB.keypress_ftp_username();
App.Listeners.WEB.keypress_ftp_path();
App.Listeners.WEB.keypress_domain_name();
$(function() {
$('#v_domain').change(function() {
var prefix = 'www.';
document.getElementById('v_aliases').value = prefix + document.getElementById('v_domain').value;
});
});
function WEBrandom() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var webrandom = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substr(rnum, 1);
}
document.v_add_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var ftprandomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substr(rnum, 1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
}
$('#vstobjects').bind('submit', function(evt) {
$('input[disabled]').each(function(i, elm) {
$(elm).removeAttr('disabled');
});
});

16
web/js/pages/edit_cron.js Normal file
View file

@ -0,0 +1,16 @@
$(document).ready(function(){
$( "#tabs" ).tabs();
$('.context-helper').click(function(){ $('#tabs').toggle(); $('.context-helper').toggle(); });
$('.context-helper-close').click(function(){ $('#tabs').toggle(); $('.context-helper').toggle(); });
$('.helper-container form').submit(function(){
$('#vstobjects input[name=v_min]').val($(this).find(':input[name=h_min]').val()).effect('highlight');
$('#vstobjects input[name=v_hour]').val($(this).find(':input[name=h_hour]').val()).effect('highlight');
$('#vstobjects input[name=v_day]').val($(this).find(':input[name=h_day]').val()).effect('highlight');
$('#vstobjects input[name=v_month]').val($(this).find(':input[name=h_month]').val()).effect('highlight');
$('#vstobjects input[name=v_wday]').val($(this).find(':input[name=h_wday]').val()).effect('highlight');
return false;
});
})

View file

@ -68,3 +68,15 @@ App.Listeners.DB.keypress_db_databasename = function() {
// Trigger listeners
App.Listeners.DB.keypress_db_username();
App.Listeners.DB.keypress_db_databasename();
randomString = function() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_edit_db.v_password.value = randomstring;
}

View file

@ -77,3 +77,36 @@ $('form[name="v_quota"]').bind('submit', function(evt) {
});
randomString = function() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_edit_mail_acc.v_password.value = randomstring;
}
$(document).ready(function() {
$('#v_account').text($('input[name=v_account]').val());
$('#v_password').text($('input[name=v_password]').val());
$('input[name=v_account]').change(function(){
$('#v_account').text($(this).val());
});
$('input[name=v_password]').change(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($(this).val());
else
$('#v_password').text(Array($(this).val().length+1).join('*'));
});
$('.toggle-psw-visibility-icon').click(function(){
if($('input[name=v_password]').attr('type') == 'text')
$('#v_password').text($('input[name=v_password]').val());
else
$('#v_password').text(Array($('input[name=v_password]').val().length+1).join('*'));
});
});

View file

@ -77,3 +77,30 @@ $('form[name="v_edit_package"]').bind('submit', function(evt) {
});
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $('input[name^=v_ns]').length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
$('.add-ns').show();
});
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
});

View file

@ -0,0 +1,17 @@
$(document).ready(function(){
$('select[name=v_filemanager]').change(function(){
if($(this).val() == 'yes'){
$('.filemanager.description').show();
} else {
$('.filemanager.description').hide();
}
});
$('select[name=v_sftp]').change(function(){
if($(this).val() == 'yes'){
$('.sftp.description').show();
} else {
$('.sftp.description').hide();
}
});
});

39
web/js/pages/edit_user.js Normal file
View file

@ -0,0 +1,39 @@
function randomString() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var randomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substr(rnum, 1);
}
document.v_edit_user.v_password.value = randomstring;
}
$(document).ready(function(){
$('.add-ns-button').click(function(){
var n = $('input[name^=v_ns]').length;
if(n < 8){
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
t.find('span').show();
$('tr.add-ns').before(t);
}
if( n == 7 ) {
$('.add-ns').hide();
}
});
$('.remove-ns').click(function(){
$(this).parents('tr')[0].remove();
$('input[name^=v_ns]').each(function(i, ns){
$(ns).attr({name: 'v_ns'+(i+1)});
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
$('.add-ns').show();
});
$('input[name^=v_ns]').each(function(i, ns){
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
});
});

View file

@ -163,3 +163,42 @@ $('.v-ftp-user-psw').on('keypress', function(evt) {
var elm = $(evt.target);
App.Actions.WEB.passwordChanged(elm);
});
function WEBrandom() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var webrandom = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substr(rnum, 1);
}
document.v_edit_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var ftprandomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substr(rnum, 1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
App.Actions.WEB.randomPasswordGenerated && App.Actions.WEB.randomPasswordGenerated(elm);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
$('#vstobjects').bind('submit', function(evt) {
$('input[disabled]').each(function(i, elm) {
var copy_elm = $(elm).clone(true);
$(copy_elm).attr('type', 'hidden');
$(copy_elm).removeAttr('disabled');
$(elm).after(copy_elm);
});
});