refactor(App): 移除服务器地址和自动启动配置功能
- 注释掉 serverUrl 相关的响应式变量定义 - 注释掉 autoStart 相关的响应式变量定义 - 移除进度列表中的测试数据注释 - 注释掉服务器地址验证逻辑 - 注释掉服务器地址和自动启动的写入配置函数 - 注释掉配置加载中的相关字段赋值 - 在模板中隐藏服务器地址输入框和自动启动复选框组件
This commit is contained in:
+23
-24
@@ -7,12 +7,12 @@ import {config} from "../wailsjs/go/models.ts";
|
||||
import Config = config.Config;
|
||||
import {EventsOn, LogPrint} from "../wailsjs/runtime";
|
||||
|
||||
const serverUrl = ref('')
|
||||
// const serverUrl = ref('')
|
||||
const token = ref('')
|
||||
const checkDir = ref('')
|
||||
const concurrentFiles = ref(1)
|
||||
const uploadThreads = ref(1)
|
||||
const autoStart = ref(false)
|
||||
// const autoStart = ref(false)
|
||||
|
||||
const isRunning = ref(false)
|
||||
const logOutput = ref<string[]>([])
|
||||
@@ -26,9 +26,8 @@ interface FileProgress {
|
||||
percentage: number
|
||||
}
|
||||
|
||||
const progressList = ref<FileProgress[]>([
|
||||
// {name: '测试文件1.txt', uploaded: 100, total: 500, percentage: 20},
|
||||
])
|
||||
// {name: '测试文件1.txt', uploaded: 100, total: 500, percentage: 20},
|
||||
const progressList = ref<FileProgress[]>([])
|
||||
|
||||
const sortedProgressList = computed(() => {
|
||||
return [...progressList.value].sort((a, b) => {
|
||||
@@ -58,10 +57,10 @@ const selectDirectory = () => {
|
||||
}
|
||||
|
||||
const startRun = () => {
|
||||
if (!serverUrl.value) {
|
||||
ElMessage.warning('请输入服务器地址')
|
||||
return
|
||||
}
|
||||
// if (!serverUrl.value) {
|
||||
// ElMessage.warning('请输入服务器地址')
|
||||
// return
|
||||
// }
|
||||
if (!token.value) {
|
||||
ElMessage.warning('请输入Token')
|
||||
return
|
||||
@@ -93,9 +92,9 @@ const clearLog = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const writeServerUrl =() => {
|
||||
WriteConfig("url", serverUrl.value)
|
||||
}
|
||||
// const writeServerUrl =() => {
|
||||
// WriteConfig("url", serverUrl.value)
|
||||
// }
|
||||
const writeToken =() => {
|
||||
WriteConfig("token", token.value)
|
||||
}
|
||||
@@ -108,19 +107,19 @@ const writeConcurrentFiles = () => {
|
||||
const writeUploadThreads =() => {
|
||||
WriteConfig("thread-count", uploadThreads.value)
|
||||
}
|
||||
const writeAutoStart = () => {
|
||||
WriteConfig("is-run-on-start", autoStart.value)
|
||||
}
|
||||
// const writeAutoStart = () => {
|
||||
// WriteConfig("is-run-on-start", autoStart.value)
|
||||
// }
|
||||
|
||||
// 加载配置
|
||||
try {
|
||||
GetConfig().then((config: Config) => {
|
||||
serverUrl.value = config.url
|
||||
// serverUrl.value = config.url
|
||||
token.value = config.token
|
||||
checkDir.value = config.check_dir
|
||||
concurrentFiles.value = config.handle_file_count
|
||||
uploadThreads.value = config.thread_count
|
||||
autoStart.value = config.is_run_on_start
|
||||
// autoStart.value = config.is_run_on_start
|
||||
|
||||
LogPrint(`[${new Date().toLocaleString()}] 配置已加载`)
|
||||
})
|
||||
@@ -142,10 +141,10 @@ EventsOn("log", (msg) => {
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="left-panel">
|
||||
<div class="form-item">
|
||||
<label>服务器地址</label>
|
||||
<el-input v-model="serverUrl" placeholder="请输入服务器地址" :disabled="isRunning" @change="writeServerUrl()"/>
|
||||
</div>
|
||||
<!-- <div class="form-item">-->
|
||||
<!-- <label>服务器地址</label>-->
|
||||
<!-- <el-input v-model="serverUrl" placeholder="请输入服务器地址" :disabled="isRunning" @change="writeServerUrl()"/>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="form-item">
|
||||
<label>Token</label>
|
||||
@@ -170,9 +169,9 @@ EventsOn("log", (msg) => {
|
||||
<el-input-number v-model="uploadThreads" :min="1" :max="100" :disabled="isRunning" @change="writeUploadThreads()"/>
|
||||
</div>
|
||||
|
||||
<div class="form-item">
|
||||
<el-checkbox v-model="autoStart" label="运行时自动启动上传" size="large" :disabled="isRunning" @change="writeAutoStart()"/>
|
||||
</div>
|
||||
<!-- <div class="form-item">-->
|
||||
<!-- <el-checkbox v-model="autoStart" label="运行时自动启动上传" size="large" :disabled="isRunning" @change="writeAutoStart()"/>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="form-item">
|
||||
<label>上传进度</label>
|
||||
|
||||
Reference in New Issue
Block a user