mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-01 11:34:13 +08:00
fix: 统一网站等删除样式 (#2724)
This commit is contained in:
parent
5e27aa04dd
commit
e9007ad8f3
@ -11,7 +11,7 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="search-button">
|
<div class="search-button">
|
||||||
<el-input
|
<el-input
|
||||||
typpe="number"
|
type="number"
|
||||||
v-model.number="processSearch.pid"
|
v-model.number="processSearch.pid"
|
||||||
clearable
|
clearable
|
||||||
@clear="search()"
|
@clear="search()"
|
||||||
@ -118,17 +118,19 @@
|
|||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
</template>
|
</template>
|
||||||
</LayoutContent>
|
</LayoutContent>
|
||||||
|
|
||||||
|
<OpDialog ref="opRef" @search="search" />
|
||||||
<ProcessDetail ref="detailRef" />
|
<ProcessDetail ref="detailRef" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import FireRouter from '@/views/host/process/index.vue';
|
import FireRouter from '@/views/host/process/index.vue';
|
||||||
|
import OpDialog from '@/components/del-dialog/index.vue';
|
||||||
import { ref, onMounted, onUnmounted, nextTick, reactive } from 'vue';
|
import { ref, onMounted, onUnmounted, nextTick, reactive } from 'vue';
|
||||||
import ProcessDetail from './detail/index.vue';
|
import ProcessDetail from './detail/index.vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { StopProcess } from '@/api/modules/process';
|
import { StopProcess } from '@/api/modules/process';
|
||||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
|
||||||
|
|
||||||
interface SortStatus {
|
interface SortStatus {
|
||||||
prop: '';
|
prop: '';
|
||||||
@ -147,6 +149,7 @@ const processSearch = reactive({
|
|||||||
username: '',
|
username: '',
|
||||||
name: '',
|
name: '',
|
||||||
});
|
});
|
||||||
|
const opRef = ref();
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
@ -158,7 +161,7 @@ const buttons = [
|
|||||||
{
|
{
|
||||||
label: i18n.global.t('process.stopProcess'),
|
label: i18n.global.t('process.stopProcess'),
|
||||||
click: function (row: any) {
|
click: function (row: any) {
|
||||||
stopProcess(row.PID);
|
stopProcess(row);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -277,10 +280,17 @@ const search = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const stopProcess = async (PID: number) => {
|
const stopProcess = async (row: any) => {
|
||||||
try {
|
opRef.value.acceptParams({
|
||||||
await useDeleteData(StopProcess, { PID: PID }, i18n.global.t('process.stopProcessWarn', [PID]));
|
title: i18n.global.t('process.stopProcess'),
|
||||||
} catch (error) {}
|
names: [row.name],
|
||||||
|
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||||
|
i18n.global.t('menu.process'),
|
||||||
|
i18n.global.t('process.stopProcess'),
|
||||||
|
]),
|
||||||
|
api: StopProcess,
|
||||||
|
params: { PID: row.PID },
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -42,13 +42,15 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
|
<OpDialog ref="opRef" @search="getContent" />
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Codemirror } from 'vue-codemirror';
|
import { Codemirror } from 'vue-codemirror';
|
||||||
import { javascript } from '@codemirror/lang-javascript';
|
import { javascript } from '@codemirror/lang-javascript';
|
||||||
import { oneDark } from '@codemirror/theme-one-dark';
|
import { oneDark } from '@codemirror/theme-one-dark';
|
||||||
|
import OpDialog from '@/components/del-dialog/index.vue';
|
||||||
import { onMounted, onUnmounted, reactive, ref, shallowRef } from 'vue';
|
import { onMounted, onUnmounted, reactive, ref, shallowRef } from 'vue';
|
||||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
|
||||||
import { OperateSupervisorProcessFile } from '@/api/modules/host-tool';
|
import { OperateSupervisorProcessFile } from '@/api/modules/host-tool';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { TabsPaneContext } from 'element-plus';
|
import { TabsPaneContext } from 'element-plus';
|
||||||
@ -66,6 +68,7 @@ const req = reactive({
|
|||||||
content: '',
|
content: '',
|
||||||
});
|
});
|
||||||
const title = ref('');
|
const title = ref('');
|
||||||
|
const opRef = ref();
|
||||||
|
|
||||||
const view = shallowRef();
|
const view = shallowRef();
|
||||||
const handleReady = (payload) => {
|
const handleReady = (payload) => {
|
||||||
@ -136,17 +139,14 @@ const acceptParams = (name: string, file: string, operate: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const cleanLog = async () => {
|
const cleanLog = async () => {
|
||||||
const clearReq = {
|
let log = req.file === 'out.log' ? i18n.global.t('logs.runLog') : i18n.global.t('logs.errLog');
|
||||||
name: req.name,
|
opRef.value.acceptParams({
|
||||||
operate: 'clear',
|
title: i18n.global.t('commons.msg.clean'),
|
||||||
file: req.file,
|
names: [req.name],
|
||||||
};
|
msg: i18n.global.t('commons.msg.operatorHelper', [log, i18n.global.t('commons.msg.clean')]),
|
||||||
try {
|
api: OperateSupervisorProcessFile,
|
||||||
await useDeleteData(OperateSupervisorProcessFile, clearReq, 'commons.msg.delete');
|
params: { name: req.name, operate: 'clear', file: req.file },
|
||||||
getContent();
|
});
|
||||||
} catch (error) {
|
|
||||||
} finally {
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onCloseLog = async () => {
|
const onCloseLog = async () => {
|
||||||
|
@ -58,19 +58,21 @@
|
|||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
</template>
|
</template>
|
||||||
</LayoutContent>
|
</LayoutContent>
|
||||||
|
|
||||||
<CreateRuntime ref="createRef" @close="search" />
|
<CreateRuntime ref="createRef" @close="search" />
|
||||||
|
<OpDialog ref="opRef" @search="search" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||||
|
import OpDialog from '@/components/del-dialog/index.vue';
|
||||||
import { Runtime } from '@/api/interface/runtime';
|
import { Runtime } from '@/api/interface/runtime';
|
||||||
import { DeleteRuntime, SearchRuntimes } from '@/api/modules/runtime';
|
import { DeleteRuntime, SearchRuntimes } from '@/api/modules/runtime';
|
||||||
import { dateFormat, toLowerCase } from '@/utils/util';
|
import { dateFormat, toLowerCase } from '@/utils/util';
|
||||||
import CreateRuntime from '@/views/website/runtime/php/create/index.vue';
|
import CreateRuntime from '@/views/website/runtime/php/create/index.vue';
|
||||||
import Status from '@/components/status/index.vue';
|
import Status from '@/components/status/index.vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
|
||||||
import RouterMenu from '../index.vue';
|
import RouterMenu from '../index.vue';
|
||||||
|
|
||||||
const paginationConfig = reactive({
|
const paginationConfig = reactive({
|
||||||
@ -86,6 +88,7 @@ let req = reactive<Runtime.RuntimeReq>({
|
|||||||
type: 'php',
|
type: 'php',
|
||||||
});
|
});
|
||||||
let timer: NodeJS.Timer | null = null;
|
let timer: NodeJS.Timer | null = null;
|
||||||
|
const opRef = ref();
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
@ -131,8 +134,16 @@ const openDetail = (row: Runtime.Runtime) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const openDelete = async (row: Runtime.Runtime) => {
|
const openDelete = async (row: Runtime.Runtime) => {
|
||||||
await useDeleteData(DeleteRuntime, { id: row.id }, 'commons.msg.delete');
|
opRef.value.acceptParams({
|
||||||
search();
|
title: i18n.global.t('commons.msg.delete'),
|
||||||
|
names: [req.name],
|
||||||
|
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||||
|
i18n.global.t('website.runtime'),
|
||||||
|
i18n.global.t('commons.msg.delete'),
|
||||||
|
]),
|
||||||
|
api: DeleteRuntime,
|
||||||
|
params: { id: row.id, forceDelete: true },
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -20,12 +20,15 @@
|
|||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
<Create ref="createRef" @close="search()"></Create>
|
<Create ref="createRef" @close="search()"></Create>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
|
<OpDialog ref="opRef" @search="search" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import OpDialog from '@/components/del-dialog/index.vue';
|
||||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||||
import { Website } from '@/api/interface/website';
|
import { Website } from '@/api/interface/website';
|
||||||
import { DeleteAcmeAccount, SearchAcmeAccount } from '@/api/modules/website';
|
import { DeleteAcmeAccount, SearchAcmeAccount } from '@/api/modules/website';
|
||||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import Create from './create/index.vue';
|
import Create from './create/index.vue';
|
||||||
@ -40,12 +43,13 @@ const paginationConfig = reactive({
|
|||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
total: 0,
|
total: 0,
|
||||||
});
|
});
|
||||||
|
const opRef = ref();
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
label: i18n.global.t('commons.button.delete'),
|
label: i18n.global.t('commons.button.delete'),
|
||||||
click: function (row: Website.AcmeAccount) {
|
click: function (row: Website.AcmeAccount) {
|
||||||
deleteAccount(row.id);
|
deleteAccount(row);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -74,9 +78,17 @@ const handleClose = () => {
|
|||||||
open.value = false;
|
open.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteAccount = async (id: number) => {
|
const deleteAccount = async (row: any) => {
|
||||||
await useDeleteData(DeleteAcmeAccount, { id: id }, 'commons.msg.delete');
|
opRef.value.acceptParams({
|
||||||
search();
|
title: i18n.global.t('commons.button.delete'),
|
||||||
|
names: [row.email],
|
||||||
|
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||||
|
i18n.global.t('website.acmeAccountManage'),
|
||||||
|
i18n.global.t('commons.button.delete'),
|
||||||
|
]),
|
||||||
|
api: DeleteAcmeAccount,
|
||||||
|
params: { id: row.id },
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
<Create ref="createRef" @close="search()"></Create>
|
<Create ref="createRef" @close="search()"></Create>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
|
<OpDialog ref="opRef" @search="search" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@ -35,7 +37,6 @@ import { Website } from '@/api/interface/website';
|
|||||||
import { DeleteDnsAccount, SearchDnsAccount } from '@/api/modules/website';
|
import { DeleteDnsAccount, SearchDnsAccount } from '@/api/modules/website';
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
|
||||||
|
|
||||||
const paginationConfig = reactive({
|
const paginationConfig = reactive({
|
||||||
cacheSizeKey: 'dns-account-page-size',
|
cacheSizeKey: 'dns-account-page-size',
|
||||||
@ -45,8 +46,8 @@ const paginationConfig = reactive({
|
|||||||
});
|
});
|
||||||
let data = ref<Website.DnsAccount[]>();
|
let data = ref<Website.DnsAccount[]>();
|
||||||
let createRef = ref();
|
let createRef = ref();
|
||||||
let loading = ref(false);
|
|
||||||
let open = ref(false);
|
let open = ref(false);
|
||||||
|
const opRef = ref();
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
@ -91,11 +92,17 @@ const openEdit = (form: Website.DnsAccount) => {
|
|||||||
createRef.value.acceptParams({ mode: 'edit', form: form });
|
createRef.value.acceptParams({ mode: 'edit', form: form });
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteAccount = async (id: number) => {
|
const deleteAccount = async (row: any) => {
|
||||||
loading.value = true;
|
opRef.value.acceptParams({
|
||||||
await useDeleteData(DeleteDnsAccount, { id: id }, 'commons.msg.delete');
|
title: i18n.global.t('commons.button.delete'),
|
||||||
loading.value = false;
|
names: [row.name],
|
||||||
search();
|
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||||
|
i18n.global.t('website.dnsAccountManage'),
|
||||||
|
i18n.global.t('commons.button.delete'),
|
||||||
|
]),
|
||||||
|
api: DeleteDnsAccount,
|
||||||
|
params: { id: row.id },
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -80,11 +80,14 @@
|
|||||||
<Renew ref="renewRef" @close="search()"></Renew>
|
<Renew ref="renewRef" @close="search()"></Renew>
|
||||||
<Detail ref="detailRef"></Detail>
|
<Detail ref="detailRef"></Detail>
|
||||||
</LayoutContent>
|
</LayoutContent>
|
||||||
|
|
||||||
|
<OpDialog ref="opRef" @search="search" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, reactive, ref, computed } from 'vue';
|
import { onMounted, reactive, ref, computed } from 'vue';
|
||||||
|
import OpDialog from '@/components/del-dialog/index.vue';
|
||||||
import { DeleteSSL, SearchSSL, UpdateSSL } from '@/api/modules/website';
|
import { DeleteSSL, SearchSSL, UpdateSSL } from '@/api/modules/website';
|
||||||
import DnsAccount from './dns-account/index.vue';
|
import DnsAccount from './dns-account/index.vue';
|
||||||
import AcmeAccount from './acme-account/index.vue';
|
import AcmeAccount from './acme-account/index.vue';
|
||||||
@ -94,7 +97,6 @@ import Detail from './detail/index.vue';
|
|||||||
import { dateFormat, getProvider } from '@/utils/util';
|
import { dateFormat, getProvider } from '@/utils/util';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { Website } from '@/api/interface/website';
|
import { Website } from '@/api/interface/website';
|
||||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
const globalStore = GlobalStore();
|
const globalStore = GlobalStore();
|
||||||
@ -112,6 +114,7 @@ const renewRef = ref();
|
|||||||
const detailRef = ref();
|
const detailRef = ref();
|
||||||
let data = ref();
|
let data = ref();
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
|
const opRef = ref();
|
||||||
|
|
||||||
const routerButton = [
|
const routerButton = [
|
||||||
{
|
{
|
||||||
@ -139,7 +142,7 @@ const buttons = [
|
|||||||
{
|
{
|
||||||
label: i18n.global.t('commons.button.delete'),
|
label: i18n.global.t('commons.button.delete'),
|
||||||
click: function (row: Website.SSL) {
|
click: function (row: Website.SSL) {
|
||||||
deleteSSL(row.id);
|
deleteSSL(row);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -191,11 +194,17 @@ const openDetail = (id: number) => {
|
|||||||
detailRef.value.acceptParams(id);
|
detailRef.value.acceptParams(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteSSL = async (id: number) => {
|
const deleteSSL = async (row: any) => {
|
||||||
loading.value = true;
|
opRef.value.acceptParams({
|
||||||
await useDeleteData(DeleteSSL, { id: id }, 'commons.msg.delete');
|
title: i18n.global.t('commons.button.delete'),
|
||||||
loading.value = false;
|
names: [row.primaryDomain],
|
||||||
search();
|
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||||
|
i18n.global.t('website.ssl'),
|
||||||
|
i18n.global.t('commons.button.delete'),
|
||||||
|
]),
|
||||||
|
api: DeleteSSL,
|
||||||
|
params: { id: row.id },
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -20,15 +20,17 @@
|
|||||||
/>
|
/>
|
||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
<Create ref="createRef" @close="search()" />
|
<Create ref="createRef" @close="search()" />
|
||||||
|
|
||||||
|
<OpDialog ref="opRef" @search="search" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="proxy">
|
<script lang="ts" setup name="proxy">
|
||||||
import { Website } from '@/api/interface/website';
|
import { Website } from '@/api/interface/website';
|
||||||
|
import OpDialog from '@/components/del-dialog/index.vue';
|
||||||
import { OperateAuthConfig, GetAuthConfig } from '@/api/modules/website';
|
import { OperateAuthConfig, GetAuthConfig } 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 Create from './create/index.vue';
|
import Create from './create/index.vue';
|
||||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
const globalStore = GlobalStore();
|
const globalStore = GlobalStore();
|
||||||
@ -49,6 +51,7 @@ const loading = ref(false);
|
|||||||
const data = ref([]);
|
const data = ref([]);
|
||||||
const createRef = ref();
|
const createRef = ref();
|
||||||
const enable = ref(false);
|
const enable = ref(false);
|
||||||
|
const opRef = ref();
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
@ -87,8 +90,16 @@ const openEdit = (authConfig: Website.NginxAuthConfig) => {
|
|||||||
const deleteAuth = async (authConfig: Website.NginxAuthConfig) => {
|
const deleteAuth = async (authConfig: Website.NginxAuthConfig) => {
|
||||||
authConfig.operate = 'delete';
|
authConfig.operate = 'delete';
|
||||||
authConfig.websiteID = id.value;
|
authConfig.websiteID = id.value;
|
||||||
await useDeleteData(OperateAuthConfig, authConfig, 'commons.msg.delete');
|
opRef.value.acceptParams({
|
||||||
search();
|
title: i18n.global.t('commons.button.delete'),
|
||||||
|
names: [authConfig.username],
|
||||||
|
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||||
|
i18n.global.t('website.basicAuth'),
|
||||||
|
i18n.global.t('commons.button.delete'),
|
||||||
|
]),
|
||||||
|
api: OperateAuthConfig,
|
||||||
|
params: authConfig,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeEnable = () => {
|
const changeEnable = () => {
|
||||||
|
@ -19,15 +19,16 @@
|
|||||||
/>
|
/>
|
||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
<Domain ref="domainRef" @close="search(id)"></Domain>
|
<Domain ref="domainRef" @close="search(id)"></Domain>
|
||||||
|
<OpDialog ref="opRef" @search="search(id)" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
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 OpDialog from '@/components/del-dialog/index.vue';
|
||||||
import { DeleteDomain, GetWebsite, 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 { Promotion } from '@element-plus/icons-vue';
|
import { Promotion } from '@element-plus/icons-vue';
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
const globalStore = GlobalStore();
|
const globalStore = GlobalStore();
|
||||||
@ -48,12 +49,13 @@ 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 website = ref<Website.WebsiteDTO>();
|
||||||
|
const opRef = ref();
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
label: i18n.global.t('commons.button.delete'),
|
label: i18n.global.t('commons.button.delete'),
|
||||||
click: function (row: Website.Domain) {
|
click: function (row: Website.Domain) {
|
||||||
deleteDoamin(row.id);
|
deleteDomain(row);
|
||||||
},
|
},
|
||||||
disabled: () => {
|
disabled: () => {
|
||||||
return data.value.length == 1;
|
return data.value.length == 1;
|
||||||
@ -73,9 +75,17 @@ const openUrl = (domain: string, port: string) => {
|
|||||||
window.open(url);
|
window.open(url);
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteDoamin = async (domainId: number) => {
|
const deleteDomain = async (row: Website.Domain) => {
|
||||||
await useDeleteData(DeleteDomain, { id: domainId }, 'commons.msg.delete');
|
opRef.value.acceptParams({
|
||||||
search(id.value);
|
title: i18n.global.t('commons.msg.delete'),
|
||||||
|
names: [row.domain],
|
||||||
|
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||||
|
i18n.global.t('website.domain'),
|
||||||
|
i18n.global.t('commons.msg.delete'),
|
||||||
|
]),
|
||||||
|
api: DeleteDomain,
|
||||||
|
params: { id: row.id },
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const search = (id: number) => {
|
const search = (id: number) => {
|
||||||
|
@ -30,12 +30,15 @@
|
|||||||
fix
|
fix
|
||||||
/>
|
/>
|
||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
|
|
||||||
<Create ref="createRef" @close="search()" />
|
<Create ref="createRef" @close="search()" />
|
||||||
<File ref="fileRef" @close="search()" />
|
<File ref="fileRef" @close="search()" />
|
||||||
|
<OpDialog ref="opRef" @search="search()" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="proxy">
|
<script lang="ts" setup name="proxy">
|
||||||
import { Website } from '@/api/interface/website';
|
import { Website } from '@/api/interface/website';
|
||||||
|
import OpDialog from '@/components/del-dialog/index.vue';
|
||||||
import { OperateProxyConfig, GetProxyConfig } from '@/api/modules/website';
|
import { OperateProxyConfig, GetProxyConfig } from '@/api/modules/website';
|
||||||
import { computed, onMounted, ref } from 'vue';
|
import { computed, onMounted, ref } from 'vue';
|
||||||
import Create from './create/index.vue';
|
import Create from './create/index.vue';
|
||||||
@ -43,7 +46,6 @@ import File from './file/index.vue';
|
|||||||
import { VideoPlay, VideoPause } from '@element-plus/icons-vue';
|
import { VideoPlay, VideoPause } from '@element-plus/icons-vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
|
||||||
import { ElMessageBox } from 'element-plus';
|
import { ElMessageBox } from 'element-plus';
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
const globalStore = GlobalStore();
|
const globalStore = GlobalStore();
|
||||||
@ -65,6 +67,7 @@ const loading = ref(false);
|
|||||||
const data = ref();
|
const data = ref();
|
||||||
const createRef = ref();
|
const createRef = ref();
|
||||||
const fileRef = ref();
|
const fileRef = ref();
|
||||||
|
const opRef = ref();
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
@ -127,8 +130,16 @@ const openEditFile = (proxyConfig: Website.ProxyConfig) => {
|
|||||||
|
|
||||||
const deleteProxy = async (proxyConfig: Website.ProxyConfig) => {
|
const deleteProxy = async (proxyConfig: Website.ProxyConfig) => {
|
||||||
proxyConfig.operate = 'delete';
|
proxyConfig.operate = 'delete';
|
||||||
await useDeleteData(OperateProxyConfig, proxyConfig, 'commons.msg.delete');
|
opRef.value.acceptParams({
|
||||||
search();
|
title: i18n.global.t('commons.msg.delete'),
|
||||||
|
names: [proxyConfig.name],
|
||||||
|
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||||
|
i18n.global.t('website.proxy'),
|
||||||
|
i18n.global.t('commons.msg.delete'),
|
||||||
|
]),
|
||||||
|
api: OperateProxyConfig,
|
||||||
|
params: proxyConfig,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeCache = (proxyConfig: Website.ProxyConfig) => {
|
const changeCache = (proxyConfig: Website.ProxyConfig) => {
|
||||||
|
@ -22,7 +22,9 @@
|
|||||||
<el-table-column :label="$t('website.targetURL')" prop="target" min-width="100px" show-overflow-tooltip />
|
<el-table-column :label="$t('website.targetURL')" prop="target" min-width="100px" show-overflow-tooltip />
|
||||||
<el-table-column :label="$t('website.keepPath')" prop="keepPath" min-width="80px" show-overflow-tooltip>
|
<el-table-column :label="$t('website.keepPath')" prop="keepPath" min-width="80px" show-overflow-tooltip>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span v-if="row.type != '404'">{{ row.keepPath ? $t('website.keep') : $t('website.notKeep') }}</span>
|
<span v-if="row.type != '404'">
|
||||||
|
{{ row.keepPath ? $t('website.keep') : $t('website.notKeep') }}
|
||||||
|
</span>
|
||||||
<span v-else></span>
|
<span v-else></span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -45,12 +47,15 @@
|
|||||||
fix
|
fix
|
||||||
/>
|
/>
|
||||||
</ComplexTable>
|
</ComplexTable>
|
||||||
|
|
||||||
<Create ref="createRef" @close="search()" />
|
<Create ref="createRef" @close="search()" />
|
||||||
<File ref="fileRef" @close="search()" />
|
<File ref="fileRef" @close="search()" />
|
||||||
|
<OpDialog ref="opRef" @search="search()" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="proxy">
|
<script lang="ts" setup name="proxy">
|
||||||
import { Website } from '@/api/interface/website';
|
import { Website } from '@/api/interface/website';
|
||||||
|
import OpDialog from '@/components/del-dialog/index.vue';
|
||||||
import { OperateRedirectConfig, GetRedirectConfig } from '@/api/modules/website';
|
import { OperateRedirectConfig, GetRedirectConfig } from '@/api/modules/website';
|
||||||
import { computed, onMounted, ref } from 'vue';
|
import { computed, onMounted, ref } from 'vue';
|
||||||
import Create from './create/index.vue';
|
import Create from './create/index.vue';
|
||||||
@ -58,7 +63,6 @@ import File from './file/index.vue';
|
|||||||
import { VideoPlay, VideoPause } from '@element-plus/icons-vue';
|
import { VideoPlay, VideoPause } from '@element-plus/icons-vue';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
|
||||||
import { ElMessageBox } from 'element-plus';
|
import { ElMessageBox } from 'element-plus';
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
const globalStore = GlobalStore();
|
const globalStore = GlobalStore();
|
||||||
@ -80,6 +84,7 @@ const loading = ref(false);
|
|||||||
const data = ref();
|
const data = ref();
|
||||||
const createRef = ref();
|
const createRef = ref();
|
||||||
const fileRef = ref();
|
const fileRef = ref();
|
||||||
|
const opRef = ref();
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
@ -140,8 +145,16 @@ const openEditFile = (proxyConfig: Website.RedirectConfig) => {
|
|||||||
|
|
||||||
const deleteProxy = async (redirectConfig: Website.RedirectConfig) => {
|
const deleteProxy = async (redirectConfig: Website.RedirectConfig) => {
|
||||||
redirectConfig.operate = 'delete';
|
redirectConfig.operate = 'delete';
|
||||||
await useDeleteData(OperateRedirectConfig, redirectConfig, 'commons.msg.delete');
|
opRef.value.acceptParams({
|
||||||
search();
|
title: i18n.global.t('commons.msg.delete'),
|
||||||
|
names: [redirectConfig.name],
|
||||||
|
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||||
|
i18n.global.t('website.redirect'),
|
||||||
|
i18n.global.t('commons.msg.delete'),
|
||||||
|
]),
|
||||||
|
api: OperateRedirectConfig,
|
||||||
|
params: redirectConfig,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const submit = async (redirectConfig: Website.RedirectConfig) => {
|
const submit = async (redirectConfig: Website.RedirectConfig) => {
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
@ready="handleReady"
|
@ready="handleReady"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<OpDialog ref="opRef" @search="getContent()" />
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Codemirror } from 'vue-codemirror';
|
import { Codemirror } from 'vue-codemirror';
|
||||||
@ -41,8 +42,8 @@ import { javascript } from '@codemirror/lang-javascript';
|
|||||||
import { oneDark } from '@codemirror/theme-one-dark';
|
import { oneDark } from '@codemirror/theme-one-dark';
|
||||||
import { computed, nextTick, onMounted, onUnmounted, reactive, ref, shallowRef } from 'vue';
|
import { computed, nextTick, onMounted, onUnmounted, reactive, ref, shallowRef } from 'vue';
|
||||||
import { OpWebsiteLog } from '@/api/modules/website';
|
import { OpWebsiteLog } from '@/api/modules/website';
|
||||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
|
||||||
import { downloadFile } from '@/utils/util';
|
import { downloadFile } from '@/utils/util';
|
||||||
|
import i18n from '@/lang';
|
||||||
|
|
||||||
const extensions = [javascript(), oneDark];
|
const extensions = [javascript(), oneDark];
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -69,6 +70,7 @@ const data = ref({
|
|||||||
});
|
});
|
||||||
const tailLog = ref(false);
|
const tailLog = ref(false);
|
||||||
let timer: NodeJS.Timer | null = null;
|
let timer: NodeJS.Timer | null = null;
|
||||||
|
const opRef = ref();
|
||||||
|
|
||||||
const view = shallowRef();
|
const view = shallowRef();
|
||||||
const editorContainer = ref<HTMLDivElement | null>(null);
|
const editorContainer = ref<HTMLDivElement | null>(null);
|
||||||
@ -147,17 +149,14 @@ const updateEnable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const cleanLog = async () => {
|
const cleanLog = async () => {
|
||||||
const req = {
|
let log = logType.value === 'access.log' ? i18n.global.t('website.accessLog') : i18n.global.t('website.errLog');
|
||||||
id: id.value,
|
opRef.value.acceptParams({
|
||||||
operate: 'delete',
|
title: i18n.global.t('commons.msg.clean'),
|
||||||
logType: logType.value,
|
names: [],
|
||||||
};
|
msg: i18n.global.t('commons.msg.operatorHelper', [log, i18n.global.t('commons.msg.clean')]),
|
||||||
try {
|
api: OpWebsiteLog,
|
||||||
await useDeleteData(OpWebsiteLog, req, 'commons.msg.delete');
|
params: { id: id.value, operate: 'delete', logType: logType.value },
|
||||||
getContent();
|
});
|
||||||
} catch (error) {
|
|
||||||
} finally {
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onDownload = async () => {
|
const onDownload = async () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user