From 3078e1ee0991ac95755222298b8ab345e4e9c865 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Thu, 2 Jan 2025 10:03:53 +0000 Subject: [PATCH 1/3] Show "Expired" for expired licenses fixes #4889 Admin overview showed "Expires: 2025-01-01" even when license has already expired, implying there was time left. Now shows "Expied: 2024-01-01" after license has expired. --- frontend/src/pages/admin/Overview.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/admin/Overview.vue b/frontend/src/pages/admin/Overview.vue index 6f83e22c4d..2722428d65 100644 --- a/frontend/src/pages/admin/Overview.vue +++ b/frontend/src/pages/admin/Overview.vue @@ -50,7 +50,7 @@ Users @@ -112,13 +112,17 @@ export default { return { license: {}, stats: {}, - settings: {} + settings: {}, + expired: false } }, async mounted () { try { this.stats = await adminApi.getStats() this.license = await adminApi.getLicenseDetails() + if ((Date.parse(this.license.expiresAt) - Date.now()) < 0) { + this.expired = true + } } catch (err) { if (err.response?.status === 403 || !err.response) { this.$router.push('/') From 77710a657701ecc96f436f7243e2d4bdeb9369c3 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Thu, 2 Jan 2025 10:44:04 +0000 Subject: [PATCH 2/3] Support no license --- frontend/src/pages/admin/Overview.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/admin/Overview.vue b/frontend/src/pages/admin/Overview.vue index 2722428d65..c7a2148de8 100644 --- a/frontend/src/pages/admin/Overview.vue +++ b/frontend/src/pages/admin/Overview.vue @@ -120,7 +120,7 @@ export default { try { this.stats = await adminApi.getStats() this.license = await adminApi.getLicenseDetails() - if ((Date.parse(this.license.expiresAt) - Date.now()) < 0) { + if (this.license?.expiresAt && (Date.parse(this.license.expiresAt) - Date.now()) < 0) { this.expired = true } } catch (err) { From 488215db4a6ba972cd58ed71d60ba74b351c3067 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Fri, 3 Jan 2025 15:48:27 +0000 Subject: [PATCH 3/3] Update frontend/src/pages/admin/Overview.vue Co-authored-by: Zeger-Jan van de Weg --- frontend/src/pages/admin/Overview.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/pages/admin/Overview.vue b/frontend/src/pages/admin/Overview.vue index c7a2148de8..6ad1abdc45 100644 --- a/frontend/src/pages/admin/Overview.vue +++ b/frontend/src/pages/admin/Overview.vue @@ -120,9 +120,7 @@ export default { try { this.stats = await adminApi.getStats() this.license = await adminApi.getLicenseDetails() - if (this.license?.expiresAt && (Date.parse(this.license.expiresAt) - Date.now()) < 0) { - this.expired = true - } + this.expired = this.license?.expiresAt && (Date.parse(this.license.expiresAt) - Date.now()) < 0 } catch (err) { if (err.response?.status === 403 || !err.response) { this.$router.push('/')