This commit is contained in:
jxxghp
2023-07-06 22:33:59 +08:00
parent 91530af029
commit d2c73bbeda
+18 -34
View File
@@ -1,4 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { requiredValidator } from "@/@validators";
import api from "@/api"; import api from "@/api";
import { Site } from "@/api/types"; import { Site } from "@/api/types";
import { useToast } from "vue-toast-notification"; import { useToast } from "vue-toast-notification";
@@ -9,6 +10,9 @@ const props = defineProps({
height: String, height: String,
}); });
// 密码输入
const isPasswordVisible = ref(false);
// 图标 // 图标
const siteIcon = ref<string>(""); const siteIcon = ref<string>("");
@@ -106,12 +110,7 @@ onMounted(() => {
</script> </script>
<template> <template>
<VCard <VCard :height="props.height" :width="props.width" :flat="!props.site?.is_active" class="overflow-hidden">
:height="props.height"
:width="props.width"
:flat="!props.site?.is_active"
class="overflow-hidden"
>
<template #image> <template #image>
<VAvatar class="absolute right-2 bottom-2" variant="flat" rounded="0"> <VAvatar class="absolute right-2 bottom-2" variant="flat" rounded="0">
<VImg :src="siteIcon" /> <VImg :src="siteIcon" />
@@ -122,28 +121,16 @@ onMounted(() => {
<VCardSubtitle>{{ props.site?.url }}</VCardSubtitle> <VCardSubtitle>{{ props.site?.url }}</VCardSubtitle>
</VCardItem> </VCardItem>
<div <div class="absolute top-0 right-0 flex items-center justify-between p-2" v-if="props.site?.is_active">
class="absolute top-0 right-0 flex items-center justify-between p-2"
v-if="props.site?.is_active"
>
<div class="pointer-events-none z-40 flex items-center"> <div class="pointer-events-none z-40 flex items-center">
<div <div
class="relative inline-flex whitespace-nowrap rounded-full border-gray-700 font-semibold leading-5 ring-gray-700" class="relative inline-flex whitespace-nowrap rounded-full border-gray-700 font-semibold leading-5 ring-gray-700">
>
<div <div
class="rounded-full bg-opacity-80 shadow-md w-5 border p-0 bg-green-500 border-green-400 ring-green-400 text-green-100" class="rounded-full bg-opacity-80 shadow-md w-5 border p-0 bg-green-500 border-green-400 ring-green-400 text-green-100">
> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<svg <path fill-rule="evenodd"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
aria-hidden="true"
>
<path
fill-rule="evenodd"
d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z"
clip-rule="evenodd" clip-rule="evenodd"></path>
></path>
</svg> </svg>
</div> </div>
</div> </div>
@@ -171,12 +158,7 @@ onMounted(() => {
<VTooltip text="过滤" v-if="props.site?.filter"> <VTooltip text="过滤" v-if="props.site?.filter">
<template #activator="{ props }"> <template #activator="{ props }">
<VIcon <VIcon color="primary" class="me-2" v-bind="props" icon="mdi-filter-cog-outline" />
color="primary"
class="me-2"
v-bind="props"
icon="mdi-filter-cog-outline"
/>
</template> </template>
</VTooltip> </VTooltip>
</VCardText> </VCardText>
@@ -206,13 +188,15 @@ onMounted(() => {
<!-- Dialog Content --> <!-- Dialog Content -->
<VCard title="更新站点Cookie & UA"> <VCard title="更新站点Cookie & UA">
<VCardText> <VCardText>
<VForm @submit.prevent="() => {}" ref="userPwForm"> <VForm @submit.prevent="() => { }" ref="userPwForm">
<VRow> <VRow>
<VCol cols="6"> <VCol cols="6">
<VTextField v-model="userPwForm.username" label="用户名" /> <VTextField v-model="userPwForm.username" label="用户名" :rules="[requiredValidator]" />
</VCol> </VCol>
<VCol cols="6"> <VCol cols="6">
<VTextField v-model="userPwForm.password" type="password" label="密码" /> <VTextField v-model="userPwForm.password" label="密码" :type="isPasswordVisible ? 'text' : 'password'"
:append-inner-icon="isPasswordVisible ? 'mdi-eye-off-outline' : 'mdi-eye-outline'
" :rules="[requiredValidator]" @keydown.enter="updateSiteCookie" />
</VCol> </VCol>
</VRow> </VRow>
</VForm> </VForm>
@@ -220,7 +204,7 @@ onMounted(() => {
<VCardActions> <VCardActions>
<VSpacer /> <VSpacer />
<VBtn @click="updateSiteCookie" @keydown.enter="updateSiteCookie"> <VBtn @click="updateSiteCookie">
开始更新 开始更新
</VBtn> </VBtn>
</VCardActions> </VCardActions>