mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-08-19 21:03:56 -07:00
feat: frontend back to working status
I am unsure about this solution: frontend writes to "additionalConfig" but reads back from `config.dns` maintained by backend.
This commit is contained in:
parent
0b77e9594b
commit
0294eb6436
3 changed files with 17 additions and 9 deletions
|
@ -22,13 +22,21 @@ async function getNetworkAdditionalData(data) {
|
||||||
delete data.remoteTraceLevel;
|
delete data.remoteTraceLevel;
|
||||||
delete data.remoteTraceTarget;
|
delete data.remoteTraceTarget;
|
||||||
|
|
||||||
let ad = { ...additionalData.value() };
|
//let ad = { ...additionalData.value() };
|
||||||
|
let ad_ = additionalData.value();
|
||||||
|
let ad = JSON.parse(JSON.stringify(ad_));
|
||||||
data.dns = {
|
data.dns = {
|
||||||
domain: ad.dnsDomain,
|
domain: ad_.dnsDomain,
|
||||||
servers: ["pippo"],
|
servers: [],
|
||||||
};
|
};
|
||||||
if (ad.dnsIP) data.dns["servers"].push(ad.dnsIP);
|
if (ad_.dnsIP) data.dns["servers"].push(ad_.dnsIP);
|
||||||
console.log(`*** dns="${JSON.stringify(ad)}" -> ${JSON.stringify(data.dns)}`);
|
console.log(
|
||||||
|
`*** ad_="${JSON.stringify(ad_, null, 3)}" -> ad="${JSON.stringify(
|
||||||
|
ad,
|
||||||
|
null,
|
||||||
|
3
|
||||||
|
)}" -> ${JSON.stringify(data.dns, null, 3)}`
|
||||||
|
);
|
||||||
delete ad.dnsIP;
|
delete ad.dnsIP;
|
||||||
delete ad.dnsDomain;
|
delete ad.dnsDomain;
|
||||||
delete ad.dnsEnable;
|
delete ad.dnsEnable;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
const cp = require("child_process");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const db = require("../utils/db");
|
const db = require("../utils/db");
|
||||||
const cp = require("child_process");
|
|
||||||
|
|
||||||
//TODO: does this kind of "optimization" make sense in Node.js?
|
//TODO: does this kind of "optimization" make sense in Node.js?
|
||||||
let token = null;
|
let token = null;
|
||||||
|
@ -61,7 +61,7 @@ function startDNS(token, nwid, conf) {
|
||||||
opts.push("-E", e);
|
opts.push("-E", e);
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(` cannot execute (${e})`);
|
console.warn(" cannot execute");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -70,7 +70,7 @@ function startDNS(token, nwid, conf) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
opts.push("start", "-v", "-v");
|
opts.push("start");
|
||||||
if (conf.hasOwnProperty("dnsWildcard") && conf.dnsWildcard) {
|
if (conf.hasOwnProperty("dnsWildcard") && conf.dnsWildcard) {
|
||||||
opts.push("-w");
|
opts.push("-w");
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ function NetworkSettings({ network, setNetwork }) {
|
||||||
/>
|
/>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<TextField
|
<TextField
|
||||||
value={network["dnsDomain"]}
|
value={network["config"]["dns"]["domain"]}
|
||||||
onChange={handleChange("dnsDomain")}
|
onChange={handleChange("dnsDomain")}
|
||||||
label="Domain"
|
label="Domain"
|
||||||
variant="filled"
|
variant="filled"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue