Fix collor when the service fails. Automatically refresh the status every 30 seconds

This commit is contained in:
akuker 2020-07-26 21:06:48 -05:00
parent b8874d1e27
commit 4c02bd5a1a
3 changed files with 23 additions and 13 deletions

View File

@ -1,8 +1,8 @@
<HTML>
<HEAD> <TITLE>Simple Frame Set Example</TITLE></HEAD>
<FRAMESET ROWS="5%,95%" BORDER=0>
<FRAME SRC="status.php" NAME="exampletoc">
<FRAME SRC="rascsi.php" NAME="examplecontent">
<HEAD> <TITLE>RaSCSI Control Page</TITLE></HEAD>
<FRAMESET ROWS="20px,*" BORDER=0>
<FRAME SRC="status.php" NAME="rascsi_status">
<FRAME SRC="rascsi.php" NAME="rascsi_control">
<NOFRAMES>You must use a browser that can display frames
to see this page. </NOFRAMES>
</FRAMESET>

View File

@ -42,10 +42,10 @@
<tr style="background-color: black;">
<td style="background-color: black;"><a href=http://github.com/akuker/RASCSI><h1>RaSCSI - 68kmla Edition</h1></a></td>
<td style="background-color: black;">
<form action="/rascsi.php">
<input type="submit" value="Refresh"/>
</form>
</td>
<form action="/rascsi.php">
<input type="submit" value="Refresh"/>
</form>
</td>
</tr>
</table>

View File

@ -7,6 +7,18 @@
<!DOCTYPE html>
<html>
<script type="text/javascript">
window.onload = setupRefresh;
function setupRefresh() {
setTimeout("refreshPage();", 30000); // milliseconds
}
function refreshPage() {
window.location = location.href;
}
</script>
<?php
// Blatently copied from stack overflow:
@ -21,13 +33,11 @@
$text='Stopped';
}
echo '<body style="background-color: green;">';
echo '<body style="background-color: '.$color.';">';
echo '<table width="100%" height=100% style="position: absolute; top: 0; bottom: 0; left: 0; right: 0; background-color:'.$color.'">';
echo '<tr style:"height: 50%">';
echo '<td style="color: white; background-color: '.$color.'; text-align: center; vertical-align: center; font-family: Arial, Helvetica, sans-serif;">'.$text.'</td>';
echo '<tr style:"height: 100%">';
echo '<td style="color: white; background-color: '.$color.'; text-align: center; vertical-align: center; font-family: Arial, Helvetica, sans-serif;">'.$text.' '.date("h:i:sa").'</td>';
echo '</tr>';
echo '<tr style:"height: 50%">';
echo '<td style="color: white; background-color: '.$color.'; text-align: center; vertical-align: center; font-family: Arial, Helvetica, sans-serif;">'.date("h:i:sa").'</td></tr>';
echo '</table>';
?>
</body>