re-factor(front): use new components on plugin pages and pw reset

This commit is contained in:
ArneBo 2025-05-10 11:47:38 +02:00 committed by Arne Bollinger
parent 1feffad091
commit 8e2511ea4a
3 changed files with 49 additions and 36 deletions

View File

@ -67,7 +67,11 @@ const submitAndScan = async () => {
:class="['ui form', {loading: isLoading}]" :class="['ui form', {loading: isLoading}]"
@submit.prevent="submit" @submit.prevent="submit"
> >
<h3>{{ plugin.label }}</h3> <h2>{{ plugin.label }}</h2>
<Alert blue>
<Layout flex>
<p><i class="bi bi-info-circle-fill" /></p>
<Layout stack no-gap>
<sanitized-html <sanitized-html
v-if="plugin.description" v-if="plugin.description"
:html="description" :html="description"
@ -77,10 +81,13 @@ const submitAndScan = async () => {
:href="plugin.homepage" :href="plugin.homepage"
target="_blank" target="_blank"
> >
<i class="external icon" /> <i class="bi bi-box-arrow-up-right" />
{{ t('components.auth.Plugin.link.documentation') }} {{ t('components.auth.Plugin.link.documentation') }}
</a> </a>
</template> </template>
</Layout>
</Layout>
</Alert>
<Alert <Alert
v-if="errors.length > 0" v-if="errors.length > 0"
red red

View File

@ -6,7 +6,10 @@ import { computed, ref } from 'vue'
import axios from 'axios' import axios from 'axios'
import Layout from '~/components/ui/Layout.vue'
import Alert from '~/components/ui/Alert.vue' import Alert from '~/components/ui/Alert.vue'
import Input from '~/components/ui/Input.vue'
import Link from '~/components/ui/Link.vue'
import Button from '~/components/ui/Button.vue' import Button from '~/components/ui/Button.vue'
interface Props { interface Props {
@ -56,15 +59,13 @@ const submit = async () => {
class="main" class="main"
> >
<h2>{{ labels.changePassword }}</h2> <h2>{{ labels.changePassword }}</h2>
<form <Layout form
v-if="!success" v-if="!success"
class="ui form"
@submit.prevent="submit()" @submit.prevent="submit()"
> >
<Alert <Alert
v-if="errors.length > 0" v-if="errors.length > 0"
role="alert" red
class="ui negative message"
> >
<h4 class="header"> <h4 class="header">
{{ t('views.auth.PasswordResetConfirm.header.failure') }} {{ t('views.auth.PasswordResetConfirm.header.failure') }}
@ -83,26 +84,33 @@ const submit = async () => {
<Input <Input
v-model="newPassword" v-model="newPassword"
password password
label="t('views.auth.PasswordResetConfirm.label.newPassword')" :label="t('views.auth.PasswordResetConfirm.label.newPassword')"
/> />
</div> </div>
<router-link :to="{path: '/login'}"> <Layout flex>
<Link
solid
secondary
:to="{path: '/login'}"
>
{{ t('views.auth.PasswordResetConfirm.link.back') }} {{ t('views.auth.PasswordResetConfirm.link.back') }}
</router-link> </Link>
<Button <Button
:class="['ui', {'loading': isLoading}, 'right', 'floated', 'success', 'button']" :class="['ui', {'loading': isLoading}, 'right', 'floated', 'success', 'button']"
type="submit" type="submit"
auto auto
primary
> >
{{ t('views.auth.PasswordResetConfirm.button.update') }} {{ t('views.auth.PasswordResetConfirm.button.update') }}
</Button> </Button>
</Layout>
</template> </template>
<template v-else> <template v-else>
<p> <p>
{{ t('views.auth.PasswordResetConfirm.message.requestSent') }} {{ t('views.auth.PasswordResetConfirm.message.requestSent') }}
</p> </p>
</template> </template>
</form> </Layout>
<Alert <Alert
v-else v-else
green green

View File

@ -7,6 +7,7 @@ import axios from 'axios'
import PluginForm from '~/components/auth/Plugin.vue' import PluginForm from '~/components/auth/Plugin.vue'
import Layout from '~/components/ui/Layout.vue' import Layout from '~/components/ui/Layout.vue'
import Loader from '~/components/ui/Loader.vue'
import useErrorHandler from '~/composables/useErrorHandler' import useErrorHandler from '~/composables/useErrorHandler'
@ -46,13 +47,10 @@ fetchData()
main main
stack stack
> >
<h2>{{ labels.title }}</h2> <h1>{{ labels.title }}</h1>
<div <Loader
v-if="isLoading" v-if="isLoading"
class="ui inverted active dimmer" />
>
<div class="ui loader" />
</div>
<template v-if="plugins && plugins.length > 0"> <template v-if="plugins && plugins.length > 0">
<plugin-form <plugin-form