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 { getSystemPermission, updateMenus } from '@/api/initHome';
import { protocolList } from '@/utils/consts'; import { protocolList } from '@/utils/consts';
import { getProviders } from '@/api/data-collect/channel'; 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 () => { 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 return undefined
} else { } else {
const res: any = await getProviders(); 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 { queryLevel, saveLevel } from '@/api/rule-engine/config';
import { LevelItem } from './typing'; import { LevelItem } from './typing';
import Io from './Io/index.vue'; import Io from './Io/index.vue';
const list = ref([ import { isNoCommunity } from '@/utils/utils';
const list = isNoCommunity ?[
{ {
key: 'config', key: 'config',
tab: '告警级别', tab: '告警级别',
@ -95,7 +96,12 @@ const list = ref([
key: 'io', key: 'io',
tab: '数据流转', tab: '数据流转',
}, },
]); ] : [
{
key: 'config',
tab: '告警级别',
}
]
let levels = ref<LevelItem[]>([]); let levels = ref<LevelItem[]>([]);
let tab = ref<'io' | 'config' | string>('config'); let tab = ref<'io' | 'config' | string>('config');
const getAlarmLevel = () => { const getAlarmLevel = () => {

View File

@ -83,7 +83,7 @@ import {
} from '@/utils/consts'; } from '@/utils/consts';
import { protocolList } from '@/utils/consts'; import { protocolList } from '@/utils/consts';
import { getProviders } from '@/api/data-collect/channel'; import { getProviders } from '@/api/data-collect/channel';
import { isNoCommunity } from '@/utils/utils';
const selectedKeys: any = ref([]); const selectedKeys: any = ref([]);
const treeData = ref<any>([]); const treeData = ref<any>([]);
const systemMenu: any = ref([]); const systemMenu: any = ref([]);
@ -118,10 +118,14 @@ const params = {
*/ */
let filterProtocolList: any[] = []; let filterProtocolList: any[] = [];
const getProvidersFn = async () => { const getProvidersFn = async () => {
const res: any = await getProviders(); if(!isNoCommunity){
filterProtocolList = protocolList.filter((item) => { return
}else{
const res: any = await getProviders();
filterProtocolList = protocolList.filter((item) => {
return res.result?.find((val: any) => item.alias == val.id); return res.result?.find((val: any) => item.alias == val.id);
}) })
}
} }
getProvidersFn(); getProvidersFn();
function filterTree(nodes: Array<any>, selectedKeys: Array<any>) { 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://192.168.32.163:8844', //张季本地
// target: 'http://120.77.179.54:8844', // 120测试 // target: 'http://120.77.179.54:8844', // 120测试
target: 'http://192.168.33.46:8844', // 本地开发环境 target: 'http://192.168.33.46:8844', // 本地开发环境
// target: 'http://192.168.32.5:8848', // 刘本地
ws: 'ws://192.168.33.46:8844', ws: 'ws://192.168.33.46:8844',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '') rewrite: (path) => path.replace(/^\/api/, '')