admin-logging.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template lang='pug'>
  2. v-card(flat)
  3. v-card(color='grey lighten-5')
  4. .pa-3.pt-4
  5. .headline.primary--text Logging
  6. .subheading.grey--text Configure the system logger(s)
  7. v-tabs(color='grey lighten-4', fixed-tabs, slider-color='primary', show-arrows)
  8. v-tab(key='settings'): v-icon settings
  9. v-tab(v-for='svc in activeServices', :key='svc.key') {{ svc.title }}
  10. v-tab-item(key='settings', :transition='false', :reverse-transition='false')
  11. v-card.pa-3
  12. .body-2.pb-2 Select which logging service to enable:
  13. v-form
  14. v-checkbox(
  15. v-for='(svc, n) in services',
  16. v-model='selectedServices',
  17. :key='svc.key',
  18. :label='svc.title',
  19. :value='svc.key',
  20. color='primary',
  21. :disabled='svc.key === `console`'
  22. hide-details
  23. )
  24. v-divider
  25. v-btn(color='primary')
  26. v-icon(left) chevron_right
  27. | Set Services
  28. v-btn(color='black', dark)
  29. v-icon(left) keyboard
  30. | View Console
  31. v-btn(color='black', dark)
  32. v-icon(left) layers_clear
  33. | Purge Logs
  34. v-btn(icon, @click='refresh')
  35. v-icon.grey--text refresh
  36. v-tab-item(v-for='(svc, n) in activeServices', :key='svc.key', :transition='false', :reverse-transition='false')
  37. v-card.pa-3
  38. v-form
  39. v-subheader Service Configuration
  40. .body-1(v-if='!svc.props || svc.props.length < 1') This logging service has no configuration options you can modify.
  41. v-text-field(v-else, v-for='prop in svc.props', :key='prop', :label='prop', prepend-icon='mode_edit')
  42. v-divider
  43. v-btn(color='primary')
  44. v-icon(left) chevron_right
  45. | Save Configuration
  46. v-snackbar(
  47. color='success'
  48. top
  49. v-model='refreshCompleted'
  50. )
  51. v-icon.mr-3(dark) cached
  52. | List of logging services has been refreshed.
  53. </template>
  54. <script>
  55. import _ from 'lodash'
  56. /* global CONSTANTS */
  57. export default {
  58. data() {
  59. return {
  60. services: [],
  61. selectedServices: ['console'],
  62. refreshCompleted: false
  63. }
  64. },
  65. computed: {
  66. activeServices() {
  67. return _.filter(this.services, 'isEnabled')
  68. }
  69. },
  70. apollo: {
  71. services: {
  72. query: CONSTANTS.GRAPH.AUTHENTICATION.QUERY_PROVIDERS,
  73. update: (data) => data.authentication.providers
  74. }
  75. },
  76. methods: {
  77. async refresh() {
  78. await this.$apollo.queries.services.refetch()
  79. this.refreshCompleted = true
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang='scss'>
  85. </style>