mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-09 20:05:54 +08:00
fix: fix issue with clean runtime lop failed (#8900)
This commit is contained in:
parent
109dc26281
commit
1d58810a78
14 changed files with 56 additions and 10 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ export namespace Runtime {
|
|||
exposedPorts?: ExposedPort[];
|
||||
environments?: Environment[];
|
||||
volumes?: Volume[];
|
||||
container: string;
|
||||
}
|
||||
|
||||
export interface RuntimeCreate {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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' });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue