mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
添加重启确认对话框并优化用户配置对话框的布局
This commit is contained in:
@@ -67,17 +67,18 @@ async function updateSiteCookie() {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VDialog max-width="50rem">
|
<VDialog max-width="30rem">
|
||||||
<!-- Dialog Content -->
|
<!-- Dialog Content -->
|
||||||
<VCard title="更新站点Cookie & UA">
|
<VCard title="更新站点Cookie & UA">
|
||||||
<DialogCloseBtn @click="emit('close')" />
|
<DialogCloseBtn @click="emit('close')" />
|
||||||
|
<VDivider />
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<VForm @submit.prevent="() => {}">
|
<VForm @submit.prevent="() => {}">
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol cols="12" md="4">
|
<VCol cols="12">
|
||||||
<VTextField v-model="userPwForm.username" label="用户名" :rules="[requiredValidator]" />
|
<VTextField v-model="userPwForm.username" label="用户名" :rules="[requiredValidator]" />
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="4">
|
<VCol cols="12">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="userPwForm.password"
|
v-model="userPwForm.password"
|
||||||
label="密码"
|
label="密码"
|
||||||
@@ -88,19 +89,19 @@ async function updateSiteCookie() {
|
|||||||
@keydown.enter="updateSiteCookie"
|
@keydown.enter="updateSiteCookie"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="4">
|
<VCol cols="12">
|
||||||
<VTextField v-model="userPwForm.code" label="两步验证" />
|
<VTextField v-model="userPwForm.code" label="两步验证" />
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
</VForm>
|
</VForm>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
|
<VCardActions class="mx-auto">
|
||||||
<VCardActions>
|
|
||||||
<VSpacer />
|
|
||||||
<VBtn
|
<VBtn
|
||||||
|
size="large"
|
||||||
variant="elevated"
|
variant="elevated"
|
||||||
@click="updateSiteCookie"
|
@click="updateSiteCookie"
|
||||||
:disabled="updateButtonDisable"
|
:disabled="updateButtonDisable"
|
||||||
|
:loading="updateButtonDisable"
|
||||||
prepend-icon="mdi-refresh"
|
prepend-icon="mdi-refresh"
|
||||||
class="px-5"
|
class="px-5"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ const progressDialog = ref(false)
|
|||||||
// 站点认证对话框
|
// 站点认证对话框
|
||||||
const siteAuthDialog = ref(false)
|
const siteAuthDialog = ref(false)
|
||||||
|
|
||||||
|
// 重启确认对话框
|
||||||
|
const restartDialog = ref(false)
|
||||||
|
|
||||||
// 执行注销操作
|
// 执行注销操作
|
||||||
function logout() {
|
function logout() {
|
||||||
// 清除登录状态信息
|
// 清除登录状态信息
|
||||||
@@ -33,13 +36,8 @@ function logout() {
|
|||||||
|
|
||||||
// 执行重启操作
|
// 执行重启操作
|
||||||
async function restart() {
|
async function restart() {
|
||||||
// 弹出提示
|
{
|
||||||
const confirmed = await createConfirm({
|
restartDialog.value = false
|
||||||
title: '确认',
|
|
||||||
content: '确认重启系统吗?',
|
|
||||||
})
|
|
||||||
|
|
||||||
if (confirmed) {
|
|
||||||
// 调用API重启
|
// 调用API重启
|
||||||
try {
|
try {
|
||||||
// 显示等待框
|
// 显示等待框
|
||||||
@@ -60,6 +58,11 @@ async function restart() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 显示重启确认对话框
|
||||||
|
async function showRestartDialog() {
|
||||||
|
restartDialog.value = true
|
||||||
|
}
|
||||||
|
|
||||||
// 显示站点认证对话框
|
// 显示站点认证对话框
|
||||||
function showSiteAuthDialog() {
|
function showSiteAuthDialog() {
|
||||||
siteAuthDialog.value = true
|
siteAuthDialog.value = true
|
||||||
@@ -130,7 +133,7 @@ const userLevel = computed(() => store.state.auth.level)
|
|||||||
<VDivider v-if="superUser" class="my-2" />
|
<VDivider v-if="superUser" class="my-2" />
|
||||||
|
|
||||||
<!-- 👉 restart -->
|
<!-- 👉 restart -->
|
||||||
<VListItem v-if="superUser" @click="restart">
|
<VListItem v-if="superUser" @click="showRestartDialog">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<VIcon class="me-2" icon="mdi-restart" size="22" />
|
<VIcon class="me-2" icon="mdi-restart" size="22" />
|
||||||
</template>
|
</template>
|
||||||
@@ -152,4 +155,22 @@ const userLevel = computed(() => store.state.auth.level)
|
|||||||
<ProgressDialog v-if="progressDialog" v-model="progressDialog" text="正在重启 ..." />
|
<ProgressDialog v-if="progressDialog" v-model="progressDialog" text="正在重启 ..." />
|
||||||
<!-- 用户认证对话框 -->
|
<!-- 用户认证对话框 -->
|
||||||
<UserAuthDialog v-if="siteAuthDialog" v-model="siteAuthDialog" @done="siteAuthDone" @close="siteAuthDialog = false" />
|
<UserAuthDialog v-if="siteAuthDialog" v-model="siteAuthDialog" @done="siteAuthDone" @close="siteAuthDialog = false" />
|
||||||
|
<!-- 重启确认对话框 -->
|
||||||
|
<VDialog v-model="restartDialog" max-width="30rem">
|
||||||
|
<VCard>
|
||||||
|
<VCardItem>
|
||||||
|
<VAlert type="error" variant="text" icon="mdi-alert" prominent class="mt-5">
|
||||||
|
<p class="font-bold text-xl">确认重启系统吗?</p>
|
||||||
|
<p>重启后,您将被注销并需要重新登录。</p>
|
||||||
|
</VAlert>
|
||||||
|
</VCardItem>
|
||||||
|
<VCardActions class="mx-auto">
|
||||||
|
<VBtn variant="elevated" color="error" size="large" @click="restart" prepend-icon="mdi-restart" class="px-5">
|
||||||
|
确定
|
||||||
|
</VBtn>
|
||||||
|
<VBtn variant="tonal" color="secondary" size="large" class="px-5" @click="restartDialog = false">取消</VBtn>
|
||||||
|
</VCardActions>
|
||||||
|
<DialogCloseBtn @click="restartDialog = false" />
|
||||||
|
</VCard>
|
||||||
|
</VDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user