fix: 社区版优化告警,菜单

fix: 社区版优化告警,菜单
This commit is contained in:
qiaochuLei 2023-09-01 15:12:43 +08:00 committed by GitHub
parent 6f41c16874
commit 7f0d66c486
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 7 deletions

View File

@ -16,7 +16,9 @@ import BaseMenu, { USER_CENTER_MENU_DATA } from '../data/baseMenu'
import { getSystemPermission, updateMenus } from '@/api/initHome';
import { protocolList } from '@/utils/consts';
import { getProviders } from '@/api/data-collect/channel';
import { isNoCommunity } from '@/utils/utils';
import {
systemVersion,
} from '@/api/login'
/**
* 获取菜单数据
@ -30,7 +32,12 @@ const menuDatas = reactive({
* 查询支持的协议
*/
const getProvidersFn = async () => {
if (!isNoCommunity) {
let version = ''
const req:any =await systemVersion()
if(req.success && req.result){
version = req.result.edition
}
if (version ==='community') {
return undefined
} else {
const res: any = await getProviders();

View File

@ -86,7 +86,8 @@ import { getImage, onlyMessage } from '@/utils/comm';
import { queryLevel, saveLevel } from '@/api/rule-engine/config';
import { LevelItem } from './typing';
import Io from './Io/index.vue';
const list = ref([
import { isNoCommunity } from '@/utils/utils';
const list = isNoCommunity ?[
{
key: 'config',
tab: '告警级别',
@ -95,7 +96,12 @@ const list = ref([
key: 'io',
tab: '数据流转',
},
]);
] : [
{
key: 'config',
tab: '告警级别',
}
]
let levels = ref<LevelItem[]>([]);
let tab = ref<'io' | 'config' | string>('config');
const getAlarmLevel = () => {

View File

@ -83,7 +83,7 @@ import {
} from '@/utils/consts';
import { protocolList } from '@/utils/consts';
import { getProviders } from '@/api/data-collect/channel';
import { isNoCommunity } from '@/utils/utils';
const selectedKeys: any = ref([]);
const treeData = ref<any>([]);
const systemMenu: any = ref([]);
@ -118,10 +118,14 @@ const params = {
*/
let filterProtocolList: any[] = [];
const getProvidersFn = async () => {
const res: any = await getProviders();
filterProtocolList = protocolList.filter((item) => {
if(!isNoCommunity){
return
}else{
const res: any = await getProviders();
filterProtocolList = protocolList.filter((item) => {
return res.result?.find((val: any) => item.alias == val.id);
})
}
}
getProvidersFn();
function filterTree(nodes: Array<any>, selectedKeys: Array<any>) {

View File

@ -97,6 +97,7 @@ export default defineConfig(({ mode}) => {
// target: 'http://192.168.32.163:8844', //张季本地
// target: 'http://120.77.179.54:8844', // 120测试
target: 'http://192.168.33.46:8844', // 本地开发环境
// target: 'http://192.168.32.5:8848', // 刘本地
ws: 'ws://192.168.33.46:8844',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')