mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-08 09:16:58 +08:00
style: Update grid-customrule-card to use larger minimum width for columns
This commit is contained in:
@@ -42,6 +42,18 @@ const notificationTypeNames: { [key: string]: string } = {
|
|||||||
webpush: 'WebPush',
|
webpush: 'WebPush',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 消息类型下拉字典
|
||||||
|
const notificationTypes = [
|
||||||
|
{ value: '资源下载', title: '资源下载' },
|
||||||
|
{ value: '整理入库', title: '整理入库' },
|
||||||
|
{ value: '订阅', title: '订阅' },
|
||||||
|
{ value: '站点', title: '站点' },
|
||||||
|
{ value: '媒体服务器', title: '媒体服务器' },
|
||||||
|
{ value: '手动处理', title: '手动处理' },
|
||||||
|
{ value: '插件', title: '插件' },
|
||||||
|
{ value: '其它', title: '其它' },
|
||||||
|
]
|
||||||
|
|
||||||
// 打开详情弹窗
|
// 打开详情弹窗
|
||||||
function openNotificationInfoDialog() {
|
function openNotificationInfoDialog() {
|
||||||
notificationInfo.value = props.notification
|
notificationInfo.value = props.notification
|
||||||
@@ -106,6 +118,17 @@ function onClose() {
|
|||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
<VSwitch v-model="notificationInfo.enabled" label="启用通知" />
|
<VSwitch v-model="notificationInfo.enabled" label="启用通知" />
|
||||||
</VCol>
|
</VCol>
|
||||||
|
<VCol cols="12">
|
||||||
|
<VSelect
|
||||||
|
v-model="notificationInfo.switchs"
|
||||||
|
:items="notificationTypes"
|
||||||
|
label="消息类型"
|
||||||
|
hint="开启通知的消息类型"
|
||||||
|
multiple
|
||||||
|
chips
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
<VRow v-if="notificationInfo.type == 'wechat'">
|
<VRow v-if="notificationInfo.type == 'wechat'">
|
||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
|
|||||||
@@ -27,21 +27,24 @@ const treeItems = ref<FileItem[]>([
|
|||||||
name: '/',
|
name: '/',
|
||||||
path: props.root,
|
path: props.root,
|
||||||
children: [],
|
children: [],
|
||||||
type: '',
|
type: 'dir',
|
||||||
basename: props.root,
|
basename: props.root,
|
||||||
extension: '',
|
extension: '',
|
||||||
size: 0,
|
size: 0,
|
||||||
modify_time: 0,
|
modify_time: 0,
|
||||||
fileid: '',
|
fileid: '',
|
||||||
parent_fileid: '',
|
parent_fileid: '',
|
||||||
|
storage: 'local',
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
// 拉取子目录
|
// 拉取子目录
|
||||||
async function fetchDirs(item: any) {
|
async function fetchDirs(item: any) {
|
||||||
return api
|
return api
|
||||||
.get('/local/listdir?path=' + item.path)
|
.post('/storage/list', item)
|
||||||
.then((data: any) => {
|
.then((data: any) => {
|
||||||
|
// 只添加目录到子目录
|
||||||
|
data = data.filter((i: any) => i.type === 'dir')
|
||||||
item.children.push(...data)
|
item.children.push(...data)
|
||||||
})
|
})
|
||||||
.catch(err => console.warn(err))
|
.catch(err => console.warn(err))
|
||||||
|
|||||||
@@ -177,7 +177,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.grid-customrule-card {
|
.grid-customrule-card {
|
||||||
grid-template-columns: repeat(auto-fill, minmax(1rem, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
|
||||||
padding-block-end: 1rem;
|
padding-block-end: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ function addDirectory() {
|
|||||||
download_path: '',
|
download_path: '',
|
||||||
priority: -1,
|
priority: -1,
|
||||||
monitor_type: '',
|
monitor_type: '',
|
||||||
|
media_type: '',
|
||||||
|
media_category: '',
|
||||||
})
|
})
|
||||||
orderDirectoryCards()
|
orderDirectoryCards()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import draggable from 'vuedraggable'
|
import draggable from 'vuedraggable'
|
||||||
import type { NotificationConf } from '@/api/types'
|
import type { NotificationConf, NotificationSwitchConf } from '@/api/types'
|
||||||
import NotificationChannelCard from '@/components/cards/NotificationChannelCard.vue'
|
import NotificationChannelCard from '@/components/cards/NotificationChannelCard.vue'
|
||||||
|
|
||||||
// 所有消息渠道
|
// 所有消息渠道
|
||||||
@@ -11,6 +11,42 @@ const notifications = ref<NotificationConf[]>([])
|
|||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
|
|
||||||
|
// 消息类型开关
|
||||||
|
const notificationSwitchs = ref<NotificationSwitchConf[]>([
|
||||||
|
{
|
||||||
|
type: '资源下载',
|
||||||
|
action: 'all',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: '整理入库',
|
||||||
|
action: 'all',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: '订阅',
|
||||||
|
action: 'all',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: '站点',
|
||||||
|
action: 'admin',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: '媒体服务器',
|
||||||
|
action: 'admin',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: '手动处理',
|
||||||
|
action: 'admin',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: '插件',
|
||||||
|
action: 'admin',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: '其它',
|
||||||
|
action: 'admin',
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
// 添加媒体服务器
|
// 添加媒体服务器
|
||||||
function addNotification(notification: string) {
|
function addNotification(notification: string) {
|
||||||
notifications.value.push({
|
notifications.value.push({
|
||||||
@@ -48,9 +84,34 @@ async function saveNotificationSetting() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加载消息类型开关
|
||||||
|
async function loadNotificationSwitchs() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.get('system/setting/NotificationSwitchs')
|
||||||
|
notificationSwitchs.value = result.data?.value ?? []
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存消息类型开关
|
||||||
|
async function saveNotificationSwitchs() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.post(
|
||||||
|
'system/setting/NotificationSwitchs',
|
||||||
|
notificationSwitchs.value,
|
||||||
|
)
|
||||||
|
if (result.success) $toast.success('消息类型开关保存成功')
|
||||||
|
else $toast.error('消息类型开关保存失败!')
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 加载数据
|
// 加载数据
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadNotificationSetting()
|
loadNotificationSetting()
|
||||||
|
loadNotificationSwitchs()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -117,11 +178,33 @@ onMounted(() => {
|
|||||||
<VCardTitle>通知发送范围</VCardTitle>
|
<VCardTitle>通知发送范围</VCardTitle>
|
||||||
<VCardSubtitle>对应消息类型只会发送给设定的用户。</VCardSubtitle>
|
<VCardSubtitle>对应消息类型只会发送给设定的用户。</VCardSubtitle>
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
|
<VTable class="text-no-wrap">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">消息类型</th>
|
||||||
|
<th scope="col">范围</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="(item, index) in notificationSwitchs" :key="index">
|
||||||
|
<td>
|
||||||
|
{{ item.type }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<VRadioGroup v-model="item.action" inline>
|
||||||
|
<VRadio value="user" label="仅操作用户" />
|
||||||
|
<VRadio value="admin" label="仅管理员" />
|
||||||
|
<VRadio value="all" label="所有用户" />
|
||||||
|
</VRadioGroup>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</VTable>
|
||||||
|
<VDivider />
|
||||||
<VCardText>
|
<VCardText>
|
||||||
<VForm @submit.prevent="() => {}">
|
<VForm @submit.prevent="() => {}">
|
||||||
<div class="d-flex flex-wrap gap-4 mt-4">
|
<div class="d-flex flex-wrap gap-4 mt-4">
|
||||||
<VBtn mtype="submit" @click=""> 保存 </VBtn>
|
<VBtn mtype="submit" @click="saveNotificationSwitchs"> 保存 </VBtn>
|
||||||
</div>
|
</div>
|
||||||
</VForm>
|
</VForm>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Site } from '@/api/types'
|
import type { FilterRuleGroup, Site } from '@/api/types'
|
||||||
|
|
||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
@@ -42,8 +42,16 @@ const selectedMediaSource = ref([])
|
|||||||
// 当前选中的过滤规则组
|
// 当前选中的过滤规则组
|
||||||
const selectedFilterGroup = ref([])
|
const selectedFilterGroup = ref([])
|
||||||
|
|
||||||
// 保存用户设置的规则
|
// 过滤规则组选择项
|
||||||
async function saveCustomFilters() {}
|
const filterRuleGroupOptions = computed(() => {
|
||||||
|
return filterRuleGroups.value.map(item => ({
|
||||||
|
title: item.name,
|
||||||
|
value: item.name,
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
|
||||||
|
// 所有规则组列表
|
||||||
|
const filterRuleGroups = ref<FilterRuleGroup[]>([])
|
||||||
|
|
||||||
// 查询所有站点
|
// 查询所有站点
|
||||||
async function querySites() {
|
async function querySites() {
|
||||||
@@ -110,9 +118,20 @@ async function saveSearchSetting() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加载规则组
|
||||||
|
async function queryFilterRuleGroups() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.get('system/setting/UserFilterRuleGroups')
|
||||||
|
filterRuleGroups.value = result.data?.value ?? []
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
querySites()
|
querySites()
|
||||||
loadSearchSetting()
|
loadSearchSetting()
|
||||||
|
queryFilterRuleGroups()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -142,7 +161,7 @@ onMounted(() => {
|
|||||||
v-model="selectedFilterGroup"
|
v-model="selectedFilterGroup"
|
||||||
multiple
|
multiple
|
||||||
chips
|
chips
|
||||||
:items="[]"
|
:items="filterRuleGroupOptions"
|
||||||
label="过滤规则组"
|
label="过滤规则组"
|
||||||
hint="搜索媒体信息时按选定的过滤规则组对结果进行过滤"
|
hint="搜索媒体信息时按选定的过滤规则组对结果进行过滤"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { Site } from '@/api/types'
|
import type { FilterRuleGroup, Site } from '@/api/types'
|
||||||
|
|
||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
@@ -37,6 +37,17 @@ const subscribeModeItems = [
|
|||||||
// 选择的订阅模式
|
// 选择的订阅模式
|
||||||
const selectedSubscribeMode = ref('spider')
|
const selectedSubscribeMode = ref('spider')
|
||||||
|
|
||||||
|
// 所有规则组列表
|
||||||
|
const filterRuleGroups = ref<FilterRuleGroup[]>([])
|
||||||
|
|
||||||
|
// 过滤规则组选择项
|
||||||
|
const filterRuleGroupOptions = computed(() => {
|
||||||
|
return filterRuleGroups.value.map(item => ({
|
||||||
|
title: item.name,
|
||||||
|
value: item.name,
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
|
||||||
// RSS运行周期选择项
|
// RSS运行周期选择项
|
||||||
const rssIntervalItems = [
|
const rssIntervalItems = [
|
||||||
{ title: '5分钟', value: 5 },
|
{ title: '5分钟', value: 5 },
|
||||||
@@ -109,8 +120,19 @@ async function querySites() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加载规则组
|
||||||
|
async function queryFilterRuleGroups() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.get('system/setting/UserFilterRuleGroups')
|
||||||
|
filterRuleGroups.value = result.data?.value ?? []
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
querySites()
|
querySites()
|
||||||
|
queryFilterRuleGroups()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -146,7 +168,7 @@ onMounted(() => {
|
|||||||
<VCol cols="12" md="12">
|
<VCol cols="12" md="12">
|
||||||
<VSelect
|
<VSelect
|
||||||
v-model="selectedFilterRuleGroup"
|
v-model="selectedFilterRuleGroup"
|
||||||
:items="[]"
|
:items="filterRuleGroupOptions"
|
||||||
chips
|
chips
|
||||||
multiple
|
multiple
|
||||||
label="优先级规则组"
|
label="优先级规则组"
|
||||||
|
|||||||
Reference in New Issue
Block a user