Skip to content

Commit

Permalink
Merge pull request #1736 from priyaganti/issue#1579-rockonSwitchWitho…
Browse files Browse the repository at this point in the history
…utConfig

display config modal when rockon is not configured but switch is turned on. fixes #1579
  • Loading branch information
schakrava authored Jun 24, 2017
2 parents 40e6bf2 + df4a66f commit 746dd47
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 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
17 changes: 13 additions & 4 deletions src/rockstor/storageadmin/static/storageadmin/js/views/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,22 @@ ServicesView = Backbone.View.extend({
},

switchStatus: function(event, state) {

console.log("the event is: " + event + " The state is: " + 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 (this.configurable_services.indexOf(serviceName) > -1 && !serviceModel.get('config') && state) {
app_router.navigate('services/' + serviceName + '/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 746dd47

Please sign in to comment.