|
21 | 21 | <el-row :gutter="12"> |
22 | 22 | <el-col :span="12" class="mt-16"> |
23 | 23 | <div class="flex"> |
24 | | - <el-text type="info">{{ $t('views.applicationOverview.appInfo.publicAccessLink') }} |
| 24 | + <el-text type="info" |
| 25 | + >{{ $t('views.applicationOverview.appInfo.publicAccessLink') }} |
25 | 26 | </el-text> |
26 | | - <el-switch v-model="accessToken.is_active" class="ml-8" size="small" inline-prompt |
| 27 | + <el-switch |
| 28 | + v-model="accessToken.is_active" |
| 29 | + class="ml-8" |
| 30 | + size="small" |
| 31 | + inline-prompt |
27 | 32 | :active-text="$t('views.applicationOverview.appInfo.openText')" |
28 | 33 | :inactive-text="$t('views.applicationOverview.appInfo.closeText')" |
29 | | - :before-change="() => changeState(accessToken.is_active)" /> |
| 34 | + :before-change="() => changeState(accessToken.is_active)" |
| 35 | + /> |
30 | 36 | </div> |
31 | 37 |
|
32 | 38 | <div class="mt-4 mb-16 url-height flex align-center" style="margin-bottom: 37px"> |
|
39 | 45 | </el-button> |
40 | 46 | </el-tooltip> |
41 | 47 | <el-tooltip effect="dark" :content="$t('common.refresh')" placement="top"> |
42 | | - <el-button @click="refreshAccessToken" type="primary" text style="margin-left: 1px"> |
| 48 | + <el-button |
| 49 | + @click="refreshAccessToken" |
| 50 | + type="primary" |
| 51 | + text |
| 52 | + style="margin-left: 1px" |
| 53 | + > |
43 | 54 | <el-icon> |
44 | 55 | <RefreshRight /> |
45 | 56 | </el-icon> |
46 | 57 | </el-button> |
47 | 58 | </el-tooltip> |
48 | 59 | </div> |
49 | 60 | <div> |
50 | | - <el-button v-if="accessToken?.is_active" :disabled="!accessToken?.is_active" tag="a" :href="shareUrl" |
51 | | - target="_blank"> |
| 61 | + <el-button |
| 62 | + v-if="accessToken?.is_active" |
| 63 | + :disabled="!accessToken?.is_active" |
| 64 | + tag="a" |
| 65 | + :href="shareUrl" |
| 66 | + target="_blank" |
| 67 | + > |
52 | 68 | <AppIcon iconName="app-create-chat" class="mr-4"></AppIcon> |
53 | 69 | {{ $t('views.application.operation.toChat') }} |
54 | 70 | </el-button> |
55 | 71 | <el-button v-else :disabled="!accessToken?.is_active"> |
56 | 72 | <AppIcon iconName="app-create-chat" class="mr-4"></AppIcon> |
57 | 73 | {{ $t('views.application.operation.toChat') }} |
58 | 74 | </el-button> |
59 | | - <el-button :disabled="!accessToken?.is_active" @click="openDialog" |
60 | | - v-if="permissionPrecise.overview_embed(id)"> |
| 75 | + <el-button |
| 76 | + :disabled="!accessToken?.is_active" |
| 77 | + @click="openDialog" |
| 78 | + v-if="permissionPrecise.overview_embed(id)" |
| 79 | + > |
61 | 80 | <AppIcon iconName="app-export" class="mr-4"></AppIcon> |
62 | 81 | {{ $t('views.applicationOverview.appInfo.embedInWebsite') }} |
63 | 82 | </el-button> |
|
69 | 88 | {{ $t('views.applicationOverview.appInfo.accessControl') }} |
70 | 89 | </el-button> |
71 | 90 | <!-- 显示设置 --> |
72 | | - <el-button @click="openDisplaySettingDialog" v-if="permissionPrecise.overview_display(id)"> |
| 91 | + <el-button |
| 92 | + @click="openDisplaySettingDialog" |
| 93 | + v-if="permissionPrecise.overview_display(id)" |
| 94 | + > |
73 | 95 | <el-icon class="mr-4"> |
74 | 96 | <Setting /> |
75 | 97 | </el-icon> |
|
79 | 101 | </el-col> |
80 | 102 | <el-col :span="12" class="mt-16"> |
81 | 103 | <div class="flex"> |
82 | | - <el-text type="info">{{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }} |
| 104 | + <el-text type="info" |
| 105 | + >{{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }} |
83 | 106 | </el-text> |
84 | 107 | </div> |
85 | 108 | <div class="mt-4 mb-16 url-height"> |
86 | 109 | <div> |
87 | 110 | <el-text>API {{ $t('common.fileUpload.document') }}: </el-text> |
88 | | - <el-button type="primary" link @click="toUrl(apiUrl)" class="vertical-middle lighter break-all"> |
| 111 | + <el-button |
| 112 | + type="primary" |
| 113 | + link |
| 114 | + @click="toUrl(apiUrl)" |
| 115 | + class="vertical-middle lighter break-all" |
| 116 | + > |
89 | 117 | {{ apiUrl }} |
90 | 118 | </el-button> |
91 | 119 | </div> |
|
96 | 124 |
|
97 | 125 | <span class="vertical-middle lighter break-all ellipsis-1">{{ |
98 | 126 | baseUrl + id |
99 | | - }}</span> |
| 127 | + }}</span> |
100 | 128 | <el-tooltip effect="dark" :content="$t('common.copy')" placement="top"> |
101 | 129 | <el-button type="primary" text @click="copyClick(baseUrl + id)"> |
102 | 130 | <AppIcon iconName="app-copy"></AppIcon> |
|
105 | 133 | </div> |
106 | 134 | </div> |
107 | 135 | <div> |
108 | | - <el-button @click="openAPIKeyDialog" v-if="permissionPrecise.overview_api_key(id)"> |
| 136 | + <el-button |
| 137 | + @click="openAPIKeyDialog" |
| 138 | + v-if="permissionPrecise.overview_api_key(id)" |
| 139 | + > |
109 | 140 | <el-icon class="mr-4"> |
110 | 141 | <Key /> |
111 | 142 | </el-icon> |
|
121 | 152 | {{ $t('views.applicationOverview.monitor.monitoringStatistics') }} |
122 | 153 | </h4> |
123 | 154 | <div class="mb-16"> |
124 | | - <el-select v-model="history_day" class="mr-12" @change="changeDayHandle" style="width: 180px"> |
125 | | - <el-option v-for="item in dayOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| 155 | + <el-select |
| 156 | + v-model="history_day" |
| 157 | + class="mr-12" |
| 158 | + @change="changeDayHandle" |
| 159 | + style="width: 180px" |
| 160 | + > |
| 161 | + <el-option |
| 162 | + v-for="item in dayOptions" |
| 163 | + :key="item.value" |
| 164 | + :label="item.label" |
| 165 | + :value="item.value" |
| 166 | + /> |
126 | 167 | </el-select> |
127 | | - <el-date-picker v-if="history_day === 'other'" v-model="daterangeValue" type="daterange" |
| 168 | + <el-date-picker |
| 169 | + v-if="history_day === 'other'" |
| 170 | + v-model="daterangeValue" |
| 171 | + type="daterange" |
128 | 172 | :start-placeholder="$t('views.applicationOverview.monitor.startDatePlaceholder')" |
129 | | - :end-placeholder="$t('views.applicationOverview.monitor.endDatePlaceholder')" format="YYYY-MM-DD" |
130 | | - value-format="YYYY-MM-DD" @change="changeDayRangeHandle" /> |
| 173 | + :end-placeholder="$t('views.applicationOverview.monitor.endDatePlaceholder')" |
| 174 | + format="YYYY-MM-DD" |
| 175 | + value-format="YYYY-MM-DD" |
| 176 | + @change="changeDayRangeHandle" |
| 177 | + /> |
131 | 178 | </div> |
132 | 179 | <div v-loading="statisticsLoading"> |
133 | 180 | <StatisticsCharts :data="statisticsData" /> |
|
136 | 183 | </div> |
137 | 184 | </el-scrollbar> |
138 | 185 |
|
139 | | - <EmbedDialog ref="EmbedDialogRef" :data="detail" :api-input-params="mapToUrlParams(apiInputParams)" /> |
| 186 | + <EmbedDialog |
| 187 | + ref="EmbedDialogRef" |
| 188 | + :data="detail" |
| 189 | + :api-input-params="mapToUrlParams(apiInputParams)" |
| 190 | + /> |
140 | 191 | <APIKeyDialog ref="APIKeyDialogRef" /> |
141 | 192 |
|
142 | 193 | <!-- 社区版访问限制 --> |
@@ -197,7 +248,10 @@ const urlParams = computed(() => |
197 | 248 | mapToUrlParams(apiInputParams.value) ? '?' + mapToUrlParams(apiInputParams.value) : '', |
198 | 249 | ) |
199 | 250 | const shareUrl = computed( |
200 | | - () => `${window.location.origin}/chat/` + accessToken.value?.access_token + urlParams.value, |
| 251 | + () => |
| 252 | + `${window.location.origin}${window.MaxKB.chatPrefix}/` + |
| 253 | + accessToken.value?.access_token + |
| 254 | + urlParams.value, |
201 | 255 | ) |
202 | 256 |
|
203 | 257 | const dayOptions = [ |
@@ -322,7 +376,7 @@ function refreshAccessToken() { |
322 | 376 | const str = t('views.applicationOverview.appInfo.refreshToken.refreshSuccess') |
323 | 377 | updateAccessToken(obj, str) |
324 | 378 | }) |
325 | | - .catch(() => { }) |
| 379 | + .catch(() => {}) |
326 | 380 | } |
327 | 381 |
|
328 | 382 | async function changeState(bool: boolean) { |
@@ -368,20 +422,20 @@ function getDetail() { |
368 | 422 | .map((v: any) => { |
369 | 423 | apiInputParams.value = v.properties.api_input_field_list |
370 | 424 | ? v.properties.api_input_field_list.map((v: any) => { |
371 | | - return { |
372 | | - name: v.variable, |
373 | | - value: v.default_value, |
374 | | - } |
375 | | - }) |
| 425 | + return { |
| 426 | + name: v.variable, |
| 427 | + value: v.default_value, |
| 428 | + } |
| 429 | + }) |
376 | 430 | : v.properties.input_field_list |
377 | 431 | ? v.properties.input_field_list |
378 | | - .filter((v: any) => v.assignment_method === 'api_input') |
379 | | - .map((v: any) => { |
380 | | - return { |
381 | | - name: v.variable, |
382 | | - value: v.default_value, |
383 | | - } |
384 | | - }) |
| 432 | + .filter((v: any) => v.assignment_method === 'api_input') |
| 433 | + .map((v: any) => { |
| 434 | + return { |
| 435 | + name: v.variable, |
| 436 | + value: v.default_value, |
| 437 | + } |
| 438 | + }) |
385 | 439 | : [] |
386 | 440 | }) |
387 | 441 | }) |
|
0 commit comments