Changeset 1290


Ignore:
Timestamp:
01/13/07 15:56:11 (6 years ago)
Author:
ckb6
Message:

Fixed a bug that r1285 created that prevented Links and Targets from being displayed properly. Added Force redraw as a feature. Added option of ALL to the hosts list.

Location:
ccsweb/trunk/ccs_mods/graphs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ccsweb/trunk/ccs_mods/graphs/graphs.php

    r1285 r1290  
    5252     
    5353    //Create arrays for host list 
    54     $ids = array(); 
    55     $names = array(); 
    56     $c = 0; 
    57     foreach ($hosts as $idx=>$host) { 
    58         $ids[$c] = $host["host_id"]; 
    59         $names[$c] = $host["host_name"]; 
    60         $c++; 
    61     } 
     54    //$ids = array(); 
     55    //$names = array(); 
     56    //$c = 0; 
     57    //foreach ($hosts as $idx=>$host) { 
     58    //    $ids[$c] = $host["host_id"]; 
     59    //    $names[$c] = $host["host_name"]; 
     60     //   $c++; 
     61    //} 
    6262 
    6363    //Create arrays for link list 
     
    8484    $smarty->assign("groups", $groups); 
    8585    $smarty->assign("target_ids", $tids); 
    86     $smarty->assign("host_ids", $ids); 
     86    //$smarty->assign("host_ids", $ids); 
     87    $smarty->assign("hosts", $hosts); 
    8788    $smarty->assign("link_ids", $lids); 
    8889    $smarty->assign("target_names", $tnames); 
    89     $smarty->assign("host_names", $names); 
     90    //$smarty->assign("host_names", $names); 
    9091    $smarty->assign("link_names", $lnames); 
    9192    $smarty->assign("scripts", array("graphs.js")); 
     
    153154        $vgraphs = $e[1]; 
    154155    }else if ($_REQUEST["main"] == "target"){ 
     156        $e = do_xmlrpc("getGraphserver", array(), $xmlrpc_conn, TRUE, FALSE); 
     157        if (xmlrpc_has_error($e)) { 
     158            ccs_notice("Could not retrieve graghserver: " . 
     159                xmlrpc_error_string($e)); 
     160            $e = array(); 
     161        } 
     162        $server = $e; 
    155163        if ($_REQUEST["target_id"] != ''){ 
    156164            list($host_name, $graph_id, $num, $ip_address,$description) = split("-",$_REQUEST["target_id"],5); 
     
    165173    $smarty->assign("server",  $server); 
    166174    $smarty->assign("mirror",  $_REQUEST["mirror"]); 
     175    $smarty->assign("force",  $_REQUEST["force"]); 
    167176    $smarty->assign("main",  $_REQUEST["main"]); 
    168177    $smarty->assign("host_id", $_REQUEST["host_id"]); 
  • ccsweb/trunk/ccs_mods/graphs/index.tpl

    r1285 r1290  
    2828  <table> 
    2929    <tr><td class="bodyText"><input type="radio" name="main" value="host" id="host" onClick="toggle();" {if $main=="host" || $main==""}checked{/if} /> Host:</td><td>  
    30       {if $main=="host" || $main==""} 
    31       {html_options values=$host_ids output=$host_names selected=$host_id name="host_id" id="host_id"} 
    32       {else} 
    33       {html_options values=$host_ids output=$host_names selected=$host_id name="host_id" id="host_id" disabled=true} 
    34       {/if} 
     30      <select id="host_id" name="host_id"{if !($main=="host" || $main=="")} DISABLED {/if} /> 
     31      <option value=-1>--ALL--</option> 
     32      {foreach from=$hosts item=host} 
     33      <option value="{$host.host_id}" {if $host.host_id == $host_id}selected="selected"{/if}>{$host.host_name}</option> 
     34      {/foreach} 
     35     
    3536</td> 
    3637    <tr><td class="bodyText"><input type="radio" name="main" value="link" id="link" onClick="toggle();" {if $main=="link"}checked{/if}/> Link:</td><td> 
     
    5960</td></tr> 
    6061    <tr><td class="bodyText">Mirror:</td><td><input type="checkbox" name="mirror" id="mirror" {if $mirror=="on"}checked{/if} {if $main!="host" && $main!=''}disabled{/if}/></td></tr> 
     62    <tr><td class="bodyText">Force Redraw:</td><td><input type="checkbox" name="force" id="force" {if $force=="on"}checked{/if} /></td></tr> 
    6163</table> 
    6264<input type="submit" value="Refresh" class="inputbox"/> 
     
    7274        </select> 
    7375        Graph of {$graph.host_name} - {if $graph.description != ''}{$graph.description}-{$graph.ip_address}{else}{$graph.ip_address}{/if}<br /> 
    74         <img id="img{$i++}" src="http://{$server}/graphs/{$graph.host_name}/{$time_id}/{$graph.graph_id}?number={$graph.num}&force=1"><br /> 
     76        <img id="img{$i++}" src="http://{$server}/graphs/{$graph.host_name}/{$time_id}/{$graph.graph_id}?number={$graph.num}{if $force=="on"}&force=1{/if}"><br /> 
    7577    </td><td> 
    7678        {if $graph.num2 != ''} 
    7779            Graph of {$graph.host_name2} - {if $graph.description != ''}{$graph.description}-{$graph.ip_address2}{else}{$graph.ip_address2}{/if}<br /> 
    78             <img src="http://{$server}/graphs/{$graph.host_name2}/{$time_id}/{$graph.graph_id}?number={$graph.num2}&force=1"><br /> 
     80            <img src="http://{$server}/graphs/{$graph.host_name2}/{$time_id}/{$graph.graph_id}?number={$graph.num2}{if $force=="on"}&force=1{/if}"><br /> 
    7981        {/if} 
    8082    </td></tr> 
     
    8284</table> 
    8385{include file="footer.tpl"} 
     86{debug} 
Note: See TracChangeset for help on using the changeset viewer.