This is an automated email from the ASF dual-hosted git repository. pearl11594 pushed a commit to branch fix-nsp-disabled-errors in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit a038862c8eb4fcbbb206c72e4802e3b39ba82877 Author: Pearl Dsilva <pearl1...@gmail.com> AuthorDate: Thu Aug 7 11:57:38 2025 -0400 UI: Prevent exceptions when network service provider that's disabled is viewed --- .../views/infra/network/providers/ProviderItem.vue | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/ui/src/views/infra/network/providers/ProviderItem.vue b/ui/src/views/infra/network/providers/ProviderItem.vue index 6130b75148d..36c0a1451e7 100644 --- a/ui/src/views/infra/network/providers/ProviderItem.vue +++ b/ui/src/views/infra/network/providers/ProviderItem.vue @@ -93,7 +93,8 @@ export default { currentAction: {}, page: 1, pageSize: 10, - itemCount: 0 + itemCount: 0, + pluginEnabled: false } }, provide () { @@ -139,6 +140,19 @@ export default { this.provider.lists.map(this.fetchOptions) } }, + async fetchConfiguration (configName) { + const params = { + name: configName + } + getAPI('listConfigurations', params).then(json => { + if (json.listconfigurationsresponse.configuration !== null) { + const config = json.listconfigurationsresponse.configuration[0] + if (config && config.name === params.name) { + this.pluginEnabled = config.value + } + } + }) + }, async fetchOptions (args) { if (!args || Object.keys(args).length === 0) { return @@ -185,6 +199,18 @@ export default { } try { + const providers = ['tungsten', 'nsx', 'netris'] + const apiLower = args.api.toLowerCase() + + for (const provider of providers) { + if (apiLower.includes(provider)) { + await this.fetchConfiguration(`${provider}.plugin.enable`) + if (!this.pluginEnabled) { + this.listData[args.title].loading = false + return + } + } + } const listResult = await this.executeApi(args.api, params) this.listData[args.title].data = listResult.data this.listData[args.title].itemCount = listResult.itemCount