[onos-5262] Adding patchset 1
[onos-5262] Adding patchset 2
Change-Id: I43cb43deca16bcfe1874699bccdb94b0301d30d1
diff --git a/web/gui/src/main/webapp/app/view/intent/intent.html b/web/gui/src/main/webapp/app/view/intent/intent.html
index 3fa441a..18d8673 100644
--- a/web/gui/src/main/webapp/app/view/intent/intent.html
+++ b/web/gui/src/main/webapp/app/view/intent/intent.html
@@ -32,6 +32,11 @@
tooltip tt-msg="topoTip"
ng-click="showIntent()"></div>
+ <div ng-class="{'active': !!selId && isIntentWithdrawn()}"
+ icon icon-id="play" icon-size="42"
+ tooltip tt-msg="resubmitTip"
+ ng-click="(!!selId && isIntentWithdrawn()) ? resubmitIntent():''"></div>
+
<div ng-class="{'active': !!selId && isIntentInstalled()}"
icon icon-id="stop" icon-size="42"
tooltip tt-msg="deactivateTip"
diff --git a/web/gui/src/main/webapp/app/view/intent/intent.js b/web/gui/src/main/webapp/app/view/intent/intent.js
index 1b49a98..71c07cf 100644
--- a/web/gui/src/main/webapp/app/view/intent/intent.js
+++ b/web/gui/src/main/webapp/app/view/intent/intent.js
@@ -71,6 +71,7 @@
});
$scope.topoTip = 'Show selected intent on topology view';
+ $scope.resubmitTip = 'Resubmit selected intent';
$scope.deactivateTip = 'Remove selected intent';
$scope.purgeTip = 'Purge selected intent';
@@ -87,20 +88,22 @@
return $scope.intentState === 'Withdrawn';
};
- function executeAction(bPurge) {
+ function executeAction(action) {
var content = ds.createDiv(),
- txt = bPurge ? 'purge' : 'withdraw' ;
+ txt,
+ bPurge = action === 'purge';
$scope.intentData.intentPurge = bPurge;
content.append('p').
- text('Are you sure you want to '+ txt +
+ text('Are you sure you want to '+ action +
' the selected intent?');
function dOk() {
var d = $scope.intentData;
$log.debug(d);
- d && tts.removeIntent(d);
+ d && (action === 'resubmit' ? tts.resubmitIntent(d) :
+ tts.removeIntent(d));
$scope.fired = true;
}
@@ -118,11 +121,15 @@
}
$scope.deactivateIntent = function () {
- executeAction(false);
+ executeAction("withdraw");
+ };
+
+ $scope.resubmitIntent = function () {
+ executeAction("resubmit");
};
$scope.purgeIntent = function () {
- executeAction(true);
+ executeAction("purge");
};
$scope.briefToggle = function () {
diff --git a/web/gui/src/main/webapp/app/view/topo/topoTraffic.js b/web/gui/src/main/webapp/app/view/topo/topoTraffic.js
index 215f3e3..5d52ab1 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoTraffic.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoTraffic.js
@@ -192,6 +192,19 @@
flash.flash('Intent ' + txt);
}
+ function resubmitIntent (d) {
+ $log.debug('Entering resubmitIntent');
+ wss.sendEvent('resubmitIntent', {
+ appId: d.appId,
+ appName: d.appName,
+ key: d.key,
+ purge: d.intentPurge
+ });
+ trafficMode = 'intents';
+ hoverMode = null;
+ flash.flash('Intent resubmitted');
+ }
+
function addMultiSourceIntent () {
var so = api.selectOrder();
wss.sendEvent('addMultiSourceIntent', {
@@ -240,7 +253,8 @@
// invoked from buttons on detail (multi-select) panel
addHostIntent: addHostIntent,
addMultiSourceIntent: addMultiSourceIntent,
- removeIntent: removeIntent
+ removeIntent: removeIntent,
+ resubmitIntent: resubmitIntent
};
}]);
}());