Skip to content

Commit

Permalink
Merge pull request #564 from grycap/egi_brand_v2
Browse files Browse the repository at this point in the history
Egi brand v2
  • Loading branch information
micafer authored Jul 19, 2024
2 parents 5f238f2 + 88144b9 commit 132ddc0
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from app.ott import OneTimeTokenData
from app import utils, appdb, db
from app.vault_info import VaultInfo
from oauthlib.oauth2.rfc6749.errors import InvalidTokenError, TokenExpiredError, InvalidGrantError
from oauthlib.oauth2.rfc6749.errors import InvalidTokenError, TokenExpiredError, InvalidGrantError, MissingTokenError
from werkzeug.exceptions import Forbidden
from flask import Flask, json, render_template, request, redirect, url_for, flash, session, g, make_response
from markupsafe import Markup
Expand Down Expand Up @@ -139,7 +139,7 @@ def decorated_function(*args, **kwargs):
if oidc_blueprint.session.token['expires_in'] < 20:
app.logger.debug("Force refresh token")
oidc_blueprint.session.get(settings.oidcUserInfoPath)
except (InvalidTokenError, TokenExpiredError, InvalidGrantError):
except (InvalidTokenError, TokenExpiredError, InvalidGrantError, MissingTokenError):
flash("Token expired.", 'warning')
return logout(next_url=request.full_path)

Expand Down
12 changes: 6 additions & 6 deletions app/cred.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ def validate_cred(self, userid, new_cred):
return 1, "Credentials already available."

if new_cred["type"] in no_host_types:
return 2, ("There is already a " + new_cred["type"] + " Credentials " +
" It may cause problems authenticating with the Provider." +
" Please disable/remove one of the Credentials.")
return 2, ("There is already a set of" + new_cred["type"] + " credentials. " +
" This may cause problems authenticating with the Cloud provider." +
" Please disable/remove one of the credentials.")
elif new_cred["type"] not in ['EGI', 'OpenStack', 'fedcloud']: # these types has no problem
if new_cred["host"] and cred["host"] == new_cred["host"]:
return 2, ("This site has already a Credential with same site URL." +
" It may cause problems authenticating with the Site." +
" Please disable/remove one of the Credentials.")
return 2, ("This site has already a Credential with the same site URL." +
" This may cause problems authenticating with the site." +
" Please disable/remove one of the credentials.")

return 0, ""
1 change: 0 additions & 1 deletion app/oaipmh/oai.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# under the License.
from lxml import etree # nosec
from datetime import datetime, timezone
from urllib.parse import urlparse
from app.oaipmh.errors import Errors


Expand Down
Binary file added app/static/images/dtgeo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/nomad_ai4eosc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/images/nomad_ai4eosc_join.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/templates/config_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% else %}
<li class="nav-item"><a class="nav-link" data-id="#InputValues" data-bs-toggle="tab" href=#InputValues>Input Values</a></li>
{% endif %}
<li class="nav-item"><a class="nav-link {% if not creds %} active{%endif%}" data-id="#Advanced" data-bs-toggle="tab" href=#Advanced>Cloud Provider Selection</a></li> <!-- always create advanced tab -->
<li class="nav-item"><a class="nav-link {% if not creds %} active{%endif%}" data-id="#Advanced" data-bs-toggle="tab" href=#Advanced>Cloud Provider</a></li> <!-- always create advanced tab -->
</ul>
<!-- end tab creation section -->

Expand Down
2 changes: 1 addition & 1 deletion app/templates/default_form.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- start tabs creation section -->
<ul class="nav nav-tabs">
<li class="nav-item"><a class="nav-link {% if creds %}active{%endif%}" data-id="#InputValues" data-bs-toggle="tab" href="#InputValues">Input Values</a></li>
<li class="nav-item"><a class="nav-link {% if not creds %}active{%endif%}" data-id="#Advanced" data-bs-toggle="tab" href="#Advanced">Cloud Provider Selection</a></li>
<li class="nav-item"><a class="nav-link {% if not creds %}active{%endif%}" data-id="#Advanced" data-bs-toggle="tab" href="#Advanced">Cloud Provider</a></li>
</ul>
<!-- end tab creation section -->
<div class="tab-content">
Expand Down
9 changes: 8 additions & 1 deletion app/templates/infrastructures.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
function setInfrState(infid, data) {
// Set state
var state = getSpanFromState(data["state"]) ;
state += '<strong>' + data["state"] + '&nbsp;</strong>';
if (data["state"] == "running") {
state += '<strong>configuring&nbsp;</strong>';
} else {
state += '<strong>' + data["state"] + '&nbsp;</strong>';
}
state += '<div style="display: none;" id="' + infid + '_state_spinner" class="spinner-border spinner-border-sm"></div>';
state += '</span>';
$('#' + infid + '_state').html(state);
Expand All @@ -27,6 +31,9 @@
var vms = '';
var delete_vms = '';
$.each( data["vm_states"], function( vmId, vmState ) {
if (vmState == "running") {
vmState = "configuring";
}
var tooltip = getSpanFromState(vmState) + vmState + '</span>';
vms += '<a class="btn btn-outline-secondary btn-sm" role="button" href="{{ url_for('showvminfo') }}?infId=' + infid + '&vmId=' + vmId + '" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-html="true" data-bs-title="' + tooltip + '">';
vms += '<span class="fas fa-server mr-2"></span> ' + vmId + '</a>';
Expand Down
4 changes: 2 additions & 2 deletions app/templates/service_creds.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ <h4 class="font-weight-bold text-primary">Cloud Credentials</h4>
{% if 'vo' in cred %}
<br><strong>VO: </strong> {{cred["vo"]}}
{% if session['vos'] and cred['vo'] not in session['vos'] %}
<i class='fas fa-exclamation-triangle text-warning' title="VO currently not available for the user!. It may cause errors in the Cloud Provider Selection list."></i>
<i class='fas fa-exclamation-triangle text-warning' title="VO currently not available for the user!. It may cause errors in the Cloud Provider list."></i>
{% endif %}
{% if 'project_id' not in cred %}
<i class='fas fa-exclamation-triangle text-danger' title="Site does not publish this VO on AppDB!. It may cause errors in the Cloud Provider Selection list."></i>
<i class='fas fa-exclamation-triangle text-danger' title="Site does not publish this VO on AppDB!. It may cause errors in the Cloud Provider list."></i>
{% endif %}
{% endif %}
{% if 'host' in cred and 'tenant' in cred %}
Expand Down
4 changes: 4 additions & 0 deletions app/templates/vminfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ <h4 class="font-weight-bold text-primary">VM ID {{ vmid }}:</h4>
{% else %}
<span class="badge bg-warning text-white"><span class="spinner-grow spinner-grow-sm"></span>
{% endif %}
{% if state == "running" %}
configuring
{% else %}
{{ state }}
{% endif %}
</td>
</tr>
<tr>
Expand Down

0 comments on commit 132ddc0

Please sign in to comment.