mirror of https://github.com/1Panel-dev/1Panel
fix: 弹出提示框增加关闭按钮
parent
81df97be14
commit
4e5aeb9d54
|
@ -1,6 +1,6 @@
|
|||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import router from '@/routers';
|
||||
import { MsgError } from '@/utils/message';
|
||||
|
||||
/**
|
||||
* @description: 校验网络请求状态码
|
||||
|
@ -10,19 +10,19 @@ import router from '@/routers';
|
|||
export const checkStatus = (status: number): void => {
|
||||
switch (status) {
|
||||
case 400:
|
||||
ElMessage.error(i18n.global.t('commons.res.paramError'));
|
||||
MsgError(i18n.global.t('commons.res.paramError'));
|
||||
break;
|
||||
case 404:
|
||||
ElMessage.error(i18n.global.t('commons.res.notFound'));
|
||||
MsgError(i18n.global.t('commons.res.notFound'));
|
||||
break;
|
||||
case 403:
|
||||
router.replace({ path: '/login' });
|
||||
ElMessage.error(i18n.global.t('commons.res.forbidden'));
|
||||
MsgError(i18n.global.t('commons.res.forbidden'));
|
||||
break;
|
||||
case 500:
|
||||
ElMessage.error(i18n.global.t('commons.res.serverError'));
|
||||
MsgError(i18n.global.t('commons.res.serverError'));
|
||||
break;
|
||||
default:
|
||||
ElMessage.error(i18n.global.t('commons.res.commonError'));
|
||||
MsgError(i18n.global.t('commons.res.commonError'));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,9 +2,9 @@ import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, AxiosResponse } f
|
|||
import { ResultData } from '@/api/interface';
|
||||
import { ResultEnum } from '@/enums/http-enum';
|
||||
import { checkStatus } from './helper/check-status';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import router from '@/routers';
|
||||
import { GlobalStore } from '@/store';
|
||||
import { MsgError } from '@/utils/message';
|
||||
|
||||
const globalStore = GlobalStore();
|
||||
|
||||
|
@ -71,14 +71,14 @@ class RequestHttp {
|
|||
return data;
|
||||
}
|
||||
if (data.code && data.code !== ResultEnum.SUCCESS) {
|
||||
ElMessage.error(data.message);
|
||||
MsgError(data.message);
|
||||
return Promise.reject(data);
|
||||
}
|
||||
return data;
|
||||
},
|
||||
async (error: AxiosError) => {
|
||||
const { response } = error;
|
||||
if (error.message.indexOf('timeout') !== -1) ElMessage.error('请求超时!请您稍后重试');
|
||||
if (error.message.indexOf('timeout') !== -1) MsgError('请求超时!请您稍后重试');
|
||||
if (response) checkStatus(response.status);
|
||||
if (!window.navigator.onLine) router.replace({ path: '/500' });
|
||||
return Promise.reject(error);
|
||||
|
|
|
@ -43,8 +43,9 @@ import SubItem from './components/sub-item.vue';
|
|||
import router, { menuList } from '@/routers/router';
|
||||
import { logOutApi } from '@/api/modules/auth';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { GlobalStore } from '@/store';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
const route = useRoute();
|
||||
const menuStore = MenuStore();
|
||||
const globalStore = GlobalStore();
|
||||
|
@ -80,10 +81,7 @@ const logout = () => {
|
|||
systemLogOut();
|
||||
router.push({ name: 'login' });
|
||||
globalStore.setLogStatus(false);
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: i18n.global.t('commons.msg.operationSuccess'),
|
||||
});
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -56,9 +56,10 @@ import { CheckAppInstalled, InstalledOp } from '@/api/modules/app';
|
|||
import router from '@/routers';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import Status from '@/components/status/index.vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import LayoutContent from '@/layout/layout-content.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const props = defineProps({
|
||||
appKey: {
|
||||
|
@ -116,7 +117,7 @@ const onOperate = async (operation: string) => {
|
|||
InstalledOp(operateReq)
|
||||
.then(() => {
|
||||
em('update:loading', false);
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
onCheck();
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* 复制某个值至剪贴板
|
||||
* 接收参数:string类型/Ref<string>类型/Reactive<string>类型
|
||||
*/
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import type { Directive, DirectiveBinding } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
interface ElType extends HTMLElement {
|
||||
copyData: string | number;
|
||||
__handleClick__: any;
|
||||
|
@ -29,10 +29,7 @@ function handleClick(this: any) {
|
|||
input.select();
|
||||
document.execCommand('Copy');
|
||||
document.body.removeChild(input);
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '复制成功',
|
||||
});
|
||||
MsgSuccess('复制成功');
|
||||
}
|
||||
|
||||
export default copy;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { HandleData } from './interface';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
/**
|
||||
* @description 删除操作使用
|
||||
|
@ -35,10 +36,7 @@ export const useDeleteData = <P = any, R = any>(
|
|||
done();
|
||||
if (!res) return reject(false);
|
||||
resolve(true);
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: i18n.global.t('commons.msg.operationSuccess'),
|
||||
});
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
instance.confirmButtonLoading = false;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { computed, onBeforeMount } from 'vue';
|
||||
import { getLightColor, getDarkColor } from '@/utils/theme/tool';
|
||||
import { GlobalStore } from '@/store';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
export const useTheme = () => {
|
||||
const globalStore = GlobalStore();
|
||||
|
@ -16,7 +16,7 @@ export const useTheme = () => {
|
|||
const changePrimary = (val: string) => {
|
||||
if (!val) {
|
||||
val = '#409EFF';
|
||||
ElMessage({ type: 'success', message: '主题颜色已重置为 #409EFF' });
|
||||
MsgSuccess('主题颜色已重置为 #409EFF');
|
||||
}
|
||||
globalStore.setThemeConfig({ ...themeConfig.value, primary: val });
|
||||
document.documentElement.style.setProperty(
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
import { ElMessage } from 'element-plus';
|
||||
|
||||
export const MsgSuccess = (message) => {
|
||||
ElMessage.success({
|
||||
message: message,
|
||||
type: 'success',
|
||||
showClose: false,
|
||||
duration: 3000,
|
||||
});
|
||||
};
|
||||
|
||||
export const MsgInfo = (message) => {
|
||||
ElMessage.info({
|
||||
message: message,
|
||||
type: 'info',
|
||||
showClose: false,
|
||||
duration: 3000,
|
||||
});
|
||||
};
|
||||
|
||||
export const MsgWarning = (message) => {
|
||||
ElMessage.warning({
|
||||
message: message,
|
||||
type: 'warning',
|
||||
showClose: true,
|
||||
duration: 3000,
|
||||
});
|
||||
};
|
||||
|
||||
export const MsgError = (message) => {
|
||||
ElMessage.error({
|
||||
message: message,
|
||||
type: 'error',
|
||||
showClose: true,
|
||||
duration: 3000,
|
||||
});
|
||||
};
|
|
@ -1,4 +1,4 @@
|
|||
import { ElMessage } from 'element-plus';
|
||||
import { MsgWarning } from '../message';
|
||||
|
||||
/**
|
||||
* hex颜色转rgb颜色
|
||||
|
@ -8,7 +8,7 @@ import { ElMessage } from 'element-plus';
|
|||
export function hexToRgb(str: any) {
|
||||
let hexs: any = '';
|
||||
let reg = /^\#?[0-9A-Fa-f]{6}$/;
|
||||
if (!reg.test(str)) return ElMessage.warning('输入错误的hex');
|
||||
if (!reg.test(str)) return MsgWarning('输入错误的hex');
|
||||
str = str.replace('#', '');
|
||||
hexs = str.match(/../g);
|
||||
for (let i = 0; i < 3; i++) hexs[i] = parseInt(hexs[i], 16);
|
||||
|
@ -24,7 +24,7 @@ export function hexToRgb(str: any) {
|
|||
*/
|
||||
export function rgbToHex(r: any, g: any, b: any) {
|
||||
let reg = /^\d{1,3}$/;
|
||||
if (!reg.test(r) || !reg.test(g) || !reg.test(b)) return ElMessage.warning('输入错误的rgb颜色值');
|
||||
if (!reg.test(r) || !reg.test(g) || !reg.test(b)) return MsgWarning('输入错误的rgb颜色值');
|
||||
let hexs = [r.toString(16), g.toString(16), b.toString(16)];
|
||||
for (let i = 0; i < 3; i++) if (hexs[i].length == 1) hexs[i] = `0${hexs[i]}`;
|
||||
return `#${hexs.join('')}`;
|
||||
|
@ -38,7 +38,7 @@ export function rgbToHex(r: any, g: any, b: any) {
|
|||
*/
|
||||
export function getDarkColor(color: string, level: number) {
|
||||
let reg = /^\#?[0-9A-Fa-f]{6}$/;
|
||||
if (!reg.test(color)) return ElMessage.warning('输入错误的hex颜色值');
|
||||
if (!reg.test(color)) return MsgWarning('输入错误的hex颜色值');
|
||||
let rgb = hexToRgb(color);
|
||||
for (let i = 0; i < 3; i++) rgb[i] = Math.floor(rgb[i] * (1 - level));
|
||||
return rgbToHex(rgb[0], rgb[1], rgb[2]);
|
||||
|
@ -52,7 +52,7 @@ export function getDarkColor(color: string, level: number) {
|
|||
*/
|
||||
export function getLightColor(color: string, level: number) {
|
||||
let reg = /^\#?[0-9A-Fa-f]{6}$/;
|
||||
if (!reg.test(color)) return ElMessage.warning('输入错误的hex颜色值');
|
||||
if (!reg.test(color)) return MsgWarning('输入错误的hex颜色值');
|
||||
let rgb = hexToRgb(color);
|
||||
for (let i = 0; i < 3; i++) rgb[i] = Math.floor((255 - rgb[i]) * level + rgb[i]);
|
||||
return rgbToHex(rgb[0], rgb[1], rgb[2]);
|
||||
|
|
|
@ -96,10 +96,10 @@ import LayoutContent from '@/layout/layout-content.vue';
|
|||
import { App } from '@/api/interface/app';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { GetAppTags, SearchApp, SyncApp } from '@/api/modules/app';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import Detail from '../detail/index.vue';
|
||||
import router from '@/routers';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
let req = reactive({
|
||||
name: '',
|
||||
|
@ -143,7 +143,7 @@ const sync = () => {
|
|||
loading.value = true;
|
||||
SyncApp()
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('app.syncSuccess'));
|
||||
MsgSuccess(i18n.global.t('app.syncSuccess'));
|
||||
search(req);
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -79,9 +79,9 @@ import { reactive, ref } from 'vue';
|
|||
import ComplexTable from '@/components/complex-table/index.vue';
|
||||
import Header from '@/components/drawer-header/index.vue';
|
||||
import { dateFormat } from '@/utils/util';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
interface InstallRrops {
|
||||
appInstallId: number;
|
||||
|
@ -140,7 +140,7 @@ const backup = async () => {
|
|||
loading.value = true;
|
||||
await InstalledOp(req)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.backupSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.backupSuccess'));
|
||||
search();
|
||||
})
|
||||
.finally(() => {
|
||||
|
@ -159,7 +159,7 @@ const restore = async () => {
|
|||
loading.value = true;
|
||||
await InstalledOp(req)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.restoreSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.restoreSuccess'));
|
||||
openRestorePage.value = false;
|
||||
search();
|
||||
})
|
||||
|
|
|
@ -39,11 +39,12 @@
|
|||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
import { App } from '@/api/interface/app';
|
||||
import { InstalledOp } from '@/api/modules/app';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
let deleteReq = ref({
|
||||
operate: 'delete',
|
||||
|
@ -84,7 +85,7 @@ const submit = async () => {
|
|||
InstalledOp(deleteReq.value)
|
||||
.then(() => {
|
||||
handleClose();
|
||||
ElMessage.success(i18n.global.t('commons.msg.deleteSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.deleteSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -165,7 +165,7 @@ import {
|
|||
import LayoutContent from '@/layout/layout-content.vue';
|
||||
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import Backups from './backup/index.vue';
|
||||
import AppResources from './check/index.vue';
|
||||
import AppDelete from './delete/index.vue';
|
||||
|
@ -175,6 +175,7 @@ import { App } from '@/api/interface/app';
|
|||
import Status from '@/components/status/index.vue';
|
||||
import { getAge } from '@/utils/util';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
let data = ref<any>();
|
||||
let loading = ref(false);
|
||||
|
@ -212,7 +213,7 @@ const sync = () => {
|
|||
loading.value = true;
|
||||
SyncInstalledApp()
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('app.syncSuccess'));
|
||||
MsgSuccess(i18n.global.t('app.syncSuccess'));
|
||||
search();
|
||||
})
|
||||
.finally(() => {
|
||||
|
@ -265,7 +266,7 @@ const operate = async () => {
|
|||
loading.value = true;
|
||||
await InstalledOp(operateReq)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
search();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -28,9 +28,10 @@
|
|||
import { App } from '@/api/interface/app';
|
||||
import { GetAppUpdateVersions, InstalledOp } from '@/api/modules/app';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { reactive, ref } from 'vue';
|
||||
import Header from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
let open = ref(false);
|
||||
let loading = ref(false);
|
||||
|
@ -65,7 +66,7 @@ const operate = async () => {
|
|||
await InstalledOp(operateReq)
|
||||
.then(() => {
|
||||
open.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -76,9 +76,10 @@ import { javascript } from '@codemirror/lang-javascript';
|
|||
import { oneDark } from '@codemirror/theme-one-dark';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { listComposeTemplate, upCompose } from '@/api/modules/container';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const extensions = [javascript(), oneDark];
|
||||
const drawerVisiable = ref(false);
|
||||
|
@ -136,7 +137,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = true;
|
||||
upCompose(form)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
loading.value = false;
|
||||
emit('search');
|
||||
drawerVisiable.value = false;
|
||||
|
|
|
@ -138,9 +138,10 @@ import ComplexTable from '@/components/complex-table/index.vue';
|
|||
import Status from '@/components/status/index.vue';
|
||||
import { dateFormat } from '@/utils/util';
|
||||
import { composeOperator, ContainerOperator, inspect, searchContainer } from '@/api/modules/container';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const composeName = ref();
|
||||
const composePath = ref();
|
||||
|
@ -175,6 +176,7 @@ const loading = ref(false);
|
|||
const search = async () => {
|
||||
let filterItem = filters.value;
|
||||
let params = {
|
||||
name: '',
|
||||
page: paginationConfig.currentPage,
|
||||
pageSize: paginationConfig.pageSize,
|
||||
filters: filterItem,
|
||||
|
@ -241,7 +243,7 @@ const onOperate = async (operation: string) => {
|
|||
Promise.all(ps)
|
||||
.then(() => {
|
||||
search();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
search();
|
||||
|
@ -268,7 +270,7 @@ const onComposeOperate = async (operation: string) => {
|
|||
await composeOperator(params)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
if (operation === 'down') {
|
||||
emit('back');
|
||||
} else {
|
||||
|
|
|
@ -38,9 +38,9 @@ import { Codemirror } from 'vue-codemirror';
|
|||
import { javascript } from '@codemirror/lang-javascript';
|
||||
import { oneDark } from '@codemirror/theme-one-dark';
|
||||
import { ref } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { composeUpdate } from '@/api/modules/container';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
const composeVisiable = ref(false);
|
||||
|
@ -59,7 +59,7 @@ const onSubmitEdit = async () => {
|
|||
await composeUpdate(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
composeVisiable.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -97,11 +97,11 @@ import CreateDialog from '@/views/container/compose/create/index.vue';
|
|||
import ComposeDetial from '@/views/container/compose/detail/index.vue';
|
||||
import { composeOperator, loadDockerStatus, searchCompose } from '@/api/modules/container';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import { LoadFile } from '@/api/modules/files';
|
||||
import router from '@/routers';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const data = ref();
|
||||
const selects = ref<any>([]);
|
||||
|
@ -175,7 +175,7 @@ const onDelete = async (row: Container.ComposeInfo) => {
|
|||
};
|
||||
await useDeleteData(composeOperator, param, 'commons.msg.delete');
|
||||
search();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
};
|
||||
|
||||
const dialogEditRef = ref();
|
||||
|
|
|
@ -204,10 +204,11 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { listImage, listVolume, createContainer } from '@/api/modules/container';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -318,7 +319,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
await createContainer(form)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
drawerVisiable.value = false;
|
||||
})
|
||||
|
|
|
@ -131,9 +131,10 @@ import { reactive, onMounted, ref } from 'vue';
|
|||
import { dateFormat } from '@/utils/util';
|
||||
import { ContainerOperator, inspect, loadDockerStatus, searchContainer } from '@/api/modules/container';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import router from '@/routers';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref();
|
||||
const data = ref();
|
||||
|
@ -274,7 +275,7 @@ const onOperate = async (operation: string) => {
|
|||
.then(() => {
|
||||
loading.value = false;
|
||||
search();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
import { ContainerOperator } from '@/api/modules/container';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { reactive, ref } from 'vue';
|
||||
|
||||
const loading = ref(false);
|
||||
|
@ -53,7 +54,7 @@ const onSubmitName = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = false;
|
||||
emit('search');
|
||||
newNameVisiable.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -30,8 +30,9 @@ import FileList from '@/components/file-list/index.vue';
|
|||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { imageLoad } from '@/api/modules/container';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -63,7 +64,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = false;
|
||||
loadVisiable.value = false;
|
||||
emit('search');
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
import { nextTick, reactive, ref, shallowRef } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { imagePull } from '@/api/modules/container';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import { Codemirror } from 'vue-codemirror';
|
||||
|
@ -76,6 +76,7 @@ import { oneDark } from '@codemirror/theme-one-dark';
|
|||
import { LoadFile } from '@/api/modules/files';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { formatImageStdout } from '@/utils/docker';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const drawerVisiable = ref(false);
|
||||
const form = reactive({
|
||||
|
@ -125,7 +126,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
logVisiable.value = true;
|
||||
buttonDisabled.value = true;
|
||||
loadLogs(res.data);
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
import { nextTick, reactive, ref, shallowRef } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { imagePush } from '@/api/modules/container';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import { Codemirror } from 'vue-codemirror';
|
||||
|
@ -79,6 +79,7 @@ import { oneDark } from '@codemirror/theme-one-dark';
|
|||
import { LoadFile } from '@/api/modules/files';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { formatImageStdout } from '@/utils/docker';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const drawerVisiable = ref(false);
|
||||
const form = reactive({
|
||||
|
@ -130,7 +131,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
logVisiable.value = true;
|
||||
buttonDisabled.value = true;
|
||||
loadLogs(res.data);
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -51,10 +51,11 @@ import FileList from '@/components/file-list/index.vue';
|
|||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { imageSave } from '@/api/modules/container';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -102,7 +103,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = false;
|
||||
drawerVisiable.value = false;
|
||||
emit('search');
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -45,10 +45,11 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { imageTag } from '@/api/modules/container';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -96,7 +97,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = false;
|
||||
drawerVisiable.value = false;
|
||||
emit('search');
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -62,9 +62,10 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { createNetwork } from '@/api/modules/container';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -111,7 +112,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
await createNetwork(form)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
drawerVisiable.value = false;
|
||||
})
|
||||
|
|
|
@ -195,7 +195,7 @@ const onInspect = async (id: string) => {
|
|||
};
|
||||
|
||||
function isSystem(val: string) {
|
||||
return val === 'bridge' || val === '1panel' || val === 'none' || val === 'host';
|
||||
return val === 'bridge' || val === '1panel-network' || val === 'none' || val === 'host';
|
||||
}
|
||||
|
||||
const buttons = [
|
||||
|
|
|
@ -27,8 +27,9 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { deleteImageRepo } from '@/api/modules/container';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
const isDelete = ref(false);
|
||||
|
@ -50,7 +51,7 @@ const onSubmit = async () => {
|
|||
await deleteImageRepo({ ids: ids.value, deleteInsecure: isDelete.value })
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
repoVisiable.value = false;
|
||||
})
|
||||
|
|
|
@ -77,10 +77,11 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { createImageRepo, updateImageRepo } from '@/api/modules/container';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -125,7 +126,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
await createImageRepo(dialogData.value.rowData!)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
drawerVisiable.value = false;
|
||||
})
|
||||
|
@ -137,7 +138,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
await updateImageRepo(dialogData.value.rowData!)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
drawerVisiable.value = false;
|
||||
})
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { Codemirror } from 'vue-codemirror';
|
||||
import LayoutContent from '@/layout/layout-content.vue';
|
||||
|
@ -123,6 +123,7 @@ import {
|
|||
updateDaemonJson,
|
||||
updateDaemonJsonByfile,
|
||||
} from '@/api/modules/container';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
const showDaemonJsonAlert = ref(false);
|
||||
|
@ -171,7 +172,7 @@ const onOperator = async (operation: string) => {
|
|||
await dockerOperate(param);
|
||||
search();
|
||||
changeMode();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
};
|
||||
|
||||
const onSubmitSave = async () => {
|
||||
|
@ -181,7 +182,7 @@ const onSubmitSave = async () => {
|
|||
await updateDaemonJsonByfile(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
@ -207,7 +208,7 @@ const onSubmitSave = async () => {
|
|||
.then(() => {
|
||||
loading.value = false;
|
||||
search();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -61,10 +61,11 @@ import { javascript } from '@codemirror/lang-javascript';
|
|||
import { oneDark } from '@codemirror/theme-one-dark';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { createComposeTemplate, updateComposeTemplate } from '@/api/modules/container';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -107,7 +108,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
await createComposeTemplate(dialogData.value.rowData!)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
drawerVisiable.value = false;
|
||||
})
|
||||
|
@ -119,7 +120,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
await updateComposeTemplate(dialogData.value.rowData!)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
drawerVisiable.value = false;
|
||||
})
|
||||
|
|
|
@ -57,9 +57,10 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { createVolume } from '@/api/modules/container';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -104,7 +105,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
await createVolume(form)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
drawerVisiable.value = false;
|
||||
})
|
||||
|
|
|
@ -137,7 +137,8 @@ import { loadBackupName } from '@/views/setting/helper';
|
|||
import i18n from '@/lang';
|
||||
import { Cronjob } from '@/api/interface/cronjob';
|
||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref();
|
||||
const selects = ref<any>([]);
|
||||
|
@ -226,7 +227,7 @@ const onChangeStatus = async (id: number, status: string) => {
|
|||
}).then(async () => {
|
||||
let itemStatus = status === 'enable' ? 'Enable' : 'Disable';
|
||||
await updateStatus({ id: id, status: itemStatus });
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
search();
|
||||
});
|
||||
};
|
||||
|
@ -236,7 +237,7 @@ const onHandle = async (row: Cronjob.CronjobInfo) => {
|
|||
await handleOnce(row.id)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
search();
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -164,13 +164,14 @@ import { loadBackupName } from '@/views/setting/helper';
|
|||
import FileList from '@/components/file-list/index.vue';
|
||||
import { getBackupList } from '@/api/modules/setting';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { Cronjob } from '@/api/interface/cronjob';
|
||||
import { addCronjob, editCronjob } from '@/api/modules/cronjob';
|
||||
import { loadDBNames } from '@/api/modules/database';
|
||||
import { CheckAppInstalled } from '@/api/modules/app';
|
||||
import { GetWebsiteOptions } from '@/api/modules/website';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
interface DialogProps {
|
||||
title: string;
|
||||
|
@ -367,7 +368,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
await editCronjob(dialogData.value.rowData);
|
||||
}
|
||||
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
drawerVisiable.value = false;
|
||||
});
|
||||
|
|
|
@ -277,12 +277,13 @@ import { loadBackupName } from '@/views/setting/helper';
|
|||
import { searchRecords, download, handleOnce, updateStatus } from '@/api/modules/cronjob';
|
||||
import { dateFormat, dateFormatForName } from '@/utils/util';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { LoadFile } from '@/api/modules/files';
|
||||
import LayoutContent from '@/layout/layout-content.vue';
|
||||
import { Codemirror } from 'vue-codemirror';
|
||||
import { javascript } from '@codemirror/lang-javascript';
|
||||
import { oneDark } from '@codemirror/theme-one-dark';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref();
|
||||
const hasRecords = ref();
|
||||
|
@ -393,7 +394,7 @@ const onHandle = async (row: Cronjob.CronjobInfo) => {
|
|||
await handleOnce(row.id)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
search();
|
||||
})
|
||||
.catch(() => {
|
||||
|
@ -408,7 +409,7 @@ const onChangeStatus = async (id: number, status: string) => {
|
|||
}).then(async () => {
|
||||
let itemStatus = status === 'enable' ? 'Enable' : 'Disable';
|
||||
await updateStatus({ id: id, status: itemStatus });
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
dialogData.value.rowData.status = itemStatus;
|
||||
});
|
||||
};
|
||||
|
|
|
@ -36,10 +36,10 @@ import { dateFormat } from '@/utils/util';
|
|||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import { backup, recover } from '@/api/modules/database';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { deleteBackupRecord, downloadBackupRecord, searchBackupRecords } from '@/api/modules/setting';
|
||||
import { Backup } from '@/api/interface/backup';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const selects = ref<any>([]);
|
||||
|
||||
|
@ -86,7 +86,7 @@ const onBackup = async () => {
|
|||
dbName: dbName.value,
|
||||
};
|
||||
await backup(params);
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
search();
|
||||
};
|
||||
|
||||
|
@ -97,7 +97,7 @@ const onRecover = async (row: Backup.RecordInfo) => {
|
|||
backupName: row.fileDir + '/' + row.fileName,
|
||||
};
|
||||
await recover(params);
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
};
|
||||
|
||||
const onDownload = async (row: Backup.RecordInfo) => {
|
||||
|
|
|
@ -56,9 +56,10 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { addMysqlDB } from '@/api/modules/database';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const createVisiable = ref(false);
|
||||
const form = reactive({
|
||||
|
@ -108,7 +109,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
form.permission = form.permissionIPs;
|
||||
}
|
||||
await addMysqlDB(form);
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
createVisiable.value = false;
|
||||
});
|
||||
|
|
|
@ -40,10 +40,11 @@
|
|||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
import i18n from '@/lang';
|
||||
import { deleteMysqlDB } from '@/api/modules/database';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
let deleteReq = ref({
|
||||
id: 0,
|
||||
|
@ -80,7 +81,7 @@ const submit = async () => {
|
|||
.then(() => {
|
||||
loading.value = false;
|
||||
emit('search');
|
||||
ElMessage.success(i18n.global.t('commons.msg.deleteSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.deleteSuccess'));
|
||||
dialogVisiable.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -164,11 +164,11 @@ import { dateFormat } from '@/utils/util';
|
|||
import { reactive, ref } from 'vue';
|
||||
import { deleteCheckMysqlDB, loadRemoteAccess, searchMysqlDBs, updateMysqlDescription } from '@/api/modules/database';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { Database } from '@/api/interface/database';
|
||||
import { App } from '@/api/interface/app';
|
||||
import { GetAppPort } from '@/api/modules/app';
|
||||
import router from '@/routers';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -254,7 +254,7 @@ const search = async () => {
|
|||
const onChange = async (info: any) => {
|
||||
if (!info.edit) {
|
||||
await updateMysqlDescription({ id: info.id, description: info.description });
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -295,7 +295,7 @@ const onCopyPassword = (row: Database.MysqlDBInfo) => {
|
|||
input.select();
|
||||
document.execCommand('Copy');
|
||||
document.body.removeChild(input);
|
||||
ElMessage.success(i18n.global.t('commons.msg.copySuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.copySuccess'));
|
||||
};
|
||||
|
||||
const onDelete = async (row: Database.MysqlDBInfo) => {
|
||||
|
|
|
@ -54,10 +54,11 @@
|
|||
<script lang="ts" setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { deleteCheckMysqlDB, updateMysqlAccess, updateMysqlPassword } from '@/api/modules/database';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref();
|
||||
const changeVisiable = ref(false);
|
||||
|
@ -128,7 +129,7 @@ const submitChangeInfo = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = false;
|
||||
emit('search');
|
||||
changeVisiable.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
@ -143,7 +144,7 @@ const submitChangeInfo = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = false;
|
||||
emit('search');
|
||||
changeVisiable.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
@ -162,7 +163,7 @@ const onSubmit = async () => {
|
|||
loading.value = false;
|
||||
emit('search');
|
||||
changeVisiable.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -31,10 +31,11 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { updateMysqlAccess } from '@/api/modules/database';
|
||||
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -70,7 +71,7 @@ const onSubmit = async () => {
|
|||
await updateMysqlAccess(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
dialogVisiable.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -28,11 +28,12 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { updateMysqlPassword } from '@/api/modules/database';
|
||||
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
||||
import { GetAppPassword } from '@/api/modules/app';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -70,7 +71,7 @@ const onSubmit = async () => {
|
|||
await updateMysqlPassword(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
dialogVisiable.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import LayoutContent from '@/layout/layout-content.vue';
|
||||
import ContainerLog from '@/components/container-log/index.vue';
|
||||
import Status from '@/views/database/mysql/setting/status/index.vue';
|
||||
|
@ -108,6 +108,7 @@ import { ChangePort, GetAppDefaultConfig } from '@/api/modules/app';
|
|||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { loadBaseDir } from '@/api/modules/setting';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -178,7 +179,7 @@ const onSubmitChangePort = async () => {
|
|||
await ChangePort(params)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
@ -224,7 +225,7 @@ const onSubmitChangeConf = async () => {
|
|||
await updateMysqlConfByFile(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -49,10 +49,10 @@ import { Database } from '@/api/interface/database';
|
|||
import { LoadFile } from '@/api/modules/files';
|
||||
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
||||
import { updateMysqlVariables } from '@/api/modules/database';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { dateFormatForName } from '@/utils/util';
|
||||
import i18n from '@/lang';
|
||||
import { loadBaseDir } from '@/api/modules/setting';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref();
|
||||
const extensions = [javascript(), oneDark];
|
||||
|
@ -122,7 +122,7 @@ const onSave = async () => {
|
|||
await updateMysqlVariables(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -116,12 +116,13 @@
|
|||
<script lang="ts" setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { Database } from '@/api/interface/database';
|
||||
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
||||
import { updateMysqlVariables } from '@/api/modules/database';
|
||||
import i18n from '@/lang';
|
||||
import { planOptions } from './../helper';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -285,7 +286,7 @@ const onSaveVariables = async () => {
|
|||
await updateMysqlVariables(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -67,11 +67,12 @@ import { computeSize, dateFormatSimple } from '@/utils/util';
|
|||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import { recoverByUpload } from '@/api/modules/database';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, UploadFile, UploadFiles, UploadInstance, UploadProps } from 'element-plus';
|
||||
import { UploadFile, UploadFiles, UploadInstance, UploadProps } from 'element-plus';
|
||||
import { File } from '@/api/interface/file';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { BatchDeleteFile, GetFilesList, UploadFileData } from '@/api/modules/files';
|
||||
import { loadBaseDir } from '@/api/modules/setting';
|
||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
|
||||
const selects = ref<any>([]);
|
||||
const baseDir = ref();
|
||||
|
@ -120,7 +121,7 @@ const onRecover = async (row: File.File) => {
|
|||
fileName: row.name,
|
||||
};
|
||||
await recoverByUpload(params);
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
};
|
||||
|
||||
const uploaderFiles = ref<UploadFiles>([]);
|
||||
|
@ -133,10 +134,10 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
|
|||
rawFile.name.endsWith('.zip') ||
|
||||
rawFile.name.endsWith('.tgz')
|
||||
) {
|
||||
ElMessage.error(i18n.global.t('database.unSupportType'));
|
||||
MsgError(i18n.global.t('database.unSupportType'));
|
||||
return false;
|
||||
} else if (rawFile.size / 1024 / 1024 > 10) {
|
||||
ElMessage.error(i18n.global.t('database.unSupportSize'));
|
||||
MsgError(i18n.global.t('database.unSupportSize'));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -160,7 +161,7 @@ const onSubmit = () => {
|
|||
}
|
||||
formData.append('path', baseDir.value);
|
||||
UploadFileData(formData, {}).then(() => {
|
||||
ElMessage.success(i18n.global.t('file.uploadSuccess'));
|
||||
MsgSuccess(i18n.global.t('file.uploadSuccess'));
|
||||
handleClose();
|
||||
search();
|
||||
});
|
||||
|
|
|
@ -30,10 +30,11 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { changeRedisPassword } from '@/api/modules/database';
|
||||
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
||||
import { GetAppPassword } from '@/api/modules/app';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -70,7 +71,7 @@ const onSubmit = async () => {
|
|||
await changeRedisPassword(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
dialogVisiable.value = false;
|
||||
emit('checkExist');
|
||||
})
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { Codemirror } from 'vue-codemirror';
|
||||
import { javascript } from '@codemirror/lang-javascript';
|
||||
|
@ -138,6 +138,7 @@ import i18n from '@/lang';
|
|||
import { Rules } from '@/global/form-rules';
|
||||
import { ChangePort, GetAppDefaultConfig } from '@/api/modules/app';
|
||||
import { loadBaseDir } from '@/api/modules/setting';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const extensions = [javascript(), oneDark];
|
||||
|
||||
|
@ -235,7 +236,7 @@ const onChangePort = async (formEl: FormInstance | undefined) => {
|
|||
await ChangePort(params)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
@ -266,7 +267,7 @@ const submtiForm = async () => {
|
|||
.then(() => {
|
||||
loadform();
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
@ -298,7 +299,7 @@ const submtiFile = async () => {
|
|||
await updateRedisConfByFile(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = true;
|
||||
|
|
|
@ -127,11 +127,12 @@ import {
|
|||
} from '@/api/modules/database';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import { computeSize } from '@/utils/util';
|
||||
import { BatchDeleteFile } from '@/api/modules/files';
|
||||
import { MsgInfo, MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
|
@ -201,7 +202,7 @@ const onBackup = async () => {
|
|||
.then(() => {
|
||||
loading.value = false;
|
||||
loadBackupRecords();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
@ -216,7 +217,7 @@ const onRecover = async () => {
|
|||
await recoverRedis(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
@ -269,7 +270,7 @@ const onSave = async (formEl: FormInstance | undefined, type: string) => {
|
|||
await updateRedisPersistenceConf(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
@ -280,7 +281,7 @@ const onSave = async (formEl: FormInstance | undefined, type: string) => {
|
|||
let itemSaves = [] as Array<string>;
|
||||
for (const item of form.saves) {
|
||||
if (item.count === 0 || item.second === 0) {
|
||||
ElMessage.info(i18n.global.t('database.rdbInfo'));
|
||||
MsgInfo(i18n.global.t('database.rdbInfo'));
|
||||
return;
|
||||
}
|
||||
itemSaves.push(item.second + '', item.count + '');
|
||||
|
@ -291,7 +292,7 @@ const onSave = async (formEl: FormInstance | undefined, type: string) => {
|
|||
await updateRedisPersistenceConf(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -24,8 +24,8 @@ import { ref } from 'vue';
|
|||
import { File } from '@/api/interface/file';
|
||||
import { ChangeFileMode } from '@/api/modules/files';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import FileRole from '@/components/file-role/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
let open = ref(false);
|
||||
let form = ref<File.FileCreate>({ path: '', isDir: false, mode: 0o755 });
|
||||
|
@ -55,7 +55,7 @@ const submit = async () => {
|
|||
loading.value = true;
|
||||
ChangeFileMode(form.value)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { SaveFileContent } from '@/api/modules/files';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import * as monaco from 'monaco-editor';
|
||||
import { ref } from 'vue';
|
||||
|
||||
|
@ -90,7 +90,7 @@ const saveContent = (closePage: boolean) => {
|
|||
SaveFileContent(form.value).finally(() => {
|
||||
loading.value = false;
|
||||
open.value = !closePage;
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -53,12 +53,13 @@
|
|||
import i18n from '@/lang';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { File } from '@/api/interface/file';
|
||||
import { ElMessage, FormInstance, FormRules } from 'element-plus';
|
||||
import { FormInstance, FormRules } from 'element-plus';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { CompressExtention, CompressType } from '@/enums/files';
|
||||
import { CompressFile } from '@/api/modules/files';
|
||||
import FileList from '@/components/file-list/index.vue';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
interface CompressProps {
|
||||
files: Array<any>;
|
||||
|
@ -111,7 +112,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = true;
|
||||
CompressFile(addItem as File.FileCompress)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('file.compressSuccess'));
|
||||
MsgSuccess(i18n.global.t('file.compressSuccess'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -60,12 +60,13 @@
|
|||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { File } from '@/api/interface/file';
|
||||
import { ElMessage, FormInstance, FormRules } from 'element-plus';
|
||||
import { FormInstance, FormRules } from 'element-plus';
|
||||
import { CreateFile } from '@/api/modules/files';
|
||||
import i18n from '@/lang';
|
||||
import FileRole from '@/components/file-role/index.vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import FileList from '@/components/file-list/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const fileForm = ref<FormInstance>();
|
||||
let loading = ref(false);
|
||||
|
@ -125,7 +126,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = true;
|
||||
CreateFile(addItem as File.FileCreate)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.createSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -43,12 +43,13 @@
|
|||
import i18n from '@/lang';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { File } from '@/api/interface/file';
|
||||
import { ElMessage, FormInstance, FormRules } from 'element-plus';
|
||||
import { FormInstance, FormRules } from 'element-plus';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { DeCompressFile } from '@/api/modules/files';
|
||||
import { Mimetypes } from '@/global/mimetype';
|
||||
import FileList from '@/components/file-list/index.vue';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
interface CompressProps {
|
||||
files: Array<any>;
|
||||
|
@ -99,7 +100,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = true;
|
||||
DeCompressFile(form.value)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('file.deCompressSuccess'));
|
||||
MsgSuccess(i18n.global.t('file.deCompressSuccess'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -150,7 +150,6 @@ import { GetFilesList, DeleteFile, GetFileContent, ComputeDirSize } from '@/api/
|
|||
import { computeSize, dateFormat, getIcon, getRandomStr } from '@/utils/util';
|
||||
import { File } from '@/api/interface/file';
|
||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import LayoutContent from '@/layout/layout-content.vue';
|
||||
import ComplexTable from '@/components/complex-table/index.vue';
|
||||
import i18n from '@/lang';
|
||||
|
@ -169,6 +168,7 @@ import Process from './process/index.vue';
|
|||
import Detail from './detail/index.vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { Back, Refresh } from '@element-plus/icons-vue';
|
||||
import { MsgWarning } from '@/utils/message';
|
||||
|
||||
interface FilePaths {
|
||||
url: string;
|
||||
|
@ -365,7 +365,7 @@ const openCompress = (items: File.File[]) => {
|
|||
|
||||
const openDeCompress = (item: File.File) => {
|
||||
if (Mimetypes.get(item.mimeType) == undefined) {
|
||||
ElMessage.warning(i18n.global.t('file.canNotDeCompress'));
|
||||
MsgWarning(i18n.global.t('file.canNotDeCompress'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,10 +42,11 @@
|
|||
import { MoveFile } from '@/api/modules/files';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, FormInstance, FormRules } from 'element-plus';
|
||||
import { FormInstance, FormRules } from 'element-plus';
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import FileList from '@/components/file-list/index.vue';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
interface MoveProps {
|
||||
oldPaths: Array<string>;
|
||||
|
@ -98,7 +99,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = true;
|
||||
MoveFile(addForm)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('file.moveStart'));
|
||||
MsgSuccess(i18n.global.t('file.moveStart'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -31,10 +31,11 @@
|
|||
<script lang="ts" setup>
|
||||
import { RenameRile } from '@/api/modules/files';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { ElMessage, FormInstance, FormRules } from 'element-plus';
|
||||
import { FormInstance, FormRules } from 'element-plus';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { File } from '@/api/interface/file';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
interface RenameProps {
|
||||
path: string;
|
||||
|
@ -81,7 +82,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = true;
|
||||
RenameRile(addItem as File.FileRename)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -29,10 +29,11 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { ElMessage, UploadFile, UploadFiles, UploadInstance } from 'element-plus';
|
||||
import { UploadFile, UploadFiles, UploadInstance } from 'element-plus';
|
||||
import { UploadFileData } from '@/api/modules/files';
|
||||
import i18n from '@/lang';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
interface UploadProps {
|
||||
path: string;
|
||||
|
@ -73,7 +74,7 @@ const submit = () => {
|
|||
loading.value = true;
|
||||
UploadFileData(formData, { onUploadProgress: onProcess })
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('file.uploadSuccess'));
|
||||
MsgSuccess(i18n.global.t('file.uploadSuccess'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -42,10 +42,11 @@
|
|||
import { WgetFile } from '@/api/modules/files';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, FormInstance, FormRules } from 'element-plus';
|
||||
import { FormInstance, FormRules } from 'element-plus';
|
||||
import { reactive, ref } from 'vue';
|
||||
import FileList from '@/components/file-list/index.vue';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
interface WgetProps {
|
||||
path: string;
|
||||
|
@ -91,7 +92,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = true;
|
||||
WgetFile(addForm)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('file.downloadStart'));
|
||||
MsgSuccess(i18n.global.t('file.downloadStart'));
|
||||
submitData.value = true;
|
||||
handleClose();
|
||||
})
|
||||
|
|
|
@ -75,8 +75,8 @@ import { useDeleteData } from '@/hooks/use-delete-data';
|
|||
import type { ElForm } from 'element-plus';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref();
|
||||
const data = ref();
|
||||
|
@ -129,7 +129,7 @@ const submitAddCommand = (formEl: FormInstance | undefined) => {
|
|||
}
|
||||
cmdVisiable.value = false;
|
||||
search();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -169,9 +169,9 @@ import {
|
|||
deleteGroup,
|
||||
} from '@/api/modules/host';
|
||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import type Node from 'element-plus/es/components/tree/src/model/node';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
type FormInstance = InstanceType<typeof ElForm>;
|
||||
const hostInfoRef = ref<FormInstance>();
|
||||
|
@ -261,21 +261,21 @@ const submitAddHost = (formEl: FormInstance | undefined, ops: string) => {
|
|||
case 'create':
|
||||
await addHost(hostInfo);
|
||||
restHostForm();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
loadHostTree();
|
||||
break;
|
||||
case 'edit':
|
||||
await editHost(hostInfo);
|
||||
restHostForm();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
loadHostTree();
|
||||
break;
|
||||
case 'testconn':
|
||||
await testByInfo(hostInfo).then((res) => {
|
||||
if (res.data) {
|
||||
ElMessage.success(i18n.global.t('terminal.connTestOk'));
|
||||
MsgSuccess(i18n.global.t('terminal.connTestOk'));
|
||||
} else {
|
||||
ElMessage.success(i18n.global.t('terminal.connTestFailed'));
|
||||
MsgSuccess(i18n.global.t('terminal.connTestFailed'));
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
@ -295,7 +295,7 @@ const onCreateGroup = async (name: string) => {
|
|||
groupOperation.value = '';
|
||||
groupInputShow.value = false;
|
||||
}
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
groupOperation.value = '';
|
||||
groupInputShow.value = false;
|
||||
loadHostTree();
|
||||
|
@ -309,7 +309,7 @@ const onUpdateGroup = async () => {
|
|||
}
|
||||
let group = { id: currentGroupID.value, name: currentGroupValue.value, type: 'host' };
|
||||
await editGroup(group);
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
loadHostTree();
|
||||
loadGroups();
|
||||
};
|
||||
|
|
|
@ -68,13 +68,14 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { Host } from '@/api/interface/host';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { addHost, testByInfo } from '@/api/modules/host';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import i18n from '@/lang';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const dialogVisiable = ref();
|
||||
type FormInstance = InstanceType<typeof ElForm>;
|
||||
|
@ -130,9 +131,9 @@ const submitAddHost = (formEl: FormInstance | undefined, ops: string) => {
|
|||
case 'testConn':
|
||||
await testByInfo(hostInfo).then((res) => {
|
||||
if (res.data) {
|
||||
ElMessage.success(i18n.global.t('terminal.connTestOk'));
|
||||
MsgSuccess(i18n.global.t('terminal.connTestOk'));
|
||||
} else {
|
||||
ElMessage.success(i18n.global.t('terminal.connTestFailed'));
|
||||
MsgSuccess(i18n.global.t('terminal.connTestFailed'));
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
|
|
@ -72,7 +72,7 @@ import { dateFormat } from '@/utils/util';
|
|||
import { cleanLogs, getLoginLogs } from '@/api/modules/log';
|
||||
import { onMounted, reactive, ref } from '@vue/runtime-core';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref();
|
||||
const data = ref();
|
||||
|
@ -116,7 +116,7 @@ const onClean = async () => {
|
|||
const onSubmitClean = async () => {
|
||||
await cleanLogs({ logType: 'login' });
|
||||
search();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
|
|
@ -96,7 +96,7 @@ import LayoutContent from '@/layout/layout-content.vue';
|
|||
import { cleanLogs, getOperationLogs } from '@/api/modules/log';
|
||||
import { onMounted, reactive, ref } from '@vue/runtime-core';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref();
|
||||
const data = ref();
|
||||
|
@ -142,7 +142,7 @@ const onClean = async () => {
|
|||
const onSubmitClean = async () => {
|
||||
await cleanLogs({ logType: 'operation' });
|
||||
search();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
|
|
@ -164,12 +164,12 @@
|
|||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import type { ElForm } from 'element-plus';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { loginApi, getCaptcha, mfaLoginApi, checkIsFirst, initUser } from '@/api/modules/auth';
|
||||
import { GlobalStore } from '@/store';
|
||||
import { MenuStore } from '@/store/modules/menu';
|
||||
import i18n from '@/lang';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const globalStore = GlobalStore();
|
||||
const menuStore = MenuStore();
|
||||
|
@ -232,7 +232,7 @@ const register = (formEl: FormInstance | undefined) => {
|
|||
if (!valid) return;
|
||||
await initUser(registerForm);
|
||||
checkStatus();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -270,7 +270,7 @@ const login = (formEl: FormInstance | undefined) => {
|
|||
}
|
||||
globalStore.setLogStatus(true);
|
||||
menuStore.setMenuList([]);
|
||||
ElMessage.success(i18n.global.t('commons.msg.loginSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.loginSuccess'));
|
||||
router.push({ name: 'home' });
|
||||
} catch (error) {
|
||||
loginVerify();
|
||||
|
@ -287,7 +287,7 @@ const mfaLogin = async () => {
|
|||
await mfaLoginApi(mfaLoginForm);
|
||||
globalStore.setLogStatus(true);
|
||||
menuStore.setMenuList([]);
|
||||
ElMessage.success(i18n.global.t('commons.msg.loginSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.loginSuccess'));
|
||||
router.push({ name: 'home' });
|
||||
}
|
||||
};
|
||||
|
|
|
@ -66,9 +66,10 @@ import { getSettingInfo, loadUpgradeInfo, upgrade } from '@/api/modules/setting'
|
|||
import { onMounted, ref } from 'vue';
|
||||
import MdEditor from 'md-editor-v3';
|
||||
import 'md-editor-v3/lib/style.css';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { MsgInfo, MsgSuccess } from '@/utils/message';
|
||||
|
||||
const version = ref();
|
||||
const upgradeInfo = ref();
|
||||
|
@ -104,7 +105,7 @@ const onLoadUpgradeInfo = async () => {
|
|||
.then((res) => {
|
||||
loading.value = false;
|
||||
if (!res.data) {
|
||||
ElMessage.info(i18n.global.t('setting.noUpgrade'));
|
||||
MsgInfo(i18n.global.t('setting.noUpgrade'));
|
||||
return;
|
||||
}
|
||||
upgradeInfo.value = res.data;
|
||||
|
@ -125,7 +126,7 @@ const onUpgrade = async () => {
|
|||
.then(() => {
|
||||
loading.value = false;
|
||||
drawerVisiable.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
search();
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -132,11 +132,12 @@ import { ref } from 'vue';
|
|||
import { Rules } from '@/global/form-rules';
|
||||
import FileList from '@/components/file-list/index.vue';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { Backup } from '@/api/interface/backup';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { addBackup, editBackup, listBucket } from '@/api/modules/setting';
|
||||
import { deepCopy } from '@/utils/util';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
type FormInstance = InstanceType<typeof ElForm>;
|
||||
|
@ -222,7 +223,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
await editBackup(dialogData.value.rowData);
|
||||
}
|
||||
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
drawerVisiable.value = false;
|
||||
});
|
||||
|
|
|
@ -57,10 +57,11 @@
|
|||
import { ref, onMounted, reactive } from 'vue';
|
||||
import { Setting } from '@/api/interface/setting';
|
||||
import { getSettingInfo, handleExpired } from '@/api/modules/setting';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import router from '@/routers';
|
||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
let settingForm = reactive<Setting.SettingInfo>({
|
||||
userName: '',
|
||||
password: '',
|
||||
|
@ -119,11 +120,11 @@ const submitChangePassword = async (formEl: FormInstance | undefined) => {
|
|||
let password =
|
||||
settingForm.complexityVerification === 'disable' ? passForm.newPassword : passForm.newPasswordComplexity;
|
||||
if (password === passForm.oldPassword) {
|
||||
ElMessage.error(i18n.global.t('setting.duplicatePassword'));
|
||||
MsgError(i18n.global.t('setting.duplicatePassword'));
|
||||
return;
|
||||
}
|
||||
await handleExpired({ oldPassword: passForm.oldPassword, newPassword: password });
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
router.push({ name: 'home' });
|
||||
});
|
||||
};
|
||||
|
|
|
@ -47,12 +47,13 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import LayoutContent from '@/layout/layout-content.vue';
|
||||
import { cleanMonitors, getSettingInfo, updateSetting } from '@/api/modules/setting';
|
||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref();
|
||||
const form = reactive({
|
||||
|
@ -89,7 +90,7 @@ const onSave = async (formEl: FormInstance | undefined, key: string, val: any) =
|
|||
await updateSetting(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -101,13 +101,14 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, onMounted, computed } from 'vue';
|
||||
import { ElMessage, ElForm } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import LayoutContent from '@/layout/layout-content.vue';
|
||||
import { syncTime, getSettingInfo, updateSetting } from '@/api/modules/setting';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { GlobalStore } from '@/store';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useTheme } from '@/hooks/use-theme';
|
||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
const i18n = useI18n();
|
||||
|
@ -166,7 +167,7 @@ const onSave = async (formEl: FormInstance | undefined, key: string, val: any) =
|
|||
break;
|
||||
case 'SessionTimeout':
|
||||
if (Number(val) < 300) {
|
||||
ElMessage.error(i18n.t('setting.sessionTimeoutError'));
|
||||
MsgError(i18n.t('setting.sessionTimeoutError'));
|
||||
search();
|
||||
return;
|
||||
}
|
||||
|
@ -186,7 +187,7 @@ const onSave = async (formEl: FormInstance | undefined, key: string, val: any) =
|
|||
await updateSetting(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.t('commons.msg.operationSuccess'));
|
||||
search();
|
||||
})
|
||||
.catch(() => {
|
||||
|
@ -223,7 +224,7 @@ const onSyncTime = async () => {
|
|||
loading.value = false;
|
||||
form.localTime = res.data;
|
||||
countdown();
|
||||
ElMessage.success(i18n.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -192,7 +192,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElMessage, ElForm, ElMessageBox } from 'element-plus';
|
||||
import { ElForm, ElMessageBox } from 'element-plus';
|
||||
import { Setting } from '@/api/interface/setting';
|
||||
import LayoutContent from '@/layout/layout-content.vue';
|
||||
import { updatePassword, updateSetting, getMFA, bindMFA, getSettingInfo, updatePort } from '@/api/modules/setting';
|
||||
|
@ -201,6 +201,7 @@ import { Rules } from '@/global/form-rules';
|
|||
import { dateFormatSimple } from '@/utils/util';
|
||||
import { GlobalStore } from '@/store';
|
||||
import router from '@/routers';
|
||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
const globalStore = GlobalStore();
|
||||
|
@ -277,7 +278,7 @@ const onSave = async (formEl: FormInstance | undefined, key: string, val: any) =
|
|||
await updateSetting(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
search();
|
||||
})
|
||||
.catch(() => {
|
||||
|
@ -317,7 +318,7 @@ const onSavePort = async (formEl: FormInstance | undefined, key: string, val: an
|
|||
await updatePort(param)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
let href = window.location.href;
|
||||
let ip = href.split('//')[1].split(':')[0];
|
||||
window.open(`${href.split('//')[0]}//${ip}:${val}/1panel/login`, '_self');
|
||||
|
@ -343,7 +344,7 @@ const submitChangePassword = async (formEl: FormInstance | undefined) => {
|
|||
let password =
|
||||
form.complexityVerification === 'disable' ? passForm.newPassword : passForm.newPasswordComplexity;
|
||||
if (password === passForm.oldPassword) {
|
||||
ElMessage.error(i18n.global.t('setting.duplicatePassword'));
|
||||
MsgError(i18n.global.t('setting.duplicatePassword'));
|
||||
return;
|
||||
}
|
||||
dialogLoading.value = true;
|
||||
|
@ -351,7 +352,7 @@ const submitChangePassword = async (formEl: FormInstance | undefined) => {
|
|||
.then(() => {
|
||||
dialogLoading.value = false;
|
||||
passwordVisiable.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
router.push({ name: 'login', params: { code: '' } });
|
||||
globalStore.setLogStatus(false);
|
||||
})
|
||||
|
@ -375,7 +376,7 @@ const handleMFA = async () => {
|
|||
.then(() => {
|
||||
loading.value = false;
|
||||
search();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
@ -389,7 +390,7 @@ const onBind = async () => {
|
|||
.then(() => {
|
||||
loading.value = false;
|
||||
search();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
isMFAShow.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
|
@ -44,13 +44,14 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref } from 'vue';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { snapshotImport } from '@/api/modules/setting';
|
||||
import { getBackupList, getFilesFromBackup } from '@/api/modules/setting';
|
||||
import { loadBackupName } from '../../helper';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const drawerVisiable = ref(false);
|
||||
const loading = ref();
|
||||
|
@ -92,7 +93,7 @@ const submitImport = async (formEl: FormInstance | undefined) => {
|
|||
emit('search');
|
||||
loading.value = false;
|
||||
drawerVisiable.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -149,7 +149,7 @@ import { snapshotCreate, searchSnapshotPage, snapshotDelete, updateSnapshotDescr
|
|||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { dateFormat } from '@/utils/util';
|
||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { Setting } from '@/api/interface/setting';
|
||||
|
@ -158,6 +158,7 @@ import RecoverStatus from '@/views/setting/snapshot/status/index.vue';
|
|||
import SnapshotImport from '@/views/setting/snapshot/import/index.vue';
|
||||
import { getBackupList } from '@/api/modules/setting';
|
||||
import { loadBackupName } from '../helper';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const loading = ref(false);
|
||||
const data = ref();
|
||||
|
@ -202,7 +203,7 @@ const handleClose = () => {
|
|||
const onChange = async (info: any) => {
|
||||
if (!info.edit) {
|
||||
await updateSnapshotDescription({ id: info.id, description: info.description });
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -216,7 +217,7 @@ const submitAddSnapshot = (formEl: FormInstance | undefined) => {
|
|||
loading.value = false;
|
||||
drawerVisiable.value = false;
|
||||
search();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -179,10 +179,11 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { Setting } from '@/api/interface/setting';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import DrawerHeader from '@/components/drawer-header/index.vue';
|
||||
import { snapshotRecover, snapshotRollback } from '@/api/modules/setting';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const drawerVisiable = ref(false);
|
||||
const snapInfo = ref();
|
||||
|
@ -212,7 +213,7 @@ const doRecover = async (isNew: boolean) => {
|
|||
loading.value = false;
|
||||
dialogVisiable.value = false;
|
||||
drawerVisiable.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
@ -242,7 +243,7 @@ const rollbackSnapshot = async () => {
|
|||
loading.value = false;
|
||||
dialogVisiable.value = false;
|
||||
drawerVisiable.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -27,11 +27,12 @@
|
|||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { CreateAcmeAccount } from '@/api/modules/website';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
let open = ref();
|
||||
let loading = ref(false);
|
||||
|
@ -67,7 +68,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
|
||||
CreateAcmeAccount(account.value)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.createSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -97,8 +97,9 @@ import { Website } from '@/api/interface/website';
|
|||
import { CreateSSL, GetDnsResolve, SearchAcmeAccount, SearchDnsAccount } from '@/api/modules/website';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
|
@ -213,7 +214,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
CreateSSL(ssl.value)
|
||||
.then(() => {
|
||||
handleClose();
|
||||
ElMessage.success(i18n.global.t('commons.msg.createSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -66,9 +66,9 @@ import DrawerHeader from '@/components/drawer-header/index.vue';
|
|||
import { GetSSL } from '@/api/modules/website';
|
||||
import { ref } from 'vue';
|
||||
import { dateFormatSimple, getProvider } from '@/utils/util';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import useClipboard from 'vue-clipboard3';
|
||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
const { toClipboard } = useClipboard();
|
||||
|
||||
let open = ref(false);
|
||||
|
@ -96,9 +96,9 @@ const get = async () => {
|
|||
const copyText = async (msg) => {
|
||||
try {
|
||||
await toClipboard(msg);
|
||||
ElMessage.success(i18n.global.t('commons.msg.copySuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.copySuccess'));
|
||||
} catch (e) {
|
||||
ElMessage.error(i18n.global.t('commons.msg.copyfailed'));
|
||||
MsgError(i18n.global.t('commons.msg.copyfailed'));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -65,7 +65,8 @@
|
|||
import { CreateDnsAccount, UpdateDnsAccount } from '@/api/modules/website';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
|
||||
interface AccountProps {
|
||||
|
@ -150,7 +151,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
if (accountData.value.mode === 'edit') {
|
||||
UpdateDnsAccount(account.value)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
@ -159,7 +160,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
} else {
|
||||
CreateDnsAccount(account.value)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.createSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
import { Website } from '@/api/interface/Website';
|
||||
import { RenewSSL } from '@/api/modules/website';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import { reactive, ref } from 'vue';
|
||||
|
||||
interface RenewProps {
|
||||
|
@ -68,7 +68,7 @@ const submit = () => {
|
|||
RenewSSL(renewReq)
|
||||
.then(() => {
|
||||
handleClose();
|
||||
ElMessage.success(i18n.global.t('ssl.renewSuccess'));
|
||||
MsgSuccess(i18n.global.t('ssl.renewSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -39,10 +39,10 @@ import { reactive, ref } from 'vue';
|
|||
import { dateFormat } from '@/utils/util';
|
||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { deleteBackupRecord, downloadBackupRecord, searchBackupRecords } from '@/api/modules/setting';
|
||||
import { Backup } from '@/api/interface/backup';
|
||||
import { BackupWebsite, RecoverWebsite } from '@/api/modules/website';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const selects = ref<any>([]);
|
||||
const loading = ref(false);
|
||||
|
@ -99,7 +99,7 @@ const onRecover = async (row: Backup.RecordInfo) => {
|
|||
await RecoverWebsite(params)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
@ -111,7 +111,7 @@ const onBackup = async () => {
|
|||
await BackupWebsite({ id: websiteID.value })
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
search();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -21,9 +21,10 @@
|
|||
import { Website } from '@/api/interface/website';
|
||||
import { GetNginxConfig, UpdateNginxConfig } from '@/api/modules/website';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
|
@ -60,7 +61,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = true;
|
||||
UpdateNginxConfig(req.value)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
search(req.value);
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -38,8 +38,9 @@ import DrawerHeader from '@/components/drawer-header/index.vue';
|
|||
import { CreateDomain } from '@/api/modules/website';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const domainForm = ref<FormInstance>();
|
||||
|
||||
|
@ -77,7 +78,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = true;
|
||||
CreateDomain(domain.value)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.createSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -119,11 +119,12 @@
|
|||
<script lang="ts" setup>
|
||||
import { Website } from '@/api/interface/website';
|
||||
import { GetHTTPSConfig, ListSSL, UpdateHTTPSConfig } from '@/api/modules/website';
|
||||
import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
|
||||
import { ElMessageBox, FormInstance } from 'element-plus';
|
||||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import i18n from '@/lang';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { dateFormatSimple, getProvider } from '@/utils/util';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
|
@ -214,7 +215,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
form.websiteId = id.value;
|
||||
UpdateHTTPSConfig(form)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
get();
|
||||
})
|
||||
.finally(() => {
|
||||
|
@ -244,7 +245,7 @@ const changeEnable = (enable: boolean) => {
|
|||
form.websiteId = id.value;
|
||||
UpdateHTTPSConfig(form).then(() => {
|
||||
done();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
get();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -47,9 +47,10 @@
|
|||
import { Rules } from '@/global/form-rules';
|
||||
import { Website } from '@/api/interface/website';
|
||||
import { GetNginxConfig, UpdateNginxConfig } from '@/api/modules/website';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
|
@ -150,7 +151,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
}
|
||||
UpdateNginxConfig(req)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
search(req);
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -41,8 +41,9 @@ import { GetWebsite, UpdateWebsite } from '@/api/modules/website';
|
|||
import { Rules } from '@/global/form-rules';
|
||||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import { ListGroups } from '@/api/modules/website';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const websiteForm = ref<FormInstance>();
|
||||
const props = defineProps({
|
||||
|
@ -76,7 +77,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = true;
|
||||
UpdateWebsite(form)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
search();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -27,10 +27,10 @@ import { oneDark } from '@codemirror/theme-one-dark';
|
|||
import { GetWebsiteNginx, UpdateNginxFile } from '@/api/modules/website';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { File } from '@/api/interface/file';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import { StreamLanguage } from '@codemirror/language';
|
||||
import { nginx } from '@codemirror/legacy-modes/mode/nginx';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const extensions = [StreamLanguage.define(nginx), oneDark];
|
||||
|
||||
|
@ -68,7 +68,7 @@ const submit = () => {
|
|||
content: content.value,
|
||||
})
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -44,7 +44,8 @@ import { SaveFileContent } from '@/api/modules/files';
|
|||
import { GetWafConfig, UpdateWafEnable } from '@/api/modules/website';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
|
@ -115,7 +116,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
loading.value = true;
|
||||
SaveFileContent(fileUpdate)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -36,8 +36,8 @@ import { GetWafConfig, UpdateWafEnable } from '@/api/modules/website';
|
|||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import ComplexTable from '@/components/complex-table/index.vue';
|
||||
import { SaveFileContent } from '@/api/modules/files';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
|
@ -112,7 +112,7 @@ const submit = async (extArray: string[]) => {
|
|||
SaveFileContent(fileUpdate)
|
||||
.then(() => {
|
||||
exts.value = '';
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
get();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -36,9 +36,9 @@ import { GetWafConfig, UpdateWafEnable } from '@/api/modules/website';
|
|||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import ComplexTable from '@/components/complex-table/index.vue';
|
||||
import { SaveFileContent } from '@/api/modules/files';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import { checkIp } from '@/utils/util';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
|
@ -117,7 +117,7 @@ const openCreate = () => {
|
|||
}
|
||||
for (const id in ipArray) {
|
||||
if (checkIp(ipArray[id])) {
|
||||
ElMessage.error(i18n.global.t('commons.rule.ipErr', [ipArray[id]]));
|
||||
MsgError(i18n.global.t('commons.rule.ipErr', [ipArray[id]]));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ const submit = async (ipList: string[]) => {
|
|||
.then(() => {
|
||||
ips.value = '';
|
||||
get();
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -36,8 +36,8 @@ import { GetWafConfig, UpdateWafEnable } from '@/api/modules/website';
|
|||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import ComplexTable from '@/components/complex-table/index.vue';
|
||||
import { SaveFileContent } from '@/api/modules/files';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
|
@ -138,7 +138,7 @@ const submit = async (addArray: string[]) => {
|
|||
SaveFileContent(fileUpdate)
|
||||
.then(() => {
|
||||
add.value = '';
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
get();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -176,10 +176,11 @@ import { GetApp, GetAppDetail, SearchApp, GetAppInstalled } from '@/api/modules/
|
|||
import { CreateWebsite, ListGroups, PreCheck } from '@/api/modules/website';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElForm, FormInstance, ElMessage } from 'element-plus';
|
||||
import { ElForm, FormInstance } from 'element-plus';
|
||||
import { reactive, ref } from 'vue';
|
||||
import Params from '@/views/app-store/detail/params/index.vue';
|
||||
import Check from '../check/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const buttonList = [
|
||||
{
|
||||
|
@ -338,7 +339,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
} else {
|
||||
CreateWebsite(website.value)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.createSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
||||
handleClose();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -41,8 +41,8 @@ import DrawerHeader from '@/components/drawer-header/index.vue';
|
|||
import { Website } from '@/api/interface/Website';
|
||||
import { ChangeDefaultServer, ListWebsites } from '@/api/modules/website';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
let open = ref(false);
|
||||
let websites = ref<any>();
|
||||
|
@ -71,7 +71,7 @@ const get = async () => {
|
|||
|
||||
const submit = () => {
|
||||
ChangeDefaultServer({ id: defaultId.value }).then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
handleClose();
|
||||
});
|
||||
};
|
||||
|
|
|
@ -46,9 +46,10 @@
|
|||
<script lang="ts" setup>
|
||||
import { DeleteWebsite } from '@/api/modules/website';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
import { Website } from '@/api/interface/website';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
let key = 1;
|
||||
let open = ref(false);
|
||||
|
@ -91,7 +92,7 @@ const submit = () => {
|
|||
DeleteWebsite(deleteReq.value)
|
||||
.then(() => {
|
||||
handleClose();
|
||||
ElMessage.success(i18n.global.t('commons.msg.deleteSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.deleteSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -52,8 +52,8 @@ import { ref } from 'vue';
|
|||
import i18n from '@/lang';
|
||||
import ComplexTable from '@/components/complex-table/index.vue';
|
||||
import { ListGroups, CreateGroup, DeleteGroup, UpdateGroup } from '@/api/modules/website';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import Header from '@/components/drawer-header/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
interface groupData {
|
||||
id: number;
|
||||
|
@ -95,12 +95,12 @@ const saveGroup = (create: groupData, isDefault: boolean) => {
|
|||
}
|
||||
if (create.id == 0) {
|
||||
CreateGroup(group).then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.createSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
||||
search();
|
||||
});
|
||||
} else {
|
||||
UpdateGroup(group).then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
search();
|
||||
});
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ const deleteGroup = (index: number) => {
|
|||
if (group.id > 0) {
|
||||
DeleteGroup({ id: group.id }).then(() => {
|
||||
data.value.splice(index, 1);
|
||||
ElMessage.success(i18n.global.t('commons.msg.deleteSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.deleteSuccess'));
|
||||
});
|
||||
} else {
|
||||
data.value.splice(index, 1);
|
||||
|
|
|
@ -163,8 +163,9 @@ import NginxConfig from './nginx/index.vue';
|
|||
import i18n from '@/lang';
|
||||
import router from '@/routers';
|
||||
import { App } from '@/api/interface/app';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { dateFormatSimple } from '@/utils/util';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const shortcuts = [
|
||||
{
|
||||
|
@ -292,7 +293,7 @@ const submitDate = (row: any) => {
|
|||
|
||||
UpdateWebsite(req).then(() => {
|
||||
row.change = true;
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -366,7 +367,7 @@ const opWebsite = (op: string, id: number) => {
|
|||
cancelButtonText: i18n.global.t('commons.button.cancel'),
|
||||
}).then(async () => {
|
||||
await OpWebsite({ id: id, operate: op });
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
search();
|
||||
});
|
||||
};
|
||||
|
|
|
@ -57,7 +57,8 @@ import { Nginx } from '@/api/interface/nginx';
|
|||
import { GetNginxConfigByScope, UpdateNginxConfigByScope } from '@/api/modules/nginx';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, FormInstance } from 'element-plus';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
|
||||
let req = ref<Nginx.NginxScopeReq>({
|
||||
|
@ -125,7 +126,7 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
updateReq.value.params = params;
|
||||
UpdateNginxConfigByScope(updateReq.value)
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
getParams();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -43,9 +43,9 @@ import { Codemirror } from 'vue-codemirror';
|
|||
import { StreamLanguage } from '@codemirror/language';
|
||||
import { nginx } from '@codemirror/legacy-modes/mode/nginx';
|
||||
import { oneDark } from '@codemirror/theme-one-dark';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import { GetAppDefaultConfig } from '@/api/modules/app';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const extensions = [StreamLanguage.define(nginx), oneDark];
|
||||
|
||||
|
@ -62,7 +62,7 @@ const submit = () => {
|
|||
backup: useOld.value,
|
||||
})
|
||||
.then(() => {
|
||||
ElMessage.success(i18n.global.t('commons.msg.updateSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
getNginx();
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
@ -67,12 +67,13 @@ import { reactive, ref } from 'vue';
|
|||
import { computeSize, dateFormatSimple } from '@/utils/util';
|
||||
import { useDeleteData } from '@/hooks/use-delete-data';
|
||||
import i18n from '@/lang';
|
||||
import { ElMessage, UploadFile, UploadFiles, UploadInstance, UploadProps } from 'element-plus';
|
||||
import { UploadFile, UploadFiles, UploadInstance, UploadProps } from 'element-plus';
|
||||
import { File } from '@/api/interface/file';
|
||||
import { BatchDeleteFile, GetFilesList, UploadFileData } from '@/api/modules/files';
|
||||
import { RecoverWebsiteByUpload } from '@/api/modules/website';
|
||||
import { loadBaseDir } from '@/api/modules/setting';
|
||||
import Header from '@/components/drawer-header/index.vue';
|
||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
|
||||
const selects = ref<any>([]);
|
||||
const baseDir = ref();
|
||||
|
@ -125,7 +126,7 @@ const onRecover = async (row: File.File) => {
|
|||
await RecoverWebsiteByUpload(params)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
@ -137,7 +138,7 @@ const uploadRef = ref<UploadInstance>();
|
|||
|
||||
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
|
||||
if (rawFile.name.endsWith('.tar.gz')) {
|
||||
ElMessage.error(i18n.global.t('database.unSupportType'));
|
||||
MsgError(i18n.global.t('database.unSupportType'));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -165,7 +166,7 @@ const onSubmit = () => {
|
|||
UploadFileData(formData, {})
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
ElMessage.success(i18n.global.t('file.uploadSuccess'));
|
||||
MsgSuccess(i18n.global.t('file.uploadSuccess'));
|
||||
handleClose();
|
||||
search();
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue