Tweak bios

This commit is contained in:
ThatOneCalculator 2022-07-06 21:15:47 -07:00
parent 787d593b8f
commit 189b1bff38
2 changed files with 137 additions and 26 deletions

View file

@ -8,7 +8,7 @@ window.onload = async () => {
const promise = new Promise((resolve, reject) => { const promise = new Promise((resolve, reject) => {
// Append a credential // Append a credential
if (i) data.i = i; if (i) data.i = i;
// Send request // Send request
fetch(endpoint.indexOf('://') > -1 ? endpoint : `/api/${endpoint}`, { fetch(endpoint.indexOf('://') > -1 ? endpoint : `/api/${endpoint}`, {
method: 'POST', method: 'POST',
@ -17,7 +17,7 @@ window.onload = async () => {
cache: 'no-cache' cache: 'no-cache'
}).then(async (res) => { }).then(async (res) => {
const body = res.status === 204 ? null : await res.json(); const body = res.status === 204 ? null : await res.json();
if (res.status === 200) { if (res.status === 200) {
resolve(body); resolve(body);
} else if (res.status === 204) { } else if (res.status === 204) {
@ -27,7 +27,7 @@ window.onload = async () => {
} }
}).catch(reject); }).catch(reject);
}); });
return promise; return promise;
}; };
@ -44,7 +44,7 @@ window.onload = async () => {
const addKeyInput = document.createElement('input'); const addKeyInput = document.createElement('input');
const addValueTextarea = document.createElement('textarea'); const addValueTextarea = document.createElement('textarea');
const addButton = document.createElement('button'); const addButton = document.createElement('button');
addButton.textContent = 'add'; addButton.textContent = 'Add';
addButton.addEventListener('click', () => { addButton.addEventListener('click', () => {
localStorage.setItem(addKeyInput.value, addValueTextarea.value); localStorage.setItem(addKeyInput.value, addValueTextarea.value);
location.reload(); location.reload();
@ -64,13 +64,13 @@ window.onload = async () => {
const textarea = document.createElement('textarea'); const textarea = document.createElement('textarea');
textarea.textContent = localStorage.getItem(k); textarea.textContent = localStorage.getItem(k);
const saveButton = document.createElement('button'); const saveButton = document.createElement('button');
saveButton.textContent = 'save'; saveButton.textContent = 'Save';
saveButton.addEventListener('click', () => { saveButton.addEventListener('click', () => {
localStorage.setItem(k, textarea.value); localStorage.setItem(k, textarea.value);
location.reload(); location.reload();
}); });
const removeButton = document.createElement('button'); const removeButton = document.createElement('button');
removeButton.textContent = 'remove'; removeButton.textContent = 'Remove';
removeButton.addEventListener('click', () => { removeButton.addEventListener('click', () => {
localStorage.removeItem(k); localStorage.removeItem(k);
location.reload(); location.reload();

View file

@ -1,20 +1,131 @@
doctype html main>.tabs {
padding:16px;
html border-bottom:4px solid #c3c3c3
}
head #lsEditor>.adder {
meta(charset='utf-8') margin:16px;
meta(name='application-name' content='Misskey') padding:16px;
title Misskey Repair Tool border:2px solid #c3c3c3
style }
include ../bios.css #lsEditor>.adder>textarea {
script display:block;
include ../bios.js width:100%;
min-height:5em;
body box-sizing:border-box
header }
h1 Misskey Repair Tool #{version} #lsEditor>.record {
main padding:16px;
div.tabs border-bottom:1px solid #c3c3c3
button#ls Edit local storage }
div#content #lsEditor>.record>header {
font-weight:700
}
#lsEditor>.record>textarea {
display:block;
width:100%;
min-height:5em;
box-sizing:border-box
}
html {
background:#222
}
main {
background:#333;
border-radius:10px
}
#tl>div {
padding:16px;
border-bottom:1px solid #c3c3c3
}
#tl>div>header {
font-weight:700
}
* {
font-family:BIZ UDGothic,Roboto,HelveticaNeue,Arial,sans-serif
}
#misskey_app {
display:none!important
}
body,
html {
background-color:#222;
color:#dfddcc;
justify-content:center;
margin:auto;
padding:10px;
text-align:center
}
button {
background:linear-gradient(90deg,#86b300,#4ab300);
line-height:50px;
color:#222;
font-weight:700;
font-size:20px;
border-radius:999px;
padding:0 20px;
margin-left: 5px;
margin-right: 5px;
border:none;
cursor:pointer;
margin-bottom:12px;
background:#444;
line-height:40px;
color:#9c0;
font-size:16px;
}
button:hover {
background:#555
}
#ls {
background:linear-gradient(90deg,#86b300,#4ab300);
line-height:50px;
color:#222;
font-weight:700;
font-size:20px;
padding:12px
}
#ls:hover {
background:#9c0
}
a {
color:#86b300;
text-decoration:none
}
li,
p {
font-size:16px
}
h1 {
font-size:32px
}
code {
font-family:Fira,FiraCode,monospace
}
textarea {
background-color:#444;
border:solid #aaa;
border-radius:10px;
color:#dfddcc;
margin-top:1rem;
margin-bottom:1rem;
width:20rem;
height:7rem;
padding:.5rem
}
textarea:focus {
border:solid #eee
}
input {
background-color:#666;
border:solid #aaa;
border-radius:10px;
color:#dfddcc;
margin-top:1rem;
margin-bottom:1rem;
width:10rem;
height:1rem;
padding:.5rem
}
input:focus {
border:solid #eee
}