Create 2026 admin theme interactions
This commit is contained in:
@@ -85,6 +85,7 @@ type DetailPolicyActionOption = {
|
||||
action: AdminFilePolicyAction
|
||||
label: string
|
||||
description: string
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
type BatchPolicyActionOption = DetailPolicyActionOption
|
||||
@@ -393,21 +394,24 @@ export function useAdminFiles() {
|
||||
}
|
||||
])
|
||||
|
||||
const detailPolicyActionOptions = computed<DetailPolicyActionOption[]>(() => [
|
||||
const createPolicyActionOptions = (disablePermanentActions = false): DetailPolicyActionOption[] => [
|
||||
{
|
||||
action: 'extend_24h',
|
||||
label: t('fileManage.policyActions.extend24h'),
|
||||
description: t('fileManage.policyActionDescriptions.extend24h')
|
||||
description: t('fileManage.policyActionDescriptions.extend24h'),
|
||||
disabled: disablePermanentActions
|
||||
},
|
||||
{
|
||||
action: 'extend_7d',
|
||||
label: t('fileManage.policyActions.extend7d'),
|
||||
description: t('fileManage.policyActionDescriptions.extend7d')
|
||||
description: t('fileManage.policyActionDescriptions.extend7d'),
|
||||
disabled: disablePermanentActions
|
||||
},
|
||||
{
|
||||
action: 'make_permanent',
|
||||
label: t('fileManage.policyActions.makePermanent'),
|
||||
description: t('fileManage.policyActionDescriptions.makePermanent')
|
||||
description: t('fileManage.policyActionDescriptions.makePermanent'),
|
||||
disabled: disablePermanentActions
|
||||
},
|
||||
{
|
||||
action: 'reset_download_limit',
|
||||
@@ -418,10 +422,14 @@ export function useAdminFiles() {
|
||||
count: detailPolicyDownloadLimit
|
||||
})
|
||||
}
|
||||
])
|
||||
]
|
||||
|
||||
const detailPolicyActionOptions = computed<DetailPolicyActionOption[]>(() =>
|
||||
createPolicyActionOptions(Boolean(selectedFileDetail.value?.isPermanentFile))
|
||||
)
|
||||
|
||||
const batchPolicyActionOptions = computed<BatchPolicyActionOption[]>(
|
||||
() => detailPolicyActionOptions.value
|
||||
() => createPolicyActionOptions(false)
|
||||
)
|
||||
|
||||
const inferIsText = (file: FileListItem) => {
|
||||
@@ -606,7 +614,11 @@ export function useAdminFiles() {
|
||||
return {
|
||||
...item,
|
||||
severity: normalizeInsightSeverity(item.severity),
|
||||
displayTitle: t(`fileManage.timeline.${item.key}.title`),
|
||||
displayTitle: t(`fileManage.timeline.${item.key}.title`, {
|
||||
status: t(`fileManage.timeline.status.${item.status || 'pending'}`),
|
||||
detail: item.detail || '',
|
||||
value: valueText || item.value || ''
|
||||
}),
|
||||
displayDescription: t(`fileManage.timeline.${item.key}.description`, {
|
||||
status: t(`fileManage.timeline.status.${item.status || 'pending'}`),
|
||||
detail: item.detail || '',
|
||||
@@ -1526,6 +1538,12 @@ export function useAdminFiles() {
|
||||
const applyDetailPolicyAction = async (action: AdminFilePolicyAction) => {
|
||||
const file = selectedFileDetail.value
|
||||
if (!file || isDetailPolicyActionRunning.value) return
|
||||
if (
|
||||
file.isPermanentFile &&
|
||||
(action === 'extend_24h' || action === 'extend_7d' || action === 'make_permanent')
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
isDetailPolicyActionRunning.value = true
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user