From 041c2d176c13d8b61c14d23ed1c3bbbe46d3f694 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 15 Oct 2023 11:26:08 +0200 Subject: [PATCH] more bootstrap-5.3 adjustments in css-classes etc. Signed-off-by: Michael Kaufmann --- lib/Froxlor/UI/Callbacks/Style.php | 22 +-- .../Froxlor/settings/opcacheinfo.html.twig | 167 ++++++++++-------- templates/Froxlor/table/macros.html.twig | 2 +- .../Froxlor/user/dashboard-item.html.twig | 65 ++++--- 4 files changed, 144 insertions(+), 112 deletions(-) diff --git a/lib/Froxlor/UI/Callbacks/Style.php b/lib/Froxlor/UI/Callbacks/Style.php index 8d23b5d9ba..511a118bdb 100644 --- a/lib/Froxlor/UI/Callbacks/Style.php +++ b/lib/Froxlor/UI/Callbacks/Style.php @@ -31,17 +31,17 @@ class Style { public static function deactivated(array $attributes): string { - return $attributes['fields']['deactivated'] ? 'bg-danger' : ''; + return $attributes['fields']['deactivated'] ? 'table-danger' : ''; } public static function loginDisabled(array $attributes): string { - return $attributes['fields']['login_enabled'] == 'N' ? 'bg-danger' : ''; + return $attributes['fields']['login_enabled'] == 'N' ? 'table-danger' : ''; } public static function resultIntegrityBad(array $attributes): string { - return $attributes['fields']['result'] ? '' : 'bg-warning'; + return $attributes['fields']['result'] ? '' : 'table-warning'; } public static function invalidApiKey(array $attributes): string @@ -53,7 +53,7 @@ public static function invalidApiKey(array $attributes): string $isValid = false; } } - return $isValid ? '' : 'bg-danger'; + return $isValid ? '' : 'table-danger'; } public static function resultDomainTerminatedOrDeactivated(array $attributes): string @@ -63,24 +63,24 @@ public static function resultDomainTerminatedOrDeactivated(array $attributes): s if (!empty($termination_date)) { $cdate = strtotime($termination_date . " 23:59:59"); $today = time(); - $termination_css = 'bg-warning'; + $termination_css = 'table-warning'; if ($cdate < $today) { - $termination_css = 'bg-danger text-light'; + $termination_css = 'table-danger'; } } $deactivated = $attributes['fields']['deactivated'] || $attributes['fields']['customer_deactivated']; - return $deactivated ? 'bg-info text-light' : $termination_css; + return $deactivated ? 'table-info' : $termination_css; } public static function resultCustomerLockedOrDeactivated(array $attributes): string { $row_css = ''; if ((int)$attributes['fields']['deactivated'] == 1) { - $row_css = 'bg-info text-light'; + $row_css = 'table-info'; } elseif ($attributes['fields']['loginfail_count'] >= Settings::Get('login.maxloginattempts') && $attributes['fields']['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime')) ) { - $row_css = 'bg-warning'; + $row_css = 'table-warning'; } return $row_css; @@ -96,9 +96,9 @@ private static function getWarningStyle(string $field, array $attributes, int $r $style = ''; if ((int)$attributes[$field] >= 0) { if (($attributes[$field] / 100) * $report_max < $attributes[$field . '_used']) { - $style = 'bg-danger'; + $style = 'table-danger'; } elseif (($attributes[$field] / 100) * ($report_max - 15) < $attributes[$field . '_used']) { - $style = 'bg-warning'; + $style = 'table-warning'; } } return $style; diff --git a/templates/Froxlor/settings/opcacheinfo.html.twig b/templates/Froxlor/settings/opcacheinfo.html.twig index ae52bc5206..adabcf48cc 100644 --- a/templates/Froxlor/settings/opcacheinfo.html.twig +++ b/templates/Froxlor/settings/opcacheinfo.html.twig @@ -20,9 +20,14 @@
{{ lng('opcacheinfo.memusage') }}
-
-
- {{ opcacheinfo.overview.used_memory_percentage }}% +
+
+ {{ opcacheinfo.overview.used_memory_percentage }} + %
    @@ -49,10 +54,22 @@
    {{ lng('opcacheinfo.hitsc') }}
    -
    -
    -
    - {{ opcacheinfo.overview.hit_rate_percentage }}% +
    +
    +
    +
    +
    +
    +
    + {{ opcacheinfo.overview.hit_rate_percentage }} + %
      @@ -80,8 +97,13 @@
      {{ lng('opcacheinfo.usedkey') }}
      -
      - {{ opcacheinfo.overview.used_key_percentage }}% +
      + {{ opcacheinfo.overview.used_key_percentage }} + %
        @@ -108,15 +130,18 @@
      • {{ lng('opcacheinfo.used') }} - {{ opcacheinfo.overview.readable.interned.strings_used_memory }} + {{ opcacheinfo.overview.readable.interned.strings_used_memory }}
      • {{ lng('opcacheinfo.free') }} - {{ opcacheinfo.overview.readable.interned.strings_free_memory }} + {{ opcacheinfo.overview.readable.interned.strings_free_memory }}
      • {{ lng('opcacheinfo.strcount') }} - {{ opcacheinfo.overview.readable.interned.number_of_strings }} + {{ opcacheinfo.overview.readable.interned.number_of_strings }}
    @@ -128,53 +153,53 @@
    - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {{ lng('opcacheinfo.generaltitle') }}
    {{ lng('opcacheinfo.version') }}{{ opcacheinfo.version.version }}
    {{ lng('opcacheinfo.phpversion') }}{{ opcacheinfo.version.php }}
    {{ lng('admin.hostname') }}{{ opcacheinfo.version.host }}
    {{ lng('admin.serversoftware') }}{{ opcacheinfo.version.server }}
    {{ lng('opcacheinfo.start') }}{{ opcacheinfo.overview.start_time|date('d.m.Y H:i:s') }}
    {{ lng('opcacheinfo.lastreset') }} - {% if opcacheinfo.overview.last_restart_time > 0 %} - {{ opcacheinfo.overview.last_restart_time|date('d.m.Y H:i:s') }} - {% else %} - {{ lng('panel.never') }} - {% endif %} -
    {{ lng('opcacheinfo.generaltitle') }}
    {{ lng('opcacheinfo.version') }}{{ opcacheinfo.version.version }}
    {{ lng('opcacheinfo.phpversion') }}{{ opcacheinfo.version.php }}
    {{ lng('admin.hostname') }}{{ opcacheinfo.version.host }}
    {{ lng('admin.serversoftware') }}{{ opcacheinfo.version.server }}
    {{ lng('opcacheinfo.start') }}{{ opcacheinfo.overview.start_time|date('d.m.Y H:i:s') }}
    {{ lng('opcacheinfo.lastreset') }} + {% if opcacheinfo.overview.last_restart_time > 0 %} + {{ opcacheinfo.overview.last_restart_time|date('d.m.Y H:i:s') }} + {% else %} + {{ lng('panel.never') }} + {% endif %} +
    - - - - {% for funcs in opcacheinfo.functions %} + + + + {% for funcs in opcacheinfo.functions %} - {% endfor %} + {% endfor %}
    {{ lng('opcacheinfo.funcsavail') }}
    {{ lng('opcacheinfo.funcsavail') }}
    {{ funcs }}
    @@ -183,29 +208,29 @@
    + + + + {% for directive in opcacheinfo.directives %} - + + - {% for directive in opcacheinfo.directives %} - - - - - {% endfor %} + {% endfor %}
    {{ lng('opcacheinfo.runtimeconf') }}
    {{ lng('opcacheinfo.runtimeconf') }}{{ directive.k }} + {% if directive.v is iterable %} + {% for vval in directive.v %} + {% if vval is iterable %} + {% for val2 in vval %} + {{ val2|raw }}
    + {% endfor %} + {% else %} + {{ vval|raw }}
    + {% endif %} + {% endfor %} + {% else %} + {{ directive.v|raw }} + {% endif %} +
    {{ directive.k }} - {% if directive.v is iterable %} - {% for vval in directive.v %} - {% if vval is iterable %} - {% for val2 in vval %} - {{ val2|raw }}
    - {% endfor %} - {% else %} - {{ vval|raw }}
    - {% endif %} - {% endfor %} - {% else %} - {{ directive.v|raw }} - {% endif %} -
    diff --git a/templates/Froxlor/table/macros.html.twig b/templates/Froxlor/table/macros.html.twig index 32fecdafef..c006f4bd7c 100644 --- a/templates/Froxlor/table/macros.html.twig +++ b/templates/Froxlor/table/macros.html.twig @@ -1,5 +1,5 @@ {% macro progressbar(data) %} -
    +
    diff --git a/templates/Froxlor/user/dashboard-item.html.twig b/templates/Froxlor/user/dashboard-item.html.twig index 6127207708..1489cde73c 100644 --- a/templates/Froxlor/user/dashboard-item.html.twig +++ b/templates/Froxlor/user/dashboard-item.html.twig @@ -1,31 +1,38 @@ {% macro ditem(lngstr, available, used, assigned = null, formatbytes = false, byte_usage = null) %} -
    -
    -
    {{ lng(lngstr) }}{% if byte_usage %} ({{ byte_usage|formatBytes }}){% endif %}
    -
    - {% if formatbytes %}{{ used|formatBytes }}{% else %}{{ used }}{% endif %}/{% if available < 0 %}{{ lng('panel.unlimited') }}{% else %}{% if formatbytes %}{{ available|formatBytes }}{% else %}{{ available }}{% endif %}{% endif %} -
    -
    -
    - {% set usageperc = 1 %} - {% if available > 0 %} - {% set usageperc = (used / available) * 100|round %} - {% endif %} -
    -
    - {% if assigned is not empty %} -
    -
    -
    - {% endif %} -
    +
    +
    +
    {{ lng(lngstr) }}{% if byte_usage %} ({{ byte_usage|formatBytes }} + ){% endif %}
    +
    + {% if formatbytes %}{{ used|formatBytes }}{% else %}{{ used }}{% endif %} + /{% if available < 0 %}{{ lng('panel.unlimited') }}{% else %}{% if formatbytes %}{{ available|formatBytes }}{% else %}{{ available }}{% endif %}{% endif %} +
    +
    + {% set usageperc = 1 %} + {% if available > 0 %} + {% set usageperc = (used / available) * 100|round %} + {% endif %} +
    +
    +
    + {% if assigned is not empty %} +
    +
    +
    + {% endif %} +
    {% endmacro %}