Skip to content

Commit

Permalink
Job load added to webview
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmccartney committed Nov 12, 2023
1 parent 234f92f commit ced4869
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
13 changes: 8 additions & 5 deletions public/html/jobs.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<th scope="col">Job ID</th>
<th scope="col">Type</th>
<th scope="col">Started</th>
<th scope="col">Load</th>
<th scope="col">Progress</th>
<th scope="col">Thumbnail</th>
<th scope="col">
Expand Down Expand Up @@ -123,16 +124,17 @@
const cell6 = await row.insertCell(5);
const cell7 = await row.insertCell(6);
const cell8 = await row.insertCell(7);
const cell9 = await row.insertCell(8);

// Add some text to the new cells:
cell1.innerHTML = job?.jobNumber || "-";
cell2.innerHTML = job?.jobName || "-";
cell3.innerHTML = job?.jobId || "-";

for (let tag of job?.type) {
if (tag === "encode") {
if (tag === "file") {
cell4.innerHTML += `<span class="badge badge-pill bg-danger">${tag}</span>`;
} else if (tag === "decode") {
} else if (tag === "bars") {
cell4.innerHTML += `<span class="badge badge-pill bg-success">${tag}</span>`;
} else if (tag === "decklink") {
cell4.innerHTML += `<span class="badge badge-pill bg-warning">${tag}</span>`;
Expand All @@ -142,13 +144,14 @@
}

cell5.innerHTML = job?.started || "-";
cell6.innerHTML = job?.progress
cell6.innerHTML = `${Math.round(job?.load?.cpu * 100)}%`;
cell7.innerHTML = job?.progress
? `<div class="progress">
<div class="progress-bar bg-success progress-bar-striped progress-bar-animated" role="progressbar" style="width: 25%" aria-valuenow="${job?.progress}" aria-valuemin="0" aria-valuemax="100"></div>${job?.progress}%
</div>`
: "-";
cell7.innerHTML = `<a href="/api/system/job/thumbnail/${jobId}"><img src="/api/system/job/thumbnail/${jobId}?cahce=${Math.random()}" alt="No Image" class="img-thumbnail"></a>`;
cell8.innerHTML = `<button onclick="killJob('${jobId}')" type="button" class="btn btn-danger">Kill</button>`;
cell8.innerHTML = `<a href="/api/system/job/thumbnail/${jobId}"><img src="/api/system/job/thumbnail/${jobId}?cahce=${Math.random()}" alt="No Image" class="img-thumbnail"></a>`;
cell9.innerHTML = `<button onclick="killJob('${jobId}')" type="button" class="btn btn-danger">Kill</button>`;
}
}

Expand Down
1 change: 0 additions & 1 deletion services/system-job-getall.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const jobManager = require("@utils/jobManager");
module.exports = async () => {
try {
const jobs = await jobManager.getAll();
console.log(jobs);
return { jobs: jobs };
} catch (error) {
logger.warn(error.message);
Expand Down
1 change: 0 additions & 1 deletion utils/ffconcat.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ const add = async (playlist="playlist",item) => {
}

const items = await parse(data);
console.log(item)
const setData = await set(playlist,items);

return {data:{raw:data,items:items}}
Expand Down
11 changes: 3 additions & 8 deletions utils/file-exists.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const fs = require('fs')
const fs = require("fs");
const path = require("path");
const logger = require("@utils/logger")(module);

Expand All @@ -11,13 +11,8 @@ module.exports = async (relativePath) => {
return true;
}
return false;
} catch(error) {
} catch (error) {
logger.warn(error);
return false;
}
}
};





0 comments on commit ced4869

Please sign in to comment.