mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
feat: 修改部分接口报错和页面显示问题 (#2731)
This commit is contained in:
parent
c346cae288
commit
45d233bade
@ -55,8 +55,8 @@ type FileOption struct {
|
||||
ShowHidden bool `json:"showHidden"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
SortBy string `json:"sortBy" validate:"oneof=name size modTime"`
|
||||
SortOrder string `json:"sortOrder" validate:"oneof=ascending descending"`
|
||||
SortBy string `json:"sortBy"`
|
||||
SortOrder string `json:"sortOrder"`
|
||||
}
|
||||
|
||||
type FileSearchInfo struct {
|
||||
|
@ -35,8 +35,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
|
||||
defineOptions({ name: 'OpDialog' });
|
||||
|
||||
const form = reactive({
|
||||
msgs: [],
|
||||
title: '',
|
||||
@ -46,6 +50,7 @@ const form = reactive({
|
||||
});
|
||||
const loading = ref();
|
||||
const open = ref();
|
||||
const successMsg = ref('');
|
||||
|
||||
interface DialogProps {
|
||||
title: string;
|
||||
@ -54,6 +59,7 @@ interface DialogProps {
|
||||
|
||||
api: Function;
|
||||
params: Object;
|
||||
successMsg: string;
|
||||
}
|
||||
const acceptParams = (props: DialogProps): void => {
|
||||
form.title = props.title;
|
||||
@ -61,6 +67,7 @@ const acceptParams = (props: DialogProps): void => {
|
||||
form.msgs = props.msg.split('\n');
|
||||
form.api = props.api;
|
||||
form.params = props.params;
|
||||
successMsg.value = props.successMsg;
|
||||
open.value = true;
|
||||
};
|
||||
|
||||
@ -74,6 +81,11 @@ const onConfirm = async () => {
|
||||
.then(() => {
|
||||
emit('cancel');
|
||||
emit('search');
|
||||
if (successMsg.value) {
|
||||
MsgSuccess(successMsg.value);
|
||||
} else {
|
||||
MsgSuccess(i18n.global.t('commons.msg.deleteSuccess'));
|
||||
}
|
||||
open.value = false;
|
||||
loading.value = false;
|
||||
})
|
||||
|
@ -3,11 +3,13 @@ import LayoutContent from './layout-content/index.vue';
|
||||
import RouterButton from './router-button/index.vue';
|
||||
import ComplexTable from './complex-table/index.vue';
|
||||
import ErrPrompt from './error-prompt/index.vue';
|
||||
import OpDialog from './del-dialog/index.vue';
|
||||
export default {
|
||||
install(app: App) {
|
||||
app.component(LayoutContent.name, LayoutContent);
|
||||
app.component(RouterButton.name, RouterButton);
|
||||
app.component(ComplexTable.name, ComplexTable);
|
||||
app.component(ErrPrompt.name, ErrPrompt);
|
||||
app.component(OpDialog.name, OpDialog);
|
||||
},
|
||||
};
|
||||
|
@ -290,6 +290,7 @@ const stopProcess = async (row: any) => {
|
||||
]),
|
||||
api: StopProcess,
|
||||
params: { PID: row.PID },
|
||||
successMsg: i18n.global.t('commons.msg.operationSuccess'),
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
<br />
|
||||
<div v-loading="loading">
|
||||
<codemirror
|
||||
style="height: calc(100vh - 430px)"
|
||||
style="height: calc(100vh - 430px); min-height: 300px"
|
||||
:autofocus="true"
|
||||
:placeholder="$t('website.noLog')"
|
||||
:indent-with-tab="true"
|
||||
@ -50,7 +50,7 @@ import { Codemirror } from 'vue-codemirror';
|
||||
import { javascript } from '@codemirror/lang-javascript';
|
||||
import { oneDark } from '@codemirror/theme-one-dark';
|
||||
import OpDialog from '@/components/del-dialog/index.vue';
|
||||
import { onMounted, onUnmounted, reactive, ref, shallowRef } from 'vue';
|
||||
import { onUnmounted, reactive, ref, shallowRef } from 'vue';
|
||||
import { OperateSupervisorProcessFile } from '@/api/modules/host-tool';
|
||||
import i18n from '@/lang';
|
||||
import { TabsPaneContext } from 'element-plus';
|
||||
@ -155,10 +155,6 @@ const onCloseLog = async () => {
|
||||
timer = null;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getContent();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
onCloseLog();
|
||||
});
|
||||
|
@ -135,8 +135,8 @@ const openDetail = (row: Runtime.Runtime) => {
|
||||
|
||||
const openDelete = async (row: Runtime.Runtime) => {
|
||||
opRef.value.acceptParams({
|
||||
title: i18n.global.t('commons.msg.delete'),
|
||||
names: [req.name],
|
||||
title: i18n.global.t('commons.msg.deleteTitle'),
|
||||
names: [row.name],
|
||||
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||
i18n.global.t('website.runtime'),
|
||||
i18n.global.t('commons.msg.delete'),
|
||||
|
@ -59,7 +59,7 @@ const buttons = [
|
||||
{
|
||||
label: i18n.global.t('commons.button.delete'),
|
||||
click: function (row: Website.DnsAccount) {
|
||||
deleteAccount(row.id);
|
||||
deleteAccount(row);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -77,7 +77,7 @@ const openUrl = (domain: string, port: string) => {
|
||||
|
||||
const deleteDomain = async (row: Website.Domain) => {
|
||||
opRef.value.acceptParams({
|
||||
title: i18n.global.t('commons.msg.delete'),
|
||||
title: i18n.global.t('commons.msg.deleteTitle'),
|
||||
names: [row.domain],
|
||||
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||
i18n.global.t('website.domain'),
|
||||
|
@ -131,7 +131,7 @@ const openEditFile = (proxyConfig: Website.ProxyConfig) => {
|
||||
const deleteProxy = async (proxyConfig: Website.ProxyConfig) => {
|
||||
proxyConfig.operate = 'delete';
|
||||
opRef.value.acceptParams({
|
||||
title: i18n.global.t('commons.msg.delete'),
|
||||
title: i18n.global.t('commons.msg.deleteTitle'),
|
||||
names: [proxyConfig.name],
|
||||
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||
i18n.global.t('website.proxy'),
|
||||
|
@ -146,7 +146,7 @@ const openEditFile = (proxyConfig: Website.RedirectConfig) => {
|
||||
const deleteProxy = async (redirectConfig: Website.RedirectConfig) => {
|
||||
redirectConfig.operate = 'delete';
|
||||
opRef.value.acceptParams({
|
||||
title: i18n.global.t('commons.msg.delete'),
|
||||
title: i18n.global.t('commons.msg.deleteTitle'),
|
||||
names: [redirectConfig.name],
|
||||
msg: i18n.global.t('commons.msg.operatorHelper', [
|
||||
i18n.global.t('website.redirect'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user