Skip to content

Commit

Permalink
固定底栏,显示版本号
Browse files Browse the repository at this point in the history
  • Loading branch information
Cp0204 committed Feb 28, 2024
1 parent ba09ae2 commit 619f107
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
3 changes: 2 additions & 1 deletion app/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
config_path = os.environ.get("CONFIG_PATH", "./config/quark_config.json")

app = Flask(__name__)
app.config["APP_VERSION"] = "0.2.1"
app.secret_key = "ca943f6db6dd34823d36ab08d8d6f65d"
app.json.ensure_ascii = False
app.json.sort_keys = False
Expand Down Expand Up @@ -94,7 +95,7 @@ def logout():
def index():
if not is_login():
return redirect(url_for("login"))
return render_template("index.html")
return render_template("index.html", version=app.config["APP_VERSION"])


# 获取配置数据
Expand Down
32 changes: 25 additions & 7 deletions app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@
<title>夸克自动转存</title>
<!-- 引入 Bootstrap CSS -->
<link rel="stylesheet" href="./static/css/bootstrap.min.css">
<style>
body {
padding-bottom: 60px;
}

.bottom-buttons {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #f1f1f1;
padding: 10px 0;
text-align: center;
}
</style>
</head>

<body>
Expand Down Expand Up @@ -125,12 +140,15 @@ <h3>任务#<span v-html="index+1"></span></h3>
</div>
</div>
<button type="button" class="btn btn-primary" @click="addTask()">增加任务</button>
<br><br>
<input type="submit" class="btn btn-success" value="保存">
<a class="btn btn-danger" href="/logout">退出</a>
<div class="bottom-buttons">
<input type="submit" class="btn btn-success" value="保存">
<a class="btn btn-danger" href="/logout">退出</a>
</div>
</form>
<div class="text-center">
<a href="https://github.com/Cp0204/quark_auto_save">@Cp0204/quark_auto_save</a>
<p>
<a target="_blank" href="https://github.com/Cp0204/quark-auto-save">@Cp0204/quark_auto_save</a> v{{ version }}
</p>
</div>
</div>

Expand Down Expand Up @@ -192,7 +210,7 @@ <h3>任务#<span v-html="index+1"></span></h3>
},
removeCookie(index) {
if (confirm("确认删除吗?"))
this.formData.cookie.splice(index, 1);
this.formData.cookie.splice(index, 1);
},
addPush() {
key = prompt("增加的键名", "");
Expand All @@ -201,7 +219,7 @@ <h3>任务#<span v-html="index+1"></span></h3>
},
removePush(key) {
if (confirm("确认删除吗?"))
this.$delete(this.formData.push_config, key);
this.$delete(this.formData.push_config, key);
},
addTask() {
this.formData.tasklist.push({
Expand All @@ -216,7 +234,7 @@ <h3>任务#<span v-html="index+1"></span></h3>
},
removeTask(index) {
if (confirm("确认删除吗?"))
this.formData.tasklist.splice(index, 1);
this.formData.tasklist.splice(index, 1);
},
clearShareurlBan(task) {
delete task.shareurl_ban;
Expand Down

0 comments on commit 619f107

Please sign in to comment.