mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-12-01 00:38:13 +08:00
debug和log页完成
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vueuse/core": "^8.9.4",
|
||||
"axios": "^0.27.2",
|
||||
"element-plus": "^2.2.10",
|
||||
"modern-normalize": "^1.1.0",
|
||||
|
||||
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@@ -5,6 +5,7 @@ specifiers:
|
||||
'@vicons/carbon': ^0.12.0
|
||||
'@vicons/utils': ^0.1.4
|
||||
'@vitejs/plugin-vue': ^3.0.0
|
||||
'@vueuse/core': ^8.9.4
|
||||
axios: ^0.27.2
|
||||
element-plus: ^2.2.10
|
||||
modern-normalize: ^1.1.0
|
||||
@@ -20,6 +21,7 @@ specifiers:
|
||||
vue-tsc: ^0.38.4
|
||||
|
||||
dependencies:
|
||||
'@vueuse/core': 8.9.4_vue@3.2.37
|
||||
axios: 0.27.2
|
||||
element-plus: 2.2.10_vue@3.2.37
|
||||
modern-normalize: 1.1.0
|
||||
@@ -35,7 +37,7 @@ devDependencies:
|
||||
'@vitejs/plugin-vue': 3.0.1_vite@3.0.2+vue@3.2.37
|
||||
sass: 1.54.0
|
||||
typescript: 4.7.4
|
||||
unplugin-auto-import: 0.10.0_vite@3.0.2
|
||||
unplugin-auto-import: 0.10.0_h424so5tb623alsee2e3aarhfi
|
||||
unplugin-vue-components: 0.21.1_vite@3.0.2+vue@3.2.37
|
||||
vite: 3.0.2_sass@1.54.0
|
||||
vue-tsc: 0.38.9_typescript@4.7.4
|
||||
@@ -144,7 +146,6 @@ packages:
|
||||
|
||||
/@types/web-bluetooth/0.0.14:
|
||||
resolution: {integrity: sha512-5d2RhCard1nQUC3aHcq/gHzWYO6K0WJmAbjO7mQJgCQKtZpgXxv1rOM6O/dBDhDYYVutk1sciOgNSe+5YyfM8A==}
|
||||
dev: false
|
||||
|
||||
/@vicons/carbon/0.12.0:
|
||||
resolution: {integrity: sha512-kCOgr/ZOhZzoiFLJ8pwxMa2TMxrkCUOA22qExPabus35F4+USqzcsxaPoYtqRd9ROOYiHrSqwapak/ywF0D9bg==}
|
||||
@@ -293,11 +294,9 @@ packages:
|
||||
'@vueuse/shared': 8.9.4_vue@3.2.37
|
||||
vue: 3.2.37
|
||||
vue-demi: 0.13.5_vue@3.2.37
|
||||
dev: false
|
||||
|
||||
/@vueuse/metadata/8.9.4:
|
||||
resolution: {integrity: sha512-IwSfzH80bnJMzqhaapqJl9JRIiyQU0zsRGEgnxN6jhq7992cPUJIRfV+JHRIZXjYqbwt07E1gTEp0R0zPJ1aqw==}
|
||||
dev: false
|
||||
|
||||
/@vueuse/shared/8.9.4_vue@3.2.37:
|
||||
resolution: {integrity: sha512-wt+T30c4K6dGRMVqPddexEVLa28YwxW5OFIPmzUHICjphfAuBFTTdDoyqREZNDOFJZ44ARH1WWQNCUK8koJ+Ag==}
|
||||
@@ -312,7 +311,6 @@ packages:
|
||||
dependencies:
|
||||
vue: 3.2.37
|
||||
vue-demi: 0.13.5_vue@3.2.37
|
||||
dev: false
|
||||
|
||||
/@xicons/utils/0.1.4:
|
||||
resolution: {integrity: sha512-uXxKDLz9abr80yJC05XSTq6wlyFcdW+N/1IYJkeHjzzXVc4VQ0sEYMoMMTjAH7HQBOyOkzOB4pf5NGF72lwa8Q==}
|
||||
@@ -1051,7 +1049,7 @@ packages:
|
||||
- webpack
|
||||
dev: true
|
||||
|
||||
/unplugin-auto-import/0.10.0_vite@3.0.2:
|
||||
/unplugin-auto-import/0.10.0_h424so5tb623alsee2e3aarhfi:
|
||||
resolution: {integrity: sha512-XvGa/38TlHQnyNvKX+PgyM7og1DR+q3DPNp0RkifCQ2t8JCFUEixfRj9yDlfzNnLuEppFxqBZaUxNYjrstCUBA==}
|
||||
engines: {node: '>=14'}
|
||||
peerDependencies:
|
||||
@@ -1062,6 +1060,7 @@ packages:
|
||||
dependencies:
|
||||
'@antfu/utils': 0.5.2
|
||||
'@rollup/pluginutils': 4.2.1
|
||||
'@vueuse/core': 8.9.4_vue@3.2.37
|
||||
local-pkg: 0.4.2
|
||||
magic-string: 0.26.2
|
||||
unimport: 0.6.2_vite@3.0.2
|
||||
@@ -1167,7 +1166,6 @@ packages:
|
||||
optional: true
|
||||
dependencies:
|
||||
vue: 3.2.37
|
||||
dev: false
|
||||
|
||||
/vue-global-api/0.4.1_vue@3.2.37:
|
||||
resolution: {integrity: sha512-283vpYOhVHJCpMkjNVEwZdgaAb+Y93zFaXGAWTI378MLoNuwQydjD/BAy1e81QYEmyA+JbxqcmMZVWcM9rbriw==}
|
||||
|
||||
@@ -14,7 +14,7 @@ import YMenu from './YMenu.vue';
|
||||
</el-header>
|
||||
|
||||
<el-container style="overflow: hidden;">
|
||||
<el-aside width="200px">
|
||||
<el-aside width="auto">
|
||||
<YMenu />
|
||||
</el-aside>
|
||||
|
||||
@@ -34,6 +34,10 @@ import YMenu from './YMenu.vue';
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
|
||||
@media screen and (max-width: 980px){
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.header {
|
||||
|
||||
@@ -1,36 +1,60 @@
|
||||
<script setup lang="ts">
|
||||
import { Home, Debug } from '@vicons/carbon';
|
||||
import { useRoute } from 'vue-router'
|
||||
import { Home, Debug, DocumentBlank } from '@vicons/carbon';
|
||||
import { useWindowSize } from '@vueuse/core';
|
||||
|
||||
const { fullPath } = useRoute();
|
||||
|
||||
const isCollapse = ref(false);
|
||||
|
||||
const { width } = useWindowSize();
|
||||
const WIDTH = 980;
|
||||
|
||||
watchEffect(() => {
|
||||
if (width.value < WIDTH) {
|
||||
isCollapse.value = true;
|
||||
} else {
|
||||
isCollapse.value = false;
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ElMenu
|
||||
default-active="/bangumi"
|
||||
<el-menu
|
||||
class="app-menu"
|
||||
:default-active="fullPath"
|
||||
:collapse="isCollapse"
|
||||
router
|
||||
>
|
||||
|
||||
<ElMenuItem index="/bangumi">
|
||||
<el-menu-item index="/bangumi">
|
||||
<Icon>
|
||||
<Home />
|
||||
</Icon>
|
||||
<template #title>番剧管理</template>
|
||||
</ElMenuItem>
|
||||
</el-menu-item>
|
||||
|
||||
<ElMenuItem index="/debug">
|
||||
<el-menu-item index="/debug">
|
||||
<Icon>
|
||||
<Debug />
|
||||
</Icon>
|
||||
<template #title>调试</template>
|
||||
</ElMenuItem>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/log">
|
||||
<Icon>
|
||||
<DocumentBlank />
|
||||
</Icon>
|
||||
<template #title>日志</template>
|
||||
</el-menu-item>
|
||||
|
||||
</ElMenu>
|
||||
</el-menu>
|
||||
</template>
|
||||
|
||||
<style lang='scss' scope>
|
||||
.app-menu {
|
||||
height: 100%;
|
||||
|
||||
.xicon{
|
||||
.xicon {
|
||||
margin-right: .5em;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ const props = defineProps<{
|
||||
type: string
|
||||
}>()
|
||||
|
||||
const rssLink = ref();
|
||||
const rssLink = ref('');
|
||||
const loading = ref(false);
|
||||
const dialog = ref();
|
||||
const dialogData = ref(null);
|
||||
|
||||
@@ -16,13 +16,13 @@ import AddBangumi from './components/AddBangumi.vue'
|
||||
<el-row :gutter="20">
|
||||
|
||||
<!-- S 添加新番 -->
|
||||
<el-col :span="8">
|
||||
<el-col :xs="24" :sm="24" :md="12" :lg="8">
|
||||
<AddBangumi type="new" />
|
||||
</el-col>
|
||||
<!-- E 添加新番 -->
|
||||
|
||||
<!-- S 添加旧番 -->
|
||||
<el-col :span="8">
|
||||
<el-col :xs="24" :sm="24" :md="12" :lg="8">
|
||||
<AddBangumi type="old" />
|
||||
</el-col>
|
||||
<!-- E 添加旧番 -->
|
||||
|
||||
@@ -1,8 +1,52 @@
|
||||
<script setup lang="ts">
|
||||
import { resetRule } from '@/api/debug';
|
||||
import 'element-plus/es/components/message/style/css'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const loading = ref(false);
|
||||
const reset = async () => {
|
||||
const res = await resetRule();
|
||||
if (res.data === "Success") {
|
||||
ElMessage({
|
||||
message: '数据已重置, 建议重启容器',
|
||||
type: 'success',
|
||||
})
|
||||
} else {
|
||||
ElMessage({
|
||||
message: `错误: ${res.data}`,
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
debug
|
||||
<section class="debug">
|
||||
<el-row :gutter="20">
|
||||
|
||||
<!-- S 重置数据 -->
|
||||
<el-col :xs="24" :sm="12" :lg="8">
|
||||
<el-card shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>重置AB数据</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="card-con">
|
||||
<el-button
|
||||
type="danger"
|
||||
:loading="loading"
|
||||
@click="reset"
|
||||
>重置</el-button>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- E 重置数据 -->
|
||||
|
||||
</el-row>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style lang='scss' scope>
|
||||
|
||||
41
src/pages/journal/index.vue
Normal file
41
src/pages/journal/index.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<script setup lang="ts">
|
||||
import { getABLog } from '@/api/debug';
|
||||
|
||||
const log = ref(null);
|
||||
const timer = ref<NodeJS.Timer | null>(null);
|
||||
|
||||
const getLog = async () => {
|
||||
const res = await getABLog();
|
||||
log.value = res.data;
|
||||
}
|
||||
|
||||
const autoUpdate = () => {
|
||||
timer.value = setInterval(getLog, 5000);
|
||||
}
|
||||
getLog();
|
||||
|
||||
onMounted(autoUpdate);
|
||||
onUnmounted(() => {
|
||||
clearInterval(Number(timer.value));
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="log-box">
|
||||
<pre>{{ 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>
|
||||
@@ -3,6 +3,7 @@ import { createRouter, createWebHashHistory } from 'vue-router';
|
||||
const YLayout = () => import('../pages/YLayout.vue');
|
||||
const YBangumi = () => import('../pages/bangumi/index.vue');
|
||||
const YDebug = () => import('../pages/debug/index.vue');
|
||||
const YLog = () => import('../pages/journal/index.vue');
|
||||
|
||||
const routes = [
|
||||
{
|
||||
@@ -17,6 +18,10 @@ const routes = [
|
||||
{
|
||||
path: 'debug',
|
||||
component: YDebug
|
||||
},
|
||||
{
|
||||
path: 'log',
|
||||
component: YLog
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -23,6 +23,7 @@ export default defineConfig({
|
||||
}
|
||||
},
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:7892',
|
||||
|
||||
Reference in New Issue
Block a user