-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #306
- Loading branch information
Showing
67 changed files
with
4,406 additions
and
828 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
document.addEventListener('alpine:init', () => { | ||
Alpine.data('variable_set_workspaces', (existing = [], available = []) => ({ | ||
open: false, | ||
close(focusAfter) { | ||
if (! this.open) return | ||
this.open = false | ||
focusAfter && focusAfter.focus() | ||
}, | ||
search: '', | ||
existing: existing, | ||
available: available, | ||
get filterAvailable() { | ||
return this.available?.filter( | ||
i => i.Name.includes(this.search) | ||
).slice(0, 3) | ||
}, | ||
get showPanel() { | ||
return (this.open && this.filterAvailable?.length > 0) | ||
}, | ||
addWorkspace(workspace) { | ||
// move workspace from available to existing | ||
this.available = this.available.filter( | ||
i => i !== workspace | ||
) | ||
this.existing.push(workspace) | ||
// hide dropdown box | ||
this.close() | ||
}, | ||
deleteWorkspace(workspace) { | ||
// move workspace from existing to available | ||
this.existing = this.existing.filter( | ||
i => i !== workspace | ||
) | ||
this.available.push(workspace) | ||
}, | ||
})) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 12 additions & 32 deletions
44
internal/http/html/static/templates/content/variable_list.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,27 @@ | ||
{{ template "layout" . }} | ||
|
||
{{ define "content-header-title" }} | ||
{{ template "variables-breadcrumb" . }} | ||
{{ template "workspace-variables-breadcrumb" . }} | ||
{{ end }} | ||
|
||
{{ define "content-header-links" }} | ||
{{ template "workspace-header-links" . }} | ||
{{ end }} | ||
|
||
{{ define "content" }} | ||
<table class="table-fixed w-full text-left break-words border-collapse" id="variables-table"> | ||
<thead class="bg-gray-200 border-t border-b border-slate-900"> | ||
<tr> | ||
<th class="p-2 w-[25%]">Key</th> | ||
<th class="p-2 w-[50%]">Value</th> | ||
<th class="p-2 w-[15%]">Category</th> | ||
<th class="p-2 w-[10%]"></th> | ||
</tr> | ||
</thead> | ||
<tbody class="border-b border-slate-900"> | ||
{{ range .Variables }} | ||
<tr class="even:bg-gray-100"> | ||
<td class="p-2"><a class="show-underline" href="{{ editVariablePath .ID }}">{{ .Key }}</a></td> | ||
<td class="p-2">{{ if .Sensitive }}<span class="data">hidden</span>{{ else }}{{ .Value }}{{ end }}</td> | ||
<td class="p-2">{{ .Category }}</td> | ||
<td class="p-2 text-right"> | ||
{{ if $.CanDeleteVariable }} | ||
<form action="{{ deleteVariablePath .ID }}" method="POST"> | ||
<button id="delete-variable-button" class="btn-danger" onclick="return confirm('Are you sure you want to delete?')">Delete</button> | ||
</form> | ||
{{ end }} | ||
</td> | ||
</tr> | ||
{{ else }} | ||
<tr> | ||
<td>No variables currently exist.</td> | ||
</tr> | ||
{{ end }} | ||
</tbody> | ||
</table> | ||
<span class="text-lg my-2">Workspace Variables ({{ len .WorkspaceVariableTable.Variables }})</span> | ||
{{ template "variable-table" .WorkspaceVariableTable }} | ||
{{ if .CanCreateVariable }} | ||
<form action="{{ newVariablePath $.Workspace.ID }}" method="GET"> | ||
<form class="mt-2" action="{{ newVariablePath $.Workspace.ID }}" method="GET"> | ||
<button class="btn">Add variable</button> | ||
</form> | ||
{{ end }} | ||
<span class="text-lg mt-4">Variable Sets ({{ len .VariableSetTables }})</span> | ||
{{ range .VariableSetTables }} | ||
<div class="flex flex-col gap-2" id="variable-set-{{ .Name }}"> | ||
{{ template "variable-set-item" . }} | ||
{{ template "variable-table" . }} | ||
</div> | ||
<div class="my-2"></div> | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
internal/http/html/static/templates/content/variable_set_edit.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{ template "layout" . }} | ||
|
||
{{ define "content-header-title" }} | ||
<a href="{{ variableSetsPath .VariableSet.Organization }}">variable sets</a> / | ||
{{ .VariableSet.Name }} / | ||
edit | ||
{{ end }} | ||
|
||
{{ define "content" }} | ||
<span class="text-xl">Edit variable set</span> | ||
|
||
{{ template "variable-set-form" . }} | ||
|
||
<hr class="my-4"> | ||
|
||
<h3 class="text-xl">Variables</h3> | ||
{{ template "variable-table" .VariableTable }} | ||
<form class="mt-2" action="{{ newVariableSetVariablePath $.VariableSet.ID }}" method="GET"> | ||
<button class="btn" id="add-variable-button">Add variable</button> | ||
</form> | ||
{{ end }} |
15 changes: 15 additions & 0 deletions
15
internal/http/html/static/templates/content/variable_set_edit_variable.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{ template "layout" . }} | ||
|
||
{{ define "content-header-title" }} | ||
<a href="{{ variableSetsPath .VariableSet.Organization }}">variable sets</a> / | ||
<a href="{{ editVariableSetPath .VariableSet.ID }}">{{ .VariableSet.Name }}</a> / | ||
variables / | ||
{{ .Variable.ID }} / | ||
edit | ||
{{ end }} | ||
|
||
{{ define "content" }} | ||
Edit workspace variable. | ||
|
||
{{ template "variable-form" . }} | ||
{{ end }} |
Oops, something went wrong.