细节修复优化

This commit is contained in:
Cp0204 2024-03-31 18:50:44 +08:00
parent 91a5a57752
commit fbd1d5c1e6
5 changed files with 2070 additions and 23 deletions

View File

@ -25,12 +25,12 @@ script_path = os.environ.get("SCRIPT_PATH", "./quark_auto_save.py")
config_path = os.environ.get("CONFIG_PATH", "./config/quark_config.json")
app = Flask(__name__)
app.config["APP_VERSION"] = "0.2.5"
app.config["APP_VERSION"] = "0.2.5.1"
app.secret_key = "ca943f6db6dd34823d36ab08d8d6f65d"
app.json.ensure_ascii = False
app.json.sort_keys = False
app.jinja_env.variable_start_string = '[['
app.jinja_env.variable_end_string = ']]'
app.jinja_env.variable_start_string = "[["
app.jinja_env.variable_end_string = "]]"
def gen_md5(string):
@ -177,6 +177,7 @@ def reload_tasks():
else:
print(">>> no crontab")
def init():
# 检查配置文件是否存在
if not os.path.exists(config_path):

2018
app/static/css/bootstrap-icons.css vendored Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -7,6 +7,7 @@
<title>夸克自动转存</title>
<!-- 引入 Bootstrap CSS -->
<link rel="stylesheet" href="./static/css/bootstrap.min.css">
<link rel="stylesheet" href="./static/css/bootstrap-icons.css">
<style>
body {
padding-bottom: 60px;
@ -21,6 +22,10 @@
padding: 10px 0;
text-align: center;
}
.title {
margin-top: 30px;
}
</style>
</head>
@ -29,7 +34,7 @@
<h1 class="mb-4">夸克自动转存配置</h1>
<form @submit.prevent="saveConfig">
<div class="row">
<div class="row title">
<div class="col">
<h2>Cookie</h2>
</div>
@ -45,7 +50,7 @@
</div>
</div>
<div class="row">
<div class="row title">
<div class="col">
<h2>通知</h2>
</div>
@ -63,7 +68,11 @@
</div>
</div>
<h2>Emby</h2>
<div class="row title">
<div class="col">
<h2>Emby</h2>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Emby URL</label>
<div class="col-sm-10">
@ -77,7 +86,11 @@
</div>
</div>
<h2>定时规则</h2>
<div class="row title">
<div class="col">
<h2>定时规则</h2>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Crontab<span class="badge badge-pill badge-light"><a target="_blank" href="https://tool.lu/crontab/">?</a></span></label>
<div class="col-sm-10">
@ -85,8 +98,13 @@
</div>
</div>
<h2>任务列表</h2>
<div class="row title">
<div class="col">
<h2>任务列表</h2>
</div>
</div>
<div v-for="(task, index) in formData.tasklist" :key="index" class="task mb-3">
<hr>
<div class="form-group row">
<div class="col">
<h3>任务#<span v-html="index+1"></span></h3>
@ -148,18 +166,25 @@
</div>
</div>
</div>
<button type="button" class="btn btn-primary" @click="addTask()">增加任务</button>
<div class="row">
<div class="col-sm-12 text-center">
<button type="button" class="btn btn-primary" @click="addTask()"><i class="bi bi-plus"></i> 增加任务</button>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12 text-center">
<p>
<a target="_blank" href="https://github.com/Cp0204/quark-auto-save">@Cp0204/quark_auto_save</a> v[[ version ]]
</p>
</div>
</div>
<div class="bottom-buttons">
<input type="submit" class="btn btn-success" value="保存">
<a class="btn btn-primary" @click="runScriptNow">运行</a>
<a class="btn btn-danger" href="/logout">退出</a>
<button class="btn btn-success"><i class="bi bi-save"></i> 保存</button>
<a class="btn btn-primary" @click="runScriptNow"><i class="bi bi-play-fill"></i> 运行</a>
<a class="btn btn-danger" href="/logout"><i class="bi bi-box-arrow-right"></i> 退出</a>
</div>
</form>
<div class="text-center">
<p>
<a target="_blank" href="https://github.com/Cp0204/quark-auto-save">@Cp0204/quark_auto_save</a> v[[ version ]]
</p>
</div>
<!-- 模态框 -->
<div class="modal" tabindex="-1" id="logModal">
@ -291,7 +316,7 @@
},
runScriptNow() {
$('#logModal').modal('toggle')
this.run_log = "请耐心等待脚本全部执行完毕..."
this.run_log = '<div class="spinner-border" role="status"></div> 请耐心等待脚本全部执行完毕...'
axios.post('/run_script_now')
.then(response => {
this.run_log = response.data;

View File

@ -1,19 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录</title>
<!-- 引入 Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="./static/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-5">
<h1 class="mb-4">登录</h1>
{% if message %}
<div class="alert alert-danger" role="alert">
{{ message }}
</div>
<div class="alert alert-danger" role="alert">
[[ message ]]
</div>
{% endif %}
<form action="/login" method="POST">
<div class="form-group">
@ -28,4 +30,5 @@
</form>
</div>
</body>
</html>
</html>