This commit is contained in:
jxxghp
2023-07-05 20:23:48 +08:00
parent 5618a9cc71
commit ffa0f38180
6 changed files with 58 additions and 40 deletions

View File

@@ -86,29 +86,32 @@ onMounted(() => {
</script>
<template>
<VCard
:height="props.height"
:width="props.width"
:flat="!props.site?.is_active"
class="overflow-hidden"
>
<VCard :height="props.height" :width="props.width" :flat="!props.site?.is_active" class="overflow-hidden">
<template #image>
<VAvatar class="absolute right-2 bottom-2" variant="flat" rounded="0">
<VImg :src="siteIcon" />
</VAvatar>
</template>
<VCardItem>
<VCardTitle>{{ props.site?.name }}</VCardTitle>
<VCardTitle class="font-bold">{{ props.site?.name }}</VCardTitle>
<VCardSubtitle>{{ props.site?.url }}</VCardSubtitle>
</VCardItem>
<VIcon
v-if="props.site?.is_active"
icon="mdi-check-circle"
color="success"
class="absolute right-2 top-2"
>
</VIcon>
<div 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="relative inline-flex whitespace-nowrap rounded-full border-gray-700 font-semibold leading-5 ring-gray-700 ">
<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">
<svg 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"
clip-rule="evenodd"></path>
</svg>
</div>
</div>
</div>
</div>
<VCardText class="py-2">
<VTooltip text="浏览器仿真" v-if="props.site?.render">
@@ -131,22 +134,29 @@ onMounted(() => {
<VTooltip text="过滤" v-if="props.site?.filter">
<template #activator="{ props }">
<VIcon
color="primary"
class="me-2"
v-bind="props"
icon="mdi-filter-cog-outline"
/>
<VIcon color="primary" class="me-2" v-bind="props" icon="mdi-filter-cog-outline" />
</template>
</VTooltip>
</VCardText>
<VCardActions>
<VBtn @click="updateSite" :disabled="updateButtonDisable">{{
updateButtonText
}}</VBtn>
<VBtn>编辑</VBtn>
<VBtn @click="testSite" :disabled="testButtonDisable">{{ testButtonText }}</VBtn>
</VCardActions>
</VCard>
</template>
<VBtn @click="updateSite" :disabled="updateButtonDisable">
<template #prepend>
<VIcon icon="mdi-refresh"></VIcon>
</template>
{{ updateButtonText }}
</VBtn>
<VBtn>
<template #prepend>
<VIcon icon="mdi-square-edit-outline"></VIcon>
</template>
编辑
</VBtn>
<VBtn @click="testSite" :disabled="testButtonDisable">
<template #prepend>
<VIcon icon="mdi-network-outline"></VIcon>
</template>
{{ testButtonText }}
</VBtn>
</VCardActions>
</VCard></template>

View File

@@ -19,3 +19,11 @@
.v-toast--bottom {
margin-bottom: env(safe-area-inset-top);
}
.centered {
position: absolute;
inset-block-start: 50%;
inset-inline-start: 50%;
transform: translate(-50%, -50%);
}

View File

@@ -136,10 +136,4 @@ const fetchData = async ({ done }) => {
grid-template-columns: repeat(auto-fill, minmax(9.375rem, 1fr));
}
.centered {
position: absolute;
inset-block-start: 50%;
inset-inline-start: 50%;
transform: translate(-50%, -50%);
}
</style>

View File

@@ -79,10 +79,4 @@ onUnmounted(() => {
padding-block-end: 1rem;
}
.centered {
position: absolute;
inset-block-start: 50%;
inset-inline-start: 50%;
transform: translate(-50%, -50%);
}
</style>

View File

@@ -24,6 +24,12 @@ onBeforeMount(fetchData)
</script>
<template>
<VProgressCircular
class="centered"
v-if="!isRefreshed"
indeterminate
color="primary"
></VProgressCircular>
<div
class="grid gap-3 grid-site-card"
v-if="dataList.length > 0"

View File

@@ -46,6 +46,12 @@ const filteredDataList = computed(() => {
</script>
<template>
<VProgressCircular
class="centered"
v-if="!isRefreshed"
indeterminate
color="primary"
></VProgressCircular>
<PullRefresh v-model="loading" @refresh="onRefresh">
<div class="grid gap-3 grid-subscribe-card"
v-if="filteredDataList.length > 0">