You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2017/10/23 21:47:45 UTC
[43/45] qpid-dispatch git commit: DISPATCH-834 Handle changing
between address.prefix and address.pattern
DISPATCH-834 Handle changing between address.prefix and address.pattern
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/e1418ab5
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/e1418ab5
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/e1418ab5
Branch: refs/heads/master
Commit: e1418ab53a8219d9e5a0aff5a126f7fb732d0cb4
Parents: d0a3dd7
Author: Ernest Allen <ea...@redhat.com>
Authored: Wed Oct 18 12:09:51 2017 -0400
Committer: Ernest Allen <ea...@redhat.com>
Committed: Wed Oct 18 12:09:51 2017 -0400
----------------------------------------------------------------------
console/config/config.py | 8 ++++++--
console/config/html/qdrTopology.html | 14 +++++++-------
console/config/mock/section.py | 2 ++
3 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e1418ab5/console/config/config.py
----------------------------------------------------------------------
diff --git a/console/config/config.py b/console/config/config.py
index 1f73e8d..f83057e 100755
--- a/console/config/config.py
+++ b/console/config/config.py
@@ -35,7 +35,7 @@ import subprocess
from distutils.spawn import find_executable
get_class = lambda x: globals()[x]
-sectionKeys = {"log": "module", "sslProfile": "name", "connector": "port", "listener": "port", "address": "distribution"}
+sectionKeys = {"log": "module", "sslProfile": "name", "connector": "port", "listener": "port", "address": "prefix|pattern"}
# modified from qpid-dispatch/python/qpid_dispatch_internal/management/config.py
def _parse(lines):
@@ -244,7 +244,11 @@ class Manager(object):
if section.type+'s' not in node:
node[section.type+'s'] = {}
key = sectionKeys[section.type]
- val = section.entries.get(key)
+ if '|' in key:
+ # assumes at least one of the keys will have a value
+ val = [section.entries.get(x) for x in key.split('|') if section.entries.get(x)][0]
+ else:
+ val = section.entries.get(key)
node[section.type+'s'][val] = section.entries
for source, ports_for_this_routers in enumerate(port_map):
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e1418ab5/console/config/html/qdrTopology.html
----------------------------------------------------------------------
diff --git a/console/config/html/qdrTopology.html b/console/config/html/qdrTopology.html
index 8b39fa0..77ab74a 100644
--- a/console/config/html/qdrTopology.html
+++ b/console/config/html/qdrTopology.html
@@ -20,7 +20,7 @@ under the License.
<div id="buttonBar" class="navbar-primary">
Current topology
<select ng-model="mockTopologyDir" ng-options="item for item in mockTopologies"></select>
- <button class="btn btn-primary" type="button" ng-click="Publish()" title="Save this topology">Publish</button>
+ <button class="btn btn-primary" type="button" ng-click="Publish()" title="Save this topology">Save</button>
<button class="btn btn-primary" type="button" ng-click="Clear()" title="Remove all routers">Clear</button>
<button class="btn btn-primary" type="button" ng-click="Deploy()" ng-disabled="!canDeploy()" ng-if="ansible" title="Deploy this topology">Deploy</button>
<button class="btn btn-primary pull-right" type="button" ng-click="doHelp()" title="Show help">?</button>
@@ -77,7 +77,7 @@ under the License.
<!-- <li ng-repeat="listener in getSectionList(selected_node, 'listener')" ng-click="editSection(selected_node, 'listener', listener)">Edit/Delete listener on port {{listener}} </li> -->
<li class="context-separator"></li>
- <li ng-click="deleteNode(false)">Delete this node</li>
+ <li ng-click="deleteNode(false)">Delete this router</li>
<li ng-click="showConfig(selected_node)">Show generated config</li>
</ul>
</div>
@@ -158,18 +158,18 @@ under the License.
<div class="form-input-container" tooltip-append-to-body="true" tooltip-placement="right" uib-tooltip-html="attributeDescription" ng-mouseenter="setDescription(attribute, $event)" tooltip-class="edit-tooltip">
<label class="form-label" for="{{attribute.name}}">{{attribute.humanName}}</label>
<div ng-if="attribute.input == 'input'">
- <input class="edit_input" ng-if="attribute.type == 'number'" type="number" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.value" ng-required="isItRequired(attribute)" class="ui-widget-content ui-corner-all"/>
- <input class="edit_input" ng-if="attribute.type == 'text'" type="text" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.value" ng-required="isItRequired(attribute)" class="ui-widget-content ui-corner-all"/>
+ <input class="edit_input" ng-if="attribute.type == 'number'" type="number" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.value" ng-required="isItRequired(attribute)" ng-disabled="isItDisabled(attribute)" class="ui-widget-content ui-corner-all"/>
+ <input class="edit_input" ng-if="attribute.type == 'text'" type="text" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.value" ng-required="isItRequired(attribute)" ng-disabled="isItDisabled(attribute)" class="ui-widget-content ui-corner-all"/>
</div>
<div ng-if="attribute.input == 'select'">
- <select class="edit_input" id="{{attribute.name}}" ng-model="attribute.selected" ng-required="isItRequired(attribute)" ng-options="item for item in attribute.rawtype"></select>
+ <select class="edit_input" id="{{attribute.name}}" ng-model="attribute.selected" ng-required="isItRequired(attribute)" ng-disabled="isItDisabled(attribute)" ng-options="item for item in attribute.rawtype"></select>
</div>
<div ng-if="attribute.input == 'boolean'" class="boolean">
<label><input type="radio" ng-model="attribute.value" value="true"> True</label>
<label><input type="radio" ng-model="attribute.value" value="false"> False</label>
</div>
<div ng-if="attribute.input == 'checkbox'" class="boolean">
- <label><input id="attribute.name" type="checkbox" ng-required="isItRequired(attribute)" ng-model="attribute.value"></label>
+ <label><input id="attribute.name" type="checkbox" ng-required="isItRequired(attribute)" ng-disabled="isItDisabled(attribute)" ng-model="attribute.value"></label>
</div>
</div>
</div>
@@ -186,7 +186,7 @@ under the License.
<script type="text/ng-template" id="show-config-template.html">
<form novalidate ng-submit="ok()">
<div class="modal-header">
- <h3 class="modal-title">Current config file if published</h3>
+ <h3 class="modal-title">Current config file if saved</h3>
</div>
<div class="modal-body">
<fieldset>
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e1418ab5/console/config/mock/section.py
----------------------------------------------------------------------
diff --git a/console/config/mock/section.py b/console/config/mock/section.py
index 3842302..ce71d7c 100644
--- a/console/config/mock/section.py
+++ b/console/config/mock/section.py
@@ -50,6 +50,8 @@ class ConfigSection(object):
self.entries.update(d)
def __repr__(self):
+ # ensure all entries have values
+ self.entries = {k: v for k, v in self.entries.iteritems() if self.entries.get(k)}
raw = self.type + " " + json.dumps(self.entries, indent=4, separators=('', ': '))
return re.sub('["]', '', raw)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org