Skip to content

Commit 8155d2c

Browse files
committed
js / index.html update set
1 parent 6ceecb8 commit 8155d2c

File tree

5 files changed

+55
-27
lines changed

5 files changed

+55
-27
lines changed

web/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ <h1 class="logo"><a href="#">Vesta panel <span>&nbsp;</span></a></h1>
187187
<div id="actions-toolbar" class="cc">
188188
<a class="add-domain do_action_new_entry" href="javascript:void(0)">
189189
<i class="icon do_action_new_entry">&nbsp;</i>
190-
add new entry
190+
add new <span id="new-entry-keyword">entry</span>
191191
</a>
192192
</div>
193193

web/js/actions.js

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,20 @@ App.Actions.save_form = function(evt) {
8989

9090
// do_action_edit
9191
App.Actions.edit = function(evt) {
92-
var elm = $(evt.target);
93-
elm = elm.hasClass('row') ? elm : elm.parents('.row');
94-
95-
var options = elm.find('.source').val();
96-
var build_method = App.Env.getWorldName() + '_form';
97-
var tpl = App.HTML.Build[build_method](options);
98-
elm.replaceWith(tpl);
99-
100-
App.Helpers.disbleNotEditable();
101-
//App.Helpers.updateScreen();
92+
if ('undefined' != typeof App.Pages[App.Env.world].edit) {
93+
App.Pages[App.Env.world].edit(evt);
94+
} else {
95+
var elm = $(evt.target);
96+
elm = elm.hasClass('row') ? elm : elm.parents('.row');
97+
98+
var options = elm.find('.source').val();
99+
var build_method = App.Env.getWorldName() + '_form';
100+
var tpl = App.HTML.Build[build_method](options);
101+
elm.replaceWith(tpl);
102+
103+
App.Helpers.disbleNotEditable();
104+
//App.Helpers.updateScreen();
105+
}
102106
}
103107

104108
// do_cancel_form
@@ -334,3 +338,16 @@ App.Actions.view_full_ns_list = function(evt)
334338
var elm = $(evt.target);
335339
App.Helpers.openInnerPopup(elm, $(elm).parents('.prop-box').find('.ns-full-list:first').html());
336340
}
341+
342+
App.Actions.view_template_info = function(evt)
343+
{
344+
var elm = $(evt.target);
345+
ref = elm.hasClass('row') ? elm : elm.parents('.row');
346+
347+
var options = ref.find('.source').val();
348+
App.Ajax.request('DNS.getTemplateInfo', {spell: options}, function(reply) {
349+
if (reply.result) {
350+
App.Helpers.openInnerPopup(elm, reply.data);
351+
}
352+
});
353+
}

web/js/pages.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ App.Pages.prepareHTML = function()
2222
else {
2323
App.Model[App.Env.world].loadList();
2424
}
25+
$('#new-entry-keyword').text(App.Env.world.toLowerCase().replace('_', ' '));
2526
}
2627

2728
App.Pages.DNS.showSubform = function(ref)
@@ -49,3 +50,13 @@ App.Pages.DNS.edit = function(elm) {
4950
elm.replaceWith(tpl);
5051
}
5152

53+
App.Pages.USER.new_entry = function(evt)
54+
{
55+
var form_id = App.Constants[App.Env.world + '_FORM_ID'];
56+
$('#'+form_id).remove();
57+
var build_method = App.Env.getWorldName() + '_form';
58+
var tpl = App.HTML.Build[build_method]({}, form_id);
59+
App.Ref.CONTENT.prepend(tpl);
60+
App.Helpers.updateScreen();
61+
$('#'+form_id).find('.ns-entry, .additional-ns-add').addClass('hidden');
62+
}

web/js/templates.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ App.Templates.html = {
110110
<span class="ip-adr">~!:IP~!</span>\
111111
<span class="prop-box template-box">\
112112
<span class="prop-title">template:</span>\
113-
<span class="prop-value">~!:TPL~!</span>\
113+
<span class="prop-value do_action_view_template_info">~!:TPL~!</span>\
114114
</span>\
115115
</div>\
116116
</div>\
@@ -126,7 +126,7 @@ App.Templates.html = {
126126
</div>\
127127
</div><!-- // .row-details -->\
128128
</div>'],
129-
SUBFORM: ['<div class="b-new-entry b-records-list subform">\
129+
SUBFORM: ['<div class="b-new-entry b-records-list subform" style="margin-top: -20px;">\
130130
<div class="entry-header">\
131131
<div class="hide-records do_action_close_subform">Hide records</div>\
132132
</div>\
@@ -153,8 +153,8 @@ App.Templates.html = {
153153
</div>\
154154
<div class="field-box dns-type-box">\
155155
<label for="#" class="field-label">type:</label>\
156-
<span class="select RECORD_TYPE" id="selectRECORD_TYPE">~!:RECORD_TYPE_VALUE~!</span>\
157-
<select name="RECORD_TYPE" class="styled">\
156+
<!-- span class="select RECORD_TYPE" id="selectRECORD_TYPE">~!:RECORD_TYPE_VALUE~!</span -->\
157+
<select name="RECORD_TYPE" class="not-styled" style="width:70px">\
158158
~!:RECORD_TYPE~!\
159159
</select>\
160160
</div>\
@@ -203,7 +203,7 @@ App.Templates.html = {
203203
</div>\
204204
<div class="form-row cc">\
205205
<label for="#" class="field-label">netmask:</label>\
206-
<div class="autocomplete-box">\
206+
<div class="_autocomplete-box">\
207207
<input type="text" value="~!:NETMASK~!" name="NETMASK" class="text-field">\
208208
</div>\
209209
</div>\
@@ -297,7 +297,7 @@ App.Templates.html = {
297297
</div>\
298298
<div class="form-row cc">\
299299
<label for="#" class="field-label">username:</label>\
300-
<input type="text" class="text-field rule-abc rule-required" value="~!:LOGIN_NAME~!" name="LOGIN_NAME">\
300+
<input type="text" class="text-field rule-required rule-username" value="~!:LOGIN_NAME~!" name="LOGIN_NAME">\
301301
</div>\
302302
<div class="form-row pwd-box cc">\
303303
<label for="#" class="field-label">password:</label>\
@@ -419,7 +419,7 @@ App.Templates.html = {
419419
<!-- bandwidth usage block -->\
420420
<div style="margin-bottom:25px;" class="b-usage-box bandwidth-box cc">\
421421
<span class="prop-title">bandwidth:</span>\
422-
<div class="usage-box">\
422+
<div class="usage-box" style="margin-left: -1px">\
423423
<div class="value-box">\
424424
<span class="value">~!:U_BANDWIDTH~!</span>\
425425
<div class="graph low">\
@@ -435,10 +435,6 @@ App.Templates.html = {
435435
<!-- // bandwidth usage block -->\
436436
</div>\
437437
<div class="props-additional">\
438-
<span class="prop-box webdomains-box">\
439-
<span class="prop-title">web domains:</span>\
440-
<span class="prop-value">~!:U_DNS_DOMAINS~! (~!:WEB_DOMAINS~!)</span>\
441-
</span>\
442438
<span class="prop-box websl-box">\
443439
<span class="prop-title">web ssl:</span>\
444440
<span class="prop-value">~!:U_WEB_SSL~! (~!:WEB_SSL~!)</span>\
@@ -479,7 +475,11 @@ App.Templates.html = {
479475
<span class="prop-title">mail domains:</span>\
480476
<span class="prop-value">~!:U_MAIL_DOMAINS~! (~!:MAIL_DOMAINS~!)</span>\
481477
</span>\
482-
<span class="prop-box dnsdomains-box">\
478+
<span class="prop-box webdomains-box">\
479+
<span class="prop-title">web domains:</span>\
480+
<span class="prop-value">~!:U_WEB_DOMAINS~! (~!:WEB_DOMAINS~!)</span>\
481+
</span>\
482+
<span class="prop-box dnsdomains-box">\
483483
<span class="prop-title">dns domains:</span>\
484484
<span class="prop-value">~!:U_DNS_DOMAINS~! (~!:DNS_DOMAINS~!)</span>\
485485
</span>\

web/js/validators.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ App.Validate.Rule = {
3030
if ($(elm).val().trim() == '' || $(elm).val().search(/[^a-zA-Z_]+/) != -1) {
3131
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' is invalid'};
3232
}
33-
if ($(elm).val().trim() == '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
33+
if ($(elm).val().trim() != '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
3434
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' too long'};
3535
}
3636
}
@@ -41,7 +41,7 @@ App.Validate.Rule = {
4141
if ($(elm).val().trim() == '') {
4242
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' is required'};
4343
}
44-
if ($(elm).val().trim() == '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
44+
if ($(elm).val().trim() != '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
4545
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' too long'};
4646
}
4747
}
@@ -51,7 +51,7 @@ App.Validate.Rule = {
5151
if ($(elm).val().trim() != '' && $(elm).val().search(/[^a-zA-Z_]+/) != -1) {
5252
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' is invalid'};
5353
}
54-
if ($(elm).val().trim() == '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
54+
if ($(elm).val().trim() != '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
5555
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' too long'};
5656
}
5757
return {VALID: true};
@@ -78,7 +78,7 @@ App.Validate.Rule = {
7878
if ($(elm).val().trim() != '' && $(elm).val().search(/[^a-zA-Z]+/) != -1) {
7979
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' must contain only letters without spaces or other symbols'};
8080
}
81-
if ($(elm).val().trim() == '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
81+
if ($(elm).val().trim() != '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
8282
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' too long'};
8383
}
8484
return {VALID: true};

0 commit comments

Comments
 (0)