From 56ca7331d6e50667ab6cde653ca3b36d6620b306 Mon Sep 17 00:00:00 2001 From: davidjumani Date: Sat, 4 Jul 2020 12:19:38 +0530 Subject: [PATCH] component: Adding contextual info for resource status (#482) Fixes #466 Signed-off-by: Rohit Yadav --- ui/src/components/view/InfoCard.vue | 9 ++--- ui/src/components/widgets/Status.vue | 27 ++++++++++++--- ui/src/locales/en.json | 50 ++++++++++++++++++++++++++-- 3 files changed, 74 insertions(+), 12 deletions(-) diff --git a/ui/src/components/view/InfoCard.vue b/ui/src/components/view/InfoCard.vue index 70f43f73c14..c0d08783bd8 100644 --- a/ui/src/components/view/InfoCard.vue +++ b/ui/src/components/view/InfoCard.vue @@ -73,22 +73,19 @@
{{ $t('label.status') }}
- - {{ resource.state || resource.status }} +
{{ $t('label.allocationstate') }}
- - {{ resource.allocationstate }} +
{{ $t('label.resourcestate') }}
- - {{ resource.resourcestate }} +
diff --git a/ui/src/components/widgets/Status.vue b/ui/src/components/widgets/Status.vue index 2301d565392..db2d63d7bd5 100644 --- a/ui/src/components/widgets/Status.vue +++ b/ui/src/components/widgets/Status.vue @@ -16,10 +16,7 @@ // under the License. @@ -97,6 +94,28 @@ export default { break } return status + }, + getTooltip (state) { + if (!(state && this.displayText)) { + return + } + if (this.$route.path === '/vmsnapshot' || this.$route.path.includes('/vmsnapshot/')) { + return 'message.vmsnapshot.state.' + state.toLowerCase() + } + if (this.$route.path === '/vm' || this.$route.path.includes('/vm/')) { + return 'message.vm.state.' + state.toLowerCase() + } + if (this.$route.path === '/volume' || this.$route.path.includes('/volume/')) { + return 'message.volume.state.' + state.toLowerCase() + } + if (this.$route.path === '/guestnetwork' || this.$route.path.includes('/guestnetwork/')) { + return 'message.guestnetwork.state.' + state.toLowerCase() + } + if (this.$route.path === '/publicip' || this.$route.path.includes('/publicip/')) { + return 'message.publicip.state.' + state.toLowerCase() + } + // Nothing for snapshots, vpcs, gateways, vnpnconn, vpnuser, kubectl, event, project, account, infra. They're all self explanatory + return state } } } diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json index c076e55d5ef..358f91afdd8 100644 --- a/ui/src/locales/en.json +++ b/ui/src/locales/en.json @@ -1687,8 +1687,6 @@ "label.rules.file": "Rules File", "label.rules.file.import.description": "Click or drag rule defintions CVS file to import", "label.running": "Running VMs", -"label.saml.disable": "SAML Disable", -"label.saml.enable": "SAML Enable", "label.s3.access.key": "Access Key", "label.s3.bucket": "Bucket", "label.s3.connection.timeout": "Connection Timeout", @@ -1699,6 +1697,8 @@ "label.s3.secret.key": "Secret Key", "label.s3.socket.timeout": "Socket Timeout", "label.s3.use.https": "Use HTTPS", +"label.saml.disable": "SAML Disable", +"label.saml.enable": "SAML Enable", "label.samlenable": "Authorize SAML SSO", "label.samlentity": "Identity Provider", "label.saturday": "Saturday", @@ -2485,6 +2485,12 @@ "message.gslb.lb.remove.confirm": "Please confirm you want to remove load balancing from GSLB", "message.guest.traffic.in.advanced.zone": "Guest network traffic is communication between end-user virtual machines. Specify a range of VLAN IDs to carry guest traffic for each physical network.", "message.guest.traffic.in.basic.zone": "Guest network traffic is communication between end-user virtual machines. Specify a range of IP addresses that CloudStack can assign to guest VMs. Make sure this range does not overlap the reserved system IP range.", +"message.guestnetwork.state.allocated": "Indicates the network configuration is in allocated but not setup", +"message.guestnetwork.state.destroy": "Indicates that the network is destroyed", +"message.guestnetwork.state.implemented": "Indicates the network configuration is in use", +"message.guestnetwork.state.implementing": "Indicates the network configuration is being implemented", +"message.guestnetwork.state.setup": "Indicates the network configuration is setup", +"message.guestnetwork.state.shutdown": "Indicates the network configuration is being destroyed", "message.host.dedicated": "Host Dedicated", "message.host.dedication.released": "Host dedication released", "message.installwizard.click.retry": "Click the button to retry launch.", @@ -2579,6 +2585,10 @@ "message.project.invite.sent": "Invite sent to user; they will be added to the project once they accept the invitation", "message.public.traffic.in.advanced.zone": "Public traffic is generated when VMs in the cloud access the internet. Publicly-accessible IPs must be allocated for this purpose. End users can use the CloudStack UI to acquire these IPs to implement NAT between their guest network and their public network.

Provide at least one range of IP addresses for internet traffic.", "message.public.traffic.in.basic.zone": "Public traffic is generated when VMs in the cloud access the Internet or provide services to clients over the Internet. Publicly accessible IPs must be allocated for this purpose. When a instance is created, an IP from this set of Public IPs will be allocated to the instance in addition to the guest IP address. Static 1-1 NAT will be set up automatically between the public IP and the guest IP. End users can also use the CloudStack UI to acquire additional IPs to implement static NAT between their instances and the public IP.", +"message.publicip.state.allocating": "The IP Address is being propagated to other network elements and is not ready for use yet.", +"message.publicip.state.allocated": "The IP address is in used.", +"message.publicip.state.free": "The IP address is ready to be allocated.", +"message.publicip.state.releasing": "The IP address is being released for other network elements and is not ready for allocation.", "message.question.are.you.sure.you.want.to.add": "Are you sure you want to add", "message.read.admin.guide.scaling.up": "Please read the dynamic scaling section in the admin guide before scaling up.", "message.recover.vm": "Please confirm that you would like to recover this VM.", @@ -2672,10 +2682,46 @@ "message.virtual.network.desc": "A dedicated virtualized network for your account. The broadcast domain is contained within a VLAN and all public network access is routed out by a virtual router.", "message.vm.create.template.confirm": "Create Template will reboot the VM automatically.", "message.vm.review.launch": "Please review the following information and confirm that your virtual instance is correct before launch.", +"message.vm.state.destroyed": "VM is marked for destroy", +"message.vm.state.error": "VM is in error", +"message.vm.state.expunging": "VM is being expunged", +"message.vm.state.migrating": "VM is being migrated", +"message.vm.state.running": "VM is running", +"message.vm.state.shutdown": "VM state is shutdown from inside", +"message.vm.state.starting": "VM is being started", +"message.vm.state.stopped": "VM is stopped", +"message.vm.state.stopping": "VM is being stopped", +"message.vm.state.unknown": "VM state is unknown.", +"message.vmsnapshot.state.allocated": "The VM snapshot is allocated but has not been created yet", +"message.vmsnapshot.state.creating": "The VM snapshot is being created", +"message.vmsnapshot.state.error": "The VM snapshot is in error state, and can't be recovered", +"message.vmsnapshot.state.expunging": "The VM snapshot is being expunging", +"message.vmsnapshot.state.ready": "The VM snapshot is ready to be used", +"message.vmsnapshot.state.removed": "The VM snapshot is destroyed, and can't be recovered", +"message.vmsnapshot.state.reverting": "The VM snapshot is being used to revert", "message.vnmc.available.list": "VNMC is not available from provider list.", "message.vnmc.not.available.list": "VNMC is not available from provider list.", "message.volume.create.template.confirm": "Please confirm that you wish to create a template for this disk volume. Creation of the template can range from several minutes to longer depending on the size of the volume.", "message.volume.root.shrink.disk.size": "Shrink operation on ROOT volume not supported", +"message.volume.state.allocated": "The volume is allocated but has not been created yet", +"message.volume.state.attaching": "The volume is attaching to a volume from Ready state.", +"message.volume.state.copying": "Volume is copying from image store to primary, in case it's an uploaded volume", +"message.volume.state.creating": "The volume is being created", +"message.volume.state.destroy": "The volume is destroyed, and can't be recovered", +"message.volume.state.destroying": "The volume is destroying, and can't be recovered", +"message.volume.state.expunged": "The volume has been expunged", +"message.volume.state.expunging": "The volume is being expunging", +"message.volume.state.migrating": "The volume is migrating to other storage pool", +"message.volume.state.notuploaded": "The volume entry is just created in DB, not yet uploaded", +"message.volume.state.ready": "The volume is ready to be used", +"message.volume.state.resizing": "The volume is being resized", +"message.volume.state.revertsnapshotting": "There is a snapshot created on this volume, the volume is being reverting from snapshot", +"message.volume.state.snapshotting": "There is a snapshot created on this volume, not backed up to secondary storage yet", +"message.volume.state.uploadabandoned": "Volume upload is abandoned since the upload was never initiated within a specificed time", +"message.volume.state.uploaded": "Volume is uploaded", +"message.volume.state.uploaderror": "Volume upload encountered some error", +"message.volume.state.uploadinprogress": "Volume upload is in progress", +"message.volume.state.uploadop": "The volume upload operation is in progress or in short the volume is on secondary storage", "message.waiting.for.builtin.templates.to.load": "Waiting for builtin templates to load...", "message.xstools61plus.update.failed": "Failed to update Original XS Version is 6.1+ field. Error:", "message.you.must.have.at.least.one.physical.network": "You must have at least one physical network",