siyuan/app/electron/error.html

242 lines
6.7 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Error - SiYuan</title>
<meta charset="UTF-8">
<meta name="color-scheme" content="light dark">
<style>
body {
margin: 0;
background-color: #fff;
color: #222;
font-family: BlinkMacSystemFont, Helvetica, "PingFang SC", "Luxi Sans", "DejaVu Sans", arial, "Microsoft Yahei", "Hiragino Sans GB", "Source Han Sans SC", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Twemoji Mozilla", "Android Emoji", "EmojiSymbols";
font-size: 16px;
}
.fn__flex-column {
display: flex;
flex-direction: column;
width: 100%;
min-height: 100vh;
box-sizing: border-box;
padding: 0 max(16px, calc((100vw - 608px) / 2));
}
.fn__flex-1 {
flex: 1;
min-height: 16px;
flex-shrink: 0;
}
a {
text-decoration: none;
color: #3575f0;
}
a:hover {
text-decoration: underline;
}
.topbar {
background: #fff;
position: sticky;
top: 0;
width: 100%;
left: 0;
display: flex;
box-sizing: border-box;
line-height: 32px;
}
.svg {
right: 32px;
top: 0;
width: 13px;
fill: #5f6368;
padding: 9.5px;
cursor: pointer;
z-index: 1;
}
.svg:hover {
background: #dfe0e1;
fill: #222;
}
#close {
width: 10px;
padding: 11px 11px;
}
#close:hover {
background-color: #d23f31;
fill: #fff;
}
.topbar img {
height: 32px;
width: 32px;
float: left;
margin-right: 8px;
}
.drag {
-webkit-app-region: drag;
flex: 1;
}
.title-container {
display: flex;
gap: 16px;
}
.title-emoji {
font-size: 48px;
align-self: center;
margin: 0 32px 0 8px;
}
#content div {
line-height: 1.6;
margin-bottom: 16px;
}
hr {
border: 1px solid #e0e0e0;
margin: 0 0 16px 0;
}
.info-section {
font-size: 14px;
color: #5f6368;
}
.info-section div:not(:last-child) {
margin-bottom: 8px;
}
.feedback {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
font-size: 14px;
text-align: center;
}
.darwin #min,
.darwin #close {
display: none;
}
.darwin .topbar {
padding-left: 80px;
}
@media (prefers-color-scheme: light) {
body {
background-color: #1e1e1e;
color: #dadada;
}
.topbar {
background-color: #1e1e1e;
}
hr {
border: 1px solid #363636;
}
.info-section {
color: #9aa0a6;
}
a {
color: #3573f0;
}
.svg {
fill: #9aa0a6;
}
.svg:hover {
background: rgba(255, 255, 255, .075);
fill: #dadada;
}
}
</style>
</head>
<body>
<div class="topbar">
<div id="icon"></div>
<div class="drag"></div>
<svg class="svg" id="min" viewBox="0 0 32 32">
<path d="M1.333 14.667h29.333q1.333 0 1.333 1.333v0q0 1.333-1.333 1.333h-29.333q-1.333 0-1.333-1.333v0q0-1.333 1.333-1.333z"></path>
</svg>
<svg class="svg" id="close" viewBox="0 0 32 32">
<path d="M32 3.221l-12.779 12.779 12.779 12.779-3.221 3.221-12.779-12.779-12.779 12.779-3.221-3.221 12.779-12.779-12.779-12.779 3.221-3.221 12.779 12.779 12.779-12.779z"></path>
</svg>
</div>
<div class="fn__flex-column">
<div class="fn__flex-1"></div>
<div class="title-container">
<span class="title-emoji" id="titleEmoji"></span>
<div class="title-text" id="titleText"></div>
</div>
<div class="fn__flex-1"></div>
<div id="content"></div>
<hr>
<div class="info-section">
<div id="time"></div>
<div id="systemInfo"></div>
</div>
<div class="fn__flex-1"></div>
<div class="feedback">
<a href="https://ld246.com/article/1649901726096" target="_blank">求助反馈建议</a>
<a href="https://b3log.org/siyuan/download.html" target="_blank">下载最新版</a>
<a href="https://liuyun.io/article/1686530886208" target="_blank">Feedback and support</a>
<a href="https://b3log.org/siyuan/en/download.html" target="_blank">Download the latest version</a>
</div>
<div class="fn__flex-1"></div>
</div>
<script>
'use strict';
const params = new URLSearchParams(window.location.search);
// 窗口控制按钮
if (process.platform === 'darwin') {
document.body.classList.add('darwin');
}
document.getElementById('close').addEventListener('click', () => {
const {ipcRenderer} = require('electron');
ipcRenderer.send("siyuan-cmd", "destroy");
});
document.getElementById('min').addEventListener('click', () => {
const {ipcRenderer} = require('electron');
ipcRenderer.send("siyuan-cmd", "minimize");
});
// LOGO和版本号
const version = 'SiYuan v' + params.get('v') || '';
document.querySelector('#icon').innerHTML = `<img src="${params.get('icon') || ''}" alt="SiYuan LOGO"> ${version}`;
// 标题
document.getElementById('titleEmoji').textContent = params.get('emoji');
document.getElementById('titleText').innerHTML = params.get('title') || '';
// 内容
document.getElementById('content').innerHTML = params.get('content') || '';
// 时间信息
const date = new Date();
document.getElementById('time').innerHTML = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}:${String(date.getSeconds()).padStart(2, '0')}`;
// 系统信息
const os = require('os');
document.getElementById('systemInfo').innerHTML = `${version} · ${{
'darwin': 'macOS',
'win32': 'Windows',
'linux': 'Linux'
}[process.platform] || process.platform} ${os.release()} · ${os.arch()} · ${os.cpus()[0]?.model || ''}`;
</script>
</body>
</html>