Skip to content

Commit

Permalink
chore(web): hide DnsID when idLabel is empty (#739)
Browse files Browse the repository at this point in the history
* chore(web): hide `DnsID` when `idLabel` is empty

* fix: do not disable when `idLabel` is empty
  • Loading branch information
WaterLemons2k authored Jun 14, 2023
1 parent 8410315 commit e283f7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/writing.html
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,10 @@ <h5 class="portlet__head">Webhook</h5>
document.getElementsByName("DnsName").forEach(e => e.addEventListener('click', e => {
const dnsInfo = dnsProviders.find(d => d.id == e.target.value);
const dnsIDElem = document.getElementById('DnsID');
dnsIDElem.disabled = !(dnsInfo.idLabel);

// idLabel 为空时隐藏 DnsID
dnsIDElem.hidden = !(dnsInfo.idLabel);

if (dnsInfo.idLabel) {
dnsIDElem.value ||= beforeDnsID;
} else {
Expand Down

0 comments on commit e283f7a

Please sign in to comment.