forked from GoEdge233/keygen-python
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.html
More file actions
225 lines (196 loc) · 7.8 KB
/
index.html
File metadata and controls
225 lines (196 loc) · 7.8 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Goedge 分遗产 | Keygen WebUI</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<style>
html, body {
height: 100%;
margin: 0;
overflow-x: hidden;
}
body {
background-image: url('https://api.demonsword.top/assets/background/picture.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
color: #333;
}
@media (max-width: 768px) {
body {
background-image: url('https://api.demonsword.top/assets/background/hpd.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
}
.container {
background: rgba(255, 255, 255, 0.9);
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
margin-top: 20px;
margin-bottom: 80px;
}
h1 {
font-size: 24px;
text-align: left;
margin-bottom: 20px;
}
.form-control, .form-control:focus {
border-radius: 4px;
}
button {
border-radius: 4px;
cursor: pointer;
}
.btn-generate, .btn-copy {
background-color: #007bff;
color: white;
border: none;
}
.btn-generate:hover, .btn-copy:hover {
background-color: #0056b3;
}
pre {
background: #fff;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
white-space: pre-wrap;
word-wrap: break-word;
}
#result-container {
display: none;
}
footer {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
padding: 10px;
background: rgba(255, 255, 255, 0.3);
backdrop-filter: blur(8px);
border-top: 1px solid rgba(0, 0, 0, 0.1);
text-align: center;
font-size: 14px;
color: #333;
z-index: 100;
}
footer a {
color: #007bff;
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container mt-5">
<h1>Goedge 分遗产 | Keygen WebUI</h1>
<form id="apiForm">
<div class="form-group">
<label for="dayFrom">授权开始时间 (留空默认 2000-12-31):</label>
<input type="date" class="form-control" id="dayFrom" name="dayFrom">
</div>
<div class="form-group">
<label for="dayTo">授权到期时间 (默认永久权限):</label>
<input type="date" class="form-control" id="dayTo" name="dayTo">
</div>
<div class="form-group">
<label for="company">公司/组织名 (company):</label>
<input type="text" class="form-control" id="company" name="company" placeholder="Goedge 分遗产群 | WebUI 版本">
</div>
<div class="form-group">
<label for="edition">版本 (edition):</label>
<select id="edition" name="edition" class="form-control" required>
<option value="basic">个人商业版 (basic)</option>
<option value="pro">专业版 (pro)</option>
<option value="ent">企业版 (ent)</option>
<option value="ultra">旗舰版 (ultra)</option>
<option value="max">豪华版 - 绝版套餐 (max)</option>
</select>
</div>
<div class="form-group">
<label for="nodes">最大节点数限制 (默认为 99999999999):</label>
<input type="number" class="form-control" id="nodes" name="nodes" value="0" min="0">
</div>
<div class="form-group">
<label for="email">电子邮件 (email):</label>
<input type="email" class="form-control" id="email" name="email" placeholder="goedge@163.com">
</div>
<button type="submit" class="btn btn-generate">提交</button>
</form>
<div id="result-container" class="mt-4">
<h2 class="text-center">激活码:</h2>
<pre id="result"></pre>
<button id="copyBtn" class="btn btn-copy mt-3">点击复制</button>
</div>
</div>
<footer>
<p>本项目是 <a href="https://github.com/oswaldlow/keygen-python-webui" target="_blank">开源项目</a>,特别感谢 <a href="https://github.com/GoEdge233/keygen-python" target="_blank">goedge233</a>。</p>
</footer>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script>
document.getElementById('apiForm').addEventListener('submit', function(event) {
event.preventDefault();
const dayFrom = document.getElementById('dayFrom').value || "2000-12-31";
const dayTo = document.getElementById('dayTo').value || "9999-12-31";
const company = document.getElementById('company').value || "Goedge 分遗产群 | WebUI 版本";
const edition = document.getElementById('edition').value;
const nodes = parseInt(document.getElementById('nodes').value, 10) || 99999999999;
const email = document.getElementById('email').value || "goedge@163.com";
const data = {
id: "",
dayFrom: dayFrom,
dayTo: dayTo,
macAddresses: [],
requestCode: "",
hostname: "*",
company: company,
nodes: nodes,
updatedAt: Math.floor(Date.now() / 1000),
components: ["*"],
edition: edition,
email: email,
method: "internet"
};
fetch('http://127.0.0.1:5000/encode', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => {
const encoded = data.encoded;
const resultElement = document.getElementById('result');
resultElement.textContent = encoded;
// 显示激活码和复制按钮
const resultContainer = document.getElementById('result-container');
resultContainer.style.display = 'block';
})
.catch((error) => {
console.error('Error:', error);
document.getElementById('result').textContent = 'Error: ' + error;
});
});
document.getElementById('copyBtn').addEventListener('click', function() {
const resultElement = document.getElementById('result');
const text = resultElement.textContent;
navigator.clipboard.writeText(text).then(() => {
alert('激活码已复制到剪贴板');
}).catch((error) => {
console.error('复制失败:', error);
});
});
</script>
</body>
</html>