mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-18 21:38:57 +08:00
feat: 网站域名增加快速跳转 (#6086)
Some checks failed
sync2gitee / repo-sync (push) Failing after -7m41s
Some checks failed
sync2gitee / repo-sync (push) Failing after -7m41s
This commit is contained in:
parent
fecba858a5
commit
62dfae8fc8
1 changed files with 40 additions and 1 deletions
|
|
@ -67,6 +67,22 @@
|
||||||
<el-text type="primary" class="cursor-pointer" @click="openConfig(row.id)">
|
<el-text type="primary" class="cursor-pointer" @click="openConfig(row.id)">
|
||||||
{{ row.primaryDomain }}
|
{{ row.primaryDomain }}
|
||||||
</el-text>
|
</el-text>
|
||||||
|
<el-popover placement="top-start" trigger="hover" @before-enter="searchDomains(row.id)">
|
||||||
|
<template #reference>
|
||||||
|
<el-button link icon="Promotion" class="ml-2.5"></el-button>
|
||||||
|
</template>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="(domain, index) in domains" :key="index">
|
||||||
|
<td>
|
||||||
|
<el-button type="primary" link @click="openUrl(getUrl(domain, row))">
|
||||||
|
{{ getUrl(domain, row) }}
|
||||||
|
</el-button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -201,7 +217,7 @@ import AppStatus from '@/components/app-status/index.vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import router from '@/routers';
|
import router from '@/routers';
|
||||||
import { onMounted, reactive, ref, computed } from 'vue';
|
import { onMounted, reactive, ref, computed } from 'vue';
|
||||||
import { OpWebsite, SearchWebsites, UpdateWebsite } from '@/api/modules/website';
|
import { ListDomains, OpWebsite, SearchWebsites, UpdateWebsite } from '@/api/modules/website';
|
||||||
import { Website } from '@/api/interface/website';
|
import { Website } from '@/api/interface/website';
|
||||||
import { App } from '@/api/interface/app';
|
import { App } from '@/api/interface/app';
|
||||||
import { ElMessageBox } from 'element-plus';
|
import { ElMessageBox } from 'element-plus';
|
||||||
|
|
@ -248,6 +264,7 @@ const defaultRef = ref();
|
||||||
const data = ref();
|
const data = ref();
|
||||||
let groups = ref<Group.GroupInfo[]>([]);
|
let groups = ref<Group.GroupInfo[]>([]);
|
||||||
const dataRef = ref();
|
const dataRef = ref();
|
||||||
|
const domains = ref<Website.Domain[]>([]);
|
||||||
|
|
||||||
const paginationConfig = reactive({
|
const paginationConfig = reactive({
|
||||||
cacheSizeKey: 'website-page-size',
|
cacheSizeKey: 'website-page-size',
|
||||||
|
|
@ -474,6 +491,28 @@ const toFolder = (folder: string) => {
|
||||||
router.push({ path: '/hosts/files', query: { path: folder } });
|
router.push({ path: '/hosts/files', query: { path: folder } });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const searchDomains = (id: number) => {
|
||||||
|
ListDomains(id).then((res) => {
|
||||||
|
domains.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const openUrl = (url: string) => {
|
||||||
|
window.open(url);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getUrl = (domain: Website.Domain, website: Website.Website): string => {
|
||||||
|
const protocol = website.protocol.toLowerCase();
|
||||||
|
let url = protocol + '://' + domain.domain;
|
||||||
|
if (protocol == 'http' && domain.port != 80) {
|
||||||
|
url = url + ':' + domain.port;
|
||||||
|
}
|
||||||
|
if (protocol == 'https' && domain.ssl) {
|
||||||
|
url = url + ':' + domain.port;
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
search();
|
search();
|
||||||
listGroup();
|
listGroup();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue