Skip to content

Commit

Permalink
fixed wrong state of force SSL on dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
githubsaturn committed Dec 31, 2017
1 parent ee629f7 commit efc4384
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app-backend/dist/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</div>
<div class="row">
<div class="pull-right col-md-4">
<button type="button" class="btn btn-block btn-primary" uib-tooltip="Redirects all regular HTTP requests to HTTPS" ng-click="onForceSslClicked()" ng-disabled="!captaininfo.hasRootSsl">Force HTTPS</button>
<button type="button" class="btn btn-block btn-primary" uib-tooltip="Redirects all regular HTTP requests to HTTPS" ng-click="onForceSslClicked()" ng-disabled="!captaininfo.hasRootSsl || captaininfo.forceSsl">Force HTTPS</button>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions app-backend/src/routes/SystemRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ router.get('/info/', function (req, res, next) {
return {
dockerRegistryDomain: dockerRegistryAuthObj ? dockerRegistryAuthObj.serveraddress : '',
hasRootSsl: hasRootSsl,
forceSsl: CaptainManager.get().getForceSslValue(),
rootDomain: dataStore.hasCustomDomain() ? dataStore.getRootDomain() : ''
};

Expand Down
5 changes: 3 additions & 2 deletions app-backend/src/user/CaptainManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class CaptainManager {

let dockerApi = DockerApi.get();

this.hasForceSsl = false;
this.dataStore = DataStoreProvider.getDataStore(CaptainConstants.rootNameSpace);
this.dockerApi = dockerApi;
this.certbotManager = new CertbotManager(dockerApi);
Expand Down Expand Up @@ -760,7 +761,7 @@ class CaptainManager {
}

getForceSslValue() {
return this.hasForceSsl;
return !!this.hasForceSsl;
}

/**
Expand Down Expand Up @@ -841,7 +842,7 @@ class CaptainManager {
return self.dataStore.setNginxConfig(baseConfig, captainConfig);
})
.then(function () {
self.resetSelf();
self.resetSelf();
});
}

Expand Down
2 changes: 1 addition & 1 deletion app-frontend/src/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="row">
<div class="pull-right col-md-4">
<button type="button" class="btn btn-block btn-primary" uib-tooltip="Redirects all regular HTTP requests to HTTPS"
ng-click="onForceSslClicked()" ng-disabled="!captaininfo.hasRootSsl">Force HTTPS</button>
ng-click="onForceSslClicked()" ng-disabled="!captaininfo.hasRootSsl || captaininfo.forceSsl">Force HTTPS</button>
</div>
</div>
</div>
Expand Down

0 comments on commit efc4384

Please sign in to comment.