Merge branch 'dev' into task/i18n

This commit is contained in:
a20070322 2024-05-10 13:34:22 +08:00
commit 5059ec3178
5 changed files with 89 additions and 60 deletions

View File

@ -267,6 +267,7 @@ public class ProjectFileControl extends BaseAgentController {
if (StrUtil.isEmpty(after)) {
return null;
}
log.debug("开始准备项目重启:{} {}", pim.getId(), after);
//
AfterOpt afterOpt = BaseEnum.getEnum(AfterOpt.class, Convert.toInt(after, AfterOpt.No.getCode()));
if ("restart".equalsIgnoreCase(after) || afterOpt == AfterOpt.Restart) {

View File

@ -113,6 +113,7 @@ public class ProjectFileBackupService {
return null;
}
String backupId = DateTime.now().toString(DatePattern.PURE_DATETIME_MS_FORMAT);
log.debug("开始准备备份项目文件:{} {}", projectInfoModel.getId(), backupId);
File projectFileBackup = this.pathProjectBackup(infoModel, backupId);
Assert.state(!FileUtil.exist(projectFileBackup), "备份目录冲突:" + projectFileBackup.getName());
FileUtil.copyContent(file, projectFileBackup, true);
@ -180,6 +181,7 @@ public class ProjectFileBackupService {
// 备份ID 不存在
return;
}
log.debug("开始检查备份项目文件:{} {}", projectInfoModel.getId(), backupId);
NodeProjectInfoModel infoModel = projectInfoService.resolveModel(projectInfoModel);
File projectPath = projectInfoService.resolveLibFile(infoModel);
DslYmlDto dslYmlDto = infoModel.dslConfig();

View File

@ -467,34 +467,44 @@
:footer="null"
:mask-closable="false"
>
<a-tabs>
<a-tab-pane key="1" tab="docker">
<a-list bordered :data-source="workspaceDockerData && workspaceDockerData.dockerList">
<template #renderItem="{ item }">
<a-list-item style="display: block">
<a-row>
<a-col :span="10">Docker 名称{{ item.name }}</a-col>
<a-col :span="10">所属工作空间 {{ item.workspace && item.workspace.name }}</a-col>
<a-col :span="4"> </a-col>
</a-row>
</a-list-item>
</template>
</a-list>
</a-tab-pane>
<a-tab-pane key="2" tab="集群">
<a-list bordered :data-source="workspaceDockerData && workspaceDockerData.swarmList">
<template #renderItem="{ item }">
<a-list-item style="display: block">
<a-row>
<a-col :span="10">集群名称{{ item.name }}</a-col>
<a-col :span="10">所属工作空间 {{ item.workspace && item.workspace.name }}</a-col>
<a-col :span="4"> </a-col>
</a-row>
</a-list-item>
</template>
</a-list>
</a-tab-pane>
</a-tabs>
<a-space direction="vertical" style="width: 100%">
<a-alert
message="已经分配到工作空间的 Docker 或者集群无非直接删除,需要到分配到的各个工作空间逐一删除后才能删除资产 Docker 或者集群"
type="info"
show-icon
v-if="
workspaceDockerData && (workspaceDockerData.dockerList?.length || workspaceDockerData.swarmList?.length)
"
/>
<a-tabs>
<a-tab-pane key="1" tab="docker">
<a-list bordered :data-source="workspaceDockerData && workspaceDockerData.dockerList">
<template #renderItem="{ item }">
<a-list-item style="display: block">
<a-row>
<a-col :span="10">Docker 名称{{ item.name }}</a-col>
<a-col :span="10">所属工作空间 {{ item.workspace && item.workspace.name }}</a-col>
<a-col :span="4"> </a-col>
</a-row>
</a-list-item>
</template>
</a-list>
</a-tab-pane>
<a-tab-pane key="2" tab="集群">
<a-list bordered :data-source="workspaceDockerData && workspaceDockerData.swarmList">
<template #renderItem="{ item }">
<a-list-item style="display: block">
<a-row>
<a-col :span="10">集群名称{{ item.name }}</a-col>
<a-col :span="10">所属工作空间 {{ item.workspace && item.workspace.name }}</a-col>
<a-col :span="4"> </a-col>
</a-row>
</a-list-item>
</template>
</a-list>
</a-tab-pane>
</a-tabs>
</a-space>
</a-modal>
<!-- 选择证书文件 -->
<a-drawer

View File

@ -469,20 +469,28 @@
:footer="null"
:mask-closable="false"
>
<a-list bordered :data-source="nodeList">
<template #renderItem="{ item }">
<a-list-item style="display: block">
<a-row>
<a-col :span="10">节点名称{{ item.name }}</a-col>
<a-col :span="10">所属工作空间 {{ item.workspace && item.workspace.name }}</a-col>
<a-col :span="4">
<a-button type="link" @click="toNode(item.id, item.name, item.workspace && item.workspace.id)">
<LoginOutlined /> </a-button
></a-col>
</a-row>
</a-list-item>
</template>
</a-list>
<a-space direction="vertical" style="width: 100%">
<a-alert
message="已经分配到工作空间的机器无非直接删除,需要到分配到的各个工作空间逐一删除后才能删除资产机器"
type="info"
show-icon
v-if="nodeList && nodeList.length"
/>
<a-list bordered :data-source="nodeList">
<template #renderItem="{ item }">
<a-list-item style="display: block">
<a-row>
<a-col :span="10">节点名称{{ item.name }}</a-col>
<a-col :span="10">所属工作空间 {{ item.workspace && item.workspace.name }}</a-col>
<a-col :span="4">
<a-button type="link" @click="toNode(item.id, item.name, item.workspace && item.workspace.id)">
<LoginOutlined /> </a-button
></a-col>
</a-row>
</a-list-item>
</template>
</a-list>
</a-space>
</a-modal>
<!-- 分发节点授权 -->
<a-modal

View File

@ -444,24 +444,32 @@
:footer="null"
:mask-closable="false"
>
<a-list bordered :data-source="workspaceSshList">
<template #renderItem="{ item }">
<a-list-item style="display: block">
<a-row>
<a-col :span="10">SSH名称{{ item.name }}</a-col>
<a-col :span="10">所属工作空间 {{ item.workspace && item.workspace.name }}</a-col>
<a-col :span="4">
<a-button v-if="item.workspace" size="small" type="primary" @click="configWorkspaceSsh(item)"
>配置
</a-button>
<a-button v-else size="small" type="primary" danger @click="handleDeleteWorkspaceItem(item)"
>删除
</a-button>
</a-col>
</a-row>
</a-list-item>
</template>
</a-list>
<a-space direction="vertical" style="width: 100%">
<a-alert
message="已经分配到工作空间的 SSH 无非直接删除,需要到分配到的各个工作空间逐一删除后才能删除资产 SSH"
type="info"
show-icon
v-if="workspaceSshList && workspaceSshList.length"
/>
<a-list bordered :data-source="workspaceSshList">
<template #renderItem="{ item }">
<a-list-item style="display: block">
<a-row>
<a-col :span="10">SSH名称{{ item.name }}</a-col>
<a-col :span="10">所属工作空间 {{ item.workspace && item.workspace.name }}</a-col>
<a-col :span="4">
<a-button v-if="item.workspace" size="small" type="primary" @click="configWorkspaceSsh(item)"
>配置
</a-button>
<a-button v-else size="small" type="primary" danger @click="handleDeleteWorkspaceItem(item)"
>删除
</a-button>
</a-col>
</a-row>
</a-list-item>
</template>
</a-list>
</a-space>
</a-modal>
<a-modal
v-model:open="configWorkspaceSshVisible"