Add bilingual user names and optional DNS updates in super-admin.

Edit user now has FA/EN first and last names, and domain save only upserts Arvan records when Update DNS is checked.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-20 11:50:57 +03:30
co-authored by Cursor
parent 353508a091
commit a7950f1f13
8 changed files with 116 additions and 12 deletions
+33 -3
View File
@@ -100,6 +100,7 @@ export function WebsitesPage() {
const [editDomain, setEditDomain] = useState<DomainListItem | null>(null)
const [editHost, setEditHost] = useState('')
const [editExpiresAt, setEditExpiresAt] = useState('')
const [editUpdateDns, setEditUpdateDns] = useState(false)
const [editSubmitting, setEditSubmitting] = useState(false)
const [editError, setEditError] = useState('')
@@ -168,6 +169,7 @@ export function WebsitesPage() {
setEditDomain(domain)
setEditHost(domain.host)
setEditExpiresAt(domain.expiresAt ? domain.expiresAt.slice(0, 10) : '')
setEditUpdateDns(false)
setEditError('')
setEditOpen(true)
}
@@ -177,13 +179,25 @@ export function WebsitesPage() {
setEditSubmitting(true)
setEditError('')
try {
await updateDomain(editDomain.id, {
const updated = (await updateDomain(editDomain.id, {
host: editHost.trim(),
updateDns: editUpdateDns,
...(editExpiresAt ? { expiresAt: new Date(editExpiresAt).toISOString() } : {}),
})
})) as { dnsError?: string | null }
setEditOpen(false)
setEditDomain(null)
showToast(`"${editHost.trim()}" has been updated.`, 'success')
setEditUpdateDns(false)
if (updated.dnsError) {
showToast(`"${editHost.trim()}" was updated, but Arvan DNS failed.`, 'error')
showToast(updated.dnsError, 'error')
} else {
showToast(
editUpdateDns
? `"${editHost.trim()}" has been updated and DNS records synced.`
: `"${editHost.trim()}" has been updated.`,
'success',
)
}
setData((prev) => {
if (!prev) return prev
return {
@@ -711,6 +725,7 @@ export function WebsitesPage() {
onClose={() => {
setEditOpen(false)
setEditDomain(null)
setEditUpdateDns(false)
setEditError('')
}}
>
@@ -740,6 +755,21 @@ export function WebsitesPage() {
/>
</div>
<div style={{ height: 12 }} />
<label className={tableStyles.entityCheck} htmlFor="edit-domain-update-dns">
<input
id="edit-domain-update-dns"
type="checkbox"
checked={editUpdateDns}
onChange={(e) => setEditUpdateDns(e.target.checked)}
disabled={editSubmitting}
/>
<span>Update DNS records</span>
</label>
<p className={tableStyles.subText} style={{ marginTop: 6 }}>
When checked, upserts Arvan records: @ ANAME → ns.meshkee.com, plus www,
business, customer, and api CNAMEs.
</p>
<div style={{ height: 12 }} />
<div className={tableStyles.actionsRow}>
<button
type="button"