Skip to content

Commit

Permalink
Merge pull request #571 from grycap/devel
Browse files Browse the repository at this point in the history
Implements #566
  • Loading branch information
micafer authored Sep 2, 2024
2 parents a54b846 + b0c38de commit eeac635
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Create the `config.json` file (see the [example](app/config-sample.json)) settin
| IM_URL | Infrastructure Manager service URL | Y | N/A |
| IM_TIMEOUT | Infrastructure Manager service calls timeout | N | 60 |
| SUPPORT_EMAIL | Email address that will be shown in case of errors | N | "" |
| SUPPORT_LINK | Link that will be shown in case of errors | N | "" |
| SUPPORT_LINK_NAME | Text Link that that will be shown in case of errors | N | "" |
| EXTERNAL_LINKS | List of dictionaries ({ "url": "example.com" , "menu_item_name": "Example link"}) specifying links that will be shown under the "External Links" menu | N | [] |
| LOG_LEVEL | Set Logging level | N | info |
| DB_URL | URL to the DB to store dashboard data | N | sqlite:///creds.db |
Expand Down
4 changes: 3 additions & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,9 @@ def page_not_found(error):
@app.errorhandler(500)
def internal_server_error(error):
app.logger.error('Server Error: %s', (error))
return render_template('error_pages/500.html', support_email=app.config.get('SUPPORT_EMAIL')), 500
return render_template('error_pages/500.html', support_email=app.config.get('SUPPORT_EMAIL'),
support_link=app.config.get('SUPPORT_LINK'),
support_link_name=app.config.get('SUPPORT_LINK_NAME')), 500

@app.errorhandler(CSRFError)
def handle_csrf_error(e):
Expand Down
4 changes: 3 additions & 1 deletion app/templates/error_pages/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ <h2>500 Internal Server Error</h2>
<div class="card-body">
<div class="alert alert-danger">
Sorry, something went wrong..Please, try again.
Contact the support {%if support_email %}({{ support_email }}){%endif %} if the error persists.
{%if support_email %} Contact the support ({{ support_email }}) if the error persists.
{%elif support_link %} Contact the support (<a href="{{ support_link }}" target="_blank">{{ support_link_name }}</a>) if the error persists
{% endif %}
</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions app/templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<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-2" style="color:white;"></i></a>
<a href="https://github.com/grycap/im-dashboard/issues" target="_blank" alt="Report Bug" title="Report Bug">
<i class="fa fa-bug 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-2" style="color:white;"></i></a>
<a href="https://imdocs.readthedocs.io" target="_blank" alt="Documentation" title="Documentation">
Expand Down

0 comments on commit eeac635

Please sign in to comment.