From c388df3f15c3b1ede95bdff76f49b4298b5a8f1c Mon Sep 17 00:00:00 2001 From: Sense T Date: Mon, 22 Apr 2024 12:35:37 +0800 Subject: [PATCH] comments --- main.go | 20 +++++++++++++++++++ .../components/records/RecordEditModal.tsx | 3 +++ web/src/main.tsx | 5 +++++ 3 files changed, 28 insertions(+) diff --git a/main.go b/main.go index 42ca3d8..3f2eebe 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,23 @@ +/* +reCoreD-UI provides web ui for CoreDNS + +NAME: +reCoreD-UI - Web UI for CoreDNS + +USAGE: + reCoreD-UI [global options] command [command options] + +COMMANDS: + server run server + config config some settings + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --config value, -c value config yaml file [$RECORED_CONFIG_FILE] + --mysql-dsn value mysql dsn [$RECORED_MYSQL_DSN] + --debug enable debug mode (default: false) + --help, -h show help +*/ package main import ( diff --git a/web/src/components/records/RecordEditModal.tsx b/web/src/components/records/RecordEditModal.tsx index 5d1ff18..92b01be 100644 --- a/web/src/components/records/RecordEditModal.tsx +++ b/web/src/components/records/RecordEditModal.tsx @@ -18,6 +18,7 @@ type Props = { createRecord(record: Record): Promise } +// convert enum RecordTypes to a list for select options. const recordTypeOptions = Object.entries(RecordTypes).filter(e => e[1] !== RecordTypes.RecordTypeSOA).map(e => { return { value: e[1], @@ -246,6 +247,8 @@ export default function RecordEditModal({ open, record, onOk, onCancel, editReco noStyle shouldUpdate={(p, c) => p.record_type !== c.record_type}> { + // load form for record type from the map 'controls'. + // this is a dynamic form ({ getFieldValue }: FormInstance) => { const e = controls.get(getFieldValue('record_type')) if (!e) { diff --git a/web/src/main.tsx b/web/src/main.tsx index 3d7150d..854fa40 100644 --- a/web/src/main.tsx +++ b/web/src/main.tsx @@ -1,3 +1,8 @@ +/* +Web UI for reCoreD-UI +Use React and ant-design now. +JSX/TSX is cool! +*/ import React from 'react' import ReactDOM from 'react-dom/client' import App from './App.tsx'