AdminFlags.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template lang='pug'>
  2. q-page.admin-flags
  3. .row.q-pa-md.items-center
  4. .col-auto
  5. img.admin-icon.animated.fadeInLeft(src='/_assets/icons/fluent-windsock.svg')
  6. .col.q-pl-md
  7. .text-h5.text-primary.animated.fadeInLeft {{ t('admin.flags.title') }}
  8. .text-subtitle1.text-grey.animated.fadeInLeft.wait-p2s {{ t('admin.flags.subtitle') }}
  9. .col-auto
  10. q-btn.q-mr-sm.acrylic-btn(
  11. icon='las la-question-circle'
  12. flat
  13. color='grey'
  14. href='https://docs.requarks.io/admin/flags'
  15. target='_blank'
  16. type='a'
  17. )
  18. q-btn(
  19. unelevated
  20. icon='fa-solid fa-check'
  21. :label='t(`common.actions.apply`)'
  22. color='secondary'
  23. @click='save'
  24. :loading='loading'
  25. )
  26. q-separator(inset)
  27. .row.q-pa-md.q-col-gutter-md
  28. .col-12.col-lg-7
  29. q-card.shadow-1.q-py-sm
  30. q-item
  31. q-item-section
  32. q-card.bg-negative.text-white.rounded-borders(flat)
  33. q-card-section.items-center(horizontal)
  34. q-card-section.col-auto.q-pr-none
  35. q-icon(name='las la-exclamation-triangle', size='sm')
  36. q-card-section
  37. span {{ t('admin.flags.warn.label') }}
  38. .text-caption.text-red-1 {{ t('admin.flags.warn.hint') }}
  39. q-item(tag='label', v-ripple)
  40. blueprint-icon(icon='flag-filled')
  41. q-item-section
  42. q-item-label {{t(`admin.flags.ldapdebug.label`)}}
  43. q-item-label(caption) {{t(`admin.flags.ldapdebug.hint`)}}
  44. q-item-section(avatar)
  45. q-toggle(
  46. v-model='flags.ldapdebug'
  47. color='primary'
  48. checked-icon='las la-check'
  49. unchecked-icon='las la-times'
  50. :aria-label='t(`admin.flags.ldapdebug.label`)'
  51. )
  52. q-separator.q-my-sm(inset)
  53. q-item(tag='label', v-ripple)
  54. blueprint-icon(icon='flag-filled')
  55. q-item-section
  56. q-item-label {{t(`admin.flags.sqllog.label`)}}
  57. q-item-label(caption) {{t(`admin.flags.sqllog.hint`)}}
  58. q-item-section(avatar)
  59. q-toggle(
  60. v-model='flags.sqllog'
  61. color='primary'
  62. checked-icon='las la-check'
  63. unchecked-icon='las la-times'
  64. :aria-label='t(`admin.flags.sqllog.label`)'
  65. )
  66. q-card.shadow-1.q-py-sm.q-mt-md
  67. q-item(tag='label', v-ripple)
  68. blueprint-icon(icon='heart-outline')
  69. q-item-section
  70. q-item-label {{t(`admin.flags.hidedonatebtn.label`)}}
  71. q-item-label(caption) {{t(`admin.flags.hidedonatebtn.hint`)}}
  72. q-item-section(avatar)
  73. q-toggle(
  74. v-model='flags.hidedonatebtn'
  75. color='primary'
  76. checked-icon='las la-check'
  77. unchecked-icon='las la-times'
  78. :aria-label='t(`admin.flags.hidedonatebtn.label`)'
  79. )
  80. </template>
  81. <script setup>
  82. import gql from 'graphql-tag'
  83. import { defineAsyncComponent, onMounted, reactive, ref, watch } from 'vue'
  84. import _transform from 'lodash/transform'
  85. import { useMeta } from 'quasar'
  86. import { useI18n } from 'vue-i18n'
  87. // STORES / ROUTERS / i18n
  88. const { t } = useI18n()
  89. // META
  90. useMeta({
  91. title: t('admin.flags.title')
  92. })
  93. const loading = ref(false)
  94. const flags = reactive({
  95. ldapdebug: false,
  96. sqllog: false,
  97. hidedonatebtn: false
  98. })
  99. const save = async () => {
  100. }
  101. // methods: {
  102. // async save () {
  103. // try {
  104. // await this.$apollo.mutate({
  105. // mutation: gql`
  106. // mutation updateFlags (
  107. // $flags: [SystemFlagInput]!
  108. // ) {
  109. // updateSystemFlags(
  110. // flags: $flags
  111. // ) {
  112. // status {
  113. // succeeded
  114. // slug
  115. // message
  116. // }
  117. // }
  118. // }
  119. // `,
  120. // variables: {
  121. // flags: _transform(this.flags, (result, value, key) => {
  122. // result.push({ key, value })
  123. // }, [])
  124. // },
  125. // watchLoading (isLoading) {
  126. // this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-flags-update')
  127. // }
  128. // })
  129. // this.$store.commit('showNotification', {
  130. // style: 'success',
  131. // message: 'Flags applied successfully.',
  132. // icon: 'check'
  133. // })
  134. // } catch (err) {
  135. // this.$store.commit('pushGraphError', err)
  136. // }
  137. // }
  138. // }
  139. // apollo: {
  140. // flags: {
  141. // query: gql``,
  142. // fetchPolicy: 'network-only',
  143. // update: (data) => _transform(data.system.flags, (result, row) => {
  144. // _set(result, row.key, row.value)
  145. // }, {}),
  146. // watchLoading (isLoading) {
  147. // this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-flags-refresh')
  148. // }
  149. // }
  150. // }
  151. </script>
  152. <style lang='scss'>
  153. </style>