| ##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"> |
| #if($currentUser.role != "G") |
| <a href="#" onclick="if(! hasCheckbox('ids')) { showAlert('#springMessageText( |
| "empty.list","empty.list")'); } else if(! hasChecked('ids')) { showAlert('#springMessageText( |
| "please.select","please.select")'); } else { showConfirm('#springMessageText( |
| "confirm.batch.forbid","confirm.batch.forbid")', 'consumers/' + getChecked('ids') + '/forbid');} return false;"><img |
| src="$rootContextPath.getURI("images/ico_disable.png")" width="12" height="12"/><span |
| class="ico_font">#springMessageText("batch.forbid", "batch.forbid")</span></a> |
| <span class="ico_line">|</span> |
| <a href="#" onclick="if(! hasCheckbox('ids')) { showAlert('#springMessageText( |
| "empty.list","empty.list")'); } else if(! hasChecked('ids')) { showAlert('#springMessageText( |
| "please.select","please.select")'); } else { showConfirm('#springMessageText( |
| "confirm.batch.allow","confirm.batch.allow")', 'consumers/' + getChecked('ids') + '/allow' );} return false;"><img |
| src="$rootContextPath.getURI("images/ico_enable.png")" width="12" height="12"/><span |
| class="ico_font">#springMessageText("batch.allow", "batch.allow")</span></a> |
| <span class="ico_line">|</span> |
| <a href="#" onclick="if(! hasCheckbox('ids')) { showAlert('#springMessageText( |
| "empty.list","empty.list")'); } else if(! hasChecked('ids')) { showAlert('#springMessageText( |
| "please.select","please.select")'); } else { showConfirm('#springMessageText( |
| "confirm.only.forbid","confirm.only.forbid")', 'consumers/' + getChecked('ids') + '/onlyforbid');} return false;"><img |
| src="$rootContextPath.getURI("images/ico_disable.png")" width="12" height="12"/><span |
| class="ico_font">#springMessageText("only.forbid", "only.forbid")</span></a> |
| <span class="ico_line">|</span> |
| <a href="#" onclick="if(! hasCheckbox('ids')) { showAlert('#springMessageText( |
| "empty.list","empty.list")'); } else if(! hasChecked('ids')) { showAlert('#springMessageText( |
| "please.select","please.select")'); } else { showConfirm('#springMessageText( |
| "confirm.only.allow","confirm.only.allow")', 'consumers/' + getChecked('ids') + '/onlyallow');} return false;"><img |
| src="$rootContextPath.getURI("images/ico_enable.png")" width="12" height="12"/><span |
| class="ico_font">#springMessageText("only.allow", "only.allow")</span></a> |
| <span class="ico_line">|</span> |
| <a href="#" onclick="if(! hasCheckbox('ids')) { showAlert('#springMessageText( |
| "empty.list","empty.list")'); } else if(! hasChecked('ids')) { showAlert('#springMessageText( |
| "please.select","please.select")'); } else { showConfirm('#springMessageText( |
| "confirm.batch.force.mock", "confirm.batch.force.mock")', 'consumers/' + getChecked('ids') + '/shield');} return false;"><img |
| src="$rootContextPath.getURI("images/ico_cancel.png")" width="12" height="12"/><span |
| class="ico_font">#springMessageText("batch.force.mock", "batch.force.mock")</span></a> |
| <span class="ico_line">|</span> |
| <a href="#" onclick="if(! hasCheckbox('ids')) { showAlert('#springMessageText( |
| "empty.list","empty.list")'); } else if(! hasChecked('ids')) { showAlert('#springMessageText( |
| "please.select","please.select")'); } else { showConfirm('#springMessageText( |
| "confirm.batch.fail.mock","confirm.batch.fail.mock")', 'consumers/' + getChecked('ids') + '/tolerant');} return false;"><img |
| src="$rootContextPath.getURI("images/ico_run.png")" width="12" height="12"/><span |
| class="ico_font">#springMessageText("batch.fail.mock", "batch.fail.mock")</span></a> |
| <span class="ico_line">|</span> |
| <a href="#" onclick="if(! hasCheckbox('ids')) { showAlert('#springMessageText( |
| "empty.list","empty.list")'); } else if(! hasChecked('ids')) { showAlert('#springMessageText( |
| "please.select","please.select")'); } else { showConfirm('#springMessageText( |
| "confirm.batch.cancel.mock","confirm.batch.cancel.mock")', 'consumers/' + getChecked('ids') + '/recover');} return false;"><img |
| src="$rootContextPath.getURI("images/ico_enable.png")" width="12" height="12"/><span |
| class="ico_font">#springMessageText("batch.cancel.mock", "batch.cancel.mock")</span></a> |
| #if($service) |
| <span class="ico_line">|</span> |
| <a href="#" |
| onclick="showConfirm('#springMessageText("confirm.all.force.mock", "confirm.all.force.mock")', 'consumers/0/allshield'); return false;"><img |
| src="$rootContextPath.getURI("images/ico_cancel.png")" width="12" height="12"/><span |
| class="ico_font">#springMessageText("all.force.mock", "all.force.mock")</span></a> |
| <span class="ico_line">|</span> |
| <a href="#" onclick="showConfirm('#springMessageText( |
| "confirm.all.fail.mock","confirm.all.fail.mock")', 'consumers/0/alltolerant'); return false;"><img |
| src="$rootContextPath.getURI("images/ico_run.png")" width="12" height="12"/><span |
| class="ico_font">#springMessageText("all.fail.mock", "all.fail.mock")</span></a> |
| <span class="ico_line">|</span> |
| <a href="#" onclick="showConfirm('#springMessageText( |
| "confirm.all.cancel.mock","confirm.all.cancel.mock")', 'consumers/0/allrecover'); return false;"><img |
| src="$rootContextPath.getURI("images/ico_enable.png")" width="12" height="12"/><span |
| class="ico_font">#springMessageText("all.cancel.mock", "all.cancel.mock")</span></a> |
| #end |
| #end |
| </div> |
| <br/> |
| <table cellpadding="0" cellspacing="0" class="list list_dubbo" id="table_o"> |
| <tr> |
| <th width="20"><input type="checkbox" onclick="checkAll('table_o', 'ids', this.checked)"/></th> |
| <th>#if($address)#springMessageText("service", "service")#else#springMessageText("address", "address")#end: <input type="text" style="width: 60px;" |
| onkeyup="searchTable('table_o', 1, this.value);" |
| onclick="searchTable('table_o', 1, this.value);"/> <img |
| src="$rootContextPath.getURI("images/ico_search.png")" width="12" height="12"/></th> |
| <th>#springMessageText("application", "application"): <input type="text" style="width: 60px;" |
| onkeyup="searchTable('table_o', 2, this.value);" |
| onclick="searchTable('table_o', 2, this.value);"/> <img |
| src="$rootContextPath.getURI("images/ico_search.png")" width="12" height="12"/></th> |
| <th width="110">#springMessageText("access", "access"): <select onchange="searchTable('table_o', 3, this.value);" |
| onclick="searchTable('table_o', 3, this.value);"> |
| <option value="">#springMessageText("all", "all")</option> |
| <option value="#springMessageText("Allowed", "Allowed")">#springMessageText("Allowed","Allowed")</option> |
| <option value="#springMessageText("Forbidden", "Forbidden")">#springMessageText("Forbidden","Forbidden")</option> |
| </select></th> |
| <th width="110">#springMessageText("mock", "mock"): <select onchange="searchTable('table_o', 4, this.value);" |
| onclick="searchTable('table_o', 4, this.value);"> |
| <option value="">#springMessageText("all", "all")</option> |
| <option value="#springMessageText("no.mocked", "no.mocked")">#springMessageText("no.mocked", "no.mocked")</option> |
| <option value="#springMessageText("force.mocked", "force.mocked")">#springMessageText("force.mocked", "force.mocked")</option> |
| <option value="#springMessageText("fail.mocked", "fail.mocked")">#springMessageText("fail.mocked", "fail.mocked")</option> |
| </select></th> |
| <th width="110">#springMessageText("Route", "Route"): <select onchange="searchTable('table_o', 5, this.value);" |
| onclick="searchTable('table_o', 5, this.value);"> |
| <option value="">#springMessageText("all", "all")</option> |
| <option value="#springMessageText("routed", "routed")">#springMessageText("routed", "routed")</option> |
| <option value="#springMessageText("unrouted", "unrouted")">#springMessageText("unrouted", "unrouted")</option> |
| </select></th> |
| <th width="110">#springMessageText("notify", "notify"): <select onchange="searchTable('table_o', 6, this.value);" |
| onclick="searchTable('table_o', 6, this.value);"> |
| <option value="">#springMessageText("all", "all")</option> |
| <option value="#springMessageText("notified", "notified")">#springMessageText("notified", "notified")</option> |
| <option value="#springMessageText("unnotified", "unnotified")">#springMessageText("unnotified", "unnotified")</option> |
| </select></th> |
| #if($currentUser.role != "G") |
| <th>#springMessageText("operation", "operation")</th>#end |
| </tr> |
| #foreach($consumer in $consumers) |
| <tr> |
| <td><input type="checkbox" name="ids" value="$consumer.id"/></td> |
| <td> |
| <a href="$rootContextPath.getURI("/governance/")consumers/$consumer.id">#if($address)$tool.getSimpleName($consumer.service)#else$consumer.address#end</a> |
| </td> |
| <td>$consumer.application</td> |
| <td> |
| #if($tool.isInBlackList($consumer)) |
| <font color="red">#springMessageText("Forbidden","Forbidden")</font> |
| #else |
| <font color="green">#springMessageText("Allowed","Allowed")</font> |
| #end |
| </td> |
| <td> |
| #set($mock=$tool.getConsumerMock($consumer)) |
| #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> |
| <td> |
| #if($consumer.routes && $consumer.routes.size() > 0) |
| <a href="$rootContextPath.getURI("/governance/")consumers/$consumer.id/routed">#springMessageText("routed", "routed")($consumer.routes.size())</a> |
| #else |
| <font color="gray">#springMessageText("unrouted", "unrouted")</font> |
| #end |
| </td> |
| <td> |
| #if($consumer.providers && $consumer.providers.size() > 0) |
| <a href="$rootContextPath.getURI("/governance/")consumers/$consumer.id/notified">#springMessageText("notified", "notified")($consumer.providers.size())</a> |
| #else |
| <font color="red">#springMessageText("noProvider", "noProvider")</font> |
| #end |
| </td> |
| #if($currentUser.role != "G") |
| <td> |
| #if($currentUser.hasServicePrivilege($consumer.service)) |
| <a href="$rootContextPath.getURI("/governance/")consumers/$consumer.id/edit"><img src="$rootContextPath.getURI("images/ico_edit.png")" |
| width="12" height="12"/><span |
| class="ico_font">#springMessageText("edit", "edit")</span></a> |
| <span class="ico_line">|</span> |
| #if($tool.isInBlackList($consumer)) |
| <a href="#" onclick="showConfirm('#springMessageText( |
| "confirm.allow","confirm.allow")', '$consumer.address -> $tool.getSimpleName($consumer.service)', 'consumers/$consumer.id/allow'); return false;"><img |
| src="$rootContextPath.getURI("images/ico_enable.png")" width="12" height="12"/><span |
| class="ico_font">#springMessageText("allow", "allow")</span></a> |
| #else |
| <a href="#" onclick="showConfirm('#springMessageText( |
| "confirm.forbid","confirm.forbid")', '$consumer.address -> $tool.getSimpleName($consumer.service)', 'consumers/$consumer.id/forbid'); return false;"><img |
| src="$rootContextPath.getURI("images/ico_disable.png")" width="12" |
| height="12"/><span class="ico_font">#springMessageText("forbid", "forbid")</span></a> |
| #end |
| <span class="ico_line">|</span> |
| #if($mock.equals("force%3Areturn+null")) |
| <a href="#" onclick="showConfirm('#springMessageText( |
| "confirm.cancel.mock","confirm.cancel.mock")', '$consumer.address -> $tool.getSimpleName($consumer.service)', 'consumers/$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 -> $tool.getSimpleName($consumer.service)', 'consumers/$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 -> $tool.getSimpleName($consumer.service)', 'consumers/$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 -> $tool.getSimpleName($consumer.service)', 'consumers/$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 -> $tool.getSimpleName($consumer.service)', 'consumers/$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 -> $tool.getSimpleName($consumer.service)', 'consumers/$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 |
| </td> |
| #end |
| </tr> |
| #end |
| </table> |
| <div class="page">#springMessageText("page.total", "page.total")$consumers.size()#springMessageText("page.records", "page.records") </div> |