You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pe...@apache.org on 2024/08/19 23:00:40 UTC
(cloudstack) branch add-is-encrypted-vol-filter created (now 42380ea4931)
This is an automated email from the ASF dual-hosted git repository.
pearl11594 pushed a change to branch add-is-encrypted-vol-filter
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
at 42380ea4931 UI: Add filter to list encrypted volumes
This branch includes the following new commits:
new 42380ea4931 UI: Add filter to list encrypted volumes
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(cloudstack) 01/01: UI: Add filter to list encrypted volumes
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pearl11594 pushed a commit to branch add-is-encrypted-vol-filter
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 42380ea49312dd5186064c1d58da72e96d0d11d7
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Mon Aug 19 19:00:26 2024 -0400
UI: Add filter to list encrypted volumes
---
ui/public/locales/en.json | 1 +
ui/src/components/view/SearchView.vue | 30 +++++++++++++++++++++++++++++-
ui/src/config/section/storage.js | 2 +-
3 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json
index b42899fc631..cda4e34618a 100644
--- a/ui/public/locales/en.json
+++ b/ui/public/locales/en.json
@@ -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",
diff --git a/ui/src/components/view/SearchView.vue b/ui/src/components/view/SearchView.vue
index 7883b162d66..07e2d14e8bc 100644
--- a/ui/src/components/view/SearchView.vue
+++ b/ui/src/components/view/SearchView.vue
@@ -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]"
@@ -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)
@@ -304,6 +310,8 @@ export default {
type = 'tag'
} else if (item === 'resourcetype') {
type = 'autocomplete'
+ } else if (item === 'isencrypted') {
+ type = 'boolean'
}
this.fields.push({
@@ -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') {
@@ -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')
@@ -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 => {
diff --git a/ui/src/config/section/storage.js b/ui/src/config/section/storage.js
index 28c451105a1..4c76ebf8db3 100644
--- a/ui/src/config/section/storage.js
+++ b/ui/src/config/section/storage.js
@@ -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')
}