Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,7 @@
"label.isdedicated": "Dedicated",
"label.isdefault": "Is default",
"label.isdynamicallyscalable": "Dynamically scalable",
"label.isencrypted": "Encrypted",
"label.istagarule": "Tag as JS rule",
"label.isextractable": "Extractable",
"label.isfeatured": "Featured",
Expand Down
30 changes: 29 additions & 1 deletion ui/src/components/view/SearchView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@
<tooltip-button :tooltip="$t('label.clear')" icon="close-outlined" size="small" @onClick="inputKey = inputValue = ''" />
</a-input-group>
</div>
<a-switch
v-else-if="field.type==='boolean'"
v-model:checked="form[field.name]"
/>
<a-auto-complete
v-else-if="field.type==='autocomplete'"
v-model:value="form[field.name]"
Expand Down Expand Up @@ -294,7 +298,9 @@ export default {
if (item === 'usagetype' && !('listUsageTypes' in this.$store.getters.apis)) {
return true
}

if (item === 'isencrypted' && !('listVolumes' in this.$store.getters.apis)) {
return true
}
if (['zoneid', 'domainid', 'imagestoreid', 'storageid', 'state', 'account', 'hypervisor', 'level',
'clusterid', 'podid', 'groupid', 'entitytype', 'accounttype', 'systemvmtype', 'scope', 'provider',
'type', 'scope', 'managementserverid', 'serviceofferingid', 'diskofferingid', 'usagetype'].includes(item)
Expand All @@ -304,6 +310,8 @@ export default {
type = 'tag'
} else if (item === 'resourcetype') {
type = 'autocomplete'
} else if (item === 'isencrypted') {
type = 'boolean'
}

this.fields.push({
Expand Down Expand Up @@ -420,6 +428,7 @@ export default {
let serviceOfferingIndex = -1
let diskOfferingIndex = -1
let usageTypeIndex = -1
let volumeIndex = -1

if (arrayField.includes('type')) {
if (this.$route.path === '/alert') {
Expand Down Expand Up @@ -511,6 +520,12 @@ export default {
promises.push(await this.fetchUsageTypes())
}

if (arrayField.includes('isencrypted')) {
volumeIndex = this.fields.findIndex(item => item.name === 'isencrypted')
this.fields[volumeIndex].loading = true
promises.push(await this.fetchVolumes(searchKeyword))
}

Promise.all(promises).then(response => {
if (typeIndex > -1) {
const types = response.filter(item => item.type === 'type')
Expand Down Expand Up @@ -884,6 +899,19 @@ export default {
})
}
},
fetchVolumes (searchKeyword) {
return new Promise((resolve, reject) => {
api('listvolumes', { listAll: true, isencrypted: searchKeyword }).then(json => {
const volumes = json.listvolumesresponse.volume
resolve({
type: 'isencrypted',
data: volumes
})
}).catch(error => {
reject(error.response.headers['x-description'])
})
})
},
fetchManagementServers (searchKeyword) {
return new Promise((resolve, reject) => {
api('listManagementServers', { listAll: true, keyword: searchKeyword }).then(json => {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/config/section/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default {
}
],
searchFilters: () => {
var filters = ['name', 'zoneid', 'domainid', 'account', 'state', 'tags', 'serviceofferingid', 'diskofferingid']
var filters = ['name', 'zoneid', 'domainid', 'account', 'state', 'tags', 'serviceofferingid', 'diskofferingid', 'isencrypted']
if (['Admin', 'DomainAdmin'].includes(store.getters.userInfo.roletype)) {
filters.push('storageid')
}
Expand Down