web debug done

This commit is contained in:
Sense T 2024-04-12 20:03:34 +08:00
parent 01765c4e7f
commit a098d3056c
3 changed files with 13 additions and 13 deletions

View File

@ -65,7 +65,7 @@ export const useDomainStore = defineStore('domains', () => {
await api.put("/domains", domain) await api.put("/domains", domain)
} }
domains.value = domains.value.map(e => e.id === domain.id ? domain : e) domains.value = domains.value.map(e => (e.id === domain.id || e.domain_name === domain.domain_name) ? domain : e)
} }
async function removeDomain(domain: Domain) { async function removeDomain(domain: Domain) {

View File

@ -82,8 +82,8 @@ const recordDevData = new Map<string, Record[]>([
ttl: 3600, ttl: 3600,
record_type: RecordTypes.RecordTypeSOA, record_type: RecordTypes.RecordTypeSOA,
content: { content: {
ns: "ns1.example.com", ns: "ns1.example.com.",
MBox: "admin@example.com", MBox: "admin@example.com.",
refresh: 86400, refresh: 86400,
retry: 7200, retry: 7200,
expire: 3600000, expire: 3600000,
@ -97,7 +97,7 @@ const recordDevData = new Map<string, Record[]>([
ttl: 3600, ttl: 3600,
record_type: RecordTypes.RecordTypeNS, record_type: RecordTypes.RecordTypeNS,
content: { content: {
host: "ns1.example.com" host: "ns1.example.com."
} }
}, },
{ {
@ -107,7 +107,7 @@ const recordDevData = new Map<string, Record[]>([
ttl: 3600, ttl: 3600,
record_type: RecordTypes.RecordTypeNS, record_type: RecordTypes.RecordTypeNS,
content: { content: {
host: "ns2.example.com" host: "ns2.example.com."
} }
}, },
{ {
@ -127,7 +127,7 @@ const recordDevData = new Map<string, Record[]>([
ttl: 3600, ttl: 3600,
record_type: RecordTypes.RecordTypeCNAME, record_type: RecordTypes.RecordTypeCNAME,
content: { content: {
host: "www.example.com" host: "www.example.com."
} }
} }
] ]
@ -141,8 +141,8 @@ const recordDevData = new Map<string, Record[]>([
ttl: 3600, ttl: 3600,
record_type: RecordTypes.RecordTypeSOA, record_type: RecordTypes.RecordTypeSOA,
content: { content: {
ns: "ns1.example.org", ns: "ns1.example.org.",
MBox: "admin@example.org", MBox: "admin@example.org.",
refresh: 86400, refresh: 86400,
retry: 7200, retry: 7200,
expire: 3600000, expire: 3600000,
@ -156,7 +156,7 @@ const recordDevData = new Map<string, Record[]>([
ttl: 3600, ttl: 3600,
record_type: RecordTypes.RecordTypeNS, record_type: RecordTypes.RecordTypeNS,
content: { content: {
host: "ns1.example.org" host: "ns1.example.org."
} }
}, },
{ {
@ -166,7 +166,7 @@ const recordDevData = new Map<string, Record[]>([
ttl: 3600, ttl: 3600,
record_type: RecordTypes.RecordTypeNS, record_type: RecordTypes.RecordTypeNS,
content: { content: {
host: "ns2.example.org" host: "ns2.example.org."
} }
}, },
{ {
@ -186,7 +186,7 @@ const recordDevData = new Map<string, Record[]>([
ttl: 3600, ttl: 3600,
record_type: RecordTypes.RecordTypeCNAME, record_type: RecordTypes.RecordTypeCNAME,
content: { content: {
host: "www.example.org" host: "www.example.org."
} }
} }
] ]

View File

@ -118,7 +118,7 @@ const generateColumns = (domain: string) => [
{ {
key: '', key: '',
render(row: Record) { render(row: Record) {
return <RecordOps record={row} domain={domain} onRecord-delete={deleteRecord} onEdit-record={showEditing} /> return <RecordOps record={row} domain={domain} onRecordDelete={deleteRecord} onEditRecord={showEditing} />
} }
} }
] as DataTableColumns<Record> ] as DataTableColumns<Record>
@ -238,7 +238,7 @@ function RecordsView({ domain }: Props) {
} }
return ( return (
<div id='records'> <div id='records'>
<RecordEditModal show={editModalShow.value} domain={domain} record={editingRecord.value} onReloadRecords={reloadRecords} /> <RecordEditModal show={editModalShow.value} domain={domain} record={editingRecord.value} onReloadRecords={reloadRecords} onUpdate:show={(v: boolean) => editModalShow.value = v} />
{ {
loading.value ? <NSpin size='large' /> : <recordsViewBody domain={domain} /> loading.value ? <NSpin size='large' /> : <recordsViewBody domain={domain} />
} }