Frontend for the Tophhie Cloud block page for Cloudflare Zero Trust.

Updated texts

tophhie.cloud 9005619e 2176f96c

verified
+17 -2
+2
README.md
··· 42 42 static readonly CONTACT_WEB: string = "https://support.tophhie.cloud"; 43 43 static readonly BLOCKED_HEADER: string = "Access restricted!"; 44 44 static readonly BLOCKED_TEXT: string = "Access to this website is restricted. Use the contact button below to request access."; 45 + static readonly BLOCKED_TEXT_NOMETA: string = "Access to this website is restricted." 45 46 static readonly CONTACT_BUTTON_TXT: string = "Request access"; 46 47 } 47 48 ``` ··· 81 82 VITE_CONTACT_WEB=https://support.tophhie.cloud 82 83 VITE_BLOCKED_HEADER=Access restricted! 83 84 VITE_BLOCKED_TEXT=Access to this website is restricted. Use the contact button below to request access. 85 + VITE_BLOCKED_TEXT_NOMETA=Access to this website is restricted. 84 86 VITE_CONTACT_BUTTON_TXT=Request access 85 87 ``` 86 88
+6 -1
src/config.ts
··· 15 15 static readonly BLOCKED_HEADER: string = "Access restricted!"; 16 16 17 17 /** 18 - * Block page detail text 18 + * Block page detail text (if Cloudflare metadata is provided) 19 19 */ 20 20 static readonly BLOCKED_TEXT: string = "Access to this website has been restricted. Use the contact button below to request access."; 21 + 22 + /** 23 + * Block page detail text (if no Cloudflare metadata is provided) 24 + */ 25 + static readonly BLOCKED_TEXT_NOMETA = "Access has been restricted. No website information has been supplied."; 21 26 22 27 /** 23 28 * Contact email button text
+9 -1
src/routes/+page.svelte
··· 50 50 showAddInfo = !showAddInfo 51 51 } 52 52 53 + function metadataAvailable(): boolean { 54 + return rows.length > 0 && rows.some(([label]) => label != "Date/Time") 55 + } 56 + 53 57 54 58 function sendBlockedRequestEmail(): void { 55 59 const subject = "Cloudflare Zero Trust - Blocked Request"; ··· 106 110 </div> 107 111 {/if} 108 112 <p> 113 + {#if metadataAvailable()} 109 114 {Config.BLOCKED_TEXT} 115 + {:else} 116 + {Config.BLOCKED_TEXT_NOMETA} 117 + {/if} 110 118 </p> 111 - {#if rows.length > 0 && rows.some(([label]) => label != "Date/Time")} 119 + {#if metadataAvailable()} 112 120 <button class="block w-full px-3 py-1.5 text-sm text-gray-700 rounded transition-colors" style="cursor: pointer;" onclick={showAdditionalInfo}> 113 121 {detailButtonTxt} 114 122 </button>