-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
1,972 additions
and
2,009 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import config from '@repo/configs/prettier/base' | ||
import config from "@repo/configs/prettier/base"; | ||
|
||
export default config; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import vueConfig from '@repo/configs/eslint/vue.js' | ||
import vueConfig from "@repo/configs/eslint/vue.js"; | ||
|
||
export default vueConfig | ||
export default vueConfig; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
import {createApp} from "vue"; | ||
import { createApp } from "vue"; | ||
import App from "./App.vue"; | ||
import ElementPlus from "element-plus"; | ||
import {createPinia} from "pinia"; | ||
import {agreedEula, loadApp} from "@repo/commons/src/utils/loader"; | ||
import {setRouter} from "@repo/commons/src/utils/globals"; | ||
import { createPinia } from "pinia"; | ||
import { agreedEula, loadApp } from "@repo/commons/src/utils/loader"; | ||
import { setRouter } from "@repo/commons/src/utils/globals"; | ||
import router from "./router"; | ||
import {createI18n} from "vue-i18n"; | ||
import {useLocale} from "@repo/commons/src/utils/uses"; | ||
import { type } from '@tauri-apps/plugin-os'; | ||
import { createI18n } from "vue-i18n"; | ||
import { useLocale } from "@repo/commons/src/utils/uses"; | ||
import { type } from "@tauri-apps/plugin-os"; | ||
|
||
const app = createApp(App) | ||
app.use(router) | ||
app.use(ElementPlus) | ||
const app = createApp(App); | ||
app.use(router); | ||
app.use(ElementPlus); | ||
app.use(createPinia()); | ||
|
||
(async () => { | ||
const messages: any = {}; | ||
const localeStore = useLocale() | ||
for (const locale of localeStore.locales) { | ||
messages[locale] = (await import(`./assets/i18n/${locale}.json`)).default; | ||
} | ||
const i18n = createI18n(await useLocale().getConfig(messages)) | ||
const messages: any = {}; | ||
const localeStore = useLocale(); | ||
for (const locale of localeStore.locales) { | ||
messages[locale] = (await import(`./assets/i18n/${locale}.json`)).default; | ||
} | ||
const i18n = createI18n(await useLocale().getConfig(messages)); | ||
|
||
return { | ||
i18n | ||
} | ||
})().then(async ({i18n}) => { | ||
app.use(i18n) | ||
setRouter(router) | ||
app.mount("#app"); | ||
const os = type() | ||
if (os == 'macos') { | ||
document.body.classList.add('tauri-macos') | ||
} else if(os == 'windows' || os == 'linux') { | ||
document.body.classList.add('tauri-desktop') | ||
} else { | ||
document.body.classList.add('tauri-mobile') | ||
} | ||
if (!agreedEula.value) await router.push('/welcome/welcome') | ||
await loadApp() | ||
}) | ||
return { | ||
i18n, | ||
}; | ||
})().then(async ({ i18n }) => { | ||
app.use(i18n); | ||
setRouter(router); | ||
app.mount("#app"); | ||
const os = type(); | ||
if (os == "macos") { | ||
document.body.classList.add("tauri-macos"); | ||
} else if (os == "windows" || os == "linux") { | ||
document.body.classList.add("tauri-desktop"); | ||
} else { | ||
document.body.classList.add("tauri-mobile"); | ||
} | ||
if (!agreedEula.value) await router.push("/welcome/welcome"); | ||
await loadApp(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,70 @@ | ||
import {createRouter, createWebHistory} from "vue-router"; | ||
import {ref} from "vue"; | ||
import {agreedEula} from "@repo/commons/src/utils/loader.ts"; | ||
import Home from "@repo/commons/src/pages/Home.vue" | ||
import Welcome from "@repo/commons/src/pages/welcome/Welcome.vue" | ||
import Eula from "@repo/commons/src/pages/welcome/Eula.vue" | ||
import Done from "@repo/commons/src/pages/welcome/Done.vue" | ||
import Connect from "@repo/commons/src/pages/Connect.vue" | ||
import Debug from "@repo/commons/src/pages/Debug.vue" | ||
import Instances from "@repo/commons/src/pages/Instances.vue" | ||
import News from "@repo/commons/src/pages/News.vue" | ||
import { createRouter, createWebHistory } from "vue-router"; | ||
import { ref } from "vue"; | ||
import { agreedEula } from "@repo/commons/src/utils/loader.ts"; | ||
import Home from "@repo/commons/src/pages/Home.vue"; | ||
import Welcome from "@repo/commons/src/pages/welcome/Welcome.vue"; | ||
import Eula from "@repo/commons/src/pages/welcome/Eula.vue"; | ||
import Done from "@repo/commons/src/pages/welcome/Done.vue"; | ||
import Connect from "@repo/commons/src/pages/Connect.vue"; | ||
import Debug from "@repo/commons/src/pages/Debug.vue"; | ||
import Instances from "@repo/commons/src/pages/Instances.vue"; | ||
import News from "@repo/commons/src/pages/News.vue"; | ||
|
||
export type LayoutType = 'none' | 'default' | ||
export type LayoutType = "none" | "default"; | ||
|
||
export const layout = ref<LayoutType>('default') | ||
export const layout = ref<LayoutType>("default"); | ||
|
||
const router = createRouter({ | ||
history: createWebHistory(import.meta.env.BASE_URL), | ||
routes: [ | ||
{ | ||
path: "/", | ||
component: Home | ||
}, | ||
{ | ||
path: "/welcome/welcome", | ||
component: Welcome, | ||
meta: { | ||
layout: 'none' | ||
} | ||
}, | ||
{ | ||
path: "/welcome/eula", | ||
component: Eula, | ||
meta: { | ||
layout: 'none' | ||
} | ||
}, | ||
{ | ||
path: "/welcome/done", | ||
component: Done, | ||
meta: { | ||
layout: 'none' | ||
} | ||
}, | ||
{ | ||
path: "/connect", | ||
component: Connect | ||
}, | ||
{ | ||
path: "/debug", | ||
component: Debug | ||
}, | ||
{ | ||
path: "/instances", | ||
component: Instances | ||
}, | ||
{ | ||
path: "/news", | ||
component: News | ||
}, | ||
], | ||
history: createWebHistory(import.meta.env.BASE_URL), | ||
routes: [ | ||
{ | ||
path: "/", | ||
component: Home, | ||
}, | ||
{ | ||
path: "/welcome/welcome", | ||
component: Welcome, | ||
meta: { | ||
layout: "none", | ||
}, | ||
}, | ||
{ | ||
path: "/welcome/eula", | ||
component: Eula, | ||
meta: { | ||
layout: "none", | ||
}, | ||
}, | ||
{ | ||
path: "/welcome/done", | ||
component: Done, | ||
meta: { | ||
layout: "none", | ||
}, | ||
}, | ||
{ | ||
path: "/connect", | ||
component: Connect, | ||
}, | ||
{ | ||
path: "/debug", | ||
component: Debug, | ||
}, | ||
{ | ||
path: "/instances", | ||
component: Instances, | ||
}, | ||
{ | ||
path: "/news", | ||
component: News, | ||
}, | ||
], | ||
}); | ||
|
||
router.beforeEach(async (to, _from, next) => { | ||
layout.value = <LayoutType | undefined>to.meta.layout ?? 'default' | ||
layout.value = <LayoutType | undefined>to.meta.layout ?? "default"; | ||
|
||
next() | ||
}) | ||
next(); | ||
}); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
// https://nuxt.com/docs/guide/concepts/typescript | ||
"extends": ["@repo/configs/ts/vue.json"] | ||
// https://nuxt.com/docs/guide/concepts/typescript | ||
"extends": ["@repo/configs/ts/vue.json"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import config from '@repo/configs/prettier/base' | ||
import config from "@repo/configs/prettier/base"; | ||
|
||
export default config; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,4 @@ pnpm i | |
pnpm dev # start a dev server | ||
pnpm run docs # generate docs | ||
pnpm build # build for production | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
const config = { | ||
appVersion: async () => { | ||
return (await import('./package.json')).default.version; | ||
}, | ||
updater: 'https://example.com/update.json', | ||
resourcepackFormat: 1, | ||
appVersion: async () => { | ||
return (await import("./package.json")).default.version; | ||
}, | ||
updater: "https://example.com/update.json", | ||
resourcepackFormat: 1, | ||
}; | ||
|
||
(async () => { | ||
console.log('MCSL Future Web version: ' + (await config.appVersion())); | ||
console.log("MCSL Future Web version: " + (await config.appVersion())); | ||
})(); | ||
|
||
export default defineAppConfig(config); |
Oops, something went wrong.