mirror of https://github.com/rancher/ui.git
commit
d7082a9f91
|
|
@ -16,6 +16,8 @@ import {
|
||||||
} from 'ui/utils/azure-choices';
|
} from 'ui/utils/azure-choices';
|
||||||
|
|
||||||
const NETWORK_POLICY = ['Calico']
|
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, {
|
export default Component.extend(ClusterDriver, {
|
||||||
globalStore: service(),
|
globalStore: service(),
|
||||||
|
|
@ -80,6 +82,14 @@ export default Component.extend(ClusterDriver, {
|
||||||
tenantId: get(this, 'config.tenantId'),
|
tenantId: get(this, 'config.tenantId'),
|
||||||
region: get(this, 'config.location')
|
region: get(this, 'config.location')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ( get(this, 'isChinaRegion') ) {
|
||||||
|
setProperties(data, {
|
||||||
|
baseUrl: CHINA_REGION_API_URL,
|
||||||
|
authBaseUrl: CHINA_REGION_AUTH_URL
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const aksRequest = {
|
const aksRequest = {
|
||||||
versions: store.rawRequest({
|
versions: store.rawRequest({
|
||||||
url: '/meta/aksVersions',
|
url: '/meta/aksVersions',
|
||||||
|
|
@ -183,6 +193,10 @@ export default Component.extend(ClusterDriver, {
|
||||||
return ( get(this, 'mode') === 'edit' || get(this, 'mode') === 'new' ) ? true : false;
|
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() {
|
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;
|
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);
|
return this._super(...arguments);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
{{#unless isChinaRegion}}
|
||||||
<div class="col span-6">
|
<div class="col span-6">
|
||||||
<label class="acc-label">
|
<label class="acc-label">
|
||||||
{{t "clusterNew.azureaks.enableHttpApplicationRouting.label"}}
|
{{t "clusterNew.azureaks.enableHttpApplicationRouting.label"}}
|
||||||
|
|
@ -184,6 +185,7 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{/unless}}
|
||||||
<div class="col span-6">
|
<div class="col span-6">
|
||||||
<label class="acc-label">
|
<label class="acc-label">
|
||||||
{{t "clusterNew.azureaks.enableMonitoring.label"}}
|
{{t "clusterNew.azureaks.enableMonitoring.label"}}
|
||||||
|
|
|
||||||
|
|
@ -449,6 +449,14 @@ export let aksRegions = [
|
||||||
'name': 'centralus',
|
'name': 'centralus',
|
||||||
'displayName': 'Central US',
|
'displayName': 'Central US',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': 'chinanorth2',
|
||||||
|
'displayName': 'China North 2',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'chinaeast2',
|
||||||
|
'displayName': 'China East 2',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'name': 'eastasia',
|
'name': 'eastasia',
|
||||||
'displayName': 'East Asia',
|
'displayName': 'East Asia',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue