-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.html
More file actions
178 lines (154 loc) · 5.36 KB
/
init.html
File metadata and controls
178 lines (154 loc) · 5.36 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BT Watcher - 初始化设置</title>
<style>
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
background: #f5f5f5;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.init-container {
background: white;
border-radius: 8px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
width: 500px;
padding: 40px;
}
.init-header {
text-align: center;
margin-bottom: 40px;
}
.init-header h1 {
font-size: 28px;
color: #333;
margin: 0 0 10px 0;
}
.init-header p {
color: #666;
font-size: 16px;
margin: 0;
}
.form-group {
margin-bottom: 25px;
}
.form-group label {
display: block;
margin-bottom: 8px;
font-weight: 500;
color: #333;
font-size: 14px;
}
.form-group input {
width: 100%;
padding: 10px 12px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 14px;
transition: border-color 0.3s;
box-sizing: border-box;
}
.form-group input:focus {
outline: none;
border-color: #409eff;
}
.form-help {
margin-top: 6px;
font-size: 12px;
color: #909399;
}
.form-error {
color: #f56c6c;
font-size: 12px;
margin-top: 6px;
display: none;
}
.button-group {
margin-top: 35px;
text-align: center;
}
.btn {
padding: 10px 30px;
border: none;
border-radius: 4px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s;
}
.btn-primary {
background-color: #409eff;
color: white;
}
.btn-primary:hover {
background-color: #66b1ff;
}
.btn-primary:disabled {
background-color: #a0cfff;
cursor: not-allowed;
}
.loading {
display: none;
text-align: center;
margin-top: 20px;
color: #666;
}
.loading-spinner {
display: inline-block;
width: 20px;
height: 20px;
border: 2px solid #f3f3f3;
border-top: 2px solid #409eff;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-right: 10px;
vertical-align: middle;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<div class="init-container">
<div class="init-header">
<h1>欢迎使用 BT Watcher</h1>
<p>请配置您的宝塔面板连接信息</p>
</div>
<div style="background: #fff4e5; border: 1px solid #ffb84d; border-radius: 4px; padding: 12px 16px; margin-bottom: 25px; font-size: 13px; color: #7a4e00;">
<strong>⚠️ 重要提示:</strong>在宝塔面板的 API 设置中,请将 IP 白名单设置为 <code style="background: #fff; padding: 2px 4px; border-radius: 2px;">0.0.0.0/0</code> 以允许本应用访问。
<a href="https://github.com/tzrj0/btwatcher/wiki/Quick-Start" target="_blank" style="color: #409eff; text-decoration: none; margin-left: 5px;">查看详细教程 →</a>
</div>
<form id="init-form">
<div class="form-group">
<label for="api-url">API 地址</label>
<input type="text" id="api-url" name="apiUrl" placeholder="例如: http://192.168.1.100:8888" required>
<div class="form-help">请输入您的宝塔面板访问地址,包含端口号</div>
<div class="form-error" id="url-error"></div>
</div>
<div class="form-group">
<label for="api-key">API 密钥</label>
<input type="password" id="api-key" name="apiKey" placeholder="请输入宝塔面板 API 密钥" required>
<div class="form-help">可在宝塔面板 - 设置 - API接口中获取</div>
<div class="form-error" id="key-error"></div>
</div>
<div class="button-group">
<button type="submit" class="btn btn-primary" id="save-btn">保存并连接</button>
</div>
<div class="loading" id="loading">
<span class="loading-spinner"></span>
<span>正在验证连接...</span>
</div>
</form>
</div>
<script src="init.js"></script>
</body>
</html>