From 6451075c5b699c016cc3073287f4cd5190b1e445 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 2 Nov 2023 22:45:57 +0100 Subject: [PATCH 1/2] Icon for `k-stat` --- config/areas/system/views.php | 17 +++--- panel/lab/components/stats/1_stats/index.vue | 14 +++-- panel/lab/components/stats/2_stat/index.vue | 3 ++ panel/src/components/Layout/Stat.vue | 41 ++++++++------- tests/Panel/Areas/SystemTest.php | 54 +++++++++++--------- 5 files changed, 74 insertions(+), 55 deletions(-) diff --git a/config/areas/system/views.php b/config/areas/system/views.php index dab7de6cfd..b786f06c9a 100644 --- a/config/areas/system/views.php +++ b/config/areas/system/views.php @@ -17,25 +17,26 @@ 'label' => $license ? I18n::translate('license') : I18n::translate('license.register.label'), 'value' => $license ? 'Kirby 3' : I18n::translate('license.unregistered.label'), 'theme' => $license ? null : 'negative', + 'icon' => $license ? 'info' : 'key', 'dialog' => $license ? 'license' : 'registration' ], [ 'label' => $updateStatus?->label() ?? I18n::translate('version'), 'value' => $kirby->version(), - 'link' => ( - $updateStatus ? - $updateStatus->url() : - 'https://github.com/getkirby/kirby/releases/tag/' . $kirby->version() - ), - 'theme' => $updateStatus?->theme() + 'link' => $updateStatus?->url() ?? + 'https://github.com/getkirby/kirby/releases/tag/' . $kirby->version(), + 'theme' => $updateStatus?->theme(), + 'icon' => $updateStatus?->icon() ?? 'info' ], [ 'label' => 'PHP', - 'value' => phpversion() + 'value' => phpversion(), + 'icon' => 'code' ], [ 'label' => I18n::translate('server'), - 'value' => $system->serverSoftware() ?? '?' + 'value' => $system->serverSoftware() ?? '?', + 'icon' => 'server' ] ]; diff --git a/panel/lab/components/stats/1_stats/index.vue b/panel/lab/components/stats/1_stats/index.vue index 30ea13fc7c..2c3c4515de 100644 --- a/panel/lab/components/stats/1_stats/index.vue +++ b/panel/lab/components/stats/1_stats/index.vue @@ -18,27 +18,31 @@ export default { label: "Views", value: "12.250", info: "+120%", - theme: "positive" + theme: "positive", + icon: "preview" }, { label: "Visitors", value: "3.500", info: "0%", - theme: "info" + theme: "info", + icon: "users" }, { label: "Searches", value: "1.250", info: "-10%", - theme: "negative" + theme: "negative", + icon: "search" } ]; }, reportsWithoutTheme() { - return this.$helper.clone(this.reports).map(report => { + return this.$helper.clone(this.reports).map((report) => { + report.icon = null; report.theme = null; return report; - }) + }); } } }; diff --git a/panel/lab/components/stats/2_stat/index.vue b/panel/lab/components/stats/2_stat/index.vue index d5be376c8a..b855ad1a5d 100644 --- a/panel/lab/components/stats/2_stat/index.vue +++ b/panel/lab/components/stats/2_stat/index.vue @@ -1,5 +1,8 @@