| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427 |
- import Layout from '@/layouts/RouterView'
- import { setupKeys, hasServices } from '@/utils/auth'
- import i18n from '@/locales'
- import store from '@/store'
- import { isScopedPolicyMenuHidden } from '@/utils/scopedPolicy'
- const Overview = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/overview')
- const CommonalertsIndex = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/commonalert')
- const commonalertsCreate = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/commonalert/create')
- const commonalertsUpdate = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/commonalert/update')
- const commonalertsClone = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/commonalert/clone')
- // const MonitorresourcesIndex = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/monitorresource')
- const AlertresourceIndex = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/alertresource')
- const AlertrecordIndex = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/alertrecord')
- const Explorer = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/explorer')
- const Dashboard = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/dashboard')
- const MonitorDashboardChartCreate = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/dashboard/create')
- const AlertRecordShieldsIndex = () => import(/* webpackChunkName: "monitor" */ /* webpackPrefetch: true */ '@Monitor/views/alertrecordshields')
- const Notification = () => import(/* webpackChunkName: "iam" */ /* webpackPrefetch: true */ '@IAM/views/notification')
- const NotifyTopic = () => import(/* webpackChunkName: "iam" */ /* webpackPrefetch: true */ '@IAM/views/notify-topic')
- const Robots = () => import(/* webpackChunkName: "iam" */ /* webpackPrefetch: true */ '@IAM/views/robots')
- const NotifyConfigs = () => import(/* webpackChunkName: "iam" */ /* webpackPrefetch: true */ '@IAM/views/notifyconfig')
- const NotifyConfigCreate = () => import(/* webpackChunkName: "iam" */ /* webpackPrefetch: true */ '@IAM/views/notifyconfig/create')
- const Contact = () => import(/* webpackChunkName: "iam" */ /* webpackPrefetch: true */ '@IAM/views/contact')
- export default {
- index: 65,
- meta: {
- label: i18n.t('monitor.text_0'),
- icon: 'menu-monitor',
- },
- menus: [
- {
- path: '/monitoroverview',
- meta: {
- label: i18n.t('monitor.text_18'),
- permission: 'commonalerts_list',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.monitoroverview')) {
- return true
- }
- return !setupKeys.hasVersionedSetupKey({ '3.0': ['monitor'] }, true)
- },
- },
- component: Overview,
- },
- // {
- // meta: {
- // label: i18n.t('monitor.monitorresources'),
- // t: 'dictionary.monitorresources',
- // },
- // submenus: [
- // {
- // path: '/monitorresources-guest',
- // meta: {
- // label: i18n.t('common.server'),
- // permission: 'monitorresources_list',
- // hidden: () => {
- // if (isScopedPolicyMenuHidden('sub_hidden_menus.monitorresources_guest')) {
- // return true
- // }
- // return process.env.VUE_APP_IS_PRIVATE ? !setupKeys.hasVersionedSetupKey({
- // '3.0': ['monitor'],
- // default: ['onestack', 'openstack', 'dstack', 'zstack', 'public', 'vmware', 'hcso', 'hcs'],
- // }) : false
- // },
- // },
- // component: Layout,
- // children: [
- // {
- // name: 'MonitorresourcesGuest',
- // path: '',
- // props: { res_type: 'guest' },
- // component: MonitorresourcesIndex,
- // },
- // ],
- // },
- // {
- // path: '/monitorresources-host',
- // meta: {
- // label: i18n.t('dictionary.host'),
- // permission: 'monitorresources_list',
- // hidden: () => {
- // if (isScopedPolicyMenuHidden('sub_hidden_menus.monitorresources_host')) {
- // return true
- // }
- // if (!(store.getters.isAdminMode || store.getters.isDomainMode)) {
- // return true
- // }
- // return process.env.VUE_APP_IS_PRIVATE ? !setupKeys.hasVersionedSetupKey({
- // '3.0': ['monitor'],
- // default: ['onestack', 'openstack', 'dstack', 'zstack', 'public', 'vmware', 'hcso', 'hcs'],
- // }) : false
- // },
- // },
- // component: Layout,
- // children: [
- // {
- // name: 'MonitorresourcesHost',
- // path: '',
- // props: { res_type: 'host' },
- // component: MonitorresourcesIndex,
- // },
- // ],
- // },
- // ],
- // },
- {
- meta: {
- label: i18n.t('monitor.monitor_metric'),
- t: 'dictionary.monitor_metrics',
- },
- submenus: [
- {
- name: 'Query',
- meta: {
- label: i18n.t('monitor.dashboard.title'),
- permission: 'unifiedmonitors_get',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.monitor_dashboard')) {
- return true
- }
- return process.env.VUE_APP_IS_PRIVATE ? !setupKeys.hasVersionedSetupKey({
- '3.0': ['monitor'],
- default: ['onestack', 'openstack', 'dstack', 'zstack', 'public', 'vmware', 'hcso', 'hcs'],
- }) : false
- },
- },
- path: '/monitor-dashboard',
- component: Layout,
- children: [
- {
- name: 'MonitorDashboard',
- path: '',
- component: Dashboard,
- },
- {
- name: 'MonitorDashboardChartCreate',
- path: 'create',
- component: MonitorDashboardChartCreate,
- },
- {
- name: 'MonitorDashboardChartUpdate',
- path: ':id/update',
- component: MonitorDashboardChartCreate,
- },
- ],
- },
- {
- name: 'Query',
- meta: {
- label: i18n.t('monitor.text_119'),
- permission: 'unifiedmonitors_get',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.explorer')) {
- return true
- }
- return process.env.VUE_APP_IS_PRIVATE ? !setupKeys.hasVersionedSetupKey({
- '3.0': ['monitor'],
- default: ['onestack', 'openstack', 'dstack', 'zstack', 'public', 'vmware', 'hcso', 'hcs'],
- }) : false
- },
- },
- path: '/explorer',
- component: Explorer,
- },
- ],
- },
- {
- meta: {
- label: i18n.t('monitor.text_1'),
- t: 'dictionary.monitor_commonalert',
- },
- submenus: [
- {
- path: '/commonalerts',
- meta: {
- label: i18n.t('monitor.text_2'),
- t: 'dictionary.commonalert',
- permission: 'commonalerts_list',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.commonalerts')) {
- return true
- }
- return process.env.VUE_APP_IS_PRIVATE ? !setupKeys.hasVersionedSetupKey({
- '3.0': ['monitor'],
- default: ['onestack', 'openstack', 'dstack', 'zstack', 'public', 'vmware', 'hcso', 'hcs'],
- }) : false
- },
- },
- component: Layout,
- children: [
- {
- name: 'CommonalertsIndex',
- path: '',
- component: CommonalertsIndex,
- meta: {
- key: '/commonalerts',
- keepAlive: true,
- keepAliveViews: ['CommonalertUpdate'],
- },
- },
- {
- name: 'CommonalertCreate',
- path: 'create',
- component: commonalertsCreate,
- },
- {
- name: 'CommonalertUpdate',
- path: ':id/update',
- component: commonalertsUpdate,
- },
- {
- name: 'CommonalertClone',
- path: ':id/clone',
- component: commonalertsClone,
- },
- ],
- },
- {
- path: '/alertresource',
- meta: {
- label: i18n.t('monitor.text_17'),
- // t: 'dictionary.alertresource',
- permission: 'alertresources_list',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.alertresource')) {
- return true
- }
- if (!store.getters.isAdminMode) return true
- return !setupKeys.hasVersionedSetupKey({ '3.0': ['monitor'] }, !(!store.getters.isAdminMode && process.env.VUE_APP_IS_PRIVATE))
- },
- },
- component: Layout,
- children: [
- {
- name: 'alertresourceIndex',
- path: '',
- component: AlertresourceIndex,
- },
- ],
- },
- {
- path: '/alertrecord',
- meta: {
- label: i18n.t('dictionary.alertrecord'),
- permission: 'alertrecords_list,monitorresourcealerts_list',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.alertrecord')) {
- return true
- }
- return !setupKeys.hasVersionedSetupKey({
- '3.0': ['monitor'],
- })
- },
- },
- component: Layout,
- children: [
- {
- name: 'AlertrecordIndex',
- path: '',
- component: AlertrecordIndex,
- },
- ],
- },
- {
- path: '/monitorresourcealerts',
- meta: {
- label: i18n.t('monitor.text_2'),
- t: 'dictionary.monitorresourcealerts',
- permission: 'alertrecordshields_list',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.commonalerts')) {
- return true
- }
- return process.env.VUE_APP_IS_PRIVATE ? !setupKeys.hasVersionedSetupKey({
- '3.0': ['monitor'],
- default: ['onestack', 'openstack', 'dstack', 'zstack', 'public', 'vmware', 'huaweicloudstack'],
- }) : false
- },
- },
- component: Layout,
- children: [
- {
- name: 'AlertRecordShieldsIndex',
- path: '',
- component: AlertRecordShieldsIndex,
- },
- ],
- },
- ],
- },
- {
- meta: {
- label: i18n.t('system.text_564'),
- },
- submenus: [
- {
- path: '/notification',
- meta: {
- label: i18n.t('system.text_16'),
- permission: 'notifications_list',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.notification')) {
- return true
- }
- return !hasServices('notify')
- },
- t: 'dictionary.webconsole',
- },
- component: Layout,
- children: [
- {
- name: 'Notification',
- path: '',
- component: Notification,
- },
- ],
- },
- {
- path: '/notify-topic',
- meta: {
- label: i18n.t('dictionary.notify-topic'),
- permission: 'topics_list',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.notify_topic')) {
- return true
- }
- if (!(store.getters.isAdminMode || store.getters.isDomainMode)) {
- return true
- }
- return !hasServices('notify')
- },
- t: 'dictionary.notify-topic',
- },
- component: Layout,
- children: [
- {
- name: 'NotifyTopic',
- path: '',
- component: NotifyTopic,
- },
- ],
- },
- {
- path: '/notifyconfig',
- meta: {
- label: i18n.t('system.text_19'),
- permission: 'notifyconfigs_list',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.notifyconfig')) {
- return true
- }
- if (!(store.getters.isAdminMode || store.getters.isDomainMode)) {
- return true
- }
- return !hasServices('notify')
- },
- },
- component: Layout,
- children: [
- {
- name: 'NotifyConfig',
- path: '',
- component: NotifyConfigs,
- },
- {
- name: 'NotifyConfigCreate',
- path: 'create',
- component: NotifyConfigCreate,
- },
- ],
- },
- {
- path: '/contact',
- meta: {
- label: i18n.t('common_27'),
- permission: 'contacts_list',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.contact')) {
- return true
- }
- return !store.getters.isAdminMode && !store.getters.isDomainMode
- },
- },
- component: Layout,
- children: [
- {
- name: 'Contact',
- path: '',
- component: Contact,
- },
- ],
- },
- {
- path: '/robot',
- meta: {
- label: i18n.t('system.robot_manage'),
- permission: 'robots_list',
- hidden: () => {
- if (isScopedPolicyMenuHidden('sub_hidden_menus.robot')) {
- return true
- }
- return false
- },
- },
- component: Layout,
- children: [
- {
- name: 'Robots',
- path: '',
- component: Robots,
- },
- ],
- },
- ],
- },
- ],
- }
|