ExportUrl.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <base-dialog @cancel="cancelDialog">
  3. <div slot="header">{{$t('compute.image.export.url.title')}}</div>
  4. <div slot="body">
  5. <p>{{ $t('compute.image.export.url.title.tips') }}</p>
  6. <div class="d-flex align-items-center list-body-cell-wrap">
  7. <pre class="image-url-export">{{ params.url }}</pre>
  8. <copy :message="params.url" />
  9. </div>
  10. </div>
  11. <div slot="footer">
  12. <a-button type="primary" @click="handleConfirm" :loading="loading">{{ $t('compute.image.export.url.confirm') }}</a-button>
  13. <a-button @click="cancelDialog">{{ $t('dialog.cancel') }}</a-button>
  14. </div>
  15. </base-dialog>
  16. </template>
  17. <script>
  18. import DialogMixin from '@/mixins/dialog'
  19. import WindowsMixin from '@/mixins/windows'
  20. export default {
  21. name: 'ImageExportUrlDialog',
  22. mixins: [DialogMixin, WindowsMixin],
  23. data () {
  24. return {
  25. cmOptions: {
  26. tabSize: 2,
  27. styleActiveLine: true,
  28. lineNumbers: true,
  29. lineWrapping: true,
  30. line: true,
  31. mode: 'text/plain',
  32. theme: 'material',
  33. },
  34. }
  35. },
  36. methods: {
  37. handleConfirm () {
  38. try {
  39. this.$copyText(this.params.url)
  40. this.cancelDialog()
  41. this.$message.success(this.$t('common.copy'))
  42. } catch (error) {
  43. this.$message.warn(this.$t('common.copyError'))
  44. }
  45. },
  46. },
  47. }
  48. </script>
  49. <style lang="less" scoped>
  50. .image-url-export {
  51. white-space: pre-wrap; /* Since CSS 2.1 */
  52. white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
  53. white-space: -o-pre-wrap; /* Opera 7 */
  54. word-wrap: break-word; /* Internet Explorer 5.5+ */
  55. }
  56. </style>