mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-14 18:41:04 +08:00
暂存
This commit is contained in:
@@ -23,11 +23,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^0.38.5",
|
||||
"@iconify-json/carbon": "^1.1.16",
|
||||
"@types/node": "^18.16.0",
|
||||
"@unocss/preset-rem-to-px": "^0.51.8",
|
||||
"@unocss/reset": "^0.51.8",
|
||||
"@vicons/carbon": "^0.12.0",
|
||||
"@vicons/utils": "^0.1.4",
|
||||
"@vitejs/plugin-vue": "^3.2.0",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
|
||||
54
pnpm-lock.yaml
generated
54
pnpm-lock.yaml
generated
@@ -27,6 +27,9 @@ devDependencies:
|
||||
'@antfu/eslint-config':
|
||||
specifier: ^0.38.5
|
||||
version: 0.38.5(eslint@8.39.0)(typescript@4.9.5)
|
||||
'@iconify-json/carbon':
|
||||
specifier: ^1.1.16
|
||||
version: 1.1.16
|
||||
'@types/node':
|
||||
specifier: ^18.16.0
|
||||
version: 18.16.0
|
||||
@@ -36,12 +39,6 @@ devDependencies:
|
||||
'@unocss/reset':
|
||||
specifier: ^0.51.8
|
||||
version: 0.51.8
|
||||
'@vicons/carbon':
|
||||
specifier: ^0.12.0
|
||||
version: 0.12.0
|
||||
'@vicons/utils':
|
||||
specifier: ^0.1.4
|
||||
version: 0.1.4(vue@3.2.47)
|
||||
'@vitejs/plugin-vue':
|
||||
specifier: ^3.2.0
|
||||
version: 3.2.0(vite@3.2.6)(vue@3.2.47)
|
||||
@@ -249,10 +246,6 @@ packages:
|
||||
vue: 3.2.47
|
||||
dev: false
|
||||
|
||||
/@emotion/hash@0.8.0:
|
||||
resolution: {integrity: sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==}
|
||||
dev: true
|
||||
|
||||
/@esbuild/android-arm@0.15.18:
|
||||
resolution: {integrity: sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -338,6 +331,12 @@ packages:
|
||||
resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==}
|
||||
dev: true
|
||||
|
||||
/@iconify-json/carbon@1.1.16:
|
||||
resolution: {integrity: sha512-AD8bcnRSGA0WfcGEass2FbA0sagrUzrpFx5WchuDy3uf7yKBWumdypdQK121DH321fQDl5+zZQ26T6gC9knwUQ==}
|
||||
dependencies:
|
||||
'@iconify/types': 2.0.0
|
||||
dev: true
|
||||
|
||||
/@iconify/types@2.0.0:
|
||||
resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==}
|
||||
dev: true
|
||||
@@ -468,10 +467,6 @@ packages:
|
||||
'@types/unist': 2.0.6
|
||||
dev: true
|
||||
|
||||
/@types/node@14.14.45:
|
||||
resolution: {integrity: sha512-DssMqTV9UnnoxDWu959sDLZzfvqCF0qDNRjaWeYSui9xkFe61kKo4l1TWNTQONpuXEm+gLMRvdlzvNHBamzmEw==}
|
||||
dev: true
|
||||
|
||||
/@types/node@18.16.0:
|
||||
resolution: {integrity: sha512-BsAaKhB+7X+H4GnSjGhJG9Qi8Tw+inU9nJDwmD5CgOmBLEI6ArdhikpLX7DjbjDRDTbqZzU2LSQNZg8WGPiSZQ==}
|
||||
dev: true
|
||||
@@ -820,19 +815,6 @@ packages:
|
||||
- rollup
|
||||
dev: true
|
||||
|
||||
/@vicons/carbon@0.12.0:
|
||||
resolution: {integrity: sha512-kCOgr/ZOhZzoiFLJ8pwxMa2TMxrkCUOA22qExPabus35F4+USqzcsxaPoYtqRd9ROOYiHrSqwapak/ywF0D9bg==}
|
||||
dev: true
|
||||
|
||||
/@vicons/utils@0.1.4(vue@3.2.47):
|
||||
resolution: {integrity: sha512-OHI19qVNN6i+uPQ+Y3f2s0dUxwsYnOCcKBW7XOU4yXXO1aU3ZoKpblCc3+4N0qmgoJs5rWKRAaMisipqEXJwAg==}
|
||||
peerDependencies:
|
||||
vue: ^3.0.6
|
||||
dependencies:
|
||||
'@xicons/utils': 0.1.4
|
||||
vue: 3.2.47
|
||||
dev: true
|
||||
|
||||
/@vitejs/plugin-vue@3.2.0(vite@3.2.6)(vue@3.2.47):
|
||||
resolution: {integrity: sha512-E0tnaL4fr+qkdCNxJ+Xd0yM31UwMkQje76fsDVBBUCoGOUPexu2VDUYHL8P4CwV+zMvWw6nlRw19OnRKmYAJpw==}
|
||||
engines: {node: ^14.18.0 || >=16.0.0}
|
||||
@@ -1010,12 +992,6 @@ packages:
|
||||
- vue
|
||||
dev: false
|
||||
|
||||
/@xicons/utils@0.1.4:
|
||||
resolution: {integrity: sha512-uXxKDLz9abr80yJC05XSTq6wlyFcdW+N/1IYJkeHjzzXVc4VQ0sEYMoMMTjAH7HQBOyOkzOB4pf5NGF72lwa8Q==}
|
||||
dependencies:
|
||||
css-render: 0.13.9
|
||||
dev: true
|
||||
|
||||
/acorn-jsx@5.3.2(acorn@8.8.2):
|
||||
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
|
||||
peerDependencies:
|
||||
@@ -1301,14 +1277,6 @@ packages:
|
||||
which: 2.0.2
|
||||
dev: true
|
||||
|
||||
/css-render@0.13.9:
|
||||
resolution: {integrity: sha512-n3C4ZH59rveBrUlAD7n0Ze9/gUMKa4dlH1C9CWKpGcIHR/xRcIVXzBGy1iw8WWq2ySmn2/ZqOpySQNAK5Pb6sw==}
|
||||
dependencies:
|
||||
'@emotion/hash': 0.8.0
|
||||
'@types/node': 14.14.45
|
||||
csstype: 3.0.11
|
||||
dev: true
|
||||
|
||||
/css-tree@2.3.1:
|
||||
resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==}
|
||||
engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0}
|
||||
@@ -1326,10 +1294,6 @@ packages:
|
||||
/csstype@2.6.21:
|
||||
resolution: {integrity: sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==}
|
||||
|
||||
/csstype@3.0.11:
|
||||
resolution: {integrity: sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==}
|
||||
dev: true
|
||||
|
||||
/dayjs@1.11.7:
|
||||
resolution: {integrity: sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==}
|
||||
dev: false
|
||||
|
||||
5
src/api/config.ts
Normal file
5
src/api/config.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import axios from 'axios';
|
||||
|
||||
export const setConfig = () => axios.post('/api/v1/updateConfig');
|
||||
|
||||
export const getConfig = () => axios.post('/api/v1/getConfig');
|
||||
4
src/api/program.ts
Normal file
4
src/api/program.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import axios from 'axios';
|
||||
|
||||
/** 重启 */
|
||||
export const appRestart = () => axios.get('/api/v1/restart');
|
||||
1
src/auto-imports.d.ts
vendored
1
src/auto-imports.d.ts
vendored
@@ -3,6 +3,7 @@ export {}
|
||||
declare global {
|
||||
const EffectScope: typeof import('vue')['EffectScope']
|
||||
const computed: typeof import('vue')['computed']
|
||||
const configStore: typeof import('./store/config')['configStore']
|
||||
const createApp: typeof import('vue')['createApp']
|
||||
const customRef: typeof import('vue')['customRef']
|
||||
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
||||
|
||||
1
src/hooks/useDialog.ts
Normal file
1
src/hooks/useDialog.ts
Normal file
@@ -0,0 +1 @@
|
||||
export function useDialog() {}
|
||||
@@ -1,12 +1,16 @@
|
||||
import { createApp } from 'vue';
|
||||
import { Icon } from '@vicons/utils';
|
||||
import { createPinia } from 'pinia';
|
||||
import router from './router';
|
||||
import App from './App.vue';
|
||||
|
||||
import '@unocss/reset/tailwind-compat.css';
|
||||
import 'virtual:uno.css';
|
||||
|
||||
const pinia = createPinia();
|
||||
|
||||
const app = createApp(App);
|
||||
app.component('Icon', Icon);
|
||||
app.use(router);
|
||||
app.use(pinia);
|
||||
app.mount('#app');
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
<script lang="ts" setup>
|
||||
import YMenu from './YMenu.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app-layout">
|
||||
<div class="app-layout" w-full h-screen overflow-hidden flex>
|
||||
<el-container>
|
||||
<el-header class="header">
|
||||
<img src="@/assets/logo.png" alt="logo" class="logo" />
|
||||
<el-header class="header" flex="~ items-center justify-center" h-65px>
|
||||
<img src="@/assets/logo.png" alt="logo" class="h-7/10" />
|
||||
</el-header>
|
||||
|
||||
<el-container style="overflow: hidden">
|
||||
<el-container overflow-hidden>
|
||||
<el-aside width="auto">
|
||||
<YMenu />
|
||||
</el-aside>
|
||||
@@ -26,25 +26,12 @@ import YMenu from './YMenu.vue';
|
||||
|
||||
<style lang="scss" scope>
|
||||
.app-layout {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
|
||||
@media screen and (max-width: 980px) {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-bottom: 1px solid var(--el-border-color);
|
||||
height: 65px;
|
||||
|
||||
.logo {
|
||||
height: 70%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { useRoute } from 'vue-router';
|
||||
import { Debug, DocumentBlank, Home } from '@vicons/carbon';
|
||||
import { useWindowSize } from '@vueuse/core';
|
||||
|
||||
const { fullPath } = useRoute();
|
||||
|
||||
const isCollapse = ref(false);
|
||||
|
||||
const { width } = useWindowSize();
|
||||
const isCollapse = ref(false);
|
||||
const WIDTH = 980;
|
||||
|
||||
watchEffect(() => {
|
||||
@@ -17,43 +13,38 @@ watchEffect(() => {
|
||||
isCollapse.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
const items = [
|
||||
{
|
||||
icon: 'i-carbon-home',
|
||||
title: '番剧管理',
|
||||
url: '/bangumi',
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon-debug',
|
||||
title: '调试',
|
||||
url: '/debug',
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon:align-box-middle-right',
|
||||
title: '日志',
|
||||
url: '/log',
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon:settings',
|
||||
title: '配置',
|
||||
url: '/config',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-menu
|
||||
class="app-menu"
|
||||
:default-active="fullPath"
|
||||
:collapse="isCollapse"
|
||||
router
|
||||
>
|
||||
<el-menu-item index="/bangumi">
|
||||
<Icon>
|
||||
<Home />
|
||||
</Icon>
|
||||
<template #title>番剧管理</template>
|
||||
</el-menu-item>
|
||||
|
||||
<el-menu-item index="/debug">
|
||||
<Icon>
|
||||
<Debug />
|
||||
</Icon>
|
||||
<template #title>调试</template>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/log">
|
||||
<Icon>
|
||||
<DocumentBlank />
|
||||
</Icon>
|
||||
<template #title>日志</template>
|
||||
</el-menu-item>
|
||||
<el-menu :default-active="fullPath" :collapse="isCollapse" router h-full>
|
||||
<template v-for="(i, index) in items" :key="index">
|
||||
<el-menu-item :index="i.url">
|
||||
<div :class="[i.icon]" mr-0.5em></div>
|
||||
<template #title>{{ i.title }}</template>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</el-menu>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
.app-menu {
|
||||
height: 100%;
|
||||
|
||||
.xicon {
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import ShowResults from '@/components/ShowResults.vue';
|
||||
import { addBangumi } from '@/api/bangumi';
|
||||
|
||||
const props = defineProps<{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import ShowResults from '@/components/ShowResults.vue';
|
||||
import { getABData } from '@/api/bangumi';
|
||||
|
||||
const res = await getABData();
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import BangumiData from './components/BangumiData.vue';
|
||||
<script lang="ts" setup>
|
||||
import AddBangumi from './components/AddBangumi.vue';
|
||||
import BangumiData from './components/BangumiData.vue';
|
||||
|
||||
const program = {
|
||||
sleep_time: 7200,
|
||||
rename_times: 20,
|
||||
webui_port: 7892,
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
<script lang="ts" setup></script>
|
||||
|
||||
<template>
|
||||
<div class="config"></div>
|
||||
<section class="settings">
|
||||
<el-row :gutter="20">
|
||||
<!-- S 添加新番 -->
|
||||
<el-col :xs="24" :sm="24" :md="12" :lg="8">
|
||||
<AddBangumi type="new" />
|
||||
</el-col>
|
||||
<!-- E 添加新番 -->
|
||||
|
||||
<!-- S 添加旧番 -->
|
||||
<el-col :xs="24" :sm="24" :md="12" :lg="8">
|
||||
<AddBangumi type="old" />
|
||||
</el-col>
|
||||
<!-- E 添加旧番 -->
|
||||
</el-row>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
.el-row {
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import 'element-plus/es/components/message/style/css';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import 'element-plus/es/components/message-box/style/css';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { resetRule } from '@/api/debug';
|
||||
|
||||
const loading = ref(false);
|
||||
async function reset() {
|
||||
loading.value = true;
|
||||
const res = await resetRule();
|
||||
loading.value = false;
|
||||
if (res.data === 'Success') {
|
||||
ElMessage({
|
||||
message: '数据已重置, 建议重启容器',
|
||||
@@ -18,6 +21,12 @@ async function reset() {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function restart() {
|
||||
ElMessageBox.confirm('该操作将重启程序!', {
|
||||
type: 'warning',
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -40,6 +49,24 @@ async function reset() {
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- E 重置数据 -->
|
||||
|
||||
<!-- S 重启程序 -->
|
||||
<el-col :xs="24" :sm="12" :lg="8">
|
||||
<el-card shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>重启程序</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="card-con">
|
||||
<el-button type="danger" :loading="loading" @click="restart"
|
||||
>重启</el-button
|
||||
>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- E 重启程序 -->
|
||||
</el-row>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { getABLog } from '@/api/debug';
|
||||
|
||||
const log = ref(null);
|
||||
const timer = ref<NodeJS.Timer | null>(null);
|
||||
const timer = ref<number | null>(null);
|
||||
|
||||
async function getLog() {
|
||||
const res = await getABLog();
|
||||
@@ -21,21 +21,7 @@ onUnmounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="log-box">
|
||||
<pre>{{ log }}</pre>
|
||||
<div class="log-box" wh-full overflow-hidden px-2em leading-2em>
|
||||
<pre whitespace-break-spaces>{{ log }}</pre>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
.log-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
line-height: 2;
|
||||
padding: 0 2em;
|
||||
|
||||
pre {
|
||||
white-space: break-spaces;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
55
src/store/config.ts
Normal file
55
src/store/config.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
export interface Config {
|
||||
data_version: 4;
|
||||
program: {
|
||||
sleep_time: number;
|
||||
rename_times: number;
|
||||
webui_port: number;
|
||||
};
|
||||
downloader: {
|
||||
type: 'qbittorrent';
|
||||
host: string;
|
||||
username: string;
|
||||
password: string;
|
||||
path: string;
|
||||
ssl: boolean;
|
||||
};
|
||||
rss_parser: {
|
||||
enable: boolean;
|
||||
type: string;
|
||||
token: string;
|
||||
custom_url: string;
|
||||
enable_tmdb: boolean;
|
||||
filter: Array<string>;
|
||||
language: 'zh' | 'en' | 'jp';
|
||||
};
|
||||
bangumi_manage: {
|
||||
enable: boolean;
|
||||
eps_complete: boolean;
|
||||
rename_method: 'normal' | 'pn' | 'advance' | 'none';
|
||||
group_tag: boolean;
|
||||
remove_bad_torrent: boolean;
|
||||
};
|
||||
log: {
|
||||
debug_enable: boolean;
|
||||
};
|
||||
proxy: {
|
||||
enable: boolean;
|
||||
type: 'http' | 'https';
|
||||
host: string;
|
||||
port: number;
|
||||
username: string;
|
||||
password: string;
|
||||
};
|
||||
notification: {
|
||||
enable: boolean;
|
||||
type: 'telegram' | 'server-chan';
|
||||
token: string;
|
||||
chat_id: string;
|
||||
};
|
||||
}
|
||||
|
||||
export const configStore = defineStore('config', () => {
|
||||
const config = ref(null);
|
||||
});
|
||||
@@ -16,6 +16,7 @@ export default defineConfig({
|
||||
imports: ['vue', 'vue-router'],
|
||||
dts: 'src/auto-imports.d.ts',
|
||||
resolvers: [ElementPlusResolver()],
|
||||
dirs: ['src/store'],
|
||||
}),
|
||||
Components({
|
||||
dts: 'src/components.d.ts',
|
||||
|
||||
Reference in New Issue
Block a user