menu.js 5.8 KB
Newer Older
L
ligang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import i18n from '@/module/i18n'
19
import config from '~/external/config'
G
gongzijian 已提交
20
import Permissions from '@/module/permissions'
21

22
const menu = {
L
ligang 已提交
23 24
  projects: [
    {
G
i18n  
gongzijian 已提交
25
      name: `${i18n.$t('Project Home')}`,
26
      id: 0,
L
ligang 已提交
27 28
      path: 'projects-index',
      isOpen: true,
29
      enabled: true,
30
      icon: 'ri-home-4-line',
L
ligang 已提交
31 32 33
      children: []
    },
    {
L
LiemLin 已提交
34
      name: `${i18n.$t('Kinship')}`,
35
      id: 1,
L
LiemLin 已提交
36 37
      path: 'projects-kinship',
      isOpen: true,
38
      enabled: true,
39
      icon: 'ri-node-tree',
L
LiemLin 已提交
40 41 42 43 44
      children: []
    },
    {
      name: `${i18n.$t('Process')}`,
      id: 2,
L
ligang 已提交
45 46
      path: '',
      isOpen: true,
47
      enabled: true,
48
      icon: 'el-icon-s-tools',
L
ligang 已提交
49 50
      children: [
        {
G
i18n  
gongzijian 已提交
51
          name: `${i18n.$t('Process definition')}`,
L
ligang 已提交
52
          path: 'definition',
53
          id: 0,
54
          enabled: true
L
ligang 已提交
55 56
        },
        {
G
i18n  
gongzijian 已提交
57
          name: `${i18n.$t('Process Instance')}`,
L
ligang 已提交
58
          path: 'instance',
59
          id: 1,
60
          enabled: true
L
ligang 已提交
61 62
        },
        {
G
i18n  
gongzijian 已提交
63
          name: `${i18n.$t('Task Instance')}`,
64
          path: 'task-instance',
65
          id: 2,
66
          enabled: true
G
i18n  
gongzijian 已提交
67 68 69
        },
        {
          name: `${i18n.$t('Task record')}`,
70
          path: 'task-record',
71
          id: 3,
72
          enabled: config.recordSwitch
73 74 75 76
        },
        {
          name: `${i18n.$t('History task record')}`,
          path: 'history-task-record',
77
          id: 4,
78
          enabled: config.recordSwitch
L
ligang 已提交
79 80 81 82 83 84 85
        }
      ]
    }
  ],

  security: [
    {
G
gongzijian 已提交
86
      name: `${i18n.$t('Tenant Manage')}`,
87
      id: 0,
L
ligang 已提交
88 89
      path: 'tenement-manage',
      isOpen: true,
90
      enabled: true,
91
      icon: 'el-icon-user-solid',
L
ligang 已提交
92 93 94
      children: []
    },
    {
G
gongzijian 已提交
95
      name: `${i18n.$t('User Manage')}`,
L
ligang 已提交
96 97 98
      id: 1,
      path: 'users-manage',
      isOpen: true,
99
      enabled: true,
100
      icon: 'el-icon-user-solid',
L
ligang 已提交
101 102 103
      children: []
    },
    {
G
gongzijian 已提交
104
      name: `${i18n.$t('Warning group manage')}`,
105
      id: 2,
L
ligang 已提交
106 107
      path: 'warning-groups-manage',
      isOpen: true,
108
      enabled: true,
109
      icon: 'el-icon-warning',
L
ligang 已提交
110 111
      children: []
    },
B
break60 已提交
112 113 114 115 116 117 118 119 120
    {
      name: `${i18n.$t('Warning instance manage')}`,
      id: 2,
      path: 'warning-instance-manage',
      isOpen: true,
      enabled: true,
      icon: 'ri-spam-fill',
      children: []
    },
G
gongzijian 已提交
121
    {
B
fix  
break60 已提交
122 123 124
      name: `${i18n.$t('Worker group manage')}`,
      id: 4,
      path: 'worker-groups-manage',
G
gongzijian 已提交
125
      isOpen: true,
126
      enabled: true,
127
      icon: 'el-icon-s-custom',
G
gongzijian 已提交
128
      children: []
G
gongzijian 已提交
129
    },
B
break60 已提交
130
    {
B
fix  
break60 已提交
131 132 133
      name: `${i18n.$t('Queue manage')}`,
      id: 3,
      path: 'queue-manage',
B
break60 已提交
134
      isOpen: true,
135
      enabled: true,
136
      icon: 'ri-group-line',
B
break60 已提交
137 138
      children: []
    },
G
gongzijian 已提交
139
    {
G
gongzijian 已提交
140
      name: `${i18n.$t('Token manage')}`,
G
gongzijian 已提交
141 142 143
      id: 2,
      path: 'token-manage',
      isOpen: true,
144
      icon: 'el-icon-document',
G
gongzijian 已提交
145
      children: [],
146
      enabled: true
L
ligang 已提交
147 148 149 150
    }
  ],
  resource: [
    {
G
gongzijian 已提交
151
      name: `${i18n.$t('File Manage')}`,
152
      id: 0,
L
ligang 已提交
153 154
      path: 'file',
      isOpen: true,
155
      icon: 'el-icon-document-copy',
L
ligang 已提交
156
      children: [],
157
      enabled: true
L
ligang 已提交
158 159
    },
    {
G
gongzijian 已提交
160
      name: `${i18n.$t('UDF manage')}`,
L
ligang 已提交
161 162 163
      id: 1,
      path: '',
      isOpen: true,
164
      icon: 'el-icon-document',
165
      enabled: true,
L
ligang 已提交
166 167
      children: [
        {
G
gongzijian 已提交
168
          name: `${i18n.$t('Resource manage')}`,
B
break60 已提交
169
          path: 'resource-udf',
170
          id: 0,
171
          enabled: true
L
ligang 已提交
172 173
        },
        {
G
gongzijian 已提交
174
          name: `${i18n.$t('Function manage')}`,
B
break60 已提交
175
          path: 'resource-func',
176
          id: 1,
177
          enabled: true
L
ligang 已提交
178 179 180 181 182 183
        }
      ]
    }
  ],
  user: [
    {
G
i18n  
gongzijian 已提交
184
      name: `${i18n.$t('User Information')}`,
185
      id: 0,
L
ligang 已提交
186 187
      path: 'account',
      isOpen: true,
188
      icon: 'el-icon-user-solid',
L
ligang 已提交
189
      children: [],
190
      enabled: true
L
ligang 已提交
191 192
    },
    {
G
i18n  
gongzijian 已提交
193
      name: `${i18n.$t('Edit password')}`,
L
ligang 已提交
194 195 196
      id: 1,
      path: 'password',
      isOpen: true,
197
      icon: 'el-icon-key',
L
ligang 已提交
198
      children: [],
199
      enabled: true
200 201
    },
    {
G
gongzijian 已提交
202
      name: `${i18n.$t('Token manage')}`,
203 204 205
      id: 2,
      path: 'token',
      isOpen: true,
206
      icon: 'el-icon-s-custom',
207
      children: [],
208
      enabled: Permissions.getAuth()
L
ligang 已提交
209
    }
210 211 212 213
  ],
  monitor: [
    {
      name: `${i18n.$t('Servers manage')}`,
214
      id: 1,
215 216
      path: '',
      isOpen: true,
217
      enabled: true,
218
      icon: 'el-icon-menu',
219 220 221 222 223
      children: [
        {
          name: 'Master',
          path: 'servers-master',
          id: 0,
224
          enabled: true
225 226 227 228 229
        },
        {
          name: 'Worker',
          path: 'servers-worker',
          id: 1,
230
          enabled: true
231 232 233 234 235
        },
        {
          name: 'Zookeeper',
          path: 'servers-zookeeper',
          id: 4,
236
          enabled: true
237 238
        },
        {
239 240
          name: 'DB',
          path: 'servers-db',
241
          id: 6,
242
          enabled: true
243 244
        }
      ]
245 246 247 248 249 250
    },
    {
      name: `${i18n.$t('Statistics manage')}`,
      id: 0,
      path: '',
      isOpen: true,
251
      enabled: true,
252
      icon: 'el-icon-menu',
253 254
      children: [
        {
255
          name: 'Statistics',
256 257
          path: 'statistics',
          id: 0,
258
          enabled: true
259 260
        }
      ]
261
    }
L
ligang 已提交
262 263 264 265
  ]
}

export default type => menu[type]