feat(SiteResourceDialog): 改进对话框布局

This commit is contained in:
jxxghp
2025-02-17 20:41:52 +08:00
parent 3a5999c341
commit 27bc2a488f
3 changed files with 41 additions and 18 deletions
+18 -12
View File
@@ -26,7 +26,7 @@ const siteIcon = ref<string>('')
const $toast = useToast() const $toast = useToast()
// 测试按钮文字 // 测试按钮文字
const testButtonText = ref('连通性测试') const testButtonText = ref('测试连通性')
// 测试按钮可用性 // 测试按钮可用性
const testButtonDisable = ref(false) const testButtonDisable = ref(false)
@@ -65,7 +65,7 @@ async function testSite() {
if (result.success) $toast.success(`${cardProps.site?.name} 连通性测试成功,可正常使用!`) if (result.success) $toast.success(`${cardProps.site?.name} 连通性测试成功,可正常使用!`)
else $toast.error(`${cardProps.site?.name} 连通性测试失败:${result.message}`) else $toast.error(`${cardProps.site?.name} 连通性测试失败:${result.message}`)
testButtonText.value = '连通性测试' testButtonText.value = '测试连通性'
testButtonDisable.value = false testButtonDisable.value = false
getSiteStats() getSiteStats()
@@ -153,7 +153,7 @@ onMounted(() => {
<VCard <VCard
:variant="cardProps.site?.is_active ? 'elevated' : 'outlined'" :variant="cardProps.site?.is_active ? 'elevated' : 'outlined'"
class="overflow-hidden h-full flex flex-col" class="overflow-hidden h-full flex flex-col"
@click="siteEditDialog = true" @click="handleResourceBrowse"
> >
<template #image> <template #image>
<VAvatar class="absolute right-2 bottom-2 rounded" variant="flat" rounded="0"> <VAvatar class="absolute right-2 bottom-2 rounded" variant="flat" rounded="0">
@@ -162,10 +162,10 @@ onMounted(() => {
</template> </template>
<VCardItem style="padding-block-end: 0"> <VCardItem style="padding-block-end: 0">
<VCardTitle class="font-bold"> <VCardTitle class="font-bold">
<span @click.stop="openSitePage">{{ cardProps.site?.name }}</span> {{ cardProps.site?.name }}
</VCardTitle> </VCardTitle>
<VCardSubtitle> <VCardSubtitle>
<span @click.stop="openSitePage">{{ cardProps.site?.url }}</span> {{ cardProps.site?.url }}
</VCardSubtitle> </VCardSubtitle>
</VCardItem> </VCardItem>
<VCardText class="py-1"> <VCardText class="py-1">
@@ -195,6 +195,12 @@ onMounted(() => {
<VIcon icon="mdi-chevron-down" color="primary" /> <VIcon icon="mdi-chevron-down" color="primary" />
<VMenu activator="parent" close-on-content-click> <VMenu activator="parent" close-on-content-click>
<VList> <VList>
<VListItem variant="plain" @click="siteEditDialog = true">
<template #prepend>
<VIcon icon="mdi-file-edit-outline" />
</template>
<VListItemTitle>编辑站点</VListItemTitle>
</VListItem>
<VListItem variant="plain" v-if="!cardProps.site?.public" @click="handleSiteUpdate"> <VListItem variant="plain" v-if="!cardProps.site?.public" @click="handleSiteUpdate">
<template #prepend> <template #prepend>
<VIcon icon="mdi-refresh" /> <VIcon icon="mdi-refresh" />
@@ -207,17 +213,17 @@ onMounted(() => {
</template> </template>
<VListItemTitle>{{ testButtonText }}</VListItemTitle> <VListItemTitle>{{ testButtonText }}</VListItemTitle>
</VListItem> </VListItem>
<VListItem variant="plain" @click="handleResourceBrowse">
<template #prepend>
<VIcon icon="mdi-web" />
</template>
<VListItemTitle>资源预览</VListItemTitle>
</VListItem>
<VListItem variant="plain" @click="handleSiteUserData"> <VListItem variant="plain" @click="handleSiteUserData">
<template #prepend> <template #prepend>
<VIcon icon="mdi-chart-bell-curve" /> <VIcon icon="mdi-chart-bell-curve" />
</template> </template>
<VListItemTitle>站点数据</VListItemTitle> <VListItemTitle>查看站点数据</VListItemTitle>
</VListItem>
<VListItem variant="plain" @click="openSitePage">
<template #prepend>
<VIcon icon="mdi-open-in-new" />
</template>
<VListItemTitle>访问站点</VListItemTitle>
</VListItem> </VListItem>
</VList> </VList>
</VMenu> </VMenu>
+16 -5
View File
@@ -99,11 +99,21 @@ onMounted(() => {
}) })
</script> </script>
<template> <template>
<VDialog max-width="80rem" scrollable :fullscreen="!display.mdAndUp.value"> <VDialog scrollable fullscreen :scrim="false" transition="dialog-bottom-transition">
<VCard :title="`浏览 - ${props.site?.name}`"> <VCard>
<DialogCloseBtn @click="emit('close')" /> <!-- Toolbar -->
<VDivider /> <div>
<VCardText class="pt-2"> <VToolbar color="primary">
<VToolbarTitle>{{ `浏览 - ${props.site?.name}` }}</VToolbarTitle>
<VSpacer />
<VToolbarItems>
<VBtn icon variant="plain" @click="emit('close')" class="me-3">
<VIcon size="large" color="white" icon="ri-close-line" />
</VBtn>
</VToolbarItems>
</VToolbar>
</div>
<VCardText class="pt-2 px-0">
<VDataTable <VDataTable
v-model:items-per-page="resourceItemsPerPage" v-model:items-per-page="resourceItemsPerPage"
:headers="resourceHeaders" :headers="resourceHeaders"
@@ -119,6 +129,7 @@ onMounted(() => {
items-per-page-text="每页条数" items-per-page-text="每页条数"
page-text="{0}-{1} {2} " page-text="{0}-{1} {2} "
loading-text="加载中..." loading-text="加载中..."
class="h-full"
> >
<template #item.title="{ item }"> <template #item.title="{ item }">
<a href="javascript:void(0)" @click.stop="addDownload(item)"> <a href="javascript:void(0)" @click.stop="addDownload(item)">
+7 -1
View File
@@ -4,10 +4,16 @@
@tailwind utilities; @tailwind utilities;
html.v-overlay-scroll-blocked { html.v-overlay-scroll-blocked {
position: relative; position: fixed;
--v-body-scroll-y: 0px !important; --v-body-scroll-y: 0px !important;
} }
@media (max-width: 768px){
html.v-overlay-scroll-blocked {
position: relative;
}
}
#nprogress .bar { #nprogress .bar {
background: rgb(var(--v-theme-primary)) !important; background: rgb(var(--v-theme-primary)) !important;
inset-block-start: env(safe-area-inset-top) !important; inset-block-start: env(safe-area-inset-top) !important;