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.remoteTraceTarget;
|
||||
|
||||
let ad = { ...additionalData.value() };
|
||||
//let ad = { ...additionalData.value() };
|
||||
let ad_ = additionalData.value();
|
||||
let ad = JSON.parse(JSON.stringify(ad_));
|
||||
data.dns = {
|
||||
domain: ad.dnsDomain,
|
||||
servers: ["pippo"],
|
||||
domain: ad_.dnsDomain,
|
||||
servers: [],
|
||||
};
|
||||
if (ad.dnsIP) data.dns["servers"].push(ad.dnsIP);
|
||||
console.log(`*** dns="${JSON.stringify(ad)}" -> ${JSON.stringify(data.dns)}`);
|
||||
if (ad_.dnsIP) data.dns["servers"].push(ad_.dnsIP);
|
||||
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.dnsDomain;
|
||||
delete ad.dnsEnable;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
const cp = require("child_process");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
const db = require("../utils/db");
|
||||
const cp = require("child_process");
|
||||
|
||||
//TODO: does this kind of "optimization" make sense in Node.js?
|
||||
let token = null;
|
||||
|
@ -61,7 +61,7 @@ function startDNS(token, nwid, conf) {
|
|||
opts.push("-E", e);
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.warn(` cannot execute (${e})`);
|
||||
console.warn(" cannot execute");
|
||||
return false;
|
||||
}
|
||||
})
|
||||
|
@ -70,7 +70,7 @@ function startDNS(token, nwid, conf) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
opts.push("start", "-v", "-v");
|
||||
opts.push("start");
|
||||
if (conf.hasOwnProperty("dnsWildcard") && conf.dnsWildcard) {
|
||||
opts.push("-w");
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ function NetworkSettings({ network, setNetwork }) {
|
|||
/>
|
||||
<Grid item>
|
||||
<TextField
|
||||
value={network["dnsDomain"]}
|
||||
value={network["config"]["dns"]["domain"]}
|
||||
onChange={handleChange("dnsDomain")}
|
||||
label="Domain"
|
||||
variant="filled"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue