2021-03-19 18:52:19 +08:00
|
|
|
import i18n from '../i18n'
|
2020-07-24 19:22:52 +08:00
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
export const defaultPageSize = 20
|
2020-12-17 11:07:57 +08:00
|
|
|
|
2021-04-13 20:33:12 +08:00
|
|
|
export const agent = {
|
2021-03-19 18:52:19 +08:00
|
|
|
theData: [
|
2020-09-01 15:36:21 +08:00
|
|
|
{
|
2021-03-19 18:52:19 +08:00
|
|
|
label: 'Federation',
|
|
|
|
|
value: 'federation',
|
|
|
|
|
children: [
|
2020-09-01 15:36:21 +08:00
|
|
|
{
|
2021-03-19 18:52:19 +08:00
|
|
|
label: 'Global',
|
|
|
|
|
value: 1,
|
|
|
|
|
text: 'Global'
|
2020-09-01 15:36:21 +08:00
|
|
|
},
|
|
|
|
|
{
|
2021-03-19 18:52:19 +08:00
|
|
|
label: 'Per-datacenter',
|
|
|
|
|
value: 2,
|
|
|
|
|
text: 'Per-datacenter'
|
2020-09-01 15:36:21 +08:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-03-19 18:52:19 +08:00
|
|
|
label: 'Thanos',
|
|
|
|
|
value: 'Thanos',
|
|
|
|
|
children: [
|
2020-09-01 15:36:21 +08:00
|
|
|
{
|
2021-03-19 18:52:19 +08:00
|
|
|
label: 'Query',
|
|
|
|
|
value: 3,
|
|
|
|
|
text: 'Thanos-Query'
|
2020-09-01 15:36:21 +08:00
|
|
|
},
|
|
|
|
|
{
|
2021-03-19 18:52:19 +08:00
|
|
|
label: 'Rule',
|
|
|
|
|
value: 4,
|
|
|
|
|
text: 'Thanos-Rule'
|
2020-09-01 15:36:21 +08:00
|
|
|
},
|
|
|
|
|
{
|
2021-03-19 18:52:19 +08:00
|
|
|
label: 'Sidecar',
|
|
|
|
|
value: 5,
|
|
|
|
|
text: 'Thanos-Sidecar'
|
2020-09-01 15:36:21 +08:00
|
|
|
},
|
|
|
|
|
{
|
2021-03-19 18:52:19 +08:00
|
|
|
label: 'Store',
|
|
|
|
|
value: 6,
|
|
|
|
|
text: 'Thanos-Store'
|
2020-09-01 15:36:21 +08:00
|
|
|
},
|
|
|
|
|
{
|
2021-03-19 18:52:19 +08:00
|
|
|
label: 'Compactor',
|
|
|
|
|
value: 7,
|
|
|
|
|
text: 'Thanos-Compactor'
|
2020-09-01 15:36:21 +08:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
}
|
2021-04-13 20:33:12 +08:00
|
|
|
export const agent2 = {
|
2021-04-08 19:36:14 +08:00
|
|
|
theData: [
|
|
|
|
|
{
|
|
|
|
|
label: 'Global',
|
|
|
|
|
value: 1,
|
|
|
|
|
text: 'Global'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Per-datacenter',
|
|
|
|
|
value: 2,
|
|
|
|
|
text: 'Per-datacenter'
|
|
|
|
|
}
|
|
|
|
|
]
|
2020-07-24 19:22:52 +08:00
|
|
|
|
2021-04-08 19:36:14 +08:00
|
|
|
}
|
2020-07-24 19:22:52 +08:00
|
|
|
export const asset = {
|
|
|
|
|
pingData: [
|
2021-03-19 18:52:19 +08:00
|
|
|
{ value: 1, label: 'up' },
|
|
|
|
|
{ value: 0, label: 'down' }
|
2020-07-24 19:22:52 +08:00
|
|
|
],
|
|
|
|
|
stateData: [
|
2021-03-19 18:52:19 +08:00
|
|
|
{ value: 1, label: i18n.t('asset.inStock') },
|
|
|
|
|
{ value: 2, label: i18n.t('asset.notInStock') },
|
|
|
|
|
{ value: 3, label: i18n.t('asset.suspended') }
|
2021-04-22 12:25:23 +08:00
|
|
|
],
|
2021-04-27 20:59:37 +08:00
|
|
|
assetType: {
|
|
|
|
|
authProtocolOptions: [
|
2021-04-28 14:21:01 +08:00
|
|
|
{ value: 0, label: 'nothing' },
|
2021-04-27 20:59:37 +08:00
|
|
|
{ value: 1, label: 'SSH' },
|
|
|
|
|
{ value: 2, label: 'TELNET' }
|
|
|
|
|
],
|
|
|
|
|
authProtocolData: {
|
|
|
|
|
non: 0,
|
|
|
|
|
ssh: 1,
|
|
|
|
|
telnet: 2
|
2021-05-08 09:40:53 +08:00
|
|
|
}
|
2021-04-27 20:59:37 +08:00
|
|
|
},
|
2021-04-22 12:25:23 +08:00
|
|
|
authProtocolOptions: [
|
|
|
|
|
{ value: 1, label: 'SSH' },
|
|
|
|
|
{ value: 2, label: 'TELNET' }
|
|
|
|
|
],
|
|
|
|
|
authProtocolData: {
|
|
|
|
|
ssh: 1,
|
|
|
|
|
telnet: 2
|
|
|
|
|
},
|
|
|
|
|
authTypeOptions: [
|
|
|
|
|
{ value: 1, label: 'Username' },
|
|
|
|
|
{ value: 2, label: 'Key' }
|
|
|
|
|
],
|
|
|
|
|
authTypeData: {
|
|
|
|
|
username: 1,
|
|
|
|
|
key: 2
|
|
|
|
|
},
|
|
|
|
|
editTypeOptions: [
|
|
|
|
|
{ value: 1, label: i18n.t('overall.account') },
|
|
|
|
|
{ value: 2, label: 'Label' },
|
|
|
|
|
{ value: 3, label: i18n.t('asset.state') },
|
|
|
|
|
{ value: 4, label: i18n.t('asset.snmpCredential') }
|
|
|
|
|
],
|
|
|
|
|
editTypeData: {
|
|
|
|
|
account: 1,
|
|
|
|
|
label: 2,
|
|
|
|
|
state: 3,
|
|
|
|
|
snmpCredential: 4
|
|
|
|
|
},
|
|
|
|
|
labelTypeData: {
|
|
|
|
|
TEXT: 'TEXT',
|
|
|
|
|
MULTITEXT: 'MULTITEXT',
|
|
|
|
|
TEXTAREA: 'TEXTAREA',
|
|
|
|
|
RADIO: 'RADIO',
|
|
|
|
|
CHECKBOX: 'CHECKBOX',
|
|
|
|
|
SELECT: 'SELECT',
|
|
|
|
|
INTEGER: 'INTEGER',
|
|
|
|
|
DOUBLE: 'DOUBLE',
|
|
|
|
|
DATETIME: 'DATETIME',
|
|
|
|
|
EMAIL: 'EMAIL'
|
|
|
|
|
},
|
|
|
|
|
labelSubTypeData: {
|
|
|
|
|
date: 'date',
|
|
|
|
|
time: 'time',
|
|
|
|
|
dateTime: 'dateTime'
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
}
|
2020-07-31 20:57:04 +08:00
|
|
|
|
|
|
|
|
export const alertMessage = {
|
|
|
|
|
severityData: [
|
2021-03-19 18:52:19 +08:00
|
|
|
{ value: 'P1', label: i18n.t('alert.config.P1') },
|
|
|
|
|
{ value: 'P2', label: i18n.t('alert.config.P2') },
|
|
|
|
|
{ value: 'P3', label: i18n.t('alert.config.P3') }
|
2020-07-31 20:57:04 +08:00
|
|
|
],
|
|
|
|
|
typeData: [
|
2021-03-19 18:52:19 +08:00
|
|
|
{ value: 1, label: i18n.t('alert.config.typeOption.project') },
|
|
|
|
|
{ value: 2, label: i18n.t('alert.config.typeOption.module') },
|
|
|
|
|
{ value: 3, label: i18n.t('alert.config.typeOption.asset') }
|
2020-07-31 20:57:04 +08:00
|
|
|
],
|
2021-03-19 18:52:19 +08:00
|
|
|
levels: [
|
|
|
|
|
{ value: 'P1', label: i18n.t('alert.config.P1') },
|
|
|
|
|
{ value: 'P2', label: i18n.t('alert.config.P2') },
|
|
|
|
|
{ value: 'P3', label: i18n.t('alert.config.P3') }
|
2020-07-31 20:57:04 +08:00
|
|
|
],
|
2021-03-19 18:52:19 +08:00
|
|
|
states: [
|
2021-05-10 15:59:39 +08:00
|
|
|
{ value: '1', label: i18n.t('overall.active') },
|
2021-04-29 22:24:38 +08:00
|
|
|
{ value: '2', label: i18n.t('overall.silence') },
|
|
|
|
|
{ value: '3', label: i18n.t('alert.list.expired') }
|
2021-03-19 18:52:19 +08:00
|
|
|
]
|
|
|
|
|
}
|
2020-07-31 20:57:04 +08:00
|
|
|
|
|
|
|
|
export const statisticsList = [
|
2021-03-19 18:52:19 +08:00
|
|
|
{ value: 'min', label: i18n.t('dashboard.panel.chartForm.statisticsVal.min') },
|
|
|
|
|
{ value: 'max', label: i18n.t('dashboard.panel.chartForm.statisticsVal.max') },
|
|
|
|
|
{ value: 'average', label: i18n.t('dashboard.panel.chartForm.statisticsVal.average') },
|
|
|
|
|
{ value: 'total', label: i18n.t('dashboard.panel.chartForm.statisticsVal.total') },
|
|
|
|
|
{ value: 'first', label: i18n.t('dashboard.panel.chartForm.statisticsVal.first') },
|
|
|
|
|
{ value: 'last', label: i18n.t('dashboard.panel.chartForm.statisticsVal.last') },
|
|
|
|
|
{ value: 'range', label: i18n.t('dashboard.panel.chartForm.statisticsVal.range') },
|
|
|
|
|
{ value: 'different', label: i18n.t('dashboard.panel.chartForm.statisticsVal.different') }
|
|
|
|
|
]
|
2020-07-31 20:57:04 +08:00
|
|
|
|
2021-06-29 14:10:41 +08:00
|
|
|
export const alignList = [
|
|
|
|
|
{ value: 'left', label: i18n.t('dashboard.panel.chartForm.alignList.left') },
|
|
|
|
|
{ value: 'center', label: i18n.t('dashboard.panel.chartForm.alignList.center') },
|
|
|
|
|
{ value: 'right', label: i18n.t('dashboard.panel.chartForm.alignList.right') }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
export const lockList = [
|
|
|
|
|
{ value: 1, label: i18n.t('dashboard.panel.chartForm.lockList.on') },
|
|
|
|
|
{ value: 0, label: i18n.t('dashboard.panel.chartForm.lockList.off') }
|
|
|
|
|
]
|
|
|
|
|
|
2021-05-10 15:59:39 +08:00
|
|
|
export const chart = {
|
|
|
|
|
varType: [
|
|
|
|
|
{ value: '1', label: i18n.t('asset.asset') },
|
|
|
|
|
{ value: '2', label: i18n.t('asset.endpoint') }
|
|
|
|
|
],
|
|
|
|
|
type: [
|
|
|
|
|
{
|
|
|
|
|
value: 'line',
|
|
|
|
|
label: i18n.t('dashboard.panel.chartForm.typeVal.line.label')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'stackArea',
|
|
|
|
|
label: i18n.t('dashboard.panel.chartForm.typeVal.stackArea.label')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'bar',
|
|
|
|
|
label: i18n.t('dashboard.panel.chartForm.typeVal.bar.label')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'singleStat',
|
|
|
|
|
label: i18n.t('dashboard.panel.chartForm.typeVal.singleStat.label')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'pie',
|
|
|
|
|
label: i18n.t('dashboard.panel.chartForm.typeVal.pie.label')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'table',
|
|
|
|
|
label: i18n.t('dashboard.panel.chartForm.typeVal.table.label')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'alertList',
|
|
|
|
|
label: i18n.t('dashboard.panel.chartForm.typeVal.alertList.label')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'text',
|
|
|
|
|
label: i18n.t('dashboard.panel.chartForm.typeVal.text.label')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'url',
|
|
|
|
|
label: i18n.t('dashboard.panel.chartForm.typeVal.url.label')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'group',
|
|
|
|
|
label: i18n.t('dashboard.panel.chartForm.typeVal.group.label')
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 20:57:04 +08:00
|
|
|
export const intervalList = [
|
2021-03-19 18:52:19 +08:00
|
|
|
{ value: -1, label: i18n.t('dashboard.panel.refreshInterval.never') },
|
|
|
|
|
{ value: 30, label: '30s' },
|
|
|
|
|
{ value: 60, label: '1m' },
|
|
|
|
|
{ value: 300, label: '5m' },
|
|
|
|
|
{ value: 900, label: '15m' },
|
|
|
|
|
{ value: 1800, label: '30m' }
|
|
|
|
|
]
|
2020-11-10 15:57:57 +08:00
|
|
|
|
|
|
|
|
export const setting = {
|
2021-03-19 18:52:19 +08:00
|
|
|
DcState: [
|
|
|
|
|
{ value: 'ON', label: i18n.t('config.dc.usable') },
|
|
|
|
|
{ value: 'OFF', label: i18n.t('config.dc.suspended') }
|
|
|
|
|
]
|
|
|
|
|
}
|
2021-04-15 11:47:44 +08:00
|
|
|
export const snmpProtocolTypes = [
|
2021-04-14 19:17:16 +08:00
|
|
|
// {label:'V1',value:1},
|
2021-04-15 11:47:44 +08:00
|
|
|
{ label: 'V2', value: 2 },
|
|
|
|
|
{ label: 'V3', value: 3 }
|
2021-04-14 19:17:16 +08:00
|
|
|
]
|
2021-04-15 11:47:44 +08:00
|
|
|
export const snmpAuthMethod = [
|
|
|
|
|
{ label: 'None', value: '' },
|
|
|
|
|
{ label: 'MD5', value: 'MD5' },
|
|
|
|
|
{ label: 'SHA', value: 'SHA' }
|
2021-04-14 19:17:16 +08:00
|
|
|
]
|
2021-04-15 11:47:44 +08:00
|
|
|
export const snmpEncryptionMethod = [
|
|
|
|
|
{ label: 'None', value: '' },
|
|
|
|
|
{ label: 'DES', value: 'DES' },
|
|
|
|
|
{ label: 'AES-128', value: 'AES-128' },
|
|
|
|
|
{ label: 'AES-192', value: 'AES-192' },
|
|
|
|
|
{ label: 'AES-256', value: 'AES-256' }
|
2021-04-14 19:17:16 +08:00
|
|
|
]
|
2021-02-18 10:13:52 +08:00
|
|
|
export const terminalLog = {
|
|
|
|
|
status: {
|
|
|
|
|
0: i18n.t('config.terminallog.statusItem.connecting'),
|
|
|
|
|
1: i18n.t('config.terminallog.statusItem.connectionFailed'),
|
|
|
|
|
2: i18n.t('config.terminallog.statusItem.over'),
|
|
|
|
|
3: i18n.t('config.terminallog.statusItem.kickedOut'),
|
2021-03-19 18:52:19 +08:00
|
|
|
4: i18n.t('config.terminallog.statusItem.unknownError')
|
2021-02-18 10:13:52 +08:00
|
|
|
},
|
|
|
|
|
dangerCmd: ['chmod', 'chown', 'kill', 'rm', 'su', 'sudo'],
|
|
|
|
|
infoCmd: ['exit']
|
2021-03-19 18:52:19 +08:00
|
|
|
}
|
2021-05-10 16:36:06 +08:00
|
|
|
// 需要隐藏的内置label
|
|
|
|
|
export const sameLabels = ['instance', 'module', 'project', 'asset', 'endpoint', 'datacenter', 'datacenter_id', 'endpoint_id', 'module_id', 'nz_agent_id', 'project_id']
|
2021-03-19 18:52:19 +08:00
|
|
|
// 公共组件的跳转来源
|
2020-12-08 21:53:37 +08:00
|
|
|
export const fromRoute = {
|
2021-03-19 18:52:19 +08:00
|
|
|
panel: 'panel',
|
|
|
|
|
explore: 'explore',
|
2021-04-13 20:33:12 +08:00
|
|
|
alertMessage: 'alertMessage',
|
|
|
|
|
alertRule: 'alertRule',
|
|
|
|
|
alertSilence: 'alertSilence',
|
2021-03-19 18:52:19 +08:00
|
|
|
model: 'model',
|
2021-04-08 20:28:54 +08:00
|
|
|
mib: 'mib',
|
2021-03-19 18:52:19 +08:00
|
|
|
asset: 'asset',
|
2021-04-08 20:28:54 +08:00
|
|
|
assetType: 'assetType',
|
|
|
|
|
assetState: 'assetState',
|
2021-04-22 12:25:23 +08:00
|
|
|
assetLabel: 'assetLabel',
|
2021-04-08 20:28:54 +08:00
|
|
|
expressionTemplate: 'expressionTemplate',
|
2021-04-12 13:00:59 +08:00
|
|
|
user: 'user',
|
2021-04-13 20:33:12 +08:00
|
|
|
agent: 'agent',
|
2021-03-19 18:52:19 +08:00
|
|
|
dc: 'dc',
|
2021-04-08 20:28:54 +08:00
|
|
|
role: 'role',
|
2021-03-19 18:52:19 +08:00
|
|
|
project: 'project',
|
2021-04-20 14:38:24 +08:00
|
|
|
module: 'module',
|
|
|
|
|
endpoint: 'endpoint',
|
2021-03-19 18:52:19 +08:00
|
|
|
endpointQuery: 'endpointQuery',
|
2021-04-08 20:28:54 +08:00
|
|
|
terminalLog: 'terminalLog',
|
2021-04-13 10:00:48 +08:00
|
|
|
operationLog: 'operationLog',
|
2021-04-16 21:10:31 +08:00
|
|
|
menus: 'menus',
|
|
|
|
|
notify: 'notify',
|
|
|
|
|
link: 'link',
|
2021-04-25 14:58:03 +08:00
|
|
|
apiKey: 'apiKey',
|
|
|
|
|
chartTemp: 'chartTemp'
|
2021-03-19 18:52:19 +08:00
|
|
|
}
|