mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-08 17:26:41 +08:00
feat: add log download actions (#489)
This commit is contained in:
@@ -42,6 +42,12 @@ function openLoggerWindow() {
|
|||||||
}system/logging?length=-1&logfile=plugins/${props.plugin?.id?.toLowerCase()}.log`
|
}system/logging?length=-1&logfile=plugins/${props.plugin?.id?.toLowerCase()}.log`
|
||||||
window.open(url, '_blank')
|
window.open(url, '_blank')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 下载当前插件日志压缩包。 */
|
||||||
|
function downloadLogger() {
|
||||||
|
const url = `${import.meta.env.VITE_API_BASE_URL}system/logging/download/${props.plugin?.id?.toLowerCase()}`
|
||||||
|
window.open(url, '_blank')
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -52,12 +58,20 @@ function openLoggerWindow() {
|
|||||||
<VCardTitle class="d-inline-flex">
|
<VCardTitle class="d-inline-flex">
|
||||||
<VIcon icon="mdi-file-document" class="me-2" />
|
<VIcon icon="mdi-file-document" class="me-2" />
|
||||||
{{ t('plugin.logTitle') }}
|
{{ t('plugin.logTitle') }}
|
||||||
<a class="mx-2 d-inline-flex align-center cursor-pointer" @click="openLoggerWindow">
|
<span class="ms-4 d-inline-flex align-center ga-1">
|
||||||
<VChip color="grey-darken-1" size="small" class="ml-2">
|
<a class="d-inline-flex align-center cursor-pointer" @click="downloadLogger">
|
||||||
<VIcon icon="mdi-open-in-new" size="small" start />
|
<VChip color="grey-darken-1" size="small">
|
||||||
{{ t('common.openInNewWindow') }}
|
<VIcon icon="mdi-download" size="small" start />
|
||||||
</VChip>
|
{{ t('common.download') }}
|
||||||
</a>
|
</VChip>
|
||||||
|
</a>
|
||||||
|
<a class="d-inline-flex align-center cursor-pointer" @click="openLoggerWindow">
|
||||||
|
<VChip color="grey-darken-1" size="small">
|
||||||
|
<VIcon icon="mdi-open-in-new" size="small" start />
|
||||||
|
{{ t('common.openInNewWindow') }}
|
||||||
|
</VChip>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
</VCardTitle>
|
</VCardTitle>
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
<VDivider />
|
<VDivider />
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ const visible = computed({
|
|||||||
function allLoggingUrl() {
|
function allLoggingUrl() {
|
||||||
return `${import.meta.env.VITE_API_BASE_URL}system/logging?length=-1`
|
return `${import.meta.env.VITE_API_BASE_URL}system/logging?length=-1`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 拼接主程序日志下载 URL。 */
|
||||||
|
function allLoggingDownloadUrl() {
|
||||||
|
return `${import.meta.env.VITE_API_BASE_URL}system/logging/download/moviepilot`
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -44,12 +49,20 @@ function allLoggingUrl() {
|
|||||||
<VCardTitle class="d-inline-flex">
|
<VCardTitle class="d-inline-flex">
|
||||||
<VIcon icon="mdi-file-document" class="me-2" />
|
<VIcon icon="mdi-file-document" class="me-2" />
|
||||||
{{ t('shortcut.log.subtitle') }}
|
{{ t('shortcut.log.subtitle') }}
|
||||||
<a class="mx-2 d-inline-flex align-center" :href="allLoggingUrl()" target="_blank">
|
<span class="ms-4 d-inline-flex align-center ga-1">
|
||||||
<VChip color="grey-darken-1" size="small" class="ml-2">
|
<a class="d-inline-flex align-center" :href="allLoggingDownloadUrl()" target="_blank">
|
||||||
<VIcon icon="mdi-open-in-new" size="small" start />
|
<VChip color="grey-darken-1" size="small">
|
||||||
{{ t('common.openInNewWindow') }}
|
<VIcon icon="mdi-download" size="small" start />
|
||||||
</VChip>
|
{{ t('common.download') }}
|
||||||
</a>
|
</VChip>
|
||||||
|
</a>
|
||||||
|
<a class="d-inline-flex align-center" :href="allLoggingUrl()" target="_blank">
|
||||||
|
<VChip color="grey-darken-1" size="small">
|
||||||
|
<VIcon icon="mdi-open-in-new" size="small" start />
|
||||||
|
{{ t('common.openInNewWindow') }}
|
||||||
|
</VChip>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
</VCardTitle>
|
</VCardTitle>
|
||||||
</VCardItem>
|
</VCardItem>
|
||||||
<VDivider />
|
<VDivider />
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export default {
|
|||||||
success: 'Success',
|
success: 'Success',
|
||||||
error: 'Error',
|
error: 'Error',
|
||||||
openInNewWindow: 'Open in new window',
|
openInNewWindow: 'Open in new window',
|
||||||
|
download: 'Download',
|
||||||
inputMessage: 'Enter message or command',
|
inputMessage: 'Enter message or command',
|
||||||
send: 'Send',
|
send: 'Send',
|
||||||
noData: 'No data',
|
noData: 'No data',
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export default {
|
|||||||
success: '成功',
|
success: '成功',
|
||||||
error: '错误',
|
error: '错误',
|
||||||
openInNewWindow: '在新窗口中打开',
|
openInNewWindow: '在新窗口中打开',
|
||||||
|
download: '下载',
|
||||||
inputMessage: '输入消息或命令',
|
inputMessage: '输入消息或命令',
|
||||||
send: '发送',
|
send: '发送',
|
||||||
noData: '暂无数据',
|
noData: '暂无数据',
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export default {
|
|||||||
success: '成功',
|
success: '成功',
|
||||||
error: '錯誤',
|
error: '錯誤',
|
||||||
openInNewWindow: '在新窗口中打開',
|
openInNewWindow: '在新窗口中打開',
|
||||||
|
download: '下載',
|
||||||
inputMessage: '輸入消息或命令',
|
inputMessage: '輸入消息或命令',
|
||||||
send: '發送',
|
send: '發送',
|
||||||
noData: '暫無數據',
|
noData: '暫無數據',
|
||||||
|
|||||||
Reference in New Issue
Block a user