diff --git a/dashboard/src/Index.vue b/dashboard/src/Index.vue index 0093ab088..2ccfa4bac 100644 --- a/dashboard/src/Index.vue +++ b/dashboard/src/Index.vue @@ -9,6 +9,7 @@ import ProvisionModel from './models/ProvisionModel.js'; import DashboardModel from './models/DashboardModel.js'; import BrandingModel from './models/BrandingModel.js'; import Headerbar from './components/Headerbar.vue'; +import SubscriptionRequiredDialog from './components/SubscriptionRequiredDialog.vue'; import OfflineOverlay from './components/OfflineOverlay.vue'; import AppsView from './views/AppsView.vue'; import AppConfigureView from './views/AppConfigureView.vue'; @@ -98,6 +99,7 @@ const profileModel = ProfileModel.create(); const provisionModel = ProvisionModel.create(); const sidebar = useTemplateRef('sidebar'); +const subscriptionDialog = useTemplateRef('subscriptionDialog'); const ready = ref(false); const view = ref(''); const profile = ref({}); @@ -193,6 +195,10 @@ ProfileModel.onChange(ProfileModel.KEYS.AVATAR, (value) => { profile.value.avatarUrl = value; }); +function onSubscriptionRequired() { + subscriptionDialog.value.open(); +} + onMounted(async () => { let [error, result] = await provisionModel.status(); if (error) return console.error(error); @@ -234,6 +240,7 @@ onMounted(async () => {
+
@@ -279,7 +286,7 @@ onMounted(async () => {
- +
diff --git a/dashboard/src/components/Headerbar.vue b/dashboard/src/components/Headerbar.vue index c861d9abc..df5586c44 100644 --- a/dashboard/src/components/Headerbar.vue +++ b/dashboard/src/components/Headerbar.vue @@ -7,6 +7,7 @@ import { Button, Popover, Icon } from 'pankow'; import NotificationsModel from '../models/NotificationsModel.js'; const props = defineProps(['config', 'profile', 'subscription']); +const emits = defineEmits(['subscriptionRequired']); const notificationModel = NotificationsModel.create(); const notificationButton = useTemplateRef('notificationButton'); @@ -52,6 +53,10 @@ async function refresh() { notifications.value = result; } +function onSubscriptionRequired() { + emits('subscriptionRequired'); +} + onMounted(async () => { if (props.profile.isAtLeastAdmin) await refresh(); }); @@ -89,14 +94,9 @@ onMounted(async () => {
-
- - {{ $t(subscription.plan.id === 'free' ? 'settings.appstoreAccount.subscriptionSetupAction' : 'settings.appstoreAccount.subscriptionReactivateAction') }} - -
-
- Subscription Expired -
+ +
Subscription Expired
+
{{ notifications.length > 99 ? '99+' : notifications.length }}
{{ profile.username }} @@ -155,4 +155,15 @@ onMounted(async () => { visibility: visible; } +.subscription-expired { + background-color: var(--pankow-color-danger); + color: white; + border-radius: 20px; +} + +.subscription-expired:hover { + color: white; + background-color: var(--pankow-color-danger-hover); +} + diff --git a/dashboard/src/components/SubscriptionRequiredDialog.vue b/dashboard/src/components/SubscriptionRequiredDialog.vue new file mode 100644 index 000000000..86177bc85 --- /dev/null +++ b/dashboard/src/components/SubscriptionRequiredDialog.vue @@ -0,0 +1,21 @@ + + +