BaseConfig.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <base-dialog @cancel="cancelDialog">
  3. <div slot="header">{{params.title}}</div>
  4. <div slot="body">
  5. <div v-loading="loading" style="min-height:100px">
  6. <a-form-item v-bind="formItemLayout" :label="key" v-for="(value, key) in infoJson" :key="key">
  7. {{value}}
  8. <copy
  9. class="ml-1"
  10. :message="value" />
  11. </a-form-item>
  12. </div>
  13. </div>
  14. <div slot="footer">
  15. <a-button type="primary" :loading="loading" @click="cancelDialog">{{ $t('dialog.ok') }}</a-button>
  16. <a-button @click="cancelDialog">{{ $t('dialog.cancel') }}</a-button>
  17. </div>
  18. </base-dialog>
  19. </template>
  20. <script>
  21. import DialogMixin from '@/mixins/dialog'
  22. import WindowsMixin from '@/mixins/windows'
  23. import 'codemirror/theme/monokai.css'
  24. import 'codemirror/mode/htmlmixed/htmlmixed.js'
  25. export default {
  26. name: 'IdpBaseConfigDialog',
  27. mixins: [DialogMixin, WindowsMixin],
  28. data () {
  29. return {
  30. loading: false,
  31. infoJson: {},
  32. formItemLayout: {
  33. wrapperCol: {
  34. span: 18,
  35. },
  36. labelCol: {
  37. span: 3,
  38. },
  39. },
  40. }
  41. },
  42. created () {
  43. this.authManager = new this.$Manager('auth/idp', 'v1')
  44. this.queryMetadata()
  45. },
  46. methods: {
  47. async queryMetadata () {
  48. this.loading = true
  49. try {
  50. const { data } = await this.authManager.getSpecific({
  51. id: this.params.data[0].id,
  52. spec: 'info',
  53. })
  54. this.infoJson = data
  55. } catch (err) {
  56. throw err
  57. } finally {
  58. this.loading = false
  59. }
  60. },
  61. },
  62. }
  63. </script>