pull/15/head
Laurence Luo 2024-06-14 18:12:49 +08:00
parent e542cd987f
commit ae2925b3d1
No known key found for this signature in database
GPG Key ID: 76D108A29460F5F9
3 changed files with 140 additions and 72 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
**/.idea/**

14
app.py
View File

@ -1,4 +1,4 @@
#/usr/bin/env python3 # /usr/bin/env python3
import os import os
import os.path import os.path
@ -110,7 +110,7 @@ def GenerateLicense(Type: int, Count: int, UserName: str, MajorVersion: int, Min
return FileName return FileName
#@app.route('/gen') # @app.route('/gen')
def get_lc(): def get_lc():
name = request.args.get('name', '') name = request.args.get('name', '')
version = request.args.get('ver', '') version = request.args.get('ver', '')
@ -125,14 +125,16 @@ def get_lc():
return lc return lc
#@app.route('/download/<lc>') # @app.route('/download/<lc>')
def download_lc(lc): def download_lc(lc):
if lc and len(lc) > 5 and os.path.exists('./' + lc): if lc and len(lc) > 5 and os.path.exists('./' + lc):
return send_file(lc, return send_file(
lc,
as_attachment=True, as_attachment=True,
attachment_filename='Custom.mxtpro') attachment_filename='Custom.mxtpro'
)
else: else:
return "请检查用户名版本号是否正确!" return "请检查用户名版本号是否正确!"
@app.route('/gen') @app.route('/gen')

View File

@ -1,73 +1,138 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en">
<head> <head>
<title>MobaXterm Keygen</title> <title>MobaXterm Keygen</title>
<link href="https://fonts.googleapis.cnpmjs.org/css?family=Roboto:300,400,500,700" rel="stylesheet"> <link href="https://fonts.googleapis.cnpmjs.org/css?family=Roboto:300,400,500,700" rel="stylesheet">
<style> <style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
form {
width: 300px; /* Set the width of the form */
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
background: #f5f5f5;
}
.container {
margin-bottom: 10px;
}
h1 {
color: #0056b3;
text-justify: newspaper;
}
button {
display: block;
width: 100%;
padding: 13px;
background-color: #0056b3;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
margin: 5px 0 20px;
font-size: 15px;
}
button:hover {
background-color: #007bff;
}
.github {
text-align: center;
}
html, body { html, body {
display: flex; display: flex;
justify-content: center; justify-content: center;
font-family: Roboto, Arial, sans-serif; font-family: Roboto, Arial, sans-serif;
font-size: 15px; font-size: 15px;
background-color: #242424;
} }
form { form {
border: 5px solid #f1f1f1; border: 5px solid #f1f1f1;
} }
input[type=text], input[type=text] { input[type=text], input[type=text] {
width: 100%; width: 100%;
padding: 16px 8px; padding: 16px 8px;
margin: 8px 0; margin: 10px 0 10px;
display: inline-block; display: inline-block;
border: 1px solid #ccc; border: 1px solid #ccc;
box-sizing: border-box; box-sizing: border-box;
} }
button {
background-color: #8ebf42; #space {
color: white; height: 15px;
padding: 14px 0;
margin: 10px 0;
border: none;
cursor: grabbing;
width: 100%;
} }
h1 { h1 {
text-align:center; text-align: center;
font-size:18;
} }
button:hover { button:hover {
opacity: 0.8; opacity: 0.8;
} }
.formcontainer { .formcontainer {
text-align: left; text-align: left;
margin: 24px 50px 12px; margin: 24px 50px 12px;
} }
.container { .container {
padding: 16px 0; padding: 16px 0;
text-align: left; text-align: left;
} }
.github { .github {
padding: 16px 0; padding: 20px 0 0;
text-align: center; text-align: right;
}
.github span a {
color: #242424;
font-size: smaller;
}
.github span a img {
height: 18px;
padding-bottom: 3px;
vertical-align: middle;
} }
</style> </style>
</head> </head>
<body> <body>
<form action="./gen" mothod="get"> <form action="./gen" mothod="get">
<h1>MobaXterm Keygen</h1> <h1>MobaXterm Keygen</h1>
<div class="formcontainer"></div> <div class="formcontainer"></div>
<hr/> <hr/>
<div class="container"> <div class="container">
<label for="name"><strong>Name</strong></label> <label for="name"><strong>Name</strong></label>
<input type="text" placeholder="Enter name" name="name" required> <input name="name" placeholder="Enter name: " required type="text">
<div id="space"></div>
<label for="ver"><strong>Version</strong></label> <label for="ver"><strong>Version</strong></label>
<input type="text" placeholder="Enter version: (21.1)" name="ver" required> <input name="ver" placeholder="Enter version: (21.1)" required type="text">
</div> </div>
<button type="submit">Gen!</button> <button type="submit">Generate !</button>
<div class="github"> <div class="github">
<label style="padding-left: 15px"> <label>
</label> </label>
<span><a style="text-decoration: none;" href="https://github.com/malaohu/MobaXterm-GenKey">View on GitHub</a><img src="https://github.githubassets.com/favicons/favicon.svg" height="16px"></span> <span>
<a href="https://github.com/malaohu/MobaXterm-GenKey" style="text-decoration: none;">
<img src="https://github.githubassets.com/favicons/favicon.svg">
malaohu/MobaXterm-GenKey
</a>
</span>
</div> </div>
</form> </form>
</body> </body>
</html> </html>