Skip to content

Commit

Permalink
also shorten target in job-panel title, closes #541
Browse files Browse the repository at this point in the history
  • Loading branch information
Erwin Dondorp committed Sep 7, 2023
1 parent 2ab2285 commit af5a39e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
12 changes: 7 additions & 5 deletions saltgui/static/scripts/output/Output.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ export class Output {

// the orchestrator for the output
// determines what format should be used and uses that
static addResponseOutput (pOutputContainer, pJobId, pMinionData, pResponse, pCommand, pInitialStatus, pHighlightMinionId, pArguments) {
static addResponseOutput (pOutputContainer, pJobId, pMinionData, pResponse, pCommand, pInitialStatus, pHighlightMinionId, pExtraInfo) {

// remove old content
pOutputContainer.innerText = "";
Expand Down Expand Up @@ -737,10 +737,12 @@ export class Output {
topSummaryDiv.appendChild(summaryJobsListJobSpan);
}

if (pArguments) {
const div = Utils.createDiv("", pArguments);
div.style.lineBreak = "anywhere";
pOutputContainer.appendChild(div);
if (pExtraInfo) {
for (const str of pExtraInfo) {
const div = Utils.createDiv("", str);
div.style.lineBreak = "anywhere";
pOutputContainer.appendChild(div);
}
}

const masterTriangle = Utils.createSpan();
Expand Down
22 changes: 15 additions & 7 deletions saltgui/static/scripts/panels/Job.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,24 @@ export class JobPanel extends Panel {
// ============================

const maxTextLength = 50;
let displayArguments = null;
const extraInfo = [];

if (argumentsText.length > maxTextLength) {
// prevent column becoming too wide
displayArguments = this.commandtext;
// prevent title becoming too wide
// save info for display in actual output box
extraInfo.push(this.commandtext);
argumentsText = argumentsText.substring(0, maxTextLength) + Character.HORIZONTAL_ELLIPSIS;
}

const functionText = info.Function + argumentsText + " on " +
TargetType.makeTargetText(info);
this.updateTitle(functionText);
let targetText = "on " + TargetType.makeTargetText(info);
if (targetText.length > maxTextLength) {
// prevent title becoming too wide
// save info for display in actual output box
extraInfo.push(targetText);
targetText = targetText.substring(0, maxTextLength) + Character.HORIZONTAL_ELLIPSIS;
}

this.updateTitle(info.Function + argumentsText + " " + targetText);

Output.dateTimeStr(info.StartTime, this.timeField, "bottom-left");

Expand Down Expand Up @@ -237,7 +245,7 @@ export class JobPanel extends Panel {
initialStatus = "(loading)";
this.jobIsTerminated = false;
}
Output.addResponseOutput(this.output, pJobId, minions, info.Result, info.Function, initialStatus, pMinionId, displayArguments);
Output.addResponseOutput(this.output, pJobId, minions, info.Result, info.Function, initialStatus, pMinionId, extraInfo);

// replace any jobid
// Don't do this with output.innerHTML as there are already
Expand Down

0 comments on commit af5a39e

Please sign in to comment.