|
93 | 93 | optionFilterProp="children" |
94 | 94 | :filterOption="(input, option) => { |
95 | 95 | return option.componentOptions.propsData.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
96 | | - }" > |
| 96 | + }" |
| 97 | + @change="val => this.fetchAccount(val)" > |
97 | 98 | <a-select-option v-for="domain in domainsList" :key="domain.id" :label="domain.path || domain.name || domain.description"> |
98 | 99 | <span> |
99 | 100 | <resource-icon v-if="domain && domain.icon" :image="domain.icon.base64image" size="1x" style="margin-right: 5px"/> |
@@ -192,7 +193,6 @@ export default { |
192 | 193 | timeZoneMap: [], |
193 | 194 | domainLoading: false, |
194 | 195 | domainsList: [], |
195 | | - selectedDomain: '', |
196 | 196 | samlEnable: false, |
197 | 197 | idpLoading: false, |
198 | 198 | idps: [], |
@@ -220,36 +220,41 @@ export default { |
220 | 220 | if (!this.domianid) { |
221 | 221 | this.fetchDomains() |
222 | 222 | } |
223 | | - if (!this.account) { |
224 | | - this.fetchAccount() |
225 | | - } |
226 | 223 | this.fetchTimeZone() |
227 | 224 | if (this.samlAllowed) { |
228 | 225 | this.fetchIdps() |
229 | 226 | } |
230 | 227 | }, |
231 | 228 | fetchDomains () { |
232 | 229 | this.domainLoading = true |
233 | | - api('listDomains', { |
| 230 | + var params = { |
234 | 231 | listAll: true, |
235 | 232 | showicon: true, |
236 | 233 | details: 'min' |
237 | | - }).then(response => { |
| 234 | + } |
| 235 | + api('listDomains', params).then(response => { |
238 | 236 | this.domainsList = response.listdomainsresponse.domain || [] |
239 | | - this.selectedDomain = this.domainsList[0].id || '' |
240 | 237 | }).catch(error => { |
241 | 238 | this.$notification.error({ |
242 | 239 | message: `${this.$t('label.error')} ${error.response.status}`, |
243 | 240 | description: error.response.data.errorresponse.errortext |
244 | 241 | }) |
245 | 242 | }).finally(() => { |
| 243 | + const domainid = this.domainsList[0].id || '' |
| 244 | + this.form.setFieldsValue({ domainid: domainid }) |
| 245 | + this.fetchAccount(domainid) |
246 | 246 | this.domainLoading = false |
247 | 247 | }) |
248 | 248 | }, |
249 | | - fetchAccount () { |
| 249 | + fetchAccount (domainid) { |
250 | 250 | this.accountList = [] |
| 251 | + this.form.setFieldsValue({ account: null }) |
251 | 252 | this.loadingAccount = true |
252 | | - api('listAccounts', { listAll: true, showicon: true }).then(response => { |
| 253 | + var params = { listAll: true, showicon: true } |
| 254 | + if (domainid) { |
| 255 | + params.domainid = domainid |
| 256 | + } |
| 257 | + api('listAccounts', params).then(response => { |
253 | 258 | this.accountList = response.listaccountsresponse.account || [] |
254 | 259 | }).catch(error => { |
255 | 260 | this.$notification.error({ |
|
0 commit comments