diff --git a/apps/desktop/src/renderer/components.d.ts b/apps/desktop/src/renderer/components.d.ts index 0132c3c61..c31097493 100644 --- a/apps/desktop/src/renderer/components.d.ts +++ b/apps/desktop/src/renderer/components.d.ts @@ -22,6 +22,7 @@ declare module 'vue' { ElContainer: typeof import('element-plus/es')['ElContainer'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElIconDelete: typeof import('@element-plus/icons-vue')['Delete'] + ElIconDownload: typeof import('@element-plus/icons-vue')['Download'] ElIconPrinter: typeof import('@element-plus/icons-vue')['Printer'] ElIconUpload: typeof import('@element-plus/icons-vue')['Upload'] ElIconWarning: typeof import('@element-plus/icons-vue')['Warning'] diff --git a/apps/desktop/src/renderer/src/main.ts b/apps/desktop/src/renderer/src/main.ts index 1ce80bd09..87c745870 100644 --- a/apps/desktop/src/renderer/src/main.ts +++ b/apps/desktop/src/renderer/src/main.ts @@ -1,17 +1,19 @@ +import type { PlatformType } from 'mqttx' import useSettingsService from '@database/services/SettingsService' -import { i18n } from '@mqttx/ui/i18n' +import { i18n } from '@mqttx/ui/i18n' import App from './App.vue' -import { router } from './router' +import { router } from './router' import '@mqttx/ui/styles.scss' import './assets/scss/main.scss' // Create Vue const app = createApp(App) - const pinia = createPinia() +app.provide('platformType', 'desktop') + app.use(router).use(pinia) const { getSettingsInDB } = useSettingsService() diff --git a/apps/web/components.d.ts b/apps/web/components.d.ts index 4e094ce5e..ead027120 100644 --- a/apps/web/components.d.ts +++ b/apps/web/components.d.ts @@ -22,6 +22,7 @@ declare module 'vue' { ElContainer: typeof import('element-plus/es')['ElContainer'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElIconDelete: typeof import('@element-plus/icons-vue')['Delete'] + ElIconDownload: typeof import('@element-plus/icons-vue')['Download'] ElIconPrinter: typeof import('@element-plus/icons-vue')['Printer'] ElIconUpload: typeof import('@element-plus/icons-vue')['Upload'] ElIconWarning: typeof import('@element-plus/icons-vue')['Warning'] diff --git a/apps/web/src/main.ts b/apps/web/src/main.ts index 94f7ce095..bc558a409 100644 --- a/apps/web/src/main.ts +++ b/apps/web/src/main.ts @@ -1,9 +1,10 @@ +import type { PlatformType } from 'mqttx' import { i18n } from '@mqttx/ui/i18n' -import App from './App.vue' +import App from './App.vue' import { createDatabase } from './database' -import useSettingsService from './database/services/SettingsService' +import useSettingsService from './database/services/SettingsService' import { router } from './router' import '@mqttx/ui/styles.scss' import './assets/scss/main.scss' @@ -12,9 +13,10 @@ const database = createDatabase() // Create Vue const app = createApp(App) - const pinia = createPinia() +app.provide('platformType', 'web') + app.use(router).use(pinia) database.then(async (db) => { diff --git a/packages/types/base.ts b/packages/types/base.ts index 67a9c6b45..b92dfa26e 100644 --- a/packages/types/base.ts +++ b/packages/types/base.ts @@ -1,3 +1,5 @@ +export type PlatformType = 'desktop' | 'web' + export type MQTTVersion = 3 | 4 | 5 export type Protocol = 'mqtt' | 'mqtts' diff --git a/packages/ui/components.d.ts b/packages/ui/components.d.ts index 66dc03f38..0f88d63cd 100644 --- a/packages/ui/components.d.ts +++ b/packages/ui/components.d.ts @@ -20,6 +20,7 @@ declare module 'vue' { ElCol: typeof import('element-plus/es')['ElCol'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElIconDelete: typeof import('@element-plus/icons-vue')['Delete'] + ElIconDownload: typeof import('@element-plus/icons-vue')['Download'] ElIconPrinter: typeof import('@element-plus/icons-vue')['Printer'] ElIconUpload: typeof import('@element-plus/icons-vue')['Upload'] ElIconWarning: typeof import('@element-plus/icons-vue')['Warning'] diff --git a/packages/ui/src/components/SettingsView.vue b/packages/ui/src/components/SettingsView.vue index dbf713799..923dd1a33 100644 --- a/packages/ui/src/components/SettingsView.vue +++ b/packages/ui/src/components/SettingsView.vue @@ -1,9 +1,11 @@