瀏覽代碼

fix: admin storage page display issues

Nicolas Giard 2 年之前
父節點
當前提交
c9fc4a1611

+ 0 - 1
server/graph/resolvers/authentication.js

@@ -12,7 +12,6 @@ module.exports = {
      */
     async apiKeys (obj, args, context) {
       const keys = await WIKI.models.apiKeys.query().orderBy(['isRevoked', 'name'])
-      console.info(keys)
       return keys.map(k => ({
         id: k.id,
         name: k.name,

+ 2 - 2
server/graph/resolvers/storage.js

@@ -32,7 +32,6 @@ module.exports = {
       // }), ['title', 'key'])
       return _.sortBy(WIKI.storage.defs.map(md => {
         const dbTarget = dbTargets.find(tg => tg.module === md.key)
-        console.info(md.actions)
         return {
           id: dbTarget?.id ?? uuid(),
           isEnabled: dbTarget?.isEnabled ?? false,
@@ -93,7 +92,8 @@ module.exports = {
               }
             }
           }, {}),
-          actions: md.actions
+          actions: {}
+          // actions: md.actions
         }
       }), ['title'])
     }

+ 1 - 0
server/modules/storage/git/definition.yml

@@ -79,6 +79,7 @@ props:
     sensitive: true
     order: 13
     if:
+      - { key: 'authType', eq: 'ssh' }
       - { key: 'sshPrivateKeyMode', eq: 'inline' }
   verifySSL:
     type: Boolean

+ 2 - 0
ux/src/boot/components.js

@@ -1,7 +1,9 @@
 import { boot } from 'quasar/wrappers'
 
 import BlueprintIcon from '../components/BlueprintIcon.vue'
+import VNetworkGraph from 'v-network-graph'
 
 export default boot(({ app }) => {
   app.component('BlueprintIcon', BlueprintIcon)
+  app.use(VNetworkGraph)
 })

+ 2 - 0
ux/src/css/app.scss

@@ -214,6 +214,8 @@ body::-webkit-scrollbar-thumb {
 
 @import './animation.scss';
 
+@import 'v-network-graph/lib/style.css'
+
 // @import '~codemirror/lib/codemirror.css';
 // @import '~codemirror/theme/elegant.css';
 // @import '~codemirror/theme/material-ocean.css';

+ 10 - 8
ux/src/pages/AdminStorage.vue

@@ -417,7 +417,7 @@ q-page.admin-storage
         q-card-section
           .text-subtitle1 {{state.target.title}}
           q-img.q-mt-sm.rounded-borders(
-            :src='target.banner'
+            :src='state.target.banner'
             fit='cover'
             no-spinner
           )
@@ -585,7 +585,7 @@ q-page.admin-storage
 <script setup>
 import { cloneDeep, find, transform } from 'lodash-es'
 import gql from 'graphql-tag'
-import * as VNetworkGraph from 'v-network-graph'
+import * as VNG from 'v-network-graph'
 
 import { useI18n } from 'vue-i18n'
 import { useMeta, useQuasar } from 'quasar'
@@ -645,9 +645,9 @@ const state = reactive({
     nodes: {}
   },
   deliveryPaths: [],
-  deliveryConfig: VNetworkGraph.defineConfigs({
+  deliveryConfig: VNG.defineConfigs({
     view: {
-      layoutHandler: new VNetworkGraph.GridLayout({ grid: 15 }),
+      layoutHandler: new VNG.GridLayout({ grid: 15 }),
       fit: true,
       mouseWheelZoomEnabled: false,
       grid: {
@@ -736,13 +736,13 @@ watch(() => state.targets, (newValue) => {
   }
 })
 watch(() => route.params.id, (to, from) => {
-  if (!to.params.id) {
+  if (!to) {
     return
   }
   if (state.targets.length < 1) {
-    state.desiredTarget = to.params.id
+    state.desiredTarget = to
   } else {
-    state.selectedTarget = to.params.id
+    state.selectedTarget = to
   }
 })
 
@@ -1165,7 +1165,7 @@ function generateGraph () {
 
   for (const [i, tp] of types.entries()) {
     state.deliveryNodes[tp.key] = { name: tp.label, color: '#3f51b5', icon: tp.icon, iconText: tp.iconText }
-    state.deliveryEdges[`user_${tp.key}`] = { source: 'user', target: t.key }
+    state.deliveryEdges[`user_${tp.key}`] = { source: 'user', target: tp.key }
     state.deliveryLayouts.nodes[tp.key] = { x: 0, y: (i + 1) * 15 }
 
     // -> Find target with direct access
@@ -1218,6 +1218,8 @@ function generateGraph () {
       state.deliveryPaths.push({ edges: [`${tp.key}_db_in`], color: '#f03a4755' })
     }
   }
+
+  console.info(state.deliveryEdges)
 }
 
 // MOUNTED