open-nomad/ui/app/components/variable-paths.hbs
Phil Renaud 4a8463595b Secure Variables: show file metadata on list pages (#13423)
* Add modified times and namespaces to layout

* Undo typing change

* Post-hoc accounting for new variable path routing
2022-07-11 13:34:06 -04:00

51 lines
1.3 KiB
Handlebars

<ListTable class="path-tree" @source={{@branch}} as |t|>
<t.head>
<th>
Path
</th>
<th>
Namespace
</th>
<th>
Last Modified
</th>
</t.head>
<tbody>
{{#each this.folders as |folder|}}
<tr data-test-folder-row {{on "click" (fn this.handleFolderClick folder.data.absolutePath)}}>
<td colspan="3">
<span>
<FlightIcon @name="folder" />
<LinkTo @route="variables.path" @model={{folder.data.absolutePath}}>
{{trim-path folder.name}}
</LinkTo>
</span>
</td>
</tr>
{{/each}}
{{#each this.files as |file|}}
<tr data-test-file-row {{on "click" (fn this.handleFileClick file.absoluteFilePath)}}>
<td>
<FlightIcon @name="file-text" />
<LinkTo
@route="variables.variable"
@model={{file.absoluteFilePath}}
>
{{file.name}}
</LinkTo>
</td>
<td>
{{file.variable.namespace}}
</td>
<td>
<span class="tooltip" aria-label="{{format-ts file.variable.modifyTime}}">
{{moment-from-now file.variable.modifyTime}}
</span>
</td>
</tr>
{{/each}}
</tbody>
</ListTable>