提交 29e43a02 编写于 作者: G Git²

Win32 fixes - #97

上级 a8a5fae7
......@@ -43,18 +43,18 @@ window._loadTheme = (theme) => {
document.querySelector("style.theming").remove();
}
document.querySelector("head").innerHTML += `<style class="theming" id="theme_${theme}_css">
document.querySelector("head").innerHTML += `<style class="theming">
@font-face {
font-family: "${theme.cssvars.font_main}";
src: url("${path.join(fontsDir, theme.cssvars.font_main.toLowerCase().replace(/ /g, '_')+'.woff2')}") format("woff2");
src: url("${path.join(fontsDir, theme.cssvars.font_main.toLowerCase().replace(/ /g, '_')+'.woff2').replace(/\\/g, '/')}") format("woff2");
}
@font-face {
font-family: "${theme.cssvars.font_main_light}";
src: url("${path.join(fontsDir, theme.cssvars.font_main_light.toLowerCase().replace(/ /g, '_')+'.woff2')}") format("woff2");
src: url("${path.join(fontsDir, theme.cssvars.font_main_light.toLowerCase().replace(/ /g, '_')+'.woff2').replace(/\\/g, '/')}") format("woff2");
}
@font-face {
font-family: "${theme.terminal.fontFamily}";
src: url("${path.join(fontsDir, theme.terminal.fontFamily.toLowerCase().replace(/ /g, '_')+'.woff2')}") format("woff2");
src: url("${path.join(fontsDir, theme.terminal.fontFamily.toLowerCase().replace(/ /g, '_')+'.woff2').replace(/\\/g, '/')}") format("woff2");
}
:root {
......@@ -260,7 +260,7 @@ initGreeter = () => {
greeter.innerHTML += `Welcome back, <em>${userlist[0].user}</em>`;
})
.catch(() => {
greeter.innerHTML += `We||//c0m€ _b@-K;; <em>##ERr0r</em>`;
greeter.innerHTML += "Welcome back";
})
.then(() => {
greeter.setAttribute("style", "opacity: 1;");
......
......@@ -81,6 +81,7 @@ class FilesystemDisplay {
let tcwd = dir;
fs.readdir(tcwd, (err, content) => {
if (err !== null) {
console.warn(err);
this.setFailedState();
} else {
this.cwd = [];
......@@ -208,10 +209,10 @@ class FilesystemDisplay {
}
if (e.type === "up" && this._noTracking) {
cmd = `window.fsDisp.readFS('${path.resolve(this.dirpath, '..')}')`;
cmd = `window.fsDisp.readFS('${path.resolve(this.dirpath, '..').replace(/\\/g, '\\\\')}')`;
}
if ((e.type === "dir" || e.type.endsWith("Dir")) && this._noTracking) {
cmd = `window.fsDisp.readFS('${path.resolve(this.dirpath, e.name)}')`;
cmd = `window.fsDisp.readFS('${path.resolve(this.dirpath, e.name).replace(/\\/g, '\\\\')}')`;
}
if (e.type === "edex-theme") {
......
......@@ -38,7 +38,10 @@ class RAMwatcher {
let available = data.used-data.active;
let active = data.active;
if (free+available+active !== total) throw("RAM Watcher Error: Bad memory values");
if (process.platform === "win32") available = data.available;
if (free+available+active !== total && process.platform !== "win32") throw("RAM Watcher Error: Bad memory values");
if (free+data.used !== total && process.platform === "win32") console.warn("RAM Watcher Error: Bad memory values");
// Convert the data for the 1000-points grid
active = Math.round((1000*active)/total);
......
......@@ -99,6 +99,13 @@ class Terminal {
this.fit();
setTimeout(() => {
this.fit();
if (process.platform === "win32") {
// Force Powershell to print a prompt
setTimeout(() => {
this.write("n");
this.write("\b");
}, 1000);
}
}, 200);
};
this.socket.onerror = (e) => {throw e};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册