Compare commits

..

No commits in common. "1954909786e8987858903995a9a2f7e8597ed5e5" and "501bf7a5f4895f5b821abfe62830602171a57655" have entirely different histories.

2 changed files with 16 additions and 6 deletions

View File

@ -5,12 +5,14 @@
import FileUpload from "./FileUpload.svelte"; import FileUpload from "./FileUpload.svelte";
import FormLayout from "./FormLayout.svelte"; import FormLayout from "./FormLayout.svelte";
import Pagination from "./Pagination.svelte"; import Pagination from "./Pagination.svelte";
import StatCards from "./StatCards.svelte";
import Table from "./Table.svelte"; import Table from "./Table.svelte";
import Tabs from "./Tabs.svelte"; import Tabs from "./Tabs.svelte";
import Tags from "./Tags.svelte"; import Tags from "./Tags.svelte";
</script> </script>
<div class="border-4 border-dashed rounded h-96 mb-4" /> <div class="border-4 border-dashed rounded h-96" />
<StatCards />
<div class="mb-8"> <div class="mb-8">
<FileUpload /> <FileUpload />
</div> </div>

View File

@ -8,8 +8,8 @@
import Toastify from "toastify-js"; import Toastify from "toastify-js";
import "toastify-js/src/toastify.css"; import "toastify-js/src/toastify.css";
// ------ // ------
let username = "demo"; let usersUsername;
let password = "demo"; let usersPassword = "";
let is_blocked_by_autologin = false; let is_blocked_by_autologin = false;
let last_loginclick_processed = true; let last_loginclick_processed = true;
@ -37,6 +37,14 @@
text: $_("login_is_checked"), text: $_("login_is_checked"),
duration: 500, duration: 500,
}).showToast(); }).showToast();
let username = usersUsername;
let password = usersPassword;
// if ((usersUsername + "").length == 0) {
username = config.fallback_username || "demo";
// }
// if ((usersPassword + "").length == 0) {
password = config.fallback_password || "demo";
// }
AuthService.authControllerLogin({ AuthService.authControllerLogin({
username, username,
password, password,
@ -46,7 +54,7 @@
OpenAPI.TOKEN = result.access_token; OpenAPI.TOKEN = result.access_token;
const jwtinfo = JSON.parse(atob(OpenAPI.TOKEN.split(".")[1])); const jwtinfo = JSON.parse(atob(OpenAPI.TOKEN.split(".")[1]));
store.login(result.access_token, jwtinfo); store.login(result.access_token, jwtinfo);
location.replace("/"); replace("/");
Toastify({ Toastify({
text: $_("welcome_wavinghand"), text: $_("welcome_wavinghand"),
duration: 500, duration: 500,
@ -103,14 +111,14 @@
class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm" class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm"
on:keydown={handleKeydown} on:keydown={handleKeydown}
placeholder={$_('email_address_or_username')} placeholder={$_('email_address_or_username')}
bind:value={username} /> bind:value={usersUsername} />
</div> </div>
<div class="-mt-px relative"> <div class="-mt-px relative">
<input <input
aria-label={$_('password')} aria-label={$_('password')}
type="password" type="password"
required="" required=""
bind:value={password} bind:value={usersPassword}
class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border rounded-b-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm" class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border rounded-b-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm"
on:keydown={handleKeydown} on:keydown={handleKeydown}
placeholder={$_('password')} /> placeholder={$_('password')} />