mirror of https://github.com/rancher/ui.git
Update Aliyun-Driver
This commit is contained in:
parent
e2f0dc795b
commit
b3f85cfafd
|
|
@ -18,6 +18,7 @@ const OPT_DISK = [
|
||||||
];
|
];
|
||||||
|
|
||||||
const DEFAULT_INSTANCE_TYPE = 'ecs.g5.large';
|
const DEFAULT_INSTANCE_TYPE = 'ecs.g5.large';
|
||||||
|
const DEFAULT_INTERNET_CHARGE_TYPE = 'PayByBandwidth';
|
||||||
|
|
||||||
export default Component.extend(NodeDriver, {
|
export default Component.extend(NodeDriver, {
|
||||||
intl: service(),
|
intl: service(),
|
||||||
|
|
@ -32,11 +33,22 @@ export default Component.extend(NodeDriver, {
|
||||||
images: null,
|
images: null,
|
||||||
instanceTypes: null,
|
instanceTypes: null,
|
||||||
|
|
||||||
|
showCustomApiEndpoint: false,
|
||||||
ecsClient: null,
|
ecsClient: null,
|
||||||
step: 1,
|
step: 1,
|
||||||
|
|
||||||
config: alias('model.aliyunecsConfig'),
|
config: alias('model.aliyunecsConfig'),
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this._super(...arguments);
|
||||||
|
if (!get(this, 'config.internetChargeType')) {
|
||||||
|
set(this, 'config.internetChargeType', DEFAULT_INTERNET_CHARGE_TYPE);
|
||||||
|
}
|
||||||
|
if (get(this, 'config.apiEndpoint')) {
|
||||||
|
set(this, 'showCustomApiEndpoint', true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
alyLogin(cb) {
|
alyLogin(cb) {
|
||||||
setProperties(this, {
|
setProperties(this, {
|
||||||
|
|
@ -299,6 +311,12 @@ export default Component.extend(NodeDriver, {
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
showCustomApiEndpointDidChange: observer('showCustomApiEndpoint', function() {
|
||||||
|
if (!get(this, 'showCustomApiEndpoint')){
|
||||||
|
set(this, 'config.apiEndpoint', '');
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
diskCategoryChoicesDidChange: observer('diskCategoryChoices.@each.value', function() {
|
diskCategoryChoicesDidChange: observer('diskCategoryChoices.@each.value', function() {
|
||||||
const systemDiskCategory = get(this, 'config.systemDiskCategory');
|
const systemDiskCategory = get(this, 'config.systemDiskCategory');
|
||||||
let found = get(this, 'diskCategoryChoices').findBy('value', systemDiskCategory);
|
let found = get(this, 'diskCategoryChoices').findBy('value', systemDiskCategory);
|
||||||
|
|
@ -337,6 +355,7 @@ export default Component.extend(NodeDriver, {
|
||||||
accessKeySecret: '',
|
accessKeySecret: '',
|
||||||
instanceType: DEFAULT_INSTANCE_TYPE,
|
instanceType: DEFAULT_INSTANCE_TYPE,
|
||||||
ioOptimized: 'optimized',
|
ioOptimized: 'optimized',
|
||||||
|
internetChargeType: DEFAULT_INTERNET_CHARGE_TYPE,
|
||||||
});
|
});
|
||||||
|
|
||||||
set(this, 'model.engineInstallURL', 'http://dev-tool.oss-cn-shenzhen.aliyuncs.com/docker-install/1.13.1.sh');
|
set(this, 'model.engineInstallURL', 'http://dev-tool.oss-cn-shenzhen.aliyuncs.com/docker-install/1.13.1.sh');
|
||||||
|
|
|
||||||
|
|
@ -57,12 +57,19 @@
|
||||||
editable=(eq step 1)
|
editable=(eq step 1)
|
||||||
value=config.apiEndpoint
|
value=config.apiEndpoint
|
||||||
}}
|
}}
|
||||||
{{input
|
<Input
|
||||||
type="text"
|
@type="checkbox"
|
||||||
class="form-control"
|
@classNames="form-control"
|
||||||
value=config.apiEndpoint
|
@checked={{showCustomApiEndpoint}}
|
||||||
placeholder=(t "nodeDriver.aliyunecs.apiEndpoint.placeholder")
|
/>
|
||||||
}}
|
{{#if showCustomApiEndpoint}}
|
||||||
|
<Input
|
||||||
|
@type="text"
|
||||||
|
@value={{config.apiEndpoint}}
|
||||||
|
@classNames="form-control"
|
||||||
|
@placeholder={{t "nodeDriver.aliyunecs.apiEndpoint.placeholder"}}
|
||||||
|
/>
|
||||||
|
{{/if}}
|
||||||
{{/input-or-display}}
|
{{/input-or-display}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -335,6 +342,21 @@
|
||||||
value=config.imageId
|
value=config.imageId
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col span-6">
|
||||||
|
<label class="acc-label">
|
||||||
|
{{t "nodeDriver.aliyunecs.aliyunSLB.label"}}
|
||||||
|
</label>
|
||||||
|
<Input
|
||||||
|
@type="text"
|
||||||
|
@value={{config.slbId}}
|
||||||
|
@classNames="form-control"
|
||||||
|
@placeholder={{t "nodeDriver.aliyunecs.aliyunSLB.placeholder"}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{#unless config.privateAddressOnly}}
|
||||||
|
<div class="row">
|
||||||
<div class="col span-6">
|
<div class="col span-6">
|
||||||
<label class="acc-label">
|
<label class="acc-label">
|
||||||
{{t "nodeDriver.aliyunecs.internetMaxBandwidth.label"}}
|
{{t "nodeDriver.aliyunecs.internetMaxBandwidth.label"}}
|
||||||
|
|
@ -350,21 +372,29 @@
|
||||||
<div class="input-group-addon bg-default">Mbps</div>
|
<div class="input-group-addon bg-default">Mbps</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col span-6">
|
<div class="col span-6">
|
||||||
<label class="acc-label">
|
<label class="acc-label">
|
||||||
{{t "nodeDriver.aliyunecs.aliyunSLB.label"}}
|
{{t "nodeDriver.aliyunecs.internetChargeType.label"}}
|
||||||
|
</label>
|
||||||
|
<div>
|
||||||
|
<label class="mr-20 hand">
|
||||||
|
<RadioButton
|
||||||
|
@selection={{config.internetChargeType}}
|
||||||
|
@value="PayByBandwidth"
|
||||||
|
/>
|
||||||
|
{{t "nodeDriver.aliyunecs.internetChargeType.payByBandwidth"}}
|
||||||
|
</label>
|
||||||
|
<label class="hand">
|
||||||
|
<RadioButton
|
||||||
|
@selection={{config.internetChargeType}}
|
||||||
|
@value="PayByTraffic"
|
||||||
|
/>
|
||||||
|
{{t "nodeDriver.aliyunecs.internetChargeType.payByTraffic"}}
|
||||||
</label>
|
</label>
|
||||||
{{input
|
|
||||||
type="text"
|
|
||||||
class="form-control"
|
|
||||||
value=config.slbId
|
|
||||||
placeholder=(t "nodeDriver.aliyunecs.aliyunSLB.placeholder")
|
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/unless}}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col span-6">
|
<div class="col span-6">
|
||||||
|
|
|
||||||
|
|
@ -8738,7 +8738,7 @@ nodeDriver:
|
||||||
placeholder: Your Aliyun Account Access Key Secret
|
placeholder: Your Aliyun Account Access Key Secret
|
||||||
provided: Provided
|
provided: Provided
|
||||||
apiEndpoint:
|
apiEndpoint:
|
||||||
label: API Endpoint (Optional)
|
label: Private Aliyun API Server Endpoint
|
||||||
placeholder: Private Aliyun API Server Endpoint
|
placeholder: Private Aliyun API Server Endpoint
|
||||||
instanceOptionsSection:
|
instanceOptionsSection:
|
||||||
label: Instance
|
label: Instance
|
||||||
|
|
@ -8758,6 +8758,10 @@ nodeDriver:
|
||||||
aliyunSLB:
|
aliyunSLB:
|
||||||
label: Aliyun SLB ID
|
label: Aliyun SLB ID
|
||||||
placeholder: Aliyun SLB ID
|
placeholder: Aliyun SLB ID
|
||||||
|
internetChargeType:
|
||||||
|
label: EIP Charge Type
|
||||||
|
payByBandwidth: Pay By Bandwidth
|
||||||
|
payByTraffic: Pay By Traffic
|
||||||
storageSection:
|
storageSection:
|
||||||
label: Storage
|
label: Storage
|
||||||
detail: Configure the storage for the instances that will be created by this template.
|
detail: Configure the storage for the instances that will be created by this template.
|
||||||
|
|
|
||||||
|
|
@ -8735,8 +8735,8 @@ nodeDriver:
|
||||||
placeholder: 阿里云访问秘钥所对应的令牌
|
placeholder: 阿里云访问秘钥所对应的令牌
|
||||||
provided: 已提供
|
provided: 已提供
|
||||||
apiEndpoint:
|
apiEndpoint:
|
||||||
label: '(可选)阿里云私有部署API地址'
|
label: '私有阿里云API地址'
|
||||||
placeholder: 阿里云私有部署API地址
|
placeholder: 私有阿里云API地址
|
||||||
instanceOptionsSection:
|
instanceOptionsSection:
|
||||||
label: 实例
|
label: 实例
|
||||||
detail: 设置即将创建的阿里云实例
|
detail: 设置即将创建的阿里云实例
|
||||||
|
|
@ -8755,6 +8755,10 @@ nodeDriver:
|
||||||
aliyunSLB:
|
aliyunSLB:
|
||||||
label: 阿里云SLB ID
|
label: 阿里云SLB ID
|
||||||
placeholder: 阿里云SLB ID
|
placeholder: 阿里云SLB ID
|
||||||
|
internetChargeType:
|
||||||
|
label: EIP计费方式
|
||||||
|
payByBandwidth: 按带宽计费
|
||||||
|
payByTraffic: 按流量计费
|
||||||
storageSection:
|
storageSection:
|
||||||
label: 存储
|
label: 存储
|
||||||
detail: 配置通过该模版创建的实例的存储选项
|
detail: 配置通过该模版创建的实例的存储选项
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue