index.ts 3.4 KB
Newer Older
R
Rongfeng Fu 已提交
1
import { intl } from '@/utils/intl';
R
Rongfeng Fu 已提交
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
export const commonStyle = { width: 216 };
export const oceanbaseComponent = 'oceanbase';
export const obproxyComponent = 'obproxy';
export const ocpexpressComponent = 'ocp-express';
export const obagentComponent = 'obagent';

export const ocpexpressComponentKey = 'ocpexpress';

export const componentVersionTypeToComponent = {
  'oceanbase-ce': oceanbaseComponent,
  'obproxy-ce': obproxyComponent,
};

export const onlyComponentsKeys = [
  obproxyComponent,
  ocpexpressComponentKey,
  obagentComponent,
];

export const allComponentsKeys = [
  oceanbaseComponent,
  obproxyComponent,
  ocpexpressComponentKey,
  obagentComponent,
];

export const allComponentsName = [
  oceanbaseComponent,
  obproxyComponent,
  ocpexpressComponent,
  obagentComponent,
];

export const componentsConfig = {
  [oceanbaseComponent]: {
R
Rongfeng Fu 已提交
37 38 39 40
    name: intl.formatMessage({
      id: 'OBD.pages.constants.Cluster',
      defaultMessage: '集群',
    }),
R
Rongfeng Fu 已提交
41
    showComponentName: 'OceanBase DataBase',
R
Rongfeng Fu 已提交
42 43 44 45
    type: intl.formatMessage({
      id: 'OBD.pages.constants.Database',
      defaultMessage: '数据库',
    }),
R
Rongfeng Fu 已提交
46
    componentKey: oceanbaseComponent,
R
Rongfeng Fu 已提交
47 48 49 50
    labelName: intl.formatMessage({
      id: 'OBD.pages.constants.ClusterParameterName',
      defaultMessage: '集群参数名称',
    }),
R
Rongfeng Fu 已提交
51 52
  },
  [obproxyComponent]: {
R
Rongfeng Fu 已提交
53
    name: 'OBProxy',
R
Rongfeng Fu 已提交
54
    showComponentName: 'OBProxy',
R
Rongfeng Fu 已提交
55 56 57 58
    type: intl.formatMessage({
      id: 'OBD.pages.constants.Proxy',
      defaultMessage: '代理',
    }),
R
Rongfeng Fu 已提交
59
    componentKey: obproxyComponent,
R
Rongfeng Fu 已提交
60 61 62 63
    labelName: intl.formatMessage({
      id: 'OBD.pages.constants.ObproxyParameterName',
      defaultMessage: 'OBProxy 参数名称',
    }),
R
Rongfeng Fu 已提交
64 65
  },
  [obagentComponent]: {
R
Rongfeng Fu 已提交
66
    name: 'OBAgent',
R
Rongfeng Fu 已提交
67
    showComponentName: 'OBAgent',
R
Rongfeng Fu 已提交
68 69 70 71
    type: intl.formatMessage({
      id: 'OBD.pages.constants.Tools',
      defaultMessage: '工具',
    }),
R
Rongfeng Fu 已提交
72
    componentKey: obagentComponent,
R
Rongfeng Fu 已提交
73 74 75 76
    labelName: intl.formatMessage({
      id: 'OBD.pages.constants.ObagentParameterName',
      defaultMessage: 'OBAgent 参数名称',
    }),
R
Rongfeng Fu 已提交
77 78
  },
  [ocpexpressComponent]: {
R
Rongfeng Fu 已提交
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
    name: 'OCP Express',
    showComponentName: 'OCP Express',
    type: intl.formatMessage({
      id: 'OBD.pages.constants.Tools',
      defaultMessage: '工具',
    }),
    componentKey: ocpexpressComponentKey,
    labelName: intl.formatMessage({
      id: 'OBD.pages.constants.OcpExpressParameterName',
      defaultMessage: 'OCP Express 参数名称',
    }),
  },
  [ocpexpressComponentKey]: {
    name: 'OCP Express',
    showComponentName: 'OCP Express',
    type: intl.formatMessage({
      id: 'OBD.pages.constants.Tools',
      defaultMessage: '工具',
    }),
R
Rongfeng Fu 已提交
98
    componentKey: ocpexpressComponentKey,
R
Rongfeng Fu 已提交
99 100 101 102
    labelName: intl.formatMessage({
      id: 'OBD.pages.constants.OcpExpressParameterName',
      defaultMessage: 'OCP Express 参数名称',
    }),
R
Rongfeng Fu 已提交
103 104 105 106
  },
};

export const modeConfig = {
R
Rongfeng Fu 已提交
107 108 109 110 111 112 113 114
  PRODUCTION: intl.formatMessage({
    id: 'OBD.pages.constants.MaximumOccupancy',
    defaultMessage: '最大占用',
  }),
  DEMO: intl.formatMessage({
    id: 'OBD.pages.constants.MinimumAvailability',
    defaultMessage: '最小可用',
  }),
R
Rongfeng Fu 已提交
115 116 117 118 119 120
};

export const pathReg = /^\/[0-9a-zA-Z~@%^_+=(){}\[\]:,.?/\/]+$/;

export const pathRule = {
  pattern: pathReg,
R
Rongfeng Fu 已提交
121 122 123 124 125
  message: intl.formatMessage({
    id: 'OBD.pages.constants.AnAbsolutePathThatStarts',
    defaultMessage:
      '以 “/” 开头的绝对路径,只能包含字母、数字和特殊字符(~@%^_+=(){}[]:,./)',
  }),
R
Rongfeng Fu 已提交
126
};