Skip to content

Commit 64f792b

Browse files
author
Daan Hoogland
committed
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)
2 parents 4e90a8c + bd79e1a commit 64f792b

8 files changed

Lines changed: 54 additions & 18 deletions

File tree

ui/src/components/view/ActionButton.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
<template>
1919
<span class="row-action-button">
20-
<a-tooltip arrowPointAtCenter placement="bottomRight">
20+
<a-tooltip arrowPointAtCenter placement="bottomRight" v-if="resource && resource.id && dataView">
2121
<template slot="title">
2222
{{ $t('label.view.console') }}
2323
</template>
24-
<console :resource="resource" :size="size" v-if="resource && resource.id && dataView" />
24+
<console :resource="resource" :size="size" />
2525
</a-tooltip>
2626
<a-tooltip
2727
v-for="(action, actionIndex) in actions"

ui/src/components/view/InfoCard.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@
262262
<a-progress
263263
class="progress-bar"
264264
size="small"
265-
:percent="Number(parseFloat(100.0 * parseFloat(resource.disksizeallocatedgb) / parseFloat(resource.disksizetotalgb)).toFixed(2))"
265+
:percent="Number(parseFloat(100.0 * parseFloat(resource.disksizeallocatedgb) / (parseFloat(resource.disksizetotalgb) *
266+
(parseFloat(resource.overprovisionfactor) || 1.0))).toFixed(2))"
266267
:format="(percent, successPercent) => parseFloat(percent).toFixed(2) + '% ' + $t('label.disksizeallocatedgb')" />
267268
</span>
268269
</div>

ui/src/components/view/SearchView.vue

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
<a-select
5454
allowClear
5555
v-if="field.type==='list'"
56-
v-decorator="[field.name]"
56+
v-decorator="[field.name, {
57+
initialValue: fieldValues[field.name] || null
58+
}]"
5759
:loading="field.loading">
5860
<a-select-option
5961
v-for="(opt, idx) in field.opts"
@@ -62,7 +64,9 @@
6264
</a-select>
6365
<a-input
6466
v-else-if="field.type==='input'"
65-
v-decorator="[field.name]" />
67+
v-decorator="[field.name, {
68+
initialValue: fieldValues[field.name] || null
69+
}]" />
6670
<div v-else-if="field.type==='tag'">
6771
<div>
6872
<a-input-group
@@ -135,7 +139,8 @@ export default {
135139
visibleFilter: false,
136140
fields: [],
137141
inputKey: null,
138-
inputValue: null
142+
inputValue: null,
143+
fieldValues: {}
139144
}
140145
},
141146
beforeCreate () {
@@ -275,7 +280,6 @@ export default {
275280
}
276281
if (clusterIndex > -1) {
277282
const cluster = response.filter(item => item.type === 'clusterid')
278-
console.log(cluster)
279283
if (cluster && cluster.length > 0) {
280284
this.fields[clusterIndex].opts = cluster[0].data
281285
}
@@ -294,8 +298,20 @@ export default {
294298
if (clusterIndex > -1) {
295299
this.fields[clusterIndex].loading = false
296300
}
301+
this.fillFormFieldValues()
297302
})
298303
},
304+
fillFormFieldValues () {
305+
this.fieldValues = {}
306+
if (Object.keys(this.$route.query).length > 0) {
307+
this.fieldValues = this.$route.query
308+
}
309+
if (this.$route.meta.params) {
310+
Object.assign(this.fieldValues, this.$route.meta.params)
311+
}
312+
this.inputKey = this.fieldValues['tags[0].key'] || null
313+
this.inputValue = this.fieldValues['tags[0].value'] || null
314+
},
299315
fetchZones () {
300316
return new Promise((resolve, reject) => {
301317
api('listZones', { listAll: true }).then(json => {

ui/src/views/AutogenView.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ export default {
608608
609609
params.page = this.page
610610
params.pagesize = this.pageSize
611+
this.searchParams = params
611612
api(this.apiName, params).then(json => {
612613
var responseName
613614
var objectName

ui/src/views/infra/ClusterAdd.vue

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,19 +247,30 @@ export default {
247247
}
248248
this.loading = true
249249
this.parentToggleLoading()
250-
api('addCluster', {}, 'POST', {
250+
var data = {
251251
zoneId: this.zoneId,
252252
hypervisor: this.hypervisor,
253253
clustertype: this.clustertype,
254254
podId: this.podId,
255255
clustername: this.clustername,
256-
ovm3pool: this.ovm3pool,
257-
ovm3cluster: this.ovm3cluster,
258-
ovm3vip: this.ovm3vip,
259-
username: this.username,
260-
password: this.password,
261256
url: this.url
262-
}).then(response => {
257+
}
258+
if (this.ovm3pool) {
259+
data.ovm3pool = this.ovm3pool
260+
}
261+
if (this.ovm3cluster) {
262+
data.ovm3cluster = this.ovm3cluster
263+
}
264+
if (this.ovm3vip) {
265+
data.ovm3vip = this.ovm3vip
266+
}
267+
if (this.username) {
268+
data.username = this.username
269+
}
270+
if (this.password) {
271+
data.password = this.password
272+
}
273+
api('addCluster', {}, 'POST', data).then(response => {
263274
const cluster = response.addclusterresponse.cluster[0] || {}
264275
if (cluster.id && this.showDedicated) {
265276
this.dedicateCluster(cluster.id)

ui/src/views/infra/zone/ZoneWizardAddResources.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ export default {
351351
}
352352
},
353353
{
354-
title: 'label.SR.name',
354+
title: 'label.sr.name',
355355
key: 'primaryStorageSRLabel',
356356
placeHolder: 'message.error.sr.namelabel',
357357
required: true,

ui/src/views/infra/zone/ZoneWizardLaunchZone.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ export default {
12831283
}
12841284
}
12851285
1286-
const server = this.prefillContent.primaryStorageServer ? this.prefillContent.primaryStorageServer.value : null
1286+
var server = this.prefillContent.primaryStorageServer ? this.prefillContent.primaryStorageServer.value : null
12871287
let url = ''
12881288
const protocol = this.prefillContent.primaryStorageProtocol.value
12891289
@@ -1303,7 +1303,13 @@ export default {
13031303
params['details[0].password'] = this.prefillContent.primaryStorageSMBPassword.value
13041304
params['details[0].domain'] = this.prefillContent.primaryStorageSMBDomain.value
13051305
} else if (protocol === 'PreSetup') {
1306-
let path = this.prefillContent.primaryStoragePath.value
1306+
let path = ''
1307+
if (this.stepData.clusterReturned.hypervisortype === 'XenServer') {
1308+
path = this.prefillContent.primaryStorageSRLabel.value
1309+
server = 'localhost'
1310+
} else {
1311+
path = this.prefillContent.primaryStoragePath.value
1312+
}
13071313
if (path.substring(0, 1) !== '/') {
13081314
path = '/' + path
13091315
}

utils/src/test/java/com/cloud/utils/backoff/impl/ConstantTimeBackoffTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ public void run() {
4343
Thread.sleep(100);
4444
Assert.assertFalse(backoff.getWaiters().isEmpty());
4545
waitThread.interrupt();
46-
Thread.sleep(100);
46+
final int TIMEOUT_AFTER_INTERUPT = 500;
47+
Thread.sleep(TIMEOUT_AFTER_INTERUPT);
4748
Assert.assertTrue(backoff.getWaiters().isEmpty());
4849
}
4950

0 commit comments

Comments
 (0)