mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-09 11:10:34 +08:00
fix: Standardize logging component (#8054)
This commit is contained in:
parent
4cfc3439cb
commit
660dc62f3c
50 changed files with 163 additions and 130 deletions
|
|
@ -119,7 +119,7 @@ import i18n from '@/lang';
|
|||
import { Backup } from '@/api/interface/backup';
|
||||
import router from '@/routers';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { GlobalStore } from '@/store';
|
||||
const globalStore = GlobalStore();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
<template>
|
||||
<DrawerPro v-model="open" :header="$t('commons.button.log')" size="large" @close="handleClose">
|
||||
<LogFile :config="config" :height-diff="config.heightDiff"></LogFile>
|
||||
</DrawerPro>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import LogFile from '@/components/log-file/index.vue';
|
||||
|
||||
interface LogProps {
|
||||
id: number;
|
||||
type: string;
|
||||
style: string;
|
||||
name: string;
|
||||
tail: boolean;
|
||||
heightDiff: number;
|
||||
}
|
||||
|
||||
const open = ref(false);
|
||||
const config = ref();
|
||||
const em = defineEmits(['close']);
|
||||
|
||||
const handleClose = () => {
|
||||
open.value = false;
|
||||
em('close', false);
|
||||
};
|
||||
|
||||
const acceptParams = (props: LogProps) => {
|
||||
config.value = props;
|
||||
open.value = true;
|
||||
};
|
||||
|
||||
defineExpose({ acceptParams });
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.fullScreen {
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -22,7 +22,7 @@ import i18n from '@/lang';
|
|||
import { computed, onBeforeUnmount, ref, watch } from 'vue';
|
||||
import { GlobalStore } from '@/store';
|
||||
import screenfull from 'screenfull';
|
||||
import ContainerLog from '@/components/container-log/index.vue';
|
||||
import ContainerLog from '@/components/log/container/index.vue';
|
||||
|
||||
const open = ref(false);
|
||||
const resource = ref('');
|
||||
|
|
@ -27,6 +27,7 @@ import i18n from '@/lang';
|
|||
import { computed, onBeforeUnmount, reactive, ref, watch } from 'vue';
|
||||
import screenfull from 'screenfull';
|
||||
import { GlobalStore } from '@/store';
|
||||
import ContainerLog from '@/components/log/container/index.vue';
|
||||
|
||||
const logVisible = ref(false);
|
||||
const mobile = computed(() => {
|
||||
|
|
@ -24,16 +24,6 @@
|
|||
{{ $t('commons.button.clean') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- <div class="log-container" ref="logContainer">
|
||||
<DynamicScroller :items="logs" :min-item-size="32" v-if="logs.length">
|
||||
<template #default="{ item, active }">
|
||||
<DynamicScrollerItem :item="item" :active="active" :size-dependencies="[item]" :data-index="item">
|
||||
<hightlight :log="item" type="container"></hightlight>
|
||||
</DynamicScrollerItem>
|
||||
</template>
|
||||
</DynamicScroller>
|
||||
</div> -->
|
||||
|
||||
<div class="log-container" ref="logContainer">
|
||||
<div class="log-spacer" :style="{ height: `${totalHeight}px` }"></div>
|
||||
<div
|
||||
|
|
@ -54,7 +44,7 @@ import { dateFormatForName } from '@/utils/util';
|
|||
import { onUnmounted, reactive, ref } from 'vue';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
import hightlight from '@/components/hightlight/index.vue';
|
||||
import hightlight from '@/components/log/custom-hightlight/index.vue';
|
||||
|
||||
const props = defineProps({
|
||||
container: {
|
||||
|
|
@ -79,13 +69,15 @@ const logSearch = reactive({
|
|||
compose: '',
|
||||
});
|
||||
const logHeight = 20;
|
||||
const logCount = ref(0);
|
||||
const logCount = computed(() => logs.value.length);
|
||||
const totalHeight = computed(() => logHeight * logCount.value);
|
||||
const startIndex = ref(0);
|
||||
const containerHeight = ref(500);
|
||||
const visibleCount = computed(() => Math.ceil(containerHeight.value / logHeight));
|
||||
const visibleCount = computed(() => Math.ceil(containerHeight.value / logHeight) + 2);
|
||||
const visibleLogs = computed(() => {
|
||||
return logs.value.slice(startIndex.value, startIndex.value + visibleCount.value);
|
||||
const start = Math.max(0, startIndex.value - 1);
|
||||
const end = startIndex.value + visibleCount.value + 1;
|
||||
return logs.value.slice(start, end);
|
||||
});
|
||||
|
||||
const timeOptions = ref([
|
||||
|
|
@ -185,10 +177,22 @@ const onClean = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const handleScroll = () => {
|
||||
if (logContainer.value) {
|
||||
const scrollTop = logContainer.value.scrollTop;
|
||||
startIndex.value = Math.max(0, Math.floor(scrollTop / logHeight) - 1);
|
||||
}
|
||||
};
|
||||
|
||||
onUnmounted(() => {
|
||||
handleClose();
|
||||
if (logContainer.value) {
|
||||
logContainer.value.removeEventListener('scroll', handleScroll);
|
||||
}
|
||||
});
|
||||
|
||||
const resizeObserver = ref<ResizeObserver | null>(null);
|
||||
|
||||
onMounted(() => {
|
||||
logSearch.container = props.container;
|
||||
logSearch.compose = props.compose;
|
||||
|
|
@ -200,8 +204,12 @@ onMounted(() => {
|
|||
|
||||
nextTick(() => {
|
||||
if (logContainer.value) {
|
||||
logContainer.value.scrollTop = totalHeight.value;
|
||||
containerHeight.value = logContainer.value.getBoundingClientRect().height;
|
||||
containerHeight.value = logContainer.value.clientHeight;
|
||||
logContainer.value.addEventListener('scroll', handleScroll);
|
||||
resizeObserver.value = new ResizeObserver((entries) => {
|
||||
containerHeight.value = entries[0].contentRect.height;
|
||||
});
|
||||
resizeObserver.value.observe(logContainer.value);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -227,7 +235,7 @@ onMounted(() => {
|
|||
}
|
||||
|
||||
.log-container {
|
||||
height: calc(100vh - 405px);
|
||||
height: calc(100vh - 320px);
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
position: relative;
|
||||
85
frontend/src/components/log/drawer/index.vue
Normal file
85
frontend/src/components/log/drawer/index.vue
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<template>
|
||||
<DrawerPro
|
||||
v-model="open"
|
||||
:header="$t('commons.button.log')"
|
||||
@close="handleClose"
|
||||
:size="globalStore.isFullScreen ? 'full' : 'large'"
|
||||
>
|
||||
<template #extra v-if="!mobile">
|
||||
<el-tooltip :content="loadTooltip()" placement="top">
|
||||
<el-button @click="toggleFullscreen" class="fullScreen" icon="FullScreen" plain></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #content>
|
||||
<LogFile :config="config" :height-diff="props.heightDiff"></LogFile>
|
||||
</template>
|
||||
</DrawerPro>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import LogFile from '@/components/log/file/index.vue';
|
||||
import { GlobalStore } from '@/store';
|
||||
import i18n from '@/lang';
|
||||
import screenfull from 'screenfull';
|
||||
|
||||
const globalStore = GlobalStore();
|
||||
interface LogProps {
|
||||
id: number;
|
||||
type: string;
|
||||
name: string;
|
||||
tail: boolean;
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
heightDiff: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
style: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
|
||||
const open = ref(false);
|
||||
const config = ref();
|
||||
const em = defineEmits(['close']);
|
||||
|
||||
const handleClose = () => {
|
||||
open.value = false;
|
||||
globalStore.isFullScreen = false;
|
||||
em('close', false);
|
||||
};
|
||||
|
||||
const mobile = computed(() => {
|
||||
return globalStore.isMobile();
|
||||
});
|
||||
|
||||
function toggleFullscreen() {
|
||||
globalStore.isFullScreen = !globalStore.isFullScreen;
|
||||
}
|
||||
const loadTooltip = () => {
|
||||
return i18n.global.t('commons.button.' + (globalStore.isFullScreen ? 'quitFullscreen' : 'fullscreen'));
|
||||
};
|
||||
|
||||
watch(open, (val) => {
|
||||
if (screenfull.isEnabled && !val && !mobile.value) screenfull.exit();
|
||||
});
|
||||
|
||||
const acceptParams = (logProps: LogProps) => {
|
||||
config.value = logProps;
|
||||
open.value = true;
|
||||
};
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
handleClose();
|
||||
});
|
||||
|
||||
defineExpose({ acceptParams });
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.fullScreen {
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
<slot name="button"></slot>
|
||||
</span>
|
||||
</div>
|
||||
<div class="log-container" ref="logContainer" @scroll="onScroll">
|
||||
<div class="log-container" ref="logContainer" @scroll="onScroll" :style="containerStyle">
|
||||
<div class="log-spacer" :style="{ height: `${totalHeight}px` }"></div>
|
||||
<div
|
||||
v-for="(log, index) in visibleLogs"
|
||||
|
|
@ -36,7 +36,7 @@ import { downloadFile } from '@/utils/util';
|
|||
import { readByLine } from '@/api/modules/files';
|
||||
import { GlobalStore } from '@/store';
|
||||
import bus from '@/global/bus';
|
||||
import hightlight from '@/components/hightlight/index.vue';
|
||||
import hightlight from '@/components/log/custom-hightlight/index.vue';
|
||||
const globalStore = GlobalStore();
|
||||
|
||||
interface LogProps {
|
||||
|
|
@ -79,7 +79,7 @@ const props = defineProps({
|
|||
},
|
||||
heightDiff: {
|
||||
type: Number,
|
||||
default: 500,
|
||||
default: 420,
|
||||
},
|
||||
showTail: {
|
||||
type: Boolean,
|
||||
|
|
@ -311,6 +311,10 @@ const init = async () => {
|
|||
await getContent(false);
|
||||
};
|
||||
|
||||
const containerStyle = computed(() => ({
|
||||
height: `calc(100vh - ${props.heightDiff}px)`,
|
||||
}));
|
||||
|
||||
onMounted(async () => {
|
||||
firstLoading.value = true;
|
||||
await init();
|
||||
|
|
@ -330,7 +334,6 @@ defineExpose({ changeTail, onDownload, clearLog });
|
|||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.log-container {
|
||||
height: calc(100vh - 420px);
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
position: relative;
|
||||
|
|
@ -49,7 +49,7 @@ import { dateFormat } from '@/utils/util';
|
|||
import { searchTasks } from '@/api/modules/log';
|
||||
import { reactive, ref } from '@vue/runtime-core';
|
||||
import { Log } from '@/api/interface/log';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
|
||||
const open = ref(false);
|
||||
const handleClose = () => {
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ import { batchDeleteFile, checkFile, chunkUploadFileData, getUploadList } from '
|
|||
import { loadBaseDir } from '@/api/modules/setting';
|
||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
import { handleRecoverByUpload } from '@/api/modules/backup';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
|
||||
interface DialogProps {
|
||||
type: string;
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@
|
|||
import AppStatus from '@/components/app-status/index.vue';
|
||||
import AddDialog from '@/views/ai/model/add/index.vue';
|
||||
import Conn from '@/views/ai/model/conn/index.vue';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import Terminal from '@/views/ai/model/terminal/index.vue';
|
||||
import Del from '@/views/ai/model/del/index.vue';
|
||||
import PortJumpDialog from '@/components/port-jump/index.vue';
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ import { MsgSuccess } from '@/utils/message';
|
|||
import { GlobalStore } from '@/store';
|
||||
import { newUUID } from '@/utils/util';
|
||||
import Detail from '../detail/index.vue';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
|
||||
const globalStore = GlobalStore();
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ import { MsgError } from '@/utils/message';
|
|||
import { Container } from '@/api/interface/container';
|
||||
import { loadResourceLimit } from '@/api/modules/container';
|
||||
import CodemirrorPro from '@/components/codemirror-pro/index.vue';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { newUUID } from '@/utils/util';
|
||||
import { computeSizeFromMB } from '@/utils/util';
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ import { App } from '@/api/interface/app';
|
|||
import { installedOp } from '@/api/modules/app';
|
||||
import i18n from '@/lang';
|
||||
import bus from '@/global/bus';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
const deleteReq = ref({
|
||||
|
|
|
|||
|
|
@ -376,14 +376,14 @@ import AppDelete from './delete/index.vue';
|
|||
import AppParams from './detail/index.vue';
|
||||
import AppUpgrade from './upgrade/index.vue';
|
||||
import AppIgnore from './ignore/index.vue';
|
||||
import ComposeLogs from '@/components/compose-log/index.vue';
|
||||
import ComposeLogs from '@/components/log/compose/index.vue';
|
||||
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';
|
||||
import { toFolder } from '@/global/business';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
|
||||
const data = ref<any>();
|
||||
const loading = ref(false);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ import { Rules } from '@/global/form-rules';
|
|||
import Diff from './diff/index.vue';
|
||||
import bus from '@/global/bus';
|
||||
import CodemirrorPro from '@/components/codemirror-pro/index.vue';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
const composeDiffRef = ref();
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ import { ElForm, ElMessageBox } from 'element-plus';
|
|||
import { loadBaseDir } from '@/api/modules/setting';
|
||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||
import CodemirrorPro from '@/components/codemirror-pro/index.vue';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { listComposeTemplate, testCompose, upCompose } from '@/api/modules/container';
|
||||
import { newUUID } from '@/utils/util';
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import MonitorDialog from '@/views/container/container/monitor/index.vue';
|
||||
import ContainerLogDialog from '@/views/container/container/log/index.vue';
|
||||
import ContainerLogDialog from '@/components/log/container-drawer/index.vue';
|
||||
import TerminalDialog from '@/views/container/container/terminal/index.vue';
|
||||
import CodemirrorDialog from '@/components/codemirror-dialog/index.vue';
|
||||
import Status from '@/components/status/index.vue';
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { ElForm } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { createContainerByCommand } from '@/api/modules/container';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import { newUUID } from '@/utils/util';
|
||||
|
|
|
|||
|
|
@ -406,11 +406,11 @@ import RenameDialog from '@/views/container/container/rename/index.vue';
|
|||
import UpgradeDialog from '@/views/container/container/upgrade/index.vue';
|
||||
import CommitDialog from '@/views/container/container/commit/index.vue';
|
||||
import MonitorDialog from '@/views/container/container/monitor/index.vue';
|
||||
import ContainerLogDialog from '@/views/container/container/log/index.vue';
|
||||
import TerminalDialog from '@/views/container/container/terminal/index.vue';
|
||||
import CodemirrorDialog from '@/components/codemirror-dialog/index.vue';
|
||||
import PortJumpDialog from '@/components/port-jump/index.vue';
|
||||
import DockerStatus from '@/views/container/docker-status/index.vue';
|
||||
import ContainerLogDialog from '@/components/log/container-drawer/index.vue';
|
||||
import Status from '@/components/status/index.vue';
|
||||
import { reactive, onMounted, ref, computed } from 'vue';
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ import {
|
|||
} from '@/api/modules/container';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import { MsgError } from '@/utils/message';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { checkIpV4V6, checkPort, newUUID } from '@/utils/util';
|
||||
import router from '@/routers';
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ import { Rules } from '@/global/form-rules';
|
|||
import i18n from '@/lang';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { imageBuild } from '@/api/modules/container';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { newUUID } from '@/utils/util';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import i18n from '@/lang';
|
|||
import { ElForm } from 'element-plus';
|
||||
import { imagePull } from '@/api/modules/container';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import { newUUID } from '@/utils/util';
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import { ElForm } from 'element-plus';
|
|||
import { imagePush } from '@/api/modules/container';
|
||||
import { Container } from '@/api/interface/container';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { newUUID } from '@/utils/util';
|
||||
|
||||
const drawerVisible = ref(false);
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ import { MsgSuccess } from '@/utils/message';
|
|||
import { listDbItems } from '@/api/modules/database';
|
||||
import { listAppInstalled } from '@/api/modules/app';
|
||||
import { shortcuts } from '@/utils/shortcuts';
|
||||
import TaskLog from '@/components/task-log/log-without-dialog.vue';
|
||||
import TaskLog from '@/components/log/task/log-without-dialog.vue';
|
||||
|
||||
const loading = ref();
|
||||
const refresh = ref(false);
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { FormInstance } from 'element-plus';
|
||||
import ContainerLog from '@/components/container-log/index.vue';
|
||||
import ContainerLog from '@/components/log/container/index.vue';
|
||||
import Status from '@/views/database/mysql/setting/status/index.vue';
|
||||
import Variables from '@/views/database/mysql/setting/variables/index.vue';
|
||||
import SlowLog from '@/views/database/mysql/setting/slow-log/index.vue';
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<LogPro v-model="slowLogs"></LogPro>
|
||||
<HighlightLog v-model="slowLogs" />
|
||||
<ConfirmDialog @cancel="onCancel" ref="confirmDialogRef" @confirm="onSave"></ConfirmDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -38,7 +38,7 @@ import { loadDBFile, updateMysqlVariables } from '@/api/modules/database';
|
|||
import { dateFormatForName, downloadWithContent } from '@/utils/util';
|
||||
import i18n from '@/lang';
|
||||
import { MsgError, MsgInfo, MsgSuccess } from '@/utils/message';
|
||||
import LogPro from '@/components/log-pro/index.vue';
|
||||
import HighlightLog from '@/components/log/hightlight-log/index.vue';
|
||||
|
||||
const slowLogs = ref();
|
||||
const detailShow = ref();
|
||||
|
|
@ -97,21 +97,6 @@ const handleSlowLogs = async () => {
|
|||
confirmDialogRef.value!.acceptParams(params);
|
||||
};
|
||||
|
||||
// const getDynamicHeight = () => {
|
||||
// if (variables.slow_query_log === 'ON') {
|
||||
// if (globalStore.openMenuTabs) {
|
||||
// return `calc(100vh - 467px)`;
|
||||
// } else {
|
||||
// return `calc(100vh - 437px)`;
|
||||
// }
|
||||
// }
|
||||
// if (globalStore.openMenuTabs) {
|
||||
// return `calc(100vh - 413px)`;
|
||||
// } else {
|
||||
// return `calc(100vh - 383px)`;
|
||||
// }
|
||||
// };
|
||||
|
||||
const changeSlowLogs = () => {
|
||||
if (!(variables.long_query_time > 0 && variables.long_query_time <= 600)) {
|
||||
MsgError(i18n.global.t('database.thresholdRangeHelper'));
|
||||
|
|
@ -166,13 +151,6 @@ const onDownload = async () => {
|
|||
const loadMysqlSlowlogs = async () => {
|
||||
const res = await loadDBFile(currentDB.type + '-slow-logs', currentDB.database);
|
||||
slowLogs.value = res.data || '';
|
||||
// nextTick(() => {
|
||||
// const state = view.value.state;
|
||||
// view.value.dispatch({
|
||||
// selection: { anchor: state.doc.length, head: state.doc.length },
|
||||
// scrollIntoView: true,
|
||||
// });
|
||||
// });
|
||||
};
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { FormInstance } from 'element-plus';
|
||||
import ContainerLog from '@/components/container-log/index.vue';
|
||||
import ContainerLog from '@/components/log/container/index.vue';
|
||||
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { loadDBFile, loadDBBaseInfo, updateDBFile } from '@/api/modules/database';
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import LogFile from '@/components/log-file/index.vue';
|
||||
import LogFile from '@/components/log/file/index.vue';
|
||||
import LogRouter from '@/views/log/router/index.vue';
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { getSystemFiles } from '@/api/modules/log';
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import { dateFormat } from '@/utils/util';
|
|||
import { searchTasks } from '@/api/modules/log';
|
||||
import { onMounted, reactive, ref } from '@vue/runtime-core';
|
||||
import { Log } from '@/api/interface/log';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
|
||||
const loading = ref();
|
||||
const data = ref();
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ import { onMounted } from 'vue';
|
|||
import { ref, nextTick } from 'vue';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import LogFile from '@/components/log-file/index.vue';
|
||||
import LogFile from '@/components/log/file/index.vue';
|
||||
|
||||
const logConfig = reactive({
|
||||
type: 'website',
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ import { ref } from 'vue';
|
|||
import { loadSnapshotInfo, snapshotCreate } from '@/api/modules/setting';
|
||||
import { computeSize, newUUID } from '@/utils/util';
|
||||
import i18n from '@/lang';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { listBackupOptions } from '@/api/modules/backup';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { ElForm } from 'element-plus';
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ import { ElForm } from 'element-plus';
|
|||
import IgnoreRule from '@/views/setting/snapshot/ignore-rule/index.vue';
|
||||
import i18n from '@/lang';
|
||||
import { Setting } from '@/api/interface/setting';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import RecoverStatus from '@/views/setting/snapshot/status/index.vue';
|
||||
import SnapshotImport from '@/views/setting/snapshot/import/index.vue';
|
||||
import SnapshotCreate from '@/views/setting/snapshot/create/index.vue';
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ import { ref } from 'vue';
|
|||
import { FormInstance } from 'element-plus';
|
||||
import i18n from '@/lang';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { snapshotRecover, snapshotRollback } from '@/api/modules/setting';
|
||||
import { computeSize, newUUID } from '@/utils/util';
|
||||
|
||||
|
|
|
|||
|
|
@ -165,7 +165,6 @@ const loadLocal = async () => {
|
|||
};
|
||||
|
||||
const setDefault = () => {
|
||||
console.log('123');
|
||||
hostInfo.addr = '';
|
||||
hostInfo.name = 'local';
|
||||
hostInfo.groupID = defaultGroup.value;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<div v-loading="loading">
|
||||
<LogPro v-model="content" :heightDiff="320"></LogPro>
|
||||
<HighlightLog v-model="content" :heightDiff="320" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { getSupervisorLog } from '@/api/modules/host-tool';
|
||||
import LogPro from '@/components/log-pro/index.vue';
|
||||
import HighlightLog from '@/components/log/hightlight-log/index.vue';
|
||||
|
||||
let content = ref('');
|
||||
let loading = ref(false);
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ import Delete from '@/views/website/runtime/delete/index.vue';
|
|||
import i18n from '@/lang';
|
||||
import RouterMenu from '../index.vue';
|
||||
import router from '@/routers/router';
|
||||
import ComposeLogs from '@/components/compose-log/index.vue';
|
||||
import ComposeLogs from '@/components/log/compose/index.vue';
|
||||
import { Promotion } from '@element-plus/icons-vue';
|
||||
import PortJumpDialog from '@/components/port-jump/index.vue';
|
||||
import AppResources from '@/views/website/runtime/php/check/index.vue';
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ import Delete from '@/views/website/runtime/delete/index.vue';
|
|||
import i18n from '@/lang';
|
||||
import RouterMenu from '../index.vue';
|
||||
import router from '@/routers/router';
|
||||
import ComposeLogs from '@/components/compose-log/index.vue';
|
||||
import ComposeLogs from '@/components/log/compose/index.vue';
|
||||
import { Promotion } from '@element-plus/icons-vue';
|
||||
import PortJumpDialog from '@/components/port-jump/index.vue';
|
||||
import AppResources from '@/views/website/runtime/php/check/index.vue';
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ import Delete from '@/views/website/runtime/delete/index.vue';
|
|||
import i18n from '@/lang';
|
||||
import RouterMenu from '../index.vue';
|
||||
import router from '@/routers/router';
|
||||
import ComposeLogs from '@/components/compose-log/index.vue';
|
||||
import ComposeLogs from '@/components/log/compose/index.vue';
|
||||
import { Promotion } from '@element-plus/icons-vue';
|
||||
import PortJumpDialog from '@/components/port-jump/index.vue';
|
||||
import AppResources from '@/views/website/runtime/php/check/index.vue';
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ import i18n from '@/lang';
|
|||
import RouterMenu from '../index.vue';
|
||||
import Modules from '@/views/website/runtime/node/module/index.vue';
|
||||
import router from '@/routers/router';
|
||||
import ComposeLogs from '@/components/compose-log/index.vue';
|
||||
import ComposeLogs from '@/components/log/compose/index.vue';
|
||||
import { Promotion } from '@element-plus/icons-vue';
|
||||
import PortJumpDialog from '@/components/port-jump/index.vue';
|
||||
import AppResources from '@/views/website/runtime/php/check/index.vue';
|
||||
|
|
|
|||
|
|
@ -122,8 +122,8 @@ import Extensions from './extension-template/index.vue';
|
|||
import AppResources from '@/views/website/runtime/php/check/index.vue';
|
||||
import CreateRuntime from '@/views/website/runtime/php/create/index.vue';
|
||||
import RouterMenu from '../index.vue';
|
||||
import Log from '@/components/log-dialog/index.vue';
|
||||
import ComposeLogs from '@/components/compose-log/index.vue';
|
||||
import Log from '@/components/log/drawer/index.vue';
|
||||
import ComposeLogs from '@/components/log/compose/index.vue';
|
||||
import Config from '@/views/website/runtime/php/config/index.vue';
|
||||
import Supervisor from '@/views/website/runtime/php/supervisor/index.vue';
|
||||
import RuntimeStatus from '@/views/website/runtime/components/runtime-status.vue';
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ import Delete from '@/views/website/runtime/delete/index.vue';
|
|||
import i18n from '@/lang';
|
||||
import RouterMenu from '../index.vue';
|
||||
import router from '@/routers/router';
|
||||
import ComposeLogs from '@/components/compose-log/index.vue';
|
||||
import ComposeLogs from '@/components/log/composeindex.vue';
|
||||
import { Promotion } from '@element-plus/icons-vue';
|
||||
import PortJumpDialog from '@/components/port-jump/index.vue';
|
||||
import AppResources from '@/views/website/runtime/php/check/index.vue';
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@
|
|||
<SSLUpload ref="sslUploadRef" @close="search()" />
|
||||
<Apply ref="applyRef" @search="search" @submit="openLog" />
|
||||
<OpDialog ref="opRef" @search="search" @cancel="search" />
|
||||
<Log ref="logRef" @close="search()" />
|
||||
<Log ref="logRef" @close="search()" :heightDiff="220" />
|
||||
<CA ref="caRef" @close="search()" />
|
||||
<Obtain ref="obtainRef" @close="search()" @submit="openLog" />
|
||||
</LayoutContent>
|
||||
|
|
@ -171,7 +171,7 @@ import { MsgSuccess } from '@/utils/message';
|
|||
import { GlobalStore } from '@/store';
|
||||
import SSLUpload from './upload/index.vue';
|
||||
import Apply from './apply/index.vue';
|
||||
import Log from '@/components/log-dialog/index.vue';
|
||||
import Log from '@/components/log/drawer/index.vue';
|
||||
import Obtain from './obtain/index.vue';
|
||||
import MsgInfo from '@/components/msg-info/index.vue';
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
import { computed, onMounted, ref } from 'vue';
|
||||
import { getWebsite, opWebsiteLog } from '@/api/modules/website';
|
||||
import i18n from '@/lang';
|
||||
import LogFile from '@/components/log-file/index.vue';
|
||||
import LogFile from '@/components/log/file/index.vue';
|
||||
import { MsgSuccess } from '@/utils/message';
|
||||
|
||||
const props = defineProps({
|
||||
|
|
|
|||
|
|
@ -548,7 +548,7 @@ import { Group } from '@/api/interface/group';
|
|||
import { SearchRuntimes } from '@/api/modules/runtime';
|
||||
import { Runtime } from '@/api/interface/runtime';
|
||||
import { getRandomStr, getRuntimeLabel } from '@/utils/util';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { getAppService } from '@/api/modules/app';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { dateFormatSimple, getProvider, getAccountName } from '@/utils/util';
|
||||
|
|
@ -807,7 +807,6 @@ const getRuntimes = async () => {
|
|||
if (runtimes.value.length > 0) {
|
||||
const first = runtimes.value[0];
|
||||
website.value.runtimeID = first.id;
|
||||
console.log('runtimeID', first.id);
|
||||
runtimeResource.value = first.resource;
|
||||
runtimePorts.value = first.port.split(',').map((port: string) => parseInt(port.trim(), 10));
|
||||
if (runtimePorts.value.length > 1) {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
<script lang="ts" setup>
|
||||
import Source from './source/index.vue';
|
||||
import { ref } from 'vue';
|
||||
import ContainerLog from '@/components/container-log/index.vue';
|
||||
import ContainerLog from '@/components/log/container/index.vue';
|
||||
import NginxPer from './performance/index.vue';
|
||||
import Status from './status/index.vue';
|
||||
import Module from './module/index.vue';
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import { FormInstance } from 'element-plus';
|
|||
import { getNginxModules, buildNginx } from '@/api/modules/nginx';
|
||||
import i18n from '@/lang';
|
||||
import { newUUID } from '@/utils/util';
|
||||
import TaskLog from '@/components/task-log/index.vue';
|
||||
import TaskLog from '@/components/log/task/index.vue';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
|
||||
const open = ref(false);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue