From 3265938a7cd0ef277bfc550ff47b60ed71b417de Mon Sep 17 00:00:00 2001 From: osmiy Date: Tue, 5 Dec 2006 12:15:43 +0000 Subject: - improved editing of graphs (Eugene) - developed 'Color picker' (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@3567 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/graph.php | 242 ------------------------------------------------ 1 file changed, 242 deletions(-) delete mode 100644 frontends/php/graph.php (limited to 'frontends/php/graph.php') diff --git a/frontends/php/graph.php b/frontends/php/graph.php deleted file mode 100644 index dff97582..00000000 --- a/frontends/php/graph.php +++ /dev/null @@ -1,242 +0,0 @@ - - - array(T_ZBX_INT, O_MAND, P_SYS, DB_ID,NULL), - - "gitemid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), - "itemid"=> array(T_ZBX_INT, O_OPT, NULL, NULL, 'isset({save})'), - "color"=> array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({save})'), - "drawtype"=> array(T_ZBX_INT, O_OPT, NULL, IN("0,1,2,3"), 'isset({save})'), - "sortorder"=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0,65535), 'isset({save})'), - "yaxisside"=> array(T_ZBX_INT, O_OPT, NULL, IN("0,1"), 'isset({save})'), - "calc_fnc"=> array(T_ZBX_INT, O_OPT, NULL, IN("1,2,4,7"), 'isset({save})'), - "type"=> array(T_ZBX_INT, O_OPT, NULL, IN("0,1"), 'isset({save})'), - "periods_cnt"=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0,360), 'isset({save})'), - - "register"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL), - "save"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL), - "delete"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL), - "cancel"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), - "form"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), - "form_refresh"=> array(T_ZBX_INT, O_OPT, NULL, NULL, NULL) - ); - - check_fields($fields); -?> - - -AddRow(new CImg("chart2.php?graphid=".$_REQUEST["graphid"]."&period=3600&from=0")); - $table->Show(); - - if(isset($_REQUEST["form"])) - { -/****** FORM ******/ - echo BR; - insert_graphitem_form(); - } - else - { -/****** TABLE ******/ - $form = new CForm(); - $form->AddVar("graphid",$_REQUEST["graphid"]); - $form->AddItem(new CButton("form",S_ADD_ITEM)); - show_table_header(S_DISPLAYED_PARAMETERS_BIG,$form); - - $table = new CTableInfo("..."); - $table->SetHeader(array(S_SORT_ORDER,S_HOST,S_PARAMETER,S_FUNCTION,S_TYPE,S_DRAW_STYLE,S_COLOR,S_ACTIONS)); - - $result=DBselect("select i.itemid,h.host,i.description,gi.*,i.key_ ". - " from hosts h,graphs_items gi,items i where i.itemid=gi.itemid ". - " and gi.graphid=".$_REQUEST["graphid"]." and h.hostid=i.hostid ". - " order by gi.sortorder desc, i.description, i.itemid"); - while($row=DBfetch($result)) - { - - if($row["type"] == GRAPH_ITEM_AGGREGATED) - { - $type = S_AGGREGATED." (".$row["periods_cnt"].")"; - - $drawtype = "-"; - $fnc_name = "-"; - $color = "-"; - } - else - { - $type = S_SIMPLE; - - $drawtype = get_drawtype_description($row["drawtype"]); - $color = $row["color"]; - - switch($row["calc_fnc"]) - { - case CALC_FNC_ALL: $fnc_name = S_ALL_SMALL; break; - case CALC_FNC_MIN: $fnc_name = S_MIN_SMALL; break; - case CALC_FNC_MAX: $fnc_name = S_MAX_SMALL; break; - case CALC_FNC_AVG: - default: - $fnc_name = S_AVG_SMALL; break; - } - } - $table->AddRow(array( - $row["sortorder"], - $row["host"], - NEW CLink(item_description($row["description"],$row["key_"]), - 'chart.php?itemid='.$row["itemid"].'&period=3600&from=0', - 'action'), - $fnc_name, - $type, - $drawtype, - $color, - array( - new CLink(S_CHANGE,"graph.php?graphid=".$_REQUEST["graphid"]. - "&gitemid=".$row["gitemid"]."&form=update#form","action"), - SPACE."-".SPACE, - new CLink(S_UP,"graph.php?graphid=".$_REQUEST["graphid"]. - "&gitemid=".$row["gitemid"]."®ister=up","action"), - SPACE."-".SPACE, - new CLink(S_DOWN,"graph.php?graphid=".$_REQUEST["graphid"]. - "&gitemid=".$row["gitemid"]."®ister=down","action") - ) - )); - } - $table->Show(); - } -?> - -- cgit