Files
api/web/components/UserProfile/ServerState.vue
Eli Bosley 86b6c4f85b fix: inject Tailwind CSS into client entry point (#1537)
Added a Vite plugin to automatically inject the Tailwind CSS import into
the `unraid-components.client.js` entry file, enhancing the integration
of Tailwind CSS within the application. This change improves the setup
for styling components consistently across the project.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added automated validation to ensure Tailwind CSS styles are correctly
included in the custom elements build output.

* **Chores**
* Updated the build process to include a CSS validation step after
manifest generation.
* Enhanced development build configuration to enable CSS source maps and
optimize Tailwind CSS injection into web components.
  * Extended CSS theme with new responsive breakpoint variables.
* Improved CSS class specificity in user profile, server state, and
update modal components for consistent styling.
* Removed redundant style blocks and global CSS imports from multiple
components to streamline styling and reduce duplication.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-23 15:30:57 -04:00

46 lines
1.6 KiB
Vue

<script setup lang="ts">
import { computed } from 'vue';
import { storeToRefs } from 'pinia';
import type { ComposerTranslation } from 'vue-i18n';
import { useServerStore } from '~/store/server';
import type { ServerStateDataAction } from '~/types/server';
import UpcServerStateBuy from './ServerStateBuy.vue';
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-2">
<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-px hidden sm:!block"
:title="t('Purchase Key')"
@click="purchaseAction.click?.()"
>{{ t('Purchase') }}</UpcServerStateBuy>
</template>
</span>
</template>