├── .babelrc ├── .editorconfig ├── .env.local.example ├── .env.local.https.example ├── .env.primate-qa ├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ ├── smoke_test_plan.md │ └── test_full_plan.md ├── .gitignore ├── .license.header ├── .prettierrc ├── .travis.yml ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── README.md ├── babel.config.js ├── docs ├── customize.md ├── development.md └── screenshot-dashboard.png ├── jest.config.js ├── jsconfig.json ├── nginx └── default.conf ├── package-lock.json ├── package.json ├── packaging ├── centos │ └── primate.spec ├── debian │ ├── changelog │ ├── cloudstack-primate.install │ ├── compat │ ├── control │ ├── copyright │ └── rules └── package.sh ├── public ├── assets │ ├── 403.png │ ├── 404.png │ ├── 500.png │ ├── banner.svg │ ├── bg-what-is-cloudstack.png │ ├── error.png │ ├── logo.svg │ └── success.png ├── cloud.ico ├── color.less ├── config.json ├── example.html ├── index.html └── locales │ ├── ar.json │ ├── ca.json │ ├── de_DE.json │ ├── en.json │ ├── es.json │ ├── fr_FR.json │ ├── hi.json │ ├── hu.json │ ├── it_IT.json │ ├── ja_JP.json │ ├── ko_KR.json │ ├── nb_NO.json │ ├── nl_NL.json │ ├── pl.json │ ├── pt_BR.json │ ├── ru_RU.json │ └── zh_CN.json ├── src ├── App.vue ├── api │ └── index.js ├── assets │ └── icons │ │ ├── cloudian.svg │ │ ├── debian.svg │ │ └── kubernetes.svg ├── components │ ├── CheckBoxSelectPair.vue │ ├── header │ │ ├── HeaderNotice.vue │ │ ├── Logo.vue │ │ ├── ProjectMenu.vue │ │ ├── SamlDomainSwitcher.vue │ │ ├── TranslationMenu.vue │ │ └── UserMenu.vue │ ├── menu │ │ ├── SideMenu.vue │ │ ├── index.js │ │ ├── menu.js │ │ └── menu.render.js │ ├── multitab │ │ ├── MultiTab.vue │ │ ├── index.js │ │ └── index.less │ ├── page │ │ ├── GlobalFooter.vue │ │ ├── GlobalHeader.vue │ │ ├── GlobalLayout.vue │ │ ├── PageHeader.vue │ │ ├── PageLayout.vue │ │ └── SHeaderNotice.vue │ ├── view │ │ ├── ActionButton.vue │ │ ├── DedicateData.vue │ │ ├── DedicateDomain.vue │ │ ├── DedicateModal.vue │ │ ├── DetailSettings.vue │ │ ├── DetailsTab.vue │ │ ├── FormView.vue │ │ ├── InfoCard.vue │ │ ├── ListResourceTable.vue │ │ ├── ListView.vue │ │ ├── QuickView.vue │ │ ├── ResourceCountUsage.vue │ │ ├── ResourceLimitTab.vue │ │ ├── ResourceView.vue │ │ ├── SearchView.vue │ │ ├── SettingsTab.vue │ │ ├── TreeView.vue │ │ └── VmwareData.vue │ └── widgets │ │ ├── Breadcrumb.vue │ │ ├── ChartCard.vue │ │ ├── Console.vue │ │ ├── OsLogo.vue │ │ └── Status.vue ├── config │ ├── eventBus.js │ ├── router.js │ ├── section │ │ ├── account.js │ │ ├── compute.js │ │ ├── config.js │ │ ├── domain.js │ │ ├── event.js │ │ ├── image.js │ │ ├── infra.js │ │ ├── infra │ │ │ ├── clusters.js │ │ │ ├── hosts.js │ │ │ ├── ilbvms.js │ │ │ ├── nsp.js │ │ │ ├── phynetworks.js │ │ │ ├── pods.js │ │ │ ├── primaryStorages.js │ │ │ ├── routers.js │ │ │ ├── secondaryStorages.js │ │ │ ├── systemVms.js │ │ │ └── zones.js │ │ ├── network.js │ │ ├── offering.js │ │ ├── plugin │ │ │ ├── cloudian.js │ │ │ └── quota.js │ │ ├── project.js │ │ ├── role.js │ │ ├── storage.js │ │ └── user.js │ └── settings.js ├── core │ ├── bootstrap.js │ ├── ext.js │ ├── lazy_lib │ │ └── components_use.js │ ├── lazy_use.js │ └── use.js ├── layouts │ ├── BasicLayout.vue │ ├── BlankLayout.vue │ ├── PageView.vue │ ├── ResourceLayout.vue │ ├── RouteView.vue │ ├── UserLayout.vue │ └── index.js ├── locales │ └── index.js ├── main.js ├── permission.js ├── router │ └── index.js ├── store │ ├── getters.js │ ├── index.js │ ├── modules │ │ ├── app.js │ │ ├── permission.js │ │ └── user.js │ └── mutation-types.js ├── style │ ├── README.md │ ├── ant-overwrite │ │ ├── ant-form.less │ │ ├── ant-layout-header.less │ │ └── ant-progress.less │ ├── common │ │ └── common.less │ ├── component │ │ └── dashboard.less │ ├── frame │ │ ├── content.less │ │ ├── search.less │ │ ├── sider.less │ │ └── top-menu.less │ ├── index.less │ ├── layout │ │ ├── ant.less │ │ └── inverted-mode.less │ ├── objects │ │ └── table.less │ ├── variables │ │ └── prefixes.less │ └── vars.less ├── utils │ ├── auth.js │ ├── axios.js │ ├── device.js │ ├── domUtil.js │ ├── filter.js │ ├── helper │ │ └── permission.js │ ├── icons.js │ ├── mixin.js │ ├── permissions.js │ ├── plugins.js │ ├── request.js │ ├── sort.js │ ├── storage.js │ ├── timezone │ │ ├── index.js │ │ └── timezone.json │ └── util.js └── views │ ├── AutogenView.vue │ ├── auth │ └── Login.vue │ ├── compute │ ├── AssignInstance.vue │ ├── AttachIso.vue │ ├── BackupScheduleWizard.vue │ ├── ChangeAffinity.vue │ ├── CreateKubernetesCluster.vue │ ├── CreateSSHKeyPair.vue │ ├── CreateSnapshotWizard.vue │ ├── DeployVM.vue │ ├── DestroyVM.vue │ ├── InstanceTab.vue │ ├── KubernetesServiceTab.vue │ ├── MigrateWizard.vue │ ├── ScaleKubernetesCluster.vue │ ├── ScaleVM.vue │ ├── StartVirtualMachine.vue │ ├── UpgradeKubernetesCluster.vue │ ├── backup │ │ ├── BackupSchedule.vue │ │ └── FormSchedule.vue │ └── wizard │ │ ├── AffinityGroupSelection.vue │ │ ├── ComputeOfferingSelection.vue │ │ ├── ComputeSelection.vue │ │ ├── DiskOfferingSelection.vue │ │ ├── DiskSizeSelection.vue │ │ ├── MultiDiskSelection.vue │ │ ├── NetworkConfiguration.vue │ │ ├── NetworkSelection.vue │ │ ├── SecurityGroupSelection.vue │ │ ├── SshKeyPairSelection.vue │ │ ├── TemplateIsoRadioGroup.vue │ │ └── TemplateIsoSelection.vue │ ├── dashboard │ ├── CapacityDashboard.vue │ ├── Dashboard.vue │ ├── OnboardingDashboard.vue │ ├── UsageDashboard.vue │ └── UsageDashboardChart.vue │ ├── exception │ ├── 403.vue │ ├── 404.vue │ ├── 500.vue │ ├── ExceptionPage.vue │ └── type.js │ ├── iam │ ├── AddAccount.vue │ ├── AddLdapAccount.vue │ ├── AddUser.vue │ ├── ChangeUserPassword.vue │ ├── ConfigureSamlSsoAuth.vue │ ├── CreateRole.vue │ ├── DomainActionForm.vue │ ├── DomainView.vue │ ├── EditUser.vue │ ├── ImportRole.vue │ ├── PermissionEditable.vue │ ├── RolePermissionTab.vue │ ├── RuleDelete.vue │ └── SSLCertificateTab.vue │ ├── image │ ├── AddKubernetesSupportedVersion.vue │ ├── IsoZones.vue │ ├── RegisterOrUploadIso.vue │ ├── RegisterOrUploadTemplate.vue │ ├── TemplateZones.vue │ ├── UpdateKubernetesSupportedVersion.vue │ ├── UpdateTemplateIsoPermissions.vue │ ├── UploadLocalIso.vue │ └── UploadLocalTemplate.vue │ ├── infra │ ├── AddPrimaryStorage.vue │ ├── AddSecondaryStorage.vue │ ├── ClusterAdd.vue │ ├── CpuSockets.vue │ ├── HostAdd.vue │ ├── HostInfo.vue │ ├── InfraSummary.vue │ ├── MigrateData.vue │ ├── PodAdd.vue │ ├── Resources.vue │ ├── network │ │ ├── DedicatedVLANTab.vue │ │ ├── EditTrafficLabel.vue │ │ ├── IpRangesTab.vue │ │ ├── IpRangesTabGuest.vue │ │ ├── IpRangesTabManagement.vue │ │ ├── IpRangesTabPublic.vue │ │ ├── IpRangesTabStorage.vue │ │ ├── ServiceProvidersTab.vue │ │ ├── TrafficTypesTab.vue │ │ └── providers │ │ │ ├── AddF5LoadBalancer.vue │ │ │ ├── AddNetscalerLoadBalancer.vue │ │ │ ├── AddNiciraNvpDevice.vue │ │ │ ├── AddPaloAltoFirewall.vue │ │ │ ├── AddSrxFirewall.vue │ │ │ ├── ProviderDetail.vue │ │ │ ├── ProviderItem.vue │ │ │ └── ProviderListView.vue │ ├── routers │ │ └── RouterHealthCheck.vue │ └── zone │ │ ├── AdvancedGuestTrafficForm.vue │ │ ├── IpAddressRangeForm.vue │ │ ├── PhysicalNetworksTab.vue │ │ ├── StaticInputsForm.vue │ │ ├── SystemVmsTab.vue │ │ ├── ZoneWizard.vue │ │ ├── ZoneWizardAddResources.vue │ │ ├── ZoneWizardLaunchZone.vue │ │ ├── ZoneWizardNetworkSetupStep.vue │ │ ├── ZoneWizardPhysicalNetworkSetupStep.vue │ │ ├── ZoneWizardZoneDetailsStep.vue │ │ └── ZoneWizardZoneTypeStep.vue │ ├── network │ ├── AclListRulesTab.vue │ ├── CreateIsolatedNetworkForm.vue │ ├── CreateL2NetworkForm.vue │ ├── CreateNetwork.vue │ ├── CreateSharedNetworkForm.vue │ ├── CreateVpc.vue │ ├── CreateVpnCustomerGateway.vue │ ├── EgressRulesTab.vue │ ├── EnableStaticNat.vue │ ├── FirewallRules.vue │ ├── IngressEgressRuleConfigure.vue │ ├── InternalLBAssignVmForm.vue │ ├── InternalLBAssignedVmTab.vue │ ├── IpAddressesTab.vue │ ├── LoadBalancing.vue │ ├── NicsTable.vue │ ├── PortForwarding.vue │ ├── PublicIpResource.vue │ ├── RoutersTab.vue │ ├── StaticRoutesTab.vue │ ├── VpcTab.vue │ ├── VpcTiersTab.vue │ └── VpnDetails.vue │ ├── offering │ ├── AddComputeOffering.vue │ ├── AddDiskOffering.vue │ ├── AddNetworkOffering.vue │ ├── AddVpcOffering.vue │ ├── ImportBackupOffering.vue │ └── UpdateOfferingAccess.vue │ ├── plugins │ ├── CloudianPlugin.vue │ ├── IFramePlugin.vue │ └── quota │ │ ├── EditTariffValueWizard.vue │ │ ├── EmailTemplateDetails.vue │ │ ├── QuotaBalance.vue │ │ ├── QuotaSummary.vue │ │ ├── QuotaSummaryResource.vue │ │ ├── QuotaTariff.vue │ │ └── QuotaUsage.vue │ ├── project │ ├── AccountsTab.vue │ ├── AddAccountOrUserToProject.vue │ ├── InvitationTokenTemplate.vue │ ├── InvitationsTemplate.vue │ ├── ProjectDetailsTab.vue │ └── iam │ │ ├── ProjectRolePermissionTab.vue │ │ └── ProjectRoleTab.vue │ ├── setting │ └── ResourceSettingsTab.vue │ └── storage │ ├── AttachVolume.vue │ ├── CreateSnapshotFromVMSnapshot.vue │ ├── CreateVolume.vue │ ├── FormSchedule.vue │ ├── MigrateVolume.vue │ ├── RecurringSnapshotVolume.vue │ ├── ResizeVolume.vue │ ├── RestoreAttachBackupVolume.vue │ ├── ScheduledSnapshots.vue │ ├── TakeSnapshot.vue │ └── UploadLocalVolume.vue ├── tests ├── .eslintrc.js ├── common │ └── index.js ├── mock │ ├── mockAxios.js │ ├── mockI18n.js │ ├── mockRouter.js │ └── mockStore.js ├── mockData │ ├── ActionButton.mock.json │ ├── AutogenView.mock.json │ ├── MigrateWizard.mock.json │ └── Status.mock.json ├── setup.js └── unit │ ├── components │ ├── view │ │ └── ActionButton.spec.js │ └── widgets │ │ └── Status.spec.js │ └── views │ ├── AutogenView.spec.js │ └── compute │ └── MigrateWizard.spec.js ├── theme.config.js ├── tools ├── api │ ├── apis.old │ ├── apis.primate.sh │ └── apis.remaining ├── docker.sh ├── git-pr └── performrelease.sh ├── vue.config.js └── webstorm.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "test": { 4 | "plugins": ["require-context-hook"] 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | charset=utf-8 3 | end_of_line=lf 4 | insert_final_newline=false 5 | indent_style=space 6 | indent_size=2 7 | 8 | [{*.ng,*.sht,*.html,*.shtm,*.shtml,*.htm}] 9 | indent_style=space 10 | indent_size=2 11 | 12 | [{*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}] 13 | indent_style=space 14 | indent_size=2 15 | 16 | [{.babelrc,.stylelintrc,jest.config,.eslintrc,.prettierrc,*.json,*.jsb3,*.jsb2,*.bowerrc}] 17 | indent_style=space 18 | indent_size=2 19 | 20 | [*.svg] 21 | indent_style=space 22 | indent_size=2 23 | 24 | [*.js.map] 25 | indent_style=space 26 | indent_size=2 27 | 28 | [*.less] 29 | indent_style=space 30 | indent_size=2 31 | 32 | [*.vue] 33 | indent_style=space 34 | indent_size=2 35 | 36 | [{.analysis_options,*.yml,*.yaml}] 37 | indent_style=space 38 | indent_size=2 39 | 40 | -------------------------------------------------------------------------------- /.env.local.example: -------------------------------------------------------------------------------- 1 | CS_URL=http://localhost:8080 2 | -------------------------------------------------------------------------------- /.env.local.https.example: -------------------------------------------------------------------------------- 1 | CS_URL=http://localhost:8080 2 | PUBLIC_HOST=primate.example.com 3 | HTTPS_CERT=/etc/ssl/certs/primate.example.com.pem 4 | HTTPS_KEY=/etc/ssl/private/primate.example.com.key 5 | HTTPS_CA=/etc/ssl/certs/ca.pem 6 | HTTPS_DHPARAM=/etc/ssl/keys/dh2048.pem 7 | ALLOWED_HOSTS=["primate.example.com","cloud.example.com"] 8 | -------------------------------------------------------------------------------- /.env.primate-qa: -------------------------------------------------------------------------------- 1 | CS_URL=http://primate-qa.cloudstack.cloud:8080 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | public/* linguist-vendored -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a bug report to help us improve 4 | title: "[BUG] " 5 | labels: bug 6 | assignees: rhtyd 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 16 | 1. Log in as a User or an Admin 17 | 2. Go to '...' 18 | 3. Click on '....' 19 | 4. Scroll down to '....' 20 | 5. See error 21 | 22 | **Expected behavior** 23 | A clear and concise description of what you expected to happen. 24 | 25 | **Screenshots** 26 | If applicable, add screenshots to help explain your problem. 27 | 28 | **Desktop (please complete the following information):** 29 | - OS: [e.g. Windows, Mac, iOS, Android with device/screen details if applicable] 30 | - Browser [e.g. chrome, safari] 31 | - Version [e.g. 22] 32 | 33 | **Additional context** 34 | Add any other context about the problem here. 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for Primate 4 | title: '[FEATURE] ' 5 | labels: feature 6 | assignees: rhtyd 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /.license.header: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "semi": false, 4 | "singleQuote": true 5 | } 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | language: node_js 19 | node_js: 20 | - 12 21 | cache: 22 | npm: false 23 | script: 24 | - npm run lint && npm run build 25 | - npm run test:unit 26 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Build example: docker build -t apache/cloudstack-primate:latest . 19 | 20 | FROM node:lts-stretch AS build 21 | 22 | MAINTAINER "Apache CloudStack" 23 | LABEL Description="Apache CloudStack Primate; Modern role-base progressive UI for Apache CloudStack" 24 | LABEL Vendor="Apache.org" 25 | LABEL License=ApacheV2 26 | LABEL Version=0.5.0 27 | 28 | WORKDIR /build 29 | 30 | RUN apt-get -y update && apt-get -y upgrade 31 | 32 | COPY . /build/ 33 | RUN npm install 34 | RUN npm run build 35 | 36 | FROM nginx:alpine AS runtime 37 | 38 | LABEL org.opencontainers.image.title="Apache CloudStack Primate" \ 39 | org.opencontainers.image.description="A modern role-based progressive CloudStack UI" \ 40 | org.opencontainers.image.authors="Apache CloudStack Contributors" \ 41 | org.opencontainers.image.url="https://github.com/apache/cloudstack-primate" \ 42 | org.opencontainers.image.documentation="https://github.com/apache/cloudstack-primate/README.md" \ 43 | org.opencontainers.image.source="https://github.com/apache/cloudstack-primate" \ 44 | org.opencontainers.image.vendor="The Apache Software Foundation" \ 45 | org.opencontainers.image.licenses="Apache-2.0" \ 46 | org.opencontainers.image.ref.name="latest" 47 | 48 | COPY --from=build /build/dist/. /usr/share/nginx/html/ 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Codebase has moved and merged with [apache/cloudstack](https://github.com/apache/cloudstack/tree/master/ui), please see: 2 | 3 | https://github.com/apache/cloudstack/pull/4598 4 | https://markmail.org/message/bgnn4xkjnlzseeuv 5 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | const babelConfig = { 19 | presets: [ 20 | '@vue/app' 21 | ], 22 | plugins: [] 23 | // if your use import on Demand, Use this code 24 | // , 25 | // plugins: [ 26 | // [ 'import', { 27 | // 'libraryName': 'ant-design-vue', 28 | // 'libraryDirectory': 'es', 29 | // 'style': true 30 | // } ] 31 | // ] 32 | } 33 | 34 | if (process.env.NODE_ENV === 'test') { 35 | babelConfig.plugins.push('require-context-hook') 36 | } 37 | 38 | module.exports = babelConfig 39 | -------------------------------------------------------------------------------- /docs/screenshot-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cloudstack-primate/350697f77b750658fd44c56bcb196b4f4c69bf81/docs/screenshot-dashboard.png -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | module.exports = { 19 | testURL: 'http://localhost/', 20 | setupFiles: ['/tests/setup.js'], 21 | moduleFileExtensions: [ 22 | 'js', 23 | 'jsx', 24 | 'json', 25 | 'vue' 26 | ], 27 | transform: { 28 | '^.+\\.vue$': 'vue-jest', 29 | '.+\\.(css|styl|less|sass|scss|png|svg|jpg|ttf|woff|woff2)?$': 'jest-transform-stub', 30 | '^.+\\.jsx?$': 'babel-jest' 31 | }, 32 | moduleNameMapper: { 33 | '.+\\.svg?.+$': 'jest-transform-stub', 34 | '^@/(.*)$': '/src/$1', 35 | '^@public/(.*)$': '/public/$1' 36 | }, 37 | snapshotSerializers: [ 38 | 'jest-serializer-vue' 39 | ], 40 | testMatch: [ 41 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' 42 | ], 43 | transformIgnorePatterns: [ 44 | '/node_modules/(?!ant-design-vue|vue)' 45 | ], 46 | collectCoverage: true, 47 | collectCoverageFrom: [ 48 | '/src/**/*.{js,vue}', 49 | '!**/node_modules/**', 50 | '!/src/locales/*.{js, json}' 51 | ], 52 | coverageReporters: ['html', 'text-summary'] 53 | } 54 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "baseUrl": ".", 5 | "paths": { 6 | "@/*": ["src/*"] 7 | } 8 | }, 9 | "exclude": ["node_modules", "dist"], 10 | "include": ["src/**/*"] 11 | } 12 | -------------------------------------------------------------------------------- /nginx/default.conf: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | server { 19 | listen 80; 20 | server_name localhost; 21 | location / { 22 | root /usr/share/nginx/html; 23 | index index.html; 24 | } 25 | location /client/ { 26 | # http://127.0.0.1:8080 should be replaced your CloudStack management 27 | # Server's actual URI 28 | proxy_pass http://127.0.0.1:8080; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packaging/centos/primate.spec: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | %define __os_install_post %{nil} 19 | %global debug_package %{nil} 20 | 21 | Name: cloudstack 22 | Summary: Modern Apache CloudStack UI - Primate 23 | Release: %{_rel} 24 | Version: %{_ver} 25 | License: Apache License, Version 2 26 | Vendor: Apache CloudStack 27 | Packager: Apache CloudStack 28 | Group: System Environment/Libraries 29 | Source0: primate-%{_ver}.tgz 30 | BuildRoot: %{_tmppath}/%{name}-%{release}-build 31 | 32 | %description 33 | Modern Apache CloudStack UI - Primate 34 | 35 | %package primate 36 | Summary: Modern Apache CloudStack UI - Primate 37 | Requires: cloudstack-management >= 4.15.0 38 | Group: System Environment/Libraries 39 | %description primate 40 | Primate - modern role-base progressive UI for Apache CloudStack 41 | 42 | %prep 43 | echo "Starting Primate build..." 44 | 45 | %setup -q -n %{name} 46 | 47 | %build 48 | 49 | echo "Executing npm build..." 50 | rm -fr node_modules 51 | npm install 52 | npm run build 53 | 54 | %install 55 | echo "Installing Primate" 56 | ls -lahi 57 | [ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT} 58 | mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/cloudstack-management/webapp/primate 59 | mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cloudstack/primate 60 | mkdir -p ${RPM_BUILD_ROOT}%{_bindir}/ 61 | 62 | ls 63 | cp -vr dist/* ${RPM_BUILD_ROOT}%{_datadir}/cloudstack-management/webapp/primate/ 64 | # copy config to ${RPM_BUILD_ROOT}%{_sysconfdir}/cloudstack/primate 65 | 66 | %clean 67 | [ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT} 68 | 69 | %preun primate 70 | echo "Running through the pre-uninstall cloudstack-primate" 71 | 72 | %pre primate 73 | echo "Running through pre-install cloudstack-primate" 74 | 75 | %post primate 76 | echo "Running through post-install cloudstack-primate" 77 | 78 | %postun primate 79 | echo "Running through the post-uninstall cloudstack-primate" 80 | 81 | %files primate 82 | %defattr(-,root,root,-) 83 | %{_datadir}/cloudstack-management/webapp/primate/* 84 | %changelog 85 | * Thu Feb 27 2020 Rohit Yadav 0.1.0 86 | - CloudStack Primate RPM 87 | -------------------------------------------------------------------------------- /packaging/debian/changelog: -------------------------------------------------------------------------------- 1 | cloudstack-primate (VERSION) unstable; urgency=low 2 | 3 | * CloudStack Primate version VERSION 4 | 5 | -- Rohit Yadav Thu, 27 Feb 2020 12:00:00 +0530 6 | -------------------------------------------------------------------------------- /packaging/debian/cloudstack-primate.install: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | /usr/share/cloudstack-management/webapp/primate/* 19 | -------------------------------------------------------------------------------- /packaging/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /packaging/debian/control: -------------------------------------------------------------------------------- 1 | Source: cloudstack-primate 2 | Section: libs 3 | Priority: extra 4 | Maintainer: Apache CloudStack 5 | Build-Depends: debhelper (>= 7), npm, nodejs 6 | Standards-Version: 3.8.1 7 | Homepage: https://cloudstack.apache.org/ 8 | 9 | Package: cloudstack-primate 10 | Architecture: all 11 | Depends: cloudstack-management (>= 4.15.0) 12 | Description: CloudStack Primate 13 | The modern CloudStack UI - Primate 14 | -------------------------------------------------------------------------------- /packaging/debian/copyright: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | -------------------------------------------------------------------------------- /packaging/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p') 4 | PACKAGE = $(shell dh_listpackages|head -n 1|cut -d '-' -f 1) 5 | CLOUDSTACK = "cloudstack" 6 | SYSCONFDIR = "/etc" 7 | USRBINDIR = "/usr/bin" 8 | DESTDIR = "debian/tmp" 9 | 10 | # Uncomment this to turn on verbose mode. 11 | export DH_VERBOSE=1 12 | 13 | # This has to be exported to make some magic below work. 14 | export DH_OPTIONS 15 | 16 | configure: configure-stamp 17 | configure-stamp: 18 | dh_testdir 19 | 20 | build: build-indep 21 | 22 | build-indep: build-indep-stamp 23 | 24 | build-indep-stamp: configure 25 | cd .. && npm install && npm run build 26 | touch $@ 27 | 28 | clean: 29 | dh_testdir 30 | dh_testroot 31 | rm -f build-arch-stamp build-indep-stamp 32 | dh_clean 33 | 34 | install: 35 | dh_testdir 36 | dh_testroot 37 | dh_prep -s 38 | 39 | # cloudstack-primate 40 | mkdir -p $(DESTDIR)/usr/share/$(CLOUDSTACK)-management/webapp/primate 41 | cp -vr ../dist/* $(DESTDIR)/usr/share/$(CLOUDSTACK)-management/webapp/primate/ 42 | 43 | dh_installdirs 44 | dh_install 45 | 46 | binary: install 47 | dh_install 48 | dh_installchangelogs 49 | dh_installman 50 | dh_link 51 | dh_strip 52 | dh_compress 53 | dh_fixperms 54 | dh_makeshlibs 55 | dh_installdeb 56 | dh_gencontrol 57 | dh_md5sums 58 | dh_builddeb 59 | -------------------------------------------------------------------------------- /packaging/package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | set -e 20 | set -x 21 | 22 | ROOT=$PWD 23 | 24 | function package_deb() { 25 | sed -i "s/VERSION/$VERSION-$DATE/g" debian/changelog 26 | dpkg-buildpackage -uc -us 27 | $(cd ../; tar czf cloudstack-primate-$VERSION-$DATE.tar.gz dist --transform s/dist/primate/) 28 | } 29 | 30 | function package_rpm() { 31 | CWD=`pwd` 32 | RPMDIR=$CWD/../build 33 | 34 | REALVER=`echo $VERSION` 35 | DEFVER="-D_ver $REALVER" 36 | DEFREL="-D_rel $DATE" 37 | 38 | echo Preparing to package CloudStack Primate ${VERSION} 39 | 40 | mkdir -p $RPMDIR/SPECS 41 | mkdir -p $RPMDIR/BUILD 42 | mkdir -p $RPMDIR/RPMS 43 | mkdir -p $RPMDIR/SRPMS 44 | mkdir -p $RPMDIR/SOURCES/cloudstack 45 | 46 | echo ". preparing source tarball" 47 | (cd ../; tar -c --exclude .git --exclude build . | tar -C $RPMDIR/SOURCES/cloudstack -x ) 48 | (cd $RPMDIR/SOURCES/; tar -czf primate-$VERSION.tgz cloudstack) 49 | 50 | echo ". executing rpmbuild" 51 | cp centos/primate.spec $RPMDIR/SPECS 52 | 53 | (cd $RPMDIR; rpmbuild --define "_topdir $RPMDIR" "${DEFVER}" "${DEFREL}" ${DEFPRE+"${DEFPRE}"} -bb SPECS/primate.spec) 54 | 55 | if [ $? -ne 0 ]; then 56 | echo "RPM Build Failed " 57 | exit 1 58 | else 59 | echo "RPM Build Done" 60 | fi 61 | } 62 | 63 | DATE=$(date +"%Y%m%d") 64 | VERSION=$(grep -Po '"version": "\K[^"]*' ../package.json) 65 | sed -i "s/\"version\":.*/\"version\": \"$VERSION$DATE\",/g" ../package.json 66 | 67 | case "$1" in 68 | deb ) package_deb 69 | ;; 70 | rpm ) package_rpm 71 | ;; 72 | * ) package_rpm 73 | package_deb 74 | ;; 75 | esac 76 | -------------------------------------------------------------------------------- /public/assets/403.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cloudstack-primate/350697f77b750658fd44c56bcb196b4f4c69bf81/public/assets/403.png -------------------------------------------------------------------------------- /public/assets/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cloudstack-primate/350697f77b750658fd44c56bcb196b4f4c69bf81/public/assets/404.png -------------------------------------------------------------------------------- /public/assets/500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cloudstack-primate/350697f77b750658fd44c56bcb196b4f4c69bf81/public/assets/500.png -------------------------------------------------------------------------------- /public/assets/bg-what-is-cloudstack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cloudstack-primate/350697f77b750658fd44c56bcb196b4f4c69bf81/public/assets/bg-what-is-cloudstack.png -------------------------------------------------------------------------------- /public/assets/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cloudstack-primate/350697f77b750658fd44c56bcb196b4f4c69bf81/public/assets/error.png -------------------------------------------------------------------------------- /public/assets/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cloudstack-primate/350697f77b750658fd44c56bcb196b4f4c69bf81/public/assets/success.png -------------------------------------------------------------------------------- /public/cloud.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/cloudstack-primate/350697f77b750658fd44c56bcb196b4f4c69bf81/public/cloud.ico -------------------------------------------------------------------------------- /public/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiBase": "/client/api", 3 | "docBase": "http://docs.cloudstack.apache.org/en/latest", 4 | "appTitle": "CloudStack", 5 | "footer": "Licensed under the Apache License, Version 2.0.", 6 | "logo": "assets/logo.svg", 7 | "banner": "assets/banner.svg", 8 | "error": { 9 | "404": "assets/404.png", 10 | "403": "assets/403.png", 11 | "500": "assets/500.png" 12 | }, 13 | "theme": { 14 | "@logo-background-color": "#ffffff", 15 | "@navigation-background-color": "#ffffff", 16 | "@project-nav-background-color": "#001529", 17 | "@project-nav-text-color": "rgba(255, 255, 255, 0.65)", 18 | "@navigation-text-color": "rgba(0, 0, 0, 0.65)", 19 | "@primary-color": "#1890ff", 20 | "@link-color": "#1890ff", 21 | "@link-hover-color": "#40a9ff", 22 | "@loading-color": "#1890ff", 23 | "@processing-color": "#1890ff", 24 | "@success-color": "#52c41a", 25 | "@warning-color": "#faad14", 26 | "@error-color": "#f5222d", 27 | "@font-size-base": "14px", 28 | "@heading-color": "rgba(0, 0, 0, 0.85)", 29 | "@text-color": "rgba(0, 0, 0, 0.65)", 30 | "@text-color-secondary": "rgba(0, 0, 0, 0.45)", 31 | "@disabled-color": "rgba(0, 0, 0, 0.25)", 32 | "@border-color-base": "#d9d9d9", 33 | "@border-radius-base": "4px", 34 | "@box-shadow-base": "0 2px 8px rgba(0, 0, 0, 0.15)", 35 | "@logo-width": "256px", 36 | "@logo-height": "64px", 37 | "@banner-width": "700px", 38 | "@banner-height": "110px", 39 | "@error-width": "256px", 40 | "@error-height": "256px" 41 | }, 42 | "keyboardOptions": { 43 | "us": "label.standard.us.keyboard", 44 | "uk": "label.uk.keyboard", 45 | "fr": "label.french.azerty.keyboard", 46 | "jp": "label.japanese.keyboard", 47 | "sc": "label.simplified.chinese.keyboard" 48 | }, 49 | "plugins": [] 50 | } 51 | -------------------------------------------------------------------------------- /public/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Example Plugin 8 | 9 | 10 | This is an example iframe plugin, please configure the config.json to remove this in production environment. 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Apache CloudStack 9 | 30 | 31 | 32 | 35 |
36 |
37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 25 | 26 | 44 | 49 | -------------------------------------------------------------------------------- /src/api/index.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import { axios } from '@/utils/request' 19 | 20 | export function api (command, args = {}, method = 'GET', data = {}) { 21 | let params = {} 22 | args.command = command 23 | args.response = 'json' 24 | 25 | if (data) { 26 | params = new URLSearchParams() 27 | Object.entries(data).forEach(([key, value]) => { 28 | params.append(key, value) 29 | }) 30 | } 31 | 32 | return axios({ 33 | params: { 34 | ...args 35 | }, 36 | url: '/', 37 | method, 38 | data: params || {} 39 | }) 40 | } 41 | 42 | export function login (arg) { 43 | const params = new URLSearchParams() 44 | params.append('command', 'login') 45 | params.append('username', arg.username) 46 | params.append('password', arg.password) 47 | params.append('domain', arg.domain) 48 | params.append('response', 'json') 49 | return axios({ 50 | url: '/', 51 | method: 'post', 52 | data: params, 53 | headers: { 54 | 'Content-Type': 'application/x-www-form-urlencoded' 55 | } 56 | }) 57 | } 58 | 59 | export function logout () { 60 | return api('logout') 61 | } 62 | -------------------------------------------------------------------------------- /src/assets/icons/cloudian.svg: -------------------------------------------------------------------------------- 1 | 2 | image/svg+xml 42 | 44 | 53 | 54 | 87 | 88 | -------------------------------------------------------------------------------- /src/components/header/Logo.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 30 | 31 | 51 | 52 | 72 | -------------------------------------------------------------------------------- /src/components/header/TranslationMenu.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 47 | 48 | 87 | 88 | 95 | -------------------------------------------------------------------------------- /src/components/menu/index.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import SMenu from './menu' 19 | export default SMenu 20 | -------------------------------------------------------------------------------- /src/components/multitab/index.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import MultiTab from './MultiTab' 19 | import './index.less' 20 | 21 | export default MultiTab 22 | -------------------------------------------------------------------------------- /src/components/multitab/index.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | @import '../../style/variables/prefixes'; 19 | 20 | @multi-tab-prefix-cls: ~"@{ant-pro-prefix}-multi-tab"; 21 | @multi-tab-wrapper-prefix-cls: ~"@{ant-pro-prefix}-multi-tab-wrapper"; 22 | 23 | .@{multi-tab-prefix-cls} { 24 | margin: -23px -24px 24px -24px; 25 | background: #fff; 26 | } 27 | 28 | .topmenu .@{multi-tab-wrapper-prefix-cls} { 29 | max-width: 1200px; 30 | margin: 0 auto; 31 | } -------------------------------------------------------------------------------- /src/components/page/GlobalFooter.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 33 | 34 | 43 | 44 | 68 | -------------------------------------------------------------------------------- /src/components/page/SHeaderNotice.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 36 | 37 | 66 | 67 | 77 | -------------------------------------------------------------------------------- /src/components/view/QuickView.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 31 | 32 | 86 | -------------------------------------------------------------------------------- /src/components/view/VmwareData.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 36 | 37 | 80 | -------------------------------------------------------------------------------- /src/components/widgets/Console.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 28 | 29 | 44 | -------------------------------------------------------------------------------- /src/config/eventBus.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vue from 'vue' 19 | export default new Vue() 20 | -------------------------------------------------------------------------------- /src/config/section/config.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | export default { 19 | name: 'config', 20 | title: 'label.configuration', 21 | icon: 'setting', 22 | permission: ['listConfigurations'], 23 | children: [ 24 | { 25 | name: 'globalsetting', 26 | title: 'label.global.settings', 27 | icon: 'setting', 28 | permission: ['listConfigurations'], 29 | columns: ['name', 'description', 'category', 'value', 'actions'] 30 | }, 31 | { 32 | name: 'ldapsetting', 33 | title: 'label.ldap.configuration', 34 | icon: 'team', 35 | permission: ['listLdapConfigurations'], 36 | columns: ['hostname', 'port', 'domainid'], 37 | details: ['hostname', 'port', 'domainid'], 38 | actions: [ 39 | { 40 | api: 'addLdapConfiguration', 41 | icon: 'plus', 42 | label: 'label.configure.ldap', 43 | listView: true, 44 | args: [ 45 | 'hostname', 'port', 'domainid' 46 | ] 47 | }, 48 | { 49 | api: 'deleteLdapConfiguration', 50 | icon: 'delete', 51 | label: 'label.remove.ldap', 52 | message: 'message.remove.ldap', 53 | dataView: true, 54 | args: ['hostname'], 55 | mapping: { 56 | hostname: { 57 | value: (record) => { return record.hostname } 58 | } 59 | } 60 | } 61 | ] 62 | }, 63 | { 64 | name: 'hypervisorcapability', 65 | title: 'label.hypervisor.capabilities', 66 | icon: 'database', 67 | permission: ['listHypervisorCapabilities'], 68 | columns: ['hypervisor', 'hypervisorversion', 'maxguestslimit', 'maxhostspercluster'], 69 | details: ['hypervisor', 'hypervisorversion', 'maxguestslimit', 'maxdatavolumeslimit', 'maxhostspercluster', 'securitygroupenabled', 'storagemotionenabled'], 70 | actions: [ 71 | { 72 | api: 'updateHypervisorCapabilities', 73 | icon: 'edit', 74 | label: 'label.edit', 75 | dataView: true, 76 | args: ['maxguestslimit'] 77 | } 78 | ] 79 | } 80 | ] 81 | } 82 | -------------------------------------------------------------------------------- /src/config/section/event.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | export default { 19 | name: 'event', 20 | title: 'label.events', 21 | icon: 'schedule', 22 | docHelp: 'adminguide/events.html', 23 | permission: ['listEvents'], 24 | columns: ['level', 'type', 'state', 'description', 'username', 'account', 'domain', 'created'], 25 | details: ['username', 'id', 'description', 'state', 'level', 'type', 'account', 'domain', 'created'], 26 | searchFilters: ['level', 'domainid', 'account', 'keyword'], 27 | related: [{ 28 | name: 'event', 29 | title: 'label.event.timeline', 30 | param: 'startid' 31 | }], 32 | actions: [ 33 | { 34 | api: 'archiveEvents', 35 | icon: 'book', 36 | label: 'label.archive.events', 37 | message: 'message.confirm.archive.selected.events', 38 | docHelp: 'adminguide/events.html#deleting-and-archiving-events-and-alerts', 39 | dataView: true, 40 | successMessage: 'label.event.archived', 41 | groupAction: true, 42 | groupMap: (selection) => { return [{ ids: selection.join(',') }] }, 43 | args: ['ids'], 44 | mapping: { 45 | ids: { 46 | value: (record) => { return record.id } 47 | } 48 | }, 49 | show: (record, store) => { return !['User'].includes(store.userInfo.roletype) }, 50 | groupShow: (record, store) => { return !['User'].includes(store.userInfo.roletype) } 51 | }, 52 | { 53 | api: 'deleteEvents', 54 | icon: 'delete', 55 | label: 'label.delete.events', 56 | message: 'message.confirm.remove.selected.events', 57 | docHelp: 'adminguide/events.html#deleting-and-archiving-events-and-alerts', 58 | dataView: true, 59 | successMessage: 'label.event.deleted', 60 | groupAction: true, 61 | groupMap: (selection) => { return [{ ids: selection.join(',') }] }, 62 | args: ['ids'], 63 | mapping: { 64 | ids: { 65 | value: (record) => { return record.id } 66 | } 67 | }, 68 | show: (record, store) => { return !['User'].includes(store.userInfo.roletype) }, 69 | groupShow: (record, store) => { return !['User'].includes(store.userInfo.roletype) } 70 | } 71 | ] 72 | } 73 | -------------------------------------------------------------------------------- /src/config/section/infra/ilbvms.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | export default { 19 | name: 'ilbvm', 20 | title: 'label.internal.lb', 21 | icon: 'share-alt', 22 | permission: ['listInternalLoadBalancerVMs'], 23 | params: { projectid: '-1' }, 24 | columns: ['name', 'state', 'publicip', 'guestnetworkname', 'vpcname', 'version', 'hostname', 'account', 'zonename', 'requiresupgrade'], 25 | details: ['name', 'id', 'version', 'requiresupgrade', 'guestnetworkname', 'vpcname', 'publicip', 'guestipaddress', 'linklocalip', 'serviceofferingname', 'networkdomain', 'isredundantrouter', 'redundantstate', 'hostname', 'account', 'zonename', 'created'], 26 | actions: [ 27 | { 28 | api: 'startInternalLoadBalancerVM', 29 | icon: 'caret-right', 30 | label: 'label.action.start.router', 31 | message: 'message.confirm.start.lb.vm', 32 | dataView: true, 33 | show: (record) => { return record.state === 'Stopped' } 34 | }, 35 | { 36 | api: 'stopInternalLoadBalancerVM', 37 | icon: 'poweroff', 38 | label: 'label.action.stop.router', 39 | dataView: true, 40 | args: ['forced'], 41 | show: (record) => { return record.state === 'Running' } 42 | }, 43 | { 44 | api: 'migrateSystemVm', 45 | icon: 'drag', 46 | label: 'label.action.migrate.router', 47 | dataView: true, 48 | show: (record) => { return record.state === 'Running' }, 49 | args: ['virtualmachineid', 'hostid'], 50 | mapping: { 51 | virtualmachineid: { 52 | value: (record) => { return record.id } 53 | } 54 | } 55 | } 56 | ] 57 | } 58 | -------------------------------------------------------------------------------- /src/config/section/infra/nsp.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | export default { 19 | name: 'nsp', 20 | title: 'label.network.service.providers', 21 | icon: 'compass', 22 | docHelp: 'adminguide/networking.html#network-service-providers', 23 | hidden: true, 24 | permission: ['listNetworkServiceProviders'], 25 | columns: ['name', 'state', 'physicalnetworkid'], 26 | details: ['name', 'state', 'servicelist', 'canenableindividualservice', 'physicalnetworkid'], 27 | tabs: [{ 28 | name: 'details', 29 | component: () => import('@/components/view/DetailsTab.vue') 30 | }], 31 | actions: [ 32 | { 33 | api: 'updateNetworkServiceProvider', 34 | icon: 'stop', 35 | label: 'label.disable.provider', 36 | message: 'message.confirm.disable.provider', 37 | dataView: true, 38 | args: ['state'], 39 | show: (record) => { return record.state === 'Enabled' }, 40 | mapping: { 41 | state: { 42 | value: (record) => { return 'Disabled' } 43 | } 44 | } 45 | }, 46 | { 47 | api: 'updateNetworkServiceProvider', 48 | icon: 'right-circle', 49 | label: 'label.enable.provider', 50 | message: 'message.confirm.enable.provider', 51 | dataView: true, 52 | args: ['state'], 53 | show: (record) => { return record.state === 'Disabled' }, 54 | mapping: { 55 | state: { 56 | value: (record) => { return 'Enabled' } 57 | } 58 | } 59 | } 60 | ] 61 | } 62 | -------------------------------------------------------------------------------- /src/config/section/infra/secondaryStorages.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | import store from '@/store' 18 | 19 | export default { 20 | name: 'imagestore', 21 | title: 'label.secondary.storage', 22 | icon: 'picture', 23 | docHelp: 'adminguide/storage.html#secondary-storage', 24 | permission: ['listImageStores'], 25 | columns: () => { 26 | var fields = ['name', 'url', 'protocol', 'scope', 'zonename'] 27 | if (store.getters.apis.listImageStores.params.filter(x => x.name === 'readonly').length > 0) { 28 | fields.push('readonly') 29 | } 30 | return fields 31 | }, 32 | details: () => { 33 | var fields = ['name', 'id', 'url', 'protocol', 'provider', 'scope', 'zonename'] 34 | if (store.getters.apis.listImageStores.params.filter(x => x.name === 'readonly').length > 0) { 35 | fields.push('readonly') 36 | } 37 | return fields 38 | }, 39 | tabs: [{ 40 | name: 'details', 41 | component: () => import('@/components/view/DetailsTab.vue') 42 | }, { 43 | name: 'settings', 44 | component: () => import('@/components/view/SettingsTab.vue') 45 | }], 46 | actions: [ 47 | { 48 | api: 'migrateSecondaryStorageData', 49 | icon: 'drag', 50 | label: 'label.migrate.data.from.image.store', 51 | listView: true, 52 | popup: true, 53 | component: () => import('@/views/infra/MigrateData.vue') 54 | }, 55 | { 56 | api: 'addImageStore', 57 | icon: 'plus', 58 | docHelp: 'installguide/configuration.html#add-secondary-storage', 59 | label: 'label.add.secondary.storage', 60 | listView: true, 61 | popup: true, 62 | component: () => import('@/views/infra/AddSecondaryStorage.vue') 63 | }, 64 | { 65 | api: 'deleteImageStore', 66 | icon: 'delete', 67 | label: 'label.action.delete.secondary.storage', 68 | message: 'message.action.delete.secondary.storage', 69 | dataView: true 70 | }, 71 | { 72 | api: 'updateImageStore', 73 | icon: 'stop', 74 | label: 'Make Image store read-only', 75 | dataView: true, 76 | defaultArgs: { readonly: true }, 77 | show: (record) => { return record.readonly === false } 78 | }, 79 | { 80 | api: 'updateImageStore', 81 | icon: 'check-circle', 82 | label: 'Make Image store read-write', 83 | dataView: true, 84 | defaultArgs: { readonly: false }, 85 | show: (record) => { return record.readonly === true } 86 | } 87 | ] 88 | } 89 | -------------------------------------------------------------------------------- /src/config/section/plugin/cloudian.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import cloudian from '@/assets/icons/cloudian.svg?inline' 19 | 20 | export default { 21 | name: 'cloudian', 22 | title: 'label.cloudian.storage', 23 | docHelp: 'plugins/cloudian-connector.html', 24 | icon: cloudian, 25 | permission: ['cloudianSsoLogin'], 26 | component: () => import('@/views/plugins/CloudianPlugin.vue') 27 | } 28 | -------------------------------------------------------------------------------- /src/config/section/plugin/quota.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | export default { 19 | name: 'quota', 20 | title: 'label.quota', 21 | icon: 'pie-chart', 22 | docHelp: 'plugins/quota.html', 23 | permission: ['quotaSummary'], 24 | children: [ 25 | { 26 | name: 'quotasummary', 27 | title: 'label.summary', 28 | icon: 'bars', 29 | permission: ['quotaSummary'], 30 | columns: ['account', 'domain', 'state', 'currency', 'balance', 'quota'], 31 | details: ['account', 'domain', 'state', 'currency', 'balance', 'quota', 'startdate', 'enddate'], 32 | component: () => import('@/views/plugins/quota/QuotaSummary.vue'), 33 | tabs: [ 34 | { 35 | name: 'details', 36 | component: () => import('@/components/view/DetailsTab.vue') 37 | }, 38 | { 39 | name: 'quota.statement.quota', 40 | component: () => import('@/views/plugins/quota/QuotaUsage.vue') 41 | }, 42 | { 43 | name: 'quota.statement.balance', 44 | component: () => import('@/views/plugins/quota/QuotaBalance.vue') 45 | } 46 | ], 47 | actions: [ 48 | { 49 | api: 'quotaCredits', 50 | icon: 'plus', 51 | docHelp: 'plugins/quota.html#quota-credits', 52 | label: 'label.quota.add.credits', 53 | dataView: true, 54 | args: ['value', 'min_balance', 'quota_enforce'], 55 | mapping: { 56 | account: { 57 | value: (record) => { return record.account } 58 | }, 59 | domainid: { 60 | value: (record) => { return record.domainid } 61 | } 62 | } 63 | } 64 | ] 65 | }, 66 | { 67 | name: 'quotatariff', 68 | title: 'label.quota.tariff', 69 | icon: 'credit-card', 70 | docHelp: 'plugins/quota.html#quota-tariff', 71 | permission: ['quotaTariffList'], 72 | columns: ['usageName', 'description', 'usageUnit', 'tariffValue', 'tariffActions'], 73 | details: ['usageName', 'description', 'usageUnit', 'tariffValue'], 74 | component: () => import('@/views/plugins/quota/QuotaTariff.vue') 75 | }, 76 | { 77 | name: 'quotaemailtemplate', 78 | title: 'label.templatetype', 79 | icon: 'mail', 80 | permission: ['quotaEmailTemplateList'], 81 | columns: ['templatetype', 'templatesubject', 'templatebody'], 82 | details: ['templatetype', 'templatesubject', 'templatebody'], 83 | tabs: [{ 84 | name: 'details', 85 | component: () => import('@/views/plugins/quota/EmailTemplateDetails.vue') 86 | }] 87 | } 88 | ] 89 | } 90 | -------------------------------------------------------------------------------- /src/config/section/role.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | export default { 19 | name: 'role', 20 | title: 'label.roles', 21 | icon: 'idcard', 22 | docHelp: 'adminguide/accounts.html#roles', 23 | permission: ['listRoles', 'listRolePermissions'], 24 | columns: ['name', 'type', 'description'], 25 | details: ['name', 'id', 'type', 'description'], 26 | tabs: [{ 27 | name: 'details', 28 | component: () => import('@/components/view/DetailsTab.vue') 29 | }, { 30 | name: 'rules', 31 | component: () => import('@/views/iam/RolePermissionTab.vue') 32 | }], 33 | actions: [ 34 | { 35 | api: 'createRole', 36 | icon: 'plus', 37 | label: 'label.add.role', 38 | listView: true, 39 | popup: true, 40 | component: () => import('@/views/iam/CreateRole.vue') 41 | }, 42 | { 43 | api: 'importRole', 44 | icon: 'cloud-upload', 45 | label: 'label.import.role', 46 | listView: true, 47 | popup: true, 48 | component: () => import('@/views/iam/ImportRole.vue') 49 | }, 50 | { 51 | api: 'updateRole', 52 | icon: 'edit', 53 | label: 'label.edit.role', 54 | dataView: true, 55 | args: ['name', 'description', 'type'], 56 | mapping: { 57 | type: { 58 | options: ['Admin', 'DomainAdmin', 'User'] 59 | } 60 | } 61 | }, 62 | { 63 | api: 'deleteRole', 64 | icon: 'delete', 65 | label: 'label.delete.role', 66 | message: 'label.delete.role', 67 | dataView: true 68 | } 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /src/config/settings.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | export default { 19 | primaryColor: '#39A7DE', // primary color of ant design 20 | navTheme: 'light', // theme for nav menu 21 | layout: 'sidemenu', // nav menu position: sidemenu or topmenu 22 | contentWidth: 'Fixed', // layout of content: Fluid or Fixed, only works when layout is topmenu 23 | fixedHeader: true, // sticky header 24 | fixSiderbar: true, // sticky siderbar 25 | autoHideHeader: false, // auto hide header 26 | invertedMode: true, 27 | multiTab: false, // enable to have tab/route history stuff 28 | // vue-ls options 29 | storageOptions: { 30 | namespace: 'primate__', // key prefix 31 | name: 'ls', // name variable Vue.[ls] or this.[$ls], 32 | storage: 'local' // storage name session, local, memory 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/core/bootstrap.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vue from 'vue' 19 | import config from '@/config/settings' 20 | import store from '@/store/' 21 | import { 22 | ACCESS_TOKEN, 23 | CURRENT_PROJECT, 24 | DEFAULT_COLOR, 25 | DEFAULT_THEME, 26 | DEFAULT_LAYOUT_MODE, 27 | DEFAULT_COLOR_INVERTED, 28 | SIDEBAR_TYPE, 29 | DEFAULT_FIXED_HEADER, 30 | DEFAULT_FIXED_HEADER_HIDDEN, 31 | DEFAULT_FIXED_SIDEMENU, 32 | DEFAULT_CONTENT_WIDTH_TYPE, 33 | DEFAULT_MULTI_TAB, 34 | ASYNC_JOB_IDS 35 | } from '@/store/mutation-types' 36 | 37 | export default function Initializer () { 38 | store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true)) 39 | store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme)) 40 | store.commit('TOGGLE_LAYOUT_MODE', Vue.ls.get(DEFAULT_LAYOUT_MODE, config.layout)) 41 | store.commit('TOGGLE_FIXED_HEADER', Vue.ls.get(DEFAULT_FIXED_HEADER, config.fixedHeader)) 42 | store.commit('TOGGLE_FIXED_SIDERBAR', Vue.ls.get(DEFAULT_FIXED_SIDEMENU, config.fixSiderbar)) 43 | store.commit('TOGGLE_CONTENT_WIDTH', Vue.ls.get(DEFAULT_CONTENT_WIDTH_TYPE, config.contentWidth)) 44 | store.commit('TOGGLE_FIXED_HEADER_HIDDEN', Vue.ls.get(DEFAULT_FIXED_HEADER_HIDDEN, config.autoHideHeader)) 45 | store.commit('TOGGLE_INVERTED', Vue.ls.get(DEFAULT_COLOR_INVERTED, config.invertedMode)) 46 | store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor)) 47 | store.commit('TOGGLE_MULTI_TAB', Vue.ls.get(DEFAULT_MULTI_TAB, config.multiTab)) 48 | store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN)) 49 | store.commit('SET_PROJECT', Vue.ls.get(CURRENT_PROJECT)) 50 | store.commit('SET_ASYNC_JOB_IDS', Vue.ls.get(ASYNC_JOB_IDS) || []) 51 | } 52 | -------------------------------------------------------------------------------- /src/core/ext.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vue from 'vue' 19 | 20 | import { library } from '@fortawesome/fontawesome-svg-core' 21 | import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' 22 | 23 | // import { fab } from '@fortawesome/free-brands-svg-icons' 24 | // import { fas } from '@fortawesome/free-solid-svg-icons' 25 | // import { far } from '@fortawesome/free-regular-svg-icons' 26 | 27 | import { faCentos, faUbuntu, faSuse, faRedhat, faFedora, faLinux, faFreebsd, faApple, faWindows, faJava } from '@fortawesome/free-brands-svg-icons' 28 | import { faLanguage, faCompactDisc, faCameraRetro } from '@fortawesome/free-solid-svg-icons' 29 | 30 | library.add(faCentos, faUbuntu, faSuse, faRedhat, faFedora, faLinux, faFreebsd, faApple, faWindows, faJava) 31 | library.add(faLanguage, faCompactDisc, faCameraRetro) 32 | 33 | Vue.component('font-awesome-icon', FontAwesomeIcon) 34 | -------------------------------------------------------------------------------- /src/core/lazy_lib/components_use.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | /* eslint-disable */ 19 | import Vue from 'vue' 20 | import { 21 | ConfigProvider, 22 | Layout, 23 | Input, 24 | InputNumber, 25 | Button, 26 | Switch, 27 | Radio, 28 | Checkbox, 29 | Select, 30 | Card, 31 | Form, 32 | Row, 33 | Col, 34 | Modal, 35 | Table, 36 | Tabs, 37 | Icon, 38 | Badge, 39 | Popover, 40 | Dropdown, 41 | List, 42 | Avatar, 43 | Breadcrumb, 44 | Steps, 45 | Spin, 46 | Menu, 47 | Drawer, 48 | Tooltip, 49 | Alert, 50 | Tag, 51 | Divider, 52 | DatePicker, 53 | TimePicker, 54 | Upload, 55 | Progress, 56 | Skeleton, 57 | Popconfirm, 58 | Descriptions, 59 | message, 60 | notification, 61 | Affix, 62 | Timeline, 63 | Pagination, 64 | Comment, 65 | Tree, 66 | Calendar 67 | } from 'ant-design-vue' 68 | 69 | Vue.use(ConfigProvider) 70 | Vue.use(Layout) 71 | Vue.use(Input) 72 | Vue.use(InputNumber) 73 | Vue.use(Button) 74 | Vue.use(Switch) 75 | Vue.use(Radio) 76 | Vue.use(Checkbox) 77 | Vue.use(Select) 78 | Vue.use(Card) 79 | Vue.use(Form) 80 | Vue.use(Row) 81 | Vue.use(Col) 82 | Vue.use(Modal) 83 | Vue.use(Table) 84 | Vue.use(Tabs) 85 | Vue.use(Icon) 86 | Vue.use(Badge) 87 | Vue.use(Popover) 88 | Vue.use(Dropdown) 89 | Vue.use(List) 90 | Vue.use(Avatar) 91 | Vue.use(Breadcrumb) 92 | Vue.use(Steps) 93 | Vue.use(Spin) 94 | Vue.use(Menu) 95 | Vue.use(Drawer) 96 | Vue.use(Tooltip) 97 | Vue.use(Alert) 98 | Vue.use(Tag) 99 | Vue.use(Divider) 100 | Vue.use(DatePicker) 101 | Vue.use(TimePicker) 102 | Vue.use(Upload) 103 | Vue.use(Progress) 104 | Vue.use(Skeleton) 105 | Vue.use(Popconfirm) 106 | Vue.use(notification) 107 | Vue.use(Affix) 108 | Vue.use(Timeline) 109 | Vue.use(Pagination) 110 | Vue.use(Comment) 111 | Vue.use(Tree) 112 | Vue.use(Calendar) 113 | 114 | Vue.prototype.$confirm = Modal.confirm 115 | Vue.prototype.$message = message 116 | Vue.prototype.$notification = notification 117 | Vue.prototype.$info = Modal.info 118 | Vue.prototype.$success = Modal.success 119 | Vue.prototype.$error = Modal.error 120 | Vue.prototype.$warning = Modal.warning 121 | -------------------------------------------------------------------------------- /src/core/lazy_use.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vue from 'vue' 19 | import VueStorage from 'vue-ls' 20 | import config from '@/config/settings' 21 | 22 | // base library' 23 | // import Viser from 'viser-vue' 24 | import VueCropper from 'vue-cropper' 25 | import '@/core/lazy_lib/components_use' 26 | 27 | import 'ant-design-vue/dist/antd.min.css' 28 | import '@/style/vars.less' 29 | 30 | // ext library 31 | import VueClipboard from 'vue-clipboard2' 32 | import PermissionHelper from '@/utils/helper/permission' 33 | 34 | // customisation 35 | import Spin from 'ant-design-vue/es/spin/Spin' 36 | 37 | VueClipboard.config.autoSetContainer = true 38 | 39 | // Vue.use(Viser) 40 | 41 | Vue.use(VueStorage, config.storageOptions) 42 | Vue.use(VueClipboard) 43 | Vue.use(PermissionHelper) 44 | Vue.use(VueCropper) 45 | 46 | Spin.setDefaultIndicator({ 47 | indicator: (h) => { 48 | return 49 | } 50 | }) 51 | -------------------------------------------------------------------------------- /src/core/use.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vue from 'vue' 19 | import VueStorage from 'vue-ls' 20 | import config from '@/config/settings' 21 | 22 | // base library 23 | import Antd from 'ant-design-vue' 24 | import Viser from 'viser-vue' 25 | import VueCropper from 'vue-cropper' 26 | import 'ant-design-vue/dist/antd.less' 27 | import '@/style/vars.less' 28 | 29 | // ext library 30 | import VueClipboard from 'vue-clipboard2' 31 | import PermissionHelper from '@/utils/helper/permission' 32 | // import '@/components/use' 33 | 34 | // customisation 35 | import Spin from 'ant-design-vue/es/spin/Spin' 36 | 37 | VueClipboard.config.autoSetContainer = true 38 | 39 | Vue.use(Antd) 40 | Vue.use(Viser) 41 | Vue.use(VueStorage, config.storageOptions) 42 | Vue.use(VueClipboard) 43 | Vue.use(PermissionHelper) 44 | Vue.use(VueCropper) 45 | 46 | Spin.setDefaultIndicator({ 47 | indicator: (h) => { 48 | return 49 | } 50 | }) 51 | -------------------------------------------------------------------------------- /src/layouts/BasicLayout.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 26 | 27 | 44 | 45 | 71 | -------------------------------------------------------------------------------- /src/layouts/BlankLayout.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 23 | 24 | 30 | 31 | 34 | -------------------------------------------------------------------------------- /src/layouts/ResourceLayout.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 32 | 33 | 41 | 42 | 50 | -------------------------------------------------------------------------------- /src/layouts/RouteView.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 41 | -------------------------------------------------------------------------------- /src/layouts/UserLayout.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 36 | 37 | 56 | 57 | 87 | -------------------------------------------------------------------------------- /src/layouts/index.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import UserLayout from './UserLayout' 19 | import BlankLayout from './BlankLayout' 20 | import BasicLayout from './BasicLayout' 21 | import RouteView from './RouteView' 22 | import PageView from './PageView' 23 | 24 | export { UserLayout, BasicLayout, BlankLayout, RouteView, PageView } 25 | -------------------------------------------------------------------------------- /src/locales/index.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vue from 'vue' 19 | import VueI18n from 'vue-i18n' 20 | 21 | const loadedLanguage = [] 22 | const messages = {} 23 | 24 | Vue.use(VueI18n) 25 | 26 | export const i18n = new VueI18n({ 27 | locale: Vue.ls ? Vue.ls.get('LOCALE') || 'en' : 'en', 28 | fallbackLocale: 'en', 29 | silentTranslationWarn: true, 30 | messages: messages 31 | }) 32 | 33 | export function loadLanguageAsync (lang) { 34 | if (!lang) { 35 | lang = Vue.ls ? Vue.ls.get('LOCALE') || 'en' : 'en' 36 | } 37 | if (loadedLanguage.includes(lang)) { 38 | return Promise.resolve(setLanguage(lang)) 39 | } 40 | 41 | return fetch(`locales/${lang}.json`) 42 | .then(response => response.json()) 43 | .then(json => Promise.resolve(setLanguage(lang, json))) 44 | } 45 | 46 | function setLanguage (lang, message) { 47 | if (i18n) { 48 | i18n.locale = lang 49 | 50 | if (message && Object.keys(message).length > 0) { 51 | i18n.setLocaleMessage(lang, message) 52 | } 53 | } 54 | 55 | if (!loadedLanguage.includes(lang)) { 56 | loadedLanguage.push(lang) 57 | } 58 | 59 | if (message && Object.keys(message).length > 0) { 60 | messages[lang] = message 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vue from 'vue' 19 | import App from './App.vue' 20 | import router from './router' 21 | import store from './store' 22 | import { i18n, loadLanguageAsync } from './locales' 23 | 24 | import bootstrap from './core/bootstrap' 25 | import './core/lazy_use' 26 | import './core/ext' 27 | import './permission' // permission control 28 | import './utils/filter' // global filter 29 | import { pollJobPlugin, notifierPlugin, toLocaleDatePlugin } from './utils/plugins' 30 | import { VueAxios } from './utils/request' 31 | 32 | Vue.config.productionTip = false 33 | Vue.use(VueAxios, router) 34 | Vue.use(pollJobPlugin) 35 | Vue.use(notifierPlugin) 36 | Vue.use(toLocaleDatePlugin) 37 | 38 | fetch('config.json').then(response => response.json()).then(config => { 39 | Vue.prototype.$config = config 40 | Vue.axios.defaults.baseURL = config.apiBase 41 | 42 | loadLanguageAsync().then(() => { 43 | new Vue({ 44 | router, 45 | store, 46 | i18n, 47 | created: bootstrap, 48 | render: h => h(App) 49 | }).$mount('#app') 50 | }) 51 | }) 52 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vue from 'vue' 19 | import Router from 'vue-router' 20 | import { constantRouterMap } from '@/config/router' 21 | 22 | Vue.use(Router) 23 | 24 | export default new Router({ 25 | mode: 'hash', 26 | base: process.env.BASE_URL, 27 | scrollBehavior: () => ({ y: 0 }), 28 | routes: constantRouterMap 29 | }) 30 | -------------------------------------------------------------------------------- /src/store/getters.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | const getters = { 19 | device: state => state.app.device, 20 | version: state => state.app.version, 21 | theme: state => state.app.theme, 22 | color: state => state.app.color, 23 | metrics: state => state.app.metrics, 24 | token: state => state.user.token, 25 | project: state => state.user.project, 26 | avatar: state => state.user.avatar, 27 | nickname: state => state.user.name, 28 | apis: state => state.user.apis, 29 | features: state => state.user.features, 30 | userInfo: state => state.user.info, 31 | addRouters: state => state.permission.addRouters, 32 | multiTab: state => state.app.multiTab, 33 | asyncJobIds: state => state.user.asyncJobIds, 34 | isLdapEnabled: state => state.user.isLdapEnabled, 35 | cloudian: state => state.user.cloudian, 36 | zones: state => state.user.zones, 37 | timezoneoffset: state => state.user.timezoneoffset, 38 | usebrowsertimezone: state => state.user.usebrowsertimezone 39 | } 40 | 41 | export default getters 42 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vue from 'vue' 19 | import Vuex from 'vuex' 20 | 21 | import app from './modules/app' 22 | import user from './modules/user' 23 | import permission from './modules/permission' 24 | import getters from './getters' 25 | 26 | Vue.use(Vuex) 27 | 28 | export default new Vuex.Store({ 29 | modules: { 30 | app, 31 | user, 32 | permission 33 | }, 34 | state: { 35 | 36 | }, 37 | mutations: { 38 | 39 | }, 40 | actions: { 41 | 42 | }, 43 | getters 44 | }) 45 | -------------------------------------------------------------------------------- /src/store/modules/permission.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import { asyncRouterMap, constantRouterMap } from '@/config/router' 19 | 20 | function hasApi (apis, route) { 21 | if (route.meta && route.meta.permission) { 22 | for (const permission of route.meta.permission) { 23 | if (!apis.includes(permission)) { 24 | return false 25 | } 26 | } 27 | return true 28 | } 29 | return true 30 | } 31 | 32 | function filterAsyncRouter (routerMap, apis) { 33 | const accessedRouters = routerMap.filter(route => { 34 | if (hasApi(apis, route)) { 35 | if (route.children && route.children.length > 0) { 36 | route.children = filterAsyncRouter(route.children, apis) 37 | } 38 | return true 39 | } 40 | return false 41 | }) 42 | return accessedRouters 43 | } 44 | 45 | const permission = { 46 | state: { 47 | routers: constantRouterMap, 48 | addRouters: [] 49 | }, 50 | mutations: { 51 | SET_ROUTERS: (state, routers) => { 52 | state.addRouters = routers 53 | state.routers = constantRouterMap.concat(routers) 54 | } 55 | }, 56 | actions: { 57 | GenerateRoutes ({ commit }, data) { 58 | return new Promise(resolve => { 59 | const apis = Object.keys(data.apis) 60 | const accessedRouters = filterAsyncRouter(asyncRouterMap(), apis) 61 | commit('SET_ROUTERS', accessedRouters) 62 | resolve() 63 | }) 64 | } 65 | } 66 | } 67 | 68 | export default permission 69 | -------------------------------------------------------------------------------- /src/store/mutation-types.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | export const ACCESS_TOKEN = 'Access-Token' 19 | export const CURRENT_PROJECT = 'CURRENT_PROJECT' 20 | export const SIDEBAR_TYPE = 'SIDEBAR_TYPE' 21 | export const DEFAULT_THEME = 'DEFAULT_THEME' 22 | export const DEFAULT_LAYOUT_MODE = 'DEFAULT_LAYOUT_MODE' 23 | export const DEFAULT_COLOR = 'DEFAULT_COLOR' 24 | export const DEFAULT_COLOR_INVERTED = 'DEFAULT_COLOR_INVERTED' 25 | export const DEFAULT_FIXED_HEADER = 'DEFAULT_FIXED_HEADER' 26 | export const DEFAULT_FIXED_SIDEMENU = 'DEFAULT_FIXED_SIDEMENU' 27 | export const DEFAULT_FIXED_HEADER_HIDDEN = 'DEFAULT_FIXED_HEADER_HIDDEN' 28 | export const DEFAULT_CONTENT_WIDTH_TYPE = 'DEFAULT_CONTENT_WIDTH_TYPE' 29 | export const DEFAULT_MULTI_TAB = 'DEFAULT_MULTI_TAB' 30 | export const APIS = 'APIS' 31 | export const ZONES = 'ZONES' 32 | export const ASYNC_JOB_IDS = 'ASYNC_JOB_IDS' 33 | export const TIMEZONE_OFFSET = 'TIMEZONE_OFFSET' 34 | export const USE_BROWSER_TIMEZONE = 'USE_BROWSER_TIMEZONE' 35 | 36 | export const CONTENT_WIDTH_TYPE = { 37 | Fluid: 'Fluid', 38 | Fixed: 'Fixed' 39 | } 40 | -------------------------------------------------------------------------------- /src/style/README.md: -------------------------------------------------------------------------------- 1 | # index.less 2 | - src/styles/index.less imports all necessary rules for cloudstack 3 | 4 | # ant .less structure node_modules/ant-design-vue/ 5 | ## main .less entry points: 6 | 7 | 1. dist/antd.less 8 | - imports everthing with index.less + components.less 9 | 2. lib/style/index.less 10 | - themes/default.less 11 | - color/colors' 12 | - default theme @variables 13 | - core/index.less 14 | - includes base styles, motion rules and iconfont 15 | 16 | # src/style/ explaination 17 | 18 | - index.less includes ant styles, as well as all custom variables and rules 19 | 20 | ## folders: 21 | 22 | 1. variables 23 | - include all custom variables here 24 | 2. common 25 | - include all rules that reset styles, define global stuffs without classes at all 26 | - e.g. body {} p, ul, li {} h1, h2, h3 {} 27 | 3. ant-overwrite 28 | - any styles that overwrites the existin ant rules by any reason 29 | - e.g. classes like .ant-layout-header .anticon {} 30 | 4. frame 31 | - everything that belongs to the frame 32 | - e.g. header, footer, nav, sider, content (just the actual content frame, not every component in it) 33 | 5. layout 34 | - rules that modify the page at all if new layout class is set. 35 | - e.g. #html class="layout-ant-black"# 36 | 6. objects 37 | - repeatly used elements like buttons, inputs 38 | 7. components 39 | - complex elements like dropdown, forms, table, search (usualy include this to components/FooterToolbar/ folder) 40 | 41 | 42 | # The "/deep/" combinator 43 | - use the /deep/ combinator (or in other versions ">>>") helps us to exclude "scoped" rules into global 44 | - e.g. will scope a generated data ID like .a .b .c[data-abcde] {} 45 | - but will scope .a[data-abcde] .b .c {} 46 | - so everything after deep will be outside the defined scope 47 | - watch this article for technical information. https://vue-loader.vuejs.org/guide/scoped-css.html#child-component-root-elements 48 | -------------------------------------------------------------------------------- /src/style/ant-overwrite/ant-form.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | .ant-form .ant-form-item { 19 | margin-bottom: 6px; 20 | } 21 | -------------------------------------------------------------------------------- /src/style/ant-overwrite/ant-layout-header.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | .ant-layout-header { 19 | .anticon-menu-fold { 20 | font-size: 18px; 21 | line-height: 1; 22 | } 23 | 24 | .ant-breadcrumb .anticon { 25 | margin-top: -3px; 26 | margin-left: 12px; 27 | } 28 | 29 | .anticon-home { 30 | font-size: 18px; 31 | } 32 | 33 | .anticon { 34 | vertical-align: middle; 35 | } 36 | } 37 | 38 | .ant-menu { 39 | 40 | .ant-menu-item .anticon, 41 | .ant-menu-submenu-title .anticon { 42 | font-size: 18px!important; // overwrite ant-menu collaped defaults 43 | margin-right: 12px; 44 | vertical-align: sub; 45 | } 46 | } 47 | 48 | .ant-badge-count { 49 | } 50 | -------------------------------------------------------------------------------- /src/style/ant-overwrite/ant-progress.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | .ant-progress-circle .ant-progress-text { 19 | font-size: 16px; 20 | } 21 | -------------------------------------------------------------------------------- /src/style/common/common.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | body { 19 | overflow-y: scroll; 20 | } 21 | -------------------------------------------------------------------------------- /src/style/component/dashboard.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | .ant-pro-capacity-dashboard { 19 | &__wrapper { 20 | display: flex; 21 | margin-bottom: 24px; 22 | flex-wrap: nowrap; 23 | 24 | .mobile & { 25 | flex-wrap: wrap; 26 | } 27 | } 28 | 29 | &__select { 30 | width: 100%; 31 | 32 | .mobile & { 33 | margin-bottom: 12px; 34 | } 35 | } 36 | 37 | &__button { 38 | width: auto; 39 | } 40 | 41 | &__tile-wrapper:after { 42 | content: ""; 43 | clear: both; 44 | display: table; 45 | } 46 | 47 | &__alert-wrapper { 48 | clear: both; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/style/frame/content.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | .content { 19 | 20 | .table-operator { 21 | margin-bottom: 18px; 22 | 23 | button { 24 | margin-right: 8px; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/style/frame/search.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | .table-page-search-wrapper { 19 | 20 | .ant-form-inline { 21 | 22 | .ant-form-item { 23 | display: flex; 24 | margin-bottom: 24px; 25 | margin-right: 0; 26 | 27 | .ant-form-item-control-wrapper { 28 | flex: 1 1; 29 | display: inline-block; 30 | vertical-align: middle; 31 | } 32 | 33 | > .ant-form-item-label { 34 | line-height: 32px; 35 | padding-right: 8px; 36 | width: auto; 37 | } 38 | 39 | .ant-form-item-control { 40 | height: 32px; 41 | line-height: 32px; 42 | } 43 | } 44 | } 45 | 46 | .table-page-search-submitButtons { 47 | display: block; 48 | margin-bottom: 24px; 49 | white-space: nowrap; 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /src/style/frame/sider.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | .sider { 19 | box-shadow: 2px 0 6px rgba(0, 21, 41, .35); 20 | position: relative; 21 | z-index: 10; 22 | height: auto; 23 | 24 | .ant-layout-sider-children { 25 | overflow-y: hidden; 26 | 27 | &:hover { 28 | overflow-y: auto; 29 | } 30 | } 31 | 32 | &.ant-fixed-sidemenu { 33 | position: fixed; 34 | height: 100%; 35 | } 36 | 37 | .logo { 38 | height: 64px; 39 | position: relative; 40 | line-height: 64px; 41 | padding-left: 24px; 42 | -webkit-transition: all .3s; 43 | transition: all .3s; 44 | background: #002140; 45 | overflow: hidden; 46 | 47 | img, 48 | svg, 49 | h1 { 50 | display: inline-block; 51 | vertical-align: middle; 52 | } 53 | 54 | img { 55 | height: 32px; 56 | width: 32px; 57 | } 58 | 59 | h1 { 60 | color: #fff; 61 | font-size: 20px; 62 | margin: 0 0 0 12px; 63 | font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif; 64 | font-weight: 600; 65 | vertical-align: middle; 66 | } 67 | } 68 | 69 | &.light { 70 | background-color: #fff; 71 | box-shadow: 2px 0px 8px 0px rgba(29, 35, 41, 0.05); 72 | 73 | .logo { 74 | background: #fff; 75 | box-shadow: 1px 1px 0px 0px #e8e8e8; 76 | 77 | h1 { 78 | color: unset; 79 | } 80 | } 81 | 82 | .ant-menu-light { 83 | border-right-color: transparent; 84 | } 85 | } 86 | 87 | } -------------------------------------------------------------------------------- /src/style/frame/top-menu.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | .topmenu { 19 | .page-header-index-wide { 20 | max-width: 1200px; 21 | margin: 0 auto; 22 | } 23 | } -------------------------------------------------------------------------------- /src/style/index.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | //* import all ## official ant ## variables; mixins and styles 19 | @import "~ant-design-vue/lib/style/themes/default"; 20 | @import "~ant-design-vue/lib/style/core/index"; 21 | 22 | //* import all ## custom ## variables, mixins and styles 23 | 24 | 25 | @import "variables/prefixes"; 26 | 27 | @import "common/common"; 28 | 29 | @import "layout/ant"; 30 | @import "layout/inverted-mode"; 31 | @import "ant-overwrite/ant-layout-header"; 32 | @import "ant-overwrite/ant-progress"; 33 | @import "ant-overwrite/ant-form"; 34 | 35 | @import "frame/content"; 36 | @import "frame/search"; 37 | @import "frame/top-menu"; 38 | 39 | @import "objects/table"; 40 | -------------------------------------------------------------------------------- /src/style/layout/inverted-mode.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | body.layout-inverted-mode { 19 | filter: invert(80%); 20 | } 21 | -------------------------------------------------------------------------------- /src/style/objects/table.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | .table-alert { 19 | margin-bottom: 16px; 20 | } -------------------------------------------------------------------------------- /src/style/variables/prefixes.less: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // The prefix to use on all css classes from ant-pro. 19 | @ant-pro-prefix : ant-pro; 20 | -------------------------------------------------------------------------------- /src/utils/auth.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import { setStore, getStore, clearStore } from '@/utils/storage' 19 | 20 | export const TokenKey = 'Access-Token' 21 | 22 | export function getToken () { 23 | return getStore(TokenKey) 24 | } 25 | 26 | export function setToken (token) { 27 | // key, token, timeout = 86400s 28 | return setStore(TokenKey, token, 86400) 29 | } 30 | 31 | export function removeToken () { 32 | return clearStore(TokenKey) 33 | } 34 | -------------------------------------------------------------------------------- /src/utils/axios.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | const VueAxios = { 19 | vm: {}, 20 | // eslint-disable-next-line no-unused-vars 21 | install (Vue, instance) { 22 | if (this.installed) { 23 | return 24 | } 25 | this.installed = true 26 | 27 | if (!instance) { 28 | // eslint-disable-next-line no-console 29 | console.error('You have to install axios') 30 | return 31 | } 32 | 33 | Vue.axios = instance 34 | 35 | Object.defineProperties(Vue.prototype, { 36 | axios: { 37 | get: function get () { 38 | return instance 39 | } 40 | }, 41 | $http: { 42 | get: function get () { 43 | return instance 44 | } 45 | } 46 | }) 47 | } 48 | } 49 | 50 | export { 51 | VueAxios 52 | } 53 | -------------------------------------------------------------------------------- /src/utils/device.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import enquireJs from 'enquire.js' 19 | 20 | export const DEVICE_TYPE = { 21 | DESKTOP: 'desktop', 22 | TABLET: 'tablet', 23 | MOBILE: 'mobile' 24 | } 25 | 26 | export const deviceEnquire = function (callback) { 27 | const matchDesktop = { 28 | match: () => { 29 | callback && callback(DEVICE_TYPE.DESKTOP) 30 | } 31 | } 32 | 33 | const matchTablet = { 34 | match: () => { 35 | callback && callback(DEVICE_TYPE.TABLET) 36 | } 37 | } 38 | 39 | const matchMobile = { 40 | match: () => { 41 | callback && callback(DEVICE_TYPE.MOBILE) 42 | } 43 | } 44 | 45 | enquireJs 46 | .register('screen and (max-width: 800px)', matchMobile) 47 | .register('screen and (min-width: 800px) and (max-width: 1366px)', matchTablet) 48 | .register('screen and (min-width: 1367px)', matchDesktop) 49 | } 50 | -------------------------------------------------------------------------------- /src/utils/domUtil.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | export const setDocumentTitle = function (title) { 19 | document.title = title 20 | const ua = navigator.userAgent 21 | // eslint-disable-next-line 22 | const regex = /\bMicroMessenger\/([\d\.]+)/ 23 | if (regex.test(ua) && /ip(hone|od|ad)/i.test(ua)) { 24 | const i = document.createElement('iframe') 25 | i.src = '/favicon.ico' 26 | i.style.display = 'none' 27 | i.onload = function () { 28 | setTimeout(function () { 29 | i.remove() 30 | }, 9) 31 | } 32 | document.body.appendChild(i) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/utils/filter.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vue from 'vue' 19 | import moment from 'moment' 20 | import 'moment/locale/en-gb' 21 | moment.locale('en-gb') 22 | 23 | Vue.filter('NumberFormat', function (value) { 24 | if (!value) { 25 | return '0' 26 | } 27 | const intPartFormat = value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') 28 | return intPartFormat 29 | }) 30 | 31 | Vue.filter('dayjs', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') { 32 | return moment(dataStr).format(pattern) 33 | }) 34 | 35 | Vue.filter('moment', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') { 36 | return moment(dataStr).format(pattern) 37 | }) 38 | -------------------------------------------------------------------------------- /src/utils/helper/permission.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | const PERMISSION_ENUM = { 19 | } 20 | 21 | function plugin (Vue) { 22 | if (plugin.installed) { 23 | return 24 | } 25 | 26 | !Vue.prototype.$auth && Object.defineProperties(Vue.prototype, { 27 | $auth: { 28 | get () { 29 | const _this = this 30 | return (permissions) => { 31 | const [permission, action] = permissions.split('.') 32 | const permissionList = _this.$store.getters.roles.permissions 33 | return permissionList.find((val) => { 34 | return val.permissionId === permission 35 | }).actionList.findIndex((val) => { 36 | return val === action 37 | }) > -1 38 | } 39 | } 40 | } 41 | }) 42 | 43 | !Vue.prototype.$enum && Object.defineProperties(Vue.prototype, { 44 | $enum: { 45 | get () { 46 | // const _this = this; 47 | return (val) => { 48 | let result = PERMISSION_ENUM 49 | val && val.split('.').forEach(v => { 50 | result = result && result[v] || null 51 | }) 52 | return result 53 | } 54 | } 55 | } 56 | }) 57 | } 58 | 59 | export default plugin 60 | -------------------------------------------------------------------------------- /src/utils/icons.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import _ from 'lodash' 19 | 20 | const osMapping = { 21 | ubuntu: 'ubuntu', 22 | debian: 'debian', 23 | redhat: 'redhat', 24 | centos: 'centos', 25 | fedora: 'fedora', 26 | suse: 'suse', 27 | linux: 'linux', 28 | bsd: 'freebsd', 29 | apple: 'apple', 30 | dos: 'windows', 31 | windows: 'windows', 32 | oracle: 'java' 33 | } 34 | 35 | export const getNormalizedOsName = (osName) => { 36 | osName = osName.toLowerCase() 37 | return _.find(osMapping, (value, key) => osName.includes(key)) || 'linux' 38 | } 39 | -------------------------------------------------------------------------------- /src/utils/mixin.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | // import Vue from 'vue' 19 | import { deviceEnquire, DEVICE_TYPE } from '@/utils/device' 20 | import { mapState } from 'vuex' 21 | 22 | // const mixinsComputed = Vue.config.optionMergeStrategies.computed 23 | // const mixinsMethods = Vue.config.optionMergeStrategies.methods 24 | 25 | const mixin = { 26 | computed: { 27 | ...mapState({ 28 | layoutMode: state => state.app.layout, 29 | navTheme: state => state.app.theme, 30 | primaryColor: state => state.app.color, 31 | invertedMode: state => state.app.inverted, 32 | fixedHeader: state => state.app.fixedHeader, 33 | fixSiderbar: state => state.app.fixSiderbar, 34 | fixSidebar: state => state.app.fixSiderbar, 35 | contentWidth: state => state.app.contentWidth, 36 | autoHideHeader: state => state.app.autoHideHeader, 37 | sidebarOpened: state => state.app.sidebar, 38 | multiTab: state => state.app.multiTab 39 | }) 40 | }, 41 | methods: { 42 | isTopMenu () { 43 | return this.layoutMode === 'topmenu' 44 | }, 45 | isSideMenu () { 46 | return !this.isTopMenu() 47 | } 48 | } 49 | } 50 | 51 | const mixinDevice = { 52 | computed: { 53 | ...mapState({ 54 | device: state => state.app.device 55 | }) 56 | }, 57 | methods: { 58 | isMobile () { 59 | return this.device === DEVICE_TYPE.MOBILE 60 | }, 61 | isDesktop () { 62 | return this.device === DEVICE_TYPE.DESKTOP 63 | }, 64 | isTablet () { 65 | return this.device === DEVICE_TYPE.TABLET 66 | } 67 | } 68 | } 69 | 70 | const AppDeviceEnquire = { 71 | mounted () { 72 | const { $store } = this 73 | deviceEnquire(deviceType => { 74 | switch (deviceType) { 75 | case DEVICE_TYPE.DESKTOP: 76 | $store.commit('TOGGLE_DEVICE', 'desktop') 77 | $store.dispatch('setSidebar', true) 78 | break 79 | case DEVICE_TYPE.TABLET: 80 | $store.commit('TOGGLE_DEVICE', 'tablet') 81 | $store.dispatch('setSidebar', false) 82 | break 83 | case DEVICE_TYPE.MOBILE: 84 | default: 85 | $store.commit('TOGGLE_DEVICE', 'mobile') 86 | $store.dispatch('setSidebar', true) 87 | break 88 | } 89 | }) 90 | } 91 | } 92 | 93 | export { mixin, AppDeviceEnquire, mixinDevice } 94 | -------------------------------------------------------------------------------- /src/utils/permissions.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | export function actionToObject (json) { 19 | try { 20 | return JSON.parse(json) 21 | } catch (e) { 22 | console.log('err', e.message) 23 | } 24 | return [] 25 | } 26 | -------------------------------------------------------------------------------- /src/utils/storage.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | /** 19 | * Set storage 20 | * 21 | * @param name 22 | * @param content 23 | * @param maxAge 24 | */ 25 | export const setStore = (name, content, maxAge = null) => { 26 | if (!global.window || !name) { 27 | return 28 | } 29 | 30 | if (typeof content !== 'string') { 31 | content = JSON.stringify(content) 32 | } 33 | 34 | const storage = global.window.localStorage 35 | 36 | storage.setItem(name, content) 37 | if (maxAge && !isNaN(parseInt(maxAge))) { 38 | const timeout = parseInt(new Date().getTime() / 1000) 39 | storage.setItem(`${name}_expire`, timeout + maxAge) 40 | } 41 | } 42 | 43 | /** 44 | * Get storage 45 | * 46 | * @param name 47 | * @returns {*} 48 | */ 49 | export const getStore = name => { 50 | if (!global.window || !name) { 51 | return 52 | } 53 | 54 | const content = window.localStorage.getItem(name) 55 | const _expire = window.localStorage.getItem(`${name}_expire`) 56 | 57 | if (_expire) { 58 | const now = parseInt(new Date().getTime() / 1000) 59 | if (now > _expire) { 60 | return 61 | } 62 | } 63 | 64 | try { 65 | return JSON.parse(content) 66 | } catch (e) { 67 | return content 68 | } 69 | } 70 | 71 | /** 72 | * Clear storage 73 | * 74 | * @param name 75 | */ 76 | export const clearStore = name => { 77 | if (!global.window || !name) { 78 | return 79 | } 80 | 81 | window.localStorage.removeItem(name) 82 | window.localStorage.removeItem(`${name}_expire`) 83 | } 84 | 85 | /** 86 | * Clear all storage 87 | */ 88 | export const clearAll = () => { 89 | if (!global.window || !name) { 90 | return 91 | } 92 | 93 | window.localStorage.clear() 94 | } 95 | -------------------------------------------------------------------------------- /src/utils/timezone/index.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | function loadTimeZone () { 19 | const timeZoneJson = require.context('./', true, /[A-Za-z0-9-_,\s]+\.json$/i) 20 | const data = [] 21 | 22 | timeZoneJson.keys().forEach(key => { 23 | const matched = key.match(/([A-Za-z0-9-_]+)\./i) 24 | if (matched && matched.length > 1) { 25 | const json = timeZoneJson(key) 26 | for (const index in json) { 27 | data.push({ 28 | id: index, 29 | name: json[index] 30 | }) 31 | } 32 | } 33 | }) 34 | 35 | return data 36 | } 37 | 38 | function getFullTimeZone (strQuery) { 39 | if (!strQuery || strQuery === '') { 40 | return [] 41 | } 42 | 43 | const timeZoneJson = require.context('./', true, /[A-Za-z0-9-_,\s]+\.json$/i) 44 | const data = [] 45 | timeZoneJson.keys().forEach(key => { 46 | const matched = key.match(/([A-Za-z0-9-_]+)\./i) 47 | if (matched && matched.length > 1) { 48 | const json = timeZoneJson(key) 49 | for (const index in json) { 50 | if (index.toLowerCase() === strQuery.toLowerCase()) { 51 | data.push({ 52 | id: index, 53 | name: json[index] 54 | }) 55 | 56 | break 57 | } 58 | } 59 | } 60 | }) 61 | 62 | return data 63 | } 64 | 65 | export function timeZone () { 66 | return new Promise(resolve => { 67 | const dataTimeZone = loadTimeZone() 68 | resolve(dataTimeZone) 69 | }) 70 | } 71 | 72 | export function timeZoneName (key) { 73 | const dataTimeZone = getFullTimeZone(key) 74 | 75 | if (dataTimeZone && dataTimeZone[0]) { 76 | return dataTimeZone[0].name 77 | } 78 | 79 | return '' 80 | } 81 | -------------------------------------------------------------------------------- /src/utils/util.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | export function timeFix () { 19 | const time = new Date() 20 | const hour = time.getHours() 21 | return hour < 9 ? '早上好' : hour <= 11 ? '上午好' : hour <= 13 ? '中午好' : hour < 20 ? '下午好' : '晚上好' 22 | } 23 | 24 | export function triggerWindowResizeEvent () { 25 | const event = document.createEvent('HTMLEvents') 26 | event.initEvent('resize', true, true) 27 | event.eventType = 'message' 28 | window.dispatchEvent(event) 29 | } 30 | 31 | export function handleScrollHeader (callback) { 32 | let timer = 0 33 | 34 | let beforeScrollTop = window.pageYOffset 35 | callback = callback || function () {} 36 | window.addEventListener( 37 | 'scroll', 38 | event => { 39 | clearTimeout(timer) 40 | timer = setTimeout(() => { 41 | let direction = 'up' 42 | const afterScrollTop = window.pageYOffset 43 | const delta = afterScrollTop - beforeScrollTop 44 | if (delta === 0) { 45 | return false 46 | } 47 | direction = delta > 0 ? 'down' : 'up' 48 | callback(direction) 49 | beforeScrollTop = afterScrollTop 50 | }, 50) 51 | }, 52 | false 53 | ) 54 | } 55 | 56 | export function removeLoadingAnimate (id = '', timeout = 1500) { 57 | if (id === '') { 58 | return 59 | } 60 | setTimeout(() => { 61 | document.body.removeChild(document.getElementById(id)) 62 | }, timeout) 63 | } 64 | -------------------------------------------------------------------------------- /src/views/compute/BackupScheduleWizard.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 36 | 37 | 87 | 88 | 96 | -------------------------------------------------------------------------------- /src/views/compute/wizard/DiskSizeSelection.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 36 | 37 | 93 | 94 | 99 | -------------------------------------------------------------------------------- /src/views/dashboard/Dashboard.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 31 | 32 | 88 | -------------------------------------------------------------------------------- /src/views/dashboard/UsageDashboardChart.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 45 | 46 | 68 | -------------------------------------------------------------------------------- /src/views/exception/403.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 21 | 22 | 31 | 32 | 35 | -------------------------------------------------------------------------------- /src/views/exception/404.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 21 | 22 | 31 | 32 | 35 | -------------------------------------------------------------------------------- /src/views/exception/500.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 21 | 22 | 31 | 32 | 35 | -------------------------------------------------------------------------------- /src/views/exception/type.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | const types = { 19 | 403: { 20 | title: '403', 21 | desc: 'Access Forbidden.' 22 | }, 23 | 404: { 24 | title: '404', 25 | desc: 'Not Found.' 26 | }, 27 | 500: { 28 | title: '500', 29 | desc: 'Internal Server Error.' 30 | } 31 | } 32 | 33 | export default types 34 | -------------------------------------------------------------------------------- /src/views/iam/PermissionEditable.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 26 | 27 | 43 | -------------------------------------------------------------------------------- /src/views/iam/RuleDelete.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 33 | 34 | 54 | 55 | 65 | -------------------------------------------------------------------------------- /src/views/image/UploadLocalIso.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 39 | 40 | 54 | 55 | 57 | -------------------------------------------------------------------------------- /src/views/image/UploadLocalTemplate.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 39 | 40 | 54 | 55 | 57 | -------------------------------------------------------------------------------- /src/views/infra/network/IpRangesTab.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 23 | 24 | 60 | 61 | 64 | -------------------------------------------------------------------------------- /src/views/infra/network/providers/ProviderDetail.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 37 | 38 | 58 | 59 | 61 | -------------------------------------------------------------------------------- /src/views/plugins/CloudianPlugin.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 31 | 32 | 60 | -------------------------------------------------------------------------------- /src/views/plugins/IFramePlugin.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 24 | 25 | 31 | -------------------------------------------------------------------------------- /src/views/plugins/quota/QuotaSummary.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 28 | 29 | 67 | -------------------------------------------------------------------------------- /src/views/plugins/quota/QuotaSummaryResource.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 24 | 25 | 90 | 91 | 93 | -------------------------------------------------------------------------------- /src/views/plugins/quota/QuotaTariff.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 27 | 28 | 61 | -------------------------------------------------------------------------------- /src/views/project/ProjectDetailsTab.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 20 | 59 | -------------------------------------------------------------------------------- /src/views/setting/ResourceSettingsTab.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 27 | 28 | 56 | 57 | 59 | -------------------------------------------------------------------------------- /src/views/storage/RecurringSnapshotVolume.vue: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 40 | 41 | 90 | 91 | 96 | -------------------------------------------------------------------------------- /tests/.eslintrc.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | module.exports = { 19 | env: { 20 | jest: true 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/common/index.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import mockI18n from '../mock/mockI18n' 19 | import mockStore from '../mock/mockStore' 20 | import mockRouter from '../mock/mockRouter' 21 | 22 | import localVue from '../setup' 23 | import { mount } from '@vue/test-utils' 24 | import { pollJobPlugin, notifierPlugin } from '@/utils/plugins' 25 | 26 | localVue.use(pollJobPlugin) 27 | localVue.use(notifierPlugin) 28 | 29 | function createMockRouter (newRoutes = []) { 30 | let routes = [] 31 | if (!newRoutes || Object.keys(newRoutes).length === 0) { 32 | return mockRouter.mock(routes) 33 | } 34 | 35 | routes = [...newRoutes] 36 | 37 | return mockRouter.mock(routes) 38 | } 39 | 40 | function createMockI18n (locale = 'en', messages = {}) { 41 | return mockI18n.mock(locale, messages) 42 | } 43 | 44 | function createMockStore (state = {}, actions = {}) { 45 | return mockStore.mock(state, actions) 46 | } 47 | 48 | function decodeHtml (html) { 49 | const text = document.createElement('textarea') 50 | text.innerHTML = html 51 | 52 | return text.value 53 | } 54 | 55 | function createFactory (component, options) { 56 | var { 57 | router = null, 58 | i18n = null, 59 | store = null, 60 | props = {}, 61 | data = {}, 62 | mocks = {} 63 | } = options 64 | 65 | if (!router) router = createMockRouter() 66 | if (!i18n) i18n = createMockI18n() 67 | if (!store) store = createMockStore() 68 | 69 | return mount(component, { 70 | localVue, 71 | router, 72 | i18n, 73 | store, 74 | propsData: props, 75 | mocks, 76 | data () { 77 | return { ...data } 78 | } 79 | }) 80 | } 81 | 82 | export default { 83 | createFactory, 84 | createMockRouter, 85 | createMockI18n, 86 | createMockStore, 87 | decodeHtml 88 | } 89 | -------------------------------------------------------------------------------- /tests/mock/mockAxios.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | const mockAxios = jest.genMockFromModule('axios') 19 | 20 | mockAxios.create = jest.fn(() => mockAxios) 21 | 22 | export default mockAxios 23 | -------------------------------------------------------------------------------- /tests/mock/mockI18n.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import VueI18n from 'vue-i18n' 19 | 20 | const mockI18n = { 21 | mock: (locale = 'en', message = {}) => { 22 | return new VueI18n({ 23 | locale: locale, 24 | messages: message 25 | }) 26 | } 27 | } 28 | 29 | export default mockI18n 30 | -------------------------------------------------------------------------------- /tests/mock/mockRouter.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import VueRouter from 'vue-router' 19 | 20 | const mockRouter = { 21 | routes: [ 22 | { 23 | path: '/', 24 | name: 'home', 25 | meta: { icon: 'home' }, 26 | children: [] 27 | } 28 | ], 29 | mock: (routes = []) => { 30 | mockRouter.routes[0].children = [ 31 | { 32 | path: '/exception', 33 | name: 'exception', 34 | children: [ 35 | { 36 | path: '/exception/403', 37 | name: 403, 38 | hidden: true, 39 | meta: { icon: 'icon-error-test' } 40 | }, 41 | { 42 | path: '/exception/404', 43 | name: 404, 44 | hidden: true, 45 | meta: { icon: 'icon-error-test' } 46 | }, 47 | { 48 | path: '/exception/500', 49 | name: 500, 50 | hidden: true, 51 | meta: { icon: 'icon-error-test' } 52 | } 53 | ] 54 | } 55 | ] 56 | if (routes && routes.length > 0) { 57 | mockRouter.routes[0].children = [...mockRouter.routes[0].children, ...routes] 58 | } 59 | 60 | return new VueRouter({ routes: mockRouter.routes, mode: 'history' }) 61 | } 62 | } 63 | 64 | export default mockRouter 65 | -------------------------------------------------------------------------------- /tests/mock/mockStore.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vuex from 'vuex' 19 | 20 | const mockStore = { 21 | state: {}, 22 | mock: (state, actions) => { 23 | mockStore.state = { 24 | app: { 25 | device: 'desktop' 26 | }, 27 | user: {}, 28 | permission: {} 29 | } 30 | 31 | if (state && Object.keys(state).length > 0) { 32 | mockStore.state = { ...mockStore.state, ...state } 33 | } 34 | 35 | if (!actions) { 36 | actions = {} 37 | } 38 | 39 | return new Vuex.Store({ 40 | state: mockStore.state, 41 | getters: { 42 | apis: () => mockStore.state.user.apis, 43 | userInfo: () => mockStore.state.user.info 44 | }, 45 | actions 46 | }) 47 | } 48 | } 49 | 50 | export default mockStore 51 | -------------------------------------------------------------------------------- /tests/mockData/ActionButton.mock.json: -------------------------------------------------------------------------------- 1 | { 2 | "messages": { 3 | "en": { "label.action": "action-en" }, 4 | "de": { "label.action": "action-de" } 5 | }, 6 | "apis": { 7 | "test-api-case-1": {}, 8 | "test-api-case-2": {}, 9 | "test-api-case-3": {}, 10 | "test-api-case-4": {}, 11 | "test-api-case-5": {}, 12 | "test-api-case-6": {} 13 | }, 14 | "routes": [ 15 | { 16 | "name": "testRouter1", 17 | "path": "/test-router-1", 18 | "meta": { 19 | "name": "systemvm" 20 | } 21 | }, 22 | { 23 | "name": "testRouter2", 24 | "path": "/test-router-2", 25 | "meta": { 26 | "name": "test-name" 27 | } 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /tests/mockData/MigrateWizard.mock.json: -------------------------------------------------------------------------------- 1 | { 2 | "messages": { 3 | "en": { 4 | "name": "name-en", 5 | "Suitability": "Suitability-en", 6 | "cpuused": "cpuused-en", 7 | "memused": "memused-en", 8 | "select": "select-en", 9 | "ok": "ok-en", 10 | "message.load.host.failed": "Failed to load hosts", 11 | "message.migrating.vm.to.host.failed": "Failed to migrate VM to host" 12 | }, 13 | "de": { 14 | "name": "name-de", 15 | "Suitability": "Suitability-de", 16 | "cpuused": "cpuused-de", 17 | "memused": "memused-de", 18 | "select": "select-de", 19 | "ok": "ok-de", 20 | "message.load.host.failed": "Failed to load hosts", 21 | "message.migrating.vm.to.host.failed": "Failed to migrate VM to host" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /tests/mockData/Status.mock.json: -------------------------------------------------------------------------------- 1 | { 2 | "messages": { 3 | "en": { 4 | "state.running": "Running", 5 | "state.migrating": "Migrating", 6 | "state.stopped": "Stopped", 7 | "state.starting": "Starting", 8 | "state.stopping": "Stopping", 9 | "state.suspended": "Suspended", 10 | "state.pending": "Pending", 11 | "state.expunging": "Expunging", 12 | "state.error": "Error", 13 | "message.publicip.state.allocated": "Allocated", 14 | "message.publicip.state.created": "Created", 15 | "message.vmsnapshot.state.active": "Active", 16 | "message.vm.state.active": "Active", 17 | "message.volume.state.active": "Active", 18 | "message.guestnetwork.state.active": "Active", 19 | "message.publicip.state.active": "Active", 20 | "Created": "Created", 21 | "Active": "Active", 22 | "Allocated": "Allocated", 23 | "Error": "Error", 24 | "Expunging": "Expunging", 25 | "Suspended": "Suspended", 26 | "Pending": "Pending", 27 | "Running": "Running", 28 | "Starting": "Starting", 29 | "Another": "Another", 30 | "Ready": "Ready", 31 | "Disabled": "Disabled", 32 | "Migrating": "Migrating", 33 | "Stopping": "Stopping", 34 | "Alert": "Alert", 35 | "Stopped": "Stopped" 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /tests/setup.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | import Vue from 'vue' 19 | import Vuex from 'vuex' 20 | import Antd from 'ant-design-vue' 21 | import VueRouter from 'vue-router' 22 | import VueI18n from 'vue-i18n' 23 | import VueStorage from 'vue-ls' 24 | import VueClipboard from 'vue-clipboard2' 25 | import config from '@/config/settings' 26 | import { createLocalVue } from '@vue/test-utils' 27 | import registerRequireContextHook from 'babel-plugin-require-context-hook/register' 28 | 29 | const localVue = createLocalVue() 30 | 31 | Vue.use(Antd) 32 | Vue.use(VueStorage, config.storageOptions) 33 | 34 | localVue.use(VueRouter) 35 | localVue.use(VueI18n) 36 | localVue.use(Vuex) 37 | localVue.use(VueClipboard) 38 | 39 | registerRequireContextHook() 40 | 41 | window.matchMedia = window.matchMedia || function () { 42 | return { 43 | matches: false, 44 | addListener: function () {}, 45 | removeListener: function () {} 46 | } 47 | } 48 | 49 | module.exports = localVue 50 | -------------------------------------------------------------------------------- /theme.config.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | const path = require('path') 19 | const AntDesignThemePlugin = require('antd-theme-webpack-plugin') 20 | 21 | function resolve (dir) { 22 | return path.join(__dirname, dir) 23 | } 24 | 25 | const options = { 26 | stylesDir: resolve('./src/style'), 27 | antDir: resolve('./node_modules/ant-design-vue'), 28 | varFile: resolve('./src/style/vars.less'), 29 | themeVariables: [ 30 | '@logo-background-color', 31 | '@project-nav-background-color', 32 | '@project-nav-text-color', 33 | '@navigation-background-color', 34 | '@navigation-text-color', 35 | '@primary-color', 36 | '@link-color', 37 | '@link-hover-color', 38 | '@loading-color', 39 | '@success-color', 40 | '@warning-color', 41 | '@processing-color', 42 | '@error-color', 43 | '@heading-color', 44 | '@text-color', 45 | '@text-color-secondary', 46 | '@disabled-color', 47 | '@border-color-base', 48 | '@border-radius-base', 49 | '@box-shadow-base' 50 | ], 51 | indexFileName: 'index.html', 52 | publicPath: '.', 53 | generateOnce: false 54 | } 55 | 56 | const createThemeColorReplacerPlugin = () => new AntDesignThemePlugin(options) 57 | 58 | module.exports = createThemeColorReplacerPlugin 59 | -------------------------------------------------------------------------------- /tools/api/apis.primate.sh: -------------------------------------------------------------------------------- 1 | cd ../../src/ 2 | rm -f apis.txt 3 | grep api\( -R . | grep -v import | sed "s/.*api('//g" | sed "s/'.*//g" | grep -v '.vue' | sort | uniq >> apis.txt 4 | grep api -R config | sed "s/.*api: '//g" | sed "s/'.*//g" | grep -v \.js | sort | uniq >> apis.txt 5 | grep store.getters.apis -R . | sed "s/' in.*//g" | sed "s/').*//g" | grep "'" | sed "s/.*'//g" | grep -v ']' >> apis.txt 6 | grep 'permission:\ \[' -R config | sed "s/.*permission: \['//g" | grep -v .js | sed "s/', '/\\n/g" | sed "s/'.*//g" >> apis.txt 7 | cat apis.txt | sort | uniq > apis.uniq 8 | rm -f apis.txt 9 | mv apis.uniq ../tools/api/apis.txt 10 | cd ../tools/api 11 | diff -Naur apis.old apis.txt | grep ^- | grep -v "^--" | sed 's/^-//g' | grep -v -i -e cisco -e nicira -e baremetal -e srx -e f5 -e brocade -e palo -e autoscale -e counter -e condition -e ucs -e netscaler -e bigswitch -e ovs -e globalloadbalancer -e opendaylight -e region -e quota | sort | uniq > apis.remaining 12 | 13 | echo "$(cat apis.txt | wc -l) APIs are supported by Primate" 14 | echo "$(cat apis.remaining | wc -l) APIs are remaining" 15 | -------------------------------------------------------------------------------- /tools/api/apis.remaining: -------------------------------------------------------------------------------- 1 | listDeploymentPlanners 2 | listHostTags 3 | listStorageProviders 4 | listStorageTags 5 | -------------------------------------------------------------------------------- /tools/docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | set -e 20 | set -x 21 | 22 | cd $(dirname $0) 23 | 24 | GIT_TAG="$(git tag --points-at | head -n 1)" 25 | if [ -n "${GIT_REV}" ]; then 26 | LABEL_GIT_TAG="--label \"org.opencontainers.image.version=${GIT_TAG}\"" 27 | fi 28 | DATE="$(date --iso-8601=seconds)" 29 | LABEL_DATE="--label \"org.opencontainers.image.created=${DATE}\"" 30 | GIT_REV="$(git rev-parse HEAD)" 31 | LABEL_GIT_REV="--label \"org.opencontainers.image.revision=${GIT_REV}\"" 32 | 33 | docker build -t cloudstack-primate ${LABEL_DATE} ${LABEL_GIT_REV} ${LABEL_GIT_TAG} .. 34 | -------------------------------------------------------------------------------- /webstorm.config.js: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | 'use strict' 19 | const path = require('path') 20 | 21 | function resolve (dir) { 22 | return path.join(__dirname, '.', dir) 23 | } 24 | 25 | module.exports = { 26 | context: path.resolve(__dirname, './'), 27 | resolve: { 28 | extensions: ['.js', '.vue', '.json'], 29 | alias: { 30 | '@': resolve('src'), 31 | '@views': resolve('src/views'), 32 | '@comp': resolve('src/components'), 33 | '@core': resolve('src/core'), 34 | '@utils': resolve('src/utils') 35 | } 36 | } 37 | } 38 | --------------------------------------------------------------------------------