status-map.ts 4.7 KB
Newer Older
Z
zengqiao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
import { IStatusMap, IStringMap, ILabelValue } from 'types/base-type';

export const optionMap = [
  'byteIn/byteOut',
  'bytesRejectedPerSec',
  'failFetchRequestPerSec',
  'failProduceRequestPerSec',
  'fetchConsumerRequestPerSec',
  'healthScore',
  'logFlushTime',
  'messagesInPerSec',
  'networkProcessorIdlPercent',
  'produceRequestPerSec',
  'requestHandlerIdlPercent',
  'requestQueueSize',
  'responseQueueSize',
  'totalTimeFetchConsumer99Th',
  'totalTimeProduce99Th',
];
export const copyValueMap = ['同步', '未同步'];

export const appStatusMap = {
  0: '待审批',
  1: '已通过',
  2: '被拒绝',
} as IStatusMap;

export const topicStatusMap = {
  0: '无权限',
  1: '可消费',
  2: '可发送',
  3: '可发送、消费',
  4: '可管理',
} as IStatusMap;

export const authStatusMap = {
  0: '无权限',
  1: '消费',
  2: '发送',
  3: '发送、消费',
  4: '管理',
} as IStatusMap;

export const orderStatusMap = {
  0: '待审批',
  1: '已通过',
  2: '已拒绝',
  3: '已取消',
} as IStatusMap;

export const clusterTypeMap = {
  0: '共享集群',
  1: '独享集群',
  2: '独立集群',
} as IStatusMap;

export const classStatusMap = {
  '-1': 'executing',
  '0': 'pending',
  '10': 'executing',
  '20': 'pending',
  '30': 'executing',
  '40': 'success',
  '41': 'success',
  '42': 'fail',
  '43': 'cancel',
  '44': 'executing',
  '45': 'pending',
} as IStatusMap;

export const orderApiTypeMap = {
  0: 'topics',
  1: 'apps',
  2: 'quotas',
  3: 'authorities',
  4: 'clusters',
} as IStatusMap;

export const offlineStatusMap = {
  '-1': '可下线',
  '0': '过期待通知',
  '1': '已通知待反馈',
} as IStatusMap;

export const orderApiMap = {
  0: '/normal/orders/topics',
  1: '/normal/orders/apps',
  2: '/normal/orders/quotas',
  3: '/normal/orders/authorities',
  4: '/normal/orders/clusters',
} as IStatusMap;

export const controlOptionMap = [{
  label: 'Bytes In/Bytes Out',
  value: 'byteIn/byteOut',
}, {
  label: 'Message In',
  value: 'messageIn',
}, {
  label: 'Topic Num',
  value: 'topicNum',
}, {
  label: 'Broker Num',
  value: 'brokerNum',
}] as ILabelValue[];

export const selectOptionMap = [{
  label: 'Bytes In/Bytes Out',
  value: 'byteIn/byteOut',
}, {
  label: 'Bytes Rejected',
  value: 'byteRejected',
}, {
  label: 'Message In/TotalProduceRequests',
  value: 'messageIn/totalProduceRequests',
}] as ILabelValue[];

export const selectBrokerMap = [{
  label: 'Bytes In/Bytes Out',
  value: 'byteIn/byteOut',
}, {
  label: 'Bytes Rejected',
  value: 'byteRejected',
}, {
  label: 'Message In',
  value: 'messageIn',
}] as ILabelValue[];

export const metricOptionMap = [
  {
    type: 'byteIn/byteOut',
    arr: ['bytesInPerSec', 'bytesOutPerSec'],
  },
  {
    type: 'messageIn/totalProduceRequests',
    arr: ['messagesInPerSec', 'totalProduceRequestsPerSec'],
  },
  {
    type: 'byteRejected',
    arr: ['bytesRejectedPerSec'],
  },
  {
    type: 'byteIn/byteOut/appByteIn/appByteOut',
    // tslint:disable-next-line:max-line-length
    // arr: ['bytesInPerSec', 'bytesOutPerSec', 'appIdBytesInPerSec', 'appIdBytesOutPerSec', 'consumeThrottled', 'produceThrottled'],
    arr: ['bytesInPerSec', 'bytesOutPerSec'],
  },
];

export const selectMonitorMap = [{
  label: '美国',
  value: '美国',
}, {
  label: '中国',
  value: '中国',
}, {
  label: '俄罗斯',
  value: '俄罗斯',
}] as ILabelValue[];

export const selectTakeMap = [{
  label: 'RequestTime99thPercentile',
  value: 'requestTime99thPercentile',
}, {
  label: 'RequestTime95thPercentile',
  value: 'requestTime95thPercentile',
}, {
  label: 'RequestTime75thPercentile',
  value: 'requestTime75thPercentile',
}, {
  label: 'RequestTime50thPercentile',
  value: 'requestTime50thPercentile',
}] as ILabelValue[];

export const columsDefault = {
  leaderPartitionList: 'leaderPartitions:',
  followerPartitionIdList: 'followerPartitions:',
  notUnderReplicatedPartitionIdList: 'notUnderReplicatedPartitions:',
} as IStringMap;

export const diskDefault = {
  leaderPartitions: 'leaderPartitions:',
  followerPartitions: 'followerPartitions:',
  notUnderReplicatedPartitions: 'notUnderReplicatedPartitions:',
} as IStringMap;

export const brokerMetrics = {
  bytesIn: 'Bytes In(MB/ 秒)',
  bytesOut: 'Bytes Out(MB/ 秒)',
  messagesIn: 'Messages In(条)',
  totalFetchRequests: 'Total Fetch Requests(QPS)',
  totalProduceRequests: 'Total Produce Requests(QPS)',
} as IStringMap;

export const roleMap = {
  0: '普通用户',
  1: '研发人员',
  2: '运维人员',
} as IStatusMap;

export const weekOptions = [
  { label: '周一', value: 1 },
  { label: '周二', value: 2 },
  { label: '周三', value: 3 },
  { label: '周四', value: 4 },
  { label: '周五', value: 5 },
  { label: '周六', value: 6 },
  { label: '周日', value: 0 },
];