Skip to content

Commit

Permalink
Fix EGI logo (#49)
Browse files Browse the repository at this point in the history
* Fix EGI logo

Point to the proper location

* Add pylint config

* Fix linting issues

* Do not depend on external images

* Move to rc style config
  • Loading branch information
enolfc authored Jun 7, 2024
1 parent e576e02 commit 4a4f50d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
19 changes: 19 additions & 0 deletions .github/linters/.python-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[MAIN]
jobs = 0

[MESSAGES CONTROL]
# add import-error to the default list
# generated with:
# $ pylint --disable=import-error --generate-rcfile
#
disable=raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
use-implicit-booleaness-not-comparison-to-string,
use-implicit-booleaness-not-comparison-to-zero,
import-error
18 changes: 11 additions & 7 deletions dashboard/dashy_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from pathlib import Path
from urllib import parse

import defusedxml.ElementTree as ElementTree
import requests
import yaml
from defusedxml import ElementTree

DEFAULT_ICON = (
"https://github.com/openstack/openstackdocstheme/blob/master"
Expand Down Expand Up @@ -91,6 +91,9 @@ def find_endpoints(service_type, production=True, monitored=True):


def main():
"""
Main function, generates config
"""
dashy_conf = {
"pageInfo": {
"title": "EGI Cloud Compute",
Expand All @@ -101,7 +104,7 @@ def main():
"path": DOCS_URL,
}
],
"logo": "https://egi-api.nois3.net/app/uploads/2021/11/egi-logo.svg",
"logo": "egi-logo.svg",
},
"appConfig": {
"theme": "material",
Expand All @@ -128,18 +131,19 @@ def main():
items.append(
{
"title": s[0],
"description": "%s (%s)" % (s[3], s[4]),
"icon": DEFAULT_ICON,
"description": f"{s[3]} ({s[4]})",
"icon": "openstack.ico",
"url": s[2],
"target": "newtab",
}
)
print(yaml.dump(dashy_conf))
with open(DASHY_OUTOUT, "w") as f:
with open(DASHY_OUTOUT, "w", encoding="utf-8") as f:
yaml.dump(dashy_conf, f)
except Exception:
# catching anything, we don't need to be specific
except Exception: # pylint: disable=broad-exception-caught
if Path(DASHY_OUTOUT).is_file():
with open(DASHY_OUTOUT) as f:
with open(DASHY_OUTOUT, "r", encoding="utf-8") as f:
print(yaml.dump(yaml.safe_load(f)))
else:
# to-do: write in dashy_conf: "site not available at the moment"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ services:
- "traefik.http.routers.dashboard.tls.certresolver=myresolver"
volumes:
- "config:/app/public"
- "/fedcloud-dashboard/icons:/app/user-data/item-icons/"
deploy:
restart_policy:
condition: any
Expand Down
Loading

0 comments on commit 4a4f50d

Please sign in to comment.