mirror of https://github.com/rancher/ui.git
commit
d7082a9f91
|
|
@ -16,6 +16,8 @@ import {
|
|||
} from 'ui/utils/azure-choices';
|
||||
|
||||
const NETWORK_POLICY = ['Calico']
|
||||
const CHINA_REGION_API_URL = 'https://management.chinacloudapi.cn/';
|
||||
const CHINA_REGION_AUTH_URL = 'https://login.chinacloudapi.cn/';
|
||||
|
||||
export default Component.extend(ClusterDriver, {
|
||||
globalStore: service(),
|
||||
|
|
@ -80,6 +82,14 @@ export default Component.extend(ClusterDriver, {
|
|||
tenantId: get(this, 'config.tenantId'),
|
||||
region: get(this, 'config.location')
|
||||
};
|
||||
|
||||
if ( get(this, 'isChinaRegion') ) {
|
||||
setProperties(data, {
|
||||
baseUrl: CHINA_REGION_API_URL,
|
||||
authBaseUrl: CHINA_REGION_AUTH_URL
|
||||
})
|
||||
}
|
||||
|
||||
const aksRequest = {
|
||||
versions: store.rawRequest({
|
||||
url: '/meta/aksVersions',
|
||||
|
|
@ -183,6 +193,10 @@ export default Component.extend(ClusterDriver, {
|
|||
return ( get(this, 'mode') === 'edit' || get(this, 'mode') === 'new' ) ? true : false;
|
||||
}),
|
||||
|
||||
isChinaRegion: computed('config.location', function() {
|
||||
return get(this, 'config.location').startsWith('china');
|
||||
}),
|
||||
|
||||
saveDisabled: computed('config.subscriptionId', 'config.tenantId', 'config.clientId', 'config.clientSecret', 'config.location', function() {
|
||||
return get(this, 'config.tenantId') && get(this, 'config.clientId') && get(this, 'config.clientSecret') && get(this, 'config.subscriptionId') && get(this, 'config.location') ? false : true;
|
||||
}),
|
||||
|
|
@ -295,6 +309,16 @@ export default Component.extend(ClusterDriver, {
|
|||
})
|
||||
}
|
||||
|
||||
if ( get(this, 'isChinaRegion') ) {
|
||||
setProperties(config, {
|
||||
baseUrl: CHINA_REGION_API_URL,
|
||||
authBaseUrl: CHINA_REGION_AUTH_URL
|
||||
})
|
||||
} else {
|
||||
delete config['baseUrl'];
|
||||
delete config['authBaseUrl'];
|
||||
}
|
||||
|
||||
return this._super(...arguments);
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -163,27 +163,29 @@
|
|||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col span-6">
|
||||
<label class="acc-label">
|
||||
{{t "clusterNew.azureaks.enableHttpApplicationRouting.label"}}
|
||||
</label>
|
||||
<div class="form-control-static">
|
||||
<label class="hand mr-20">
|
||||
{{radio-button
|
||||
selection=config.enableHttpApplicationRouting
|
||||
value=true
|
||||
}}
|
||||
{{t "generic.enabled"}}
|
||||
</label>
|
||||
<label class="hand">
|
||||
{{radio-button
|
||||
selection=config.enableHttpApplicationRouting
|
||||
value=false
|
||||
}}
|
||||
{{t "generic.disabled"}}
|
||||
{{#unless isChinaRegion}}
|
||||
<div class="col span-6">
|
||||
<label class="acc-label">
|
||||
{{t "clusterNew.azureaks.enableHttpApplicationRouting.label"}}
|
||||
</label>
|
||||
<div class="form-control-static">
|
||||
<label class="hand mr-20">
|
||||
{{radio-button
|
||||
selection=config.enableHttpApplicationRouting
|
||||
value=true
|
||||
}}
|
||||
{{t "generic.enabled"}}
|
||||
</label>
|
||||
<label class="hand">
|
||||
{{radio-button
|
||||
selection=config.enableHttpApplicationRouting
|
||||
value=false
|
||||
}}
|
||||
{{t "generic.disabled"}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
<div class="col span-6">
|
||||
<label class="acc-label">
|
||||
{{t "clusterNew.azureaks.enableMonitoring.label"}}
|
||||
|
|
|
|||
|
|
@ -449,6 +449,14 @@ export let aksRegions = [
|
|||
'name': 'centralus',
|
||||
'displayName': 'Central US',
|
||||
},
|
||||
{
|
||||
'name': 'chinanorth2',
|
||||
'displayName': 'China North 2',
|
||||
},
|
||||
{
|
||||
'name': 'chinaeast2',
|
||||
'displayName': 'China East 2',
|
||||
},
|
||||
{
|
||||
'name': 'eastasia',
|
||||
'displayName': 'East Asia',
|
||||
|
|
|
|||
Loading…
Reference in New Issue