diff --git a/ui/.template-lintrc.js b/ui/.template-lintrc.js index a0c20fdc2ad5..fea180ebf444 100644 --- a/ui/.template-lintrc.js +++ b/ui/.template-lintrc.js @@ -34,5 +34,6 @@ module.exports = { // remove when moving from extending `recommended` to `octane` 'no-curly-component-invocation': true, + 'no-implicit-this': true, }, }; diff --git a/ui/app/templates/allocations/allocation/fs.hbs b/ui/app/templates/allocations/allocation/fs.hbs index 568087ca4407..d1c29f2a5d72 100644 --- a/ui/app/templates/allocations/allocation/fs.hbs +++ b/ui/app/templates/allocations/allocation/fs.hbs @@ -1,10 +1,10 @@ -{{title pathWithLeadingSlash " - Allocation " allocation.shortId " filesystem"}} - +{{title this.pathWithLeadingSlash " - Allocation " this.allocation.shortId " filesystem"}} + \ No newline at end of file + @model={{this.allocation}} + @path={{this.path}} + @stat={{this.stat}} + @isFile={{this.isFile}} + @directoryEntries={{this.directoryEntries}} + @sortProperty={{this.sortProperty}} + @sortDescending={{this.sortDescending}} /> \ No newline at end of file diff --git a/ui/app/templates/allocations/allocation/index.hbs b/ui/app/templates/allocations/allocation/index.hbs index 8db6717c9755..11b9df8a945d 100644 --- a/ui/app/templates/allocations/allocation/index.hbs +++ b/ui/app/templates/allocations/allocation/index.hbs @@ -1,15 +1,15 @@ -{{title "Allocation " model.name}} - +{{title "Allocation " this.model.name}} +
- {{#if error}} + {{#if this.error}}
-

{{error.title}}

-

{{error.description}}

+

{{this.error.title}}

+

{{this.error.description}}

- +
@@ -17,13 +17,13 @@

- Allocation {{model.name}} - {{model.clientStatus}} + Allocation {{this.model.name}} + {{this.model.clientStatus}}
- {{#if model.isRunning}} + {{#if this.model.isRunning}}
- +
+ @awaitingConfirmation={{this.stopAllocation.isRunning}} + @disabled={{or this.stopAllocation.isRunning this.restartAllocation.isRunning}} + @onConfirm={{perform this.stopAllocation}} /> + @awaitingConfirmation={{this.restartAllocation.isRunning}} + @disabled={{or this.stopAllocation.isRunning this.restartAllocation.isRunning}} + @onConfirm={{perform this.restartAllocation}} /> {{/if}}

- {{model.id}} - + {{this.model.id}} +
Allocation Details Job - {{model.job.name}} + {{this.model.job.name}} Client - {{model.node.shortId}} + {{this.model.node.shortId}}
@@ -71,13 +71,13 @@ Resource Utilization
- {{#if model.isRunning}} + {{#if this.model.isRunning}}
- +
- +
{{else}} @@ -89,18 +89,18 @@
- +
Tasks
-
- {{#if sortedStates.length}} +
+ {{#if this.sortedStates.length}} @@ -129,13 +129,13 @@
- {{#if network.ports.length}} + {{#if this.network.ports.length}}
Ports
- + Name Dynamic? @@ -147,7 +147,7 @@ {{row.model.name}} {{if row.model.isDynamic "Yes" "No"}} - {{network.ip}}:{{row.model.port}} + {{this.network.ip}}:{{row.model.port}} {{row.model.to}} @@ -157,13 +157,13 @@
{{/if}} - {{#if services.length}} + {{#if this.services.length}}
Services
- + Name Port @@ -189,47 +189,47 @@
{{/if}} - {{#if model.hasRescheduleEvents}} + {{#if this.model.hasRescheduleEvents}}
Reschedule Events
- +
{{/if}} - {{#if model.wasPreempted}} + {{#if this.model.wasPreempted}}
Preempted By
- {{#if preempter}} + {{#if this.preempter}}
- - {{preempter.clientStatus}} + + {{this.preempter.clientStatus}} - {{preempter.name}} - {{preempter.shortId}} + {{this.preempter.name}} + {{this.preempter.shortId}} Job - {{preempter.job.name}} + {{this.preempter.job.name}} Priority - {{preempter.job.priority}} + {{this.preempter.job.priority}} Client - {{preempter.node.shortId}} + {{this.preempter.node.shortId}} Reserved CPU - {{preempter.resources.cpu}} MHz + {{this.preempter.resources.cpu}} MHz Reserved Memory - {{preempter.resources.memory}} MiB + {{this.preempter.resources.memory}} MiB
@@ -243,12 +243,12 @@
{{/if}} - {{#if (and model.preemptedAllocations.isFulfilled model.preemptedAllocations.length)}} + {{#if (and this.model.preemptedAllocations.isFulfilled this.model.preemptedAllocations.length)}}
Preempted Allocations
diff --git a/ui/app/templates/allocations/allocation/task/fs.hbs b/ui/app/templates/allocations/allocation/task/fs.hbs index 1c8d66dca1e2..945cfa4755fd 100644 --- a/ui/app/templates/allocations/allocation/task/fs.hbs +++ b/ui/app/templates/allocations/allocation/task/fs.hbs @@ -1,10 +1,10 @@ -{{title pathWithLeadingSlash " - Task " taskState.name " filesystem"}} - +{{title this.pathWithLeadingSlash " - Task " this.taskState.name " filesystem"}} + \ No newline at end of file + @model={{this.taskState}} + @path={{this.path}} + @stat={{this.stat}} + @isFile={{this.isFile}} + @directoryEntries={{this.directoryEntries}} + @sortProperty={{this.sortProperty}} + @sortDescending={{this.sortDescending}} /> \ No newline at end of file diff --git a/ui/app/templates/allocations/allocation/task/index.hbs b/ui/app/templates/allocations/allocation/task/index.hbs index 1278741044fb..f274e131268e 100644 --- a/ui/app/templates/allocations/allocation/task/index.hbs +++ b/ui/app/templates/allocations/allocation/task/index.hbs @@ -1,15 +1,15 @@ -{{title "Task " model.name}} - +{{title "Task " this.model.name}} +
- {{#if error}} + {{#if this.error}}
-

{{error.title}}

-

{{error.description}}

+

{{this.error.title}}

+

{{this.error.description}}

- +
@@ -17,20 +17,20 @@

- {{model.name}} - {{#if model.isConnectProxy}} + {{this.model.name}} + {{#if this.model.isConnectProxy}} {{/if}} - {{model.state}} + {{this.model.state}}
- {{#if model.isRunning}} + {{#if this.model.isRunning}}
+ @job={{this.model.task.taskGroup.job}} + @taskGroup={{this.model.task.taskGroup}} + @allocation={{this.model.allocation}} + @task={{this.model.task}} />
+ @awaitingConfirmation={{this.restartTask.isRunning}} + @disabled={{this.restartTask.isRunning}} + @onConfirm={{perform this.restartTask}} /> {{/if}}

@@ -51,21 +51,21 @@ Task Details Started At - {{format-ts model.startedAt}} + {{format-ts this.model.startedAt}} - {{#if model.finishedAt}} + {{#if this.model.finishedAt}} Finished At - {{format-ts model.finishedAt}} + {{format-ts this.model.finishedAt}} {{/if}} Driver - {{model.task.driver}} + {{this.model.task.driver}} Lifecycle - {{model.task.lifecycleName}} + {{this.model.task.lifecycleName}}
@@ -75,13 +75,13 @@ Resource Utilization
- {{#if model.isRunning}} + {{#if this.model.isRunning}}
- +
- +
{{else}} @@ -93,13 +93,13 @@
- {{#if (and (not model.task.lifecycle) prestartTaskStates)}} + {{#if (and (not this.model.task.lifecycle) this.prestartTaskStates)}}
Prestart Tasks
- + Task @@ -125,13 +125,13 @@
{{/if}} - {{#if network.ports.length}} + {{#if this.network.ports.length}}
Addresses
- + Dynamic? Name @@ -142,8 +142,8 @@ {{if row.model.isDynamic "Yes" "No"}} {{row.model.name}} - - {{network.ip}}:{{row.model.port}} + + {{this.network.ip}}:{{row.model.port}} @@ -153,13 +153,13 @@
{{/if}} - {{#if model.task.volumeMounts.length}} + {{#if this.model.task.volumeMounts.length}}
Volumes
- + Name Destination @@ -192,7 +192,7 @@ Recent Events
- + Time Type diff --git a/ui/app/templates/allocations/allocation/task/logs.hbs b/ui/app/templates/allocations/allocation/task/logs.hbs index 69132b20ccf6..0cd039a05b20 100644 --- a/ui/app/templates/allocations/allocation/task/logs.hbs +++ b/ui/app/templates/allocations/allocation/task/logs.hbs @@ -1,5 +1,5 @@ -{{title "Task " model.name " logs"}} - +{{title "Task " this.model.name " logs"}} +
- +
diff --git a/ui/app/templates/application.hbs b/ui/app/templates/application.hbs index c2ed3ae814a2..d2ed5fd6bd88 100644 --- a/ui/app/templates/application.hbs +++ b/ui/app/templates/application.hbs @@ -1,25 +1,25 @@ -{{title (if system.shouldShowRegions (concat system.activeRegion " - ")) "Nomad" separator=" - "}} +{{title (if this.system.shouldShowRegions (concat this.system.activeRegion " - ")) "Nomad" separator=" - "}} -{{#unless error}} +{{#unless this.error}} {{outlet}} {{else}}
- {{#if isNoLeader}} + {{#if this.isNoLeader}}

No Cluster Leader

The cluster has no leader. Read about Outage Recovery.

- {{else if is500}} + {{else if this.is500}}

Server Error

A server error prevented data from being sent to the client.

- {{else if is404}} + {{else if this.is404}}

Not Found

What you're looking for couldn't be found. It either doesn't exist or you are not authorized to see it.

- {{else if is403}} + {{else if this.is403}}

Not Authorized

- {{#if token.secret}} + {{#if this.token.secret}}

Your ACL token does not provide the required permissions. Contact your administrator if this is an error.

{{else}}

Provide an ACL token with requisite permissions to view this.

@@ -28,8 +28,8 @@

Error

Something went wrong.

{{/if}} - {{#if (eq config.environment "development")}} -
{{errorStr}}
+ {{#if (eq this.config.environment "development")}} +
{{this.errorStr}}
{{/if}}