dashboard: fix lint and translations

Fixes translations on metrics and local storage values

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2020-06-06 00:46:36 +05:30
parent e979ae58df
commit 773d31b140
3 changed files with 38 additions and 25 deletions

View File

@ -1166,7 +1166,7 @@
"label.maxvpc": "Max. VPCs",
"label.may.continue": "You may now continue.",
"label.memallocated": "Mem Allocation",
"label.memory": "Memory (in MB)",
"label.memory": "Memory",
"label.memory.maximum.mb": "Max Memory (in MB)",
"label.memory.total": "Memory Total",
"label.memory.used": "Memory Used",

View File

@ -54,7 +54,7 @@
:key="stat.type">
<chart-card :loading="loading">
<div class="capacity-dashboard-chart-card-inner">
<h4>{{ $t(stat.name) }}</h4>
<h4>{{ $t(ts[stat.name]) }}</h4>
<a-progress
type="dashboard"
:status="getStatus(parseFloat(stat.percentused))"
@ -138,7 +138,20 @@ export default {
events: [],
zones: [],
zoneSelected: {},
stats: []
stats: [],
ts: {
CPU: 'label.cpu',
CPU_CORE: 'label.cpunumber',
GPU: 'label.gpu',
LOCAL_STORAGE: 'label.local.storage',
MEMORY: 'label.memory',
PRIVATE_IP: 'label.management.ips',
SECONDARY_STORAGE: 'label.secondary.storage',
STORAGE: 'label.storage',
STORAGE_ALLOCATED: 'label.primary.storage',
VIRTUAL_NETWORK_PUBLIC_IP: 'label.public.ips',
VLAN: 'label.vlan'
}
}
},
mounted () {
@ -181,7 +194,7 @@ export default {
case 'STORAGE':
case 'STORAGE_ALLOCATED':
case 'SECONDARY_STORAGE':
case 'CAPACITY_TYPE_LOCAL_STORAGE':
case 'LOCAL_STORAGE':
value = parseFloat(value / (1024 * 1024 * 1024.0), 10).toFixed(2)
if (value >= 1024.0) {
value = parseFloat(value / 1024.0).toFixed(2) + ' TB'

View File

@ -136,27 +136,27 @@
}]"
/>
</a-form-item>
<a-form-item
:label="$t('label.ip6gateway')"
v-bind="formItemLayout"
v-if="isAdvancedZone && securityGroupsEnabled"
has-feedback>
<a-input
v-decorator="['ip6gateway', {
rules: [
{
message: 'Please enter IpV6 Gateway',
initialValue: ip6gateway
},
{
validator: checkIpFormat,
ipV6: true,
message: 'Please enter a valid IPv6 Gatweay.'
}
]
}]"
/>
</a-form-item>
<a-form-item
:label="$t('label.ip6gateway')"
v-bind="formItemLayout"
v-if="isAdvancedZone && securityGroupsEnabled"
has-feedback>
<a-input
v-decorator="['ip6gateway', {
rules: [
{
message: 'Please enter IpV6 Gateway',
initialValue: ip6gateway
},
{
validator: checkIpFormat,
ipV6: true,
message: 'Please enter a valid IPv6 Gatweay.'
}
]
}]"
/>
</a-form-item>
<a-form-item
:label="$t('label.internal.dns.1')"
v-bind="formItemLayout"