This commit is contained in:
Daniel 2023-06-22 22:06:04 +08:00
parent ee69dc6742
commit bb5150c8d4
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 20 additions and 2 deletions

View file

@ -33,6 +33,23 @@
const sleep = (ms) => {
return new Promise(resolve => setTimeout(resolve, ms))
}
const getSearch = (key) => {
if (window.location.search.indexOf('?') === -1) {
return ''
}
let value = ''
const data = window.location.search.split('?')[1].split('&')
data.find(item => {
const keyValue = item.split('=')
if (keyValue[0] === key) {
value = keyValue[1]
return true
}
})
return value
}
const redirect = () => {
const uri = 'http://127.0.0.1:' + location.port
if (navigator.userAgent.match(/Android/i))
@ -41,7 +58,8 @@
window.location.replace(uri)
}
(async () => {
document.getElementById('details').textContent = 'Booting kernel...'
const v = getSearch('v')
document.getElementById('details').textContent = "v" + v + ' Booting kernel...'
let progressing = false
while (!progressing) {
try {

View file

@ -402,7 +402,7 @@ const initKernel = (workspace, port, lang) => {
if (isDevEnv) {
bootIndex = path.join(appDir, "electron", "boot.html");
}
bootWindow.loadFile(bootIndex);
bootWindow.loadFile(bootIndex, {query: {v: appVer}});
bootWindow.show();
const kernelName = "win32" === process.platform ? "SiYuan-Kernel.exe" : "SiYuan-Kernel";