stage 2, not completed

This commit is contained in:
Sense T 2024-04-19 10:05:19 +08:00
parent 88b2255f8b
commit 34fb2a478b
5 changed files with 5 additions and 1 deletions

View File

@ -86,6 +86,7 @@ func GetDomains(domain string) ([]models.Domain, error) {
func UpdateDomain(d *models.Domain) error { func UpdateDomain(d *models.Domain) error {
tx := database.Client.Begin() tx := database.Client.Begin()
logrus.Debug(d)
if _, err := (domainsDAO{}).Update(tx, d); err != nil { if _, err := (domainsDAO{}).Update(tx, d); err != nil {
tx.Rollback() tx.Rollback()
return err return err

View File

@ -79,6 +79,7 @@ export default function DomainEditModal({ open, domain, editDomain, createDomain
scrollToFirstError scrollToFirstError
autoComplete="off" autoComplete="off"
> >
<Form.Item<Domain> hidden name='id' />
<Form.Item<Domain> <Form.Item<Domain>
label={t('domains._')} label={t('domains._')}
name='domain_name' name='domain_name'

View File

@ -15,7 +15,7 @@ export default function DomainInfo({ domain }: Props) {
</p> </p>
<p> <p>
<GlobalOutlined className="icon-info" /> <GlobalOutlined className="icon-info" />
<span className="info">{domain.domain_name}</span> <span className="info">{domain.main_dns}</span>
</p> </p>
</> </>
) )

View File

@ -226,6 +226,7 @@ export default function RecordEditModal({ open, record, onOk, onCancel, editReco
wrapperCol={{ span: 20 }} wrapperCol={{ span: 20 }}
validateTrigger='onBlur' validateTrigger='onBlur'
> >
<Form.Item<Record> hidden name='id' />
<Form.Item<Record> label={t('records.recordType')} required name='record_type'> <Form.Item<Record> label={t('records.recordType')} required name='record_type'>
<Select allowClear={false} options={recordTypeOptions} /> <Select allowClear={false} options={recordTypeOptions} />
</Form.Item> </Form.Item>

View File

@ -56,6 +56,7 @@ export const useDomainStore = () => {
} }
async function updateDomain(domain: Domain) { async function updateDomain(domain: Domain) {
console.log(domain)
if (!import.meta.env.DEV) { if (!import.meta.env.DEV) {
await api.put("/domains", domain) await api.put("/domains", domain)
} }