admin-auth.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template lang='pug'>
  2. v-card(flat)
  3. v-card(color='grey lighten-5')
  4. .pa-3.pt-4
  5. .headline.primary--text Authentication
  6. .subheading.grey--text Configure the authentication settings of your wiki
  7. v-tabs(color='grey lighten-4', grow, slider-color='primary', show-arrows)
  8. v-tab(key='settings'): v-icon settings
  9. v-tab(v-for='provider in providers', :key='provider.key') {{ provider.title }}
  10. v-tab-item(key='settings', :transition='false', :reverse-transition='false')
  11. v-card.pa-3
  12. .body-2.pb-2 Select which authentication providers are enabled:
  13. v-form
  14. v-checkbox(
  15. v-for='(provider, n) in providers',
  16. v-model='auths',
  17. :key='provider.key',
  18. :label='provider.title',
  19. :value='provider.key',
  20. color='primary',
  21. :disabled='provider.key === `local`'
  22. hide-details
  23. )
  24. v-divider
  25. v-btn(color='primary')
  26. v-icon(left) chevron_right
  27. | Set Providers
  28. v-btn(color='black', dark)
  29. v-icon(left) layers_clear
  30. | Flush Sessions
  31. v-btn(icon, @click='refresh')
  32. v-icon.grey--text refresh
  33. v-tab-item(v-for='(provider, n) in providers', :key='provider.key', :transition='false', :reverse-transition='false')
  34. v-card.pa-3
  35. .body-1(v-if='!provider.props || provider.props.length < 1') This provider has no configuration options you can modify.
  36. v-form(v-else)
  37. v-text-field(v-for='prop in provider.props', :key='prop', :label='prop', prepend-icon='mode_edit')
  38. v-divider
  39. v-btn(color='primary')
  40. v-icon(left) chevron_right
  41. | Save Configuration
  42. v-snackbar(
  43. color='success'
  44. top
  45. v-model='refreshCompleted'
  46. )
  47. v-icon.mr-3(dark) cached
  48. | List of providers has been refreshed.
  49. </template>
  50. <script>
  51. /* global CONSTANTS */
  52. export default {
  53. data() {
  54. return {
  55. providers: [],
  56. auths: ['local'],
  57. refreshCompleted: false
  58. }
  59. },
  60. apollo: {
  61. providers: {
  62. query: CONSTANTS.GRAPH.AUTHENTICATION.QUERY_PROVIDERS,
  63. update: (data) => data.authentication.providers
  64. }
  65. },
  66. methods: {
  67. async refresh() {
  68. await this.$apollo.queries.providers.refetch()
  69. this.refreshCompleted = true
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang='scss'>
  75. </style>