|
106 | 106 | <div class="resource-detail-item" v-if="resource.id"> |
107 | 107 | <div class="resource-detail-item__label">{{ $t('label.id') }}</div> |
108 | 108 | <div class="resource-detail-item__details"> |
109 | | - <a-tooltip placement="right" > |
110 | | - <template slot="title"> |
111 | | - <span>{{ $t('label.copyid') }}</span> |
112 | | - </template> |
113 | | - <a-button |
114 | | - style="margin-left: -5px" |
115 | | - shape="circle" |
116 | | - icon="barcode" |
117 | | - type="dashed" |
118 | | - size="small" |
119 | | - @click="$message.success($t('label.copied.clipboard'))" |
120 | | - v-clipboard:copy="resource.id" /> |
121 | | - </a-tooltip> |
| 109 | + <tooltip-button |
| 110 | + tooltipPlacement="right" |
| 111 | + :tooltip="$t('label.copyid')" |
| 112 | + style="margin-left: -5px" |
| 113 | + icon="barcode" |
| 114 | + type="dashed" |
| 115 | + size="small" |
| 116 | + @click="$message.success($t('label.copied.clipboard'))" |
| 117 | + v-clipboard:copy="resource.id" /> |
122 | 118 | <span style="margin-left: 10px;">{{ resource.id }}</span> |
123 | 119 | </div> |
124 | 120 | </div> |
|
573 | 569 | <a-icon type="key" /> |
574 | 570 | <strong> |
575 | 571 | {{ $t('label.apikey') }} |
576 | | - <a-tooltip placement="right" > |
577 | | - <template slot="title"> |
578 | | - <span>{{ $t('label.copy') + ' ' + $t('label.apikey') }}</span> |
579 | | - </template> |
580 | | - <a-button shape="circle" type="dashed" size="small" @click="$message.success($t('label.copied.clipboard'))" v-clipboard:copy="resource.apikey"> |
581 | | - <a-icon type="copy"/> |
582 | | - </a-button> |
583 | | - </a-tooltip> |
| 572 | + <tooltip-button |
| 573 | + tooltipPlacement="right" |
| 574 | + :tooltip="$t('label.copy') + ' ' + $t('label.apikey')" |
| 575 | + icon="copy" |
| 576 | + type="dashed" |
| 577 | + size="small" |
| 578 | + @click="$message.success($t('label.copied.clipboard'))" |
| 579 | + v-clipboard:copy="resource.apikey" /> |
584 | 580 | </strong> |
585 | 581 | <div> |
586 | 582 | {{ resource.apikey.substring(0, 20) }}... |
|
590 | 586 | <a-icon type="lock" /> |
591 | 587 | <strong> |
592 | 588 | {{ $t('label.secretkey') }} |
593 | | - <a-tooltip placement="right" > |
594 | | - <template slot="title"> |
595 | | - <span>{{ $t('label.copy') + ' ' + $t('label.secretkey') }}</span> |
596 | | - </template> |
597 | | - <a-button shape="circle" type="dashed" size="small" @click="$message.success($t('label.copied.clipboard'))" v-clipboard:copy="resource.secretkey"> |
598 | | - <a-icon type="copy"/> |
599 | | - </a-button> |
600 | | - </a-tooltip> |
| 589 | + <tooltip-button |
| 590 | + tooltipPlacement="right" |
| 591 | + :tooltip="$t('label.copy') + ' ' + $t('label.secretkey')" |
| 592 | + icon="copy" |
| 593 | + type="dashed" |
| 594 | + size="small" |
| 595 | + @click="$message.success($t('label.copied.clipboard'))" |
| 596 | + v-clipboard:copy="resource.secretkey" /> |
601 | 597 | </strong> |
602 | 598 | <div> |
603 | 599 | {{ resource.secretkey.substring(0, 20) }}... |
|
626 | 622 | <a-input ref="input" :value="inputKey" @change="handleKeyChange" style="width: 30%; text-align: center" :placeholder="$t('label.key')" /> |
627 | 623 | <a-input style=" width: 30px; border-left: 0; pointer-events: none; backgroundColor: #fff" placeholder="=" disabled /> |
628 | 624 | <a-input :value="inputValue" @change="handleValueChange" style="width: 30%; text-align: center; border-left: 0" :placeholder="$t('label.value')" /> |
629 | | - <a-button shape="circle" size="small" @click="handleInputConfirm"> |
630 | | - <a-icon type="check"/> |
631 | | - </a-button> |
632 | | - <a-button shape="circle" size="small" @click="inputVisible=false"> |
633 | | - <a-icon type="close"/> |
634 | | - </a-button> |
| 625 | + <tooltip-button :tooltip="$t('label.ok')" icon="check" size="small" @click="handleInputConfirm" /> |
| 626 | + <tooltip-button :tooltip="$t('label.cancel')" icon="close" size="small" @click="inputVisible=false" /> |
635 | 627 | </a-input-group> |
636 | 628 | </div> |
637 | 629 | <a-tag @click="showInput" style="background: #fff; borderStyle: dashed;" v-else-if="isAdminOrOwner() && 'createTags' in $store.getters.apis"> |
@@ -701,13 +693,15 @@ import { api } from '@/api' |
701 | 693 | import Console from '@/components/widgets/Console' |
702 | 694 | import OsLogo from '@/components/widgets/OsLogo' |
703 | 695 | import Status from '@/components/widgets/Status' |
| 696 | +import TooltipButton from '@/components/view/TooltipButton' |
704 | 697 |
|
705 | 698 | export default { |
706 | 699 | name: 'InfoCard', |
707 | 700 | components: { |
708 | 701 | Console, |
709 | 702 | OsLogo, |
710 | | - Status |
| 703 | + Status, |
| 704 | + TooltipButton |
711 | 705 | }, |
712 | 706 | props: { |
713 | 707 | resource: { |
|
0 commit comments