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"`
Favorite bool `json:"favorite"`
App AppDetail `json:"app"`
Container string `json:"container"`
}
type DatabaseConn struct {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -203,7 +203,11 @@ const openCreate = () => {
};
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) => {

View file

@ -694,7 +694,11 @@ const openLog = (row: any) => {
taskLogRef.value.openWithResourceID('App', 'TaskInstall', row.id);
break;
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) => {
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) => {

View file

@ -219,7 +219,11 @@ const openDelete = async (row: Runtime.Runtime) => {
};
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) => {

View file

@ -219,7 +219,11 @@ const openDelete = (row: Runtime.Runtime) => {
};
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) => {

View file

@ -235,7 +235,11 @@ const openDelete = async (row: Runtime.Runtime) => {
};
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) => {

View file

@ -278,7 +278,11 @@ const openTerminal = (row: Runtime.Runtime) => {
const openLog = (row: Runtime.RuntimeDTO) => {
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 {
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) => {
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) => {