99 body { font-family : -apple-system, BlinkMacSystemFont, "Segoe UI" , Roboto, sans-serif; background : # f5f5f5 ; color : # 333 ; padding : 20px ; max-width : 640px ; margin : 0 auto; }
1010 h1 { margin-bottom : 6px ; font-size : 1.4em ; }
1111 .subtitle { font-size : 0.85em ; color : # 666 ; margin-bottom : 20px ; }
12+ .phone { background : # fff ; border-radius : 8px ; padding : 16px ; box-shadow : 0 1px 3px rgba (0 , 0 , 0 , 0.1 ); margin-bottom : 20px ; display : flex; align-items : center; gap : 12px ; }
13+ .phone-label { font-size : 0.8em ; color : # 666 ; text-transform : uppercase; letter-spacing : 0.5px ; }
14+ .phone-number { font-size : 1.3em ; font-weight : 600 ; letter-spacing : 0.5px ; }
1215 .overall { padding : 16px ; border-radius : 8px ; margin-bottom : 20px ; font-weight : 600 ; font-size : 1.1em ; text-align : center; }
1316 .overall .ok { background : # dcfce7 ; color : # 166534 ; }
1417 .overall .degraded { background : # fef9c3 ; color : # 854d0e ; }
3235< body >
3336< h1 > Avalanche SMS</ h1 >
3437< div class ="subtitle "> System Status</ div >
38+ < div class ="phone " id ="phone " style ="display:none ">
39+ < div > < div class ="phone-label "> Text lat,long or send location to</ div > < div class ="phone-number " id ="phone-number "> </ div > </ div >
40+ </ div >
3541< div class ="overall loading " id ="overall "> Checking...</ div >
3642< div id ="services "> </ div >
3743< button class ="refresh-btn " id ="refresh-btn " onclick ="refresh() "> Refresh</ button >
3844< div class ="updated " id ="updated "> </ div >
3945< script >
4046var labels = { ok : 'All Systems Operational' , degraded : 'Partial Outage' , down : 'Major Outage' } ;
47+ function formatPhone ( num ) {
48+ // Format +15551234567 as +1 (555) 123-4567
49+ var m = num . match ( / ^ \+ 1 ( \d { 3 } ) ( \d { 3 } ) ( \d { 4 } ) $ / ) ;
50+ if ( m ) return '+1 (' + m [ 1 ] + ') ' + m [ 2 ] + '-' + m [ 3 ] ;
51+ return num ;
52+ }
4153function refresh ( ) {
4254 var btn = document . getElementById ( 'refresh-btn' ) ;
4355 btn . disabled = true ;
@@ -48,6 +60,13 @@ <h1>Avalanche SMS</h1>
4860 fetch ( '/status' ) . then ( function ( r ) { return r . json ( ) ; } ) . then ( function ( data ) {
4961 ov . className = 'overall ' + data . overall ;
5062 ov . textContent = labels [ data . overall ] || data . overall ;
63+ var phoneEl = document . getElementById ( 'phone' ) ;
64+ if ( data . phone_number ) {
65+ document . getElementById ( 'phone-number' ) . textContent = formatPhone ( data . phone_number ) ;
66+ phoneEl . style . display = '' ;
67+ } else {
68+ phoneEl . style . display = 'none' ;
69+ }
5170 var container = document . getElementById ( 'services' ) ;
5271 container . innerHTML = '' ;
5372 data . services . forEach ( function ( s ) {
0 commit comments