mirror of https://github.com/Requarks/wiki.git
13 changed files with 519 additions and 100 deletions
Split View
Diff Options
-
14client/components/admin.vue
-
132client/components/admin/admin-general.vue
-
116client/components/admin/admin-webhooks.vue
-
8client/components/common/nav-header.vue
-
126client/components/editor/editor-modal-media.vue
-
12client/graph/editor/editor-media-mutation-asset-delete.gql
-
12client/graph/editor/editor-media-mutation-asset-rename.gql
-
6client/scss/components/v-dialog.scss
-
14client/static/svg/icon-winter.svg
-
126server/graph/resolvers/asset.js
-
9server/graph/schemas/asset.graphql
-
32server/helpers/error.js
-
12server/models/assets.js
@ -0,0 +1,116 @@ |
|||
<template lang='pug'> |
|||
v-container(fluid, grid-list-lg) |
|||
v-layout(row, wrap) |
|||
v-flex(xs12) |
|||
.admin-header |
|||
img.animated.fadeInUp(src='/svg/icon-winter.svg', alt='Mail', style='width: 80px;') |
|||
.admin-header-title |
|||
.headline.primary--text.animated.fadeInLeft {{ $t('admin:webhooks.title') }} |
|||
.subheading.grey--text.animated.fadeInLeft.wait-p4s {{ $t('admin:webhooks.subtitle') }} |
|||
v-spacer |
|||
v-btn.animated.fadeInDown(color='success', depressed, @click='save', large, disabled) |
|||
v-icon(left) check |
|||
span {{$t('common:actions.apply')}} |
|||
|
|||
v-flex(lg3, xs12) |
|||
v-card.animated.fadeInUp |
|||
v-toolbar(flat, color='primary', dark, dense) |
|||
.subheading Webhooks |
|||
v-spacer |
|||
v-btn(outline, small) |
|||
v-icon.mr-2 add |
|||
span New |
|||
v-list(two-line, dense).py-0 |
|||
template(v-for='(str, idx) in hooks') |
|||
v-list-tile(:key='str.key', @click='selectedHook = str.key') |
|||
v-list-tile-avatar |
|||
v-icon(color='primary', v-if='str.isEnabled', v-ripple, @click='str.isEnabled = false') check_box |
|||
v-icon(color='grey', v-else, v-ripple, @click='str.isEnabled = true') check_box_outline_blank |
|||
v-list-tile-content |
|||
v-list-tile-title.body-2(:class='!str.isAvailable ? `grey--text` : (selectedHook === str.key ? `primary--text` : ``)') {{ str.title }} |
|||
v-list-tile-sub-title.caption(:class='!str.isAvailable ? `grey--text text--lighten-1` : (selectedHook === str.key ? `blue--text ` : ``)') {{ str.description }} |
|||
v-list-tile-avatar(v-if='selectedHook === str.key') |
|||
v-icon.animated.fadeInLeft(color='primary') arrow_forward_ios |
|||
v-divider(v-if='idx < hooks.length - 1') |
|||
|
|||
v-flex(xs12, lg9) |
|||
v-card.wiki-form.animated.fadeInUp.wait-p2s |
|||
v-toolbar(color='primary', dense, flat, dark) |
|||
.subheading {{hook.title}} |
|||
v-card-text |
|||
v-form |
|||
.authlogo |
|||
img(:src='hook.logo', :alt='hook.title') |
|||
.caption.pt-3 {{hook.description}} |
|||
.caption.pb-3: a(:href='hook.website') {{hook.website}} |
|||
.body-2(v-if='hook.isEnabled') |
|||
span This hook is |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import _ from 'lodash' |
|||
import { get } from 'vuex-pathify' |
|||
import mailConfigQuery from 'gql/admin/mail/mail-query-config.gql' |
|||
import mailUpdateConfigMutation from 'gql/admin/mail/mail-mutation-save-config.gql' |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
hooks: [], |
|||
selectedHook: '' |
|||
} |
|||
}, |
|||
computed: { |
|||
hook() { |
|||
return _.find(this.hooks, ['id', this.selectedHook]) || {} |
|||
} |
|||
}, |
|||
methods: { |
|||
async save () { |
|||
try { |
|||
await this.$apollo.mutate({ |
|||
mutation: mailUpdateConfigMutation, |
|||
variables: { |
|||
senderName: this.config.senderName || '', |
|||
senderEmail: this.config.senderEmail || '', |
|||
host: this.config.host || '', |
|||
port: _.toSafeInteger(this.config.port) || 0, |
|||
secure: this.config.secure || false, |
|||
user: this.config.user || '', |
|||
pass: this.config.pass || '', |
|||
useDKIM: this.config.useDKIM || false, |
|||
dkimDomainName: this.config.dkimDomainName || '', |
|||
dkimKeySelector: this.config.dkimKeySelector || '', |
|||
dkimPrivateKey: this.config.dkimPrivateKey || '' |
|||
}, |
|||
watchLoading (isLoading) { |
|||
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-mail-update') |
|||
} |
|||
}) |
|||
this.$store.commit('showNotification', { |
|||
style: 'success', |
|||
message: 'Configuration saved successfully.', |
|||
icon: 'check' |
|||
}) |
|||
} catch (err) { |
|||
this.$store.commit('pushGraphError', err) |
|||
} |
|||
} |
|||
}, |
|||
apollo: { |
|||
hooks: { |
|||
query: mailConfigQuery, |
|||
fetchPolicy: 'network-only', |
|||
update: (data) => _.cloneDeep(data.mail.config), |
|||
watchLoading (isLoading) { |
|||
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-mail-refresh') |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang='scss'> |
|||
|
|||
</style> |
@ -0,0 +1,12 @@ |
|||
mutation ($id: Int!) { |
|||
assets { |
|||
deleteAsset(id: $id) { |
|||
responseResult { |
|||
succeeded |
|||
errorCode |
|||
slug |
|||
message |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
mutation ($id: Int!, $filename: String!) { |
|||
assets { |
|||
renameAsset(id:$id, filename: $filename) { |
|||
responseResult { |
|||
succeeded |
|||
errorCode |
|||
slug |
|||
message |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="iso-8859-1"?> |
|||
<!-- Generator: Adobe Illustrator 20.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> |
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Слой_1" x="0px" y="0px" viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve" width="96px" height="96px"> |
|||
<linearGradient id="SVGID_1__48266" gradientUnits="userSpaceOnUse" x1="32" y1="5.3331" x2="32" y2="59.1757" spreadMethod="reflect"> |
|||
<stop offset="0" style="stop-color:#1A6DFF"/> |
|||
<stop offset="1" style="stop-color:#C822FF"/> |
|||
</linearGradient> |
|||
<path style="fill:url(#SVGID_1__48266);" d="M57.402,30.556l-2.959-2.959c-0.796-0.795-2.09-0.795-2.886,0l-2.96,2.96 C48.463,30.691,48.361,31,48.272,31h-7.137c-0.128,0-0.323-0.704-0.594-1.005l-2.404-2.671L42.46,23H47v-2h-4v-4h-2v4.632 l-4.203,4.203l-2.569-2.854C33.893,22.609,33,22.361,33,22.208v-6.48c0-0.089,0.309-0.192,0.443-0.326l2.96-2.96 c0.793-0.795,0.793-2.09-0.001-2.886l-2.959-2.959c-0.796-0.795-2.09-0.795-2.886,0l-2.96,2.96c-0.793,0.795-0.793,2.09,0.001,2.886 l2.959,2.959C30.691,15.536,31,15.639,31,15.728v6.48c0,0.152-0.893,0.401-1.228,0.772l-2.525,2.806L23,21.539V17h-2v4h-4v2h4.632 l4.275,4.275l-2.448,2.72C23.188,30.296,22.993,31,22.865,31h-7.137c-0.089,0-0.192-0.309-0.325-0.443l-2.959-2.959 c-0.796-0.795-2.09-0.795-2.886,0l-2.96,2.96c-0.793,0.795-0.793,2.09,0.001,2.886l2.959,2.959c0.398,0.397,0.92,0.597,1.443,0.597 s1.045-0.199,1.443-0.597l2.96-2.96C15.537,33.308,15.639,33,15.728,33h7.137c0.128,0,0.323,0.703,0.594,1.005l1.955,2.173L20.63,41 H16v2h4v4h2v-4.541l4.755-4.792l3.017,3.353C30.108,41.392,31,41.657,31,41.823v6.45c0,0.088-0.309,0.191-0.443,0.325l-2.96,2.96 c-0.793,0.795-0.793,2.09,0.001,2.886l2.959,2.959c0.398,0.397,0.92,0.597,1.443,0.597s1.045-0.199,1.443-0.597l2.96-2.96 c0.793-0.795,0.793-2.09-0.001-2.886l-2.959-2.959C33.309,48.464,33,48.361,33,48.272v-6.45c0-0.166,0.892-0.43,1.228-0.803 l3.024-3.36L42,42.371V47h2v-4h4v-2h-4.541l-4.867-4.83l1.949-2.165C40.812,33.704,41.007,33,41.135,33h7.137 c0.089,0,0.192,0.309,0.325,0.443l2.959,2.959c0.398,0.397,0.92,0.597,1.443,0.597s1.045-0.199,1.443-0.597l2.96-2.96 C58.197,32.647,58.197,31.352,57.402,30.556z M29.012,10.97l3.017-2.959l2.958,2.958c0.017,0.017,0.017,0.043,0,0.06l-3.017,2.959 L29.012,10.97z M10.971,34.988L8.012,31.97l3.017-2.959l2.958,2.958c0.017,0.017,0.017,0.043,0,0.06L10.971,34.988z M34.987,52.969 c0.017,0.017,0.017,0.043,0,0.06l-3.017,2.959l-2.959-3.018l3.017-2.959L34.987,52.969z M39.054,32.667l-6.313,7.015 c-0.383,0.426-1.101,0.426-1.483,0l-6.313-7.015c-0.342-0.38-0.342-0.954,0-1.334l6.313-7.015c0.191-0.213,0.455-0.329,0.742-0.329 s0.55,0.116,0.742,0.329l6.313,7.015C39.396,31.713,39.396,32.287,39.054,32.667z M52.971,34.988l-2.959-3.018l3.017-2.959 l2.958,2.958c0.017,0.017,0.017,0.043,0,0.06L52.971,34.988z"/> |
|||
<linearGradient id="SVGID_2__48266" gradientUnits="userSpaceOnUse" x1="32" y1="25.9998" x2="32" y2="38.5098" spreadMethod="reflect"> |
|||
<stop offset="0" style="stop-color:#6DC7FF"/> |
|||
<stop offset="1" style="stop-color:#E6ABFF"/> |
|||
</linearGradient> |
|||
<path style="fill:url(#SVGID_2__48266);" d="M36.627,32.781l-3.746,4.162c-0.471,0.523-1.291,0.523-1.762,0l-3.746-4.162 c-0.406-0.451-0.406-1.135,0-1.586l3.746-4.162c0.471-0.523,1.291-0.523,1.762,0l3.746,4.162 C37.033,31.646,37.033,32.33,36.627,32.781z"/> |
|||
</svg> |
Write
Preview
Loading…
Cancel
Save