Merge release branch 4.15 to master

* 4.15:
  ui: Consider overprovisioning factor when displaying allocated progress bar (#4850)
  ui: Fix the styles action button (#4856)
  ui: Fill out the search filter form field after performing a filter (#4855)
  ui: fix add cluster form for vmware (#4841)
  ui: Fix add primary store during Zone Deployment for PreSetup protocol (#4845)
  tests: Extend wait time after interrupt (#4815)
This commit is contained in:
Daan Hoogland 2021-03-23 15:36:30 +01:00
commit 64f792bd7c
8 changed files with 54 additions and 18 deletions

View File

@ -17,11 +17,11 @@
<template>
<span class="row-action-button">
<a-tooltip arrowPointAtCenter placement="bottomRight">
<a-tooltip arrowPointAtCenter placement="bottomRight" v-if="resource && resource.id && dataView">
<template slot="title">
{{ $t('label.view.console') }}
</template>
<console :resource="resource" :size="size" v-if="resource && resource.id && dataView" />
<console :resource="resource" :size="size" />
</a-tooltip>
<a-tooltip
v-for="(action, actionIndex) in actions"

View File

@ -262,7 +262,8 @@
<a-progress
class="progress-bar"
size="small"
:percent="Number(parseFloat(100.0 * parseFloat(resource.disksizeallocatedgb) / parseFloat(resource.disksizetotalgb)).toFixed(2))"
:percent="Number(parseFloat(100.0 * parseFloat(resource.disksizeallocatedgb) / (parseFloat(resource.disksizetotalgb) *
(parseFloat(resource.overprovisionfactor) || 1.0))).toFixed(2))"
:format="(percent, successPercent) => parseFloat(percent).toFixed(2) + '% ' + $t('label.disksizeallocatedgb')" />
</span>
</div>

View File

@ -53,7 +53,9 @@
<a-select
allowClear
v-if="field.type==='list'"
v-decorator="[field.name]"
v-decorator="[field.name, {
initialValue: fieldValues[field.name] || null
}]"
:loading="field.loading">
<a-select-option
v-for="(opt, idx) in field.opts"
@ -62,7 +64,9 @@
</a-select>
<a-input
v-else-if="field.type==='input'"
v-decorator="[field.name]" />
v-decorator="[field.name, {
initialValue: fieldValues[field.name] || null
}]" />
<div v-else-if="field.type==='tag'">
<div>
<a-input-group
@ -135,7 +139,8 @@ export default {
visibleFilter: false,
fields: [],
inputKey: null,
inputValue: null
inputValue: null,
fieldValues: {}
}
},
beforeCreate () {
@ -275,7 +280,6 @@ export default {
}
if (clusterIndex > -1) {
const cluster = response.filter(item => item.type === 'clusterid')
console.log(cluster)
if (cluster && cluster.length > 0) {
this.fields[clusterIndex].opts = cluster[0].data
}
@ -294,8 +298,20 @@ export default {
if (clusterIndex > -1) {
this.fields[clusterIndex].loading = false
}
this.fillFormFieldValues()
})
},
fillFormFieldValues () {
this.fieldValues = {}
if (Object.keys(this.$route.query).length > 0) {
this.fieldValues = this.$route.query
}
if (this.$route.meta.params) {
Object.assign(this.fieldValues, this.$route.meta.params)
}
this.inputKey = this.fieldValues['tags[0].key'] || null
this.inputValue = this.fieldValues['tags[0].value'] || null
},
fetchZones () {
return new Promise((resolve, reject) => {
api('listZones', { listAll: true }).then(json => {

View File

@ -608,6 +608,7 @@ export default {
params.page = this.page
params.pagesize = this.pageSize
this.searchParams = params
api(this.apiName, params).then(json => {
var responseName
var objectName

View File

@ -247,19 +247,30 @@ export default {
}
this.loading = true
this.parentToggleLoading()
api('addCluster', {}, 'POST', {
var data = {
zoneId: this.zoneId,
hypervisor: this.hypervisor,
clustertype: this.clustertype,
podId: this.podId,
clustername: this.clustername,
ovm3pool: this.ovm3pool,
ovm3cluster: this.ovm3cluster,
ovm3vip: this.ovm3vip,
username: this.username,
password: this.password,
url: this.url
}).then(response => {
}
if (this.ovm3pool) {
data.ovm3pool = this.ovm3pool
}
if (this.ovm3cluster) {
data.ovm3cluster = this.ovm3cluster
}
if (this.ovm3vip) {
data.ovm3vip = this.ovm3vip
}
if (this.username) {
data.username = this.username
}
if (this.password) {
data.password = this.password
}
api('addCluster', {}, 'POST', data).then(response => {
const cluster = response.addclusterresponse.cluster[0] || {}
if (cluster.id && this.showDedicated) {
this.dedicateCluster(cluster.id)

View File

@ -351,7 +351,7 @@ export default {
}
},
{
title: 'label.SR.name',
title: 'label.sr.name',
key: 'primaryStorageSRLabel',
placeHolder: 'message.error.sr.namelabel',
required: true,

View File

@ -1283,7 +1283,7 @@ export default {
}
}
const server = this.prefillContent.primaryStorageServer ? this.prefillContent.primaryStorageServer.value : null
var server = this.prefillContent.primaryStorageServer ? this.prefillContent.primaryStorageServer.value : null
let url = ''
const protocol = this.prefillContent.primaryStorageProtocol.value
@ -1303,7 +1303,13 @@ export default {
params['details[0].password'] = this.prefillContent.primaryStorageSMBPassword.value
params['details[0].domain'] = this.prefillContent.primaryStorageSMBDomain.value
} else if (protocol === 'PreSetup') {
let path = this.prefillContent.primaryStoragePath.value
let path = ''
if (this.stepData.clusterReturned.hypervisortype === 'XenServer') {
path = this.prefillContent.primaryStorageSRLabel.value
server = 'localhost'
} else {
path = this.prefillContent.primaryStoragePath.value
}
if (path.substring(0, 1) !== '/') {
path = '/' + path
}

View File

@ -43,7 +43,8 @@ public class ConstantTimeBackoffTest {
Thread.sleep(100);
Assert.assertFalse(backoff.getWaiters().isEmpty());
waitThread.interrupt();
Thread.sleep(100);
final int TIMEOUT_AFTER_INTERUPT = 500;
Thread.sleep(TIMEOUT_AFTER_INTERUPT);
Assert.assertTrue(backoff.getWaiters().isEmpty());
}