This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
cyber-narrator-cn-ui/src/utils/constants.js

88 lines
2.2 KiB
JavaScript
Raw Normal View History

2021-06-11 10:00:22 +08:00
export const defaultPageSize = 20
export const storageKey = {
2021-07-05 17:40:43 +08:00
iso36112Capital: 'cn-iso3611-2-capital',
iso36112WorldLow: 'cn-iso3611-2-world-low',
i18n: 'cn-i18n',
languages: 'cn-languages',
language: 'cn-language',
timezone: 'cn-timezone',
timezoneOffset: 'cn-timezone-offset',
timezoneLocalOffset: 'cn-timezone-local-offset',
token: 'cn-token',
username: 'cn-username',
sysName: 'cn-sys-name',
sysLogo: 'cn-sys-logo',
tableTitlePrefix: 'cn-table-title',
tablePageSizePrefix: 'cn-page-size',
leftMenuShrink: 'cn-left-menu-shrink',
unsavedChange: 'cn-unsaved-change'
}
2021-07-05 17:40:43 +08:00
export const iso36112 = {
[storageKey.iso36112Capital]: 'data/countriesWithCapital.json',
[storageKey.iso36112WorldLow]: 'worldChinaLow.json'
}
2021-06-11 10:00:22 +08:00
// 统一定义跳转来源
export const fromRoute = {
trafficSummary: 'trafficSummary',
2021-06-11 23:00:33 +08:00
networkAppPerformance: 'networkAppPerformance',
dnsServiceInsights: 'dnsServiceInsights',
2021-09-02 17:12:27 +08:00
user: 'user',
galaxyProxy: 'galaxyProxy'
2021-06-11 10:00:22 +08:00
}
2021-06-11 23:00:33 +08:00
/* panel类别和路由之间的映射 */
export const panelTypeAndRouteMapping = {
trafficSummary: 1,
networkAppPerformance: 2,
2021-08-02 13:22:15 +08:00
dnsServiceInsights: 3,
2021-09-07 11:38:06 +08:00
ipEntityDetail: 4, // 此为clientIP
2021-08-02 13:22:15 +08:00
domainEntityDetail: 5,
appEntityDetail: 6,
serverIpEntityDetail: 7
2021-06-11 23:00:33 +08:00
}
2021-06-11 10:00:22 +08:00
export const position = {
tableHeight: {
normal: 'calc(100% - 48px)' // 常规高度,特例在下方定义
}
}
2021-06-21 20:33:39 +08:00
2021-07-07 22:58:52 +08:00
export const entityType = {
ip: 'IP',
domain: 'Domain',
app: 'APP'
}
2021-08-11 22:14:23 +08:00
export const entityFilterType = {
ip: {
country: 'locate_country',
region: 'locate_region',
asn: 'asn'
},
domain: {
categoryGroup: 'category_group',
categoryName: 'category_name',
reputationLevel: 'reputation_level'
},
app: {
appCategory: 'app_category',
appSubcategory: 'app_subcategory',
appRisk: 'app_risk'
}
2021-07-09 17:24:22 +08:00
}
export const unitTypes = {
time: 'time',
number: 'number',
byte: 'byte',
string: 'string',
percent: 'percent'
}
2021-06-21 20:33:39 +08:00
export const chartTableDefaultPageSize = 10 // table类型图表默认每页数据量
export const chartTableTopOptions = [10, 100] // table类型图表的TOP-N选项
export const chartPieTableTopOptions = [{ name: 'Sessions', value: 'sessions' }, { name: 'Packets', value: 'packets' }, { name: 'Bytes', value: 'bytes' }] // table类型图表的TOP-N选项