diff --git a/inc/charts.php b/inc/charts.php index 618d122..ba799f5 100644 --- a/inc/charts.php +++ b/inc/charts.php @@ -1,9 +1,9 @@ width); $iHeight=round($this->height); - $sApp = ($this->app ? $this->app->name : cADApp::NO_APP); + $sApp = ($this->app ? $this->app->id : cADApp::NO_APP); ?>
"; $end_tag = " | "; } - + $iWidth = null; if ( isset( $aItem[self::WIDTH])) { $iWidth = $aItem[self::WIDTH]; @@ -237,8 +258,8 @@ public static function metrics_table($poApp, $paItems, $piMaxCols, $psRowClass, } } if ($iCol !== 0) echo "
---|
"; oElement.append(sHTML); - - + + //- - - - -convert chart to Widgets if (cCharts.isGoogleChartsLoaded()) - convert_charts_to_widgets(poApp) + oThis.convert_charts_to_widgets(poApp) else cCharts.load_google_charts(function(){oThis.convert_charts_to_widgets(poApp);}); - + //- - - render the menus - $("#"+poApp.id+"menu").admenu(); + $("#"+poApp.id+"menu").admenu(); }); }, - + //******************************************************************* convert_charts_to_widgets: function(poApp){ var oElement = this.element; @@ -151,33 +175,15 @@ $.widget( "ck.adallapps",{ oParams[ cRenderQS.APP_QS ] = poApp.name; var sUrl = cBrowser.buildUrl(oElement.attr("baseurl"),oParams); var sHome = oElement.attr(cRenderQS.HOME_QS); - - $("#"+poApp.id+"1").adchart({ - home:sHome, - appName:poApp.name, - title:oElement.attr("title1"), metric:oElement.attr("metric1"), goUrl:sUrl, - width:cChartConsts.WIDTH_3ACROSS,height:cChartConsts.LETTERBOX_HEIGHT,showZoom:1,showCompare:1,previous_period:0 - }); - $("#"+poApp.id+"2").adchart({ - home:sHome, - appName:poApp.name, - title:oElement.attr("title2"), - metric:oElement.attr("metric2"), - width:cChartConsts.WIDTH_3ACROSS,height:cChartConsts.LETTERBOX_HEIGHT,showZoom:1,showCompare:1,previous_period:0 - }); - $("#"+poApp.id+"3").adchart({ - home:sHome, - appName:poApp.name, - title:oElement.attr("title3"), - metric:oElement.attr("metric3"), - width:cChartConsts.WIDTH_3ACROSS,height:cChartConsts.LETTERBOX_HEIGHT,showZoom:1,showCompare:1,previous_period:0 - }); + + for (var i=1; i<=3; i++) + $("#a"+poApp.id+"i"+i).adchart(); }, - + //******************************************************************* render_list: function(paData){ var oElement = this.element; - + var sHTML = cRenderMDL.card_start(); sHTML += cRenderMDL.body_start(); sHTML += "
"; diff --git a/js/widgets/menu.js b/js/widgets/menu.js index 39bc0d1..8c6e22e 100644 --- a/js/widgets/menu.js +++ b/js/widgets/menu.js @@ -261,9 +261,9 @@ $.widget( "ck.admenu",{ oSelect.append(oOption); var iCount = 1; while (true){ - sTier = oElement.attr("tname."+iCount); + var sTier = oElement.attr("tname."+iCount); if (!sTier) break; - sTid = oElement.attr("tid."+iCount); + var sTid = oElement.attr("tid."+iCount); var oParams = {}; oParams[cRenderQS.TIER_QS] = sTier; diff --git a/js/widgets/tierserviceendpoints.js b/js/widgets/tierserviceendpoints.js new file mode 100644 index 0000000..e621bf8 --- /dev/null +++ b/js/widgets/tierserviceendpoints.js @@ -0,0 +1,190 @@ +'use strict'; +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +$.widget( "ck.adserviceendpoints",{ + //################################################################# + //# Definition + //################################################################# + consts:{ + REST_API:"/rest/tierserviceendpoints.php" + }, + + //################################################################# + //# Constructor + //#################################################################` + _create: function(){ + var oThis = this; + + //set basic stuff + var oElement = this.element; + oElement.uniqueId(); + + //check for necessary classes + if (!cQueueifVisible) $.error("Queue on visible class is missing! check includes"); + + //check for required options + if (!oElement.attr(cRenderQS.TIER_QS)) $.error("tier Name missing!"); + if (!oElement.attr(cRenderQS.TIER_ID_QS)) $.error("tier ID missing!"); + if (!oElement.attr(cRenderQS.APP_ID_QS)) $.error("app ID missing!"); + if (!oElement.attr(cRenderQS.HOME_QS)) $.error("home missing!"); + if (!oElement.attr(cRenderQS.LIST_MODE_QS) && !oElement.adchart) + $.error("charts widget is missing! check includes"); + if (!bean) $.error("bean class is missing! check includes"); + + + //set behaviour for widget when it becomes visible + var oQueue = new cQueueifVisible(); + bean.on(oQueue, "status", function(psStatus){oThis.onStatus(psStatus);} ); + bean.on(oQueue, "start", function(){oThis.onStart();} ); + bean.on(oQueue, "result", function(poHttp){oThis.onResponse(poHttp);} ); + bean.on(oQueue, "error", function(poHttp){oThis.onError(poHttp);} ); + oQueue.go(oElement, this.get_url()); + }, + + + //******************************************************************* + onStatus: function(psMessage){ + var oElement = this.element; + oElement.empty(); + oElement.append("status: " +psMessage); + }, + + //******************************************************************* + onError: function(poHttp, psMessage){ + var oThis = this; + var oElement = this.element; + + oElement.empty(); + oElement.addClass("ui-state-error"); + oElement.append("There was an error getting data "); + }, + +//******************************************************************* + onStart: function(poItem){ + var oElement = this.element; + + oElement.empty(); + oElement.removeClass(); + + var oLoader = $("
Calls | Response Times | Errors per minute | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
" + poSP.name + " | "); + oTable.append(oRow); + + //----------------------------------------------------------------- + var oChartParams = {}; + oChartParams[cChartConsts.ATTR_TITLE + "0"] = poSP.name ; + oChartParams[cRenderQS.APP_ID_QS] = oElement.attr(cRenderQS.APP_ID_QS); + oChartParams["type"] = "spwidget"; + oChartParams["style"] = "position: relative; max-width: 341px; width: 341px; height: 125px;"; + oChartParams["class"] = "chart_widget"; + oChartParams[cRenderQS.HOME_QS] = oElement.attr(cRenderQS.HOME_QS) ; + oChartParams[cChartConsts.ATTR_SHOW_ZOOM] =1; + oChartParams[cChartConsts.ATTR_SHOW_COMPARE] = 1; + oChartParams[cChartConsts.ATTR_PREVIOUS] = 0; + oChartParams[cChartConsts.ATTR_WIDTH] = cChartConsts.WIDTH_3ACROSS; + oChartParams[cChartConsts.ATTR_HEIGHT] = cChartConsts.LETTERBOX_HEIGHT; + + //----------------------------------------------------------------- + var oRow = $("|||||||||||||
");
+ var oChart = $(" ", oChartParams);
+ oChart.append("please wait - chart loading...")
+ oTD.append(oChart);
+ oRow.append(oTD);
+ //-----------------------------------------------------------------
+ oChartParams[cRenderQS.METRIC_QS + "0"] = sSPMetric + "|Average Response Time (ms)";
+ oTD = $(" ");
+ oChart = $(" | ", oChartParams);
+ oChart.append("please wait - chart loading...")
+ oTD.append(oChart);
+ oRow.append(oTD);
+ //-----------------------------------------------------------------
+ oChartParams[cRenderQS.METRIC_QS + "0"] = sSPMetric + "|Errors Per Minute";
+ oTD = $(" ");
+ oChart = $(" | ", oChartParams);
+ oChart.append("please wait - chart loading...")
+ oTD.append(oChart);
+ oRow.append(oTD);
+
+ //-----------------------------------------------------------------
+
+ oTable.append(oRow);
+ });
+
+ oElement.append(oTable);
+
+ //- - - - -convert chart to Widgets
+ if (cCharts.isGoogleChartsLoaded())
+ this.convert_to_widgets()
+ else
+ cCharts.load_google_charts(function(){this.convert_to_widgets();});
+ },
+
+ //*******************************************************************
+ convert_to_widgets: function(){
+ $("DIV[type=spwidget]").each(
+ function(piIndex, poElement){
+ $(poElement).adchart();
+ }
+ );
+ }
+});
\ No newline at end of file
diff --git a/pages/agents/allagentversions.php b/pages/agents/allagentversions.php
index e55c31c..c38eaca 100644
--- a/pages/agents/allagentversions.php
+++ b/pages/agents/allagentversions.php
@@ -12,7 +12,7 @@
// USE AT YOUR OWN RISK - NO GUARANTEES OR ANY FORM ARE EITHER EXPRESSED OR IMPLIED
**************************************************************************/
//####################################################################
-//TODO make asynchronous - separate calls for machine/db/app agents
+//TBD make asynchronous - separate calls for machine/db/app agents
$home="../..";
require_once "$home/inc/common.php";
diff --git a/pages/all/allbackendsbyname.php b/pages/all/allbackendsbyname.php
index dc0ec77..aedb930 100644
--- a/pages/all/allbackendsbyname.php
+++ b/pages/all/allbackendsbyname.php
@@ -24,11 +24,7 @@
cRenderHtml::header("All Remote Services");
cRender::force_login();
?>
-
-
-
-
-
+
="=$poTier->id?>">please wait...name'>";
+ cRenderMenus::show_tier_functions($poTier);
+ echo "";
$sUrl = cHttp::build_url("tiertransgraph.php", $gsAppQS);
- $sUrl = cHttp::build_url($sUrl, cRenderQS::TIER_QS, $oTier->name);
- $sUrl = cHttp::build_url($sUrl, cRenderQS::TIER_ID_QS, $oTier->id);
+ $sUrl = cHttp::build_url($sUrl, cRenderQS::TIER_QS, $poTier->name);
+ $sUrl = cHttp::build_url($sUrl, cRenderQS::TIER_ID_QS, $poTier->id);
cRender::button("show transaction graphs", $sUrl);
cRenderCards::action_end();
cRenderCards::card_end();
diff --git a/pages/trans/searchsnaps.php b/pages/trans/searchsnaps.php
index 1681137..bba45d4 100644
--- a/pages/trans/searchsnaps.php
+++ b/pages/trans/searchsnaps.php
@@ -45,7 +45,7 @@
}
//********************************************************************
-//TODO make this a widget
+//TBD make this a widget
$oCred = cRenderObjs::get_AD_credentials();
diff --git a/pages/trans/snapdetails.php b/pages/trans/snapdetails.php
index 64b4aa8..937ee43 100644
--- a/pages/trans/snapdetails.php
+++ b/pages/trans/snapdetails.php
@@ -74,7 +74,7 @@ function sort_by_time($a,$b){
$sDate = cADTime::timestamp_to_date($oSnap->starttime);
?>=$sBackend?>=cRender::show_name(cRender::NAME_APP,$oApp)?>=$oApp->name?>GET_Tiers(); // work through each tier -?>Availability for =cRender::show_name(cRender::NAME_APP,$oApp)?>Availability for =$oApp->name?>name); $sUrl = cHttp::build_qs($sUrl, cRenderQS::TIER_ID_QS, $oTier->id); - ?> diff --git a/pages/app/appheatmap.php b/pages/app/appheatmap.php index 7b20895..3eb16ff 100644 --- a/pages/app/appheatmap.php +++ b/pages/app/appheatmap.php @@ -48,7 +48,7 @@ $metric = cADMetricPaths::tierCallsPerMin($tier); ?> -Heatmap for =cRender::show_name(cRender::NAME_APP,$oApp)?>+Heatmap for =$oApp->name?>-Overview for =cRender::show_name(cRender::NAME_APP,$oApp)?>+Overview for =$oApp->name?>
|