Skip to content

Commit

Permalink
Unified variable names to el
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneTR committed Oct 30, 2023
1 parent f68cb05 commit 226e6f5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions frontend/js/energy-timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ $(document).ready(function () {
{ data: 4, title: 'Filename'},
{ data: 6, title: 'Machine'},
{ data: 7, title: 'Schedule Mode'},
{ data: 8, title: 'Last Scheduled', render: (data) => data == null ? '-' : dateToYMD(new Date(data)) },
{ data: 9, title: 'Created At', render: (data) => data == null ? '-' : dateToYMD(new Date(data)) },
{ data: 10, title: 'Updated At', render: (data) => data == null ? '-' : dateToYMD(new Date(data)) },
{ data: 8, title: 'Last Scheduled', render: (el) => el == null ? '-' : dateToYMD(new Date(el)) },
{ data: 9, title: 'Created At', render: (el) => el == null ? '-' : dateToYMD(new Date(el)) },
{ data: 10, title: 'Updated At', render: (el) => el == null ? '-' : dateToYMD(new Date(el)) },
{
data: 0,
title: 'Timeline Link',
Expand Down
24 changes: 12 additions & 12 deletions frontend/js/helpers/runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ const getRunsTable = (el, url, include_uri=true, include_button=true, searching=
{
data: 1,
title: 'Name',
render: function(name, type, row) {
render: function(el, type, row) {

if(row[9] == null) name = `${name} (in progress 🔥)`;
if(row[5] != null) name = `${name} <span class="ui yellow horizontal label" title="${row[5]}">invalidated</span>`;
return `<a href="/stats.html?id=${row[0]}" target="_blank">${name}</a>`
if(row[9] == null) el = `${el} (in progress 🔥)`;
if(row[5] != null) el = `${el} <span class="ui yellow horizontal label" title="${row[5]}">invalidated</span>`;
return `<a href="/stats.html?id=${row[0]}" target="_blank">${el}</a>`
},
},
]
Expand All @@ -108,11 +108,11 @@ const getRunsTable = (el, url, include_uri=true, include_button=true, searching=
columns.push({
data: 2,
title: '(<i class="icon code github"></i> / <i class="icon code gitlab"></i> / <i class="icon code folder"></i> etc.) Repo',
render: function(uri, type, row) {
let uri_link = replaceRepoIcon(uri);
render: function(el, type, row) {
let uri_link = replaceRepoIcon(el);

if (uri.startsWith("http")) {
uri_link = `${uri_link} <a href="${uri}"><i class="icon external alternate"></i></a>`;
uri_link = `${uri_link} <a href="${el}"><i class="icon external alternate"></i></a>`;
}
return uri_link
},
Expand All @@ -124,24 +124,24 @@ const getRunsTable = (el, url, include_uri=true, include_button=true, searching=
columns.push({
data: 8,
title: '<i class="icon history"></i>Commit</th>',
render: function(commit, type, row) {
render: function(el, type, row) {
// Modify the content of the "Name" column here
return commit == null ? null : `${commit.substr(0,3)}...${commit.substr(-3,3)}`
return el == null ? null : `${el.substr(0,3)}...${el.substr(-3,3)}`
},
});

columns.push({ data: 6, title: '<i class="icon file alternate"></i>Filename', });
columns.push({ data: 7, title: '<i class="icon laptop code"></i>Machine</th>' });
columns.push({ data: 4, title: '<i class="icon calendar"></i>Last run</th>', render: (data) => data == null ? '-' : dateToYMD(new Date(data)) });
columns.push({ data: 4, title: '<i class="icon calendar"></i>Last run</th>', render: (el) => el == null ? '-' : dateToYMD(new Date(el)) });

const button_title = include_button ? '<button id="compare-button" onclick="compareButton()" class="ui small button blue right">Compare: 0 Run(s)</button>' : '';

columns.push({
data: 0,
title: button_title,
render: function(id, type, row) {
render: function(el, type, row) {
// Modify the content of the "Name" column here
return `<input type="checkbox" value="${id}" name="chbx-proj"/>&nbsp;`
return `<input type="checkbox" value="${el}" name="chbx-proj"/>&nbsp;`
}
});

Expand Down
20 changes: 10 additions & 10 deletions frontend/js/hog-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,33 +186,33 @@ $(document).ready(function () {
data: 1,
title: 'Energy Impact',
className: "dt-body-right",
render: function(data, type, row) {
render: function(el, type, row) {
if (type === 'display' || type === 'filter') {
return (data.toLocaleString())
return (el.toLocaleString())
}
return data;
return el;
}
},
{
data: 2,
title: 'Mb Read',
className: "dt-body-right",
render: function(data, type, row) {
render: function(el, type, row) {
if (type === 'display' || type === 'filter') {
return Math.trunc(data / 1048576).toLocaleString();
return Math.trunc(el / 1048576).toLocaleString();
}
return data;
return el;
}
},
{
data: 3,
title: 'Mb Written',
className: "dt-body-right",
render: function(data, type, row) {
render: function(el, type, row) {
if (type === 'display' || type === 'filter') {
return Math.trunc(data / 1048576).toLocaleString();
return Math.trunc(el / 1048576).toLocaleString();
}
return data;
return el;
}
},
{ data: 4, title: 'Intr Wakeups',className: "dt-body-right"},
Expand All @@ -222,7 +222,7 @@ $(document).ready(function () {
{
data: null,
title: '',
render: function(data, type, row) {
render: function(el, type, row) {
return `<button class="ui icon button js-task-info" data-name="${row[0]}" data-start="${firstValue[6]}" data-end="${lastValue[6]}"><i class="info icon"></i></button>`;
},
orderable: false,
Expand Down
6 changes: 3 additions & 3 deletions frontend/js/hog.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ $(document).ready(function () {
data: 1,
title: 'Energy Impact',
className: "dt-body-right",
render: function(data, type, row) {
render: function(el, type, row) {
if (type === 'display' || type === 'filter') {
return (data.toLocaleString())
return (el.toLocaleString())
}
return data;
return el;
}
},
],
Expand Down

0 comments on commit 226e6f5

Please sign in to comment.