2
0

admin-logging.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. export default {
  57. data() {
  58. return {
  59. services: [],
  60. selectedServices: ['console'],
  61. refreshCompleted: false
  62. }
  63. },
  64. computed: {
  65. activeServices() {
  66. return _.filter(this.services, 'isEnabled')
  67. }
  68. },
  69. // apollo: {
  70. // services: {
  71. // query: CONSTANTS.GRAPH.AUTHENTICATION.QUERY_PROVIDERS,
  72. // update: (data) => data.authentication.providers
  73. // }
  74. // },
  75. methods: {
  76. async refresh() {
  77. await this.$apollo.queries.services.refetch()
  78. this.refreshCompleted = true
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang='scss'>
  84. </style>