siyuan/app/electron/error.html

298 lines
7.9 KiB
HTML
Raw Normal View History

<!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: #202124;
font-family: BlinkMacSystemFont, "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";
font-size: 16px;
}
.fn__flex-column {
display: flex;
flex-direction: column;
width: 100%;
margin: 0 auto;
border: 1px solid rgba(0, 0, 0, .06);
min-height: 100vh;
box-sizing: border-box;
padding: 0 calc((100vw - 608px) / 2);
}
.fn__flex-1 {
flex: 1;
min-height: 16px;
flex-shrink: 0;
}
.title-container {
display: flex;
gap: 12px;
}
.title-emoji {
font-size: 40px;
line-height: 50px;
align-self: center;
}
.title-text {
flex: 1;
display: flex;
flex-direction: column;
}
.title-line {
font-size: 24px;
line-height: 30px;
}
h2 {
margin: 0;
padding: 0;
}
#content div {
line-height: 1.6;
margin-top: 0;
margin-bottom: 16px;
}
hr {
border: 1px solid rgba(0, 0, 0, .06);
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;
}
a {
text-decoration: none;
color: #218bff;
}
a:hover {
text-decoration: underline;
color: #0969da;
}
.svg {
position: fixed;
2024-02-05 12:19:48 +08:00
right: 32px;
top: 0;
2024-02-05 12:19:48 +08:00
width: 13px;
fill: #5f6368;
2024-02-05 12:19:48 +08:00
padding: 9.5px;
cursor: pointer;
z-index: 1;
}
.svg:hover {
background: #dfe0e1;
fill: #202124;
}
#close {
right: 0;
2024-02-05 12:19:48 +08:00
width: 10px;
padding: 11px 11px;
}
#close:hover {
background-color: #d23f31;
fill: #fff;
}
.darwin #min,
.darwin #close {
display: none;
}
#icon {
position: fixed;
left: 4px;
top: 0;
line-height: 32px;
color: #5f6368;
}
.darwin #icon {
left: 74px;
}
#icon img {
height: 32px;
width: 32px;
vertical-align: top;
}
.drag {
-webkit-app-region: drag;
height: 32px;
cursor: pointer;
position: fixed;
top: 0;
left: 0;
right: 64px;
}
.darwin .drag {
right: 0;
}
@media (prefers-color-scheme: dark) {
body {
background-color: #1e1e1e;
color: #e4e4e4;
}
.fn__flex-column {
border: 1px solid rgba(255, 255, 255, .1);
}
2024-02-05 12:19:48 +08:00
hr {
border: 1px solid rgba(255, 255, 255, .1);
}
.info-section {
color: #9aa0a6;
}
a {
color: #58a6ff;
}
a:hover {
color: #79c0ff;
}
.svg {
fill: #9aa0a6;
}
.svg:hover {
background: #3c3c3c;
fill: #e4e4e4;
}
#close:hover {
background-color: #d23f31;
fill: #fff;
}
#icon {
color: #9aa0a6;
}
}
</style>
</head>
<body>
<div class="fn__flex-column">
<div class="fn__flex-1"></div>
<div id="title" class="title-container">
<span class="title-emoji" id="titleEmoji"></span>
<div class="title-text">
<h2 class="title-line" id="titleZh"></h2>
<h2 class="title-line" id="titleEn"></h2>
</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>
2023-07-06 10:23:20 +08:00
</div>
<div class="fn__flex-1"></div>
2023-07-06 10:23:20 +08:00
<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>
<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>
2024-02-05 12:19:48 +08:00
<div id="icon"></div>
<div class="drag"></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('titleZh').textContent = params.get('titleZh') || '';
document.getElementById('titleEn').textContent = params.get('titleEn') || '';
// 内容
document.getElementById('content').innerHTML = params.get('content') || '';
// 时间信息
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
const timeString = `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
document.getElementById('time').innerHTML = timeString;
// 系统信息
const os = require('os');
const platformMap = {
'darwin': 'macOS',
'win32': 'Windows',
'linux': 'Linux'
};
const platform = platformMap[process.platform] || process.platform;
const release = os.release();
const arch = os.arch();
const cpus = os.cpus();
const cpuModel = cpus[0]?.model || '';
document.getElementById('systemInfo').innerHTML = `${version} · ${platform} ${release} · ${arch} · ${cpuModel}`;
</script>
</body>
</html>