|
@@ -1744,13 +1744,13 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
|
|
|
|
|
|
restartComponents: function(e) {
|
|
|
var commandName = "stop_component";
|
|
|
- if(e.context) {
|
|
|
- if(this.get('content.healthStatus') != 'green'){
|
|
|
+ if (e.context) {
|
|
|
+ if (!this.get('content.hostComponents').filterProperty('staleConfigs').findProperty('workStatus', 'STARTED')) {
|
|
|
return;
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
commandName = "start_component";
|
|
|
- if(this.get('content.healthStatus') != 'red'){
|
|
|
+ if (!this.get('content.hostComponents').filterProperty('staleConfigs').findProperty('workStatus', 'INSTALLED')) {
|
|
|
return;
|
|
|
}
|
|
|
};
|
|
@@ -1764,16 +1764,31 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
|
|
|
onPrimary: function () {
|
|
|
var selectedService = this.content.get('content.id');
|
|
|
var hostComponents = App.HostComponent.find().filterProperty('service.id', selectedService).filterProperty('staleConfigs', true)
|
|
|
- hostComponents.forEach(function(item){
|
|
|
- var componentName = item.get('componentName');
|
|
|
- var hostName = item.get('host.hostName');
|
|
|
+ hostComponents.forEach(function (item) {
|
|
|
+ var state = 'INSTALLED',
|
|
|
+ componentName = item.get('componentName'),
|
|
|
+ context = "Stop " + App.format.role(componentName),
|
|
|
+ hostName = item.get('host.hostName');
|
|
|
+
|
|
|
+ if (commandName === 'start_component') {
|
|
|
+ context = "Start " + App.format.role(componentName);
|
|
|
+ state = 'STARTED';
|
|
|
+ if (item.get('isClient')) {
|
|
|
+ //start components action includes install of clients
|
|
|
+ context = "Install " + App.format.role(componentName);
|
|
|
+ state = "INSTALLED";
|
|
|
+ }
|
|
|
+ } else if (item.get('isClient')) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
App.ajax.send({
|
|
|
- name: 'config.stale.'+commandName,
|
|
|
+ name: 'host.host_component.action',
|
|
|
sender: this,
|
|
|
data: {
|
|
|
hostName: hostName,
|
|
|
componentName: componentName,
|
|
|
- displayName: App.format.role(componentName)
|
|
|
+ context: context,
|
|
|
+ state: state
|
|
|
}
|
|
|
});
|
|
|
})
|