diff --git a/ui/src/views/application-overview/index.vue b/ui/src/views/application-overview/index.vue index 5ac8c2dff..50ba634ae 100644 --- a/ui/src/views/application-overview/index.vue +++ b/ui/src/views/application-overview/index.vue @@ -42,7 +42,7 @@ - +
{{ $t('views.applicationOverview.appInfo.publicAccessLink') @@ -58,8 +58,8 @@ />
-
- +
+ {{ shareUrl }} @@ -88,7 +88,7 @@
- +
{{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }} @@ -106,10 +106,13 @@ {{ apiUrl }}
- - + @@ -199,8 +206,12 @@ const detail = ref(null) const loading = ref(false) -const urlParams = computed(() => mapToUrlParams(apiInputParams.value) ? '?' + mapToUrlParams(apiInputParams.value) : '') -const shareUrl = computed(() => application.location + accessToken.value.access_token + urlParams.value) +const urlParams = computed(() => + mapToUrlParams(apiInputParams.value) ? '?' + mapToUrlParams(apiInputParams.value) : '' +) +const shareUrl = computed( + () => application.location + accessToken.value.access_token + urlParams.value +) const dayOptions = [ { @@ -328,17 +339,18 @@ function getAccessToken() { function getDetail() { application.asyncGetApplicationDetail(id, loading).then((res: any) => { detail.value = res.data - detail.value.work_flow?.nodes?.filter((v: any) => v.id === 'base-node') + detail.value.work_flow?.nodes + ?.filter((v: any) => v.id === 'base-node') .map((v: any) => { apiInputParams.value = v.properties.input_field_list ? v.properties.input_field_list - .filter((v: any) => v.assignment_method === 'api_input') - .map((v: any) => { - return { - name: v.variable, - value: v.default_value - } - }) + .filter((v: any) => v.assignment_method === 'api_input') + .map((v: any) => { + return { + name: v.variable, + value: v.default_value + } + }) : [] }) }) @@ -352,15 +364,14 @@ function refreshIcon() { getDetail() } - function mapToUrlParams(map: any[]) { - const params = new URLSearchParams(); + const params = new URLSearchParams() - map.forEach((item: any) => { - params.append(encodeURIComponent(item.name), encodeURIComponent(item.value)); - }); + map.forEach((item: any) => { + params.append(encodeURIComponent(item.name), encodeURIComponent(item.value)) + }) - return params.toString(); // 返回 URL 查询字符串 + return params.toString() // 返回 URL 查询字符串 } onMounted(() => {