Skip to content

Commit e09d941

Browse files
moeshinadri
authored andcommitted
fix: Fix website https url (1Panel-dev#11792)
1 parent 417626f commit e09d941

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

frontend/src/components/app-status/index.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ onMounted(() => {
180180
181181
defineExpose({
182182
onCheck,
183+
getHttpPort: () => httpPort.value,
184+
getHttpsPort: () => httpsPort.value,
183185
});
184186
</script>
185187
<style scoped lang="scss">

frontend/src/views/website/website/domain/index.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ import { GetPunyCodeDomain, isPunycoded } from '@/utils/util';
7474
interface Props {
7575
row: Website.Website;
7676
isHovered: boolean;
77+
defaultHttpPort: number;
78+
defaultHttpsPort: number;
7779
}
7880
const props = defineProps<Props>();
7981
const emit = defineEmits(['favoriteChange', 'domainEdit']);
@@ -164,8 +166,14 @@ const getUrl = (domain: Website.Domain, website: Website.Website): string => {
164166
165167
if (protocol === 'http' && domain.port && domain.port !== 80) {
166168
url = `${url}:${domain.port}`;
167-
} else if (protocol === 'https' && domain.port && domain.port !== 443) {
168-
url = `${url}:${domain.port}`;
169+
} else if (protocol === 'https') {
170+
let port = domain.port;
171+
if (!domain.ssl) {
172+
port = props.defaultHttpsPort || 443;
173+
}
174+
if (port && port !== 443) {
175+
url = `${url}:${port}`;
176+
}
169177
}
170178
171179
return url;

frontend/src/views/website/website/index.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
v-model:mask-show="maskShow"
1717
v-model:loading="loading"
1818
@is-exist="checkExist"
19+
ref="appStatusRef"
1920
></AppStatus>
2021
</template>
2122
<template v-if="!openNginxConfig && nginxIsExist" #leftToolBar>
@@ -95,6 +96,8 @@
9596
<Domain
9697
:row="row"
9798
:is-hovered="hoveredRowIndex === $index"
99+
:defaultHttpPort="appStatusRef?.getHttpPort?.() || 0"
100+
:defaultHttpsPort="appStatusRef?.getHttpsPort?.() || 0"
98101
@favorite-change="favoriteWebsite"
99102
@domain-edit="handleDomainEdit"
100103
/>
@@ -369,6 +372,7 @@ const opRef = ref();
369372
const batchSetGroupRef = ref();
370373
const batchSetHttpsRef = ref();
371374
const nginxVersion = ref();
375+
const appStatusRef = ref();
372376
373377
const paginationConfig = reactive({
374378
cacheSizeKey: 'website-page-size',

0 commit comments

Comments
 (0)