Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devel #521

Merged
merged 4 commits into from
Mar 12, 2024
Merged

Devel #521

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class Settings:
def __init__(self, config):
"""Creator function."""
self.version = "2.5.3"
self.version = "2.5.6"
self.toscaDir = config.get('TOSCA_TEMPLATES_DIR', '') + "/"
self.imUrl = config['IM_URL']
self.oidcName = config['OIDC_NAME']
Expand Down
6 changes: 5 additions & 1 deletion app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
<!-- Latest compiled and minified JavaScript -->
<script src="{{ url_for('static', filename='js/bootstrap-show-password.min.js') }}"></script>
{% endif %}
<style>
<style>
/* Make the navbar a bit transparent */
.navbar {
opacity: 0.95;
}
.cookieconsent-com---palette-dark .cc-nb-okagree {
background-color: #ffc107;
color: white;
Expand Down
12 changes: 5 additions & 7 deletions app/templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@
</div>
<div class="col-md-2 col-4 mt-2 ms-auto me-1 text-end" style="min-width:160px;">
<a href="https://github.com/grycap/" target="_blank" alt="Github" title="Github">
<i class="fab fa-github ms-1" style="color:white;"></i></a>
<a href="https://hub.docker.com/orgs/grycap" target="_blank" alt="DockerHub" title="DockerHub">
<i class="fab fa-docker ms-1" style="color:white;"></i></a>
<i class="fab fa-github ms-2" style="color:white;"></i></a>
<a href="https://www.researchgate.net/lab/GRyCAP-Ignacio-Blanquer" target="_blank" alt="ResearchGate" title="ResearchGate">
<i class="fab fa-researchgate ms-1" style="color:white;"></i></a>
<i class="fab fa-researchgate ms-2" style="color:white;"></i></a>
<a href="https://imdocs.readthedocs.io" target="_blank" alt="Documentation" title="Documentation">
<i class="fa fa-book ms-1" style="color:white;"></i></a>
<i class="fa fa-book ms-2" style="color:white;"></i></a>
<a href="{{ url_for('static', filename='terms.html') }}" target="_blank" alt="Terms of Service" title="Terms of Service">
<i class="fa fa-file-contract ms-1" style="color:white;"></i></a>
<i class="fa fa-file-contract ms-2" style="color:white;"></i></a>
<a href="{{ url_for('static', filename='privacy.html') }}" target="_blank" alt="Privacy Notice" title="Privacy Notice">
<i class="fa fa-user-secret ms-1" style="color:white;"></i></a>
<i class="fa fa-user-secret ms-2" style="color:white;"></i></a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/input_types.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="form-group">
<div>
{% if value.tag_type is not defined or value.tag_type not in ["hidden", "random"] %}
<label for="{{key}}" style="white-space: pre-wrap;">{% if value.description is defined %}{{value.description}}{% else %}{{key}}{% endif %}</label>
{% endif %}
Expand Down
36 changes: 26 additions & 10 deletions app/templates/list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="mt-1">
<div id="{{key}}-container"></div>
<button type="button" class="ms-2 btn btn-sm btn-outline-info" id="add-new-item-{{key}}" class="add-new" data-tag-name="{{key}}"><i class='fas fa-plus me-2'></i>Add</button>
<button type="button" class="ms-2 mt-2 btn btn-sm btn-outline-info" id="add-new-item-{{key}}" class="add-new" data-tag-name="{{key}}"><i class='fas fa-plus me-2'></i>Add</button>
<input id="id-{{key}}" type="hidden" data-output-type="json" name="{{key}}" value=""/>
</div>

Expand Down Expand Up @@ -45,12 +45,20 @@
// this can be done better
{% if value.type == "map" %}
input_template = `
<input type="text" class="me-1 col-5 form-control" name="${tagname}_list_value_${num__{{key}}}_range" class="form-control" pattern="([0-9]+:{0,1}[0-9]+)" required value="${range}" placeholder="Port Range">
<input type="text" class="me-1 col-6 form-control" name="${tagname}_list_value_${num__{{key}}}_cidr" class="form-control" pattern="(([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))){0,1}" value="${cidr}" placeholder="CIDR">`;
<div class="col col-md-5 ps-0">
<input type="text" class="form-control" name="${tagname}_list_value_${num__{{key}}}_range" class="form-control" pattern="([0-9]+:{0,1}[0-9]+)" required value="${range}" placeholder="Port Range">
</div>
<div class="col col-md-6 ps-0">
<input type="text" class="form-control" name="${tagname}_list_value_${num__{{key}}}_cidr" class="form-control" pattern="(([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))){0,1}" value="${cidr}" placeholder="CIDR">
</div>`;
{% else %}
input_template = `
<input type="text" class="me-1 col-5 form-control" name="${tagname}_list_value_${num__{{key}}}_target" class="form-control" pattern="([0-9]{1,5})" required value="${target}" placeholder="Target Port">
<input type="text" class="me-1 col-6 form-control" name="${tagname}_list_value_${num__{{key}}}_range" class="form-control" pattern="([0-9]{1,5})" value="${range}" placeholder="Source Port">`;
<div class="col col-md-5 ps-0">
<input type="text" class="form-control" name="${tagname}_list_value_${num__{{key}}}_target" class="form-control" pattern="([0-9]{1,5})" required value="${target}" placeholder="Target Port">
</div>
<div class="col col-md-6 ps-0">
<input type="text" class="form-control" name="${tagname}_list_value_${num__{{key}}}_range" class="form-control" pattern="([0-9]{1,5})" value="${range}" placeholder="Source Port">
</div>`;
{% endif %}

{% elif value.type == "map" %}
Expand All @@ -61,17 +69,25 @@
v = parts[1]
}
input_template = `
<input type="text" class="me-1 col-4 form-control" name="${tagname}_list_value_${num__{{key}}}_key" class="form-control" required value="${k}" placeholder="Key">
<input type="text" class="me-1 col-7 form-control" name="${tagname}_list_value_${num__{{key}}}_value" class="form-control" required pattern="${pattern}" value="${v}" placeholder="Value">`;
<div class="col col-md-4 ps-0">
<input type="text" class="form-control" name="${tagname}_list_value_${num__{{key}}}_key" class="form-control" required value="${k}" placeholder="Key">
</div>
<div class="col col-md-5 ps-0">
<input type="text" class="form-control" name="${tagname}_list_value_${num__{{key}}}_value" class="form-control" required pattern="${pattern}" value="${v}" placeholder="Value">
</div>`;
{% else %}
input_template = `
<input type="text" class="col-11 form-control" name="${tagname}_list_value_${num__{{key}}}" class="form-control" required pattern="${pattern}" value="${value}">`;
<div class="col col-md-11 ps-0">
<input type="text" class="form-control" name="${tagname}_list_value_${num__{{key}}}" class="form-control" required pattern="${pattern}" value="${value}">
</div>`;
{% endif %}

let template = `
<div class="form-group mt-1 mx-2 row" id="${tagname}-${num__{{key}}}">
<div class="mt-1 mx-2 row" id="${tagname}-${num__{{key}}}">
${input_template}
<button type=button class='btn btn-sm btn-outline-danger' href="" onclick="javascript:removeItem('${tagname}'+ '-' + ${num__{{key}}} + '' ); return false;"><i class='far fa-trash-alt m-1'></i></button>
<div class="col col-md-1 ps-0">
<button type=button class='btn btn-sm btn-outline-danger' href="" onclick="javascript:removeItem('${tagname}'+ '-' + ${num__{{key}}} + '' ); return false;"><i class='far fa-trash-alt' style='margin: 0.4rem !important;'></i></button>
</div>
</div>`;

let container = document.getElementById(tagname + '-container');
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@type": "SoftwareSourceCode",
"identifier": "im-dashboard",
"name": "Infrastructure Manager Dashboard",
"version": "2.5.3",
"version": "2.5.6",
"description": "Infrastructure Manager - Simple Graphical UI",
"license": "GNU General Public License v3.0",
"author": [
Expand Down