mirror of https://github.com/1Panel-dev/1Panel
style: 网站跳转按钮挪到网站域名设置页面
parent
1111b6b494
commit
92a5d6faeb
|
@ -3,6 +3,11 @@
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<el-button type="primary" plain @click="openCreate">{{ $t('website.addDomain') }}</el-button>
|
<el-button type="primary" plain @click="openCreate">{{ $t('website.addDomain') }}</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
<el-table-column width="30px">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button link :icon="Promotion" @click="openUrl(row.domain)"></el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column :label="$t('website.domain')" prop="domain"></el-table-column>
|
<el-table-column :label="$t('website.domain')" prop="domain"></el-table-column>
|
||||||
<el-table-column :label="$t('website.port')" prop="port"></el-table-column>
|
<el-table-column :label="$t('website.port')" prop="port"></el-table-column>
|
||||||
<fu-table-operations :ellipsis="1" :buttons="buttons" :label="$t('commons.table.operate')" fixed="right" fix />
|
<fu-table-operations :ellipsis="1" :buttons="buttons" :label="$t('commons.table.operate')" fixed="right" fix />
|
||||||
|
@ -14,10 +19,11 @@
|
||||||
import ComplexTable from '@/components/complex-table/index.vue';
|
import ComplexTable from '@/components/complex-table/index.vue';
|
||||||
import Domain from './create/index.vue';
|
import Domain from './create/index.vue';
|
||||||
import { Website } from '@/api/interface/website';
|
import { Website } from '@/api/interface/website';
|
||||||
import { DeleteDomain, ListDomains } from '@/api/modules/website';
|
import { DeleteDomain, GetWebsite, ListDomains } from '@/api/modules/website';
|
||||||
import { computed, onMounted, ref } from 'vue';
|
import { computed, onMounted, ref } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||||
|
import { Promotion } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -31,6 +37,7 @@ const id = computed(() => {
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
const data = ref<Website.Domain[]>([]);
|
const data = ref<Website.Domain[]>([]);
|
||||||
const domainRef = ref();
|
const domainRef = ref();
|
||||||
|
const website = ref<Website.WebsiteDTO>();
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
|
@ -48,6 +55,11 @@ const openCreate = () => {
|
||||||
domainRef.value.acceptParams(id.value);
|
domainRef.value.acceptParams(id.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const openUrl = (domain: string) => {
|
||||||
|
const url = website.value.protocol.toLowerCase() + '://' + domain;
|
||||||
|
window.open(url);
|
||||||
|
};
|
||||||
|
|
||||||
const deleteDoamin = async (domainId: number) => {
|
const deleteDoamin = async (domainId: number) => {
|
||||||
await useDeleteData(DeleteDomain, { id: domainId }, 'commons.msg.delete');
|
await useDeleteData(DeleteDomain, { id: domainId }, 'commons.msg.delete');
|
||||||
search(id.value);
|
search(id.value);
|
||||||
|
@ -64,5 +76,14 @@ const search = (id: number) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => search(id.value));
|
const getWebsite = (id: number) => {
|
||||||
|
GetWebsite(id).then((res) => {
|
||||||
|
website.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
search(id.value);
|
||||||
|
getWebsite(id.value);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<el-tabs tab-position="left" v-model="tabIndex">
|
<el-tabs tab-position="left" v-model="tabIndex">
|
||||||
<el-tab-pane :label="$t('website.domainConfig')">
|
<el-tab-pane :label="$t('website.domainConfig')">
|
||||||
<Doamin :key="id" :id="id" v-if="tabIndex == '0'"></Doamin>
|
<Doamin :key="id" :id="id" v-if="tabIndex == '0' && id > 0"></Doamin>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="$t('website.sitePath')">
|
<el-tab-pane :label="$t('website.sitePath')">
|
||||||
<SitePath :id="id" v-if="tabIndex == '1'"></SitePath>
|
<SitePath :id="id" v-if="tabIndex == '1'"></SitePath>
|
||||||
|
|
|
@ -66,11 +66,6 @@
|
||||||
@search="search()"
|
@search="search()"
|
||||||
:class="{ mask: nginxStatus != 'Running' }"
|
:class="{ mask: nginxStatus != 'Running' }"
|
||||||
>
|
>
|
||||||
<el-table-column width="30px">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-button link :icon="Promotion" @click="openUrl(row)"></el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('commons.table.name')" fix prop="primaryDomain" min-width="120px">
|
<el-table-column :label="$t('commons.table.name')" fix prop="primaryDomain" min-width="120px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<Tooltip @click="openConfig(row.id)" :text="row.primaryDomain" />
|
<Tooltip @click="openConfig(row.id)" :text="row.primaryDomain" />
|
||||||
|
@ -180,7 +175,7 @@ import { ElMessageBox } from 'element-plus';
|
||||||
import { dateFormatSimple } from '@/utils/util';
|
import { dateFormatSimple } from '@/utils/util';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { Promotion, VideoPlay, VideoPause } from '@element-plus/icons-vue';
|
import { VideoPlay, VideoPause } from '@element-plus/icons-vue';
|
||||||
import MsgInfo from '@/components/msg-info/index.vue';
|
import MsgInfo from '@/components/msg-info/index.vue';
|
||||||
|
|
||||||
const shortcuts = [
|
const shortcuts = [
|
||||||
|
@ -228,11 +223,6 @@ let req = reactive({
|
||||||
websiteGroupId: 0,
|
websiteGroupId: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const openUrl = (row: Website.WebsiteDTO) => {
|
|
||||||
const url = row.protocol.toLowerCase() + '://' + row.primaryDomain;
|
|
||||||
window.open(url);
|
|
||||||
};
|
|
||||||
|
|
||||||
const search = async () => {
|
const search = async () => {
|
||||||
req.page = paginationConfig.currentPage;
|
req.page = paginationConfig.currentPage;
|
||||||
req.pageSize = paginationConfig.pageSize;
|
req.pageSize = paginationConfig.pageSize;
|
||||||
|
|
Loading…
Reference in New Issue