mirror of
https://github.com/unraid/api.git
synced 2026-04-30 04:01:10 -05:00
fix: include nuxt ui configuration files in web-components-plugins
This commit is contained in:
+1
-1
@@ -3,4 +3,4 @@ Title="Detail Layout"
|
||||
Icon="icon-u-globe"
|
||||
Tag="globe"
|
||||
---
|
||||
<unraid-detail-test></unraid-detail-test>
|
||||
<unraid-detail-test />
|
||||
@@ -5,6 +5,9 @@ import { DefaultApolloClient } from '@vue/apollo-composable';
|
||||
// Import Tailwind CSS for web components shadow DOM injection
|
||||
import tailwindStyles from '~/assets/main.css?inline';
|
||||
|
||||
// Import UI configurations from .nuxt generated files
|
||||
import * as uiConfig from '~/.nuxt/ui';
|
||||
|
||||
import en_US from '~/locales/en_US.json';
|
||||
import { createHtmlEntityDecoder } from '~/helpers/i18n-utils';
|
||||
import { globalPinia } from '~/store/globalPinia';
|
||||
@@ -23,7 +26,7 @@ export default function (Vue: App) {
|
||||
if (windowLocaleData) {
|
||||
try {
|
||||
parsedMessages = JSON.parse(decodeURIComponent(windowLocaleData));
|
||||
parsedLocale = Object.keys(parsedMessages)[0];
|
||||
parsedLocale = Object.keys(parsedMessages)[0] || '';
|
||||
nonDefaultLocale = parsedLocale !== defaultLocale;
|
||||
} catch (error) {
|
||||
console.error('[WebComponentPlugins] error parsing messages', error);
|
||||
@@ -50,6 +53,10 @@ export default function (Vue: App) {
|
||||
// Provide Apollo client for all web components
|
||||
Vue.provide(DefaultApolloClient, client);
|
||||
|
||||
// Provide UI config for components
|
||||
Vue.provide('ui.config', uiConfig);
|
||||
|
||||
|
||||
// Inject Tailwind CSS into the shadow DOM
|
||||
Vue.mixin({
|
||||
mounted() {
|
||||
|
||||
+13
-10
@@ -10,16 +10,19 @@ const themeStore = useThemeStore();
|
||||
// Initialize theme on mount
|
||||
onMounted(() => {
|
||||
// Set a default theme similar to ColorSwitcherCe
|
||||
const defaultTheme = {
|
||||
banner: false,
|
||||
bannerGradient: false,
|
||||
descriptionShow: true,
|
||||
textColor: defaultColors.white['--header-text-primary']!,
|
||||
metaColor: defaultColors.white['--header-text-secondary']!,
|
||||
bgColor: defaultColors.white['--header-background-color']!,
|
||||
name: 'white',
|
||||
};
|
||||
themeStore.setTheme(defaultTheme);
|
||||
const whiteTheme = defaultColors.white;
|
||||
if (whiteTheme) {
|
||||
const defaultTheme = {
|
||||
banner: false,
|
||||
bannerGradient: false,
|
||||
descriptionShow: true,
|
||||
textColor: whiteTheme['--header-text-primary'],
|
||||
metaColor: whiteTheme['--header-text-secondary'],
|
||||
bgColor: whiteTheme['--header-background-color'],
|
||||
name: 'white',
|
||||
};
|
||||
themeStore.setTheme(defaultTheme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user