From 798b0c61ee31e5ce4905a3df0c3cb1179e097244 Mon Sep 17 00:00:00 2001 From: lijiahangmax Date: Mon, 4 Dec 2023 21:25:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B5=84=E4=BA=A7=E6=8E=88=E6=9D=83.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/asset/entity/dto/HostCacheDTO.java | 7 ++ .../entity/dto/HostIdentityCacheDTO.java | 10 +++ .../asset/entity/dto/HostKeyCacheDTO.java | 7 ++ .../src/api/asset/asset-data-grant.ts | 4 +- orion-ops-ui/src/assets/style/global.less | 8 ++ .../src/components/app/setting/block.vue | 2 +- .../components/app/setting/form-wrapper.vue | 2 +- .../src/components/app/tab-bar/tab-item.vue | 4 +- .../asset/host-group/host-group-tree.vue | 2 +- .../components/host-group-role-grant.vue | 5 +- .../components/host-group-user-grant.vue | 9 +- .../components/host-identity-grant-table.vue | 77 +++++++++++++++++ .../components/host-identity-role-grant.vue | 67 +++++---------- .../components/host-identity-user-grant.vue | 70 ++++++--------- .../grant/components/host-key-grant-table.vue | 65 ++++++++++++++ .../grant/components/host-key-role-grant.vue | 17 +--- .../grant/components/host-key-user-grant.vue | 85 +++++++++---------- orion-ops-ui/src/views/asset/grant/index.vue | 2 +- .../views/asset/grant/types/table.columns.ts | 42 +++++++++ .../components/group/host-transfer.vue | 2 +- 20 files changed, 319 insertions(+), 168 deletions(-) create mode 100644 orion-ops-ui/src/views/asset/grant/components/host-identity-grant-table.vue create mode 100644 orion-ops-ui/src/views/asset/grant/components/host-key-grant-table.vue diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostCacheDTO.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostCacheDTO.java index 7c0b3110..4ec3e45d 100644 --- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostCacheDTO.java +++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostCacheDTO.java @@ -8,6 +8,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; +import java.util.Date; /** * 主机 缓存对象 @@ -35,4 +36,10 @@ public class HostCacheDTO implements LongCacheIdModel, Serializable { @Schema(description = "主机地址") private String address; + @Schema(description = "创建时间") + private Date createTime; + + @Schema(description = "修改时间") + private Date updateTime; + } diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostIdentityCacheDTO.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostIdentityCacheDTO.java index 94d70a8d..eccdd7a3 100644 --- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostIdentityCacheDTO.java +++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostIdentityCacheDTO.java @@ -8,6 +8,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; +import java.util.Date; /** * 主机身份缓存 @@ -32,4 +33,13 @@ public class HostIdentityCacheDTO implements LongCacheIdModel, Serializable { @Schema(description = "用户名") private String username; + @Schema(description = "秘钥id") + private Long keyId; + + @Schema(description = "创建时间") + private Date createTime; + + @Schema(description = "修改时间") + private Date updateTime; + } diff --git a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostKeyCacheDTO.java b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostKeyCacheDTO.java index 106e33d9..90f49fde 100644 --- a/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostKeyCacheDTO.java +++ b/orion-ops-module-asset/orion-ops-module-asset-service/src/main/java/com/orion/ops/module/asset/entity/dto/HostKeyCacheDTO.java @@ -8,6 +8,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; +import java.util.Date; /** * 主机秘钥缓存 @@ -29,4 +30,10 @@ public class HostKeyCacheDTO implements LongCacheIdModel, Serializable { @Schema(description = "名称") private String name; + @Schema(description = "创建时间") + private Date createTime; + + @Schema(description = "修改时间") + private Date updateTime; + } diff --git a/orion-ops-ui/src/api/asset/asset-data-grant.ts b/orion-ops-ui/src/api/asset/asset-data-grant.ts index dae52df6..dcb8eb36 100644 --- a/orion-ops-ui/src/api/asset/asset-data-grant.ts +++ b/orion-ops-ui/src/api/asset/asset-data-grant.ts @@ -35,7 +35,7 @@ export function getAuthorizedHostGroup(params: AssetAuthorizedDataQueryRequest) * 主机秘钥授权 */ export function grantHostKey(request: AssetDataGrantRequest) { - return axios.put('/asset/host-group/grant-host-key', request); + return axios.put('/asset/data-grant/grant-host-key', request); } /** @@ -49,7 +49,7 @@ export function getAuthorizedHostKey(params: AssetAuthorizedDataQueryRequest) { * 主机身份授权 */ export function grantHostIdentity(request: AssetDataGrantRequest) { - return axios.put('/asset/host-group/grant-host-identity', request); + return axios.put('/asset/data-grant/grant-host-identity', request); } /** diff --git a/orion-ops-ui/src/assets/style/global.less b/orion-ops-ui/src/assets/style/global.less index ba877e75..cd84d608 100644 --- a/orion-ops-ui/src/assets/style/global.less +++ b/orion-ops-ui/src/assets/style/global.less @@ -73,6 +73,14 @@ body { display: none; } +.sticky-list { + .arco-list-header { + position: sticky; + background: var(--color-bg-2); + top: 0; + } +} + .arco-table-td-content { color: rgba(var(--gray-9), .95); font-size: 13px; diff --git a/orion-ops-ui/src/components/app/setting/block.vue b/orion-ops-ui/src/components/app/setting/block.vue index 9456737a..1a1d3091 100644 --- a/orion-ops-ui/src/components/app/setting/block.vue +++ b/orion-ops-ui/src/components/app/setting/block.vue @@ -41,7 +41,7 @@ title: String, options: { type: Array as PropType, - default: [] + default: () => [] }, }); diff --git a/orion-ops-ui/src/components/app/setting/form-wrapper.vue b/orion-ops-ui/src/components/app/setting/form-wrapper.vue index 396e3ca1..717f5b7e 100644 --- a/orion-ops-ui/src/components/app/setting/form-wrapper.vue +++ b/orion-ops-ui/src/components/app/setting/form-wrapper.vue @@ -49,7 +49,7 @@ }, options: { type: Array as PropType>, - default: [] + default: () => [] } }); const emit = defineEmits(['inputChange']); diff --git a/orion-ops-ui/src/components/app/tab-bar/tab-item.vue b/orion-ops-ui/src/components/app/tab-bar/tab-item.vue index 7f2c06e1..3bbbb556 100644 --- a/orion-ops-ui/src/components/app/tab-bar/tab-item.vue +++ b/orion-ops-ui/src/components/app/tab-bar/tab-item.vue @@ -68,7 +68,9 @@ const props = defineProps({ itemData: { type: Object as PropType, - default: [], + default: () => { + return {}; + } }, index: { type: Number, diff --git a/orion-ops-ui/src/components/asset/host-group/host-group-tree.vue b/orion-ops-ui/src/components/asset/host-group/host-group-tree.vue index 9a92134e..a0e0dd5e 100644 --- a/orion-ops-ui/src/components/asset/host-group/host-group-tree.vue +++ b/orion-ops-ui/src/components/asset/host-group/host-group-tree.vue @@ -108,7 +108,7 @@ }, checkedKeys: { type: Array, - default: [] + default: () => [] } }); const emits = defineEmits(['loading', 'selectNode', 'update:checkedKeys']); diff --git a/orion-ops-ui/src/views/asset/grant/components/host-group-role-grant.vue b/orion-ops-ui/src/views/asset/grant/components/host-group-role-grant.vue index 4818fd6a..5d7e7a2d 100644 --- a/orion-ops-ui/src/views/asset/grant/components/host-group-role-grant.vue +++ b/orion-ops-ui/src/views/asset/grant/components/host-group-role-grant.vue @@ -37,8 +37,7 @@ @select-node="e => selectedGroup = e" @update:checked-keys="updateCheckedGroups" /> - + @@ -57,9 +56,9 @@ import { getAuthorizedHostGroup, grantHostGroup } from '@/api/asset/asset-data-grant'; import { AdminRoleCode } from '@/types/const'; import { Message } from '@arco-design/web-vue'; - import HostGroupTree from '@/components/asset/host-group/host-group-tree.vue'; import HostList from './host-list.vue'; import RouterRoles from './router-roles.vue'; + import HostGroupTree from '@/components/asset/host-group/host-group-tree.vue'; const { loading, setLoading } = useLoading(); diff --git a/orion-ops-ui/src/views/asset/grant/components/host-group-user-grant.vue b/orion-ops-ui/src/views/asset/grant/components/host-group-user-grant.vue index 78a91e25..389994cb 100644 --- a/orion-ops-ui/src/views/asset/grant/components/host-group-user-grant.vue +++ b/orion-ops-ui/src/views/asset/grant/components/host-group-user-grant.vue @@ -28,7 +28,7 @@
- - +
@@ -52,12 +51,12 @@ + + + + diff --git a/orion-ops-ui/src/views/asset/grant/components/host-identity-role-grant.vue b/orion-ops-ui/src/views/asset/grant/components/host-identity-role-grant.vue index ca806b5c..e020c071 100644 --- a/orion-ops-ui/src/views/asset/grant/components/host-identity-role-grant.vue +++ b/orion-ops-ui/src/views/asset/grant/components/host-identity-role-grant.vue @@ -3,11 +3,11 @@ + @change="fetchAuthorizedHostIdentity" /> -
+
-
+
@@ -26,19 +26,9 @@
-
- - - - +
+
@@ -51,53 +41,45 @@ + + + + diff --git a/orion-ops-ui/src/views/asset/grant/components/host-key-role-grant.vue b/orion-ops-ui/src/views/asset/grant/components/host-key-role-grant.vue index a6873a7d..7ffa75cd 100644 --- a/orion-ops-ui/src/views/asset/grant/components/host-key-role-grant.vue +++ b/orion-ops-ui/src/views/asset/grant/components/host-key-role-grant.vue @@ -27,17 +27,8 @@
- +
@@ -55,13 +46,11 @@ import { getAuthorizedHostKey, grantHostKey } from '@/api/asset/asset-data-grant'; import { AdminRoleCode } from '@/types/const'; import { Message } from '@arco-design/web-vue'; - import { hostKeyColumns } from '../types/table.columns'; import useLoading from '@/hooks/loading'; - import { useRowSelection } from '@/types/table'; import { useCacheStore } from '@/store'; import RouterRoles from './router-roles.vue'; + import HostKeyGrantTable from './host-key-grant-table.vue'; - const rowSelection = useRowSelection(); const cacheStore = useCacheStore(); const { loading, setLoading } = useLoading(); diff --git a/orion-ops-ui/src/views/asset/grant/components/host-key-user-grant.vue b/orion-ops-ui/src/views/asset/grant/components/host-key-user-grant.vue index 157e44e5..9a3f5df8 100644 --- a/orion-ops-ui/src/views/asset/grant/components/host-key-user-grant.vue +++ b/orion-ops-ui/src/views/asset/grant/components/host-key-user-grant.vue @@ -3,16 +3,16 @@ + @change="fetchAuthorizedHostKey" /> -
+
-
+
当前选择的用户为 {{ currentUser?.text }} - 若当前选择的用户角色包含管理员则无需配置 (管理员拥有全部权限) + 若当前选择的用户用户包含管理员则无需配置 (管理员拥有全部权限) @@ -25,19 +25,10 @@
- -
- - - - + +
+
@@ -50,52 +41,46 @@