support refill license info

This commit is contained in:
novice.li 2024-03-02 09:55:45 +08:00
parent ed598a6693
commit 7f3a82c5ce
1 changed files with 37 additions and 3 deletions

View File

@ -4,7 +4,26 @@
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Get keys</title> <title>Generate License</title>
<style>
.jetbra-button {
background-color: #04AA6D;
border: none;
color: white;
padding: 8px 24px;
text-align: center;
text-decoration: none;
display: inline-block;
border-radius: 16px;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
transition-duration: 0.4s;
}
.jetbra-button:hover {
background-color: #057e47;
color: white;
}
</style>
<style> <style>
.form { .form {
background-color: #15172b; background-color: #15172b;
@ -776,6 +795,7 @@
</main> </main>
<footer class="flex items-center justify-between"> <footer class="flex items-center justify-between">
<div class="text-sm text-grey">Theme by QieTuZai</div> <div class="text-sm text-grey">Theme by QieTuZai</div>
<div class="text-sm text-grey"><button class="jetbra-button" onclick="showLicenseForm()">Refill licensee information</button></div>
<div class="text-sm text-grey">Copy from ja-netfilter</div> <div class="text-sm text-grey">Copy from ja-netfilter</div>
</footer> </footer>
<div id ="mask" style="position:fixed;top:0;left:0;z-index:998;width:100%;height:100%;display:none;background-color:#000;opacity:0.5;overflow:hidden;"></div> <div id ="mask" style="position:fixed;top:0;left:0;z-index:998;width:100%;height:100%;display:none;background-color:#000;opacity:0.5;overflow:hidden;"></div>
@ -794,7 +814,7 @@
<label for="assigneeName" class="placeholder">assigneeName</label> <label for="assigneeName" class="placeholder">assigneeName</label>
</div> </div>
<div class="input-container ic2"> <div class="input-container ic2">
<input id="expiryDate" class="input" type="text" placeholder="" value="2030-12-31"/> <input id="expiryDate" class="input" type="text" placeholder="" value="2026-12-31"/>
<div class="cut cut-short"></div> <div class="cut cut-short"></div>
<label for="expiryDate" class="placeholder">expiryDate</label> <label for="expiryDate" class="placeholder">expiryDate</label>
</div> </div>
@ -802,7 +822,6 @@
</div> </div>
</div> </div>
<script> <script>
if (localStorage.getItem('licenseInfo') === null) { if (localStorage.getItem('licenseInfo') === null) {
document.getElementById('mask').style.display = 'block' document.getElementById('mask').style.display = 'block'
@ -821,6 +840,21 @@
document.getElementById('mask').style.display = 'none' document.getElementById('mask').style.display = 'none'
document.getElementById('form').style.display = 'none' document.getElementById('form').style.display = 'none'
} }
window.showLicenseForm = function () {
let licenseInfo = localStorage.getItem('licenseInfo');
if (licenseInfo !== null) {
licenseInfo = JSON.parse(licenseInfo)
document.getElementById('licenseeName').value = licenseInfo.licenseeName
document.getElementById('assigneeName').value = licenseInfo.assigneeName
document.getElementById('expiryDate').value = licenseInfo.expiryDate
}else {
document.getElementById('licenseeName').value = 'Test only'
document.getElementById('assigneeName').value = 'Test only'
document.getElementById('expiryDate').value = '2026-12-31'
}
document.getElementById('mask').style.display = 'block'
document.getElementById('form').style.display = 'block'
}
</script> </script>
<script> <script>