mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 02:28:03 -07:00
Merge branch 'master' of github.com:serghey-rodin/vesta
This commit is contained in:
commit
bff632a2ad
38 changed files with 1641 additions and 1224 deletions
|
@ -54,6 +54,11 @@ App.Actions.update_cs_value = function(evt)
|
|||
var val = elm.find('.c-s-value').val();
|
||||
$('.complex-select-content').addClass('hidden');
|
||||
|
||||
if (val.toLowerCase() == 'nothing') {
|
||||
App.Actions.mass_nothing();
|
||||
return;
|
||||
}
|
||||
|
||||
if (App.Tmp[App.Env.world + '_selected_records'] > 0) {
|
||||
var confirm_message_key = App.Tmp[App.Env.world + '_selected_records'] == 1 ? 1 + ' record' : App.Tmp[App.Env.world + '_selected_records'] + ' records';
|
||||
var confirmed = confirm('This action will ' + val.toLowerCase() + ' ' + confirm_message_key + '. Do you want to proceede?');
|
||||
|
@ -83,6 +88,11 @@ App.Actions.mass_unsuspend = function()
|
|||
App.Actions.reset_batch();
|
||||
}
|
||||
|
||||
App.Actions.mass_nothing = function()
|
||||
{
|
||||
$('.complex-select-content').addClass('hidden');
|
||||
}
|
||||
|
||||
App.Actions.mass_action = function(method_name)
|
||||
{
|
||||
var rows = $('.checked-row');
|
||||
|
@ -561,7 +571,7 @@ App.Actions.add_form_ns = function(evt)
|
|||
|
||||
var tpl = App.Templates.get('NS_INPUT', 'user');
|
||||
tpl.set(':NAME', '');
|
||||
tpl.set(':NS_LABEL', 'NS');
|
||||
tpl.set(':NS_LABEL', 'Name Server');
|
||||
var ref = $(elm).hasClass('form-row') ? elm : $(elm).parents('.form-row');
|
||||
$(ref).before(tpl.finalize());
|
||||
|
||||
|
@ -571,7 +581,7 @@ App.Actions.add_form_ns = function(evt)
|
|||
|
||||
$(form).find('.ns-entry').each(function(i, o)
|
||||
{
|
||||
$(o).find('label').text('NS #' + (i + 1));
|
||||
$(o).find('label').text('Name Server #' + (i + 1));
|
||||
$(o).find('input').attr('name', 'NS' + (i + 1));
|
||||
});
|
||||
}
|
||||
|
@ -587,7 +597,7 @@ App.Actions.delete_ns = function(evt)
|
|||
form = elm.parents('.form:first');
|
||||
var total_nses = $(form).find('.ns-entry').length;
|
||||
if (total_nses == App.Settings.NS_MIN) {
|
||||
return App.Helpers.alert('Minimum number of NS is ' + App.Settings.NS_MIN);
|
||||
return App.Helpers.alert('Minimum number of Name Servers is ' + App.Settings.NS_MIN);
|
||||
}
|
||||
|
||||
var form = elm.parents('.form:first');
|
||||
|
@ -596,7 +606,7 @@ App.Actions.delete_ns = function(evt)
|
|||
|
||||
$(form).find('.ns-entry').each(function(i, o)
|
||||
{
|
||||
$(o).find('label').text('NS #' + (i + 1));
|
||||
$(o).find('label').text('Name Server #' + (i + 1));
|
||||
$(o).find('input').attr('name', 'NS' + (i + 1));
|
||||
});
|
||||
}
|
||||
|
@ -604,7 +614,7 @@ App.Actions.delete_ns = function(evt)
|
|||
App.Actions.view_full_ns_list = function(evt)
|
||||
{
|
||||
var elm = $(evt.target);
|
||||
App.Helpers.openInnerPopup(elm, $(elm).parents('.prop-box').find('.ns-full-list:first').html(), 'NS list');
|
||||
App.Helpers.openInnerPopup(elm, $(elm).parents('.prop-box').find('.ns-full-list:first').html(), 'Name Server list');
|
||||
}
|
||||
|
||||
App.Actions.view_template_info = function(evt)
|
||||
|
|
|
@ -29,9 +29,11 @@ App.HTML.Build.dns_form = function (options, id) {
|
|||
if (App.Helpers.isEmpty(options)) {
|
||||
tpl.set(':title', 'New dns domain');
|
||||
tpl.set(':save_button', 'ADD');
|
||||
tpl.set(':DELETE_ACTION', '');
|
||||
} else {
|
||||
tpl.set(':title', 'Edit dns domain');
|
||||
tpl.set(':save_button', 'SAVE');
|
||||
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
|
||||
}
|
||||
tpl.set(':id', id || '');
|
||||
tpl.set(':DNS_DOMAIN', options.DNS_DOMAIN || '');
|
||||
|
@ -55,9 +57,11 @@ App.HTML.Build.ip_form = function (options, id) {
|
|||
if (App.Helpers.isEmpty(options)) {
|
||||
tpl.set(':title', 'New ip address');
|
||||
tpl.set(':save_button', 'ADD');
|
||||
tpl.set(':DELETE_ACTION', '');
|
||||
} else {
|
||||
tpl.set(':title', 'Edit ip address');
|
||||
tpl.set(':save_button', 'SAVE');
|
||||
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
|
||||
}
|
||||
tpl.set(':id', id || '');
|
||||
tpl.set(':IP_ADDRESS', options.IP_ADDRESS || '');
|
||||
|
@ -84,9 +88,11 @@ App.HTML.Build.user_form = function (options, id) {
|
|||
if (App.Helpers.isEmpty(options)) {
|
||||
tpl.set(':title', 'New user');
|
||||
tpl.set(':save_button', 'ADD');
|
||||
tpl.set(':DELETE_ACTION', '');
|
||||
} else {
|
||||
tpl.set(':title', 'Edit user');
|
||||
tpl.set(':save_button', 'SAVE');
|
||||
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
|
||||
}
|
||||
options = !App.Helpers.isEmpty(options) ? options : App.Empty.USER;
|
||||
if (in_edit == true) {
|
||||
|
@ -95,7 +101,7 @@ App.HTML.Build.user_form = function (options, id) {
|
|||
$([3, 4, 5, 6, 7, 8]).each(function (i, index) {
|
||||
if (options['NS' + index].trim() != '') {
|
||||
var tpl_ns = App.Templates.get('NS_INPUT', 'user');
|
||||
tpl_ns.set(':NS_LABEL', 'NS #' + (index));
|
||||
tpl_ns.set(':NS_LABEL', 'Name Server #' + (index));
|
||||
tpl_ns.set(':NAME', options['NS' + index]);
|
||||
ns[ns.length++] = tpl_ns.finalize();
|
||||
}
|
||||
|
@ -135,9 +141,11 @@ App.HTML.Build.web_domain_form = function (options, id) {
|
|||
if (App.Helpers.isEmpty(options)) {
|
||||
tpl.set(':title', 'New WEB domain');
|
||||
tpl.set(':save_button', 'ADD');
|
||||
tpl.set(':DELETE_ACTION', '');
|
||||
} else {
|
||||
tpl.set(':title', 'Edit WEB domain');
|
||||
tpl.set(':save_button', 'SAVE');
|
||||
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
|
||||
}
|
||||
options = !App.Helpers.isEmpty(options) ? options : App.Empty.WEB_DOMAIN;
|
||||
if (in_edit == true) {
|
||||
|
@ -180,9 +188,11 @@ App.HTML.Build.db_form = function (options, id) {
|
|||
if (App.Helpers.isEmpty(options)) {
|
||||
tpl.set(':title', 'New database');
|
||||
tpl.set(':save_button', 'ADD');
|
||||
tpl.set(':DELETE_ACTION', '');
|
||||
} else {
|
||||
tpl.set(':title', 'Edit database "' + options.DB + '"');
|
||||
tpl.set(':save_button', 'SAVE');
|
||||
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
|
||||
}
|
||||
options = !App.Helpers.isEmpty(options) ? options : App.Empty.DB;
|
||||
if (in_edit == true) {
|
||||
|
@ -206,9 +216,11 @@ App.HTML.Build.cron_form = function (options, id) {
|
|||
if (App.Helpers.isEmpty(options)) {
|
||||
tpl.set(':title', 'New cron job');
|
||||
tpl.set(':save_button', 'ADD');
|
||||
tpl.set(':DELETE_ACTION', '');
|
||||
} else {
|
||||
tpl.set(':title', 'Edit cron job');
|
||||
tpl.set(':save_button', 'SAVE');
|
||||
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
|
||||
}
|
||||
options = !App.Helpers.isEmpty(options) ? options : {
|
||||
DAY: '',
|
||||
|
|
|
@ -1,10 +1,17 @@
|
|||
App.Pages.init = function()
|
||||
{
|
||||
if ('undefined' == typeof App.Env.initialParams) {
|
||||
if ('undefined' == typeof App.Env.initialParams) { // first run
|
||||
App.Ajax.request('MAIN.getInitial', {}, function(reply) {
|
||||
App.Env.initialParams = reply.data;
|
||||
App.Helpers.updateInitial();
|
||||
});
|
||||
if (!App.Env.initialParams.auth_user.admin) {
|
||||
var head= document.getElementsByTagName('head')[0];
|
||||
var script= document.createElement('script');
|
||||
script.type= 'text/javascript';
|
||||
script.src= App.Helpers.generateUrl('js/user_templates.js?'+Math.random());
|
||||
head.appendChild(script);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
App.Pages.prepareHTML();
|
||||
|
@ -18,6 +25,7 @@ App.Pages.init = function()
|
|||
|
||||
App.Pages.prepareHTML = function()
|
||||
{
|
||||
App.Actions.reset_batch();
|
||||
$('#actions-toolbar .stats-subbar').remove();
|
||||
$('#actions-toolbar .do_action_new_entry').removeClass('hidden');
|
||||
$('.active').removeClass('active');
|
||||
|
|
2332
web/js/templates.js
2332
web/js/templates.js
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue