Skip to content

Commit 11d2991

Browse files
fix: trigger
1 parent 1a1d0f1 commit 11d2991

File tree

13 files changed

+202
-137
lines changed

13 files changed

+202
-137
lines changed

ui/src/components/ai-chat/component/operation-button/ChatOperationButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<el-divider direction="vertical" />
4949
<el-tooltip effect="dark" :content="$t('chat.operation.regeneration')" placement="top">
5050
<el-button :disabled="chat_loading" text @click="regeneration">
51-
<el-icon><RefreshRight /></el-icon>
51+
<AppIcon iconName="app-refresh"></AppIcon>
5252
</el-button>
5353
</el-tooltip>
5454
<el-divider direction="vertical" />

ui/src/components/app-icon/index.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,27 @@ export const iconMap: any = {
558558
])
559559
},
560560
},
561+
'app-refresh': {
562+
iconReader: () => {
563+
return h('i', [
564+
h(
565+
'svg',
566+
{
567+
style: { height: '100%', width: '100%' },
568+
viewBox: '0 0 1024 1024',
569+
version: '1.1',
570+
xmlns: 'http://www.w3.org/2000/svg',
571+
},
572+
[
573+
h('path', {
574+
d: 'M757.12 341.333333a298.666667 298.666667 0 1 0 41.173333 256h88.192A384 384 0 1 1 810.666667 270.634667V149.333333a21.333333 21.333333 0 0 1 21.333333-21.333333h42.666667a21.333333 21.333333 0 0 1 21.333333 21.333333V384a42.666667 42.666667 0 0 1-42.666667 42.666667h-234.666666a21.333333 21.333333 0 0 1-21.333334-21.333334v-42.666666a21.333333 21.333333 0 0 1 21.333334-21.333334h138.453333z',
575+
fill: 'currentColor',
576+
}),
577+
],
578+
),
579+
])
580+
},
581+
},
561582
// 动态加载的图标
562583
...dynamicIcons,
563584
}

ui/src/locales/lang/en-US/workflow.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,8 @@ You are a master of problem optimization, adept at accurately inferring user int
532532
len_gt: 'Length greater than',
533533
len_le: 'Length less than or equal to',
534534
len_lt: 'Length less than',
535+
is_true: 'Is true',
536+
is_not_true: 'Is not true',
535537
},
536538
SystemPromptPlaceholder: 'System Prompt, can reference variables in the system, such as',
537539
UserPromptPlaceholder: 'User Prompt, can reference variables in the system, such as',

ui/src/locales/lang/zh-Hant/workflow.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,8 @@ export default {
517517
len_gt: '長度大於',
518518
len_le: '長度小於等於',
519519
len_lt: '長度小於',
520+
is_true: '為真',
521+
is_not_true: '不為真',
520522
},
521523
SystemPromptPlaceholder: '系統提示詞,可以引用系統中的變量:如',
522524
UserPromptPlaceholder: '用戶提示詞,可以引用系統中的變量:如',

ui/src/views/application-overview/index.vue

Lines changed: 48 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="title flex align-center">
1212
<div class="edit-avatar mr-12">
1313
<el-avatar shape="square" :size="32" style="background: none">
14-
<img :src="resetUrl(detail?.icon, resetUrl('./favicon.ico'))" alt=""/>
14+
<img :src="resetUrl(detail?.icon, resetUrl('./favicon.ico'))" alt="" />
1515
</el-avatar>
1616
</div>
1717

@@ -22,7 +22,7 @@
2222
<el-col :span="12" class="mt-16">
2323
<div class="flex">
2424
<el-text type="info"
25-
>{{ $t('views.applicationOverview.appInfo.publicAccessLink') }}
25+
>{{ $t('views.applicationOverview.appInfo.publicAccessLink') }}
2626
</el-text>
2727
<el-switch
2828
v-model="accessToken.is_active"
@@ -51,9 +51,7 @@
5151
text
5252
style="margin-left: 1px"
5353
>
54-
<el-icon>
55-
<RefreshRight/>
56-
</el-icon>
54+
<AppIcon iconName="app-refresh"></AppIcon>
5755
</el-button>
5856
</el-tooltip>
5957
</div>
@@ -98,7 +96,7 @@
9896
<el-col :span="12" class="mt-16">
9997
<div class="flex">
10098
<el-text type="info"
101-
>{{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }}
99+
>{{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }}
102100
</el-text>
103101
</div>
104102
<div class="mt-4 mb-16 url-height">
@@ -119,8 +117,8 @@
119117
</span>
120118

121119
<span class="vertical-middle lighter break-all ellipsis-1">{{
122-
baseUrl + id
123-
}}</span>
120+
baseUrl + id
121+
}}</span>
124122
<el-tooltip effect="dark" :content="$t('common.copy')" placement="top">
125123
<el-button type="primary" text @click="copyClick(baseUrl + id)">
126124
<AppIcon iconName="app-copy"></AppIcon>
@@ -134,7 +132,7 @@
134132
v-if="permissionPrecise.overview_api_key(id)"
135133
>
136134
<el-icon class="mr-4">
137-
<Key/>
135+
<Key />
138136
</el-icon>
139137
{{ $t('views.applicationOverview.appInfo.apiKey') }}
140138
</el-button>
@@ -148,12 +146,7 @@
148146
{{ $t('views.applicationOverview.monitor.monitoringStatistics') }}
149147
</h4>
150148
<div class="mb-16">
151-
<el-select
152-
v-model="history_day"
153-
class="mr-12 w-180"
154-
@change="changeDayHandle"
155-
156-
>
149+
<el-select v-model="history_day" class="mr-12 w-180" @change="changeDayHandle">
157150
<el-option
158151
v-for="item in dayOptions"
159152
:key="item.value"
@@ -173,8 +166,11 @@
173166
/>
174167
</div>
175168
<div v-loading="statisticsLoading">
176-
<StatisticsCharts :data="statisticsData" :token-usage="tokenUsage"
177-
:top-questions="topQuestions"/>
169+
<StatisticsCharts
170+
:data="statisticsData"
171+
:token-usage="tokenUsage"
172+
:top-questions="topQuestions"
173+
/>
178174
</div>
179175
</el-card>
180176
</div>
@@ -185,38 +181,38 @@
185181
:data="detail"
186182
:api-input-params="mapToUrlParams(apiInputParams)"
187183
/>
188-
<APIKeyDialog ref="APIKeyDialogRef"/>
184+
<APIKeyDialog ref="APIKeyDialogRef" />
189185

190186
<!-- 社区版访问限制 -->
191-
<component :is="currentLimitDialog" ref="LimitDialogRef" @refresh="refresh"/>
187+
<component :is="currentLimitDialog" ref="LimitDialogRef" @refresh="refresh" />
192188
<!-- 显示设置 -->
193-
<component :is="currentDisplaySettingDialog" ref="DisplaySettingDialogRef" @refresh="refresh"/>
189+
<component :is="currentDisplaySettingDialog" ref="DisplaySettingDialogRef" @refresh="refresh" />
194190
</div>
195191
</template>
196192
<script setup lang="ts">
197-
import {ref, computed, onMounted, shallowRef, nextTick} from 'vue'
198-
import {useRoute} from 'vue-router'
193+
import { ref, computed, onMounted, shallowRef, nextTick } from 'vue'
194+
import { useRoute } from 'vue-router'
199195
import EmbedDialog from './component/EmbedDialog.vue'
200196
import APIKeyDialog from './component/APIKeyDialog.vue'
201197
import LimitDialog from './component/LimitDialog.vue'
202198
import XPackLimitDrawer from './xpack-component/XPackLimitDrawer.vue'
203199
import DisplaySettingDialog from './component/DisplaySettingDialog.vue'
204200
import XPackDisplaySettingDialog from './xpack-component/XPackDisplaySettingDialog.vue'
205201
import StatisticsCharts from './component/StatisticsCharts.vue'
206-
import {nowDate, beforeDay} from '@/utils/time'
207-
import {MsgSuccess, MsgConfirm} from '@/utils/message'
208-
import {copyClick} from '@/utils/clipboard'
209-
import {resetUrl} from '@/utils/common'
210-
import {mapToUrlParams} from '@/utils/application'
211-
import {t} from '@/locales'
212-
import {EditionConst} from '@/utils/permission/data'
213-
import {hasPermission} from '@/utils/permission/index'
202+
import { nowDate, beforeDay } from '@/utils/time'
203+
import { MsgSuccess, MsgConfirm } from '@/utils/message'
204+
import { copyClick } from '@/utils/clipboard'
205+
import { resetUrl } from '@/utils/common'
206+
import { mapToUrlParams } from '@/utils/application'
207+
import { t } from '@/locales'
208+
import { EditionConst } from '@/utils/permission/data'
209+
import { hasPermission } from '@/utils/permission/index'
214210
import permissionMap from '@/permission'
215-
import {loadSharedApi} from '@/utils/dynamics-api/shared-api'
211+
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
216212
217213
const route = useRoute()
218214
const {
219-
params: {id},
215+
params: { id },
220216
} = route as any
221217
222218
const apiType = computed(() => {
@@ -311,7 +307,7 @@ function openDisplaySettingDialog() {
311307
}
312308
nextTick(() => {
313309
if (currentDisplaySettingDialog.value == XPackDisplaySettingDialog) {
314-
loadSharedApi({type: 'application', systemType: apiType.value})
310+
loadSharedApi({ type: 'application', systemType: apiType.value })
315311
.getApplicationSetting(id)
316312
.then((ok: any) => {
317313
DisplaySettingDialogRef.value?.open(ok.data, detail.value)
@@ -354,18 +350,18 @@ function changeDayRangeHandle(val: string) {
354350
}
355351
356352
function getAppStatistics() {
357-
loadSharedApi({type: 'application', systemType: apiType.value})
353+
loadSharedApi({ type: 'application', systemType: apiType.value })
358354
.getStatistics(id, daterange.value, statisticsLoading)
359355
.then((res: any) => {
360356
statisticsData.value = res.data
361357
})
362-
loadSharedApi({type: 'application', systemType: apiType.value})
358+
loadSharedApi({ type: 'application', systemType: apiType.value })
363359
.getTokenUsage(id, daterange.value, statisticsLoading)
364360
.then((res: any) => {
365361
// [{'token_usage': 200, 'username': '张三'}, ...]
366362
tokenUsage.value = res.data
367363
})
368-
loadSharedApi({type: 'application', systemType: apiType.value})
364+
loadSharedApi({ type: 'application', systemType: apiType.value })
369365
.topQuestions(id, daterange.value, statisticsLoading)
370366
.then((res: any) => {
371367
// [{'chat_record_count': 200, 'username': '张三'}, ...]
@@ -389,8 +385,7 @@ function refreshAccessToken() {
389385
const str = t('views.applicationOverview.appInfo.refreshToken.refreshSuccess')
390386
updateAccessToken(obj, str)
391387
})
392-
.catch(() => {
393-
})
388+
.catch(() => {})
394389
}
395390
396391
async function changeState(bool: boolean) {
@@ -408,7 +403,7 @@ async function changeState(bool: boolean) {
408403
}
409404
410405
async function updateAccessToken(obj: any, str: string) {
411-
loadSharedApi({type: 'application', systemType: apiType.value})
406+
loadSharedApi({ type: 'application', systemType: apiType.value })
412407
.putAccessToken(id as string, obj, loading)
413408
.then((res: any) => {
414409
accessToken.value = res?.data
@@ -425,15 +420,15 @@ function openDialog() {
425420
}
426421
427422
function getAccessToken() {
428-
loadSharedApi({type: 'application', systemType: apiType.value})
423+
loadSharedApi({ type: 'application', systemType: apiType.value })
429424
.getAccessToken(id, loading)
430425
.then((res: any) => {
431426
accessToken.value = res?.data
432427
})
433428
}
434429
435430
function getDetail() {
436-
loadSharedApi({type: 'application', systemType: apiType.value})
431+
loadSharedApi({ type: 'application', systemType: apiType.value })
437432
.getApplicationDetail(id, loading)
438433
.then((res: any) => {
439434
detail.value = res.data
@@ -442,20 +437,20 @@ function getDetail() {
442437
.map((v: any) => {
443438
apiInputParams.value = v.properties.api_input_field_list
444439
? v.properties.api_input_field_list.map((v: any) => {
445-
return {
446-
name: v.variable,
447-
value: v.default_value,
448-
}
449-
})
440+
return {
441+
name: v.variable,
442+
value: v.default_value,
443+
}
444+
})
450445
: v.properties.input_field_list
451446
? v.properties.input_field_list
452-
.filter((v: any) => v.assignment_method === 'api_input')
453-
.map((v: any) => {
454-
return {
455-
name: v.variable,
456-
value: v.default_value,
457-
}
458-
})
447+
.filter((v: any) => v.assignment_method === 'api_input')
448+
.map((v: any) => {
449+
return {
450+
name: v.variable,
451+
value: v.default_value,
452+
}
453+
})
459454
: []
460455
})
461456
})

ui/src/views/application-overview/xpack-component/XPackLimitDrawer.vue

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
</p>
5050
</el-radio>
5151
<el-form-item class="ml-24" v-if="form.authentication_value.type === 'password'">
52-
<div class="complex-search flex align-center">
52+
<div class="complex-input flex align-center">
5353
<el-input
54-
class="authentication-append-input"
54+
class="complex-input__left"
5555
v-model="form.authentication_value.password_value"
5656
readonly
5757
style="width: 268px"
@@ -69,9 +69,7 @@
6969
text
7070
style="margin: 0 4px 0 0 !important"
7171
>
72-
<el-icon class="color-secondary">
73-
<RefreshRight />
74-
</el-icon>
72+
<AppIcon iconName="app-refresh" class="color-secondary"></AppIcon>
7573
</el-button>
7674
</el-tooltip>
7775
</div>
@@ -308,7 +306,4 @@ function firstGeneration() {
308306
309307
defineExpose({ open })
310308
</script>
311-
<style lang="scss" scoped>
312-
.authentication-append-input {
313-
}
314-
</style>
309+
<style lang="scss" scoped></style>

ui/src/views/application/index.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@
245245
></AppIcon>
246246
{{ $t('views.system.resourceAuthorization.title') }}
247247
</el-dropdown-item>
248+
<el-dropdown-item
249+
@click.stop="openTriggerDrawer(item)"
250+
v-if="apiType === 'workspace'"
251+
>
252+
<AppIcon iconName="app-trigger" class="color-secondary"></AppIcon>
253+
{{ $t('views.trigger.title') }}
254+
</el-dropdown-item>
248255
<el-dropdown-item
249256
@click.stop="openMoveToDialog(item)"
250257
v-if="permissionPrecise.edit(item.id) && apiType === 'workspace'"
@@ -302,6 +309,10 @@
302309
ref="ResourceAuthorizationDrawerRef"
303310
/>
304311
<TemplateStoreDialog ref="templateStoreDialogRef" :api-type="apiType" @refresh="getList" />
312+
<ResourceTriggerDrawer
313+
ref="resourceTriggerDrawerRef"
314+
:source="SourceTypeEnum.APPLICATION"
315+
></ResourceTriggerDrawer>
305316
</LayoutContainer>
306317
</template>
307318

@@ -312,6 +323,7 @@ import CreateFolderDialog from '@/components/folder-tree/CreateFolderDialog.vue'
312323
import CopyApplicationDialog from '@/views/application/component/CopyApplicationDialog.vue'
313324
import MoveToDialog from '@/components/folder-tree/MoveToDialog.vue'
314325
import ResourceAuthorizationDrawer from '@/components/resource-authorization-drawer/index.vue'
326+
import ResourceTriggerDrawer from '@/views/trigger/ResourceTriggerDrawer.vue'
315327
import ApplicationApi from '@/api/application/application'
316328
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
317329
import useStore from '@/stores'
@@ -361,6 +373,11 @@ const folderList = ref<any[]>([])
361373
const applicationList = ref<any[]>([])
362374
const CopyApplicationDialogRef = ref()
363375
376+
const resourceTriggerDrawerRef = ref<InstanceType<typeof ResourceTriggerDrawer>>()
377+
const openTriggerDrawer = (data: any) => {
378+
resourceTriggerDrawerRef.value?.open(data)
379+
}
380+
364381
const ResourceAuthorizationDrawerRef = ref()
365382
366383
function openAuthorization(item: any) {

0 commit comments

Comments
 (0)