* Finish task #106115.
This commit is contained in:
@@ -39,7 +39,16 @@ window.renderDTableCell = function(result, {row, col})
|
||||
});
|
||||
|
||||
|
||||
var html = `<span class="cell-ellipsis" style="width: ${cellWidth[col.name] - 24}px;" title="${row.data[col.name]}">${row.data[col.name]}</span>`;
|
||||
if(Array.isArray(row.data[col.name]))
|
||||
{
|
||||
var value = row.data[col.name][0];
|
||||
var title = updateTimeTip.replace('%s', row.data[col.name][1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
var title = value = row.data[col.name];
|
||||
}
|
||||
var html = `<span class="cell-ellipsis" style="width: ${cellWidth[col.name] - 24}px;" title="${title}">${value}</span>`;
|
||||
result[0] = {html: html};
|
||||
|
||||
return result;
|
||||
|
||||
@@ -112,6 +112,7 @@ $lang->metric->saveSqlMeasSuccess = "Query success,result is:%s";
|
||||
$lang->metric->monthText = "%s day";
|
||||
$lang->metric->errorDateRange = "The start date cannot be longer than the end date";
|
||||
$lang->metric->errorCalcTimeRange = "The start time of collection cannot be later than the end time of collection";
|
||||
$lang->metric->updateTimeTip = "Update snapshot time:%s";
|
||||
|
||||
$lang->metric->noDesc = "No description available";
|
||||
$lang->metric->noFormula = "No calculation rules available";
|
||||
|
||||
@@ -112,6 +112,7 @@ $lang->metric->saveSqlMeasSuccess = "Query success,result is:%s";
|
||||
$lang->metric->monthText = "%s day";
|
||||
$lang->metric->errorDateRange = "The start date cannot be longer than the end date";
|
||||
$lang->metric->errorCalcTimeRange = "The start time of collection cannot be later than the end time of collection";
|
||||
$lang->metric->updateTimeTip = "Update snapshot time:%s";
|
||||
|
||||
$lang->metric->noDesc = "No description available";
|
||||
$lang->metric->noFormula = "No calculation rules available";
|
||||
|
||||
@@ -112,6 +112,7 @@ $lang->metric->saveSqlMeasSuccess = "Query success,result is:%s";
|
||||
$lang->metric->monthText = "%s day";
|
||||
$lang->metric->errorDateRange = "The start date cannot be longer than the end date";
|
||||
$lang->metric->errorCalcTimeRange = "The start time of collection cannot be later than the end time of collection";
|
||||
$lang->metric->updateTimeTip = "Update snapshot time:%s";
|
||||
|
||||
$lang->metric->noDesc = "No description available";
|
||||
$lang->metric->noFormula = "No calculation rules available";
|
||||
|
||||
@@ -112,6 +112,7 @@ $lang->metric->saveSqlMeasSuccess = "查询成功,测试结果:%s";
|
||||
$lang->metric->monthText = "%s号";
|
||||
$lang->metric->errorDateRange = "开始日期不能大于结束日期";
|
||||
$lang->metric->errorCalcTimeRange = "采集开始时间不能大于采集结束时间";
|
||||
$lang->metric->updateTimeTip = "更新快照时间:%s";
|
||||
|
||||
$lang->metric->noDesc = "暂无描述";
|
||||
$lang->metric->noFormula = "暂无计算规则";
|
||||
|
||||
@@ -9,6 +9,7 @@ declare(strict_types=1);
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
jsVar('updateTimeTip', $lang->metric->updateTimeTip);
|
||||
|
||||
$metricID = $metric->id;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ declare(strict_types=1);
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
jsVar('updateTimeTip', $lang->metric->updateTimeTip);
|
||||
|
||||
div
|
||||
(
|
||||
|
||||
@@ -10,8 +10,7 @@ declare(strict_types=1);
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
jsVar('resultHeader', isset($resultHeader) ? $resultHeader : array());
|
||||
jsVar('resultData', isset($resultData) ? $resultData : array());
|
||||
jsVar('updateTimeTip', $lang->metric->updateTimeTip);
|
||||
jsVar('objectList', $lang->metric->objectList);
|
||||
jsVar('current', $current);
|
||||
jsVar('maxSelectNum', $config->metric->maxSelectNum);
|
||||
|
||||
@@ -527,17 +527,18 @@ class metricZen extends metric
|
||||
return ($dateA > $dateB) ? -1 : 1;
|
||||
});
|
||||
|
||||
$times = array();
|
||||
$objects = array();
|
||||
$times = array();
|
||||
$objects = array();
|
||||
foreach($data as $dataInfo)
|
||||
{
|
||||
$time = substr($dataInfo->$dateField, 0, 10);
|
||||
$time = substr($dataInfo->$dateField, 0, 10);
|
||||
$calcTime = $dataInfo->calcTime;
|
||||
$object = $dataInfo->scope;
|
||||
$value = $dataInfo->value;
|
||||
|
||||
if(!isset($times[$time])) $times[$time] = $time;
|
||||
if(!isset($times[$time])) $times[$time] = $time;
|
||||
if(!isset($objects[$object])) $objects[$object] = array();
|
||||
$objects[$object][$time] = $value;
|
||||
$objects[$object][$time] = array($value, $calcTime);
|
||||
}
|
||||
/* e.g $times = array('2023-10-14', '2023-10-15'), $objects = array('object1' => array('2023-10-14' => 2, '2023-10-15 => 3)) */
|
||||
|
||||
@@ -630,7 +631,7 @@ class metricZen extends metric
|
||||
$groupHeader[] = array('name' => $name, 'title' => $day, 'headerGroup' => $year, 'align' => 'center');
|
||||
}
|
||||
|
||||
$groupData[0][$name] = $dataInfo->value;
|
||||
$groupData[0][$name] = array($dataInfo->value, $dataInfo->calcTime);
|
||||
}
|
||||
|
||||
return array($groupHeader, $groupData);
|
||||
|
||||
Reference in New Issue
Block a user