update domain registration and dns frontend
This commit is contained in:
+1
-1
@@ -33,7 +33,7 @@ async function RegisterNewDomain(domain) {
|
|||||||
if (!prefix) throw new Error("Invalid domain");
|
if (!prefix) throw new Error("Invalid domain");
|
||||||
|
|
||||||
const key = `${prefix}`;
|
const key = `${prefix}`;
|
||||||
const value = JSON.stringify({ type: 'A', host: '10.66.66.1' });
|
const value = JSON.stringify({ type: 'A', host: '10.66.66.1', ttl: '300' });
|
||||||
|
|
||||||
await client.put(key).value(value);
|
await client.put(key).value(value);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-4
@@ -28,13 +28,11 @@ router.get('/dns/edit/:domainId', authMw.AllowIfAuthenticated, async (req, res,
|
|||||||
const fullDomain = result.domain + "." + result.tld;
|
const fullDomain = result.domain + "." + result.tld;
|
||||||
const rawRecords = await GetAllRecords(fullDomain);
|
const rawRecords = await GetAllRecords(fullDomain);
|
||||||
let records = [];
|
let records = [];
|
||||||
let recordHeaders = ["Domain"];
|
let recordHeaders = [];
|
||||||
|
|
||||||
for(const [key, value] of Object.entries(rawRecords)) {
|
for(const [key, value] of Object.entries(rawRecords)) {
|
||||||
let parsedVal = JSON.parse(value);
|
let parsedVal = JSON.parse(value);
|
||||||
let finalRecord = {
|
let finalRecord = {};
|
||||||
domain: CoreDNSToDomain(key)
|
|
||||||
};
|
|
||||||
|
|
||||||
for(const [key, value] of Object.entries(parsedVal)) {
|
for(const [key, value] of Object.entries(parsedVal)) {
|
||||||
if(!recordHeaders.includes(key)) {
|
if(!recordHeaders.includes(key)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user