From 47dcc90fb7e7ddec1abd8ed0868f9bac5d096139 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 5 Aug 2018 11:27:46 -0400 Subject: [PATCH] feat: storage extra metadata + user search fix --- client/components/admin/admin-storage.vue | 22 ++++++++- client/components/admin/admin-theme.vue | 45 ++++++++++++++++++- client/components/common/user-search.vue | 3 +- client/components/setup.vue | 17 +++++-- .../admin/storage/storage-query-targets.gql | 3 ++ client/graph/admin/users/users-query-list.gql | 2 +- .../common/common-users-query-search.gql | 2 +- server/graph/resolvers/user.js | 4 +- server/graph/schemas/storage.graphql | 3 ++ server/graph/schemas/user.graphql | 4 +- server/modules/storage/azure/definition.yml | 3 ++ server/modules/storage/box/definition.yml | 3 ++ .../storage/digitalocean/definition.yml | 5 ++- server/modules/storage/disk/definition.yml | 3 ++ server/modules/storage/dropbox/definition.yml | 3 ++ server/modules/storage/gdrive/definition.yml | 3 ++ server/modules/storage/git/definition.yml | 3 ++ .../modules/storage/onedrive/definition.yml | 3 ++ server/modules/storage/s3/definition.yml | 3 ++ server/modules/storage/scp/definition.yml | 3 ++ 20 files changed, 123 insertions(+), 14 deletions(-) diff --git a/client/components/admin/admin-storage.vue b/client/components/admin/admin-storage.vue index b23fe7cd..d5f566a9 100644 --- a/client/components/admin/admin-storage.vue +++ b/client/components/admin/admin-storage.vue @@ -24,6 +24,12 @@ v-tab-item(v-for='(tgt, n) in activeTargets', :key='tgt.key', :transition='false', :reverse-transition='false') v-card.pa-3(flat, tile) v-form + .targetlogo + img(:src='tgt.logo', :alt='tgt.title') + v-subheader.pl-0 {{tgt.title}} + .caption {{tgt.description}} + .caption: a(:href='tgt.website') {{tgt.website}} + v-divider.mt-3 v-subheader.pl-0 Target Configuration .body-1.ml-3(v-if='!tgt.config || tgt.config.length < 1') This storage target has no configuration options you can modify. template(v-else, v-for='cfg in tgt.config') @@ -163,6 +169,20 @@ export default { } - diff --git a/client/components/admin/admin-theme.vue b/client/components/admin/admin-theme.vue index ccde8268..d25cf630 100644 --- a/client/components/admin/admin-theme.vue +++ b/client/components/admin/admin-theme.vue @@ -39,6 +39,46 @@ v-btn(color='primary', :loading='loading', @click='save') v-icon(left) chevron_right span Save + v-card.mt-3 + v-toolbar(color='primary', dark, dense, flat) + v-toolbar-title + .subheading Code Injection + v-card-text + v-textarea( + v-model='injectCSS' + label='CSS Override' + outline + background-color='grey lighten-1' + color='primary' + persistent-hint + hint='CSS code to inject after system default CSS' + auto-grow + ) + v-textarea.mt-2( + v-model='injectHeader' + label='Site Header' + outline + background-color='grey lighten-1' + color='primary' + persistent-hint + hint='HTML code to be injected just before the closing head tag' + auto-grow + ) + v-textarea.mt-2( + v-model='injectFooter' + label='Site Footer' + outline + background-color='grey lighten-1' + color='primary' + persistent-hint + hint='HTML code to be injected just before the closing body tag' + auto-grow + ) + v-card-chin + v-spacer + v-btn(color='primary', :loading='loading', @click='save') + v-icon(left) chevron_right + span Save v-flex(lg6 xs12) v-card v-toolbar(color='teal', dark, dense, flat) @@ -61,7 +101,10 @@ export default { { text: 'Default', author: 'requarks.io', value: 'default' } ], selectedTheme: 'default', - darkModeInitial: false + darkModeInitial: false, + injectCSS: '', + injectHeader: '', + injectFooter: '' } }, computed: { diff --git a/client/components/common/user-search.vue b/client/components/common/user-search.vue index a704cae9..88c6276d 100644 --- a/client/components/common/user-search.vue +++ b/client/components/common/user-search.vue @@ -21,9 +21,10 @@ label='Search Users...' v-model='search' prepend-icon='search' - :class='$vuetify.dark ? "grey darken-4" : "blue lighten-5"' + :background-color='$vuetify.dark ? "grey darken-4" : "blue lighten-5"' color='primary' ref='searchIpt' + hide-details ) v-list(two-line) template(v-for='(usr, idx) in items') diff --git a/client/components/setup.vue b/client/components/setup.vue index 7f19b2f5..897a8d55 100644 --- a/client/components/setup.vue +++ b/client/components/setup.vue @@ -286,14 +286,19 @@ v-stepper-content(:step='conf.upgrade ? 6 : 5') v-card.text-xs-center(flat) template(v-if='loading') - v-progress-circular(size='64', indeterminate, color='blue') - .subheading Finalizing your installation... + .mt-3(style='width: 64px; display:inline-block;') + atom-spinner( + :animation-duration='800' + :size='64' + color='#1976d2' + ) + .subheading.primary--text.mt-3 Finalizing your installation... template(v-else-if='final.ok') svg.icons.is-64: use(xlink:href='#nc-check-bold') - .subheading Installation complete! + .subheading.green--text Installation complete! template(v-else) svg.icons.is-64: use(xlink:href='#nc-square-remove') - .subheading Something went wrong... + .subheading.red--text Something went wrong... v-container v-alert(type='success', outline, :value='!loading && final.ok') Wiki.js was configured successfully and is now ready for use. v-alert(type='error', outline, :value='!loading && !final.ok') {{ final.error }} @@ -315,8 +320,12 @@ import axios from 'axios' import _ from 'lodash' +import { AtomSpinner } from 'epic-spinners' export default { + components: { + AtomSpinner + }, props: { telemetryId: { type: String, diff --git a/client/graph/admin/storage/storage-query-targets.gql b/client/graph/admin/storage/storage-query-targets.gql index ecfc5712..4b02edc5 100644 --- a/client/graph/admin/storage/storage-query-targets.gql +++ b/client/graph/admin/storage/storage-query-targets.gql @@ -4,6 +4,9 @@ query { isEnabled key title + description + logo + website mode config { key diff --git a/client/graph/admin/users/users-query-list.gql b/client/graph/admin/users/users-query-list.gql index 2f06a48a..62e7faf9 100644 --- a/client/graph/admin/users/users-query-list.gql +++ b/client/graph/admin/users/users-query-list.gql @@ -4,7 +4,7 @@ query { id name email - provider + providerKey role createdAt updatedAt diff --git a/client/graph/common/common-users-query-search.gql b/client/graph/common/common-users-query-search.gql index e5ac2867..609eca8a 100644 --- a/client/graph/common/common-users-query-search.gql +++ b/client/graph/common/common-users-query-search.gql @@ -4,7 +4,7 @@ query ($query: String!) { id name email - provider + providerKey } } } diff --git a/server/graph/resolvers/user.js b/server/graph/resolvers/user.js index 963dcece..63cb85c7 100644 --- a/server/graph/resolvers/user.js +++ b/server/graph/resolvers/user.js @@ -11,14 +11,14 @@ module.exports = { UserQuery: { async list(obj, args, context, info) { return WIKI.models.users.query() - .select('id', 'email', 'name', 'provider', 'role', 'createdAt', 'updatedAt') + .select('id', 'email', 'name', 'providerKey', 'role', 'createdAt', 'updatedAt') }, async search(obj, args, context, info) { return WIKI.models.users.query() .where('email', 'like', `%${args.query}%`) .orWhere('name', 'like', `%${args.query}%`) .limit(10) - .select('id', 'email', 'name', 'provider', 'role', 'createdAt', 'updatedAt') + .select('id', 'email', 'name', 'providerKey', 'role', 'createdAt', 'updatedAt') }, async single(obj, args, context, info) { let usr = await WIKI.models.users.query().findById(args.id) diff --git a/server/graph/schemas/storage.graphql b/server/graph/schemas/storage.graphql index 14385eb3..015f1dc8 100644 --- a/server/graph/schemas/storage.graphql +++ b/server/graph/schemas/storage.graphql @@ -39,6 +39,9 @@ type StorageTarget { isEnabled: Boolean! key: String! title: String! + description: String + logo: String + website: String mode: String config: [KeyValuePair] } diff --git a/server/graph/schemas/user.graphql b/server/graph/schemas/user.graphql index 3dac063a..60d1bdc2 100644 --- a/server/graph/schemas/user.graphql +++ b/server/graph/schemas/user.graphql @@ -85,14 +85,14 @@ type UserMinimal { id: Int! name: String! email: String! - provider: String! + providerKey: String! } type User { id: Int! name: String! email: String! - provider: String! + providerKey: String! providerId: String role: UserRole! createdAt: Date! diff --git a/server/modules/storage/azure/definition.yml b/server/modules/storage/azure/definition.yml index 3c551fdf..24360b49 100644 --- a/server/modules/storage/azure/definition.yml +++ b/server/modules/storage/azure/definition.yml @@ -1,6 +1,9 @@ key: azure title: Azure Blob Storage +description: Azure Blob Storage by Microsoft provides massively scalable object storage for unstructured data. author: requarks.io +logo: https://static.requarks.io/logo/azure.svg +website: https://azure.microsoft.com/services/storage/blobs/ props: accountName: String accountKey: String diff --git a/server/modules/storage/box/definition.yml b/server/modules/storage/box/definition.yml index f86f80b6..30276a39 100644 --- a/server/modules/storage/box/definition.yml +++ b/server/modules/storage/box/definition.yml @@ -1,6 +1,9 @@ key: box title: Box +description: Box is a cloud content management and file sharing service for businesses. author: requarks.io +logo: https://static.requarks.io/logo/box.svg +website: https://www.box.com/platform props: clientId: String clientSecret: String diff --git a/server/modules/storage/digitalocean/definition.yml b/server/modules/storage/digitalocean/definition.yml index cbd24f19..7a1a388d 100644 --- a/server/modules/storage/digitalocean/definition.yml +++ b/server/modules/storage/digitalocean/definition.yml @@ -1,6 +1,9 @@ key: digitalocean -title: DigialOcean Spaces +title: DigitalOcean Spaces +description: DigitalOcean provides developers and businesses a reliable, easy-to-use cloud computing platform of virtual servers (Droplets), object storage (Spaces) and more. author: requarks.io +logo: https://static.requarks.io/logo/digitalocean.svg +website: https://www.digitalocean.com/products/spaces/ props: accessKeyId: String accessSecret: String diff --git a/server/modules/storage/disk/definition.yml b/server/modules/storage/disk/definition.yml index e8f9e8b2..a55569e8 100644 --- a/server/modules/storage/disk/definition.yml +++ b/server/modules/storage/disk/definition.yml @@ -1,6 +1,9 @@ key: disk title: Local File System +description: Local storage on disk or network shares. author: requarks.io +logo: https://static.requarks.io/logo/local-fs.svg +website: https://wiki.js.org props: path: type: String diff --git a/server/modules/storage/dropbox/definition.yml b/server/modules/storage/dropbox/definition.yml index 5b3b0c9f..74959570 100644 --- a/server/modules/storage/dropbox/definition.yml +++ b/server/modules/storage/dropbox/definition.yml @@ -1,6 +1,9 @@ key: dropbox title: Dropbox +description: Dropbox is a file hosting service that offers cloud storage, file synchronization, personal cloud, and client software. author: requarks.io +logo: https://static.requarks.io/logo/dropbox.svg +website: https://dropbox.com props: appKey: String appSecret: String diff --git a/server/modules/storage/gdrive/definition.yml b/server/modules/storage/gdrive/definition.yml index 80ac3d6b..b19ea06b 100644 --- a/server/modules/storage/gdrive/definition.yml +++ b/server/modules/storage/gdrive/definition.yml @@ -1,6 +1,9 @@ key: gdrive title: Google Drive +description: Google Drive is a file storage and synchronization service developed by Google. author: requarks.io +logo: https://static.requarks.io/logo/google-drive.svg +website: https://www.google.com/drive/ props: clientId: String clientSecret: String diff --git a/server/modules/storage/git/definition.yml b/server/modules/storage/git/definition.yml index 89770a2c..60eecbfd 100644 --- a/server/modules/storage/git/definition.yml +++ b/server/modules/storage/git/definition.yml @@ -1,6 +1,9 @@ key: git title: Git +description: Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. author: requarks.io +logo: https://static.requarks.io/logo/git-alt.svg +website: https://git-scm.com/ props: authType: type: String diff --git a/server/modules/storage/onedrive/definition.yml b/server/modules/storage/onedrive/definition.yml index 3bbf3dd7..b8cad109 100644 --- a/server/modules/storage/onedrive/definition.yml +++ b/server/modules/storage/onedrive/definition.yml @@ -1,6 +1,9 @@ key: onedrive title: OneDrive +description: OneDrive is a file hosting service operated by Microsoft as part of its suite of Office Online services. author: requarks.io +logo: https://static.requarks.io/logo/onedrive.svg +website: https://onedrive.live.com/about/ props: clientId: String clientSecret: String diff --git a/server/modules/storage/s3/definition.yml b/server/modules/storage/s3/definition.yml index 06931b60..e9681231 100644 --- a/server/modules/storage/s3/definition.yml +++ b/server/modules/storage/s3/definition.yml @@ -1,6 +1,9 @@ key: s3 title: Amazon S3 +description: Amazon S3 is a cloud computing web service offered by Amazon Web Services which provides object storage. author: requarks.io +logo: https://static.requarks.io/logo/aws-s3.svg +website: https://aws.amazon.com/s3/ props: accessKeyId: String accessSecret: String diff --git a/server/modules/storage/scp/definition.yml b/server/modules/storage/scp/definition.yml index 2d4a7488..971f2c0b 100644 --- a/server/modules/storage/scp/definition.yml +++ b/server/modules/storage/scp/definition.yml @@ -1,6 +1,9 @@ key: scp title: SCP (SSH) +description: SSH is a software package that enables secure system administration and file transfers over insecure networks. author: requarks.io +logo: https://static.requarks.io/logo/ssh.svg +website: https://www.ssh.com/ssh/ props: host: String port: