From fe9e4532d85abf6770f810ed8dbfd94fae294c64 Mon Sep 17 00:00:00 2001 From: Giovani Avelar <7998054+geovannyAvelar@users.noreply.github.com> Date: Fri, 2 Sep 2022 16:20:45 -0300 Subject: [PATCH] [ui] Show a different message when there are no tasks in a job (#14071) Different mesage when there are not tasks in a job --- .changelog/14071.txt | 3 +++ ui/app/controllers/exec.js | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changelog/14071.txt diff --git a/.changelog/14071.txt b/.changelog/14071.txt new file mode 100644 index 000000000..b4f729dcf --- /dev/null +++ b/.changelog/14071.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: Display different message when trying to exec into a job with no task running. +``` diff --git a/ui/app/controllers/exec.js b/ui/app/controllers/exec.js index 1738300d8..0049cc1e2 100644 --- a/ui/app/controllers/exec.js +++ b/ui/app/controllers/exec.js @@ -47,7 +47,12 @@ export default class ExecController extends Controller { window.execTerminal = this.terminal; // Issue to improve: https://github.com/hashicorp/nomad/issues/7457 this.terminal.write(ANSI_UI_GRAY_400); - this.terminal.writeln('Select a task to start your session.'); + + if (this.sortedTaskGroups.length > 0) { + this.terminal.writeln('Select a task to start your session.'); + } else { + this.terminal.writeln(`There are no tasks running for this job.`); + } } @alias('model.allocations') allocations;