Skip to content

Commit 3ebd9e4

Browse files
authored
Migrate "infinity" fields to .form-control (hestiacp#2975)
* Migrate Rclone text inputs to .form-control * Migrate "Command" field on Add/Edit Cron forms * Migrate text fields on Add/Edit Cron forms * Consistency * Fix HTML * Migrate "infinity" fields on Add/Edit Mail forms - Fix "infinity" icon JS not working on Edit Mail form * Migrate some text fields on Add/Edit Package forms * Migrate "infinity" fields on Add/Edit Package forms * Remove unnecessary IDs * Remove .short class
1 parent ccdb4c5 commit 3ebd9e4

17 files changed

+235
-346
lines changed

web/css/src/themes/dark.css

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -670,14 +670,6 @@ label:hover {
670670
border-color: #606060 !important;
671671
}
672672

673-
.vst-input.long {
674-
675-
}
676-
677-
.vst-input.short {
678-
679-
}
680-
681673
.vst-input.vst-list-editor {
682674

683675
}

web/css/src/themes/default.css

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2295,14 +2295,6 @@ label:hover {
22952295
border-color: #cfcfcf;
22962296
}
22972297

2298-
.vst-input.long {
2299-
width: 832px;
2300-
}
2301-
2302-
.vst-input.short {
2303-
width: 200px;
2304-
}
2305-
23062298
.vst-input.vst-list-editor {
23072299
border: none;
23082300
box-shadow: none;
@@ -2747,8 +2739,8 @@ a.button.cancel {
27472739
.unlim-trigger {
27482740
cursor: pointer;
27492741
position: absolute;
2750-
margin-left: -32px;
2751-
margin-top: 16px;
2742+
top: 13px;
2743+
right: 12px;
27522744
z-index: 1;
27532745
font-size: 0.8rem;
27542746
}
@@ -3686,11 +3678,6 @@ li[aria-expanded="true"] a {
36863678
width: 379px;
36873679
}
36883680

3689-
.cron-helper-tabs .form-select.short {
3690-
min-width: 30px;
3691-
width: 70px;
3692-
}
3693-
36943681
.cron-helper-tabs .button {
36953682
width: auto;
36963683
background-color: #3b9de8;

web/css/themes/default.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/js/pages/add_mail_acc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ App.Actions.MAIL_ACC.disable_unlimited = function(elm, source_elm) {
2626

2727
App.Actions.MAIL_ACC.toggle_unlimited_feature = function(evt) {
2828
var elm = $(evt.target);
29-
var ref = elm.prev('.vst-input');
29+
var ref = elm.prev('.form-control');
3030
if (!$(ref).data('checked')) {
3131
App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
3232
}
@@ -41,7 +41,7 @@ App.Listeners.MAIL_ACC.checkbox_unlimited_feature = function() {
4141

4242
App.Listeners.MAIL_ACC.init = function() {
4343
$('.unlim-trigger').each(function(i, elm) {
44-
var ref = $(elm).prev('.vst-input');
44+
var ref = $(elm).prev('.form-control');
4545
if (App.Helpers.isUnlimitedValue($(ref).val())) {
4646
App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
4747
}

web/js/pages/add_package.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ App.Actions.PACKAGE.disable_unlimited = function(elm, source_elm) {
2424
$(source_elm).css('opacity', '0.5');
2525
}
2626

27-
//
27+
//
2828
App.Actions.PACKAGE.toggle_unlimited_feature = function(evt) {
2929
var elm = $(evt.target);
30-
var ref = elm.prev('.vst-input');
30+
var ref = elm.prev('.form-control');
3131
if (!$(ref).data('checked')) {
3232
App.Actions.PACKAGE.enable_unlimited(ref, elm);
3333
}
@@ -42,7 +42,7 @@ App.Listeners.PACKAGE.checkbox_unlimited_feature = function() {
4242

4343
App.Listeners.PACKAGE.init = function() {
4444
$('.unlim-trigger').each(function(i, elm) {
45-
var ref = $(elm).prev('.vst-input');
45+
var ref = $(elm).prev('.form-control');
4646
if (App.Helpers.isUnlimitedValue($(ref).val())) {
4747
App.Actions.PACKAGE.enable_unlimited(ref, elm);
4848
}

web/js/pages/edit_mail_acc.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ App.Actions.MAIL_ACC.disable_unlimited = function(elm, source_elm) {
2727
//
2828
App.Actions.MAIL_ACC.toggle_unlimited_feature = function(evt) {
2929
var elm = $(evt.target);
30-
var ref = elm.prev('.vst-input');
30+
var ref = elm.prev('.form-control');
3131
if (!$(ref).data('checked')) {
3232
App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
3333
}
@@ -42,7 +42,7 @@ App.Listeners.MAIL_ACC.checkbox_unlimited_feature = function() {
4242

4343
App.Listeners.MAIL_ACC.init = function() {
4444
$('.unlim-trigger').each(function(i, elm) {
45-
var ref = $(elm).prev('.vst-input');
45+
var ref = $(elm).prev('.form-control');
4646
if (App.Helpers.isUnlimitedValue($(ref).val())) {
4747
App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
4848
}
@@ -53,6 +53,18 @@ App.Listeners.MAIL_ACC.init = function() {
5353
});
5454
}
5555

56+
App.Helpers.isUnlimitedValue = function(value) {
57+
var value = value.trim();
58+
if (value == App.Constants.UNLIM_VALUE || value == App.Constants.UNLIM_TRANSLATED_VALUE) {
59+
return true;
60+
}
61+
62+
return false;
63+
}
64+
65+
App.Listeners.MAIL_ACC.init();
66+
App.Listeners.MAIL_ACC.checkbox_unlimited_feature();
67+
5668
App.Actions.MAIL_ACC.update_password_meter = function (){
5769
var password = $('input[name="v_password"]').val();
5870
var min_small = new RegExp(/^(?=.*[a-z]).+$/);

web/js/pages/edit_package.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ App.Actions.PACKAGE.disable_unlimited = function(elm, source_elm) {
2424
$(source_elm).css('opacity', '0.5');
2525
}
2626

27-
//
27+
//
2828
App.Actions.PACKAGE.toggle_unlimited_feature = function(evt) {
2929
var elm = $(evt.target);
30-
var ref = elm.prev('.vst-input');
30+
var ref = elm.prev('.form-control');
3131
if (!$(ref).data('checked')) {
3232
App.Actions.PACKAGE.enable_unlimited(ref, elm);
3333
}
@@ -42,7 +42,7 @@ App.Listeners.PACKAGE.checkbox_unlimited_feature = function() {
4242

4343
App.Listeners.PACKAGE.init = function() {
4444
$('.unlim-trigger').each(function(i, elm) {
45-
var ref = $(elm).prev('.vst-input');
45+
var ref = $(elm).prev('.form-control');
4646
if (App.Helpers.isUnlimitedValue($(ref).val())) {
4747
App.Actions.PACKAGE.enable_unlimited(ref, elm);
4848
}
@@ -103,4 +103,4 @@ $(document).ready(function(){
103103
$('input[name^=v_ns]').each(function(i, ns){
104104
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
105105
});
106-
});
106+
});

web/templates/pages/add_cron.html

Lines changed: 24 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<div class="l-center animated fadeIn">
1717

18-
<div class="u-pt18 helper-container">
18+
<div class="helper-container">
1919
<div id="tabs" class="cron-helper-tabs">
2020
<ul>
2121
<li><a href="#tabs-1"><?=_('Minutes');?></a></li>
@@ -63,7 +63,7 @@
6363
</p>
6464
<p>
6565
<label for="h_min_2" class="form-label first"><?=_('Minute');?>:</label>
66-
<select class="form-select short" name="h_min" id="h_min_2">
66+
<select class="form-select" name="h_min" id="h_min_2" style="width:70px;">
6767
<option value="0" selected="selected">00</option>
6868
<option value="15">15</option>
6969
<option value="30">30</option>
@@ -94,7 +94,7 @@
9494
</p>
9595
<p>
9696
<label for="h_hour_3" class="form-label first"><?=_('Hour');?>:</label>
97-
<select class="form-select short" name="h_hour" id="h_hour_3">
97+
<select class="form-select" name="h_hour" id="h_hour_3" style="width:70px;">
9898
<option value="0">00</option>
9999
<option value="1">01</option>
100100
<option value="2">02</option>
@@ -121,7 +121,7 @@
121121
<option value="23">23</option>
122122
</select>
123123
<label for="h_min_3" class="form-label"><?=_('Minute');?>:</label>
124-
<select class="form-select short" name="h_min" id="h_min_3">
124+
<select class="form-select" name="h_min" id="h_min_3" style="width:70px;">
125125
<option value="0" selected="selected">00</option>
126126
<option value="1">01</option>
127127
<option value="2">02</option>
@@ -165,7 +165,7 @@
165165
</p>
166166
<p>
167167
<label for="h_hour_4" class="form-label first"><?=_('Hour');?>:</label>
168-
<select class="form-select short" name="h_hour" id="h_hour_4">
168+
<select class="form-select" name="h_hour" id="h_hour_4" style="width:70px;">
169169
<option value="0">00</option>
170170
<option value="1">01</option>
171171
<option value="2">02</option>
@@ -192,7 +192,7 @@
192192
<option value="23">23</option>
193193
</select>
194194
<label for="h_min_4" class="form-label"><?=_('Minute');?>:</label>
195-
<select class="form-select short" name="h_min" id="h_min_4">
195+
<select class="form-select" name="h_min" id="h_min_4" style="width:70px;">
196196
<option value="0" selected="selected">00</option>
197197
<option value="1">01</option>
198198
<option value="2">02</option>
@@ -242,7 +242,7 @@
242242
</p>
243243
<p>
244244
<label for="h_day_5" class="form-label first"><?=_('Date');?>:</label>
245-
<select class="form-select short" name="h_day" id="h_day_5">
245+
<select class="form-select" name="h_day" id="h_day_5" style="width:70px;">
246246
<option value="1" selected="selected">1</option>
247247
<option value="2">2</option>
248248
<option value="3">3</option>
@@ -276,7 +276,7 @@
276276
<option value="31">31</option>
277277
</select>
278278
<label for="h_hour_5" class="form-label"><?=_('Hour');?>:</label>
279-
<select class="form-select short" name="h_hour" id="h_hour_5">
279+
<select class="form-select" name="h_hour" id="h_hour_5" style="width:70px;">
280280
<option value="0">00</option>
281281
<option value="1">01</option>
282282
<option value="2">02</option>
@@ -303,7 +303,7 @@
303303
<option value="23">23</option>
304304
</select>
305305
<label for="h_min_5" class="form-label"><?=_('Minute');?>:</label>
306-
<select class="form-select short" name="h_min" id="h_min_5">
306+
<select class="form-select" name="h_min" id="h_min_5" style="width:70px;">
307307
<option value="0" selected="selected">00</option>
308308
<option value="1">01</option>
309309
<option value="2">02</option>
@@ -341,7 +341,7 @@
341341
</table>
342342
</td>
343343
<td class="data-dotted">
344-
<table class="data-col2" width="600px">
344+
<table class="data-col2" width="850px">
345345
<tr>
346346
<td class="u-pt18">
347347
<span class="page-title"><?=_('Adding Cron Job');?></span>
@@ -354,67 +354,42 @@
354354
</tr>
355355
<tr>
356356
<td class="u-pt6">
357-
<?=_('Command');?>
358-
</td>
359-
</tr>
360-
<tr>
361-
<td>
362-
<input type="text" class="vst-input long" name="v_cmd" value="<?=htmlentities(trim($v_cmd, "'"))?>">
357+
<label for="v_cmd" class="form-label"><?=_('Command');?></label>
358+
<input type="text" class="form-control" name="v_cmd" id="v_cmd" value="<?=htmlentities(trim($v_cmd, "'"))?>">
363359
</td>
364360
</tr>
365361
<tr>
366362
<td class="u-pt18">
367-
<?=_('Minute');?>
368-
</td>
369-
</tr>
370-
<tr>
371-
<td>
372-
<input type="text" class="vst-input short" name="v_min" value="<?=htmlentities(trim($v_min, "'"))?>">
363+
<label for="v_min" class="form-label"><?=_('Minute');?></label>
364+
<input type="text" class="form-control" name="v_min" id="v_min" style="width:220px;" value="<?=htmlentities(trim($v_min, "'"))?>">
373365
</td>
374366
</tr>
375367
<tr>
376368
<td class="u-pt6">
377-
<?=_('Hour');?>
378-
</td>
379-
</tr>
380-
<tr>
381-
<td>
382-
<input type="text" class="vst-input short" name="v_hour" value="<?=htmlentities(trim($v_hour, "'"))?>">
369+
<label for="v_hour" class="form-label"><?=_('Hour');?></label>
370+
<input type="text" class="form-control" name="v_hour" id="v_hour" style="width:220px;" value="<?=htmlentities(trim($v_hour, "'"))?>">
383371
</td>
384372
</tr>
385373
<tr>
386374
<td class="u-pt6">
387-
<?=_('Day');?>
375+
<label for="v_day" class="form-label"><?=_('Day');?></label>
376+
<input type="text" class="form-control" name="v_day" id="v_day" style="width:220px;" value="<?=htmlentities(trim($v_day, "'"))?>">
388377
</td>
389378
</tr>
390379
<tr>
391-
<td>
392-
<input type="text" class="vst-input short" name="v_day" value="<?=htmlentities(trim($v_day, "'"))?>">
393-
</td>
394-
</tr>
395-
<tr>
396-
<td class="u-pt6">
397-
<?=_('Month');?>
398-
</td>
399-
</tr>
400-
<tr>
401-
<td>
402-
<input type="text" class="vst-input short" name="v_month" value="<?=htmlentities(trim($v_month, "'"))?>">
380+
<td class="u-pt18">
381+
<label for="v_month" class="form-label"><?=_('Month');?></label>
382+
<input type="text" class="form-control" name="v_month" id="v_month" style="width:220px;" value="<?=htmlentities(trim($v_month, "'"))?>">
403383
</td>
404384
</tr>
405385
<tr>
406386
<td class="u-pt6">
407-
<?=_('Day of week');?>
408-
</td>
409-
</tr>
410-
<tr>
411-
<td>
412-
<input type="text" class="vst-input short" name="v_wday" value="<?=htmlentities(trim($v_wday, "'"))?>">
387+
<label for="v_wday" class="form-label"><?=_('Day of week');?></label>
388+
<input type="text" class="form-control" name="v_wday" id="v_wday" style="width:220px;" value="<?=htmlentities(trim($v_wday, "'"))?>">
413389
</td>
414390
</tr>
415391
</table>
416-
<table class="data-col2">
417-
</table>
392+
<table class="data-col2"></table>
418393
</td>
419394
</tr>
420395
</table>

web/templates/pages/add_db.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@
189189
</td>
190190
</tr>
191191
</table>
192-
<table class="data-col2">
193-
</table>
192+
<table class="data-col2"></table>
194193
</td>
195194
</tr>
196195
<?php } ?>

web/templates/pages/add_firewall_banlist.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@
6363
</td>
6464
</tr>
6565
</table>
66-
<table class="data-col2">
67-
<tr>
68-
</tr>
69-
</table>
66+
<table class="data-col2"></table>
7067
</td>
7168
</tr>
7269
</table>

0 commit comments

Comments
 (0)