Commit 84195771 authored by Minteck's avatar Minteck 😸

Commit

parent d6b7845f
Pipeline #130490914 passed with stages
in 1 minute and 16 seconds
* {
/* cursor: default; */
cursor: url("./normal.png"), default !important;
cursor: url("./24/normal.png"), none;
}
.nocur, .nocur * {
......@@ -8,5 +8,9 @@
}
input[type="text"], input[type="password"], textarea {
cursor: text;
cursor: url("./24/text.png"), none;
}
#fde-debugger-debug a {
cursor: url("./24/link.png"), none;
}
\ No newline at end of file
......@@ -235,6 +235,8 @@
document.getElementById('wunaconn').style.display = "block";
document.getElementById('wrefresh').style.display = "block";
} else {
global.wifiPassword = document.getElementById('wifipass').value;
global.wifiSsid = wifiSsid;
document.getElementById('wifipass').value = "";
currenta = await wifi.getCurrentConnections();
current = currenta[0];
......@@ -304,6 +306,8 @@
document.getElementById('wunaconn').style.display = "block";
document.getElementById('wrefresh').style.display = "block";
} else {
global.wifiPassword = document.getElementById('wifipass').value;
global.wifiSsid = wifiSsid;
document.getElementById('wifipass').value = "";
currenta = await wifi.getCurrentConnections();
current = currenta[0];
......@@ -457,6 +461,17 @@
// In the system config file, add computer name
fs.writeFileSync("./user/system.json", JSON.stringify({hostname:document.getElementById('hostname').value,lang:langprop}));
// Save Wi-Fi password
if (wifiSsid) {
if (wifiPassword) {
fs.writeFileSync("./user/wifipass.json", "{\"" + wifiSsid.split("\"").join("\\\"") + "\": \"" + wifiPassword.split("\"").join("\\\"") + "\"}");
} else {
fs.writeFileSync("./user/wifipass.json", "{\"" + wifiSsid.split("\"").join("\\\"") + "\": null}");
}
} else {
fs.writeFileSync("./user/wifipass.json", "{}");
}
// Create the user data folder
try {
// Try to process
......
......@@ -80,7 +80,7 @@
setInterval(() => {
navigator.getBattery().then((e) => {
image = "../../icons/shell/battery/battery_missing.svg";
level = e.level * 100;
level = Math.round(e.level * 100);
charging = e.charging;
if (charging == true) {
if (level == 0) {
......@@ -139,6 +139,47 @@
})
}, 500)
// Network
setTimeout(() => {
const os = require('os');
const wifi = require('node-wifi');
ifaces = Object.keys(os.networkInterfaces());
image = "../../icons/shell/wired_error.svg";
wiredprocessed = false;
ifaces.forEach((iface, index) => {
if (iface.toLowerCase().includes("enp") || iface.toLowerCase().includes("eth")) { // Check if interface is Ethernet
wiredprocessed = true;
e = os.networkInterfaces()[iface];
if (e.address.trim() != "" && e.family.startsWith("IP") && e.mac != "00:00:00:00:00:00") { // Check if Ethernet is connected and enabled
image = "../../icons/shell/wired_online.svg";
} else {
if (e.address.trim() == "") {
image = "../../icons/shell/wired_connecting.svg";
}
if (!e.family.startsWith("IP")) {
image = "../../icons/shell/wired_offline.svg";
}
if (e.mac == "00:00:00:00:00:00") {
image = "../../icons/shell/wired_error.svg";
}
}
}
})
wifi.init({
iface: null,
});
wifi.getCurrentConnections((err, conn) => {
if (!wiredprocessed) {
c = conn[0];
if (c.ssid.trim() == "" || c.bssid.trim() == "") {
}
}
});
document.getElementById('statusbar-network').innerHTML = '<img src="' + image + '" width="16px" height="16px" style="filter:brightness(200%);vertical-align:middle;">';
}, 500)
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment