Compare commits

...

29 commits

Author SHA1 Message Date
ThatOneCalculator
349b288a8b Also hide splash 2022-07-06 23:19:06 -07:00
ThatOneCalculator
c57e789414 Responsive 2022-07-06 23:16:37 -07:00
ThatOneCalculator
7863088bea Revert flush changes 2022-07-06 21:17:56 -07:00
ThatOneCalculator
efda6b0b7d Flush -> Clear 2022-07-06 20:50:11 -07:00
ThatOneCalculator
bd05c80495 Adjust text 2022-07-06 20:43:40 -07:00
ThatOneCalculator
47bc382151 Adjust style 2022-07-06 20:42:54 -07:00
ThatOneCalculator
08fde9abdd Typo 2022-07-06 20:38:02 -07:00
ThatOneCalculator
cd3b43bf45 Merge branch 'error-style' of https://github.com/ThatOneCalculator/misskey into error-style 2022-07-06 20:35:01 -07:00
ThatOneCalculator
f8c2182719 Fix 2022-07-06 20:34:42 -07:00
Kainoa Kanter
ef319e6f6b
BIOS -> Repair tool 2022-07-06 18:16:58 -07:00
ThatOneCalculator
aad9579a09 Fix 2022-07-05 20:19:15 -07:00
ThatOneCalculator
d9f5570b51 Add style to flush 2022-07-05 20:09:47 -07:00
ThatOneCalculator
027c22f013 Wrap details in <code> 2022-07-05 20:03:31 -07:00
ThatOneCalculator
c763ffc004 Merge branch 'error-style' of https://github.com/ThatOneCalculator/misskey into error-style 2022-07-05 19:57:45 -07:00
ThatOneCalculator
5e12df2143 Finally fix! 2022-07-05 19:57:35 -07:00
Kainoa Kanter
e6992ce89d
Update base.pug 2022-07-05 18:55:23 -07:00
ThatOneCalculator
63082ac8b8 Fix 2022-07-05 15:33:52 -07:00
ThatOneCalculator
1df04a2cef Merge branch 'error-style' of https://github.com/ThatOneCalculator/misskey into error-style 2022-07-05 15:23:04 -07:00
Kainoa Kanter
32d50fc8ed
Merge branch 'misskey-dev:develop' into error-style 2022-07-05 15:06:56 -07:00
ThatOneCalculator
162d444d85 Merge branch 'error-style' of https://github.com/ThatOneCalculator/misskey into error-style 2022-07-05 00:55:42 -07:00
ThatOneCalculator
db7b5d777d Rename to error.css 2022-07-05 00:55:30 -07:00
Kainoa Kanter
2cfb3a1d36
Merge branch 'misskey-dev:develop' into error-style 2022-07-05 00:50:15 -07:00
ThatOneCalculator
0f76cb1e76 Add new style to flush screen 2022-07-05 00:49:58 -07:00
Kainoa Kanter
b64c85f82c
Remove hr 2022-07-05 00:45:47 -07:00
Kainoa Kanter
4592ceb30e
Replace fontawesome with tabler svg 2022-07-05 00:42:11 -07:00
Kainoa Kanter
dda94d11a7
Update boot.css 2022-07-05 00:41:35 -07:00
Kainoa Kanter
8a335caff5
Merge branch 'misskey-dev:develop' into error-style 2022-07-03 14:37:32 -07:00
Kainoa Kanter
b172e4637a
Make details margin auto 2022-07-03 14:31:21 -07:00
ThatOneCalculator
274d154228 Styled error screen 2022-07-03 14:25:38 -07:00

View file

@ -102,29 +102,169 @@
document.head.appendChild(style); document.head.appendChild(style);
} }
// eslint-disable-next-line no-inner-declarations async function addStyle(styleText) {
function renderError(code, details) { let css = document.createElement('style');
let errorsElement = document.getElementById('errors'); css.appendChild(document.createTextNode(styleText));
if (!errorsElement) { document.head.appendChild(css);
document.documentElement.innerHTML = `
<h1> An error has occurred. </h1>
<p>If the problem persists, please contact the administrator. You may also try the following options:</p>
<ul>
<li>Start <a href="/cli">the simple client</a></li>
<li>Attempt to repair in <a href="/bios">BIOS</a></li>
<li><a href="/flush">Flush preferences and cache</a></li>
</ul>
<hr>
<div id="errors"></div>
`;
errorsElement = document.getElementById('errors');
} }
const detailsElement = document.createElement('details'); function renderError(code, details) {
detailsElement.innerHTML = `<summary><code>ERROR CODE: ${code}</code></summary>${JSON.stringify(details)}`; let errorsElement = document.getElementById('errors');
if (!errorsElement) {
document.documentElement.innerHTML = `
<svg class="icon-warning" xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-alert-triangle" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 9v2m0 4v.01"></path>
<path d="M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75"></path>
</svg>
<h1>An error has occurred!</h1>
<button class="button-big" onclick="location.reload(true);">
<span class="button-label-big">Refresh</span>
</button>
<p class="dont-worry">Don't worry, it's (probably) not your fault.</p>
<p>If the problem persists after refreshing, please contact your instance's administrator.<br>You may also try the following options:</p>
<a href="/flush">
<button class="button-small">
<span class="button-label-small">Clear preferences and cache</span>
</button>
</a>
<br>
<a href="/cli">
<button class="button-small">
<span class="button-label-small">Start the simple client</span>
</button>
</a>
<br>
<a href="/bios">
<button class="button-small">
<span class="button-label-small">Start the repair tool</span>
</button>
</a>
<br>
<div id="errors"></div>
`;
errorsElement = document.getElementById('errors');
}
const detailsElement = document.createElement('details');
detailsElement.innerHTML = `
<br>
<summary>
<code>ERROR CODE: ${code}</code>
</summary>
<code>${JSON.stringify(details)}</code>`;
errorsElement.appendChild(detailsElement); errorsElement.appendChild(detailsElement);
addStyle(`
* {
font-family: BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif;
}
#misskey_app,
#splash {
display: none !important;
}
body,
html {
background-color: #222;
color: #dfddcc;
justify-content: center;
margin: auto;
padding: 10px;
text-align: center;
}
button {
border-radius: 999px;
padding: 0px 12px 0px 12px;
border: none;
cursor: pointer;
margin-bottom: 12px;
}
.button-big {
background: linear-gradient(90deg, rgb(134, 179, 0), rgb(74, 179, 0));
line-height: 50px;
}
.button-big:hover {
background: rgb(153, 204, 0);
}
.button-small {
background: #444;
line-height: 40px;
}
.button-small:hover {
background: #555;
}
.button-label-big {
color: #222;
font-weight: bold;
font-size: 20px;
padding: 12px;
}
.button-label-small {
color: rgb(153, 204, 0);
font-size: 16px;
padding: 12px;
}
a {
color: rgb(134, 179, 0);
text-decoration: none;
}
p,
li {
font-size: 16px;
}
.dont-worry,
#msg {
font-size: 18px;
}
.icon-warning {
color: #dec340;
height: 4rem;
padding-top: 2rem;
}
h1 {
font-size: 32px;
}
code {
font-family: Fira, FiraCode, monospace;
}
details {
background: #333;
margin-bottom: 2rem;
padding: 0.5rem 1rem;
width: 40rem;
border-radius: 10px;
justify-content: center;
margin: auto;
}
summary {
cursor: pointer;
}
summary > * {
display: inline;
}
@media screen and (max-width: 500px) {
details {
width: 50%;
}
`)
} }
// eslint-disable-next-line no-inner-declarations // eslint-disable-next-line no-inner-declarations