Skip to content

Commit 81b4449

Browse files
authored
Refactor server info section (hestiacp#3120)
- Add note to development docs about clearing backups - Improve some syntax compatibility with Prettier in views - Format login views with Prettier, to cut down on eventual diff
1 parent 9f52c52 commit 81b4449

File tree

22 files changed

+333
-262
lines changed

22 files changed

+333
-262
lines changed

docs/docs/contributing/development.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ Please ensure you have [Yarn](https://yarnpkg.com) v3 installed and are using [N
118118

119119
1. Reload the page in your browser to see your changes
120120

121+
::: info
122+
A backup is created each time the Hestia build script is run. If you run this a lot it can fill up your VM's disk space.
123+
You can delete the backups by running `rm -rf /root/hst_backups` as root user on the VM.
124+
:::
125+
121126
Please refer to the [contributing guidelines](https://github.com/hestiacp/hestiacp/blob/main/CONTRIBUTING.md) for more details on submitting code changes for review.
122127

123128
### Building packages

web/css/src/themes/dark.css

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -960,18 +960,10 @@ li[aria-expanded="true"] a {
960960
color: #dadada;
961961
}
962962

963-
.server-info-name {
964-
color: #fafafa !important;
965-
}
966-
967-
.server-info-output {
963+
.server-console-output {
968964
background: #282828;
969965
}
970966

971-
.icon-server-info {
972-
color: #707070;
973-
}
974-
975967
.body-rrd .units .l-unit {
976968
background-color: #282828 !important;
977969
border-left: 1px solid transparent !important;
@@ -1012,6 +1004,17 @@ li[aria-expanded="true"] a {
10121004
border-color: #454545;
10131005
}
10141006

1007+
/* Server summary component
1008+
========================================================================== */
1009+
1010+
.server-summary-icon {
1011+
color: #707070;
1012+
}
1013+
1014+
.server-summary-title {
1015+
color: #fafafa;
1016+
}
1017+
10151018
/* Panel component
10161019
========================================================================== */
10171020

web/css/src/themes/default.css

Lines changed: 74 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,6 +2240,79 @@
22402240
.values-list-value {
22412241
}
22422242

2243+
/* Server summary component
2244+
========================================================================== */
2245+
2246+
.server-summary {
2247+
padding: 20px;
2248+
2249+
@media (--viewport-medium) {
2250+
display: flex;
2251+
}
2252+
}
2253+
2254+
.server-summary-icon {
2255+
text-align: center;
2256+
margin-bottom: 10px;
2257+
2258+
& .fas {
2259+
font-size: 4.6rem;
2260+
}
2261+
2262+
@media (--viewport-medium) {
2263+
margin-top: 8px;
2264+
margin-bottom: 0;
2265+
}
2266+
}
2267+
2268+
.server-summary-content {
2269+
text-align: center;
2270+
2271+
@media (--viewport-medium) {
2272+
text-align: left;
2273+
flex-grow: 1;
2274+
margin-left: 30px;
2275+
}
2276+
2277+
@media (--viewport-large) {
2278+
margin-left: 40px;
2279+
}
2280+
}
2281+
2282+
.server-summary-title {
2283+
color: #414141;
2284+
margin-bottom: 10px;
2285+
2286+
@media (--viewport-medium) {
2287+
font-size: 1.7rem;
2288+
margin-bottom: 0;
2289+
}
2290+
}
2291+
2292+
.server-summary-list {
2293+
@media (--viewport-medium) {
2294+
display: flex;
2295+
justify-content: space-between;
2296+
}
2297+
}
2298+
2299+
.server-summary-item {
2300+
@media (--viewport-large) {
2301+
min-width: 200px;
2302+
}
2303+
}
2304+
2305+
.server-summary-list-label {
2306+
font-weight: 600;
2307+
2308+
@media (--viewport-medium) {
2309+
display: block;
2310+
}
2311+
}
2312+
2313+
.server-summary-list-value {
2314+
}
2315+
22432316
/* Panel component
22442317
========================================================================== */
22452318

@@ -2716,34 +2789,12 @@ li[aria-expanded="true"] a {
27162789
}
27172790
}
27182791

2719-
.server-info-data {
2720-
margin-left: 100px;
2721-
margin-top: -20px;
2722-
2723-
& table {
2724-
width: auto;
2725-
}
2726-
}
2727-
2728-
.server-info-name {
2729-
margin-top: 8px;
2730-
margin-bottom: 22px;
2731-
font-weight: 400;
2732-
}
2733-
2734-
.server-info-output {
2792+
.server-console-output {
27352793
color: #c36;
27362794
padding: 10px 0 20px 20px;
27372795
background: #fff;
27382796
}
27392797

2740-
.icon-server-info {
2741-
font-size: 4.6rem;
2742-
float: left;
2743-
margin-right: 32px;
2744-
margin-left: 2px;
2745-
}
2746-
27472798
.userlist-email {
27482799
font-size: 0.75rem;
27492800
white-space: nowrap;

web/css/src/themes/vestia.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,6 @@ strong {
380380
border-radius: 4px !important;
381381
}
382382

383-
.server-info-data {
384-
line-height: 1rem !important;
385-
}
386-
387383
/* Shortcuts panel
388384
========================================================================== */
389385

web/css/themes/dark.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/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/css/themes/vestia.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/templates/header.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<!doctype html>
2-
<html class="no-js" lang="<?=$_SESSION['LANGUAGE']?>">
2+
<html class="no-js" lang="<?= $_SESSION["LANGUAGE"] ?>">
33

44
<head>
55
<?php
6-
require $_SERVER['HESTIA'] . '/web/templates/includes/title.php';
7-
require $_SERVER['HESTIA'] . '/web/templates/includes/css.php';
8-
require $_SERVER['HESTIA'] . '/web/templates/includes/js.php';
6+
require $_SERVER["HESTIA"] . "/web/templates/includes/title.php";
7+
require $_SERVER["HESTIA"] . "/web/templates/includes/css.php";
8+
require $_SERVER["HESTIA"] . "/web/templates/includes/js.php";
99
?>
1010
</head>
1111

12-
<body class="body-<?=strtolower($TAB)?> lang-<?=$_SESSION['language']?>">
12+
<body class="body-<?= strtolower($TAB) ?> lang-<?= $_SESSION["language"] ?>">

web/templates/includes/js.php

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<script defer src="/js/main.js?<?=JS_LATEST_UPDATE?>"></script>
2-
<script defer src="/js/shortcuts.js?<?=JS_LATEST_UPDATE?>"></script>
3-
<script defer src="/js/vendor/alpine-3.10.5.min.js?<?=JS_LATEST_UPDATE?>"></script>
4-
<script defer src="/js/vendor/jquery-3.6.1.min.js?<?=JS_LATEST_UPDATE?>"></script>
5-
<script defer src="/js/vendor/jquery-ui.min.js?<?=JS_LATEST_UPDATE?>"></script>
6-
<script defer src="/js/vendor/chart.min.js?<?=JS_LATEST_UPDATE?>"></script>
7-
<script defer src="/js/events.js?<?=JS_LATEST_UPDATE?>"></script>
8-
<script defer src="/js/init.js?<?=JS_LATEST_UPDATE?>"></script>
1+
<script defer src="/js/main.js?<?= JS_LATEST_UPDATE ?>"></script>
2+
<script defer src="/js/shortcuts.js?<?= JS_LATEST_UPDATE ?>"></script>
3+
<script defer src="/js/vendor/alpine-3.10.5.min.js?<?= JS_LATEST_UPDATE ?>"></script>
4+
<script defer src="/js/vendor/jquery-3.6.1.min.js?<?= JS_LATEST_UPDATE ?>"></script>
5+
<script defer src="/js/vendor/jquery-ui.min.js?<?= JS_LATEST_UPDATE ?>"></script>
6+
<script defer src="/js/vendor/chart.min.js?<?= JS_LATEST_UPDATE ?>"></script>
7+
<script defer src="/js/events.js?<?= JS_LATEST_UPDATE ?>"></script>
8+
<script defer src="/js/init.js?<?= JS_LATEST_UPDATE ?>"></script>
99
<script>
1010
// TODO: REMOVE
1111
const App = {
@@ -27,9 +27,9 @@
2727
document.documentElement.classList.replace('no-js', 'js');
2828
document.addEventListener('alpine:init', () => {
2929
Alpine.store('globals', {
30-
FTP_USER_PREFIX: '<?= $user_plain; ?>_',
31-
DB_USER_PREFIX: '<?= $user_plain; ?>_',
32-
DB_DBNAME_PREFIX: '<?= $user_plain; ?>_',
30+
FTP_USER_PREFIX: '<?= $user_plain ?>_',
31+
DB_USER_PREFIX: '<?= $user_plain ?>_',
32+
DB_DBNAME_PREFIX: '<?= $user_plain ?>_',
3333
UNLIM_VALUE: 'unlimited',
3434
UNLIM_TRANSLATED_VALUE: '<?= _("unlimited") ?>',
3535
NOTIFICATIONS_EMPTY: '<?= _("no notifications") ?>',
@@ -40,10 +40,11 @@
4040
});
4141
})
4242
</script>
43-
<?php foreach(new DirectoryIterator($_SERVER['HESTIA'].'/web/js/custom_scripts') as $customScript){
44-
if($customScript->getExtension() === 'js'){
45-
echo '<script defer src="/js/custom_scripts/'.rawurlencode($customScript->getBasename()).'"></script>';
46-
} elseif($customScript->getExtension() === "php"){
47-
require_once($customScript->getPathname());
43+
44+
<?php foreach (new DirectoryIterator($_SERVER["HESTIA"] . "/web/js/custom_scripts") as $customScript) {
45+
if ($customScript->getExtension() === "js") {
46+
echo '<script defer src="/js/custom_scripts/' . rawurlencode($customScript->getBasename()) . '"></script>';
47+
} elseif ($customScript->getExtension() === "php") {
48+
require_once $customScript->getPathname();
4849
}
49-
} ?>
50+
} ?>

web/templates/includes/title.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<meta charset="utf-8">
2-
<title><?=_($TAB)?> - <?=htmlentities($_SERVER['HTTP_HOST']); ?> - <?=_('Hestia Control Panel');?></title>
2+
<title><?= _($TAB) ?> - <?= htmlentities($_SERVER["HTTP_HOST"]) ?> - <?= _("Hestia Control Panel") ?></title>
33
<meta name="viewport" content="width=device-width, initial-scale=1">

0 commit comments

Comments
 (0)