mirror of https://github.com/rancher/ui.git
Fix conflicts
This commit is contained in:
commit
96ee0012bd
|
|
@ -14,6 +14,7 @@ export default Ember.Component.extend(ModalBase, NewOrEdit, ManageLabels, {
|
|||
|
||||
ips: null,
|
||||
requireAny: null,
|
||||
requiredIfAny: {[C.LABEL.SYSTEM_TYPE]: ''},
|
||||
systemLabels: null,
|
||||
userLabels: null,
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,22 @@
|
|||
<p class="help-block">{{t 'editHost.requireAny.help'}}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-12 col-md-2 form-label form-control-static">
|
||||
<label>{{t 'editHost.requireAny.label'}}</label>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-8">
|
||||
{{form-key-value
|
||||
initialStr=requireAny
|
||||
changedStr=(action (mut requireAny))
|
||||
requiredIfAny=requiredIfAny
|
||||
addActionLabel="editHost.requireAny.addActionLabel"
|
||||
allowEmptyValue=true
|
||||
}}
|
||||
<p class="help-block">{{format-html-message 'editHost.requireAny.help'}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{top-errors errors=errors}}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ export default Ember.Component.extend({
|
|||
initialStr: null,
|
||||
initialMap: null,
|
||||
kvSeparator: '=',
|
||||
requiredIfAny: null,
|
||||
addActionLabel: 'formKeyValue.addAction',
|
||||
keyLabel: 'formKeyValue.key.label',
|
||||
valueLabel: 'formKeyValue.value.label',
|
||||
|
|
@ -73,7 +74,15 @@ export default Ember.Component.extend({
|
|||
|
||||
actions: {
|
||||
add() {
|
||||
this.get('ary').pushObject(Ember.Object.create({key: '', value: ''}));
|
||||
let ary = this.get('ary');
|
||||
let required = this.get('requiredIfAny');
|
||||
if ( required && !ary.get('length') ) {
|
||||
Object.keys(required).forEach((k) => {
|
||||
ary.pushObject(Ember.Object.create({key: k, value: required[k], editable: false}));
|
||||
});
|
||||
}
|
||||
|
||||
ary.pushObject(Ember.Object.create({key: '', value: ''}));
|
||||
Ember.run.next(() => {
|
||||
if ( this.isDestroyed || this.isDestroying ) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<tr>
|
||||
<td class="valign-top" data-title="{{t keyLabel}}:">
|
||||
{{#if editing}}
|
||||
{{input-paste pasted="pastedLabels" class="form-control input-sm key" type="text" value=row.key placeholder=keyPlaceholder}}
|
||||
{{input-paste pasted="pastedLabels" class="form-control input-sm key" type="text" value=row.key placeholder=keyPlaceholder disabled=(eq row.editable false)}}
|
||||
{{else}}
|
||||
{{row.key}}
|
||||
{{/if}}
|
||||
|
|
@ -29,9 +29,9 @@
|
|||
<td class="valign-top" data-title="{{t valueLabel}}:">
|
||||
{{#if editing}}
|
||||
{{#if allowMultilineValue}}
|
||||
{{textarea-autogrow class="form-control input-sm value" value=row.value placeholder=valuePlaceholder}}
|
||||
{{textarea-autogrow class="form-control input-sm value" value=row.value placeholder=valuePlaceholder disabled=(eq row.editable false)}}
|
||||
{{else}}
|
||||
{{input class="form-control input-sm value" type="text" value=row.value placeholder=valuePlaceholder}}
|
||||
{{input class="form-control input-sm value" type="text" value=row.value placeholder=valuePlaceholder disabled=(eq row.editable false)}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{row.value}}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
import Ember from 'ember';
|
||||
import { isMobile } from 'ui/utils/platform';
|
||||
|
||||
function sanitize(val) {
|
||||
val = (val+'').trim().replace(/[^0-9]/g,'');
|
||||
val = val.replace(/\..*$/g,'');
|
||||
return val;
|
||||
}
|
||||
|
||||
export default Ember.TextField.extend({
|
||||
type: Ember.computed(function() {
|
||||
return ( isMobile ? 'number' : 'text' );
|
||||
|
|
@ -13,23 +19,36 @@ export default Ember.TextField.extend({
|
|||
_elementValueDidChange: function () {
|
||||
let val = this.element.value;
|
||||
let cur = val;
|
||||
val = (val+'').trim().replace(/[^0-9]/g,'');
|
||||
val = sanitize(val);
|
||||
|
||||
val = val.replace(/\..*$/g,'');
|
||||
let num = parseInt(val, 10);
|
||||
let min = parseInt(this.get('min'), 10);
|
||||
let max = parseInt(this.get('max'), 10);
|
||||
if ( !isNaN(num) ) {
|
||||
if ( !isNaN(min) && num < min ) {
|
||||
val = ""+min;
|
||||
} else if ( !isNaN(max) && num > max ) {
|
||||
if ( !isNaN(num) && !isNaN(max) && num > max ) {
|
||||
val = ""+max;
|
||||
}
|
||||
}
|
||||
|
||||
if ( cur !== val ) {
|
||||
this.element.value = val;
|
||||
}
|
||||
this.set('value', val);
|
||||
},
|
||||
|
||||
focusOut() {
|
||||
this._super(...arguments);
|
||||
|
||||
let val = this.element.value;
|
||||
let cur = val;
|
||||
val = sanitize(val);
|
||||
|
||||
let num = parseInt(val, 10);
|
||||
let min = parseInt(this.get('min'), 10);
|
||||
if ( !isNaN(num) && !isNaN(min) && num < min ) {
|
||||
val = ""+min;
|
||||
}
|
||||
|
||||
if ( cur !== val ) {
|
||||
this.element.value = val;
|
||||
this.set('value', val);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,88 +0,0 @@
|
|||
<section class="horizontal-form container-fluid">
|
||||
<h2>{{t (if editing 'newReceiver.title.edit' 'newReceiver.title.add')}}</h2>
|
||||
|
||||
<div class="row inline-form">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="col-inline">
|
||||
<label>{{t 'generic.name'}}*</label>
|
||||
</div>
|
||||
<div>
|
||||
{{input type="text" value=model.name classNames="form-control" placeholder=(t 'newReceiver.name.placeholder')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row inline-form">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="col-inline">
|
||||
<label>{{t 'newReceiver.driver.label'}}</label>
|
||||
</div>
|
||||
<div>
|
||||
<select class="form-control">
|
||||
<option value="scaleService">{{t 'hookPage.scaleService.label'}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row inline-form">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="col-inline">
|
||||
<label>{{t 'newReceiver.action.label'}}</label>
|
||||
</div>
|
||||
<div>
|
||||
<span class="radio inline-block r-mr10">
|
||||
<label>{{radio-button selection=model.scaleServiceConfig.action value="up"}} Scale up</label>
|
||||
</span>
|
||||
<span class="radio inline-block">
|
||||
<label>{{radio-button selection=model.scaleServiceConfig.action value="down"}} Scale down</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row inline-form">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="col-inline">
|
||||
<label>{{t 'newReceiver.service.label'}}*</label>
|
||||
</div>
|
||||
<div>
|
||||
{{schema/input-service selected=model.scaleServiceConfig.serviceId canHaveContainers=true}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row inline-form">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="col-inline">
|
||||
<label>{{t 'newReceiver.amount.label'}}</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 col-sm-2">
|
||||
{{format-number model.scaleServiceConfig.amount}}
|
||||
</div>
|
||||
<div class="col-xs-9 col-sm-10">
|
||||
{{input-slider value=model.scaleServiceConfig.amount valueMin=1 valueMax=11}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row inline-form">
|
||||
<div class="col-md-3 col-md-offset-3">
|
||||
<div class="col-inline">
|
||||
<label>{{t 'newReceiver.min.label'}}</label>
|
||||
</div>
|
||||
{{input-integer min=1 value=model.scaleServiceConfig.min class="form-control" placeholder=(t 'newReceiver.min.placeholder')}}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-inline">
|
||||
<label>{{t 'newReceiver.max.label'}}</label>
|
||||
</div>
|
||||
{{input-integer min=1 value=model.scaleServiceConfig.max class="form-control" placeholder=(t 'newReceiver.max.placeholder')}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{top-errors errors=errors}}
|
||||
{{save-cancel editing=editing save="save" cancel="cancel"}}
|
||||
|
|
@ -1586,7 +1586,7 @@ editHost:
|
|||
help: If provided, the scheduler will select and bind published ports to one of the given public IP addresses.
|
||||
requireAny:
|
||||
label: Require Container Label
|
||||
help: If provided, containers must have one or more of the given labels in order to be eligible for scheduling onto this host. If the value is left empty, a container with a matching key is eligible regardless of value.
|
||||
help: If provided, containers must have one or more of the given labels in order to be eligible for scheduling onto this host. If the value is left empty, a container with a matching key is eligible regardless of value. <code>io.rancher.container.system</code> is required to allow system containers on to the host.
|
||||
addActionLabel: Add Required Label
|
||||
|
||||
editProjectTemplate:
|
||||
|
|
|
|||
Loading…
Reference in New Issue