review code.
This commit is contained in:
@@ -1 +1,2 @@
|
||||
VITE_API_BASE_URL= 'http://127.0.0.1:9200/orion-api'
|
||||
VITE_APP_VERSION= '1.0.0'
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
VITE_API_BASE_URL= 'http://127.0.0.1:9200/orion-api'
|
||||
VITE_APP_VERSION= '1.0.0'
|
||||
|
||||
34
orion-ops-ui/src/api/asset/asset-authorized-data.ts
Normal file
34
orion-ops-ui/src/api/asset/asset-authorized-data.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import type { HostGroupQueryResponse } from '@/api/asset/host-group';
|
||||
import type { HostQueryResponse } from './host';
|
||||
import type { HostKeyQueryResponse } from './host-key';
|
||||
import type { HostIdentityQueryResponse } from './host-identity';
|
||||
import axios from 'axios';
|
||||
|
||||
/**
|
||||
* 已授权的主机分组 查询响应
|
||||
*/
|
||||
export interface AuthorizedHostGroupQueryResponse {
|
||||
groupTree: Array<HostGroupQueryResponse>;
|
||||
hostList: Array<HostQueryResponse>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户已授权的主机分组
|
||||
*/
|
||||
export function getCurrentAuthorizedHostGroup() {
|
||||
return axios.get<AuthorizedHostGroupQueryResponse>('/asset/authorized-data/current-host-group');
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户已授权的主机秘钥
|
||||
*/
|
||||
export function getCurrentAuthorizedHostKey() {
|
||||
return axios.get<HostKeyQueryResponse>('/asset/authorized-data/current-host-key');
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户已授权的主机身份
|
||||
*/
|
||||
export function getCurrentAuthorizedHostIdentity() {
|
||||
return axios.get<HostIdentityQueryResponse>('/asset/authorized-data/current-host-identity');
|
||||
}
|
||||
60
orion-ops-ui/src/api/asset/asset-data-grant.ts
Normal file
60
orion-ops-ui/src/api/asset/asset-data-grant.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import axios from 'axios';
|
||||
|
||||
/**
|
||||
* 数据授权 请求对象
|
||||
*/
|
||||
export interface AssetDataGrantRequest {
|
||||
userId?: number;
|
||||
roleId?: number;
|
||||
idList?: Array<number>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 授权数据 查询请求对象
|
||||
*/
|
||||
export interface AssetAuthorizedDataQueryRequest {
|
||||
userId?: number;
|
||||
roleId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主机分组授权
|
||||
*/
|
||||
export function grantHostGroup(request: AssetDataGrantRequest) {
|
||||
return axios.put('/asset/host-group/grant-host-group', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已授权的主机分组
|
||||
*/
|
||||
export function getAuthorizedHostGroup(params: AssetAuthorizedDataQueryRequest) {
|
||||
return axios.get<Array<number>>('/asset/data-grant/get-host-group', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 主机秘钥授权
|
||||
*/
|
||||
export function grantHostKey(request: AssetDataGrantRequest) {
|
||||
return axios.put('/asset/host-group/grant-host-key', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已授权的主机秘钥
|
||||
*/
|
||||
export function getAuthorizedHostKey(params: AssetAuthorizedDataQueryRequest) {
|
||||
return axios.get<Array<number>>('/asset/data-grant/get-host-key', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 主机身份授权
|
||||
*/
|
||||
export function grantHostIdentity(request: AssetDataGrantRequest) {
|
||||
return axios.put('/asset/host-group/grant-host-identity', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已授权的主机身份
|
||||
*/
|
||||
export function getAuthorizedHostIdentity(params: AssetAuthorizedDataQueryRequest) {
|
||||
return axios.get<Array<number>>('/asset/data-grant/get-host-identity', { params });
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import type { HostGroupQueryResponse } from '@/api/asset/host-group';
|
||||
import axios from 'axios';
|
||||
|
||||
/**
|
||||
* 查询已授权的主机分组
|
||||
*/
|
||||
export function getAuthorizedHostGroup() {
|
||||
return axios.get<Array<HostGroupQueryResponse>>('/asset/authorized-data/host-group');
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { HostQueryResponse } from './host';
|
||||
import axios from 'axios';
|
||||
|
||||
/**
|
||||
@@ -33,7 +34,7 @@ export interface HostGroupQueryResponse {
|
||||
parentId: number;
|
||||
title: string;
|
||||
children: Array<HostGroupQueryResponse>;
|
||||
hosts: Array<number>;
|
||||
hostList: Array<HostQueryResponse>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,21 +45,6 @@ export interface HostGroupRelUpdateRequest {
|
||||
hostIdList?: Array<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主机分组授权 查询请求对象
|
||||
*/
|
||||
export interface HostGroupGrantQueryRequest {
|
||||
userId?: number;
|
||||
roleId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主机分组 授权请求对象
|
||||
*/
|
||||
export interface HostGroupGrantRequest extends HostGroupGrantQueryRequest {
|
||||
groupIdList?: Array<number>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建主机分组
|
||||
*/
|
||||
@@ -107,17 +93,3 @@ export function getHostGroupRelList(groupId: number) {
|
||||
export function updateHostGroupRel(request: HostGroupRelUpdateRequest) {
|
||||
return axios.put('/asset/host-group/update-rel', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已授权的分组
|
||||
*/
|
||||
export function getAuthorizedHostGroup(params: HostGroupGrantQueryRequest) {
|
||||
return axios.get<Array<number>>('/asset/host-group/get-authorized-group', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 主机分组授权
|
||||
*/
|
||||
export function grantHostGroup(request: HostGroupGrantRequest) {
|
||||
return axios.put('/asset/host-group/grant', request);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<a target="_blank" href="https://github.com/lijiahangmax/orion-ops-pro">教程</a>
|
||||
<a target="_blank" href="https://github.com/lijiahangmax/orion-ops-pro">github</a>
|
||||
<a target="_blank" href="https://gitee.com/lijiahangmax/orion-ops-pro">gitee</a>
|
||||
<span title="当前版本">v{{ version }}</span>
|
||||
</a-space>
|
||||
<span class="copyright">
|
||||
Copyright<icon-copyright /> 2023 By OrionOpsPro
|
||||
@@ -16,6 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const version = import.meta.env.VITE_APP_VERSION;
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@@ -26,7 +28,7 @@
|
||||
text-align: center;
|
||||
height: 64px;
|
||||
|
||||
a {
|
||||
a, span {
|
||||
text-decoration: none;
|
||||
color: rgb(var(--primary-6));
|
||||
}
|
||||
|
||||
@@ -377,7 +377,6 @@
|
||||
margin: -16px -16px 0 -16px;
|
||||
padding: 16px 16px 12px 16px;
|
||||
position: fixed;
|
||||
background: var(--color-fill-2);
|
||||
z-index: 999;
|
||||
height: @top-height;
|
||||
transition: none;
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
user-select: none;
|
||||
background: var(--color-bg-1);
|
||||
background: var(--color-bg-2);
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
|
||||
1
orion-ops-ui/src/env.d.ts
vendored
1
orion-ops-ui/src/env.d.ts
vendored
@@ -9,6 +9,7 @@ declare module '*.vue' {
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_API_BASE_URL: string;
|
||||
readonly VITE_APP_VERSION: string;
|
||||
}
|
||||
|
||||
// editor
|
||||
|
||||
@@ -238,13 +238,13 @@ export function cleanXss(s: string) {
|
||||
*/
|
||||
export function replaceHtmlTag(message: string) {
|
||||
return cleanXss(message)
|
||||
.replaceAll('<sb 0>', '<span class="span-blue mx0">')
|
||||
.replaceAll('<sb>', '<span class="span-blue mx0">')
|
||||
.replaceAll('<sb 2>', '<span class="span-blue mx2">')
|
||||
.replaceAll('<sb>', '<span class="span-blue mx4">')
|
||||
.replaceAll('<sb 4>', '<span class="span-blue mx4">')
|
||||
.replaceAll('</sb>', '</span>')
|
||||
.replaceAll('<sr 0>', '<span class="span-red mx0">')
|
||||
.replaceAll('<sr>', '<span class="span-red mx0">')
|
||||
.replaceAll('<sr 2>', '<span class="span-red mx2">')
|
||||
.replaceAll('<sr>', '<span class="span-red mx4">')
|
||||
.replaceAll('<sr 4>', '<span class="span-red mx4">')
|
||||
.replaceAll('</sr>', '</span>')
|
||||
.replaceAll('<b>', '<b>')
|
||||
.replaceAll('</b>', '</b>');
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
background: var(--color-bg-1);
|
||||
background: var(--color-bg-2);
|
||||
}
|
||||
|
||||
:deep(.arco-tabs-tab-title){
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
|
||||
<style lang="less" scoped>
|
||||
.tabs-container {
|
||||
background: var(--color-bg-1);
|
||||
background: var(--color-bg-2);
|
||||
margin: 16px 16px 0 16px;
|
||||
padding: 16px;
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user