From 34fb2a478b90760c1efd4401a59a29bb236a8653 Mon Sep 17 00:00:00 2001
From: Sense T
Date: Fri, 19 Apr 2024 10:05:19 +0800
Subject: [PATCH] stage 2, not completed
---
controllers/domain.go | 1 +
web/src/components/domains/DomainEditModal.tsx | 1 +
web/src/components/domains/DomainInfo.tsx | 2 +-
web/src/components/records/RecordEditModal.tsx | 1 +
web/src/stores/domains.ts | 1 +
5 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/controllers/domain.go b/controllers/domain.go
index f16064c..273de25 100644
--- a/controllers/domain.go
+++ b/controllers/domain.go
@@ -86,6 +86,7 @@ func GetDomains(domain string) ([]models.Domain, error) {
func UpdateDomain(d *models.Domain) error {
tx := database.Client.Begin()
+ logrus.Debug(d)
if _, err := (domainsDAO{}).Update(tx, d); err != nil {
tx.Rollback()
return err
diff --git a/web/src/components/domains/DomainEditModal.tsx b/web/src/components/domains/DomainEditModal.tsx
index 32b7550..79d740b 100644
--- a/web/src/components/domains/DomainEditModal.tsx
+++ b/web/src/components/domains/DomainEditModal.tsx
@@ -79,6 +79,7 @@ export default function DomainEditModal({ open, domain, editDomain, createDomain
scrollToFirstError
autoComplete="off"
>
+ hidden name='id' />
label={t('domains._')}
name='domain_name'
diff --git a/web/src/components/domains/DomainInfo.tsx b/web/src/components/domains/DomainInfo.tsx
index c442291..c773efa 100644
--- a/web/src/components/domains/DomainInfo.tsx
+++ b/web/src/components/domains/DomainInfo.tsx
@@ -15,7 +15,7 @@ export default function DomainInfo({ domain }: Props) {
- {domain.domain_name}
+ {domain.main_dns}
>
)
diff --git a/web/src/components/records/RecordEditModal.tsx b/web/src/components/records/RecordEditModal.tsx
index 6e24eda..b8e3b32 100644
--- a/web/src/components/records/RecordEditModal.tsx
+++ b/web/src/components/records/RecordEditModal.tsx
@@ -226,6 +226,7 @@ export default function RecordEditModal({ open, record, onOk, onCancel, editReco
wrapperCol={{ span: 20 }}
validateTrigger='onBlur'
>
+ hidden name='id' />
label={t('records.recordType')} required name='record_type'>
diff --git a/web/src/stores/domains.ts b/web/src/stores/domains.ts
index 57cf283..03e6083 100644
--- a/web/src/stores/domains.ts
+++ b/web/src/stores/domains.ts
@@ -56,6 +56,7 @@ export const useDomainStore = () => {
}
async function updateDomain(domain: Domain) {
+ console.log(domain)
if (!import.meta.env.DEV) {
await api.put("/domains", domain)
}