blob: f91cade4217f059208a27be264a2a28d6edd1d6c [file] [log] [blame]
##Licensed to the Apache Software Foundation (ASF) under one or more
##contributor license agreements. See the NOTICE file distributed with
##this work for additional information regarding copyright ownership.
##The ASF licenses this file to You under the Apache License, Version 2.0
##(the "License"); you may not use this file except in compliance with
##the License. You may obtain a copy of the License at
##
##http://www.apache.org/licenses/LICENSE-2.0
##
##Unless required by applicable law or agreed to in writing, software
##distributed under the License is distributed on an "AS IS" BASIS,
##WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
##See the License for the specific language governing permissions and
##limitations under the License.
#set($layout = "/templates/governance/layout/default.vm")
<div class="ico_btn">
<a href="../../consumers"><img src="$rootContextPath.getURI("images/ico_back.png")" width="12" height="12"/><span
class="ico_font">#springMessageText("back", "back")</span></a>
<span class="ico_line">|</span>
<a href="../$consumer.id"><img src="$rootContextPath.getURI("images/ico_show.png")" width="12" height="12"/><span
class="ico_font">#springMessageText("show", "show")</span></a>
#set($mock=$tool.getConsumerMock($consumer))
#if($currentUser.hasServicePrivilege($consumer.service))
<span class="ico_line">|</span>
#if($mock.equals("force%3Areturn+null"))
<a href="#" onclick="showConfirm('#springMessageText(
"confirm.cancel.mock","confirm.cancel.mock")', '$consumer.address -&gt; $tool.getSimpleName($consumer.service)', '../$consumer.id/recover'); return false;"><img
src="$rootContextPath.getURI("images/ico_enable.png")" width="12" height="12"/><span
class="ico_font">#springMessageText("cancel.mock", "cancel.mock")</span></a>
<span class="ico_line">|</span>
<a href="#" onclick="showConfirm('#springMessageText(
"confirm.fail.mock","confirm.fail.mock")', '$consumer.address -&gt; $tool.getSimpleName($consumer.service)', '../$consumer.id/tolerant'); return false;"><img
src="$rootContextPath.getURI("images/ico_run.png")" width="12" height="12"/><span
class="ico_font">#springMessageText("fail.mock", "fail.mock")</span></a>
#elseif ($mock.equals("fail%3Areturn+null"))
<a href="#" onclick="showConfirm('#springMessageText(
"confirm.force.mock","confirm.force.mock")', '$consumer.address -&gt; $tool.getSimpleName($consumer.service)', '../$consumer.id/shield'); return false;"><img
src="$rootContextPath.getURI("images/ico_cancel.png")" width="12" height="12"/><span
class="ico_font">#springMessageText("force.mock", "force.mock")</span></a>
<span class="ico_line">|</span>
<a href="#" onclick="showConfirm('#springMessageText(
"confirm.cancel.mock","confirm.cancel.mock")', '$consumer.address -&gt; $tool.getSimpleName($consumer.service)', '../$consumer.id/recover'); return false;"><img
src="$rootContextPath.getURI("images/ico_enable.png")" width="12" height="12"/><span
class="ico_font">#springMessageText("cancel.mock", "cancel.mock")</span></a>
#else
<a href="#" onclick="showConfirm('#springMessageText(
"confirm.force.mock","confirm.force.mock")', '$consumer.address -&gt; $tool.getSimpleName($consumer.service)', '../$consumer.id/shield'); return false;"><img
src="$rootContextPath.getURI("images/ico_cancel.png")" width="12" height="12"/><span
class="ico_font">#springMessageText("force.mock", "force.mock")</span></a>
<span class="ico_line">|</span>
<a href="#" onclick="showConfirm('#springMessageText(
"confirm.fail.mock","confirm.fail.mock")', '$consumer.address -&gt; $tool.getSimpleName($consumer.service)', '../$consumer.id/tolerant'); return false;"><img
src="$rootContextPath.getURI("images/ico_run.png")" width="12" height="12"/><span
class="ico_font">#springMessageText("fail.mock", "fail.mock")</span></a>
#end
#end
#if ($consumer.routes && $consumer.routes.size() > 0)
<span class="ico_line">|</span>
<a href="../$consumer.id/routed"><img src="$rootContextPath.getURI("images/ico_balance.png")" width="12"
height="12"/><span class="ico_font">#springMessageText("routed", "routed")
($consumer.routes.size())</span></a>
#end
#if ($consumer.providers && $consumer.providers.size() > 0)
<span class="ico_line">|</span>
<a href="../$consumer.id/notified"><img src="$rootContextPath.getURI("images/ico_renotify.png")" width="12"
height="12"/><span class="ico_font">#springMessageText("notified", "notified")
($consumer.providers.size())</span></a>
#end
</div>
<br/>
<form id="consumerForm" action="../update" method="POST">
<table cellpadding="0" cellspacing="0" class="info">
<tr type = "hidden">
<td>
<input type="hidden" name="id" value="$consumer.id">
</td>
</tr>
#if(! $service)
<tr>
<th style="width: 100px;">#springMessageText("service", "service"):</th>
<td>$!consumer.service</td>
</tr>
#end
<tr>
<th style="width: 100px;">#springMessageText("ConsumerAddress", "ConsumerAddress"):</th>
<td>consumer://$!consumer.address/$!consumer.service?$!consumer.parameters</td>
</tr>
<tr>
<th>#springMessageText("overrides", "overrides"):</th>
<td><input type="text" name="parameters" value="$!consumer.override.params" class="setting_input"
style="width: 400px;"/> <font color="blue">#springMessageText("dynamic.parameters.tip", "dynamic.parameters.tip")</font></td>
</tr>
<tr>
<th>#springMessageText("mock", "mock"):</th>
<td>
#if($mock.equals("force%3Areturn+null"))
<font color="red">#springMessageText("force.mocked", "force.mocked")</font>
#elseif ($mock.equals("fail%3Areturn+null"))
<font color="blue">#springMessageText("fail.mocked", "fail.mocked")</font>
#else
<font color="gray">#springMessageText("no.mocked", "no.mocked")</font>
#end
</td>
</tr>
<tr>
<th>#springMessageText("status", "status"):</th>
<td>
#if($tool.isInBlackList($consumer))
<font color="red">#springMessageText("Forbidden", "Forbidden")</font>
#else
<font color="green">#springMessageText("Allowed", "Allowed")</font>
#end
</td>
</tr>
<tr>
<th>#springMessageText("Route", "Route"):</th>
<td>
#if($consumer.routes && $consumer.routes.size() > 0)
<a href="../$consumer.id/routed">#springMessageText("routed", "routed")($consumer.routes.size())</a>
#else
<font color="gray">#springMessageText("unrouted", "unrouted")</font>
#end
</td>
</tr>
<tr>
<th>#springMessageText("notify", "notify"):</th>
<td>
#if($consumer.providers && $consumer.providers.size() > 0)
<a href="../$consumer.id/notified">#springMessageText("notified", "notified")($consumer.providers.size())</a>
#else
<font color="red">#springMessageText("noProvider", "noProvider")</font>
#end
</td>
</tr>
<tr>
<th>
<div class="btn"><a href="#" onclick="document.getElementById('consumerForm').submit();">#springMessageText(
"save","save")</a></div>
</th>
<td></td>
</tr>
</table>
</form>