SPW-DIG / metawal-core-geonetwork

Metawal - Catalogue pour l'information géographique de Wallonie
http://metawal.wallonie.be
GNU General Public License v2.0
3 stars 1 forks source link

UI / Dashboard sous forme d'onglet #593

Open fxprunayre opened 3 years ago

fxprunayre commented 3 years ago

Objectif

Ajouter un ou plusieurs onglet dans l'application correspondant à des dashboards dans Kibana

Proposal

GeoNetwork provides an API to configure pages (see https://geonetwork-opensource.org/manuals/4.0.x/eng/users/customizing-application/adding-static-pages.html#adding-static-pages)

image

This allows to add menu in header/top toolbar/footer. eg. https://nationaalgeoregister.nl/geonetwork/srv/dut/catalog.search#/page/Voor%20ontwikkelaars?page=Voor%20ontwikkelaars

image

This could be used to send a page using an Iframe to point to a Kibana dashboard.

It suppose that Kibana dashboard are public - so we need to setup Elasticsearch security. We will probably not managed privileges in that setup (needs investigation - the easiest to start with is probably to make a public aliases for use in Kibana public dashboard).

Tasks

Optional:

Doc

Creating an HTML page pointing to a dashboard

<div>
  <h1>Statistics</h1>
  <iframe src="http://localhost:5601/app/dashboards?auth_provider_hint=anonymous1#/view/853fef90-8dce-11e9-9bb7-5db216293bad?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15y,to:now))&_a=(description:'Dashboard%20showing%20the%20main%20statistics%20about%20the%20catalog',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!f),query:(language:kuery,query:''),tags:!(),timeRestore:!f,title:Overview,viewMode:view)&embed="
          style="border: none;width: 100%; height: 80vh;"
  />
</div>

Load the page using the API:


TOKEN=cca14447-217f-49fe-97be-c5d47da22fca
SESSION=node018tpappsmidre189yacl0a71nz5.node0

curl -X DELETE "http://localhost:8080/geonetwork/srv/api/pages/fre/dashboard?format=HTML" -H "X-XSRF-TOKEN: $TOKEN" \
-H "Cookie: XSRF-TOKEN=$TOKEN; JSESSIONID=$SESSION;"

curl -X POST "http://localhost:8080/geonetwork/srv/api/pages/?language=fre&pageId=dashboard&format=HTML" \
-H "Content-Type: multipart/form-data" \
-H "X-XSRF-TOKEN: $TOKEN" \
-H "Cookie: XSRF-TOKEN=$TOKEN; JSESSIONID=$SESSION;" \
-F "data=@593.html"

curl -X POST "http://localhost:8080/geonetwork/srv/api/pages/fre/dashboard/TOP" -H "X-XSRF-TOKEN: $TOKEN" \
-H "Cookie: XSRF-TOKEN=$TOKEN; JSESSIONID=$SESSION;" 

curl -X PUT "http://localhost:8080/geonetwork/srv/api/pages/fre/dashboard/PUBLIC" -H "X-XSRF-TOKEN: $TOKEN" \
-H "Cookie: XSRF-TOKEN=$TOKEN; JSESSIONID=$SESSION;" 

Kibana looks to have issue to authenticate user (needs investigation). Using auth_provider_hint allows to pass authentication form. embed allow to hide header.

davinciagf commented 3 years ago

Testé avec succès Screen Shot 2021-05-26 at 15 03 42

vbombaerts commented 2 years ago

@vbombaerts - créer un dashboard qui reprend des statistiques sur le contenu de MW : nbre de fiches publiées, évolution temporelle, répartition par gestionnaire, etc.

vbombaerts commented 2 years ago

Une première réponse avec les webcomponents de type tableau, qui permettent d'afficher des fiches lignes par lignes, mais pas de faire des tableaux agrégés.