Skip to content

Commit

Permalink
show config form modal when rockon switch is turned on without config…
Browse files Browse the repository at this point in the history
…uring rockon share. fixes #1579
  • Loading branch information
priyaganti committed Jun 20, 2017
1 parent deb916f commit 231a5e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ To alert on temperature changes: <br> <strong>DEVICESCAN -W 4,35,40</strong> <br
jqxhr.done(function() {
enableButton(button);
$('#services_modal').modal('hide');
app_router.navigate('/services', {
trigger: true
});
});

jqxhr.fail(function(xhr, status, error) {
Expand Down
14 changes: 11 additions & 3 deletions src/rockstor/storageadmin/static/storageadmin/js/views/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,19 @@ ServicesView = Backbone.View.extend({
switchStatus: function(event, state) {

var serviceName = $(event.target).attr('data-service-name');
if (state) {
this.startService(serviceName);
var serviceModel = this.collection.get(serviceName); // extract the service model from the collection to obtain config property
if(!serviceModel.get('config')){
app_router.navigate('services/docker/edit', {
trigger: true
});
} else {
this.stopService(serviceName);
if (state) {
this.startService(serviceName);
} else {
this.stopService(serviceName);
}
}

},

startService: function(serviceName) {
Expand Down

0 comments on commit 231a5e1

Please sign in to comment.