File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed
src/routes/(auth)/(project)/domain Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 5858 {#each domains as it (` ${it .domain }-${it .location } ` )}
5959 <tr >
6060 <td >
61- <StatusIcon status ={it .verification .ssl .pending ? ' verify' : it .status } />
61+ <StatusIcon status ={it .cdn && it . verification .ssl .pending ? ' verify' : it .status } />
6262 <a href ={` /domain/detail?project=${project }&domain=${it .domain } ` } class ="nm-link" >{it .domain }</a >
6363 </td >
6464 <td >
Original file line number Diff line number Diff line change 178178
179179 function upgradeCdn () {
180180 modal .confirm ({
181- html: ` Add CDN to "${ domain .domain } " ?<br><br>This action can not roll back. ` ,
182- yes: ' Upgrade to Hostname ' ,
181+ html: ` Add CDN to "${ domain .domain } " ?` ,
182+ yes: ' Upgrade' ,
183183 callback: async () => {
184184 const resp = await api .invoke (' domain.create' , {
185185 project,
197197 }
198198 })
199199 }
200+
201+ function downgradeCdn () {
202+ modal .confirm ({
203+ html: ` Remove CDN from "${ domain .domain } " ?` ,
204+ yes: ' Downgrade' ,
205+ callback: async () => {
206+ const resp = await api .invoke (' domain.create' , {
207+ project,
208+ location: domain .location ,
209+ domain: domain .domain ,
210+ wildcard: domain .wildcard ,
211+ cdn: false
212+ }, fetch)
213+ if (! resp .ok ) {
214+ modal .error ({ error: resp .error })
215+ return
216+ }
217+ await api .invalidate (' domain.get' )
218+ handleReload ()
219+ }
220+ })
221+ }
200222 </script >
201223
202224<div class =" nm-breadcrumb" >
432454 {/if }
433455 </div >
434456
435- {#if ! domain .cdn }
436- <hr >
457+ <hr >
458+ {#if domain .cdn }
459+ <div class =" _dp-f _alit-ct _fw-w" >
460+ <button class ="nm-button" onclick ={downgradeCdn }>Remove CDN (DDoS Protection)</button >
461+ </div >
462+ {:else }
437463 <div class =" _dp-f _alit-ct _fw-w" >
438464 <button class ="nm-button" onclick ={upgradeCdn }>Add CDN (DDoS Protection)</button >
439465 </div >
You can’t perform that action at this time.
0 commit comments