mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-04 23:18:44 +08:00
feat:增加域名设置
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "moviepilot",
|
"name": "moviepilot",
|
||||||
"version": "1.9.4-1",
|
"version": "1.9.4-2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"bin": "dist/service.js",
|
"bin": "dist/service.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ const downloaderTab = ref('qbittorrent')
|
|||||||
// 媒体服务器选中标签页
|
// 媒体服务器选中标签页
|
||||||
const mediaserverTab = ref('emby')
|
const mediaserverTab = ref('emby')
|
||||||
|
|
||||||
|
// 系统设置项
|
||||||
|
const SystemSettings = ref({
|
||||||
|
APP_DOMAIN: '',
|
||||||
|
})
|
||||||
|
|
||||||
// 下载器设置项
|
// 下载器设置项
|
||||||
const downloaderSettings = ref({
|
const downloaderSettings = ref({
|
||||||
DOWNLOADER_MONITOR: true,
|
DOWNLOADER_MONITOR: true,
|
||||||
@@ -208,6 +213,33 @@ async function saveMediaServerSetting() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加载系统设置
|
||||||
|
async function loadSystemSettings() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.get('system/env')
|
||||||
|
if (result.success) {
|
||||||
|
const { APP_DOMAIN } = result.data
|
||||||
|
SystemSettings.value = {
|
||||||
|
APP_DOMAIN,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用API保存系统设置
|
||||||
|
async function saveSystemSetting() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.post('system/env', SystemSettings.value)
|
||||||
|
|
||||||
|
if (result.success) $toast.success('保存设置成功')
|
||||||
|
else $toast.error('保存设置失败!')
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 调用API接口重新加载模块
|
// 调用API接口重新加载模块
|
||||||
async function reloadModule() {
|
async function reloadModule() {
|
||||||
try {
|
try {
|
||||||
@@ -223,11 +255,41 @@ async function reloadModule() {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadDownloaderSetting()
|
loadDownloaderSetting()
|
||||||
loadMediaServerSetting()
|
loadMediaServerSetting()
|
||||||
|
loadSystemSettings()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VRow>
|
<VRow>
|
||||||
|
<VCol cols="12">
|
||||||
|
<VCard>
|
||||||
|
<VCardItem>
|
||||||
|
<VCardTitle>系统</VCardTitle>
|
||||||
|
<VCardSubtitle>设置服务使用的域名等信息。</VCardSubtitle>
|
||||||
|
</VCardItem>
|
||||||
|
<VCardText>
|
||||||
|
<VForm>
|
||||||
|
<VRow>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VTextField
|
||||||
|
v-model="SystemSettings.APP_DOMAIN"
|
||||||
|
label="访问域名"
|
||||||
|
hint="用于通知跳转,格式:http(s)://domain:port"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
</VForm>
|
||||||
|
</VCardText>
|
||||||
|
<VCardText>
|
||||||
|
<VForm @submit.prevent="() => {}">
|
||||||
|
<div class="d-flex flex-wrap gap-4 mt-4">
|
||||||
|
<VBtn mtype="submit" @click="saveSystemSetting"> 保存 </VBtn>
|
||||||
|
</div>
|
||||||
|
</VForm>
|
||||||
|
</VCardText>
|
||||||
|
</VCard>
|
||||||
|
</VCol>
|
||||||
<VCol cols="12">
|
<VCol cols="12">
|
||||||
<VCard>
|
<VCard>
|
||||||
<VCardItem>
|
<VCardItem>
|
||||||
|
|||||||
Reference in New Issue
Block a user