mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-04 00:30:27 +00:00
improve UI for demo instance
This commit is contained in:
parent
79f1456017
commit
5f57b1ed97
6 changed files with 36 additions and 0 deletions
|
@ -1580,6 +1580,9 @@ const docTemplate = `{
|
|||
"build": {
|
||||
"$ref": "#/definitions/v1.Build"
|
||||
},
|
||||
"demo": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"health": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
|
|
@ -1572,6 +1572,9 @@
|
|||
"build": {
|
||||
"$ref": "#/definitions/v1.Build"
|
||||
},
|
||||
"demo": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"health": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
|
|
@ -335,6 +335,8 @@ definitions:
|
|||
properties:
|
||||
build:
|
||||
$ref: '#/definitions/v1.Build'
|
||||
demo:
|
||||
type: boolean
|
||||
health:
|
||||
type: boolean
|
||||
message:
|
||||
|
|
|
@ -56,6 +56,10 @@ func NewControllerV1(svc *services.AllServices, options ...func(*V1Controller))
|
|||
svc: svc,
|
||||
}
|
||||
|
||||
for _, opt := range options {
|
||||
opt(ctrl)
|
||||
}
|
||||
|
||||
return ctrl
|
||||
}
|
||||
|
||||
|
|
|
@ -227,6 +227,7 @@ export interface UserRegistration {
|
|||
|
||||
export interface ApiSummary {
|
||||
build: Build;
|
||||
demo: boolean;
|
||||
health: boolean;
|
||||
message: string;
|
||||
title: string;
|
||||
|
|
|
@ -11,6 +11,24 @@
|
|||
const api = usePublicApi();
|
||||
const toast = useNotifier();
|
||||
|
||||
const { data: status } = useAsyncData(async () => {
|
||||
const { data } = await api.status();
|
||||
|
||||
if (data) {
|
||||
console.log(data);
|
||||
username.value = "demo@email.com";
|
||||
password.value = "demo";
|
||||
}
|
||||
return data;
|
||||
});
|
||||
|
||||
whenever(status, status => {
|
||||
if (status?.demo) {
|
||||
email.value = "demo@email.com";
|
||||
loginPassword.value = "demo";
|
||||
}
|
||||
});
|
||||
|
||||
const authStore = useAuthStore();
|
||||
if (!authStore.isTokenExpired) {
|
||||
navigateTo("/home");
|
||||
|
@ -178,6 +196,11 @@
|
|||
<Icon name="heroicons-user" class="mr-1 w-7 h-7" />
|
||||
Login
|
||||
</h2>
|
||||
<template v-if="status && status.demo">
|
||||
<p class="text-xs italic text-center">This is a demo instance</p>
|
||||
<p class="text-xs text-center"><b>Email</b> demo@email.com</p>
|
||||
<p class="text-xs text-center"><b>Password</b> demo</p>
|
||||
</template>
|
||||
<FormTextField v-model="email" label="Email" />
|
||||
<FormTextField v-model="loginPassword" label="Password" type="password" />
|
||||
<div class="card-actions justify-end mt-2">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue