Add new vue-based frontend
This commit is contained in:
34
packages/sshecret-frontend/src/main.ts
Normal file
34
packages/sshecret-frontend/src/main.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import './assets/main.css'
|
||||
// Added for shoelace.
|
||||
// See note on CDB usage: https://shoelace.style/frameworks/vue
|
||||
import '@shoelace-style/shoelace/dist/themes/light.css'
|
||||
import { setBasePath } from '@shoelace-style/shoelace/dist/utilities/base-path'
|
||||
|
||||
setBasePath('https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.1/cdn/')
|
||||
import ShoelaceModelDirective from '@shoelace-style/vue-sl-model'
|
||||
|
||||
// End of shoelace import
|
||||
|
||||
import { createPinia } from 'pinia'
|
||||
import { createApp } from 'vue'
|
||||
import '@/api/interceptors'
|
||||
import { useAuthTokenStore } from '@/store/auth'
|
||||
import { client } from '@/client/client.gen'
|
||||
|
||||
import router from './router'
|
||||
import App from './App.vue'
|
||||
|
||||
const baseURL = import.meta.env.SSHECRET_FRONTEND_API_BASE_URL
|
||||
|
||||
client.setConfig({ baseURL })
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(createPinia())
|
||||
app.use(router)
|
||||
app.use(ShoelaceModelDirective)
|
||||
|
||||
useAuthTokenStore().loadFromStorage()
|
||||
|
||||
|
||||
app.mount('#app')
|
||||
Reference in New Issue
Block a user