fix: fix issue with clean runtime lop failed (#8900)

This commit is contained in:
CityFun 2025-06-04 17:29:36 +08:00 committed by GitHub
parent 109dc26281
commit 1d58810a78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 56 additions and 10 deletions

View file

@ -126,6 +126,7 @@ type AppInstallDTO struct {
CreatedAt time.Time `json:"createdAt"` CreatedAt time.Time `json:"createdAt"`
Favorite bool `json:"favorite"` Favorite bool `json:"favorite"`
App AppDetail `json:"app"` App AppDetail `json:"app"`
Container string `json:"container"`
} }
type DatabaseConn struct { type DatabaseConn struct {

View file

@ -29,6 +29,7 @@ type RuntimeDTO struct {
Environments []request.Environment `json:"environments"` Environments []request.Environment `json:"environments"`
Volumes []request.Volume `json:"volumes"` Volumes []request.Volume `json:"volumes"`
ContainerStatus string `json:"containerStatus"` ContainerStatus string `json:"containerStatus"`
Container string `json:"container"`
} }
type PackageScripts struct { type PackageScripts struct {
@ -51,6 +52,7 @@ func NewRuntimeDTO(runtime model.Runtime) RuntimeDTO {
Version: runtime.Version, Version: runtime.Version,
Port: runtime.Port, Port: runtime.Port,
Path: runtime.GetPath(), Path: runtime.GetPath(),
Container: runtime.ContainerName,
} }
} }

View file

@ -1484,6 +1484,7 @@ func handleInstalled(appInstallList []model.AppInstall, updated bool, sync bool)
Document: installed.App.Document, Document: installed.App.Document,
}, },
Favorite: installed.Favorite, Favorite: installed.Favorite,
Container: installed.ContainerName,
} }
if updated { if updated {
installDTO.DockerCompose = installed.DockerCompose installDTO.DockerCompose = installed.DockerCompose

View file

@ -41,6 +41,7 @@ export namespace Runtime {
exposedPorts?: ExposedPort[]; exposedPorts?: ExposedPort[];
environments?: Environment[]; environments?: Environment[];
volumes?: Volume[]; volumes?: Volume[];
container: string;
} }
export interface RuntimeCreate { export interface RuntimeCreate {

View file

@ -12,7 +12,12 @@
</el-tooltip> </el-tooltip>
</template> </template>
<template #content> <template #content>
<ContainerLog :compose="compose" :resource="resource" :highlightDiff="highlightDiff" /> <ContainerLog
:compose="compose"
:resource="resource"
:container="container"
:highlightDiff="highlightDiff"
/>
</template> </template>
</DrawerPro> </DrawerPro>
</template> </template>
@ -26,6 +31,7 @@ import ContainerLog from '@/components/log/container/index.vue';
const open = ref(false); const open = ref(false);
const resource = ref(''); const resource = ref('');
const container = ref('');
const globalStore = GlobalStore(); const globalStore = GlobalStore();
const logVisible = ref(false); const logVisible = ref(false);
const compose = ref(''); const compose = ref('');
@ -34,6 +40,7 @@ const highlightDiff = ref(320);
interface DialogProps { interface DialogProps {
compose: string; compose: string;
resource: string; resource: string;
container: string;
} }
const defaultProps = defineProps({ const defaultProps = defineProps({
@ -67,6 +74,7 @@ const acceptParams = (props: DialogProps): void => {
highlightDiff.value = defaultProps.highlightDiff; highlightDiff.value = defaultProps.highlightDiff;
compose.value = props.compose; compose.value = props.compose;
resource.value = props.resource; resource.value = props.resource;
container.value = props.container;
open.value = true; open.value = true;
}; };

View file

@ -197,6 +197,7 @@ const onClean = async () => {
cancelButtonText: i18n.global.t('commons.button.cancel'), cancelButtonText: i18n.global.t('commons.button.cancel'),
type: 'info', type: 'info',
}).then(async () => { }).then(async () => {
console.log(logSearch);
await cleanContainerLog(logSearch.container); await cleanContainerLog(logSearch.container);
searchLogs(); searchLogs();
MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));

View file

@ -203,7 +203,11 @@ const openCreate = () => {
}; };
const openLog = (row: AI.McpServer) => { const openLog = (row: AI.McpServer) => {
composeLogRef.value.acceptParams({ compose: row.dir + '/docker-compose.yml', resource: row.name }); composeLogRef.value.acceptParams({
compose: row.dir + '/docker-compose.yml',
resource: row.name,
container: row.containerName,
});
}; };
const deleteServer = async (row: AI.McpServer) => { const deleteServer = async (row: AI.McpServer) => {

View file

@ -694,7 +694,11 @@ const openLog = (row: any) => {
taskLogRef.value.openWithResourceID('App', 'TaskInstall', row.id); taskLogRef.value.openWithResourceID('App', 'TaskInstall', row.id);
break; break;
default: default:
composeLogRef.value.acceptParams({ compose: row.path + '/docker-compose.yml', resource: row.name }); composeLogRef.value.acceptParams({
compose: row.path + '/docker-compose.yml',
resource: row.name,
container: row.container,
});
} }
}; };

View file

@ -225,7 +225,11 @@ const openTerminal = (row: Runtime.Runtime) => {
}; };
const openLog = (row: any) => { const openLog = (row: any) => {
composeLogRef.value.acceptParams({ compose: row.path + '/docker-compose.yml', resource: row.name }); composeLogRef.value.acceptParams({
compose: row.path + '/docker-compose.yml',
resource: row.name,
container: row.container,
});
}; };
const goDashboard = async (port: any, protocol: string) => { const goDashboard = async (port: any, protocol: string) => {

View file

@ -219,7 +219,11 @@ const openDelete = async (row: Runtime.Runtime) => {
}; };
const openLog = (row: any) => { const openLog = (row: any) => {
composeLogRef.value.acceptParams({ compose: row.path + '/docker-compose.yml', resource: row.name }); composeLogRef.value.acceptParams({
compose: row.path + '/docker-compose.yml',
resource: row.name,
container: row.container,
});
}; };
const goDashboard = async (port: any, protocol: string) => { const goDashboard = async (port: any, protocol: string) => {

View file

@ -219,7 +219,11 @@ const openDelete = (row: Runtime.Runtime) => {
}; };
const openLog = (row: any) => { const openLog = (row: any) => {
composeLogRef.value.acceptParams({ compose: row.path + '/docker-compose.yml', resource: row.name }); composeLogRef.value.acceptParams({
compose: row.path + '/docker-compose.yml',
resource: row.name,
container: row.container,
});
}; };
const openTerminal = (row: Runtime.Runtime) => { const openTerminal = (row: Runtime.Runtime) => {

View file

@ -235,7 +235,11 @@ const openDelete = async (row: Runtime.Runtime) => {
}; };
const openLog = (row: any) => { const openLog = (row: any) => {
composeLogRef.value.acceptParams({ compose: row.path + '/docker-compose.yml', resource: row.name }); composeLogRef.value.acceptParams({
compose: row.path + '/docker-compose.yml',
resource: row.name,
container: row.container,
});
}; };
const goDashboard = async (port: any, protocol: string) => { const goDashboard = async (port: any, protocol: string) => {

View file

@ -278,7 +278,11 @@ const openTerminal = (row: Runtime.Runtime) => {
const openLog = (row: Runtime.RuntimeDTO) => { const openLog = (row: Runtime.RuntimeDTO) => {
if (row.status == 'Running') { if (row.status == 'Running') {
composeLogRef.value.acceptParams({ compose: row.path + '/docker-compose.yml', resource: row.name }); composeLogRef.value.acceptParams({
compose: row.path + '/docker-compose.yml',
resource: row.name,
container: row.container,
});
} else { } else {
logRef.value.acceptParams({ id: row.id, type: 'php', tail: row.status == 'Building' }); logRef.value.acceptParams({ id: row.id, type: 'php', tail: row.status == 'Building' });
} }

View file

@ -219,7 +219,11 @@ const openDelete = async (row: Runtime.Runtime) => {
}; };
const openLog = (row: any) => { const openLog = (row: any) => {
composeLogRef.value.acceptParams({ compose: row.path + '/docker-compose.yml', resource: row.name }); composeLogRef.value.acceptParams({
compose: row.path + '/docker-compose.yml',
resource: row.name,
container: row.container,
});
}; };
const goDashboard = async (port: any, protocol: string) => { const goDashboard = async (port: any, protocol: string) => {