|
From: <jt...@hy...> - 2007-03-29 22:31:05
|
Author: jtravis Date: 2007-03-29 14:31:02 -0800 (Thu, 29 Mar 2007) New Revision: 3965 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3965 Modified: trunk/ui_plugins/rendit_sys/org/hyperic/hq/ui/rendit/BaseController.groovy Log: Start adding chart link capabilities Modified: trunk/ui_plugins/rendit_sys/org/hyperic/hq/ui/rendit/BaseController.groovy =================================================================== --- trunk/ui_plugins/rendit_sys/org/hyperic/hq/ui/rendit/BaseController.groovy 2007-03-29 22:01:51 UTC (rev 3964) +++ trunk/ui_plugins/rendit_sys/org/hyperic/hq/ui/rendit/BaseController.groovy 2007-03-29 22:31:02 UTC (rev 3965) @@ -64,6 +64,11 @@ StringEscapeUtils.escapeHtml(str) } + public String createURL(path) { + def curUrl = new URL(invokeArgs.request.requestURL + "") + (new URL(curUrl.protocol, curUrl.host, curUrl.port, path)).toString() + } + public String url_for(opts, htmlOpts) { def url = "" @@ -75,12 +80,19 @@ if (opts.containsKey('action')) { url += h(opts['action']) - } else if (opts.containsKey('resource')) { + } + + if (opts.containsKey('metricChart')) { + def entId = opts['metricChart'].entId + def templateId = opts['metricChart'].templateId + url = createURL("/resource/common/monitor/Visibility.do?" + + "eid=$entId&m=$templateId" + + "&mode=chartSingleMetricSingleResource") + } + + if (opts.containsKey('resource')) { def entId = opts['resource'].entityId.appdefKey - def curUrl = new URL(invokeArgs.request.requestURL + "") - def newURL = new URL(curUrl.protocol, curUrl.host, curUrl.port, - "/Resource.do?eid=$entId") - url = newURL.toString() + url = createURL("/Resource.do?eid=$entId") } url += '?' |