Skip to content

Commit d3875f8

Browse files
authored
UI updates (hestiacp#3510)
1 parent efff604 commit d3875f8

33 files changed

+212
-276
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ module.exports = {
4040
},
4141
],
4242
'no-console': 'error',
43+
'prefer-const': 'error',
4344
'import/no-unresolved': 'off',
4445
},
4546
};

web/css/src/themes/default.css

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,16 @@
10551055
padding-top: 12px;
10561056
vertical-align: top;
10571057
padding-bottom: 10px;
1058+
1059+
@media (--viewport-large) {
1060+
& .actions-panel {
1061+
visibility: hidden;
1062+
}
1063+
1064+
&:hover .actions-panel {
1065+
visibility: visible;
1066+
}
1067+
}
10581068
}
10591069

10601070
.l-unit__col--right.total {
@@ -1222,24 +1232,17 @@
12221232

12231233
.actions-panel__col {
12241234
display: inline-block;
1225-
margin-left: 3px;
1226-
text-transform: uppercase;
1235+
margin-left: 6px;
12271236

12281237
& a {
12291238
color: #777;
1230-
font-weight: 600;
12311239
font-size: 0.9rem;
12321240
display: inline-block;
1233-
cursor: pointer;
12341241
}
1235-
}
1236-
1237-
.l-unit__col .actions-panel .fas {
1238-
display: none;
1239-
}
12401242

1241-
.l-unit__col:hover .actions-panel .fas {
1242-
display: inline-block;
1243+
@media (--viewport-large) {
1244+
margin-left: 3px;
1245+
}
12431246
}
12441247

12451248
/* Statistics
@@ -1395,23 +1398,36 @@
13951398
}
13961399

13971400
@media (--viewport-medium) {
1398-
.sidebar-right-container {
1401+
.sidebar-right-grid {
13991402
display: grid;
14001403
gap: 50px;
14011404
grid-template-columns: 2fr 1.3fr;
14021405
}
1406+
1407+
.sidebar-right-grid-content {
1408+
}
1409+
1410+
.sidebar-right-grid-sidebar {
1411+
max-width: 385px;
1412+
}
14031413
}
14041414

14051415
@media (--viewport-medium) {
1406-
.sidebar-left-container {
1416+
.sidebar-left-grid {
14071417
display: grid;
14081418
gap: 20px;
14091419
grid-template-columns: 1fr 3fr;
14101420
}
1421+
1422+
.sidebar-left-grid-sidebar {
1423+
}
1424+
1425+
.sidebar-left-grid-content {
1426+
}
14111427
}
14121428

14131429
@media (--viewport-large) {
1414-
.sidebar-left-container {
1430+
.sidebar-left-grid {
14151431
gap: 50px;
14161432
}
14171433
}

web/css/src/utilities.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
white-space: nowrap !important;
5050
}
5151

52+
.u-overflow {
53+
overflow: auto !important;
54+
}
55+
5256
.u-mt15 {
5357
margin-top: 15px !important;
5458
}

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/dist/main.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/js/dist/main.min.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/js/pages/add_db.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ App.Listeners.DB.keypress_db_username = () => {
2828
App.Actions.DB.update_db_username_hint(input);
2929
}
3030

31-
const updateTimeout = (evt) => {
32-
clearTimeout(window.frp_usr_tmt);
33-
window.frp_usr_tmt = setTimeout(() => {
31+
input.addEventListener(
32+
'input',
33+
Hestia.helpers.debounce((evt) => {
3434
App.Actions.DB.update_db_username_hint(evt.target);
35-
}, 100);
36-
};
37-
38-
input.addEventListener('input', updateTimeout);
35+
}, 100)
36+
);
3937
};
4038

4139
// Listener that triggers database user hint updating
@@ -46,14 +44,12 @@ App.Listeners.DB.keypress_db_databasename = () => {
4644
App.Actions.DB.update_db_databasename_hint(input);
4745
}
4846

49-
const updateTimeout = (evt) => {
50-
clearTimeout(window.frp_dbn_tmt);
51-
window.frp_dbn_tmt = setTimeout(() => {
47+
input.addEventListener(
48+
'input',
49+
Hestia.helpers.debounce((evt) => {
5250
App.Actions.DB.update_db_databasename_hint(evt.target);
53-
}, 100);
54-
};
55-
56-
input.addEventListener('input', updateTimeout);
51+
}, 100)
52+
);
5753
};
5854

5955
//

web/js/pages/add_dns_rec.js

Lines changed: 0 additions & 52 deletions
This file was deleted.

web/js/pages/add_web.js

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,16 @@
1-
// Page entry point
2-
// Trigger listeners
3-
App.Listeners.DB.keypress_custom_folder();
4-
App.Listeners.DB.change_custom_doc();
5-
6-
App.Actions.WEB.update_ftp_username_hint = function (elm, hint) {
7-
if (hint.trim() == '') {
8-
$(elm).parent().find('.hint').text('');
9-
}
10-
11-
hint = hint.replace(/[^\w\d]/gi, '');
12-
13-
$(elm).parent().find('.js-ftp-user').val(hint);
14-
$(elm)
15-
.parent()
16-
.find('.hint')
17-
.text(Alpine.store('globals').FTP_USER_PREFIX + hint);
18-
};
19-
20-
App.Listeners.WEB.keypress_ftp_username = function () {
21-
var ftp_user_inputs = $('.js-ftp-user');
22-
$.each(ftp_user_inputs, function (i, ref) {
23-
var $ref = $(ref);
24-
var current_val = $ref.val();
25-
if (current_val.trim() != '') {
26-
App.Actions.WEB.update_ftp_username_hint($ref, current_val);
27-
}
28-
29-
$ref.bind('keypress input', function (evt) {
30-
clearTimeout(window.frp_usr_tmt);
31-
window.frp_usr_tmt = setTimeout(function () {
32-
var elm = $(evt.target);
33-
App.Actions.WEB.update_ftp_username_hint(elm, $(elm).val());
34-
}, 100);
35-
});
36-
});
37-
};
38-
391
App.Listeners.WEB.keypress_domain_name = function () {
402
$('#v_domain').bind('keypress input', function () {
41-
clearTimeout(window.frp_usr_tmt);
42-
window.frp_usr_tmt = setTimeout(function () {
3+
clearTimeout(window.frpUserTimeout);
4+
window.frpUserTimeout = setTimeout(function () {
435
$('#v-custom-doc-domain-main').text($('#v_domain').val());
446
$('#v-custom-doc-domain-main').val($('#v_domain').val());
457
App.Actions.WEB.update_custom_doc_root(13, 12);
468
}, 100);
479
});
4810
};
4911

50-
App.Actions.WEB.toggle_letsencrypt = function (elm) {
51-
if ($(elm).prop('checked')) {
52-
$(
53-
'#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]'
54-
).attr('disabled', 'disabled');
55-
$('#generate-csr').hide();
56-
} else {
57-
$(
58-
'#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]'
59-
).removeAttr('disabled');
60-
$('#generate-csr').show();
61-
}
62-
};
63-
6412
//
6513
// Page entry point
66-
App.Listeners.WEB.keypress_ftp_username();
67-
App.Listeners.WEB.keypress_ftp_path();
6814
App.Listeners.WEB.keypress_domain_name();
6915

7016
$(function () {
@@ -77,15 +23,4 @@ $(function () {
7723
prefix + document.getElementById('v_domain').value;
7824
}
7925
});
80-
App.Actions.WEB.toggle_letsencrypt($('input[name=v_letsencrypt]'));
81-
82-
$('select[name="v_stats"]').change(function (evt) {
83-
var select = $(evt.target);
84-
85-
if (select.val() == 'none') {
86-
$('.stats-auth').hide();
87-
} else {
88-
$('.stats-auth').show();
89-
}
90-
});
9126
});

web/js/pages/edit_db.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ App.Listeners.DB.keypress_db_username = () => {
2828
App.Actions.DB.update_db_username_hint(input);
2929
}
3030

31-
const updateTimeout = (evt) => {
32-
clearTimeout(window.frp_usr_tmt);
33-
window.frp_usr_tmt = setTimeout(() => {
31+
input.addEventListener(
32+
'input',
33+
Hestia.helpers.debounce((evt) => {
3434
App.Actions.DB.update_db_username_hint(evt.target);
35-
}, 100);
36-
};
37-
38-
input.addEventListener('input', updateTimeout);
35+
}, 100)
36+
);
3937
};
4038

4139
// Listener that triggers database user hint updating
@@ -51,14 +49,12 @@ App.Listeners.DB.keypress_db_databasename = () => {
5149
App.Actions.DB.update_db_databasename_hint(input);
5250
}
5351

54-
const updateTimeout = (evt) => {
55-
clearTimeout(window.frp_dbn_tmt);
56-
window.frp_dbn_tmt = setTimeout(() => {
52+
input.addEventListener(
53+
'input',
54+
Hestia.helpers.debounce((evt) => {
5755
App.Actions.DB.update_db_databasename_hint(evt.target);
58-
}, 100);
59-
};
60-
61-
input.addEventListener('input', updateTimeout);
56+
}, 100)
57+
);
6258
};
6359

6460
//

0 commit comments

Comments
 (0)