diff --git a/docker/adminer/build.sh b/docker/adminer/build.sh index 0e499258..f5085cfd 100644 --- a/docker/adminer/build.sh +++ b/docker/adminer/build.sh @@ -1,6 +1,6 @@ #/bin/bash set -e -version=2.3.8 +version=2.3.9 docker build -t orion-visor-adminer:${version} . docker tag orion-visor-adminer:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:${version} docker tag orion-visor-adminer:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:latest diff --git a/docker/mysql/build.sh b/docker/mysql/build.sh index 925c0fa2..6182604d 100644 --- a/docker/mysql/build.sh +++ b/docker/mysql/build.sh @@ -1,6 +1,6 @@ #/bin/bash set -e -version=2.3.8 +version=2.3.9 cp -r ../../sql ./sql docker build -t orion-visor-mysql:${version} . rm -rf ./sql diff --git a/docker/push.sh b/docker/push.sh index 39812f79..e1797e5e 100644 --- a/docker/push.sh +++ b/docker/push.sh @@ -1,6 +1,6 @@ #/bin/bash set -e -version=2.3.8 +version=2.3.9 docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:${version} docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:${version} docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:${version} diff --git a/docker/redis/build.sh b/docker/redis/build.sh index d0c84beb..292baaa5 100644 --- a/docker/redis/build.sh +++ b/docker/redis/build.sh @@ -1,6 +1,6 @@ #/bin/bash set -e -version=2.3.8 +version=2.3.9 docker build -t orion-visor-redis:${version} . docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:${version} docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest diff --git a/docker/service/build.sh b/docker/service/build.sh index d77b26af..bab0a84b 100644 --- a/docker/service/build.sh +++ b/docker/service/build.sh @@ -1,6 +1,6 @@ #/bin/bash set -e -version=2.3.8 +version=2.3.9 mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar docker build -t orion-visor-service:${version} . rm -rf ./orion-visor-launch.jar diff --git a/docker/ui/build.sh b/docker/ui/build.sh index cca3e365..cadd9df8 100644 --- a/docker/ui/build.sh +++ b/docker/ui/build.sh @@ -1,6 +1,6 @@ #/bin/bash set -e -version=2.3.8 +version=2.3.9 mv ../../orion-visor-ui/dist ./dist docker build -t orion-visor-ui:${version} . rm -rf ./orion-visor-launch.jar diff --git a/orion-visor-common/src/main/java/org/dromara/visor/common/constant/AppConst.java b/orion-visor-common/src/main/java/org/dromara/visor/common/constant/AppConst.java index a93a53c7..e80c7282 100644 --- a/orion-visor-common/src/main/java/org/dromara/visor/common/constant/AppConst.java +++ b/orion-visor-common/src/main/java/org/dromara/visor/common/constant/AppConst.java @@ -36,7 +36,7 @@ public interface AppConst extends OrionConst { /** * 同 ${orion.version} 迭代时候需要手动更改 */ - String VERSION = "2.3.8"; + String VERSION = "2.3.9"; /** * 同 ${spring.application.name} diff --git a/orion-visor-dependencies/pom.xml b/orion-visor-dependencies/pom.xml index 37c0db2f..0e27d55d 100644 --- a/orion-visor-dependencies/pom.xml +++ b/orion-visor-dependencies/pom.xml @@ -14,7 +14,7 @@ https://github.com/dromara/orion-visor - 2.3.8 + 2.3.9 2.7.17 2.7.15 1.5.0 diff --git a/orion-visor-launch/src/test/java/org/dromara/visor/launch/ReplaceVersion.java b/orion-visor-launch/src/test/java/org/dromara/visor/launch/ReplaceVersion.java index b0de9f73..bde1e71d 100644 --- a/orion-visor-launch/src/test/java/org/dromara/visor/launch/ReplaceVersion.java +++ b/orion-visor-launch/src/test/java/org/dromara/visor/launch/ReplaceVersion.java @@ -39,9 +39,9 @@ import java.util.function.Function; */ public class ReplaceVersion { - private static final String TARGET_VERSION = "2.3.7"; + private static final String TARGET_VERSION = "2.3.8"; - private static final String REPLACE_VERSION = "2.3.8"; + private static final String REPLACE_VERSION = "2.3.9"; private static final String PATH = new File("").getAbsolutePath(); diff --git a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/controller/HostController.java b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/controller/HostController.java index 3b7629f7..9520f585 100644 --- a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/controller/HostController.java +++ b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/controller/HostController.java @@ -84,6 +84,17 @@ public class HostController { return hostService.updateHostById(request); } + @DemoDisableApi + @OperatorLog(HostOperatorType.CREATE) + @PostMapping("/copy") + @Operation(summary = "复制主机") + @PreAuthorize("@ss.hasPermission('asset:host:create')") + public Long copyHost(@Validated @RequestBody HostUpdateRequest request) { + Long id = request.getId(); + request.setId(null); + return hostService.copyHost(id, request); + } + @DemoDisableApi @OperatorLog(HostOperatorType.UPDATE_STATUS) @PutMapping("/update-status") diff --git a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/convert/HostConvert.java b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/convert/HostConvert.java index b91ed80e..55fc70e1 100644 --- a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/convert/HostConvert.java +++ b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/convert/HostConvert.java @@ -61,6 +61,8 @@ public interface HostConvert { HostBaseVO toBase(HostDO domain); + HostCreateRequest toCreate(HostUpdateRequest request); + List toList(List domain); List toBaseList(List domain); diff --git a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/dao/HostConfigDAO.java b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/dao/HostConfigDAO.java index 59dd7e6d..53b52021 100644 --- a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/dao/HostConfigDAO.java +++ b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/dao/HostConfigDAO.java @@ -57,6 +57,20 @@ public interface HostConfigDAO extends IMapper { .getOne(); } + /** + * 通过 hostId 查询 + * + * @param hostId hostId + * @return config + */ + default List selectByHostId(Long hostId) { + return this.of() + .createWrapper() + .eq(HostConfigDO::getHostId, hostId) + .then() + .list(); + } + /** * 更新配置状态 * diff --git a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostConfigService.java b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostConfigService.java index c3efacc4..2595ba88 100644 --- a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostConfigService.java +++ b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostConfigService.java @@ -26,6 +26,8 @@ import org.dromara.visor.common.handler.data.model.GenericsDataModel; import org.dromara.visor.module.asset.entity.request.host.HostConfigQueryRequest; import org.dromara.visor.module.asset.entity.request.host.HostConfigUpdateRequest; +import java.util.List; + /** * 主机配置 服务类 * @@ -43,6 +45,15 @@ public interface HostConfigService { */ Integer updateHostConfig(HostConfigUpdateRequest request); + /** + * 复制主机配置 + * + * @param originId originId + * @param newId newId + * @param types types + */ + void copyHostConfig(Long originId, Long newId, List types); + /** * 获取主机配置 * diff --git a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostExtraService.java b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostExtraService.java index 181dfd83..2a512c05 100644 --- a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostExtraService.java +++ b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostExtraService.java @@ -75,4 +75,12 @@ public interface HostExtraService { */ Integer updateHostExtra(HostExtraUpdateRequest request); + /** + * 复制主机拓展信息 + * + * @param originId originId + * @param newId newId + */ + void copyHostExtra(Long originId, Long newId); + } diff --git a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostService.java b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostService.java index 3866c505..f9f33e10 100644 --- a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostService.java +++ b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/HostService.java @@ -47,6 +47,15 @@ public interface HostService { */ Long createHost(HostCreateRequest request); + /** + * 复制主机 + * + * @param originId originId + * @param request request + * @return id + */ + Long copyHost(Long originId, HostUpdateRequest request); + /** * 通过 id 更新主机 * diff --git a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostConfigServiceImpl.java b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostConfigServiceImpl.java index 0e291d2e..d3370f8d 100644 --- a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostConfigServiceImpl.java +++ b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostConfigServiceImpl.java @@ -22,6 +22,8 @@ */ package org.dromara.visor.module.asset.service.impl; +import cn.orionsec.kit.lang.function.Functions; +import cn.orionsec.kit.lang.utils.Strings; import com.alibaba.fastjson.JSON; import lombok.extern.slf4j.Slf4j; import org.dromara.visor.common.constant.ErrorMessage; @@ -42,6 +44,10 @@ import org.dromara.visor.module.asset.service.HostConfigService; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * 主机配置 服务实现类 @@ -102,6 +108,34 @@ public class HostConfigServiceImpl implements HostConfigService { } } + @Override + public void copyHostConfig(Long originId, Long newId, List types) { + // 查询原始主机配置 + Map originHostConfigMap = hostConfigDAO.selectByHostId(originId) + .stream() + .collect(Collectors.toMap(HostConfigDO::getType, + HostConfigDO::getConfig, + Functions.right())); + // 新增 + List records = new ArrayList<>(); + for (String type : types) { + // 获取原始配置 + String configValue = originHostConfigMap.get(type); + if (Strings.isBlank(configValue)) { + // 获取默认值 + configValue = HostTypeEnum.of(type).getDefault().serial(); + } + HostConfigDO newConfig = HostConfigDO.builder() + .hostId(newId) + .type(type) + .status(EnableStatus.ENABLED.name()) + .config(configValue) + .build(); + records.add(newConfig); + } + hostConfigDAO.insertBatch(records); + } + @Override public T getHostConfig(Long hostId, String type) { // 查询配置信息 diff --git a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostExtraServiceImpl.java b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostExtraServiceImpl.java index e1e4fc1a..fadede43 100644 --- a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostExtraServiceImpl.java +++ b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostExtraServiceImpl.java @@ -123,6 +123,29 @@ public class HostExtraServiceImpl implements HostExtraService { return dataExtraApi.updateExtraValue(beforeExtraItem.getId(), newExtra.serial()); } + @Override + public void copyHostExtra(Long originId, Long newId) { + // 查询原始配置 + DataExtraQueryDTO query = DataExtraQueryDTO.builder() + .userId(Const.SYSTEM_USER_ID) + .relId(originId) + .build(); + List items = dataExtraApi.getExtraItems(query, DataExtraTypeEnum.HOST); + if (items.isEmpty()) { + return; + } + // 插入新配置 + List newItems = items.stream() + .map(s -> DataExtraSetDTO.builder() + .userId(Const.SYSTEM_USER_ID) + .relId(newId) + .item(s.getItem()) + .value(s.getValue()) + .build()) + .collect(Collectors.toList()); + dataExtraApi.addExtraItems(newItems, DataExtraTypeEnum.HOST); + } + /** * 检查配置项并且转为视图 (不存在则初始化默认值) * diff --git a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostServiceImpl.java b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostServiceImpl.java index 7ea0a61d..0dc34d70 100644 --- a/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostServiceImpl.java +++ b/orion-visor-modules/orion-visor-module-asset/orion-visor-module-asset-service/src/main/java/org/dromara/visor/module/asset/service/impl/HostServiceImpl.java @@ -49,10 +49,7 @@ import org.dromara.visor.module.asset.entity.vo.HostVO; import org.dromara.visor.module.asset.enums.HostExtraItemEnum; import org.dromara.visor.module.asset.enums.HostStatusEnum; import org.dromara.visor.module.asset.handler.host.extra.model.HostSpecExtraModel; -import org.dromara.visor.module.asset.service.ExecJobHostService; -import org.dromara.visor.module.asset.service.ExecTemplateHostService; -import org.dromara.visor.module.asset.service.HostExtraService; -import org.dromara.visor.module.asset.service.HostService; +import org.dromara.visor.module.asset.service.*; import org.dromara.visor.module.infra.api.DataExtraApi; import org.dromara.visor.module.infra.api.DataGroupRelApi; import org.dromara.visor.module.infra.api.FavoriteApi; @@ -91,6 +88,9 @@ public class HostServiceImpl implements HostService { @Resource private HostConfigDAO hostConfigDAO; + @Resource + private HostConfigService hostConfigService; + @Resource private HostExtraService hostExtraService; @@ -138,6 +138,23 @@ public class HostServiceImpl implements HostService { return id; } + @Override + @Transactional(rollbackFor = Exception.class) + public Long copyHost(Long originId, HostUpdateRequest request) { + log.info("HostService-copyHost originId: {}, request: {}", originId, JSON.toJSONString(request)); + // 查询原始主机 + HostDO originHost = hostDAO.selectById(originId); + Valid.notNull(originHost, ErrorMessage.HOST_ABSENT); + // 创建主机 + Long newId = SpringHolder.getBean(HostService.class) + .createHost(HostConvert.MAPPER.toCreate(request)); + // 复制主机额外信息 + hostExtraService.copyHostExtra(originId, newId); + // 复制主机配置信息 + hostConfigService.copyHostConfig(originId, newId, request.getTypes()); + return newId; + } + @Override @Transactional(rollbackFor = Exception.class) public Integer updateHostById(HostUpdateRequest request) { diff --git a/orion-visor-ui/.env.development b/orion-visor-ui/.env.development index 4ca0c29a..ad91bf7c 100644 --- a/orion-visor-ui/.env.development +++ b/orion-visor-ui/.env.development @@ -3,4 +3,4 @@ VITE_API_BASE_URL=http://127.0.0.1:9200/orion-visor/api # websocket 路径 VITE_WS_BASE_URL=ws://127.0.0.1:9200/orion-visor/keep-alive # 版本号 -VITE_APP_VERSION=2.3.8 +VITE_APP_VERSION=2.3.9 diff --git a/orion-visor-ui/.env.production b/orion-visor-ui/.env.production index 5826dcf8..ee096b13 100644 --- a/orion-visor-ui/.env.production +++ b/orion-visor-ui/.env.production @@ -3,4 +3,4 @@ VITE_API_BASE_URL=/orion-visor/api # websocket 路径 VITE_WS_BASE_URL=/orion-visor/keep-alive # 版本号 -VITE_APP_VERSION=2.3.8 +VITE_APP_VERSION=2.3.9 diff --git a/orion-visor-ui/package.json b/orion-visor-ui/package.json index dafffbea..6af63764 100644 --- a/orion-visor-ui/package.json +++ b/orion-visor-ui/package.json @@ -1,7 +1,7 @@ { "name": "orion-visor-ui", "description": "Orion Visor UI", - "version": "2.3.8", + "version": "2.3.9", "private": true, "author": "Jiahang Li", "license": "Apache 2.0", diff --git a/orion-visor-ui/src/api/asset/host.ts b/orion-visor-ui/src/api/asset/host.ts index 790998ef..772fa21a 100644 --- a/orion-visor-ui/src/api/asset/host.ts +++ b/orion-visor-ui/src/api/asset/host.ts @@ -1,4 +1,4 @@ -import type { HostSpecExtraModel, HostExtraUpdateRequest } from './host-extra'; +import type { HostExtraUpdateRequest, HostSpecExtraModel } from './host-extra'; import type { TableData } from '@arco-design/web-vue'; import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import axios from 'axios'; @@ -114,6 +114,13 @@ export function updateHost(request: HostUpdateRequest) { return axios.put('/asset/host/update', request); } +/** + * 复制主机 + */ +export function copyHost(request: HostUpdateRequest) { + return axios.post('/asset/host/copy', request); +} + /** * 通过 id 更新主机状态 */ diff --git a/orion-visor-ui/src/api/system/setting.ts b/orion-visor-ui/src/api/system/setting.ts index ca55626a..b193c956 100644 --- a/orion-visor-ui/src/api/system/setting.ts +++ b/orion-visor-ui/src/api/system/setting.ts @@ -23,6 +23,7 @@ export interface AppInfoResponse { */ export interface AppReleaseResponse { tagName: string; + releaseTime: string; body: string; } diff --git a/orion-visor-ui/src/components/asset/host-group/tree/index.vue b/orion-visor-ui/src/components/asset/host-group/tree/index.vue index d4c62fae..a980726b 100644 --- a/orion-visor-ui/src/components/asset/host-group/tree/index.vue +++ b/orion-visor-ui/src/components/asset/host-group/tree/index.vue @@ -60,7 +60,7 @@ position="left" type="warning" @ok="deleteNode(node.key)"> - diff --git a/orion-visor-ui/src/views/asset/host-list/components/host-form-drawer.vue b/orion-visor-ui/src/views/asset/host-list/components/host-form-drawer.vue index 5e4431cb..50a56879 100644 --- a/orion-visor-ui/src/views/asset/host-list/components/host-form-drawer.vue +++ b/orion-visor-ui/src/views/asset/host-list/components/host-form-drawer.vue @@ -21,7 +21,7 @@ + @updated="onUpdateHostInfo" /> + @updated="onUpdateHostSpec" /> ('info'); @@ -72,6 +70,7 @@ const hostId = ref(); const types = ref([]); const infoRef = ref(); + const hostViewUpdated = ref(false); const emits = defineEmits(['reload']); @@ -93,7 +92,7 @@ // 打开复制 const openCopy = (id: number) => { - init('复制主机', id); + init('复制主机', undefined); nextTick(() => { infoRef.value.openCopy(id); }); @@ -104,9 +103,9 @@ title.value = _title; activeTab.value = 'info'; hostId.value = id; + hostViewUpdated.value = false; types.value = []; checkHostGroup(); - resetCounter(); setVisible(true); }; @@ -123,14 +122,20 @@ defineExpose({ openAdd, openUpdate, openCopy }); // 更新主机信息 - const updateHostInfo = (id: number) => { + const onUpdateHostInfo = (id: number) => { hostId.value = id; - incrUpdatedCount(); + hostViewUpdated.value = true; + }; + + // 更新主机信息 + const onUpdateHostSpec = () => { + hostViewUpdated.value = true; }; // 处理关闭 const handleClose = () => { - if (updatedCount.value) { + // 修改主机视图信息后刷新列表 + if (hostViewUpdated.value) { emits('reload'); } }; diff --git a/orion-visor-ui/src/views/asset/host-list/components/host-form-info.vue b/orion-visor-ui/src/views/asset/host-list/components/host-form-info.vue index 95598396..0a45dae8 100644 --- a/orion-visor-ui/src/views/asset/host-list/components/host-form-info.vue +++ b/orion-visor-ui/src/views/asset/host-list/components/host-form-info.vue @@ -5,28 +5,6 @@ label-align="right" :auto-label-width="true" :rules="hostFormRules"> - - - - - - - - - - - - + + + + + + + + + + + + ({}); @@ -135,6 +136,7 @@ // 打开复制 const openCopy = async (id: number) => { renderForm({ ...defaultForm() }); + isCopy.value = true; await fetchHostRender(id); }; @@ -188,7 +190,12 @@ if (error) { return; } - if (!formModel.value.id) { + if (isCopy.value) { + // 复制 + const { data } = await copyHost(formModel.value); + Message.success('复制成功'); + emits('updated', data); + } else if (!formModel.value.id) { // 新增 const { data } = await createHost(formModel.value); Message.success('创建成功'); diff --git a/orion-visor-ui/src/views/asset/host-list/types/table.columns.ts b/orion-visor-ui/src/views/asset/host-list/types/table.columns.ts index 9d71ba1b..2f1c3873 100644 --- a/orion-visor-ui/src/views/asset/host-list/types/table.columns.ts +++ b/orion-visor-ui/src/views/asset/host-list/types/table.columns.ts @@ -14,7 +14,7 @@ const columns = [ title: '主机信息', dataIndex: 'hostInfo', slotName: 'hostInfo', - minWidth: 344, + width: 288, align: 'left', fixed: 'left', default: true, @@ -22,7 +22,7 @@ const columns = [ title: '主机规格', dataIndex: 'hostSpec', slotName: 'hostSpec', - width: 188, + width: 198, align: 'left', default: true, }, { diff --git a/orion-visor-ui/src/views/system/setting/components/about-setting.vue b/orion-visor-ui/src/views/system/setting/components/about-setting.vue index 0bdb2630..b115b5a2 100644 --- a/orion-visor-ui/src/views/system/setting/components/about-setting.vue +++ b/orion-visor-ui/src/views/system/setting/components/about-setting.vue @@ -32,7 +32,11 @@ 新版本已发布, 请及时升级版本 - + + + {{ repo.releaseTime }} + + import type { AppInfoResponse, AppReleaseResponse } from '@/api/system/setting'; - import { onMounted, reactive } from 'vue'; - import { getAppLatestRelease, getSystemAppInfo } from '@/api/system/setting'; + import { onMounted, ref } from 'vue'; import { copy } from '@/hooks/copy'; import useLoading from '@/hooks/loading'; + import { getAppLatestRelease, getSystemAppInfo } from '@/api/system/setting'; const { loading, setLoading } = useLoading(); const webVersion = import.meta.env.VITE_APP_VERSION; - const app = reactive({ + const app = ref({ version: '', uuid: '', }); - const repo = reactive({ + const repo = ref({ tagName: '', + releaseTime: '', body: '', }); @@ -75,8 +80,7 @@ setLoading(true); try { const { data } = await getSystemAppInfo(); - app.version = data.version; - app.uuid = data.uuid; + app.value = data; } catch (e) { } finally { setLoading(false); @@ -87,8 +91,7 @@ onMounted(async () => { try { const { data } = await getAppLatestRelease(); - repo.tagName = data.tagName; - repo.body = data.body; + repo.value = data; } catch (e) { } }); diff --git a/pom.xml b/pom.xml index 313eff19..ea8eb4ea 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ - 2.3.8 + 2.3.9 8 8 3.0.0-M5