From 79f71f8e8a5571e6fd3602c5975f71ca9836a0a6 Mon Sep 17 00:00:00 2001 From: Denis Gukov Date: Mon, 9 Dec 2024 17:21:26 +0500 Subject: [PATCH] feat(tf): ui for state --- api/projects/terraform_inventory.go | 2 +- web/src/components/TerraformStateView.vue | 12 ++++ web/src/views/project/Inventory.vue | 1 + .../template/TemplateTerraformState.vue | 58 +++++++++++++++++-- 4 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 web/src/components/TerraformStateView.vue diff --git a/api/projects/terraform_inventory.go b/api/projects/terraform_inventory.go index d4c3aaa0..29b576e0 100644 --- a/api/projects/terraform_inventory.go +++ b/api/projects/terraform_inventory.go @@ -28,7 +28,7 @@ func SetTerraformInventoryAliasAccessKey(w http.ResponseWriter, r *http.Request) } func GetTerraformInventoryStates(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusNotFound) + helpers.WriteJSON(w, http.StatusOK, []string{}) } func AddTerraformInventoryState(w http.ResponseWriter, r *http.Request) { diff --git a/web/src/components/TerraformStateView.vue b/web/src/components/TerraformStateView.vue new file mode 100644 index 00000000..ed759079 --- /dev/null +++ b/web/src/components/TerraformStateView.vue @@ -0,0 +1,12 @@ + + + diff --git a/web/src/views/project/Inventory.vue b/web/src/views/project/Inventory.vue index a9e7b427..7aef7b71 100644 --- a/web/src/views/project/Inventory.vue +++ b/web/src/views/project/Inventory.vue @@ -189,6 +189,7 @@ export default { sortable: false, }]; }, + getItemsUrl() { return `/api/project/${this.projectId}/inventory`; }, diff --git a/web/src/views/project/template/TemplateTerraformState.vue b/web/src/views/project/template/TemplateTerraformState.vue index 7b4a92f9..b7d8991c 100644 --- a/web/src/views/project/template/TemplateTerraformState.vue +++ b/web/src/views/project/template/TemplateTerraformState.vue @@ -12,17 +12,23 @@ class="ml-2" color="hsl(348deg, 86%, 61%)" href="https://semaphoreui.com/pro" - >Upgrade + >Upgrade +
{{ alias.url }} - + mdi-content-copy - + + mdi-pencil + + mdi-delete
@@ -32,6 +38,26 @@
+ + + + +