Skip to content

Commit 874e905

Browse files
committed
Merge branch 'master' into onepointthree
2 parents 9071b22 + 93caf94 commit 874e905

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

client/controllers/instance/controllerInstance.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,14 @@ function ControllerInstance(
7575
// watch for deployed/started/stopped instance
7676
// all watches necessary, updateDisplayedTabs expectst to be invoked
7777
// after fetching instance, fetching container, and cointainer start
78-
var containerWatch;
79-
$scope.$watch('dataInstance.data.instance', handleInstance);
80-
function handleInstance (instance) {
81-
if (!instance) { return; } // instance still being fetched
82-
containerWatch = $scope.$watch('dataInstance.data.instance.containers.models[0]', handleContainer);
83-
}
78+
var containerWatch =
79+
$scope.$watch('dataInstance.data.instance.containers.models[0]', handleContainer);
80+
8481
function handleContainer (container) {
8582
if (!container) {
8683
buildLogsOnly();
8784
}
8885
else { // handles both container.error and container.dockerContainer states
89-
containerWatch(); // once, got container
9086
$scope.$watch('dataInstance.data.instance.containers.models[0].attrs.inspect.State.Running', displayTabsForContainerState); // once
9187
}
9288
}
@@ -140,6 +136,10 @@ function ControllerInstance(
140136
displayTabsForContainerState(keypather.get(container, 'running()'));
141137
}
142138

139+
$scope.$on('$destroy', function () {
140+
containerWatch();
141+
});
142+
143143
function buildLogsOnly () {
144144
data.openItems.reset([]);
145145
// Set to true if we see the instance in an undeployed state

client/services/serviceHelperInstanceActionsModal.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ function HelperInstanceActionsModal(
1111
$timeout,
1212
async,
1313
keypather,
14+
errs,
1415
updateEnvName,
1516
$localStorage
1617
) {
@@ -73,12 +74,15 @@ function HelperInstanceActionsModal(
7374
$rootScope.dataApp.data.loading = true;
7475
if (!opts.env) { return; }
7576
$scope.instance.update(opts, function (err) {
76-
$rootScope.safeApply();
7777
if (err) { throw err; }
78-
$rootScope.dataApp.data.loading = false;
78+
$rootScope.safeApply();
7979
// update instances collection to update
8080
// viewInstanceList
81-
$state.go('instance.instance', $stateParams);
81+
$scope.instance.redeploy(function(err) {
82+
$rootScope.dataApp.data.loading = false;
83+
errs.handler(err);
84+
$state.go('instance.instance', $stateParams, {reload: true});
85+
});
8286
});
8387
if (cb) {
8488
cb();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"ngStorage": "git+https://github.com/cflynn07/ngStorage.git#v0.4.0",
4242
"primus": "^2.3.0",
4343
"regexp-quote": "0.0.0",
44-
"runnable": "git+ssh://[email protected]:CodeNow/runnable-api-client#v0.38.4",
44+
"runnable": "git+ssh://[email protected]:CodeNow/runnable-api-client#v0.38.6",
4545
"term.js": "git://github.com/Runnable/term.js.git#6a1d4ec38aa26c61fb6a4f0a20ba5cb207e66f2d",
4646
"uuid": "^2.0.1"
4747
},

0 commit comments

Comments
 (0)