File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 648648 }
649649
650650 // Button event listeners (CSP-compliant, no inline handlers)
651+ // Show reset button only for local connections (hidden by default)
652+ if (!window.__IS_REMOTE__) {
653+ document.getElementById('resetDataBtn').hidden = false;
654+ }
651655 document.getElementById('resetDataBtn').addEventListener('click', showResetModal);
652656 document.getElementById('historyModalClose').addEventListener('click', closeModal);
653657 document.getElementById('resetModalClose').addEventListener('click', cancelReset);
Original file line number Diff line number Diff line change @@ -44,8 +44,9 @@ <h1><span class="logo-bracket"><</span><span class="logo-text">WebStatusπ</s
4444 < span class ="updated-time " id ="updatedTime " role ="status " aria-live ="polite "> // INITIALIZING...</ span >
4545 < button class ="install-button " id ="installBtn " hidden
4646 aria-label ="Install WebStatusπ app " type ="button "> // INSTALL APP</ button >
47- < button class ="reset-button " id ="resetDataBtn "
47+ < button class ="reset-button " id ="resetDataBtn " hidden
4848 aria-label ="Reset all monitoring data " type ="button "> // RESET DATA</ button >
49+ < script nonce ="__CSP_NONCE__ "> window . __IS_REMOTE__ = __IS_REMOTE__ ; </ script >
4950 </ div >
5051 </ nav >
5152 < main id ="cardsContainer " role ="main " aria-label ="Service status cards ">
Original file line number Diff line number Diff line change @@ -807,6 +807,9 @@ def _handle_dashboard(self) -> None:
807807 # get_dashboard() supports hot-reload: detects template file changes
808808 html = get_dashboard ().replace (CSP_NONCE_PLACEHOLDER , nonce )
809809 html = html .replace ("__INITIAL_DATA__" , initial_data )
810+ # Hide reset button for remote (Cloudflare) connections
811+ is_remote = "true" if self ._is_cloudflare_request () else "false"
812+ html = html .replace ("__IS_REMOTE__" , is_remote )
810813 body = html .encode ("utf-8" )
811814
812815 self ._send_html_bytes (200 , body , nonce )
You can’t perform that action at this time.
0 commit comments