You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by ki...@apache.org on 2022/01/13 09:59:17 UTC

[jena] 07/07: Add header menu logo-link to home, and add buttons to the datasets view (PR feedback)

This is an automated email from the ASF dual-hosted git repository.

kinow pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit e3c3a7d2f17c3b433f420d77b3b61bffd50dc74d
Author: Bruno P. Kinoshita <ki...@apache.org>
AuthorDate: Mon Jan 10 19:50:25 2022 +1300

    Add header menu logo-link to home, and add buttons to the datasets view (PR feedback)
---
 jena-fuseki2/jena-fuseki-ui/src/assets/logo.png    | Bin 2469 -> 0 bytes
 jena-fuseki2/jena-fuseki-ui/src/assets/logo.svg    |  89 +++++++++++++++++++++
 .../jena-fuseki-ui/src/components/Menu.vue         |   4 +-
 jena-fuseki2/jena-fuseki-ui/src/styles/index.scss  |  11 +++
 jena-fuseki2/jena-fuseki-ui/src/views/Home.vue     |   3 +
 .../jena-fuseki-ui/src/views/dataset/Info.vue      |  24 +++---
 .../src/views/manage/ExistingDatasets.vue          |  12 ++-
 .../jena-fuseki-ui/src/views/manage/NewDataset.vue |   8 +-
 8 files changed, 132 insertions(+), 19 deletions(-)

diff --git a/jena-fuseki2/jena-fuseki-ui/src/assets/logo.png b/jena-fuseki2/jena-fuseki-ui/src/assets/logo.png
deleted file mode 100644
index 2990c2d..0000000
Binary files a/jena-fuseki2/jena-fuseki-ui/src/assets/logo.png and /dev/null differ
diff --git a/jena-fuseki2/jena-fuseki-ui/src/assets/logo.svg b/jena-fuseki2/jena-fuseki-ui/src/assets/logo.svg
new file mode 100644
index 0000000..6bd7b8c
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-ui/src/assets/logo.svg
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   version="1.1"
+   width="90.929314"
+   height="89.5625"
+   id="svg2"
+   inkscape:version="0.48.2 r9819"
+   sodipodi:docname="jena-icon.svg">
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1920"
+     inkscape:window-height="1118"
+     id="namedview13"
+     showgrid="false"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0"
+     inkscape:zoom="1.7940591"
+     inkscape:cx="67.179959"
+     inkscape:cy="-38.036736"
+     inkscape:window-x="0"
+     inkscape:window-y="30"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg2" />
+  <defs
+     id="defs4">
+    <clipPath
+       id="clipPath3020">
+      <path
+         d="m 0,0 1507,0 0,888.648 -1507,0 L 0,0 z"
+         id="path3022"
+         inkscape:connector-curvature="0" />
+    </clipPath>
+  </defs>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     transform="translate(-304.86728,-220.21538)">
+    <g
+       transform="matrix(0.125,0,0,-0.125,319.59883,347.90268)"
+       id="g3016">
+      <g
+         transform="translate(-117.85113,132.85037)"
+         id="g3102">
+        <g
+           id="g3049">
+          <path
+             d="m 246.496,333.113 c 0,38.629 -5.566,55.996 -35.07,72.699 -28.895,16.333 -173.0862,68.79 -195.4533,95.008 -39.543,46.371 1.1796,108.598 47.7343,104.625 24.6836,-2.117 40.863,-16.386 55.895,-31.507 11.964,-12.043 73.73,-82.422 92.918,-101.004 15.21,-14.707 32.753,-22.657 54.562,-25.879 20.793,-3.075 38.547,1.566 53.887,11.125 25.656,16.011 44.543,45.8 59.531,76.234 17,34.516 44.031,55.356 75.84,52.816 53.41,-4.269 73.262,-56.058 58.613,-94.82 -5.898,-15.586 -31.367,-38.773  [...]
+             id="path3032"
+             style="fill:#231f20;fill-opacity:1;fill-rule:nonzero;stroke:none"
+             inkscape:connector-curvature="0" />
+          <path
+             d="m 480.93,727.688 c 0,-38.633 5.57,-56.004 35.062,-72.688 28.91,-16.328 173.102,-68.793 195.469,-95.016 39.543,-46.367 -1.188,-108.593 -47.746,-104.629 -24.688,2.122 -40.863,16.399 -55.887,31.52 -11.969,12.031 -73.73,82.418 -92.91,100.992 -15.219,14.711 -32.77,22.66 -54.57,25.871 -20.793,3.086 -38.551,-1.554 -53.891,-11.117 -25.656,-16.016 -44.543,-45.801 -59.527,-76.223 -16.992,-34.527 -44.028,-55.359 -75.836,-52.82 -53.414,4.258 -73.266,56.051 -58.614,94.824 5.903,15.578 [...]
+             id="path3076"
+             style="fill:#1a80b9;fill-opacity:1;fill-rule:nonzero;stroke:none"
+             inkscape:connector-curvature="0" />
+        </g>
+      </g>
+    </g>
+  </g>
+</svg>
diff --git a/jena-fuseki2/jena-fuseki-ui/src/components/Menu.vue b/jena-fuseki2/jena-fuseki-ui/src/components/Menu.vue
index 316d913..34f3212 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/components/Menu.vue
+++ b/jena-fuseki2/jena-fuseki-ui/src/components/Menu.vue
@@ -20,7 +20,9 @@
     <b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
     <b-collapse id="nav-collapse" is-nav>
       <b-navbar-brand>
-        <img alt="Apache Jena logo" src="../assets/logo.png">
+        <router-link to="/">
+          <img alt="Apache Jena logo" width="52px" src="../assets/logo.svg"> Apache Jena Fuseki
+        </router-link>
       </b-navbar-brand>
       <b-navbar-nav>
         <b-nav-item to="/" exact-active-class="active">
diff --git a/jena-fuseki2/jena-fuseki-ui/src/styles/index.scss b/jena-fuseki2/jena-fuseki-ui/src/styles/index.scss
index 913f184..59741d8 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/styles/index.scss
+++ b/jena-fuseki2/jena-fuseki-ui/src/styles/index.scss
@@ -20,6 +20,17 @@
 @import 'upload.scss';
 
 #app {
+  .navbar {
+    .navbar-brand {
+      a {
+        color: $gray-600;
+        &:hover {
+          color: $gray-800;
+          text-decoration: none;
+        }
+      }
+    }
+  }
   #status-icon {
     width: 2em;
     height: 2em;
diff --git a/jena-fuseki2/jena-fuseki-ui/src/views/Home.vue b/jena-fuseki2/jena-fuseki-ui/src/views/Home.vue
index b3f6bc2..b8b419f 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/views/Home.vue
+++ b/jena-fuseki2/jena-fuseki-ui/src/views/Home.vue
@@ -30,6 +30,9 @@
       :items="items"
       :is-busy="isBusy"
     >
+      <template v-slot:empty>
+        <h4>No datasets created - <router-link to="/manage/new">add one</router-link></h4>
+      </template>
       <template v-slot:cell(actions)="data">
         <b-button
           :to="`/dataset${data.item.name}/query`"
diff --git a/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Info.vue b/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Info.vue
index df2dc64..2daed94 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Info.vue
+++ b/jena-fuseki2/jena-fuseki-ui/src/views/dataset/Info.vue
@@ -29,17 +29,19 @@
               <b-row>
                 <b-col sm="12" md="6">
                   <h3 class="text-center">Available Services</h3>
-                  <b-row
+                  <div
                     :key="service['srv.type']"
                     v-for="service in this.services"
                   >
-                    <b-col cols="6" class="text-right">{{ service['srv.description'] }}</b-col>
-                    <b-col cols="6">
-                      <a :href="`/${datasetName}/${service['srv.endpoints'][0]}`">
-                        /{{ datasetName }}/{{ service['srv.endpoints'][0] }}
-                      </a>
-                    </b-col>
-                  </b-row>
+                    <b-row v-for="endpoint of service['srv.endpoints']" :key="endpoint">
+                      <b-col cols="6" class="text-right">{{ service['srv.description'] }}</b-col>
+                      <b-col cols="6">
+                        <a :href="`/${datasetName}/${endpoint}`">
+                          /{{ datasetName }}/{{ endpoint }}
+                        </a>
+                      </b-col>
+                    </b-row>
+                  </div>
                   <b-row class="my-4">
                     <b-col cols="12" align="center">
                       <h3 class="text-center">Dataset size</h3>
@@ -240,11 +242,7 @@ export default {
       // collect the stats of each endpoint
       const items = Object.keys(endpoints)
         .map(endpointName => {
-          // TODO: probably better to change in the server side as "Graph Store Protocol" is returned twice,
-          //       but one entry is already distinguished by a "(Read)" suffix.
-          const endpoint = endpoints[endpointName].description.trim() === 'SPARQL Query'
-            ? `${endpoints[endpointName].description} (${endpointName})`
-            : endpoints[endpointName].description
+          const endpoint = !endpointName.startsWith('_') ? `${endpoints[endpointName].description} (${endpointName})` : endpoints[endpointName].description
           return {
             endpoint: endpoint,
             operation: endpoints[endpointName].operation,
diff --git a/jena-fuseki2/jena-fuseki-ui/src/views/manage/ExistingDatasets.vue b/jena-fuseki2/jena-fuseki-ui/src/views/manage/ExistingDatasets.vue
index 612de1c..f0901d5 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/views/manage/ExistingDatasets.vue
+++ b/jena-fuseki2/jena-fuseki-ui/src/views/manage/ExistingDatasets.vue
@@ -33,6 +33,9 @@
                     :items="items"
                     :is-busy="isBusy"
                   >
+                    <template v-slot:empty>
+                      <h4>No datasets created - <router-link to="/manage/new">add one</router-link></h4>
+                    </template>
                     <template v-slot:cell(actions)="data">
                       <b-button
                         :to="`/dataset${data.item.name}/query`"
@@ -116,10 +119,17 @@
                       <b-button
                         :to="`/dataset${data.item.name}/upload`"
                         variant="primary"
-                        class="mr-0 mb-md-0 d-block d-md-inline-block">
+                        class="mr-0 mr-md-2 mr-0 mb-2 mb-md-0 d-block d-md-inline-block">
                         <FontAwesomeIcon icon="upload" />
                         <span class="ml-1">add data</span>
                       </b-button>
+                      <b-button
+                        :to="`/dataset${data.item.name}/info`"
+                        variant="primary"
+                        class="mr-0 mb-md-0 d-block d-md-inline-block">
+                        <FontAwesomeIcon icon="tachometer-alt" />
+                        <span class="ml-1">info</span>
+                      </b-button>
                     </template>
                   </table-listing>
                 </b-col>
diff --git a/jena-fuseki2/jena-fuseki-ui/src/views/manage/NewDataset.vue b/jena-fuseki2/jena-fuseki-ui/src/views/manage/NewDataset.vue
index 86a3ae6..e627d47 100644
--- a/jena-fuseki2/jena-fuseki-ui/src/views/manage/NewDataset.vue
+++ b/jena-fuseki2/jena-fuseki-ui/src/views/manage/NewDataset.vue
@@ -116,10 +116,10 @@ export default {
           item: 'mem',
           name: 'In-memory – dataset will be recreated when Fuseki restarts, but contents will be lost'
         },
-        {
-          item: 'tdb',
-          name: 'Persistent – dataset will persist across Fuseki restart'
-        },
+        // {
+        //   item: 'tdb',
+        //   name: 'Persistent – dataset will persist across Fuseki restart'
+        // },
         {
           item: 'tdb2',
           name: 'Persistent (TDB2) – dataset will persist across Fuseki restarts'