2018-03-04 02:48:28 +00:00
|
|
|
<template lang='pug'>
|
2018-09-30 03:30:20 +00:00
|
|
|
v-container(fluid, grid-list-lg)
|
|
|
|
v-layout(row, wrap)
|
|
|
|
v-flex(xs12)
|
|
|
|
.admin-header
|
2020-05-15 21:05:11 +00:00
|
|
|
img.animated.fadeInUp(src='/_assets/svg/icon-unlock.svg', alt='Authentication', style='width: 80px;')
|
2018-09-30 03:30:20 +00:00
|
|
|
.admin-header-title
|
2019-06-06 03:24:37 +00:00
|
|
|
.headline.primary--text.animated.fadeInLeft {{ $t('admin:auth.title') }}
|
2019-08-03 04:48:55 +00:00
|
|
|
.subtitle-1.grey--text.animated.fadeInLeft.wait-p4s {{ $t('admin:auth.subtitle') }}
|
2018-09-30 03:30:20 +00:00
|
|
|
v-spacer
|
2019-07-29 04:50:03 +00:00
|
|
|
v-btn.animated.fadeInDown.wait-p2s.mr-3(outlined, color='grey', @click='refresh', large)
|
2019-08-03 04:48:55 +00:00
|
|
|
v-icon mdi-refresh
|
2019-04-07 16:37:33 +00:00
|
|
|
v-btn.animated.fadeInDown(color='success', @click='save', depressed, large)
|
2019-08-03 04:48:55 +00:00
|
|
|
v-icon(left) mdi-check
|
2019-01-01 06:40:31 +00:00
|
|
|
span {{$t('common:actions.apply')}}
|
2018-03-04 02:48:28 +00:00
|
|
|
|
2019-04-21 00:49:05 +00:00
|
|
|
v-flex(lg3, xs12)
|
|
|
|
v-card.animated.fadeInUp
|
|
|
|
v-toolbar(flat, color='primary', dark, dense)
|
2019-08-03 04:48:55 +00:00
|
|
|
.subtitle-1 {{$t('admin:auth.strategies')}}
|
2019-04-21 00:49:05 +00:00
|
|
|
v-list(two-line, dense).py-0
|
|
|
|
template(v-for='(str, idx) in strategies')
|
2019-07-29 04:50:03 +00:00
|
|
|
v-list-item(:key='str.key', @click='selectedStrategy = str.key', :disabled='!str.isAvailable')
|
2019-08-03 04:48:55 +00:00
|
|
|
v-list-item-avatar(size='24')
|
|
|
|
v-icon(color='grey', v-if='!str.isAvailable') mdi-minus-box-outline
|
|
|
|
v-icon(color='primary', v-else-if='str.isEnabled && str.key !== `local`', v-ripple, @click='str.isEnabled = false') mdi-checkbox-marked-outline
|
|
|
|
v-icon(color='primary', v-else-if='str.isEnabled && str.key === `local`') mdi-checkbox-marked-outline
|
|
|
|
v-icon(color='grey', v-else, v-ripple, @click='str.isEnabled = true') mdi-checkbox-blank-outline
|
2019-07-29 04:50:03 +00:00
|
|
|
v-list-item-content
|
|
|
|
v-list-item-title.body-2(:class='!str.isAvailable ? `grey--text` : (selectedStrategy === str.key ? `primary--text` : ``)') {{ str.title }}
|
2019-08-03 04:48:55 +00:00
|
|
|
v-list-item-subtitle: .caption(:class='!str.isAvailable ? `grey--text text--lighten-1` : (selectedStrategy === str.key ? `blue--text ` : ``)') {{ str.description }}
|
2019-08-05 03:53:21 +00:00
|
|
|
v-list-item-avatar(v-if='selectedStrategy === str.key', size='24')
|
2019-08-03 04:48:55 +00:00
|
|
|
v-icon.animated.fadeInLeft(color='primary', large) mdi-chevron-right
|
2019-04-21 00:49:05 +00:00
|
|
|
v-divider(v-if='idx < strategies.length - 1')
|
2018-03-06 04:13:20 +00:00
|
|
|
|
2019-08-05 03:53:21 +00:00
|
|
|
v-card.mt-3.animated.fadeInUp.wait-p2s
|
2019-04-21 00:49:05 +00:00
|
|
|
v-toolbar(flat, color='primary', dark, dense)
|
2019-08-03 04:48:55 +00:00
|
|
|
.subtitle-1 {{$t('admin:auth.globalAdvSettings')}}
|
2019-04-21 00:49:05 +00:00
|
|
|
v-card-text
|
|
|
|
v-text-field.md2(
|
|
|
|
v-model='jwtAudience'
|
2019-07-29 04:50:03 +00:00
|
|
|
outlined
|
2019-08-03 04:48:55 +00:00
|
|
|
prepend-icon='mdi-account-group-outline'
|
2019-06-06 03:24:37 +00:00
|
|
|
:label='$t(`admin:auth.jwtAudience`)'
|
|
|
|
:hint='$t(`admin:auth.jwtAudienceHint`)'
|
2019-04-21 00:49:05 +00:00
|
|
|
persistent-hint
|
|
|
|
)
|
|
|
|
v-text-field.mt-3.md2(
|
|
|
|
v-model='jwtExpiration'
|
2019-07-29 04:50:03 +00:00
|
|
|
outlined
|
2019-08-03 04:48:55 +00:00
|
|
|
prepend-icon='mdi-clock-outline'
|
2019-06-06 03:24:37 +00:00
|
|
|
:label='$t(`admin:auth.tokenExpiration`)'
|
|
|
|
:hint='$t(`admin:auth.tokenExpirationHint`)'
|
2019-04-21 00:49:05 +00:00
|
|
|
persistent-hint
|
|
|
|
)
|
|
|
|
v-text-field.mt-3.md2(
|
|
|
|
v-model='jwtRenewablePeriod'
|
2019-07-29 04:50:03 +00:00
|
|
|
outlined
|
2019-08-03 04:48:55 +00:00
|
|
|
prepend-icon='mdi-update'
|
2019-06-06 03:24:37 +00:00
|
|
|
:label='$t(`admin:auth.tokenRenewalPeriod`)'
|
|
|
|
:hint='$t(`admin:auth.tokenRenewalPeriodHint`)'
|
2019-04-21 00:49:05 +00:00
|
|
|
persistent-hint
|
|
|
|
)
|
2018-03-06 04:13:20 +00:00
|
|
|
|
2019-04-21 00:49:05 +00:00
|
|
|
v-flex(xs12, lg9)
|
2019-08-05 03:53:21 +00:00
|
|
|
v-card.animated.fadeInUp.wait-p2s
|
2019-04-21 00:49:05 +00:00
|
|
|
v-toolbar(color='primary', dense, flat, dark)
|
2019-08-03 04:48:55 +00:00
|
|
|
.subtitle-1 {{strategy.title}}
|
2019-09-01 22:33:36 +00:00
|
|
|
v-spacer
|
|
|
|
v-switch(
|
|
|
|
dark
|
|
|
|
color='blue lighten-5'
|
|
|
|
label='Active'
|
|
|
|
v-model='strategy.isEnabled'
|
|
|
|
hide-details
|
|
|
|
inset
|
|
|
|
:disabled='strategy.key === `local`'
|
|
|
|
)
|
2019-04-21 00:49:05 +00:00
|
|
|
v-card-text
|
|
|
|
v-form
|
|
|
|
.authlogo
|
|
|
|
img(:src='strategy.logo', :alt='strategy.title')
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2.pt-3 {{strategy.description}}
|
|
|
|
.body-2.pt-3.pb-5: a(:href='strategy.website') {{strategy.website}}
|
2019-06-06 03:24:37 +00:00
|
|
|
i18next.body-2(path='admin:auth.strategyState', tag='div', v-if='strategy.isEnabled')
|
|
|
|
v-chip(color='green', small, dark, label, place='state') {{$t('admin:auth.strategyStateActive')}}
|
|
|
|
span(v-if='selectedStrategy === `local`', place='locked') {{$t('admin:auth.strategyStateLocked')}}
|
|
|
|
span(v-else, place='locked', v-text='')
|
|
|
|
i18next.body-2(path='admin:auth.strategyState', tag='div', v-else)
|
|
|
|
v-chip(color='red', small, dark, label, place='state') {{$t('admin:auth.strategyStateInactive')}}
|
2019-04-21 00:49:05 +00:00
|
|
|
v-divider.mt-3
|
2019-08-03 04:48:55 +00:00
|
|
|
.overline.my-5 {{$t('admin:auth.strategyConfiguration')}}
|
|
|
|
.body-2.ml-3(v-if='!strategy.config || strategy.config.length < 1'): em {{$t('admin:auth.strategyNoConfiguration')}}
|
2019-04-21 00:49:05 +00:00
|
|
|
template(v-else, v-for='cfg in strategy.config')
|
2020-05-15 21:05:11 +00:00
|
|
|
v-select.mb-3(
|
2019-04-21 00:49:05 +00:00
|
|
|
v-if='cfg.value.type === "string" && cfg.value.enum'
|
2019-07-29 04:50:03 +00:00
|
|
|
outlined
|
2019-04-21 00:49:05 +00:00
|
|
|
:items='cfg.value.enum'
|
|
|
|
:key='cfg.key'
|
|
|
|
:label='cfg.value.title'
|
|
|
|
v-model='cfg.value.value'
|
2020-04-24 04:29:49 +00:00
|
|
|
prepend-icon='mdi-cog-box'
|
2019-04-21 00:49:05 +00:00
|
|
|
:hint='cfg.value.hint ? cfg.value.hint : ""'
|
|
|
|
persistent-hint
|
|
|
|
:class='cfg.value.hint ? "mb-2" : ""'
|
2020-05-15 21:05:11 +00:00
|
|
|
:style='cfg.value.maxWidth > 0 ? `max-width:` + cfg.value.maxWidth + `px;` : ``'
|
2019-04-21 00:49:05 +00:00
|
|
|
)
|
2020-05-15 21:05:11 +00:00
|
|
|
v-switch.mb-6(
|
2019-04-21 00:49:05 +00:00
|
|
|
v-else-if='cfg.value.type === "boolean"'
|
|
|
|
:key='cfg.key'
|
|
|
|
:label='cfg.value.title'
|
|
|
|
v-model='cfg.value.value'
|
|
|
|
color='primary'
|
2020-04-24 04:29:49 +00:00
|
|
|
prepend-icon='mdi-cog-box'
|
2019-04-21 00:49:05 +00:00
|
|
|
:hint='cfg.value.hint ? cfg.value.hint : ""'
|
|
|
|
persistent-hint
|
2019-09-01 22:33:36 +00:00
|
|
|
inset
|
2019-04-21 00:49:05 +00:00
|
|
|
)
|
2020-05-15 21:05:11 +00:00
|
|
|
v-textarea.mb-3(
|
2019-07-14 22:55:12 +00:00
|
|
|
v-else-if='cfg.value.type === "string" && cfg.value.multiline'
|
2019-07-29 04:50:03 +00:00
|
|
|
outlined
|
2019-07-14 22:55:12 +00:00
|
|
|
:key='cfg.key'
|
|
|
|
:label='cfg.value.title'
|
|
|
|
v-model='cfg.value.value'
|
2020-04-24 04:29:49 +00:00
|
|
|
prepend-icon='mdi-cog-box'
|
2019-07-14 22:55:12 +00:00
|
|
|
:hint='cfg.value.hint ? cfg.value.hint : ""'
|
|
|
|
persistent-hint
|
|
|
|
:class='cfg.value.hint ? "mb-2" : ""'
|
|
|
|
)
|
2020-05-15 21:05:11 +00:00
|
|
|
v-text-field.mb-3(
|
2019-04-21 00:49:05 +00:00
|
|
|
v-else
|
2019-07-29 04:50:03 +00:00
|
|
|
outlined
|
2019-04-21 00:49:05 +00:00
|
|
|
:key='cfg.key'
|
|
|
|
:label='cfg.value.title'
|
|
|
|
v-model='cfg.value.value'
|
2020-04-24 04:29:49 +00:00
|
|
|
prepend-icon='mdi-cog-box'
|
2019-04-21 00:49:05 +00:00
|
|
|
:hint='cfg.value.hint ? cfg.value.hint : ""'
|
|
|
|
persistent-hint
|
|
|
|
:class='cfg.value.hint ? "mb-2" : ""'
|
2020-05-15 21:05:11 +00:00
|
|
|
:style='cfg.value.maxWidth > 0 ? `max-width:` + cfg.value.maxWidth + `px;` : ``'
|
2019-04-21 00:49:05 +00:00
|
|
|
)
|
|
|
|
v-divider.mt-3
|
2019-08-03 04:48:55 +00:00
|
|
|
.overline.my-5 {{$t('admin:auth.registration')}}
|
2019-04-21 00:49:05 +00:00
|
|
|
.pr-3
|
|
|
|
v-switch.ml-3(
|
|
|
|
v-model='strategy.selfRegistration'
|
2019-06-09 01:00:12 +00:00
|
|
|
:label='$t(`admin:auth.selfRegistration`)'
|
2019-04-21 00:49:05 +00:00
|
|
|
color='primary'
|
2019-06-09 01:00:12 +00:00
|
|
|
:hint='$t(`admin:auth.selfRegistrationHint`)'
|
2019-04-21 00:49:05 +00:00
|
|
|
persistent-hint
|
2019-09-01 22:33:36 +00:00
|
|
|
inset
|
2019-04-21 00:49:05 +00:00
|
|
|
)
|
|
|
|
v-combobox.ml-3.mt-3(
|
2019-06-09 01:00:12 +00:00
|
|
|
:label='$t(`admin:auth.domainsWhitelist`)'
|
2019-04-21 00:49:05 +00:00
|
|
|
v-model='strategy.domainWhitelist'
|
2019-08-03 04:48:55 +00:00
|
|
|
prepend-icon='mdi-email-check-outline'
|
2019-07-29 04:50:03 +00:00
|
|
|
outlined
|
2019-04-21 00:49:05 +00:00
|
|
|
:disabled='!strategy.selfRegistration'
|
2019-06-09 01:00:12 +00:00
|
|
|
:hint='$t(`admin:auth.domainsWhitelistHint`)'
|
2019-04-21 00:49:05 +00:00
|
|
|
persistent-hint
|
|
|
|
small-chips
|
|
|
|
deletable-chips
|
|
|
|
clearable
|
|
|
|
multiple
|
|
|
|
chips
|
|
|
|
)
|
|
|
|
v-autocomplete.mt-3.ml-3(
|
2019-07-29 04:50:03 +00:00
|
|
|
outlined
|
2019-04-21 00:49:05 +00:00
|
|
|
:disabled='!strategy.selfRegistration'
|
|
|
|
:items='groups'
|
|
|
|
item-text='name'
|
|
|
|
item-value='id'
|
2019-06-09 01:00:12 +00:00
|
|
|
:label='$t(`admin:auth.autoEnrollGroups`)'
|
2019-04-21 00:49:05 +00:00
|
|
|
v-model='strategy.autoEnrollGroups'
|
2019-08-03 04:48:55 +00:00
|
|
|
prepend-icon='mdi-account-group'
|
2019-06-09 01:00:12 +00:00
|
|
|
:hint='$t(`admin:auth.autoEnrollGroupsHint`)'
|
2019-04-21 00:49:05 +00:00
|
|
|
small-chips
|
|
|
|
persistent-hint
|
|
|
|
deletable-chips
|
|
|
|
clearable
|
|
|
|
multiple
|
|
|
|
chips
|
|
|
|
)
|
|
|
|
template(v-if='strategy.useForm')
|
|
|
|
v-divider.mt-3
|
2019-11-02 20:04:43 +00:00
|
|
|
.d-flex.my-5.align-center
|
|
|
|
.overline {{$t('admin:auth.security')}}
|
|
|
|
v-chip.ml-3.grey--text(outlined, small, label) Coming soon
|
|
|
|
v-switch.ml-3(
|
|
|
|
v-if='strategy.key === `local`'
|
|
|
|
:disabled='!strategy.selfRegistration || true'
|
|
|
|
v-model='strategy.recaptcha'
|
|
|
|
label='Use reCAPTCHA by Google'
|
|
|
|
color='primary'
|
|
|
|
hint='Protects against spam robots and malicious registrations.'
|
|
|
|
persistent-hint
|
|
|
|
inset
|
|
|
|
)
|
2019-04-21 00:49:05 +00:00
|
|
|
v-switch.ml-3(
|
|
|
|
v-model='strategy.recaptcha'
|
|
|
|
:disabled='true'
|
2019-06-09 01:00:12 +00:00
|
|
|
:label='$t(`admin:auth.force2fa`)'
|
2019-04-21 00:49:05 +00:00
|
|
|
color='primary'
|
2019-06-09 01:00:12 +00:00
|
|
|
:hint='$t(`admin:auth.force2faHint`)'
|
2019-04-21 00:49:05 +00:00
|
|
|
persistent-hint
|
2019-09-01 22:33:36 +00:00
|
|
|
inset
|
2019-04-21 00:49:05 +00:00
|
|
|
)
|
|
|
|
|
2020-04-24 04:17:10 +00:00
|
|
|
v-card.mt-4.wiki-form.animated.fadeInUp.wait-p4s(v-if='selectedStrategy !== `local`')
|
2019-04-21 00:49:05 +00:00
|
|
|
v-toolbar(color='primary', dense, flat, dark)
|
2019-08-03 04:48:55 +00:00
|
|
|
.subtitle-1 {{$t('admin:auth.configReference')}}
|
2019-04-21 00:49:05 +00:00
|
|
|
v-card-text
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2 {{$t('admin:auth.configReferenceSubtitle')}}
|
2019-08-05 03:53:21 +00:00
|
|
|
v-alert.mt-3.radius-7(v-if='host.length < 8', color='red', outlined, :value='true', icon='mdi-alert')
|
2019-06-09 01:00:12 +00:00
|
|
|
i18next(path='admin:auth.siteUrlNotSetup', tag='span')
|
|
|
|
strong(place='siteUrl') {{$t('admin:general.siteUrl')}}
|
|
|
|
strong(place='general') {{$t('admin:general.title')}}
|
2019-08-10 16:18:14 +00:00
|
|
|
.pa-3.mt-3.radius-7.grey(v-else, :class='$vuetify.theme.dark ? `darken-3-d5` : `lighten-3`')
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2: strong {{$t('admin:auth.allowedWebOrigins')}}
|
|
|
|
.body-2 {{host}}
|
2019-04-21 00:49:05 +00:00
|
|
|
v-divider.my-3
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2: strong {{$t('admin:auth.callbackUrl')}}
|
|
|
|
.body-2 {{host}}/login/{{strategy.key}}/callback
|
2019-04-21 00:49:05 +00:00
|
|
|
v-divider.my-3
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2: strong {{$t('admin:auth.loginUrl')}}
|
|
|
|
.body-2 {{host}}/login
|
2019-04-21 00:49:05 +00:00
|
|
|
v-divider.my-3
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2: strong {{$t('admin:auth.logoutUrl')}}
|
|
|
|
.body-2 {{host}}
|
2019-04-21 00:49:05 +00:00
|
|
|
v-divider.my-3
|
2019-08-03 04:48:55 +00:00
|
|
|
.body-2: strong {{$t('admin:auth.tokenEndpointAuthMethod')}}
|
|
|
|
.body-2 HTTP-POST
|
2018-03-04 02:48:28 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-03-12 04:09:54 +00:00
|
|
|
import _ from 'lodash'
|
2018-06-04 04:41:29 +00:00
|
|
|
|
2018-06-26 00:55:00 +00:00
|
|
|
import groupsQuery from 'gql/admin/auth/auth-query-groups.gql'
|
2018-06-25 06:44:40 +00:00
|
|
|
import strategiesQuery from 'gql/admin/auth/auth-query-strategies.gql'
|
|
|
|
import strategiesSaveMutation from 'gql/admin/auth/auth-mutation-save-strategies.gql'
|
2019-04-21 00:49:05 +00:00
|
|
|
import hostQuery from 'gql/admin/auth/auth-query-host.gql'
|
2018-03-06 01:53:24 +00:00
|
|
|
|
2018-03-04 02:48:28 +00:00
|
|
|
export default {
|
2018-07-01 23:50:42 +00:00
|
|
|
filters: {
|
|
|
|
startCase(val) { return _.startCase(val) }
|
|
|
|
},
|
2018-03-04 02:48:28 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2018-06-26 00:55:00 +00:00
|
|
|
groups: [],
|
2018-10-13 03:14:11 +00:00
|
|
|
strategies: [],
|
2019-04-21 00:49:05 +00:00
|
|
|
selectedStrategy: '',
|
|
|
|
host: '',
|
|
|
|
strategy: {},
|
2018-10-13 03:14:11 +00:00
|
|
|
jwtAudience: 'urn:wiki.js',
|
|
|
|
jwtExpiration: '30m',
|
|
|
|
jwtRenewablePeriod: '14d'
|
2018-03-04 02:48:28 +00:00
|
|
|
}
|
2018-03-06 01:53:24 +00:00
|
|
|
},
|
2018-03-12 04:09:54 +00:00
|
|
|
computed: {
|
2018-06-04 04:41:29 +00:00
|
|
|
activeStrategies() {
|
2018-06-26 00:55:00 +00:00
|
|
|
return _.filter(this.strategies, 'isEnabled')
|
2018-03-12 04:09:54 +00:00
|
|
|
}
|
|
|
|
},
|
2019-04-21 00:49:05 +00:00
|
|
|
watch: {
|
|
|
|
selectedStrategy(newValue, oldValue) {
|
|
|
|
this.strategy = _.find(this.strategies, ['key', newValue]) || {}
|
|
|
|
},
|
|
|
|
strategies(newValue, oldValue) {
|
|
|
|
this.selectedStrategy = 'local'
|
|
|
|
}
|
|
|
|
},
|
2018-06-04 04:41:29 +00:00
|
|
|
methods: {
|
|
|
|
async refresh() {
|
|
|
|
await this.$apollo.queries.strategies.refetch()
|
|
|
|
this.$store.commit('showNotification', {
|
2019-06-10 03:39:37 +00:00
|
|
|
message: this.$t('admin:auth.refreshSuccess'),
|
2018-06-04 04:41:29 +00:00
|
|
|
style: 'success',
|
|
|
|
icon: 'cached'
|
|
|
|
})
|
|
|
|
},
|
2018-06-26 00:55:00 +00:00
|
|
|
async save() {
|
2018-06-04 04:41:29 +00:00
|
|
|
this.$store.commit(`loadingStart`, 'admin-auth-savestrategies')
|
2019-01-13 03:33:30 +00:00
|
|
|
try {
|
|
|
|
await this.$apollo.mutate({
|
|
|
|
mutation: strategiesSaveMutation,
|
|
|
|
variables: {
|
|
|
|
config: {
|
|
|
|
audience: this.jwtAudience,
|
|
|
|
tokenExpiration: this.jwtExpiration,
|
|
|
|
tokenRenewal: this.jwtRenewablePeriod
|
|
|
|
},
|
|
|
|
strategies: this.strategies.map(str => _.pick(str, [
|
|
|
|
'isEnabled',
|
|
|
|
'key',
|
|
|
|
'config',
|
|
|
|
'selfRegistration',
|
|
|
|
'domainWhitelist',
|
|
|
|
'autoEnrollGroups'
|
|
|
|
])).map(str => ({...str, config: str.config.map(cfg => ({...cfg, value: JSON.stringify({ v: cfg.value.value })}))}))
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.$store.commit('showNotification', {
|
2019-06-10 03:39:37 +00:00
|
|
|
message: this.$t('admin:auth.saveSuccess'),
|
2019-01-13 03:33:30 +00:00
|
|
|
style: 'success',
|
|
|
|
icon: 'check'
|
|
|
|
})
|
|
|
|
} catch (err) {
|
|
|
|
this.$store.commit('pushGraphError', err)
|
|
|
|
}
|
2018-06-04 04:41:29 +00:00
|
|
|
this.$store.commit(`loadingStop`, 'admin-auth-savestrategies')
|
2018-03-06 01:53:24 +00:00
|
|
|
}
|
2018-03-06 04:13:20 +00:00
|
|
|
},
|
2018-06-04 04:41:29 +00:00
|
|
|
apollo: {
|
|
|
|
strategies: {
|
|
|
|
query: strategiesQuery,
|
|
|
|
fetchPolicy: 'network-only',
|
2019-04-21 00:49:05 +00:00
|
|
|
update: (data) => _.cloneDeep(data.authentication.strategies).map(str => ({
|
|
|
|
...str,
|
|
|
|
config: _.sortBy(str.config.map(cfg => ({
|
|
|
|
...cfg,
|
|
|
|
value: JSON.parse(cfg.value)
|
|
|
|
})), [t => t.value.order])
|
|
|
|
})),
|
2018-06-04 04:41:29 +00:00
|
|
|
watchLoading (isLoading) {
|
|
|
|
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-auth-refresh')
|
|
|
|
}
|
2018-06-26 00:55:00 +00:00
|
|
|
},
|
|
|
|
groups: {
|
|
|
|
query: groupsQuery,
|
|
|
|
fetchPolicy: 'network-only',
|
|
|
|
update: (data) => data.groups.list,
|
|
|
|
watchLoading (isLoading) {
|
|
|
|
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-auth-groups-refresh')
|
|
|
|
}
|
2019-04-21 00:49:05 +00:00
|
|
|
},
|
|
|
|
host: {
|
|
|
|
query: hostQuery,
|
|
|
|
fetchPolicy: 'network-only',
|
|
|
|
update: (data) => _.cloneDeep(data.site.config.host),
|
|
|
|
watchLoading (isLoading) {
|
|
|
|
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-auth-host-refresh')
|
|
|
|
}
|
2018-03-06 04:13:20 +00:00
|
|
|
}
|
2018-03-04 02:48:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2018-08-04 21:27:55 +00:00
|
|
|
<style lang='scss' scoped>
|
|
|
|
|
|
|
|
.authlogo {
|
|
|
|
width: 250px;
|
|
|
|
height: 85px;
|
|
|
|
float:right;
|
|
|
|
display: flex;
|
|
|
|
justify-content: flex-end;
|
|
|
|
align-items: center;
|
2019-08-03 04:48:55 +00:00
|
|
|
margin-left: 16px;
|
2018-08-04 21:27:55 +00:00
|
|
|
|
|
|
|
img {
|
|
|
|
max-width: 100%;
|
|
|
|
max-height: 50px;
|
|
|
|
}
|
|
|
|
}
|
2018-03-04 02:48:28 +00:00
|
|
|
|
|
|
|
</style>
|