Skip to content

Commit dbe277b

Browse files
committed
Merge branch 'master' of github.com:serghey-rodin/vesta
2 parents 2b07689 + f2c1e0e commit dbe277b

File tree

9 files changed

+1385
-63
lines changed

9 files changed

+1385
-63
lines changed

web/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ <h1 class="logo"><a href="/">Vesta panel <span>&nbsp;</span></a></h1>
217217
<div id="batch-processor" class="b-row-selector">
218218
<div class="checkbox-selector cc">
219219
<input class="styled do_action_toggle_batch_selector" autocomplete="off" type="checkbox" value="" />
220-
<span class="selector-title">All</span>
220+
<span class="selector-title">None</span>
221221
</div>
222222
<div class="context-actions c-s-box">
223223
<div class="b-cust-sel complex-select c-s-opt">
@@ -226,6 +226,10 @@ <h1 class="logo"><a href="/">Vesta panel <span>&nbsp;</span></a></h1>
226226
<div class="cust-sel-arrow do_action_toggle_custom_select c-s-opt"><i class="do_action_toggle_custom_select">&nbsp;</i></div>
227227
<div class="cust-sel-options complex-select-content c-s-opt hidden">
228228
<div class="cust-sel-option ico_gray c-s-opt do_action_update_cs_value">
229+
<input type="hidden" class="c-s-value" value="Nothing">
230+
Nothing
231+
</div>
232+
<div class="cust-sel-option ico_gray c-s-opt do_action_update_cs_value">
229233
<input type="hidden" class="c-s-value" value="Suspend">
230234
Suspend
231235
</div>

web/js/actions.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ App.Actions.update_cs_value = function(evt)
5454
var val = elm.find('.c-s-value').val();
5555
$('.complex-select-content').addClass('hidden');
5656

57+
if (val.toLowerCase() == 'nothing') {
58+
App.Actions.mass_nothing();
59+
return;
60+
}
61+
5762
if (App.Tmp[App.Env.world + '_selected_records'] > 0) {
5863
var confirm_message_key = App.Tmp[App.Env.world + '_selected_records'] == 1 ? 1 + ' record' : App.Tmp[App.Env.world + '_selected_records'] + ' records';
5964
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()
8388
App.Actions.reset_batch();
8489
}
8590

91+
App.Actions.mass_nothing = function()
92+
{
93+
$('.complex-select-content').addClass('hidden');
94+
}
95+
8696
App.Actions.mass_action = function(method_name)
8797
{
8898
var rows = $('.checked-row');
@@ -561,7 +571,7 @@ App.Actions.add_form_ns = function(evt)
561571

562572
var tpl = App.Templates.get('NS_INPUT', 'user');
563573
tpl.set(':NAME', '');
564-
tpl.set(':NS_LABEL', 'NS');
574+
tpl.set(':NS_LABEL', 'Name Server');
565575
var ref = $(elm).hasClass('form-row') ? elm : $(elm).parents('.form-row');
566576
$(ref).before(tpl.finalize());
567577

@@ -571,7 +581,7 @@ App.Actions.add_form_ns = function(evt)
571581

572582
$(form).find('.ns-entry').each(function(i, o)
573583
{
574-
$(o).find('label').text('NS #' + (i + 1));
584+
$(o).find('label').text('Name Server #' + (i + 1));
575585
$(o).find('input').attr('name', 'NS' + (i + 1));
576586
});
577587
}
@@ -587,7 +597,7 @@ App.Actions.delete_ns = function(evt)
587597
form = elm.parents('.form:first');
588598
var total_nses = $(form).find('.ns-entry').length;
589599
if (total_nses == App.Settings.NS_MIN) {
590-
return App.Helpers.alert('Minimum number of NS is ' + App.Settings.NS_MIN);
600+
return App.Helpers.alert('Minimum number of Name Servers is ' + App.Settings.NS_MIN);
591601
}
592602

593603
var form = elm.parents('.form:first');
@@ -596,15 +606,15 @@ App.Actions.delete_ns = function(evt)
596606

597607
$(form).find('.ns-entry').each(function(i, o)
598608
{
599-
$(o).find('label').text('NS #' + (i + 1));
609+
$(o).find('label').text('Name Server #' + (i + 1));
600610
$(o).find('input').attr('name', 'NS' + (i + 1));
601611
});
602612
}
603613

604614
App.Actions.view_full_ns_list = function(evt)
605615
{
606616
var elm = $(evt.target);
607-
App.Helpers.openInnerPopup(elm, $(elm).parents('.prop-box').find('.ns-full-list:first').html(), 'NS list');
617+
App.Helpers.openInnerPopup(elm, $(elm).parents('.prop-box').find('.ns-full-list:first').html(), 'Name Server list');
608618
}
609619

610620
App.Actions.view_template_info = function(evt)

web/js/html.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ App.HTML.Build.dns_form = function (options, id) {
2929
if (App.Helpers.isEmpty(options)) {
3030
tpl.set(':title', 'New dns domain');
3131
tpl.set(':save_button', 'ADD');
32+
tpl.set(':DELETE_ACTION', '');
3233
} else {
3334
tpl.set(':title', 'Edit dns domain');
3435
tpl.set(':save_button', 'SAVE');
36+
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
3537
}
3638
tpl.set(':id', id || '');
3739
tpl.set(':DNS_DOMAIN', options.DNS_DOMAIN || '');
@@ -55,9 +57,11 @@ App.HTML.Build.ip_form = function (options, id) {
5557
if (App.Helpers.isEmpty(options)) {
5658
tpl.set(':title', 'New ip address');
5759
tpl.set(':save_button', 'ADD');
60+
tpl.set(':DELETE_ACTION', '');
5861
} else {
5962
tpl.set(':title', 'Edit ip address');
6063
tpl.set(':save_button', 'SAVE');
64+
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
6165
}
6266
tpl.set(':id', id || '');
6367
tpl.set(':IP_ADDRESS', options.IP_ADDRESS || '');
@@ -84,9 +88,11 @@ App.HTML.Build.user_form = function (options, id) {
8488
if (App.Helpers.isEmpty(options)) {
8589
tpl.set(':title', 'New user');
8690
tpl.set(':save_button', 'ADD');
91+
tpl.set(':DELETE_ACTION', '');
8792
} else {
8893
tpl.set(':title', 'Edit user');
8994
tpl.set(':save_button', 'SAVE');
95+
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
9096
}
9197
options = !App.Helpers.isEmpty(options) ? options : App.Empty.USER;
9298
if (in_edit == true) {
@@ -95,7 +101,7 @@ App.HTML.Build.user_form = function (options, id) {
95101
$([3, 4, 5, 6, 7, 8]).each(function (i, index) {
96102
if (options['NS' + index].trim() != '') {
97103
var tpl_ns = App.Templates.get('NS_INPUT', 'user');
98-
tpl_ns.set(':NS_LABEL', 'NS #' + (index));
104+
tpl_ns.set(':NS_LABEL', 'Name Server #' + (index));
99105
tpl_ns.set(':NAME', options['NS' + index]);
100106
ns[ns.length++] = tpl_ns.finalize();
101107
}
@@ -135,9 +141,11 @@ App.HTML.Build.web_domain_form = function (options, id) {
135141
if (App.Helpers.isEmpty(options)) {
136142
tpl.set(':title', 'New WEB domain');
137143
tpl.set(':save_button', 'ADD');
144+
tpl.set(':DELETE_ACTION', '');
138145
} else {
139146
tpl.set(':title', 'Edit WEB domain');
140147
tpl.set(':save_button', 'SAVE');
148+
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
141149
}
142150
options = !App.Helpers.isEmpty(options) ? options : App.Empty.WEB_DOMAIN;
143151
if (in_edit == true) {
@@ -180,9 +188,11 @@ App.HTML.Build.db_form = function (options, id) {
180188
if (App.Helpers.isEmpty(options)) {
181189
tpl.set(':title', 'New database');
182190
tpl.set(':save_button', 'ADD');
191+
tpl.set(':DELETE_ACTION', '');
183192
} else {
184193
tpl.set(':title', 'Edit database "' + options.DB + '"');
185194
tpl.set(':save_button', 'SAVE');
195+
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
186196
}
187197
options = !App.Helpers.isEmpty(options) ? options : App.Empty.DB;
188198
if (in_edit == true) {
@@ -206,9 +216,11 @@ App.HTML.Build.cron_form = function (options, id) {
206216
if (App.Helpers.isEmpty(options)) {
207217
tpl.set(':title', 'New cron job');
208218
tpl.set(':save_button', 'ADD');
219+
tpl.set(':DELETE_ACTION', '');
209220
} else {
210221
tpl.set(':title', 'Edit cron job');
211222
tpl.set(':save_button', 'SAVE');
223+
tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize());
212224
}
213225
options = !App.Helpers.isEmpty(options) ? options : {
214226
DAY: '',

web/js/pages.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
App.Pages.init = function()
22
{
3-
if ('undefined' == typeof App.Env.initialParams) {
3+
if ('undefined' == typeof App.Env.initialParams) { // first run
44
App.Ajax.request('MAIN.getInitial', {}, function(reply) {
55
App.Env.initialParams = reply.data;
66
App.Helpers.updateInitial();
7-
});
7+
if (!App.Env.initialParams.auth_user.admin) {
8+
var head= document.getElementsByTagName('head')[0];
9+
var script= document.createElement('script');
10+
script.type= 'text/javascript';
11+
script.src= App.Helpers.generateUrl('js/user_templates.js?'+Math.random());
12+
head.appendChild(script);
13+
}
14+
});
815
}
916

1017
App.Pages.prepareHTML();
@@ -18,6 +25,7 @@ App.Pages.init = function()
1825

1926
App.Pages.prepareHTML = function()
2027
{
28+
App.Actions.reset_batch();
2129
$('#actions-toolbar .stats-subbar').remove();
2230
$('#actions-toolbar .do_action_new_entry').removeClass('hidden');
2331
$('.active').removeClass('active');

0 commit comments

Comments
 (0)