mirror of
https://git.ari.lt/ari.lt/ari.lt.git
synced 2025-02-04 17:49:24 +01:00
update @ Sat 9 Oct 03:22:48 EEST 2021
This commit is contained in:
parent
2375b1db3a
commit
6f9f78a5a9
8 changed files with 47 additions and 12 deletions
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"compile-hero.disable-compile-files-on-did-save-code": false
|
"compile-hero.disable-compile-files-on-did-save-code": true
|
||||||
}
|
}
|
|
@ -41,7 +41,7 @@ const locations = {
|
||||||
"desc": "The minimal page",
|
"desc": "The minimal page",
|
||||||
"aliases": [
|
"aliases": [
|
||||||
"mini","minimal",
|
"mini","minimal",
|
||||||
"txt"
|
"txt", "min"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
var root = false;
|
var root = false;
|
||||||
|
var not_return = false;
|
||||||
|
|
||||||
add_boot_entry(boot_message)
|
add_boot_entry(boot_message)
|
||||||
|
|
||||||
|
@ -33,15 +34,31 @@ async function main() {
|
||||||
6: {
|
6: {
|
||||||
"type": 'ok',
|
"type": 'ok',
|
||||||
"text": `'${site_name}' has been booted! Type <b>help</b> for help.`
|
"text": `'${site_name}' has been booted! Type <b>help</b> for help.`
|
||||||
|
},
|
||||||
|
7: {
|
||||||
|
"type": 'error',
|
||||||
|
"text": 'A fatal error has occured, report it <a href="https://github.com/TruncatedDinosour/website">here</a>',
|
||||||
|
"sleep_time": 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_logged_in) {
|
if (!is_logged_in) {
|
||||||
await add_boot_entry({ 0: tmp_boot_entries[0], 1: tmp_boot_entries[1] });
|
await add_boot_entry({ 0: tmp_boot_entries[0], 1: tmp_boot_entries[1] });
|
||||||
await sleep(500);
|
await sleep(500);
|
||||||
user_account_create();
|
await user_account_create()
|
||||||
|
.catch(async (e) => {
|
||||||
|
window.localStorage.clear();
|
||||||
|
let boot_error = {
|
||||||
|
"type": 'error',
|
||||||
|
"text": e,
|
||||||
|
"sleep_time": 0
|
||||||
|
};
|
||||||
|
|
||||||
return 1;
|
await add_boot_entry({ 0: boot_error, 1: tmp_boot_entries[7] });
|
||||||
|
not_return = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!not_return) window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
await add_boot_entry({
|
await add_boot_entry({
|
||||||
0: tmp_boot_entries[3]
|
0: tmp_boot_entries[3]
|
||||||
|
|
|
@ -20,14 +20,13 @@ async function user_account_create() {
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
if (confirm('The credentials you entered are not valid, try again?')) {
|
if (confirm('The credentials you entered are not valid (password/username too short or the password don\'t match), try again?')) {
|
||||||
user_account_create();
|
user_account_create();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_boot_entry({0: tmp_boot_entries[0]});
|
add_boot_entry({0: tmp_boot_entries[0]});
|
||||||
await sleep(2500);
|
await sleep(2500);
|
||||||
window.location.reload();
|
|
||||||
} else {
|
} else {
|
||||||
alert('The next popup will show your credentials, press OK to proceed')
|
alert('The next popup will show your credentials, press OK to proceed')
|
||||||
let confirm_credentials = confirm(`Are these credentials correct?:
|
let confirm_credentials = confirm(`Are these credentials correct?:
|
||||||
|
@ -39,7 +38,6 @@ async function user_account_create() {
|
||||||
localStorage.setItem('password', hash(password))
|
localStorage.setItem('password', hash(password))
|
||||||
|
|
||||||
alert('Credentials saved!')
|
alert('Credentials saved!')
|
||||||
window.location.reload();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,4 +98,16 @@ var commands = {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"whoami": {
|
||||||
|
"func": whoami,
|
||||||
|
"root_only": false,
|
||||||
|
"help": {
|
||||||
|
"desc": "A command to show your current user",
|
||||||
|
"short_desc": "Show user",
|
||||||
|
"examples": [
|
||||||
|
"whoami"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,3 +143,8 @@ function passwd() {
|
||||||
return 'Wrong password'
|
return 'Wrong password'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function whoami() {
|
||||||
|
return root ? "root" : window.localStorage.getItem("username");
|
||||||
|
}
|
||||||
|
|
|
@ -28,8 +28,9 @@
|
||||||
<div class="boot" id="boot">
|
<div class="boot" id="boot">
|
||||||
<p id="bootver"></p>
|
<p id="bootver"></p>
|
||||||
<noscript>
|
<noscript>
|
||||||
<p class="bmsg" bmsg_type="error">Your JavaScript is <b>DISABLED</b>, read how to enable JavaScript <a
|
<p class="bmsg" bmsg_type="error">JavaScript is <b>DISABLED</b>, read how to enable it <a
|
||||||
href="//enable-javascript.com">here</a></p>
|
href="//enable-javascript.com">here</a>. here is the <a
|
||||||
|
href="https://github.com/TruncatedDinosour/website">source code.</a></p>
|
||||||
</noscript>
|
</noscript>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
.buttons * {
|
.buttons * {
|
||||||
color: black;
|
color: black;
|
||||||
|
padding: 1em;
|
||||||
|
font-size: 1.4em;
|
||||||
}
|
}
|
||||||
.buttons {
|
.buttons {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
Loading…
Add table
Reference in a new issue