Repository: knox Updated Branches: refs/heads/master f98abb9c6 -> e56c3a048
KNOX-705 rules to support view changes in Ambari Project: http://git-wip-us.apache.org/repos/asf/knox/repo Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/e56c3a04 Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/e56c3a04 Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/e56c3a04 Branch: refs/heads/master Commit: e56c3a048af509eba9a82c7afac3c0e41e64900f Parents: f98abb9 Author: Sumit Gupta <su...@apache.org> Authored: Tue Jun 21 10:41:26 2016 -0400 Committer: Sumit Gupta <su...@apache.org> Committed: Tue Jun 21 10:41:26 2016 -0400 ---------------------------------------------------------------------- .../services/ambariui/2.2.0/rewrite.xml | 43 +++++++++++++++++++- .../services/ambariui/2.2.0/service.xml | 30 ++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/e56c3a04/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/rewrite.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/rewrite.xml index 9151fe0..4d03e9a 100644 --- a/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/rewrite.xml +++ b/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/rewrite.xml @@ -25,6 +25,10 @@ <rewrite template="{$serviceUrl[AMBARIUI]}/{**}?{**}"/> </rule> + <rule dir="OUT" name="AMBARIUI/ambari/outbound/sitepath"> + <rewrite template="{$frontend[path]}/ambari"/> + </rule> + <rule dir="OUT" name="AMBARIUI/ambari/outbound/extrapath"> <rewrite template="{$frontend[path]}/ambari/api/v1"/> </rule> @@ -42,15 +46,52 @@ <rewrite template="{$frontend[url]}/ambari/img/{**}"/> </rule> + <filter name="AMBARIUI/ambari/outbound/proxyroot"> + <content type="*/x-javascript"> + <apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/> + </content> + <content type="application/javascript"> + <apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/> + </content> + </filter> + + <!-- filter to rewrite api prefix defined in .js from root --> + <!-- e.g. /api/v1 --> + <filter name="AMBARIUI/ambari/outbound/apiendpoint"> + <content type="*/x-javascript"> + <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> + </content> + <content type="application/javascript"> + <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> + </content> + </filter> + + <filter name="AMBARIUI/ambari/outbound/apiendpoint/html"> + <content type="text/html"> + <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> + </content> + </filter> + + <filter name="AMBARIUI/ambari/outbound/apiendpoint/noroot"> + <content type="*/x-javascript"> + <apply path="api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> + </content> + <content type="application/javascript"> + <apply path="api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> + </content> + </filter> + <filter name="AMBARIUI/ambari/outbound/links"> <content type="*/x-javascript"> <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> + <apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/> <apply path="/img/logo-white.png" rule="AMBARIUI/ambari/outbound/whitelogo"/> <apply path="/#/main/dashboard" rule="AMBARIUI/ambari/outbound/logohref"/> <apply path="/img/ambari-view-default.png" rule="AMBARIUI/ambari/outbound/ambariview"/> </content> <content type="application/javascript"> <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/> + <apply path="\{proxy_root\}" rule="AMBARIUI/ambari/outbound/sitepath"/> <apply path="/img/logo-white.png" rule="AMBARIUI/ambari/outbound/whitelogo"/> <apply path="/#/main/dashboard" rule="AMBARIUI/ambari/outbound/logohref"/> <apply path="/img/ambari-view-default.png" rule="AMBARIUI/ambari/outbound/ambariview"/> @@ -58,4 +99,4 @@ <content type="*/html"> </content> </filter> -</rules> \ No newline at end of file +</rules> http://git-wip-us.apache.org/repos/asf/knox/blob/e56c3a04/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/service.xml b/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/service.xml index 786b197..728fe2a 100644 --- a/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/service.xml +++ b/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/service.xml @@ -28,6 +28,36 @@ <route path="/ambari/**/app.js"> <rewrite apply="AMBARIUI/ambari/outbound/links" to="response.body"/> </route> + + <!-- Admin View route --> + <route path="/ambari/views/ADMIN_VIEW/**/INSTANCE/**/main.js"> + <rewrite apply="AMBARIUI/ambari/outbound/proxyroot" to="response.body"/> + </route> + + <!-- Files view --> + <route path="/ambari/views/FILES/**/assets/files-view*.js"> + <rewrite apply="AMBARIUI/ambari/outbound/apiendpoint" to="response.body"/> + </route> + + <!-- Capacity Scheduler view --> + <route path="/ambari/views/CAPACITY-SCHEDULER/**/javascripts/app.js"> + <rewrite apply="AMBARIUI/ambari/outbound/apiendpoint/noroot" to="response.body"/> + </route> + + <!-- Hive view route --> + <route path="/ambari/views/HIVE/**/assets/hive.js"> + <rewrite apply="AMBARIUI/ambari/outbound/apiendpoint" to="response.body"/> + </route> + + <!-- Storm View --> + <route path="/ambari/views/Storm_Monitoring/**/scripts/models/*.js"> + <rewrite apply="AMBARIUI/ambari/outbound/apiendpoint" to="response.body"/> + </route> + + <route path="/ambari/views/ZEPPELIN/*/*/"> + <rewrite apply="AMBARIUI/ambari/outbound/apiendpoint/html" to="response.body"/> + </route> + <!-- No need to rewrite Slider View --> </routes> <dispatch classname="org.apache.hadoop.gateway.dispatch.PassAllHeadersDispatch"/> </service>