Example #1
0
 createTask: function (_task) {
   return Em.Object.create({
     id: _task.Tasks.id,
     hostName: _task.Tasks.host_name,
     command: ( _task.Tasks.command.toLowerCase() != 'service_check') ? _task.Tasks.command.toLowerCase() : '',
     commandDetail: App.format.commandDetail(_task.Tasks.command_detail),
     status: App.format.taskStatus(_task.Tasks.status),
     role: App.format.role(_task.Tasks.role),
     outputLog: Em.I18n.t('common.hostLog.popup.logDir.path') + Em.I18n.t('common.hostLog.popup.outputLog.value').format(_task.Tasks.id),
     errorLog: Em.I18n.t('common.hostLog.popup.logDir.path') + Em.I18n.t('common.hostLog.popup.errorLog.value').format(_task.Tasks.id),
     stderr: _task.Tasks.stderr,
     stdout: _task.Tasks.stdout,
     isVisible: true,
     startTime: date.startTime(_task.Tasks.start_time),
     duration: date.durationSummary(_task.Tasks.start_time, _task.Tasks.end_time),
     icon: function () {
       var statusIconMap = {
         'pending': 'icon-cog',
         'queued': 'icon-cog',
         'in_progress': 'icon-cogs',
         'completed': 'icon-ok',
         'failed': 'icon-exclamation-sign',
         'aborted': 'icon-minus',
         'timedout': 'icon-time'
       };
       return statusIconMap[this.get('status')] || 'icon-cog';
     }.property('status')
   });
 },
Example #2
0
 newHostInfo.logTasks.forEach(function (_task) {
   var existTask = existTasks.findProperty('id', _task.Tasks.id);
   if (existTask) {
     existTask.set('status', App.format.taskStatus(_task.Tasks.status));
     existTask.set('stdout', _task.Tasks.stdout);
     existTask.set('stderr', _task.Tasks.stderr);
     existTask.set('startTime', date.startTime(_task.Tasks.start_time));
     existTask.set('duration', date.durationSummary(_task.Tasks.start_time, _task.Tasks.end_time));
   } else {
     existTasks.pushObject(this.createTask(_task));
   }
 }, this);
Example #3
0
 this.get("inputData").forEach(function (service) {
   var status = statuses[service.status] || pendingStatus;
   var newService = Ember.Object.create({
     id: service.id,
     displayName: service.displayName,
     progress: service.progress,
     status: App.format.taskStatus(status[0]),
     isRunning: service.isRunning,
     name: service.name,
     isVisible: true,
     startTime: date.startTime(service.startTime),
     duration: date.durationSummary(service.startTime, service.endTime),
     icon: status[1],
     barColor: status[2],
     isInProgress: status[3],
     barWidth: "width:" + service.progress + "%;",
     sourceRequestScheduleId: service.get('sourceRequestScheduleId'),
     contextCommand: service.get('contextCommand')
   });
   allNewServices.push(newService);
 });