|
105 | 105 | </div> |
106 | 106 | <el-card v-if="form.trigger_type === 'EVENT'" shadow="never" class="card-never mt-16"> |
107 | 107 | <el-form-item :label="$t('views.trigger.from.event_url.label')"> |
108 | | - <div class="complex-input flex align-center w-full" style="background-color: #ffffff"> |
| 108 | + <div |
| 109 | + class="complex-input flex-between align-center w-full" |
| 110 | + style="background-color: #ffffff" |
| 111 | + > |
109 | 112 | <el-input |
110 | 113 | class="complex-input__left" |
111 | 114 | v-bind:modelValue="event_url" |
112 | 115 | readonly |
113 | 116 | ></el-input> |
114 | 117 |
|
115 | 118 | <el-tooltip :content="$t('common.copy')" placement="top"> |
116 | | - <el-button text @click="copy"> |
| 119 | + <el-button text @click="copyClick(event_url)" class="mr-4"> |
117 | 120 | <AppIcon iconName="app-copy" class="color-secondary"></AppIcon> |
118 | 121 | </el-button> |
119 | 122 | </el-tooltip> |
120 | 123 | </div> |
121 | 124 | </el-form-item> |
122 | 125 | <el-form-item label="Bearer Token"> |
123 | | - <el-input |
124 | | - type="password" |
125 | | - :placeholder="$t('common.inputPlaceholder')" |
126 | | - v-model="form.trigger_setting.token" |
127 | | - show-password |
128 | | - readonly |
129 | | - > |
130 | | - </el-input> |
| 126 | + <div class="complex-input flex-between w-full" style="background-color: #ffffff"> |
| 127 | + <el-input |
| 128 | + class="complex-input__left" |
| 129 | + :placeholder="$t('common.inputPlaceholder')" |
| 130 | + v-model="form.trigger_setting.token" |
| 131 | + readonly |
| 132 | + style="width: 80%" |
| 133 | + > |
| 134 | + </el-input> |
| 135 | + <div> |
| 136 | + <el-tooltip :content="$t('common.copy')" placement="top"> |
| 137 | + <el-button text @click="copyClick(form.trigger_setting.token)"> |
| 138 | + <AppIcon iconName="app-copy" class="color-secondary"></AppIcon> |
| 139 | + </el-button> |
| 140 | + </el-tooltip> |
| 141 | + <el-tooltip :content="$t('common.refresh')" placement="top"> |
| 142 | + <el-button @click="refreshToken" text style="margin: 0 4px 0 0 !important"> |
| 143 | + <AppIcon iconName="app-refresh" class="color-secondary"></AppIcon> |
| 144 | + </el-button> |
| 145 | + </el-tooltip> |
| 146 | + </div> |
| 147 | + </div> |
131 | 148 | </el-form-item> |
132 | 149 | <el-form-item> |
133 | 150 | <template #label> |
@@ -538,9 +555,7 @@ const editPermission = computed(() => { |
538 | 555 | }) |
539 | 556 |
|
540 | 557 | const triggerFormRef = ref<FormInstance>() |
541 | | -const copy = () => { |
542 | | - copyClick(event_url.value) |
543 | | -} |
| 558 | +
|
544 | 559 | const addParameter = () => { |
545 | 560 | form.value.trigger_setting.body.push({ field: '', type: '' }) |
546 | 561 | } |
@@ -681,7 +696,7 @@ const getDefaultValue = () => { |
681 | 696 | trigger_task: [], |
682 | 697 | trigger_type: 'SCHEDULED', |
683 | 698 | trigger_setting: { |
684 | | - token: uuidv4().replace('-', ''), |
| 699 | + token: uuidv4().replace(/-/g, ''), |
685 | 700 | body: [], |
686 | 701 | }, |
687 | 702 | } |
@@ -726,6 +741,10 @@ const init = (trigger_id: string) => { |
726 | 741 | }) |
727 | 742 | } |
728 | 743 | } |
| 744 | +
|
| 745 | +function refreshToken() { |
| 746 | + form.value.trigger_setting.token = uuidv4().replace(/-/g, '') |
| 747 | +} |
729 | 748 | const current_trigger_id = ref<string>() |
730 | 749 | const current_source_id = ref<string>() |
731 | 750 | const current_source_type = ref<string>() |
|
0 commit comments