mirror of
https://github.com/unraid/api.git
synced 2026-01-01 22:20:05 -06:00
* feat(theme): add default header colors for theme differences * refactor(theme): update UserProfile component colors to use theme variables * fix(theme): safely handle default header colors for themes
44 lines
1.5 KiB
Vue
44 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import { storeToRefs } from 'pinia';
|
|
import type { ComposerTranslation } from 'vue-i18n';
|
|
|
|
import { useServerStore } from '~/store/server';
|
|
import type { ServerStateDataAction } from '~/types/server';
|
|
|
|
defineProps<{ t: ComposerTranslation; }>();
|
|
|
|
const { state, stateData } = storeToRefs(useServerStore());
|
|
|
|
const purchaseAction = computed((): ServerStateDataAction | undefined => {
|
|
return stateData.value.actions && stateData.value.actions.find(action => action.name === 'purchase');
|
|
});
|
|
const upgradeAction = computed((): ServerStateDataAction | undefined => {
|
|
return stateData.value.actions && stateData.value.actions.find(action => action.name === 'upgrade');
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<span class="flex flex-row items-center gap-x-8px">
|
|
<template v-if="upgradeAction">
|
|
<UpcServerStateBuy
|
|
class="text-header-text-secondary"
|
|
:title="t('Upgrade Key')"
|
|
@click="upgradeAction.click?.()"
|
|
>
|
|
<h5>Unraid OS <em><strong>{{ t(stateData.humanReadable) }}</strong></em></h5>
|
|
</UpcServerStateBuy>
|
|
</template>
|
|
<h5 v-else>
|
|
Unraid OS <em :class="{ 'text-unraid-red': stateData.error || state === 'EEXPIRED' }"><strong>{{ t(stateData.humanReadable) }}</strong></em>
|
|
</h5>
|
|
|
|
<template v-if="purchaseAction">
|
|
<UpcServerStateBuy
|
|
class="text-orange-dark relative top-[1px] hidden sm:block"
|
|
:title="t('Purchase Key')"
|
|
@click="purchaseAction.click?.()"
|
|
>{{ t('Purchase') }}</UpcServerStateBuy>
|
|
</template>
|
|
</span>
|
|
</template>
|