Merge remote-tracking branch 'origin/develop' into ent-7074-Command-Center
This commit is contained in:
commit
edb2dfb2fc
|
@ -667,57 +667,9 @@ class DiscoveryTaskList extends HTML
|
|||
$data[4] = '-';
|
||||
}
|
||||
|
||||
$can_be_reviewed = false;
|
||||
if (empty($task['summary']) === false
|
||||
&& $task['summary'] == 'cancelled'
|
||||
) {
|
||||
$data[5] = __('Cancelled').ui_print_help_tip(
|
||||
__('Server has been restarted while executing this task, please retry.'),
|
||||
true
|
||||
);
|
||||
} else if ($task['review_mode'] == DISCOVERY_STANDARD) {
|
||||
if ($task['type'] == DISCOVERY_APP_VMWARE) {
|
||||
if ($task['status'] <= 0 && $task['utimestamp'] != 0) {
|
||||
$data[5] = __('Done');
|
||||
} else if ($task['status'] > 0) {
|
||||
$data[5] = __('Pending');
|
||||
} else {
|
||||
$data[5] = __('Not started');
|
||||
}
|
||||
} else {
|
||||
if ($task['status'] <= 0
|
||||
&& empty($task['summary']) === false
|
||||
) {
|
||||
$data[5] = __('Done');
|
||||
} else if ($task['utimestamp'] == 0
|
||||
&& empty($task['summary'])
|
||||
) {
|
||||
$data[5] = __('Not started');
|
||||
} else {
|
||||
$data[5] = __('Pending');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($task['status'] <= 0
|
||||
&& empty($task['summary']) === false
|
||||
&& (int) $task['type'] === DISCOVERY_HOSTDEVICES
|
||||
) {
|
||||
$can_be_reviewed = true;
|
||||
$data[5] = '<span class="link review" onclick="show_review('.$task['id_rt'].',\''.$task['name'].'\')">';
|
||||
$data[5] .= __('Review');
|
||||
$data[5] .= '</span>';
|
||||
} else if ($task['utimestamp'] == 0
|
||||
&& empty($task['summary'])
|
||||
) {
|
||||
$data[5] = __('Not started');
|
||||
} else {
|
||||
if ($task['review_mode'] == DISCOVERY_RESULTS) {
|
||||
$data[5] = __('Processing');
|
||||
} else {
|
||||
$data[5] = __('Searching');
|
||||
}
|
||||
}
|
||||
}
|
||||
$_rs = $this->getStatusMessage($task);
|
||||
$can_be_reviewed = $_rs['can_be_reviewed'];
|
||||
$data[5] = $_rs['message'];
|
||||
|
||||
switch ($task['type']) {
|
||||
case DISCOVERY_CLOUD_AZURE_COMPUTE:
|
||||
|
@ -1763,4 +1715,65 @@ class DiscoveryTaskList extends HTML
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates task status string for given task.
|
||||
*
|
||||
* @param array $task Discovery task (retrieved from DB).
|
||||
*
|
||||
* @return array Message to be displayed and review status.
|
||||
*/
|
||||
public function getStatusMessage(array $task)
|
||||
{
|
||||
$status = '';
|
||||
$can_be_reviewed = false;
|
||||
|
||||
if (empty($task['summary']) === false
|
||||
&& $task['summary'] == 'cancelled'
|
||||
) {
|
||||
$status = __('Cancelled').ui_print_help_tip(
|
||||
__('Server has been restarted while executing this task, please retry.'),
|
||||
true
|
||||
);
|
||||
} else if ($task['review_mode'] == DISCOVERY_STANDARD) {
|
||||
if ($task['status'] <= 0
|
||||
&& empty($task['summary']) === false
|
||||
) {
|
||||
$status = __('Done');
|
||||
} else if ($task['utimestamp'] == 0
|
||||
&& empty($task['summary'])
|
||||
) {
|
||||
$status = __('Not started');
|
||||
} else if ($task['utimestamp'] > 0) {
|
||||
$status = __('Done');
|
||||
} else {
|
||||
$status = __('Pending');
|
||||
}
|
||||
} else {
|
||||
if ($task['status'] <= 0
|
||||
&& empty($task['summary']) === false
|
||||
) {
|
||||
$can_be_reviewed = true;
|
||||
$status = '<span class="link review" onclick="show_review('.$task['id_rt'].',\''.$task['name'].'\')">';
|
||||
$status .= __('Review');
|
||||
$status .= '</span>';
|
||||
} else if ($task['utimestamp'] == 0
|
||||
&& empty($task['summary'])
|
||||
) {
|
||||
$status = __('Not started');
|
||||
} else {
|
||||
if ($task['review_mode'] == DISCOVERY_RESULTS) {
|
||||
$status = __('Processing');
|
||||
} else {
|
||||
$status = __('Searching');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'message' => $status,
|
||||
'can_be_reviewed' => $can_be_reviewed,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1775,7 +1775,7 @@ table.databox {
|
|||
padding: 9px 7px;
|
||||
font-weight: normal;
|
||||
color: #fff;
|
||||
text-align: justify;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.databox > th * {
|
||||
|
|
|
@ -190,7 +190,7 @@ if (!empty($result_groups)) {
|
|||
|
||||
echo '<tr>';
|
||||
echo "<th class='w26px'>".__('Force').'</th>';
|
||||
echo "<th width='30%' class='mw60px'>".__('Group').'/'.__('Tags').'</th>';
|
||||
echo "<th width='30%' class='mw60px' style='text-align: justify'>".__('Group').'/'.__('Tags').'</th>';
|
||||
echo "<th width='10%' class='mw60px center'>".__('Total').'</th>';
|
||||
echo "<th width='10%' class='mw60px center'>".__('Unknown').'</th>';
|
||||
echo "<th width='10%' class='mw60px center'>".__('Not init').'</th>';
|
||||
|
@ -319,7 +319,7 @@ if (!empty($result_groups)) {
|
|||
$link = "<a class='group_view_data $color_class bolder font_18px center'
|
||||
href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_'].'&status='.AGENT_STATUS_UNKNOWN."'>";
|
||||
} else {
|
||||
$link = "<a class='group_view_data $color_class bolder font_18x center'
|
||||
$link = "<a class='group_view_data $color_class bolder font_18px center'
|
||||
href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_'].'&status='.AGENT_STATUS_UNKNOWN."'>";
|
||||
}
|
||||
|
||||
|
@ -336,7 +336,7 @@ if (!empty($result_groups)) {
|
|||
// Agents not init
|
||||
echo "<td class='group_view_data group_view_data_unk $color_class bolder font_18px center'>";
|
||||
if (isset($data['_is_tag_'])) {
|
||||
$link = "<a class='group_view_data $color_class bolder ont_18px center'
|
||||
$link = "<a class='group_view_data $color_class bolder font_18px center'
|
||||
href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_'].'&status='.AGENT_STATUS_NOT_INIT."'>";
|
||||
} else {
|
||||
$link = "<a class='group_view_data $color_class bolder font_18px center'
|
||||
|
@ -359,7 +359,7 @@ if (!empty($result_groups)) {
|
|||
$link = "<a class='group_view_data $color_class bolder font_18px center'
|
||||
href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_'].'&status='.AGENT_STATUS_NORMAL."'>";
|
||||
} else {
|
||||
$link = "<a class='group_view_data $color_class bolder ont_18px center'
|
||||
$link = "<a class='group_view_data $color_class bolder font_18px center'
|
||||
href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_'].'&status='.AGENT_STATUS_NORMAL."'>";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue