⚡ 添加系统类型.
This commit is contained in:
@@ -37,6 +37,7 @@ public interface HostDAO extends IMapper<HostDO> {
|
||||
List<SFunction<HostDO, ?>> BASE_COLUMN = Arrays.asList(
|
||||
HostDO::getId,
|
||||
HostDO::getType,
|
||||
HostDO::getOsType,
|
||||
HostDO::getName,
|
||||
HostDO::getCode,
|
||||
HostDO::getAddress,
|
||||
|
||||
@@ -49,6 +49,10 @@ public class HostDO extends BaseDO {
|
||||
@TableField("type")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "系统类型")
|
||||
@TableField("os_type")
|
||||
private String osType;
|
||||
|
||||
@Schema(description = "主机名称")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@@ -44,6 +44,9 @@ public class HostCacheDTO implements LongCacheIdModel, Serializable {
|
||||
@Schema(description = "主机类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "系统类型")
|
||||
private String osType;
|
||||
|
||||
@Schema(description = "主机名称")
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -46,6 +46,11 @@ public class HostCreateRequest implements Serializable {
|
||||
@Schema(description = "主机类型")
|
||||
private String type;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 12)
|
||||
@Schema(description = "系统类型")
|
||||
private String osType;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
@Schema(description = "主机名称")
|
||||
|
||||
@@ -59,6 +59,10 @@ public class HostQueryRequest extends PageRequest {
|
||||
@Schema(description = "主机类型")
|
||||
private String type;
|
||||
|
||||
@Size(max = 12)
|
||||
@Schema(description = "系统类型")
|
||||
private String osType;
|
||||
|
||||
@Size(max = 8)
|
||||
@Schema(description = "主机状态")
|
||||
private String status;
|
||||
|
||||
@@ -43,6 +43,11 @@ public class HostUpdateRequest implements Serializable {
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 12)
|
||||
@Schema(description = "系统类型")
|
||||
private String osType;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
@Schema(description = "主机名称")
|
||||
|
||||
@@ -49,6 +49,9 @@ public class HostVO implements Serializable {
|
||||
@Schema(description = "主机类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "系统类型")
|
||||
private String osType;
|
||||
|
||||
@Schema(description = "主机名称")
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -50,13 +50,6 @@ public class HostSshConfigModel implements GenericsDataModel, UpdatePasswordActi
|
||||
@Size(max = 12)
|
||||
private String authType;
|
||||
|
||||
/**
|
||||
* 系统类型
|
||||
*/
|
||||
@NotBlank
|
||||
@Size(max = 12)
|
||||
private String osType;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
|
||||
@@ -60,7 +60,6 @@ public class HostSshConfigStrategy extends AbstractGenericsDataStrategy<HostSshC
|
||||
return HostSshConfigModel.builder()
|
||||
.username(USERNAME)
|
||||
.authType(HostSshAuthTypeEnum.PASSWORD.name())
|
||||
.osType(HostSshOsTypeEnum.LINUX.name())
|
||||
.connectTimeout(Const.MS_S_10)
|
||||
.charset(Const.UTF_8)
|
||||
.fileNameCharset(Const.UTF_8)
|
||||
|
||||
@@ -259,7 +259,7 @@ public class ExecCommandServiceImpl implements ExecCommandService {
|
||||
// 脚本路径
|
||||
String scriptPath = null;
|
||||
if (ScriptExecEnum.isEnabled(execLog.getScriptExec())) {
|
||||
scriptPath = this.buildScriptPath(config.getUsername(), config.getOsType(), execId, hostId);
|
||||
scriptPath = this.buildScriptPath(config.getUsername(), host.getOsType(), execId, hostId);
|
||||
}
|
||||
// 获取参数
|
||||
String parameter = JSON.toJSONString(this.getHostParams(builtinParams, host, config, scriptPath));
|
||||
@@ -328,7 +328,7 @@ public class ExecCommandServiceImpl implements ExecCommandService {
|
||||
params.put("hostUuid", uuid);
|
||||
params.put("hostUuidShort", uuid.replace("-", Strings.EMPTY));
|
||||
params.put("hostUsername", config.getUsername());
|
||||
params.put("osType", config.getOsType());
|
||||
params.put("osType", host.getOsType());
|
||||
params.put("charset", config.getCharset());
|
||||
params.put("scriptPath", scriptPath);
|
||||
return params;
|
||||
|
||||
@@ -398,6 +398,7 @@ public class HostServiceImpl implements HostService {
|
||||
.like(HostDO::getAddress, request.getAddress())
|
||||
.eq(HostDO::getStatus, request.getStatus())
|
||||
.eq(HostDO::getType, request.getType())
|
||||
.eq(HostDO::getOsType, request.getOsType())
|
||||
.and(Strings.isNotEmpty(searchValue), c -> c
|
||||
.eq(HostDO::getId, searchValue).or()
|
||||
.like(HostDO::getName, searchValue).or()
|
||||
|
||||
@@ -229,7 +229,7 @@ public class TerminalServiceImpl implements TerminalService {
|
||||
conn.setHostName(host.getName());
|
||||
conn.setHostAddress(host.getAddress());
|
||||
conn.setHostPort(host.getPort());
|
||||
conn.setOsType(config.getOsType());
|
||||
conn.setOsType(host.getOsType());
|
||||
conn.setTimeout(config.getConnectTimeout());
|
||||
conn.setCharset(config.getCharset());
|
||||
conn.setFileNameCharset(config.getFileNameCharset());
|
||||
|
||||
@@ -394,10 +394,14 @@ public class UploadTaskServiceImpl implements UploadTaskService {
|
||||
if (containsEnv) {
|
||||
// 获取主机配置信息
|
||||
Map<Long, HostSshConfigModel> hostConfigMap = hostConfigService.buildHostConfigMap(hosts, HostTypeEnum.SSH);
|
||||
hostConfigMap.forEach((k, v) -> {
|
||||
for (HostDO host : hosts) {
|
||||
Long id = host.getId();
|
||||
// 替换占位符
|
||||
String username = v.getUsername();
|
||||
String home = PathUtils.getHomePath(HostSshOsTypeEnum.isWindows(v.getOsType()), username);
|
||||
String username = Optional.ofNullable(id)
|
||||
.map(hostConfigMap::get)
|
||||
.map(HostSshConfigModel::getUsername)
|
||||
.orElse(Const.EMPTY);
|
||||
String home = PathUtils.getHomePath(HostSshOsTypeEnum.isWindows(host.getOsType()), username);
|
||||
// 替换环境变量路径
|
||||
Map<String, String> env = Maps.newMap(4);
|
||||
env.put(ExtraFieldConst.USERNAME, username);
|
||||
@@ -405,9 +409,9 @@ public class UploadTaskServiceImpl implements UploadTaskService {
|
||||
// 设置主机上传路径
|
||||
String realRemotePath = Files1.getPath(Strings.format(remotePath, env));
|
||||
for (UploadTaskFileRequest file : files) {
|
||||
realRemoteFilePathMap.put(k, file.getFileId(), Files1.getPath(realRemotePath, file.getFilePath()));
|
||||
realRemoteFilePathMap.put(id, file.getFileId(), Files1.getPath(realRemotePath, file.getFilePath()));
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// 无占位符
|
||||
for (UploadTaskFileRequest file : files) {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<resultMap id="BaseResultMap" type="org.dromara.visor.module.asset.entity.domain.HostDO">
|
||||
<id column="id" property="id"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="os_type" property="osType"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="code" property="code"/>
|
||||
<result column="address" property="address"/>
|
||||
@@ -21,7 +22,7 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, type, name, code, address, port, status, config, create_time, update_time, creator, updater, deleted
|
||||
id, type, os_type, name, code, address, port, status, config, create_time, update_time, creator, updater, deleted
|
||||
</sql>
|
||||
|
||||
<update id="setKeyIdWithNull">
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
import axios from 'axios';
|
||||
|
||||
/**
|
||||
* 主机别名修改请求
|
||||
*/
|
||||
export interface HostAliasUpdateRequest {
|
||||
id?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主机拓展信息查询请求
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,7 @@ export type HostType = 'SSH' | string | undefined;
|
||||
*/
|
||||
export interface HostCreateRequest {
|
||||
type?: string;
|
||||
osType?: string;
|
||||
name?: string;
|
||||
code?: string;
|
||||
address?: string;
|
||||
@@ -50,6 +51,7 @@ export interface HostQueryRequest extends Pagination {
|
||||
searchValue?: string;
|
||||
id?: number;
|
||||
type?: string;
|
||||
osType?: string;
|
||||
name?: string;
|
||||
code?: string;
|
||||
address?: string;
|
||||
@@ -64,6 +66,7 @@ export interface HostQueryRequest extends Pagination {
|
||||
export interface HostQueryResponse extends TableData, HostQueryResponseExtra {
|
||||
id: number;
|
||||
type: string;
|
||||
osType?: string;
|
||||
name: string;
|
||||
code: string;
|
||||
address: string;
|
||||
|
||||
32
orion-visor-ui/src/assets/images/icon/os_linux.svg
Normal file
32
orion-visor-ui/src/assets/images/icon/os_linux.svg
Normal file
@@ -0,0 +1,32 @@
|
||||
<svg width="200" height="200"
|
||||
viewBox="0 0 1024 1024"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M525.2 198.3c-8.6 5.6-15.2 13.8-18.9 23.4-3.8 12.4-3.2 25.6 1.5 37.7 3.9 12.7 11.7 23.8 22.2 31.8 5.4 3.8 11.6 6.2 18.2 7 6.6 0.8 13.2-0.3 19.1-3.3 7-3.9 12.6-10 15.9-17.3 3.2-7.4 5-15.3 5.2-23.3 0.7-10.2-0.6-20.4-3.8-30.1-3.5-10.6-10.3-19.7-19.5-25.9-4.7-3-9.9-5-15.4-5.8-5.5-0.8-11.1-0.2-16.3 1.8-2.9 1.2-5.7 2.7-8.3 4.5"
|
||||
fill="#FFFFFF"/>
|
||||
<path d="M810.2 606.5c-5.1-28.3-13.1-56-23.8-82.6-7.3-19.8-17.2-38.6-29.5-55.8-12.4-16.5-28.1-30.4-40.2-47.1-6.4-8.7-11.8-18.4-18.5-26.9-2.7-5.6-5.3-11.2-7.9-16.8-8-17.5-15.3-35.4-24.8-52-1.5-2.6-3.1-5.2-4.6-7.7-1.2-16-2.9-32-3.8-48 0.7-32.1-2-64.3-8.1-95.9-4.2-15.1-10.6-29.6-19-42.8-9.8-15.6-22.4-29.2-37.2-40.1-24.1-17.1-52.9-26.3-82.4-26.4-21.7-0.5-43.2 4.4-62.5 14.4-20.3 11.1-36.7 28.2-47 48.9-9.6 20.9-14.7 43.5-15 66.5-0.8 22.6 1.3 45 2.2 67.6 0.9 23.4 0.4 46.9 2.3 70.3 0.6 7.5 1.5 15 1.5 22.6 0 3.8-0.2 7.6-0.3 11.3l-0.3 0.8c-10.2 17.3-21.5 34-33.8 49.9-8.6 10.9-17.2 21.7-25.9 32.4-11.3 12.7-20.9 26.8-28.5 42-5.1 13.2-9.2 26.8-12.4 40.6l-0.3 1.1c-4.8 15.9-10.8 31.3-18 46.2-0.7 1.4-1.4 2.9-2 4.2-4.3 8.9-8.8 17.8-13.5 26.5l-5.4 10.1c-3.4 6.1-6.4 12.4-9 18.8-1.5 3.9-2.7 7.9-3.4 12-1.3 8.7-0.7 17.5 1.6 25.9 0.5 2.1 1.2 4.2 1.9 6.3 2.2 6.2 4.8 12.3 7.9 18.1 1.4 2.7 2.9 5.3 4.3 8l1.3 1.9c1.4 2.5 2.9 5 4.4 7.4l0.2 0.3c1.7 2.8 3.6 5.5 5.4 8.2l0.3 0.4c1.9 2.6 3.8 5.3 5.8 7.9 7.4 28.9 21 55.8 39.7 79-2.9 5.1-5.5 10.1-8.4 15.1-10.2 14.8-18.6 30.7-25.1 47.4-2.7 8.6-3.4 17.7-1.9 26.6 1.4 9 6 17.1 13 23 4.7 3.6 10.1 6.1 15.8 7.3 5.7 1.2 11.6 1.8 17.5 1.5 22.2-1.7 44.2-6.1 65.4-12.9 12.8-3.4 25.6-6.4 38.6-9 13.5-3.1 27.2-5 41-5.6 3.4 0.1 6.8-0.1 10.1-0.3 9.4 1 18.8 1.4 28.3 1l3.5-0.2c2.4 0.3 4.9 0.4 7.4 0.6 16.6 0.9 33.1 2.6 49.5 5.1 14.4 2.2 28.8 5 43 8.5 21.9 6.6 44.4 11 67.3 12.9 6 0.3 12-0.2 18-1.4 5.9-1.2 11.5-3.8 16.3-7.4 7-5.8 11.6-13.9 13.1-22.9 1.5-8.9 0.8-18-1.9-26.6-6.6-16.7-15.1-32.6-25.5-47.3-3.6-6.1-7-12.4-10.6-18.5 15.5-17.3 29.2-36.3 40.7-56.5 7 0.4 13.9-0.4 20.6-2.6 17.5-5.9 32.7-17.3 43.3-32.5 3.2-4.5 5.7-9.5 7.2-14.8 6.9-10.7 11.6-22.7 13.8-35.3 3.2-20.8 2.7-42.1-1.5-62.7h-0.2z m0 0"
|
||||
fill="#020204"/>
|
||||
<path d="M425.6 323.2c-3.1 4-5.3 8.7-6.4 13.6-1.1 4.9-1.8 10-1.9 15 0.3 10.1-0.5 20.2-2.5 30.1-3.5 10.3-8.8 19.8-15.6 28.3-11.7 14.7-20.9 31.2-27.2 48.8-3.2 10.9-4.3 22.3-3.1 33.7-12.1 17.9-22.6 36.9-31.3 56.7-13.4 29.9-22 61.8-25.5 94.4-4.3 40.1 1.6 80.6 17 117.8 11.3 26.8 28.5 50.8 50.3 70.1 11.2 9.7 23.5 17.9 36.7 24.4 46.7 22.8 101.4 22.3 147.6-1.4 23.1-13.5 44.2-30.2 62.6-49.5 11.9-10.8 22.5-22.9 31.8-36.1 15.5-26.9 24.6-57.1 26.5-88.1 9.6-53.6 3.7-108.8-16.9-159.2-8.1-16.8-18.8-32.2-31.8-45.6a252.5 252.5 0 0 0-20.2-68c-7.2-15.5-15.9-30.3-22.6-46.2-2.7-6.5-5.1-13.1-8.1-19.4-2.9-6.4-6.9-12.3-11.8-17.3-5.3-4.9-11.6-8.6-18.5-10.7-6.9-2.2-14-3.4-21.2-3.6-14.4-0.7-28.9 1.1-43.1 0.6-11.5-0.5-22.8-2.5-34.3-1.8-5.7 0.3-11.4 1.4-16.7 3.5-5.4 2.1-10.1 5.5-13.8 10m4.6-125.1c-5.4 0.4-10.5 2.7-14.4 6.4-3.9 3.7-6.8 8.4-8.4 13.5-2.7 10.4-3.4 21.3-1.9 32 0.2 9.7 1.9 19.4 5.1 28.6 1.8 4.5 4.4 8.7 7.8 12.2 3.4 3.5 7.7 6.1 12.4 7.3 4.5 1.1 9.2 0.9 13.5-0.5 4.3-1.4 8.3-3.8 11.5-7 4.7-4.8 8.1-10.7 9.8-17.1 1.7-6.4 2.5-13.1 2.3-19.8 0-8.3-1.3-16.6-3.8-24.6s-6.8-15.3-12.6-21.4c-2.8-2.9-6-5.4-9.6-7.2-3.7-1.7-7.7-2.6-11.7-2.4m95 0c-8.6 5.6-15.2 13.8-18.9 23.4-3.8 12.4-3.2 25.6 1.5 37.7 3.9 12.7 11.7 23.8 22.2 31.8 5.4 3.8 11.6 6.2 18.2 7 6.6 0.8 13.2-0.3 19.1-3.3 7-3.9 12.6-10 15.9-17.3 3.2-7.4 5-15.3 5.2-23.3 0.7-10.2-0.6-20.4-3.8-30.1-3.5-10.6-10.3-19.7-19.5-25.9-4.7-3-9.9-5-15.4-5.8-5.5-0.8-11.1-0.2-16.3 1.8-2.9 1.2-5.7 2.7-8.3 4.5"
|
||||
fill="#FFFFFF"/>
|
||||
<path d="M544.5 223.6c-3.2 0.2-6.2 1.2-8.9 2.9s-5 4-6.8 6.6c-3.4 5.3-5.3 11.5-5.4 17.9-0.3 4.7 0.4 9.5 1.9 14s4.3 8.5 7.9 11.5c3.8 3.1 8.4 4.9 13.3 5.2 4.9 0.2 9.7-1.1 13.7-3.9 3.2-2.3 5.8-5.2 7.6-8.7 1.8-3.4 2.9-7.2 3.4-11 1-6.8-0.2-13.8-3.2-19.9-3.1-6.2-8.4-10.9-14.8-13.4-2.8-1.1-5.7-1.5-8.7-1.4"
|
||||
fill="#020204"/>
|
||||
<path d="M430.2 198.3c-5.4 0.4-10.5 2.7-14.4 6.4-3.9 3.7-6.8 8.4-8.4 13.5-2.7 10.4-3.4 21.3-1.9 32 0.2 9.7 1.9 19.4 5.1 28.6 1.8 4.6 4.4 8.7 7.8 12.2 3.4 3.5 7.7 6.1 12.4 7.3 4.5 1.1 9.2 0.9 13.5-0.5 4.3-1.4 8.3-3.8 11.5-7 4.7-4.8 8.1-10.7 9.8-17.1 1.7-6.4 2.5-13.1 2.3-19.8 0-8.3-1.3-16.6-3.8-24.6s-6.8-15.3-12.6-21.4c-2.8-2.9-6-5.4-9.6-7.2-3.7-1.7-7.7-2.6-11.7-2.4"
|
||||
fill="#FFFFFF"/>
|
||||
<path d="M417.3 242.8c-1.3 6.7-1 13.7 1.1 20.2 1.6 4.3 4 8.2 7.2 11.5 2 2.2 4.3 4.1 7 5.4 2.7 1.4 5.7 1.8 8.7 1.1 2.7-0.7 5-2.3 6.7-4.5 1.7-2.2 2.9-4.7 3.7-7.3 2.3-7.8 2.1-16.1-0.4-23.9-1.6-5.7-4.7-10.9-9.1-14.8-2.1-1.8-4.7-3.2-7.4-3.9-2.8-0.7-5.7-0.5-8.4 0.7-2.8 1.4-5.1 3.7-6.5 6.5-1.4 2.8-2.3 5.8-2.7 8.9"
|
||||
fill="#020204"/>
|
||||
<path d="M404.6 326.9c0.2 0.9 0.5 1.8 1 2.5 0.9 1.4 2 2.5 3.4 3.4 1.3 0.9 2.6 1.7 3.9 2.5 6.9 4.7 13 10.5 17.9 17.3 6 9.4 13.5 17.8 22 25 6.5 4.5 14.1 7.2 22 7.9 9.2 0.7 18.5-0.4 27.4-3.2 8.2-2.4 16.1-5.8 23.5-10.3 12.7-10.2 26.3-19.2 40.7-26.7 3.4-1.2 6.8-2.1 10-3.6 3.3-1.4 6.1-3.8 7.8-7 1.1-3.2 1.8-6.6 1.9-10 0.5-3.6 1.7-7.1 2.3-10.7 0.8-3.6 0.5-7.3-0.8-10.8-1.4-2.7-3.6-4.9-6.3-6.3-2.7-1.3-5.7-2.1-8.7-2.2-6.1 0.2-12.1 0.8-18 1.8-8 0.7-16-0.3-24 0-9.9 0.3-19.8 2.5-29.8 2.9-11.4 0.6-22.7-1.2-34.1-1.7-4.9-0.3-9.9-0.1-14.8 0.7-4.9 0.7-9.6 2.5-13.7 5.3-3.8 3-7.3 6.2-10.7 9.6-1.8 1.6-3.8 3-5.9 4.1-2.2 1.1-4.5 1.7-7 1.6-1.2-0.2-2.5-0.2-3.7 0-0.7 0.3-1.4 0.7-1.9 1.2l-1.5 1.8c-1 1.5-1.9 3.1-2.6 4.7"
|
||||
fill="#D99A03"/>
|
||||
<path d="M429.7 301.7c-4 2.4-7.9 5-11.8 7.7-2.1 1.3-3.8 3-5.1 5.1-0.7 1.6-1 3.3-0.9 5 0.1 1.7 0.1 3.4 0 5.1-0.1 1.1-0.5 2.3-0.5 3.5 0 0.6 0 1.2 0.2 1.7 0.2 0.6 0.4 1.1 0.8 1.5 0.5 0.5 1.2 0.9 2 1.1 0.7 0.2 1.5 0.3 2.3 0.5 3.5 1 6.7 2.9 9.3 5.4 2.7 2.4 5.1 5.2 8 7.5 8 6 17.7 9.1 27.6 9 9.9-0.2 19.7-1.6 29.2-4.1 7.5-1.6 14.9-3.6 22.1-6.1 11.2-4.2 21.5-10.3 30.4-18.2 3.9-3.8 8-7.2 12.4-10.3 4-2.5 8.7-4.2 12.7-6.6 0.4-0.2 0.7-0.5 1.1-0.7 0.3-0.3 0.6-0.6 0.8-1 0.3-0.7 0.3-1.5 0-2.2-0.2-0.7-0.5-1.3-0.9-1.8-0.5-0.6-1.1-1.2-1.7-1.7-4.6-3.4-10.1-5.3-15.8-5.5-5.8-0.4-11.3 0-16.9-1.1-5.2-1.1-10.3-2.6-15.3-4.4-5.3-1.7-10.7-3-16.3-3.9-13-2.1-26.2-1.8-39.1 1-12.1 2.7-23.8 7.3-34.6 13.5"
|
||||
fill="#604405"/>
|
||||
<path d="M428.4 288.1c-5.8 3.9-11 8.7-15.5 14.1-2.6 3-4.7 6.5-6.1 10.3-0.9 3-1.5 6.1-2 9.2-0.3 1.1-0.5 2.3-0.5 3.5 0 0.6 0.1 1.2 0.3 1.7 0.2 0.6 0.5 1.1 0.9 1.5 0.7 0.7 1.6 1.1 2.6 1.3 0.9 0.2 1.9 0.2 2.9 0.3 4.4 0.7 8.5 2.5 12.1 5.1 3.6 2.5 7 5.4 10.7 7.8 8.4 5 18 7.7 27.8 7.9 9.8 0.2 19.5-0.8 29-2.9 7.6-1.4 15.1-3.5 22.4-6.3 10.9-4.7 21.1-10.8 30.4-18.2 4.3-3.2 8.5-6.6 12.4-10.3 1.3-1.3 2.6-2.6 4-3.8 1.4-1.2 3-2.1 4.7-2.7 2.7-0.7 5.5-0.8 8.3-0.1 2 0.5 4.1 0.7 6.2 0.7 1.1 0 2.1-0.2 3.1-0.5 1-0.4 1.9-1 2.5-1.8 0.9-1.1 1.3-2.4 1.3-3.8s-0.4-2.7-1.1-3.9c-1.5-2.3-3.8-4.1-6.3-5.1-3.5-1.4-7.1-2.5-10.8-3.2-11.3-2.7-22.3-6.7-32.7-11.9-5.2-2.6-10.1-5.4-15.3-8.1-5.2-2.9-10.6-5.4-16.2-7.2-12.9-3.5-26.6-2.9-39.1 1.8-14 4.9-26.5 13.4-36.1 24.7"
|
||||
fill="#F5BD0C"/>
|
||||
<path d="M493.5 272.2c0.7 2.3 4.3 1.9 6.4 2.9 2.1 1 3.3 2.9 5.3 3.1 2.1 0.2 5-0.7 5.3-2.6 0.4-2.6-3.4-4.2-5.8-5.1-3.2-1.5-6.8-1.6-10-0.2-0.7 0.3-1.4 1.2-1.2 1.9z m-34.4-1.2c-2.7-0.9-7.1 3.8-5.8 6.3 0.4 0.7 1.6 1.5 2.4 1.1 0.8-0.4 2.3-3.1 3.6-4 1-0.8 0.8-3.1-0.2-3.4z m0 0"
|
||||
fill="#CD8907"/>
|
||||
<path d="M887.7 829.8c-2 5.2-4.9 10-8.5 14.3-8.4 9-18.6 16.2-29.8 21.2-19 8.8-37.5 18.6-55.5 29.3-11.7 7.8-22.6 16.6-32.7 26.4-8.3 8.7-17.2 16.7-26.6 24.2-9.8 7.2-21.1 12.1-33.1 14-14.7 1.9-29.6-0.4-43.1-6.5-9.7-3.7-18.1-10.2-24-18.8-5-9.2-7.3-19.5-6.8-29.9 0.6-18.3 2.8-36.5 6.6-54.5 2.6-15 5.2-30 6.8-45.1 2.8-27.6 3.1-55.3 1-82.9-0.5-4.6-0.5-9.3 0-13.9 0.6-9.4 8.5-16.6 18-16.5 4.3-0.1 8.6 0.3 12.8 1.1 10 1.2 20 2.9 29.8 5.2 6.1 1.6 12.2 3.8 18.3 5.5 10.2 3 21 3.9 31.6 2.9 11.1-2.6 22.4-4.3 33.8-5.3 4.7 0.2 9.4 1 13.8 2.4 4.6 1.3 8.9 3.6 12.4 6.9 2.5 2.7 4.5 5.8 5.8 9.2 1.9 5.1 3.1 10.4 3.5 15.8 0.2 4.8 0.6 9.6 1.2 14.4 1.7 7.7 5.4 14.9 10.6 20.9 5.3 5.8 11 11.2 17.2 16 5.9 5.2 12.1 10 18.6 14.4 3.1 2.1 6.2 4 9.1 6.3 3 2.2 5.5 5 7.4 8.2 2.4 4.4 3.2 9.5 2 14.4"
|
||||
fill="#F5BD0C"/>
|
||||
<path d="M887.7 829.8c-2 5.2-4.9 10-8.5 14.3-8.4 9-18.6 16.2-29.8 21.2-19 8.8-37.5 18.6-55.5 29.3-11.7 7.8-22.6 16.6-32.7 26.4-8.3 8.7-17.2 16.7-26.6 24.2-9.8 7.2-21.1 12.1-33.1 14-14.7 1.9-29.6-0.4-43.1-6.5-9.7-3.7-18.1-10.2-24-18.8-5-9.2-7.3-19.5-6.8-29.9 0.6-18.3 2.8-36.5 6.6-54.5 2.6-15 5.2-30 6.8-45.1 2.8-27.6 3.1-55.3 1-82.9-0.5-4.6-0.5-9.3 0-13.9 0.6-9.4 8.5-16.6 18-16.5 4.3-0.1 8.6 0.3 12.8 1.1 10 1.2 20 2.9 29.8 5.2 6.1 1.6 12.2 3.8 18.3 5.5 10.2 3 21 3.9 31.6 2.9 11.1-2.6 22.4-4.3 33.8-5.3 4.7 0.2 9.4 1 13.8 2.4 4.6 1.3 8.9 3.6 12.4 6.9 2.5 2.7 4.5 5.8 5.8 9.2 1.9 5.1 3.1 10.4 3.5 15.8 0.2 4.8 0.6 9.6 1.2 14.4 1.7 7.7 5.4 14.9 10.6 20.9 5.3 5.8 11 11.2 17.2 16 5.9 5.2 12.1 10 18.6 14.4 3.1 2.1 6.2 4 9.1 6.3 3 2.2 5.5 5 7.4 8.2 2.4 4.4 3.2 9.5 2 14.4M259.4 676.3c4.9-1.9 10.2-2.4 15.4-1.4 5.2 1 10.1 3.1 14.4 6.1 8.3 6.3 15.5 14.1 21.2 22.8 14.1 19.4 27.6 39.2 39.9 59.8 10 16.7 19.1 33.9 30.6 49.6 7.5 10.2 16 19.7 23.6 29.9 7.9 10 13.9 21.4 17.6 33.5 4.4 16.1 2.6 33.2-4.9 48.1-5.4 10.4-13.5 19.1-23.4 25.1-10 6-21.5 9-33.2 8.7-18.4-2.5-36.2-8.1-52.6-16.6-34.9-13.9-72.8-18.3-108.8-29.1-11.1-3.3-21.9-7.3-33.1-10.3-5-1.2-9.9-2.7-14.7-4.7-4.7-2-8.8-5.4-11.5-9.7-2-3.5-3-7.5-2.9-11.5 0.1-4 0.9-7.9 2.3-11.5 2.7-7.5 7.1-14.2 10-21.6 4.4-12.2 6.1-25.3 5-38.2-0.6-12.9-2.9-25.8-3.6-38.7-0.6-5.8-0.4-11.6 0.6-17.3 1.5-11.4 10.4-20.5 21.9-22.2 5.3-0.9 10.6-1.3 15.9-1 5.3 0.3 10.7 0.3 16 0 5.3-0.3 10.6-1.8 15.3-4.3 4.3-2.6 8.1-6.2 11-10.4 2.9-4.2 5.5-8.5 7.9-13 2.4-4.5 5.1-8.7 8.3-12.7 3-4.1 7.1-7.2 11.8-9.4"
|
||||
fill="#F5BD0C"/>
|
||||
<path d="M259.4 676.4c4.9-1.9 10.2-2.4 15.4-1.4 5.2 1 10.1 3.1 14.4 6.1 8.3 6.3 15.5 14.1 21.2 22.8 14.1 19.4 27.6 39.2 39.9 59.8 10 16.7 19.1 33.9 30.6 49.6 7.5 10.2 16 19.7 23.6 29.9 7.9 10 13.9 21.4 17.6 33.5 4.4 16.1 2.6 33.2-4.9 48.1-5.4 10.4-13.5 19.1-23.4 25.1-10 6-21.5 9-33.2 8.7-18.4-2.5-36.2-8.1-52.6-16.6-34.9-13.9-72.8-18.3-108.8-29.1-11.1-3.3-21.9-7.3-33.1-10.3-5-1.2-9.9-2.7-14.7-4.7-4.7-2-8.8-5.4-11.5-9.7-2-3.5-3-7.5-2.9-11.5 0.1-4 0.9-7.9 2.3-11.5 2.7-7.5 7.1-14.2 10-21.6 4.4-12.2 6.1-25.3 5-38.2-0.6-12.9-2.9-25.7-3.6-38.7-0.6-5.8-0.4-11.6 0.6-17.3 1.5-11.4 10.4-20.5 21.9-22.2 5.3-0.9 10.6-1.3 15.9-1 5.3 0.3 10.7 0.3 16 0 5.3-0.3 10.6-1.8 15.3-4.3 4.3-2.6 8.1-6.2 11-10.4 2.9-4.2 5.5-8.5 7.9-13 2.4-4.5 5.1-8.7 8.3-12.7 3-4.1 7.1-7.3 11.8-9.4"
|
||||
fill="#F5BD0C"/>
|
||||
<path d="M267.1 684.8c4.4-1.7 9.3-2 13.9-0.9s8.9 3.2 12.6 6.2c7.1 6.2 13.1 13.6 17.6 21.9 12 19.4 23.7 39 34.6 59 7.9 15.3 16.8 30.1 26.6 44.2 6.8 9.2 14.6 17.6 21.6 26.6 7.3 8.9 12.8 19 16.2 29.9 4 14.3 2.3 29.6-4.5 42.9-5 9.4-12.5 17.3-21.7 22.6-9.2 5.4-19.8 8-30.4 7.5-16.7-2.6-32.9-7.6-48.2-14.9-30.4-11.1-63.5-12.5-94.7-21.2-11.2-3-22.1-7.1-33.4-9.9-5-1.1-10-2.5-14.8-4.3-4.8-1.8-9-5.2-11.8-9.5-1.8-3.4-2.7-7.2-2.5-11 0.2-3.8 1-7.6 2.4-11.2 2.7-7.1 7-13.6 9.7-20.7 3.8-11 5.1-22.6 3.9-34.2-0.8-11.5-2.9-22.9-3.5-34.5-0.4-5.1-0.2-10.3 0.7-15.4 0.9-5.1 3.3-9.8 6.9-13.6 4.2-3.8 9.4-6.3 15-7 5.6-0.7 11.2-0.7 16.7 0 5.6 0.7 11.2 0.9 16.8 0.8 11 0 21-6.4 25.7-16.4 2.3-4.5 4.3-9.2 5.9-13.9 1.7-4.8 4-9.3 6.7-13.6 2.8-4.3 6.8-7.7 11.5-9.7"
|
||||
fill="#F5BD0C"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 11 KiB |
6
orion-visor-ui/src/assets/images/icon/os_windows.svg
Normal file
6
orion-visor-ui/src/assets/images/icon/os_windows.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg width="200" height="200"
|
||||
viewBox="0 0 1024 1024"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M456 484V160.1l-335.9 72V484H456zM512 484h391.8V64.2l-391.8 84V484zM456 540H120.2v251.9l335.9 72V540zM512 540v335.9l391.8 84V540H512z"
|
||||
fill="#00adef"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 282 B |
@@ -26,14 +26,6 @@
|
||||
label-align="right"
|
||||
:auto-label-width="true"
|
||||
:rules="rules">
|
||||
<!-- 系统类型 -->
|
||||
<a-form-item field="osType"
|
||||
label="系统类型"
|
||||
:hide-asterisk="true">
|
||||
<a-select v-model="formModel.osType"
|
||||
:options="toOptions(sshOsTypeKey)"
|
||||
placeholder="请选择系统类型" />
|
||||
</a-form-item>
|
||||
<!-- 用户名 -->
|
||||
<a-form-item field="username"
|
||||
label="用户名"
|
||||
@@ -128,7 +120,7 @@
|
||||
import type { HostSshConfig } from '../types/const';
|
||||
import type { HostConfigQueryResponse } from '@/api/asset/host';
|
||||
import { ref, watch } from 'vue';
|
||||
import { sshAuthTypeKey, sshOsTypeKey, SshAuthType } from '../types/const';
|
||||
import { sshAuthTypeKey, SshAuthType } from '../types/const';
|
||||
import { useDictStore } from '@/store';
|
||||
import rules from '../types/ssh-form.rules';
|
||||
import HostKeySelector from '@/components/asset/host-key/selector/index.vue';
|
||||
@@ -144,7 +136,6 @@
|
||||
|
||||
const formRef = ref();
|
||||
const formModel = ref<HostSshConfig>({
|
||||
osType: undefined,
|
||||
username: undefined,
|
||||
password: undefined,
|
||||
authType: SshAuthType.PASSWORD,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// 主机 SSH 配置
|
||||
export interface HostSshConfig {
|
||||
osType?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
authType?: string;
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import type { FieldRule } from '@arco-design/web-vue';
|
||||
|
||||
export const osType = [{
|
||||
required: true,
|
||||
message: '请选择系统类型'
|
||||
}] as FieldRule[];
|
||||
|
||||
export const authType = [{
|
||||
required: true,
|
||||
message: '请选择认证方式'
|
||||
@@ -55,7 +50,6 @@ export const fileContentCharset = [{
|
||||
}] as FieldRule[];
|
||||
|
||||
export default {
|
||||
osType,
|
||||
authType,
|
||||
keyId,
|
||||
identityId,
|
||||
|
||||
@@ -78,6 +78,13 @@
|
||||
placeholder="请选择主机类型"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
<!-- 系统类型 -->
|
||||
<a-form-item field="osType" label="系统类型">
|
||||
<a-select v-model="formModel.osType"
|
||||
:options="toOptions(hostOsTypeKey)"
|
||||
placeholder="请选择系统类型"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
<!-- 主机状态 -->
|
||||
<a-form-item field="status" label="主机状态">
|
||||
<a-select v-model="formModel.status"
|
||||
@@ -97,7 +104,14 @@
|
||||
</template>
|
||||
<!-- 标题 -->
|
||||
<template #title="{ record }">
|
||||
{{ record.name }}
|
||||
<div class="host-title">
|
||||
<!-- 系统类型图标 -->
|
||||
<component v-if="HostOsType[record.osType as keyof typeof HostOsType]"
|
||||
:is="HostOsType[record.osType as keyof typeof HostOsType].icon"
|
||||
class="os-icon" />
|
||||
<!-- 主机名称 -->
|
||||
<span>{{ record.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 编码 -->
|
||||
<template #code="{ record }">
|
||||
@@ -183,16 +197,16 @@
|
||||
</span>
|
||||
</a-doption>
|
||||
<!-- SSH -->
|
||||
<a-doption v-if="record.type === hostType.SSH.type"
|
||||
v-permission="['asset:terminal:access']"
|
||||
<a-doption v-if="record.type === HostType.SSH.value"
|
||||
v-permission="['terminal:terminal:access']"
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'SSH' } })">
|
||||
<span class="more-doption normal">
|
||||
<icon-thunderbolt /> SSH
|
||||
</span>
|
||||
</a-doption>
|
||||
<!-- SFTP -->
|
||||
<a-doption v-if="record.type === hostType.SSH.type"
|
||||
v-permission="['asset:terminal:access']"
|
||||
<a-doption v-if="record.type === HostType.SSH.value"
|
||||
v-permission="['terminal:terminal:access']"
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'SFTP' } })">
|
||||
<span class="more-doption normal">
|
||||
<icon-folder /> SFTP
|
||||
@@ -218,7 +232,7 @@
|
||||
import { dataColor, objectTruthKeyCount, resetObject } from '@/utils';
|
||||
import { deleteHost, getHostPage, updateHostStatus } from '@/api/asset/host';
|
||||
import { Message, Modal } from '@arco-design/web-vue';
|
||||
import { hostStatusKey, hostType, hostTypeKey, tagColor } from '../types/const';
|
||||
import { HostOsType, hostOsTypeKey, hostStatusKey, HostType, hostTypeKey, tagColor } from '../types/const';
|
||||
import { copy } from '@/hooks/copy';
|
||||
import { useDictStore } from '@/store';
|
||||
import { GrantKey, GrantRouteName } from '@/views/asset/grant/types/const';
|
||||
@@ -243,6 +257,7 @@
|
||||
code: undefined,
|
||||
address: undefined,
|
||||
type: undefined,
|
||||
osType: undefined,
|
||||
status: undefined,
|
||||
tags: undefined,
|
||||
queryTag: true
|
||||
@@ -343,6 +358,18 @@
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.host-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
|
||||
.os-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.host-address::after {
|
||||
content: ':';
|
||||
user-select: text;
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
placeholder="请选择主机类型"
|
||||
:options="toOptions(hostTypeKey)" />
|
||||
</a-form-item>
|
||||
<!-- 系统类型 -->
|
||||
<a-form-item field="osType" label="系统类型">
|
||||
<a-select v-model="formModel.osType"
|
||||
placeholder="请选择系统类型"
|
||||
:options="toOptions(hostOsTypeKey)" />
|
||||
</a-form-item>
|
||||
<!-- 主机名称 -->
|
||||
<a-form-item field="name" label="主机名称">
|
||||
<a-input v-model="formModel.name" placeholder="请输入主机名称" />
|
||||
@@ -80,7 +86,7 @@
|
||||
import { createHost, getHost, updateHost } from '@/api/asset/host';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { pick } from 'lodash';
|
||||
import { tagColor, hostType, hostTypeKey } from '../types/const';
|
||||
import { tagColor, HostType, hostTypeKey, hostOsTypeKey, HostOsType } from '../types/const';
|
||||
import { useDictStore } from '@/store';
|
||||
import TagMultiSelector from '@/components/meta/tag/multi-selector/index.vue';
|
||||
import HostGroupTreeSelector from '@/components/asset/host-group/tree-selector/index.vue';
|
||||
@@ -95,11 +101,12 @@
|
||||
const defaultForm = (): HostUpdateRequest => {
|
||||
return {
|
||||
id: undefined,
|
||||
type: hostType.SSH.type,
|
||||
type: HostType.SSH.value,
|
||||
osType: HostOsType.LINUX.value,
|
||||
name: undefined,
|
||||
code: undefined,
|
||||
address: undefined,
|
||||
port: hostType.SSH.default.port,
|
||||
port: HostType.SSH.port,
|
||||
tags: undefined,
|
||||
groupIdList: undefined,
|
||||
};
|
||||
@@ -142,7 +149,7 @@
|
||||
setLoading(true);
|
||||
const { data } = await getHost(id);
|
||||
const detail = Object.assign({} as Record<string, any>,
|
||||
pick(data, 'id', 'type', 'name', 'code', 'address', 'port', 'status', 'groupIdList'));
|
||||
pick(data, 'id', 'type', 'osType', 'name', 'code', 'address', 'port', 'status', 'groupIdList'));
|
||||
// tag
|
||||
const tags = (data.tags || []).map(s => s.id);
|
||||
// 渲染
|
||||
|
||||
@@ -32,6 +32,13 @@
|
||||
placeholder="请选择主机类型"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
<!-- 系统类型 -->
|
||||
<a-form-item field="osType" label="系统类型">
|
||||
<a-select v-model="formModel.osType"
|
||||
:options="toOptions(hostOsTypeKey)"
|
||||
placeholder="请选择系统类型"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
<!-- 主机状态 -->
|
||||
<a-form-item field="status" label="主机状态">
|
||||
<a-select v-model="formModel.status"
|
||||
@@ -131,8 +138,13 @@
|
||||
@page-size-change="(size: number) => fetchTableData(1, size)">
|
||||
<!-- 主机类型 -->
|
||||
<template #type="{ record }">
|
||||
<a-tag :color="getDictValue(hostTypeKey, record.type, 'color')">
|
||||
{{ getDictValue(hostTypeKey, record.type) }}
|
||||
<a-tag class="flex-center" :color="getDictValue(hostTypeKey, record.type, 'color')">
|
||||
<!-- 系统类型图标 -->
|
||||
<component v-if="HostOsType[record.osType as keyof typeof HostOsType]"
|
||||
:is="HostOsType[record.osType as keyof typeof HostOsType].icon"
|
||||
class="os-icon" />
|
||||
<!-- 主机类型 -->
|
||||
<span>{{ getDictValue(hostTypeKey, record.type) }}</span>
|
||||
</a-tag>
|
||||
</template>
|
||||
<!-- 主机编码 -->
|
||||
@@ -221,16 +233,16 @@
|
||||
</span>
|
||||
</a-doption>
|
||||
<!-- SSH -->
|
||||
<a-doption v-if="record.type === hostType.SSH.type"
|
||||
v-permission="['asset:terminal:access']"
|
||||
<a-doption v-if="record.type === HostType.SSH.value"
|
||||
v-permission="['terminal:terminal:access']"
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'SSH' } })">
|
||||
<span class="more-doption normal">
|
||||
SSH
|
||||
</span>
|
||||
</a-doption>
|
||||
<!-- SFTP -->
|
||||
<a-doption v-if="record.type === hostType.SSH.type"
|
||||
v-permission="['asset:terminal:access']"
|
||||
<a-doption v-if="record.type === HostType.SSH.value"
|
||||
v-permission="['terminal:terminal:access']"
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'SFTP' } })">
|
||||
<span class="more-doption normal">
|
||||
SFTP
|
||||
@@ -255,7 +267,7 @@
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { deleteHost, batchDeleteHost, getHostPage, updateHostStatus } from '@/api/asset/host';
|
||||
import { Message, Modal } from '@arco-design/web-vue';
|
||||
import { tagColor, hostTypeKey, hostStatusKey, hostType } from '../types/const';
|
||||
import { tagColor, hostTypeKey, hostStatusKey, HostType, HostOsType, hostOsTypeKey } from '../types/const';
|
||||
import { useTablePagination, useRowSelection } from '@/hooks/table';
|
||||
import { useDictStore } from '@/store';
|
||||
import { copy } from '@/hooks/copy';
|
||||
@@ -282,6 +294,7 @@
|
||||
code: undefined,
|
||||
address: undefined,
|
||||
type: undefined,
|
||||
osType: undefined,
|
||||
status: undefined,
|
||||
tags: undefined,
|
||||
queryTag: true
|
||||
@@ -381,6 +394,12 @@
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
.os-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.row-handle-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -9,10 +9,6 @@ const fieldConfig = {
|
||||
label: 'id',
|
||||
dataIndex: 'id',
|
||||
slotName: 'id',
|
||||
}, {
|
||||
label: '主机类型',
|
||||
dataIndex: 'type',
|
||||
slotName: 'type',
|
||||
}, {
|
||||
label: '主机编码',
|
||||
dataIndex: 'code',
|
||||
@@ -22,6 +18,10 @@ const fieldConfig = {
|
||||
dataIndex: 'address',
|
||||
slotName: 'address',
|
||||
tooltip: true,
|
||||
}, {
|
||||
label: '主机类型',
|
||||
dataIndex: 'type',
|
||||
slotName: 'type',
|
||||
}, {
|
||||
label: '主机状态',
|
||||
dataIndex: 'status',
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import WindowsIcon from '@/assets/images/icon/os_windows.svg';
|
||||
import LinuxIcon from '@/assets/images/icon/os_linux.svg';
|
||||
|
||||
// tag 颜色
|
||||
export const tagColor = [
|
||||
'arcoblue',
|
||||
@@ -8,20 +11,37 @@ export const tagColor = [
|
||||
];
|
||||
|
||||
// 主机类型
|
||||
export const hostType = {
|
||||
export const HostType = {
|
||||
SSH: {
|
||||
type: 'SSH',
|
||||
default: {
|
||||
port: 22,
|
||||
}
|
||||
}
|
||||
value: 'SSH',
|
||||
port: 22,
|
||||
},
|
||||
};
|
||||
|
||||
// 系统类型
|
||||
export const HostOsType = {
|
||||
LINUX: {
|
||||
value: 'LINUX',
|
||||
icon: LinuxIcon,
|
||||
},
|
||||
WINDOWS: {
|
||||
value: 'WINDOWS',
|
||||
icon: WindowsIcon,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
// 主机类型 字典项
|
||||
export const hostTypeKey = 'hostType';
|
||||
|
||||
// 主机系统类型 字典项
|
||||
export const hostOsTypeKey = 'hostOsType';
|
||||
|
||||
// 主机状态 字典项
|
||||
export const hostStatusKey = 'hostStatus';
|
||||
|
||||
// 主机认证方式 字典项
|
||||
export const sshAuthTypeKey = 'hostSshAuthType';
|
||||
|
||||
// 加载的字典值
|
||||
export const dictKeys = [hostTypeKey, hostStatusKey];
|
||||
export const dictKeys = [hostTypeKey, hostOsTypeKey, hostStatusKey, sshAuthTypeKey];
|
||||
|
||||
@@ -5,6 +5,11 @@ export const type = [{
|
||||
message: '请选择主机类型'
|
||||
}] as FieldRule[];
|
||||
|
||||
export const osType = [{
|
||||
required: true,
|
||||
message: '请选择系统类型'
|
||||
}] as FieldRule[];
|
||||
|
||||
export const name = [{
|
||||
required: true,
|
||||
message: '请输入主机名称'
|
||||
@@ -46,6 +51,7 @@ export const tags = [{
|
||||
|
||||
export default {
|
||||
type,
|
||||
osType,
|
||||
name,
|
||||
code,
|
||||
address,
|
||||
|
||||
@@ -25,7 +25,7 @@ const columns = [
|
||||
dataIndex: 'type',
|
||||
slotName: 'type',
|
||||
align: 'center',
|
||||
width: 88,
|
||||
width: 100,
|
||||
}, {
|
||||
title: '主机地址',
|
||||
dataIndex: 'address',
|
||||
|
||||
Reference in New Issue
Block a user