[#31] replaced the initial admin create interactive cli with Installer web page

This commit is contained in:
Gani Georgiev
2022-07-10 11:46:21 +03:00
parent 460c684caa
commit 0739e90ff2
28 changed files with 812 additions and 1064 deletions
+43
View File
@@ -0,0 +1,43 @@
<script>
import { tick } from "svelte";
import { replace } from "svelte-spa-router";
import ApiClient from "@/utils/ApiClient";
import FullPage from "@/components/base/FullPage.svelte";
import Installer from "@/components/base/Installer.svelte";
let showInstaller = false;
handler();
function handler() {
showInstaller = false;
const realQueryParams = new URLSearchParams(window.location.search);
if (realQueryParams.has(import.meta.env.PB_INSTALLER_PARAM)) {
ApiClient.logout(false);
showInstaller = true;
return;
}
if (ApiClient.AuthStore.isValid) {
replace("/collections");
} else {
ApiClient.logout();
}
}
</script>
{#if showInstaller}
<FullPage>
<Installer
on:submit={async () => {
showInstaller = false;
await tick();
// clear the installer param
window.location.search = "";
}}
/>
</FullPage>
{/if}