Add internal transition to web sample

- This is purely for jepsen tests, though also
  handy for UI for showing that variable can be changed.
  Essentially we want to have a way to set extended state
  variable via internal transition which takes an value from
  event headers and set that to extended state. This is then
  supposed to be used from jepsen to test concurrenty issues
  around extended state variables.
This commit is contained in:
Janne Valkealahti
2015-08-07 17:22:28 +01:00
parent 435b306cf9
commit 672a41ecf1
4 changed files with 47 additions and 6 deletions

View File

@@ -35,6 +35,12 @@
<button ng-click="sendEvent('I')">event I</button>
</div>
</div>
<div class="row">
<div>
<button ng-click="sendEventAndVariable('J')">event J</button>
<input id="newTestVariable" type="text" ng-model="testVariable" placeholder="New testVariable value..." />
</div>
</div>
<div class="row">
<div class="col-xs-3">
<h4>States</h4>

View File

@@ -18,6 +18,12 @@ angular.module('springChat.controllers', ['toaster'])
});
};
$scope.sendEventAndVariable = function(event) {
$http.post('/event', null, {params:{"id": event, "testVariable": $scope.testVariable}}).
success(function(data) {
});
};
var initStompClient = function() {
chatSocket.init('/ws');