-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathindex.html
107 lines (99 loc) · 3.92 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<title>文件夹展示</title>
<style>
/* 添加粗竖线分割 */
li {
display: flex; /* 居左显示 */
align-items: center; /* 居上显示 */
padding: 10px;
}
div {
display: flex;
flex-direction: column;
}
img {
margin-right: 20px;
}
div + div {
border-left: 10px solid #ccc; /* 添加粗竖线分割 */
padding-left: 20px; /* 调整分割线和内容之间的距离 */
}
/* 新增样式,使按钮和文字在同一行 */
.button-container {
display: flex;
justify-content: space-between;
align-items: center;
}
.button-container button {
/* 设置按钮样式,包括右对齐 */
text-align: center;
width: 150px;
height: 40px;
}
</style>
<script>
function redirectAndAlert(deffer) {
// 使用 window.location.href 实现页面重定向
window.location.href = deffer; // 替换为你的目标网页URL
}
function refreshPage(id) {
$.ajax({
url: '/re_make_picer/'+id,
type: 'GET',
success: function(data) {
if (data === 'Success') {
// 刷新页面的逻辑,可以使用location.reload()等
location.reload();
}
}
});
}
// 在页面加载后,每5秒刷新一次页面
window.onload = function() {
setInterval(function() {
location.reload();
}, 10000); // 5000毫秒 = 5秒
}
</script>
</head>
<body>
<h1>图片文件夹</h1>
<span class="button-container">
<button onclick="redirectAndAlert('/delete_folder_fileser')">删除所有</button>
<button onclick="redirectAndAlert('/make_texter')">生成文</button>
<button onclick="redirectAndAlert('/make_ttser')">生成音</button>
<button onclick="redirectAndAlert('/make_picer')">生成图</button>
<button onclick="redirectAndAlert('/make_movieer')">生成视频</button>
<button onclick="redirectAndAlert('/open_floder_picer')">打开图片文件夹</button>
<button onclick="redirectAndAlert('/open_file_contenter')">添加文本内容</button>
<button onclick="redirectAndAlert('/open_floder_videoer')">打开视频文件夹</button>
</span>
<ul>
{% if split_txt_files_cont != 0 %}
{% for i in range(1, split_txt_files_cont+1) %}
<li class="button-container">
<img src="{{ url_for('static', filename='pictures/image' ~ i ~ '.png')}}" alt="Image {{ i }}" width="200">
<div>
<p>{{ i }}</p>
<p>{{ text_contents[i-1] }}</p>
</div>
<div>
</div>
<button onclick="refreshPage('{{i}}')" style="margin-left: auto;">重构图片</button>
</li>
{% endfor %}
{% else %}
<h1>所有内容为空</h1>
{% endif %}
</ul>
</body>
</html>