Skip to content

Commit 3754eca

Browse files
author
mdatelle
committed
fix: include nuxt ui configuration files in web-components-plugins
1 parent e332c0e commit 3754eca

3 files changed

Lines changed: 22 additions & 12 deletions

File tree

plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/DetailTest.page

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Title="Detail Layout"
33
Icon="icon-u-globe"
44
Tag="globe"
55
---
6-
<unraid-detail-test></unraid-detail-test>
6+
<unraid-detail-test />

web/components/Wrapper/web-component-plugins.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { DefaultApolloClient } from '@vue/apollo-composable';
55
// Import Tailwind CSS for web components shadow DOM injection
66
import tailwindStyles from '~/assets/main.css?inline';
77

8+
// Import UI configurations from .nuxt generated files
9+
import * as uiConfig from '~/.nuxt/ui';
10+
811
import en_US from '~/locales/en_US.json';
912
import { createHtmlEntityDecoder } from '~/helpers/i18n-utils';
1013
import { globalPinia } from '~/store/globalPinia';
@@ -23,7 +26,7 @@ export default function (Vue: App) {
2326
if (windowLocaleData) {
2427
try {
2528
parsedMessages = JSON.parse(decodeURIComponent(windowLocaleData));
26-
parsedLocale = Object.keys(parsedMessages)[0];
29+
parsedLocale = Object.keys(parsedMessages)[0] || '';
2730
nonDefaultLocale = parsedLocale !== defaultLocale;
2831
} catch (error) {
2932
console.error('[WebComponentPlugins] error parsing messages', error);
@@ -50,6 +53,10 @@ export default function (Vue: App) {
5053
// Provide Apollo client for all web components
5154
Vue.provide(DefaultApolloClient, client);
5255

56+
// Provide UI config for components
57+
Vue.provide('ui.config', uiConfig);
58+
59+
5360
// Inject Tailwind CSS into the shadow DOM
5461
Vue.mixin({
5562
mounted() {

web/layouts/unraid-next.vue

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@ const themeStore = useThemeStore();
1010
// Initialize theme on mount
1111
onMounted(() => {
1212
// Set a default theme similar to ColorSwitcherCe
13-
const defaultTheme = {
14-
banner: false,
15-
bannerGradient: false,
16-
descriptionShow: true,
17-
textColor: defaultColors.white['--header-text-primary']!,
18-
metaColor: defaultColors.white['--header-text-secondary']!,
19-
bgColor: defaultColors.white['--header-background-color']!,
20-
name: 'white',
21-
};
22-
themeStore.setTheme(defaultTheme);
13+
const whiteTheme = defaultColors.white;
14+
if (whiteTheme) {
15+
const defaultTheme = {
16+
banner: false,
17+
bannerGradient: false,
18+
descriptionShow: true,
19+
textColor: whiteTheme['--header-text-primary'],
20+
metaColor: whiteTheme['--header-text-secondary'],
21+
bgColor: whiteTheme['--header-background-color'],
22+
name: 'white',
23+
};
24+
themeStore.setTheme(defaultTheme);
25+
}
2326
});
2427
</script>
2528

0 commit comments

Comments
 (0)