v1.1.57: fix scenario editor body bug + relativeTime columns + infra UUIDs
- scenario-form.js: fix ReferenceError body is not defined in renderEditor() - utils.js: relativeTime(iso) → 3ч 12м / 2д 5ч / только что - instances.js: columns created / modified with relativeTime() - index.html: instanceUid under displayName in infra column
This commit is contained in:
@@ -43,3 +43,18 @@ function toggleLog(){
|
||||
if(el.style.display==='none'){ el.style.display='block'; startLogPoll(); }
|
||||
else el.style.display='none';
|
||||
}
|
||||
|
||||
function relativeTime(iso) {
|
||||
if (!iso) return '-';
|
||||
const d = new Date(iso);
|
||||
if (isNaN(d.getTime())) return '-';
|
||||
const sec = Math.floor((Date.now() - d.getTime()) / 1000);
|
||||
if (sec < 0) return 'только что';
|
||||
if (sec < 60) return sec + 'с';
|
||||
const min = Math.floor(sec / 60);
|
||||
if (min < 60) return min + 'м';
|
||||
const hr = Math.floor(min / 60);
|
||||
if (hr < 24) return hr + 'ч ' + (min % 60) + 'м';
|
||||
const days = Math.floor(hr / 24);
|
||||
return days + 'д ' + (hr % 24) + 'ч';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user