diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index 69e7fc7..b1e641b 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -35,5 +35,35 @@ export default { badButton: "I dont like Ukraine", }, } + }, + bootstrap: { + title: "Looks like you are first time here. Let us help you", + + header: { + language: "Select language", + data: "Data", + itarmy: "ITArmy ID" + + }, + + language: { + continueButton: "Continue" + }, + + data: { + body: "Application will automatically download required modules and store them on yours PC. Modules and all the data will be stored in the folder", + windows: "Before continue, make sure you added data folder to the windows defender and antivirus exceptions. Otherwise, all the downloaded data will be deleted.", + openDataFolderButton: "Open data folder", + changeDataFolderButton: "Change data folder", + continueButton: "Continue", + backButton: "Back" + }, + + itarmy: { + body: "If you have ITArmy ID, you can enter it here. Otherwise, you can skip this step.", + uuidInputTitle: "ITArmy ID", + continueButton: "Continue", + backButton: "Back" + } } } diff --git a/src/pages/bootstrap/BootstrapPage.vue b/src/pages/bootstrap/BootstrapPage.vue index a9e1771..107925b 100644 --- a/src/pages/bootstrap/BootstrapPage.vue +++ b/src/pages/bootstrap/BootstrapPage.vue @@ -1,57 +1,64 @@ \ No newline at end of file diff --git a/src/router/guards.ts b/src/router/guards.ts new file mode 100644 index 0000000..6d8cd5c --- /dev/null +++ b/src/router/guards.ts @@ -0,0 +1,11 @@ +import { NavigationGuardNext, RouteLocationNormalized } from 'vue-router' + +export async function bootstrapGuard(to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) { + const settings = await window.settingsAPI.get() + console.log(settings) + if (settings.bootstrap.step !== "DONE") { + return next({ name: 'bootstrap' }) + } + + return next() +} \ No newline at end of file diff --git a/src/router/routes.ts b/src/router/routes.ts index 37b76b5..8d2b755 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -1,4 +1,5 @@ import { RouteRecordRaw } from 'vue-router' +import { bootstrapGuard } from './guards' const routes: RouteRecordRaw[] = [ { @@ -13,7 +14,14 @@ const routes: RouteRecordRaw[] = [ { path: '/settings', name: 'settings', component: () => import('pages/SettingsPage.vue') }, { path: '/top', name: 'top', component: () => import('pages/top/TopPage.vue') }, { path: '/developers', name: 'developers', component: () => import('pages/developers/DevelopersPage.vue') } - ] + ], + beforeEnter: [ bootstrapGuard ] + }, + + { + path: '/bootstrap', + name: 'bootstrap', + component: () => import('pages/bootstrap/BootstrapPage.vue') }, // Always leave this as last one,