File tree Expand file tree Collapse file tree 3 files changed +38
-7
lines changed
views/app-store/installed Expand file tree Collapse file tree 3 files changed +38
-7
lines changed Original file line number Diff line number Diff line change @@ -143,8 +143,10 @@ export namespace App {
143143 canUpdate : boolean ;
144144 path : string ;
145145 httpPort ?: number ;
146+ httpsPort ?: number ;
146147 favorite : boolean ;
147148 app : App ;
149+ webUI : string ;
148150 }
149151
150152 export interface AppInstallDto {
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ const get = async () => {
242242 if (res .data .webUI != ' ' ) {
243243 const httpConfig = splitHttp (res .data .webUI );
244244 webUI .domain = httpConfig .url ;
245- webUI .protocol = httpConfig .proto ;
245+ webUI .protocol = httpConfig .proto + ' :// ' ;
246246 }
247247 appType .value = res .data .type ;
248248 } catch (error ) {
@@ -289,14 +289,15 @@ const submit = async (formEl: FormInstance) => {
289289};
290290
291291const updateAppConfig = async () => {
292- if (! webUI .domain || webUI .domain === ' ' ) {
293- return ;
294- }
295292 try {
296- await updateInstallConfig ( {
293+ let req = {
297294 installID: Number (paramData .value .id ),
298295 webUI: webUI .protocol + webUI .domain ,
299- });
296+ };
297+ if (! webUI .domain || webUI .domain === ' ' ) {
298+ req .webUI = ' ' ;
299+ }
300+ await updateInstallConfig (req );
300301 MsgSuccess (i18n .global .t (' commons.msg.updateSuccess' ));
301302 handleClose ();
302303 } catch (error ) {}
Original file line number Diff line number Diff line change 249249 :width =" 400"
250250 >
251251 <template #reference >
252- <el-button plain icon =" Promotion" size =" small" >
252+ <el-button
253+ plain
254+ icon =" Promotion"
255+ size =" small"
256+ @click =" openLink(defaultLink, installed)"
257+ >
253258 {{ $t('app.toLink') }}
254259 </el-button >
255260 </template >
277282 }}
278283 </el-button >
279284 </td >
285+ </tr >
286+ <tr v-if =" defaultLink != ''" >
280287 <td v-if =" installed.httpsPort > 0" >
281288 <el-button
282289 type =" primary"
@@ -700,6 +707,27 @@ const getConfig = async () => {
700707 } catch (error ) {}
701708};
702709
710+ const openLink = (defaultLink : string , installed : App .AppInstalled ) => {
711+ if (defaultLink != ' ' && installed .webUI != ' ' ) {
712+ return ;
713+ }
714+ if (defaultLink == ' ' && installed .webUI == ' ' ) {
715+ return ;
716+ }
717+ if (installed .webUI != ' ' ) {
718+ toLink (installed .webUI );
719+ return ;
720+ }
721+ if (installed .httpsPort > 0 ) {
722+ toLink (' https://' + defaultLink + ' :' + installed .httpsPort );
723+ return ;
724+ }
725+ if (installed .httpPort > 0 ) {
726+ toLink (' http://' + defaultLink + ' :' + installed .httpPort );
727+ return ;
728+ }
729+ };
730+
703731onMounted (() => {
704732 getConfig ();
705733 const path = router .currentRoute .value .path ;
You can’t perform that action at this time.
0 commit comments