This commit is contained in:
biosvos
2026-08-07 17:38:18 +09:00
commit 873193a243
9613 changed files with 2755992 additions and 0 deletions
@@ -0,0 +1 @@
../src/clock.js
@@ -0,0 +1,8 @@
<?
//
$rc_id = 'BD-08';
$service_name = 'Yonhapnews BD';
$title_name = 'KT-ICS';
$move_page_title = 'Yonhapnews YD';
$move_page_uri = '../yd/';
?>
@@ -0,0 +1 @@
../src/images
@@ -0,0 +1 @@
../src/index.html
@@ -0,0 +1 @@
../src/layer.js
@@ -0,0 +1,15 @@
<html>
<head>
<script language="javascript" type="text/javascript">
<!--
function setLocationHref()
{
// set the location path as local page name.
window.location.href = 'bd/index.html';
}
//-->
</script>
</head>
<body onLoad="setLocationHref()">
</body>
@@ -0,0 +1,292 @@
// Removes leading and trailing spaces from the passed string. Also removes
// consecutive spaces and replaces it with one space. If something besides
// a string is passed in (null, custom object, etc.) then return the input.
function trimString(inputString) {
if (typeof inputString != "string") {
return inputString;
}
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ") {
// Check for spaces at the beginning of the string
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
ch = retValue.substring(retValue.length-1, retValue.length);
while (ch == " ") { // Check for spaces at the end of the string
retValue = retValue.substring(0, retValue.length-1);
ch = retValue.substring(retValue.length-1, retValue.length);
}
while (retValue.indexOf(" ") != -1) {
// Note that there are two spaces in the string - look for multiple spaces within the string
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+ 1, retValue.length); // Again, there are two spaces in each of the strings
}
return retValue; // Return the trimmed string back to the user
}
// Ends the "trim" function
function idnKeyboard(url)
{
myPopupWin= window.open(url,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=818,height=350');
myPopupWin.focus();
}
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+args[i+2]+args[i+3]+args[i+4]+"'");
}
function submitRequest(url)
{
self.opener.location.href=url;
self.opener.document.submit();
}
function setGainingRegIDValue(selectedform, selectedRegID ) {
selectedRegID.value = selectedform.regID.options[selectedform.regID.selectedIndex].value;
}
function PopWin(myUrl, arg1, arg2, arg3, width, height,resizable)
{
var url=myUrl+arg1+arg2+arg3;
myPopupWin = window.open(url,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=700', copyhistory=0);
myPopupWin.focus();
}
function appendValues(nameObj)
{
if (isEmpty(nameObj.value) ) return;
appendOptionToSelectBox(window.document.form1.userNameList,
nameObj.value, false);
}
function appendNVPair(nameObj, valueObj)
{
if (isEmpty(nameObj.value) ) return;
if (isEmpty(valueObj.value) ) return;
str = nameObj.value + "=" + valueObj.value;
appendOptionToSelectBox(window.document.form1.userNameList, str, false);
}
function appendContPairs(nameObj, valueObj)
{
if (isEmpty(nameObj.value) ) return;
if (isEmpty(valueObj.value) ) return;
str = nameObj.value + "=" + valueObj.value;
appendOptionToSelectBox(window.document.form1.regContList, str, false);
}
function appendIPAdressValue(nameObj, valueObj)
{
if (isEmpty(nameObj.value) ) return;
if (isEmpty(valueObj.value) ) return;
str = nameObj.value + "=" + valueObj.value;
appendOptionToSelectBox(window.document.form1.nsIplist, str, false);
}
function removeNVPair()
{
if(window.document.form1.userNameList.selectedIndex >=0 ){
//removeOptionSelected(window.document.form1.userValueList);
removeOptionSelected(window.document.form1.userNameList);
}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function validateIP(theIP,theField, formCxt)
{
if( !isValidIPV4(theIP) ) {
formCxt.setError();
alert('invalid entry: '+formCxt.getFieldDescription(theField.name));
}
}
function setRegIDValue(selectedRegID ) {
selectedRegID.value = window.document.query.regID.options[window.document.query.regID.selectedIndex].value;
}
var timerID ;
function tzone(tz, os, ds, cl)
{
this.ct = new Date(0) ; // datetime
this.tz = tz ; // code
this.os = os ; // GMT offset
this.ds = ds ; // has daylight savings
this.cl = cl ; // font color
}
function UpdateClocks()
{
// www.timeanddate.com/worldclock
var ct = new Array(
new tzone('UTC: ', 0, 1, '#FFAA00'),
new tzone('KST: ', +9, 1, '#FFAA00'),
new tzone('EST: ', -5, 1, '#FFAA00'),
new tzone('GMT: ', 0, 1, '#FFAA00'),
new tzone('C N : ', +8, 0, 'silver'),
new tzone('KST: ', +9, 0, 'silver'),
new tzone('EDT: ', -4, 1, 'silver'),
new tzone('GER: ', +1, 1, 'silver')
) ;
var dt = new Date() ; // [GMT] time according to machine clock
var startDST = new Date(dt.getFullYear(), 3, 1) ;
while (startDST.getDay() != 0)
startDST.setDate(startDST.getDate() + 1) ;
var endDST = new Date(dt.getFullYear(), 9, 31) ;
while (endDST.getDay() != 0)
endDST.setDate(endDST.getDate() - 1) ;
var ds_active ; // DS currently active
if (startDST < dt && dt < endDST)
ds_active = 1 ;
else
ds_active = 0 ;
// Adjust each clock offset if that clock has DS and in DS.
for(n=0 ; n<ct.length ; n++)
if (ct[n].ds == 1 && ds_active == 1) ct[n].os++ ;
// compensate time zones
gmdt = new Date() ;
for (n=0 ; n<ct.length ; n++)
ct[n].ct = new Date(gmdt.getTime() + ct[n].os * 3600 * 1000) ;
window.document.getElementById("Clock0").innerHTML = '<font color="' + ct[0].cl + '">' + ct[0].tz + ClockString(ct[0].ct) + '</font>' ;
window.document.getElementById("Clock1").innerHTML = '<font color="' + ct[1].cl + '">' + ct[1].tz + ClockString(ct[1].ct) + '</font>' ;
window.document.getElementById("Clock2").innerHTML = '<font color="' + ct[2].cl + '">' + ct[2].tz + ClockString(ct[2].ct) + '</font>' ;
window.document.getElementById("Clock3").innerHTML = '<font color="' + ct[3].cl + '">' + ct[3].tz + ClockString(ct[3].ct) + '</font>' ;
window.document.getElementById("Clock4").innerHTML = '<font color="' + ct[4].cl + '">' + ct[4].tz + ClockString(ct[4].ct) + '</font>' ;
window.document.getElementById("Clock5").innerHTML = '<font color="' + ct[5].cl + '">' + ct[5].tz + ClockString(ct[5].ct) + '</font>' ;
window.document.getElementById("Clock6").innerHTML = '<font color="' + ct[6].cl + '">' + ct[6].tz + ClockString(ct[6].ct) + '</font>' ;
window.document.getElementById("Clock7").innerHTML = '<font color="' + ct[7].cl + '">' + ct[7].tz + ClockString(ct[7].ct) + '</font>' ;
timerID = window.setTimeout("UpdateClocks()", 1001) ;
}
function ClockString(dt)
{
var stemp, ampm ;
var dt_year = dt.getUTCFullYear() ;
var dt_month = dt.getUTCMonth() + 1 ;
var dt_day = dt.getUTCDate() ;
var dt_hour = dt.getUTCHours() ;
var dt_minute = dt.getUTCMinutes() ;
var dt_second = dt.getUTCSeconds() ;
dt_year = dt_year.toString() ;
if (0 <= dt_hour && dt_hour < 12)
{
ampm = 'AM' ;
// if (dt_hour == 0) dt_hour = 12 ;
} else {
ampm = 'PM' ;
// dt_hour = dt_hour - 12 ;
// if (dt_hour == 0) dt_hour = 12 ;
}
if (dt_hour < 10)
dt_hour = '0' + dt_hour ;
if (dt_minute < 10)
dt_minute = '0' + dt_minute ;
if (dt_second < 10)
dt_second = '0' + dt_second ;
//stemp = dt_month + '/' + dt_day + '/' + dt_year.substr(2,2) ;
stemp = dt_year + '/' + dt_month + '/' + dt_day;
stemp = stemp + ' ' + dt_hour + ":" + dt_minute + ":" + dt_second + ' ' + ampm ;
return stemp ;
}
function goToURL( myUrl, arg1, arg2, arg3 ) {
window.location.href=myUrl+arg1+arg2+arg3;
}
function validateStreet(value, theField, formCxt)
{
if(value.length >= 10) {
formCxt.setError();
alert('invalid entry: '+formCxt.getFieldDescription(theField.name));
}
}
function validateName(value,theField, formCxt )
{
if(value.length > 5) {
formCxt.setError();
alert('invalid entry: '+formCxt.getFieldDescription(theField.name));
}
}
function validateEmail(email, theField, formCxt)
{
if ( ! isValidEmail(email) ){
formCxt.setError();
alert('invalid entry: '+formCxt.getFieldDescription(theField.name));
}
}
function selectNVPair(nameObj, valueObj, nvplistObj)
{
nm = nameObj;
val = valueObj;
ix = nvplistObj.selectedIndex;
if(ix < 0 ) return;
nm.value = userNVPList.getName(ix);
val.value = userNVPList.getValue(ix);
val.focus();
}
//Name server add and delete functions
function addNS(nslistObj,nsObj)
{
appendOptionToSelectBox(nslistObj,nsObj);
}
function removeNS(nslistObj,nsObj)
{
removeOptionFromSelectBox(nslistObj,nsObj);
}
function selectNS(nslistObj,nsObj)
{
selectOption(nslistObj,nsObj);
}
function selectAll(list1, list2, list3)
{
if (list1)
selectList(list1);
if (list2)
selectList(list2);
if (list3)
selectList(list3);
}
@@ -0,0 +1,16 @@
<?
// Environment values
// rc id
$rc_id = '';
// service name
$service_name = '';
// pget title
$title_name = '';
// page link
$move_page_title = '';
$move_page_uri = '';
?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

@@ -0,0 +1,725 @@
<?
require_once( "./env_values.php" );
//$serviceType = //isset($_GET['service_type']) ? $_GET['service_type'] : $_POST['service_type'];
//if($serviceType == "") $serviceType = getSeviceType();
//serviceType : the order described in conf file. --_-;
?>
<html>
<head>
<title>######## <?= $title_name ?> SERVICE STATUS ######## </title>
<STYLE type=text/css>
TD { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,±¼¸²Ã¼'; TEXT-DECORATION: none; }
TR { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,±¼¸²Ã¼'; TEXT-DECORATION: none; }
TABLE { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,±¼¸²Ã¼'; TEXT-DECORATION: none; line-height : 120%}
INPUT { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,±¼¸²Ã¼'; TEXT-DECORATION: none; line-height : 120%}
}
</STYLE>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
<meta http-equiv="Pragma" content="no-cache"/>
<link rel="stylesheet" href="clockstyle.css" type="text/css">
<style type="text/css">
#tooltip {position:absolute;
top:5;
left:5;
border:solid 3 ffccff;
background:ffffcc;
color:660066;
font-size:9pt;
width:200;
height:20;
padding:2;
overflow:hidden;
z-index:10;
display:none;
}
</style>
<? require "layer.js";?>
<script language="javascript1.2" type="text/javascript" src="clock.js" ></script>
<script language="JavaScript">
<!--
function changeVisual()
{
fr = document.frm;
if(fr.chk.value == 0) {
fr.chk.value = 1;
info.style.display="block";
} else {
fr.chk.value = 0;
info.style.display="none";
}
}
//-->
</script>
</head>
<body onLoad="UpdateClocks()">
<form name="frm" action=<?=$_SERVER['PHP_SELF']?> method=POST>
<input type="hidden" name="service_type" value="<?= $serviceType ?>">
<table border="0" cellspacing="0" width="100%">
<tr bgcolor=#003366 class="ratNavText">
<td ID="Clock0" width="25%" > </td>
<td ID="Clock1" width="25%" > </td>
<td ID="Clock2" width="25%" > </td>
<td ID="Clock3" width="25%" > </td>
</tr>
<tr bgcolor=#003366 class="ratNavText">
<td ID="Clock4" width="25%" > </td>
<td ID="Clock5" width="25%" > </td>
<td ID="Clock6" width="25%" > </td>
<td ID="Clock7" width="25%" > </td>
</tr>
</table>
<br>
<table border="0" cellspacing="1" width="530" align="center">
<tr align="center">
<td> <h3>######## <?= $title_name ?> SERVICE STATUS ########</h3></td>
</tr>
</table>
<marquee id="tooltip" name="tooltip"></marquee>
<?
$server_addr[0][0] = "127.0.0.1";
$server_addr[0][1] = "30001";
$server_addr[0][2] = "DREAMLINE-1";
$tot = count($server_addr);
for($i=0; $i < $tot; $i++){
if($i%3 == 0) echo "<table align=\"center\"><tr>";
$fp = @fsockopen("udp://{$server_addr[$i][0]}", $server_addr[$i][1], $errno, $errstr);
if (!$fp) {
echo "ERROR: $errno - $errstr<br>\n";
continue;
} else {
fwrite($fp,"GET_SERVSTATUS", 15);
while(1) {
$test2 = fread($fp, 2048);
$test .= trim($test2);
$j = strlen($test2);
if($j < 1024) break;
}
fclose($fp);
}
?>
<td valign=top>
<?
//echo "<!--".$test."-->";
//$test = str_replace("1|6|SORIBADA_DB01|222.122.153.2|5432|1151049193|-|-|-|-|\r\n1|6|SORIBADA_DB03|222.122.153.4|5432|1151049193|-|-|-|-|\r\n", "", $test);
$pt = new parsePipe();
$test = $pt->nullTrim($test);
//echo "<!--".$test."-->";
$tmpArr = $pt->textArr($test);
$serviceName = $pt->serviceName($test);
if($serviceType == "") $serviceType = getSeviceType($serviceName, $rc_id );
$result = $pt->parseIt($tmpArr[$serviceType]);
$tot_tr = $pt->countIt();
//print_r($serviceName);
//echo $serviceName[$serviceType][0];
if($serviceName[$serviceType][0] != $rc_id) exit;
?>
<table border=0 cellpadding=0 cellspacing=0 width="100%">
<tr>
<td align="right" width="*">
<b>
<a href="<?= $move_page_uri ?>">
[ <?= $move_page_title ?> ]
</a>
</b>
</tr>
</td>
</table>
<table border=1 cellpadding=1 cellspacing=0>
<tr height="60">
<td colspan="10">
<br/>
<center><b>
<font color="#000066" size="5">
<?= $service_name ?>(<?= $serviceName[$serviceType][0] ?>)<br><br>
</font>
</b>
</center>
</td>
</tr>
<tr align="center">
<td width="170" bgcolor="efefef"><center><b><font color="#000066">Name</font></b></center></td>
<!-- <td width="110"><center><b><font color="#000066">Server IP</font></b></center></td>
<td width="50" bgcolor="efefef"><center><b><font color="#000066">Server Port</font></b></center></td> -->
<td width="150" bgcolor="efefef"><center><b><font color="#000066">Last Status Changed At</font></b></center></td>
<td width="150" bgcolor="efefef"><center><b><font color="#000066">Last Disk Checked At</font></b></center></td>
<!-- <td width="170"><center><b><font color="#000066">Domain</font></b></center></td> -->
<td width="70" bgcolor="efefef"><center><b><font color="#000066">Total Disk</font></b></center></td>
<td width="70" bgcolor="efefef"><center><b><font color="#000066">Used</font></b></center></td>
<td width="70" bgcolor="efefef"><center><b><font color="#000066">Free</font></b></center></td>
<td width="*" bgcolor="efefef"><center><b><font color="#000066">Disk Busy(Lq)</font></b></center></td>
<td width="100" bgcolor="efefef"><center><b><font color="#000066">Traffic INB(Packets)</font></b></center></td>
<td width="100" bgcolor="efefef"><center><b><font color="#000066">Traffic OUTB(Packets)</font></b></center></td>
<td width="50" bgcolor="efefef"><center><b><font color="#000066">Conn EASTAB(TOT)</font></b></center></td>
</tr>
<?
$totalDisk = 0;
$freeDisk = 0;
$usedDisk = 0;
$totalTrafficINB = 0;
for($j=0; $j<$tot_tr; $j++){
$alt_str = "[$j]".
" [SERVER STATUS] : ".$pt->translateIt($result[$j][0], 2).
" [SERVER NAME] : ".$result[$j][2];
//" [SERVER IP] : ".$pt->translateIt($result[$j][3],3).
//" [SERVER PORT] : ".$pt->translateIt($result[$j][4],4);
$totalDisk += $result[$j][8];
$freeDisk += $result[$j][9];
$usedDisk += ($result[$j][8] - $result[$j][9]);
//print_r($result);
if(strstr($result[$j][2],"RCTS") || strstr($result[$j][2],"DB") || strstr($result[$j][2],"PGLB")
||strstr($result[$j][2],"RC") ||strstr($result[$j][2],"STAT") )
{
continue;
}
/* Packets INB */
if ($result[$j][16] != '-') {
$totalPacketsINB += $result[$j][16];
}
/* Traffic INB */
if ($result[$j][17] != '-') {
$totalTrafficINB += $result[$j][17];
}
/* Packets OUTB */
if ($result[$j][18] != '-') {
$totalPacketsOUTB += $result[$j][18];
}
/* Traffic OUTB */
if ($result[$j][19] != '-') {
$totalTrafficOUTB += $result[$j][19];
}
/* Connection Estblished */
if ($result[$j][14] != '-') {
$totalConnEstab += $result[$j][14];
}
/* Connection All */
if ($result[$j][15] != '-') {
$totalConnAll += $result[$j][15];
}
?>
<span onmouseover="showtip('<?=$alt_str?>');" onmouseout="hidetip();">
<tr>
<td><?=$pt->translateIt($result[$j][0],1)?>&nbsp;<?=$result[$j][2]?></td>
<!-- <td align="center"><?=$pt->translateIt($result[$j][3],3)?></td>
<td align="center"><?=$pt->translateIt($result[$j][4],4)?></td> -->
<td align="center"><?=date("Y-m-d H:i:s", $result[$j][5])?></td>
<td align="center">
<?
if ($result[$j][6] == "-" || $result[$j][6] == "") {
echo "-";
} else {
echo date("Y-m-d H:i:s", $result[$j][6]);
}
?></td>
<!-- <td align="center"><?=$pt->translateIt($result[$j][7],7)?></td> -->
<td align="center"><?=$pt->translateIt($result[$j][8],8)?></td>
<td align="center">
<?
if($result[$j][8] == "-" || $result[$j][8] == "") echo "-";
else if($result[$j][8] == "0") echo "disabled";
else echo $pt->translateIt($result[$j][8]-$result[$j][9], 8);
?>
</td>
<td align="center" bgcolor="<?=$pt->translateIt($result[$j][20],100)?>">
<?=$pt->translateIt(trim($result[$j][9]), 8)?>
</td>
<td align="center">
<?
if ($result[$j][12] == '-') {
echo "-";
} else if ($result[$j][10] == 0 &&
$result[$j][11] == 0 &&
$result[$j][12] == 0 &&
$result[$j][13] == 0 &&
$result[$j][14] == 0 &&
$result[$j][15] == 0 &&
$result[$j][16] == 0 &&
$result[$j][17] == 0 &&
$result[$j][18] == 0 &&
$result[$j][19] == 0) {
echo "-";
} else {
if ($result[$j][12] >= 20) {
echo "<font color=\"red\"><b>";
} else if ($result[$j][12] >= 10) {
echo "<font color=\"blue\"><b>";
} else {
echo "<font color=\"black\">";
}
echo $result[$j][13]."%(".$result[$j][12].")";
echo "</font>";
}
?>
</td>
<td align="center" bgcolor="<?=$bgcolor?>">
<? //Traffic INB
if ($result[$j][17] == '-') {
echo "-";
} else if ($result[$j][10] == 0 &&
$result[$j][11] == 0 &&
$result[$j][12] == 0 &&
$result[$j][13] == 0 &&
$result[$j][14] == 0 &&
$result[$j][15] == 0 &&
$result[$j][16] == 0 &&
$result[$j][17] == 0 &&
$result[$j][18] == 0 &&
$result[$j][19] == 0) {
echo "-";
} else {
echo $pt->translateIt($result[$j][17],3)."(".$result[$j][16].")";
}
?>
</td>
<td align="center" bgcolor="<?=$bgcolor?>">
<? // Traffic OUTB
if ($result[$j][19] == '-') {
echo "-";
} else if ($result[$j][10] == 0 &&
$result[$j][11] == 0 &&
$result[$j][12] == 0 &&
$result[$j][13] == 0 &&
$result[$j][14] == 0 &&
$result[$j][15] == 0 &&
$result[$j][16] == 0 &&
$result[$j][17] == 0 &&
$result[$j][18] == 0 &&
$result[$j][19] == 0) {
echo "-";
} else {
echo $pt->translateIt($result[$j][19],3)."(".$result[$j][18].")";
}
?>
</td>
<td align="center" bgcolor="<?=$bgcolor?>">
<?
if ($result[$j][14] == '-') {
echo "-";
} else if ($result[$j][10] == 0 &&
$result[$j][11] == 0 &&
$result[$j][12] == 0 &&
$result[$j][13] == 0 &&
$result[$j][14] == 0 &&
$result[$j][15] == 0 &&
$result[$j][16] == 0 &&
$result[$j][17] == 0 &&
$result[$j][18] == 0 &&
$result[$j][19] == 0) {
echo "-";
} else {
if ($result[$j][14] >= 100) {
echo "<font color=\"red\"><b>";
} else if ($result[$j][14] >= 50) {
echo "<font color=\"blue\"><b>";
} else {
echo "<font color=\"black\">";
}
echo $result[$j][14]."(".$result[$j][15].")</font>";
}
?>
</td>
</tr>
</span>
<?
}
?>
<tr>
<td align="center" colspan="3"><b>Storage Total</b></td>
<td align="center"><?= ($totalDisk == "") ? "-" : $pt->translateIt($totalDisk, 9)?></td>
<td align="center"><?= ($totalDisk == "") ? "-" : $pt->translateIt($usedDisk, 9)?></td>
<td align="center"><?= ($totalDisk == "") ? "-" : $pt->translateIt($freeDisk, 9)?></td>
<td align="center" bgcolor="FFFFFF"><b>Network Total</b></td>
<td align="center" colspan="1" bgcolor="FFFFFF">
<? if ($totalTrafficINB > 0) { ?>
<?=$pt->translateIt($totalTrafficINB,30)?>B(<?=$pt->translateIt($totalPacketsINB,30)?>p)
<? } else { ?>
-
<? } ?>
</td>
<td align="center" colspan="1" bgcolor="FFFFFF">
<? if ($totalTrafficOUTB > 0) { ?>
<?=$pt->translateIt($totalTrafficOUTB,30)?>B(<?=$pt->translateIt($totalPacketsOUTB,30)?>p)
<? } else { ?>
-
<? } ?>
</td>
<td align="center" colspan="1" bgcolor="FFFFFF">
<? if ($totalConnEstab > 0) { ?>
<?=$totalConnEstab?>(<?=$totalConnAll?>)
<? } else { ?>
-
<? } ?>
</td>
</tr>
</table></td>
<?
if($i%3 == 2) echo "</table></tr>"; //
}
?>
<table>
</table>
<?
////////////////////
//Print REFRESHER
////////////////////
extract($_POST);
if($refresh_rate<1 || $refresh_rate>1000)
$refresh_rate = 60;
?>
<br>
<table align="center">
<tr>
<td>
Refresh Rate :
<input type=text name=refresh_rate value=<?=$refresh_rate?>>
<input type=submit value=SET>
(MIN : 1, MAX : 1000)
<input type="hidden" name="chk" value="0">
</form>
</td>
</tr><tr>
<td align=right>
<form action=<?=$_SERVER['PHP_SELF']?> method=POST>
<input type="hidden" name="service_type" value="<?= $serviceType?>">
<input type=hidden name=refresh_rate value=30>
<input type=submit value=RESET(30)>
</form>
</td>
</tr>
</table>
<script language="javascript" type="text/javascript" src="tooltip.js" ></script>
<script language=javascript>
function showtip(text) {
tooltip.innerText=text;
tooltip.style.display="inline";
}
function hidetip() {
tooltip.style.display="none";
}
function movetip() {
tooltip.style.pixelTop=event.y+document.body.scrollTop;
tooltip.style.pixelLeft=event.x+document.body.scrollLeft+10;
}
document.onmousemove=movetip;
</script>
</body>
</html>
<META http-equiv="refresh" content="<?=$refresh_rate?>; url=<?=$_SERVER['PHP_SELF']?>?refresh_rate=<?=$refresh_rate?>&service_type=<?= $serviceType ?>">
<?
########
#CLASSES
########
class parsePipe {
var $tot_line;
function parseIt($givenText){
$cnt = 0;
$minValue = 0;
$maxValue = 0;
$minLevel = 1000;
$tmp_arr = array();
$temp_arr = explode("\r\n", $givenText);
$result_arr[$i][9] = "";
$this->tot_line = count($temp_arr) == 1 ? 0 : count($temp_arr) - 1;
for($i=0; $i < $this->tot_line; $i++){
if($temp_arr[$i]!='') {
$result_arr[$i] = explode("|", $temp_arr[$i]);
$result_arr[$i][20] = "";
$tmp_arr[$i] = ($result_arr[$i][9] == '' || $result_arr[$i][9] == '-') ? 0 : $this->nullTrim($result_arr[$i][9]);
$result_arr[$i][8] = $this->nullTrim($result_arr[$i][8]);
$result_arr[$i][9] = $this->nullTrim($result_arr[$i][9]);
$result_arr[$i][10] = $this->nullTrim($result_arr[$i][10]);
/*
if($result_arr[$i][9] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0) {
if($cnt == 0) {
$minValue = $result_arr[$i][9];
$cnt++;
}
if($minValue > $result_arr[$i][9]) {
$minValue = $result_arr[$i][9];
}
}
*/
if ($result_arr[$i][11] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0) {
if ($minLevel > $result_arr[$i][11]) {
$minLevel = $result_arr[$i][11];
}
}
}
}
for ($i = 0; $i < $tot_tr; $i++) {
if ($result_arr[$i][11] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0 && $result_arr[$i][11] <= $minLevel) {
if($result_arr[$i][9] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0) {
if($cnt == 0) {
$minValue = $result_arr[$i][9];
$cnt++;
}
if($minValue > $result_arr[$i][9]) {
$minValue = $result_arr[$i][9];
}
}
}
}
//echo "minLevel $minLevel minValue $minValue<br>";
$cnt = 0;
arsort($tmp_arr);
reset($tmp_arr);
while (list ($key, $val) = each ($tmp_arr)) {
//echo "$key = $val<br>";
if($val != 0) {
if($cnt == 0) {
if ($minLevel < $result_arr[$key][11] ||
$result_arr[$key][10] > 0) {
$result_arr[$key][20] = "yellow";//$maxValue;
} else {
//echo "11 ".$result_arr[$key][11]." 10 ".$result_arr[$key][10]."<br>";
$maxValue = $val;
$result_arr[$key][20] = "99FFFF";
$cnt++;
}
} else {
//if($minValue == $val) {
if($val < (2 * 1024 * 1024 * 1024 * 10)) {
$result_arr[$key][20] = "#FAC1C1";
} else if(($maxValue - $val) < (1024 * 1024 * 1024) &&
$minLevel == $result_arr[$key][11]) {
//echo "1GB Highed<br>";
//echo "minLevel $minLevel maxValue $maxValue<br>";
$result_arr[$key][20] = "99FFFF";
} else {
//echo "1GB Lowed<br>";
$result_arr[$key][20] = "yellow";//$maxValue;
}
}
} else {
$result_arr[$key][20] = "white";
}
}
return $result_arr;
}
function countIt(){
return $this->tot_line;
}
function translateIt($parsedText, $type){
if($parsedText == '') return;
$eServerType = array('RC', 'STAT', 'RTS', 'RCTS', 'RCDB', 'WWW', 'CCDB');
/*$eStatus = array('<img src=images/bu16_1.gif width=11 height=11>UNKNOWN',
'<img src=images/bu14.gif width=11 height=11>ALIVE',
'<img src=images/bu15.gif width=11 height=11>DEAD');*/
$eStatus = array('<img src=images/bu16_1.gif width=11 height=11>',
'<img src=images/bu14.gif width=11 height=11>',
'<img src=images/bu15.gif width=11 height=11>',
'<img src=images/bu77.gif width=11 height=11 border=0>');
$eStatusUP = array('<img src=images/bu14.gif width=11 height=11>',
'<img src=images/bu16_1.gif width=11 height=11>',
'<img src=images/bu15.gif width=11 height=11>');
$eStatusChar = array('UNKNOWN', 'ALIVE', 'DEAD', 'NO MONITORING');
switch($type){
case 0:
return $eServerType[$parsedText];
return '';
case 1:
return $eStatus[$parsedText];
case 2:
return $eStatusChar[$parsedText];
case 3:
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
else {
if (trim($parsedText) / 1024 / 1024 > 1024) {
return sprintf("<b>%.2fGB</b>",
trim($parsedText) / 1024 / 1024 / 1024 );
} else {
if (trim($parsedText) / 1024 > 1024) {
if (trim($parsedText) / 1024 / 1024 > 10) {
return sprintf("<font color=\"blue\"><b>%.2fMB</b></font>",
trim($parsedText) / 1024 / 1024 );
} else {
return sprintf("<b>%.2fMB</b>",
trim($parsedText) / 1024 / 1024 );
}
} else {
if (trim($parsedText) > 1024) {
return sprintf("%.2fKB",
trim($parsedText) / 1024 );
} else {
return sprintf("%dB",
trim($parsedText));
}
}
}
}
case 8:
if(trim($parsedText) == "-" || $parsedText == "") return "-";
else return sprintf("%.2lfG", (trim($parsedText) / 1024) / 1024 / 1024);
case 9:
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
else {
if (trim($parsedText) / 1024 / 1024 / 1024 > 1024) {
return sprintf("%.2fT", trim($parsedText) / 1024 / 1024 / 1024 / 1024);
} else
return sprintf("%.2fG", trim($parsedText) / 1024 / 1024 / 1024);
}
case 10:
return $eStatusUP[$parsedText];
case 30:
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
else {
if (trim($parsedText) / 1024 / 1024 > 1024) {
return sprintf("%.2fG",
trim($parsedText) / 1024 / 1024 / 1024 );
} else {
if (trim($parsedText) / 1024 > 1024) {
return sprintf("%.2fM",
trim($parsedText) / 1024 / 1024 );
} else {
if (trim($parsedText) > 1024) {
return sprintf("%.2fK",
trim($parsedText) / 1024 );
} else {
return sprintf("%d",
trim($parsedText));
}
}
}
}
default:
return $parsedText;
}
}
function nullTrim($tmp_str)
{
$return_str = "";
$maxLength = strlen($tmp_str);
for($i=0 ; $i < $maxLength ; $i++) {
if(ord(substr($tmp_str, $i, 1)) != 0 || $tmp_str != " ") {
$return_str .= substr($tmp_str, $i, 1);
}
}
return $return_str;
}
function textArr($text)
{
$cnt = -1;
$tmp_cnt = 0;
$str_arr = array();
$tmp_search_str = "";
$temp_arr = explode("\r\n", $text);
for($i=0; $i<sizeof($temp_arr); $i++) {
$split_str = explode("|", $temp_arr[$i]);
$search_str = explode("_", $split_str[2]);
// added by roolu 090224 : reason AION is ICS20
if (substr_count($split_str[2], "AION") >= 1)
continue;
if($tmp_search_str != $search_str[0]) {
$tmp_search_str = $search_str[0];
//$str_arr[$cnt][30] = $search_str[0];
//echo $str_arr[$cnt][0]."<br>".$tmp_search_str."->".$cnt."<-"."<br>";
$cnt++;
}
$str_arr[$cnt] .= $temp_arr[$i]."\r\n";
}
return $str_arr;
}
function serviceName($text)
{
$cnt = -1;
$tmp_cnt = 0;
$str_arr = array();
$tmp_search_str = "";
$temp_arr = explode("\r\n", $text);
for($i=0; $i<sizeof($temp_arr); $i++) {
$split_str = explode("|", $temp_arr[$i]);
$search_str = explode("_", $split_str[2]);
// added by roolu 090224 : reason AION is ICS20
if (substr_count($split_str[2], "AION") >= 1)
continue;
if(($tmp_search_str != $search_str[0])) {
$tmp_search_str = $search_str[0];
$cnt++;
}
$str_arr[$cnt][0] = $tmp_search_str;
if(($tmp_search_str == $search_str[0]) && $split_str[7] != "-") {
$a = explode(".", $split_str[7]);
if(!strncmp($a[3], "kr", 2)) {
$b = $a[1].".".$a[2]."."."kr";
} else if(!strncmp($a[2], "com", 3)) {
$b = $a[1]."."."com";
}
$str_arr[$cnt][2] = $b;
}
if($split_str[0] == 2) {
$str_arr[$cnt][1] = "dead";
}
// $str_arr[4][1] = "dead";
// $str_arr[1][1] = "dead";
}
return $str_arr;
}
function tailer($name)
{
$temp_arr = explode("_", $name);
$temp_arr2 = substr($name, strlen($temp_arr[0]) + 1, strlen($name));
return $temp_arr2;
}
function noYear($date)
{
$date = substr($date, 5, 14);
return $date;
}
}
function getSeviceType (&$service_data, &$rc_id){
$ret = -1;
for($t = 0; $t < count($service_data); $t++)
{
if($service_data[$t][0] == $rc_id)
{
$ret = $t;
break;
}
}
return $ret;
}
?>
@@ -0,0 +1,133 @@
<script language="JavaScript">
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_dragLayer(objName,x,hL,hT,hW,hH,toFront,dropBack,cU,cD,cL,cR,targL,targT,tol,dropJS,et,dragJS) { //v4.01
//Copyright 1998 Macromedia, Inc. All rights reserved.
var i,j,aLayer,retVal,curDrag=null,curLeft,curTop,IE=document.all,NS4=document.layers;
var NS6=(!IE&&document.getElementById), NS=(NS4||NS6); if (!IE && !NS) return false;
retVal = true; if(IE && event) event.returnValue = true;
if (MM_dragLayer.arguments.length > 1) {
curDrag = MM_findObj(objName); if (!curDrag) return false;
if (!document.allLayers) { document.allLayers = new Array();
with (document) if (NS4) { for (i=0; i<layers.length; i++) allLayers[i]=layers[i];
for (i=0; i<allLayers.length; i++) if (allLayers[i].document && allLayers[i].document.layers)
with (allLayers[i].document) for (j=0; j<layers.length; j++) allLayers[allLayers.length]=layers[j];
} else {
if (NS6) { var spns = getElementsByTagName("span"); var all = getElementsByTagName("div");
for (i=0;i<spns.length;i++) if (spns[i].style&&spns[i].style.position) allLayers[allLayers.length]=spns[i];}
for (i=0;i<all.length;i++) if (all[i].style&&all[i].style.position) allLayers[allLayers.length]=all[i];
} }
curDrag.MM_dragOk=true; curDrag.MM_targL=targL; curDrag.MM_targT=targT;
curDrag.MM_tol=Math.pow(tol,2); curDrag.MM_hLeft=hL; curDrag.MM_hTop=hT;
curDrag.MM_hWidth=hW; curDrag.MM_hHeight=hH; curDrag.MM_toFront=toFront;
curDrag.MM_dropBack=dropBack; curDrag.MM_dropJS=dropJS;
curDrag.MM_everyTime=et; curDrag.MM_dragJS=dragJS;
curDrag.MM_oldZ = (NS4)?curDrag.zIndex:curDrag.style.zIndex;
curLeft= (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft;
if (String(curLeft)=="NaN") curLeft=0; curDrag.MM_startL = curLeft;
curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop;
if (String(curTop)=="NaN") curTop=0; curDrag.MM_startT = curTop;
curDrag.MM_bL=(cL<0)?null:curLeft-cL; curDrag.MM_bT=(cU<0)?null:curTop-cU;
curDrag.MM_bR=(cR<0)?null:curLeft+cR; curDrag.MM_bB=(cD<0)?null:curTop+cD;
curDrag.MM_LEFTRIGHT=0; curDrag.MM_UPDOWN=0; curDrag.MM_SNAPPED=false; //use in your JS!
document.onmousedown = MM_dragLayer; document.onmouseup = MM_dragLayer;
if (NS) document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
} else {
var theEvent = ((NS)?objName.type:event.type);
if (theEvent == 'mousedown') {
var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
var maxDragZ=null; document.MM_maxZ = 0;
for (i=0; i<document.allLayers.length; i++) { aLayer = document.allLayers[i];
var aLayerZ = (NS4)?aLayer.zIndex:parseInt(aLayer.style.zIndex);
if (aLayerZ > document.MM_maxZ) document.MM_maxZ = aLayerZ;
var isVisible = (((NS4)?aLayer.visibility:aLayer.style.visibility).indexOf('hid') == -1);
if (aLayer.MM_dragOk != null && isVisible) with (aLayer) {
var parentL=0; var parentT=0;
if (NS6) { parentLayer = aLayer.parentNode;
while (parentLayer != null && parentLayer.style.position) {
parentL += parseInt(parentLayer.offsetLeft); parentT += parseInt(parentLayer.offsetTop);
parentLayer = parentLayer.parentNode;
} } else if (IE) { parentLayer = aLayer.parentElement;
while (parentLayer != null && parentLayer.style.position) {
parentL += parentLayer.offsetLeft; parentT += parentLayer.offsetTop;
parentLayer = parentLayer.parentElement; } }
var tmpX=mouseX-(((NS4)?pageX:((NS6)?parseInt(style.left):style.pixelLeft)+parentL)+MM_hLeft);
var tmpY=mouseY-(((NS4)?pageY:((NS6)?parseInt(style.top):style.pixelTop) +parentT)+MM_hTop);
if (String(tmpX)=="NaN") tmpX=0; if (String(tmpY)=="NaN") tmpY=0;
var tmpW = MM_hWidth; if (tmpW <= 0) tmpW += ((NS4)?clip.width :offsetWidth);
var tmpH = MM_hHeight; if (tmpH <= 0) tmpH += ((NS4)?clip.height:offsetHeight);
if ((0 <= tmpX && tmpX < tmpW && 0 <= tmpY && tmpY < tmpH) && (maxDragZ == null
|| maxDragZ <= aLayerZ)) { curDrag = aLayer; maxDragZ = aLayerZ; } } }
if (curDrag) {
document.onmousemove = MM_dragLayer; if (NS4) document.captureEvents(Event.MOUSEMOVE);
curLeft = (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft;
curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop;
if (String(curLeft)=="NaN") curLeft=0; if (String(curTop)=="NaN") curTop=0;
MM_oldX = mouseX - curLeft; MM_oldY = mouseY - curTop;
document.MM_curDrag = curDrag; curDrag.MM_SNAPPED=false;
if(curDrag.MM_toFront) {
eval('curDrag.'+((NS4)?'':'style.')+'zIndex=document.MM_maxZ+1');
if (!curDrag.MM_dropBack) document.MM_maxZ++; }
retVal = false; if(!NS4&&!NS6) event.returnValue = false;
} } else if (theEvent == 'mousemove') {
if (document.MM_curDrag) with (document.MM_curDrag) {
var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
newLeft = mouseX-MM_oldX; newTop = mouseY-MM_oldY;
if (MM_bL!=null) newLeft = Math.max(newLeft,MM_bL);
if (MM_bR!=null) newLeft = Math.min(newLeft,MM_bR);
if (MM_bT!=null) newTop = Math.max(newTop ,MM_bT);
if (MM_bB!=null) newTop = Math.min(newTop ,MM_bB);
MM_LEFTRIGHT = newLeft-MM_startL; MM_UPDOWN = newTop-MM_startT;
if (NS4) {left = newLeft; top = newTop;}
else if (NS6){style.left = newLeft; style.top = newTop;}
else {style.pixelLeft = newLeft; style.pixelTop = newTop;}
if (MM_dragJS) eval(MM_dragJS);
retVal = false; if(!NS) event.returnValue = false;
} } else if (theEvent == 'mouseup') {
document.onmousemove = null;
if (NS) document.releaseEvents(Event.MOUSEMOVE);
if (NS) document.captureEvents(Event.MOUSEDOWN); //for mac NS
if (document.MM_curDrag) with (document.MM_curDrag) {
if (typeof MM_targL =='number' && typeof MM_targT == 'number' &&
(Math.pow(MM_targL-((NS4)?left:(NS6)?parseInt(style.left):style.pixelLeft),2)+
Math.pow(MM_targT-((NS4)?top:(NS6)?parseInt(style.top):style.pixelTop),2))<=MM_tol) {
if (NS4) {left = MM_targL; top = MM_targT;}
else if (NS6) {style.left = MM_targL; style.top = MM_targT;}
else {style.pixelLeft = MM_targL; style.pixelTop = MM_targT;}
MM_SNAPPED = true; MM_LEFTRIGHT = MM_startL-MM_targL; MM_UPDOWN = MM_startT-MM_targT; }
if (MM_everyTime || MM_SNAPPED) eval(MM_dropJS);
if(MM_dropBack) {if (NS4) zIndex = MM_oldZ; else style.zIndex = MM_oldZ;}
retVal = false; if(!NS) event.returnValue = false; }
document.MM_curDrag = null;
}
if (NS) document.routeEvent(objName);
} return retVal;
}
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
@@ -0,0 +1 @@
../src/clock.js
@@ -0,0 +1,7 @@
<?
$rc_id = 'YD-01';
$service_name = 'Yonhapnews YD';
$title_name = 'KT-ICS';
$move_page_title = 'Yonhapnews BD';
$move_page_uri = '../bd/';
?>
@@ -0,0 +1 @@
../src/images
@@ -0,0 +1 @@
../src/index.html
@@ -0,0 +1 @@
../src/layer.js