Skip to content

Commit

Permalink
Merge pull request #492 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer authored Jan 3, 2024
2 parents 8a6c509 + 5bedb12 commit cab71c0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
15 changes: 13 additions & 2 deletions app/templates/service_creds.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ <h5 class="modal-title">Vault Info</h5>
<div class="modal-body">
</div>
<div class="modal-footer">
<a class="btn btn-secondary canceltBtn" role="button" data-bs-dismiss="modal">Cancel</a>
<button type="submit" class="btn btn-success updatetBtn">Update</button>
<button class="btn btn-secondary cancelVaultBtn" role="button" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-success submitBtn">Update</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -224,6 +224,17 @@ <h5 class="modal-title">Vault Info</h5>
});
});

$(document).ready(function () {
$("#vaultForm").submit(function () {
//disable button on click
$(".submitBtn").attr("disabled", true);
$(".cancelVaultBtn").attr("disabled", true);
// add spinner to button
$(".submitBtn").html( `<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Updating...` );
return true;
});
});

</script>
{% endblock %}

6 changes: 3 additions & 3 deletions app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ def _addTabs(tabs, toscaInfo, tosca):
toscaInfo[tosca]['inputs'][input_name]["pattern"] = input_params["pattern"]


def _addAddons(toscaInfo, toscaTemplates, toscaDir):
def _addAddons(toscaInfo, toscaDir):
# Add addons to description
for tosca in toscaTemplates:
for tosca in toscaInfo.keys():
if "childs" in toscaInfo[tosca]["metadata"] and toscaInfo[tosca]["metadata"]["childs"]:
if 'addons' not in toscaInfo[tosca]['metadata']:
toscaInfo[tosca]['metadata']["addons"] = ""
Expand Down Expand Up @@ -407,7 +407,7 @@ def extractToscaInfo(toscaDir, toscaTemplates, tags_to_hide):
toscaInfoOrder = OrderedDict(sorted(toscaInfo.items(), key=lambda x: x[1]["metadata"]['order']))

# Add addons to description
_addAddons(toscaInfo, toscaTemplates, toscaDir)
_addAddons(toscaInfo, toscaDir)

return toscaInfoOrder

Expand Down

0 comments on commit cab71c0

Please sign in to comment.