mirror of https://github.com/rancher/ui.git
Merge pull request #2698 from n313893254/18394
Delete 'client_cert_key' when CA field change
This commit is contained in:
commit
657e0ccfb8
|
|
@ -5,9 +5,6 @@ import layout from './template';
|
||||||
import { next } from '@ember/runloop';
|
import { next } from '@ember/runloop';
|
||||||
import { get, set, observer, computed } from '@ember/object';
|
import { get, set, observer, computed } from '@ember/object';
|
||||||
import ThrottledResize from 'shared/mixins/throttled-resize';
|
import ThrottledResize from 'shared/mixins/throttled-resize';
|
||||||
import { downloadFile } from 'shared/utils/download-files';
|
|
||||||
import CodeMirror from 'codemirror';
|
|
||||||
import jsyaml from 'js-yaml';
|
|
||||||
import { alias } from '@ember/object/computed'
|
import { alias } from '@ember/object/computed'
|
||||||
import C from 'ui/utils/constants';
|
import C from 'ui/utils/constants';
|
||||||
|
|
||||||
|
|
@ -40,14 +37,11 @@ export default Component.extend(ThrottledResize, {
|
||||||
showDownload: true,
|
showDownload: true,
|
||||||
deepStr: null,
|
deepStr: null,
|
||||||
|
|
||||||
shouldChangeName: true,
|
|
||||||
|
|
||||||
config: alias('model.config'),
|
config: alias('model.config'),
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
this.customTypeObserver()
|
||||||
window.jsyaml || (window.jsyaml = jsyaml);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
@ -55,27 +49,6 @@ export default Component.extend(ThrottledResize, {
|
||||||
this.$('INPUT[type=file]')[0].click();
|
this.$('INPUT[type=file]')[0].click();
|
||||||
},
|
},
|
||||||
|
|
||||||
wantsChange() {
|
|
||||||
set(this, 'shouldChangeName', true);
|
|
||||||
},
|
|
||||||
|
|
||||||
download() {
|
|
||||||
let yaml = get(this, 'value');
|
|
||||||
const lintError = [];
|
|
||||||
|
|
||||||
jsyaml.safeLoadAll(yaml, (y) => {
|
|
||||||
lintError.pushObjects(CodeMirror.lint.yaml(y));
|
|
||||||
});
|
|
||||||
|
|
||||||
if ( lintError.length ) {
|
|
||||||
set(this, 'errors', [get(this, 'intl').t('yamlPage.errors')]);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
downloadFile(get(this, 'filename'), yaml);
|
|
||||||
},
|
|
||||||
|
|
||||||
updateValue(value) {
|
updateValue(value) {
|
||||||
next(() => {
|
next(() => {
|
||||||
set(this, 'value', value)
|
set(this, 'value', value)
|
||||||
|
|
@ -102,7 +75,7 @@ export default Component.extend(ThrottledResize, {
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
|
||||||
caChange: observer('config.clientKey', 'config.clientCert', 'config.certificate', function() {
|
caChange: observer('clientKeyPath', 'clientCertPath', 'certificatePath', function() {
|
||||||
let { fileObj, deepStrs = [] } = this.parseValue(get(this, 'value'));
|
let { fileObj, deepStrs = [] } = this.parseValue(get(this, 'value'));
|
||||||
|
|
||||||
const deletedField = [
|
const deletedField = [
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@
|
||||||
{{ivy-codemirror
|
{{ivy-codemirror
|
||||||
placeholder=placeholder
|
placeholder=placeholder
|
||||||
value=value
|
value=value
|
||||||
valueUpdated=(action 'updateValue')
|
valueUpdated=(action "updateValue")
|
||||||
options=(hash
|
options=(hash
|
||||||
autofocus=true
|
autofocus=true
|
||||||
theme="monokai"
|
theme="monokai"
|
||||||
tabSize=2
|
tabSize=2
|
||||||
lineNumbers=true
|
lineNumbers=true
|
||||||
mode="yaml"
|
mode="yaml"
|
||||||
readOnly=(if (or (eq modalOpts.type 'review') readOnly) true false)
|
readOnly=(if (or (eq modalOpts.type "review") readOnly) true false)
|
||||||
gutters=gutters
|
gutters=gutters
|
||||||
lint=false
|
lint=false
|
||||||
lineWrapping=true
|
lineWrapping=true
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{yield 'description'}}
|
{{yield "description"}}
|
||||||
<input type="file" accept="{{actualAccept}}" multiple={{multiple}} class="hide">
|
<input type="file" accept="{{actualAccept}}" multiple={{multiple}} class="hide">
|
||||||
|
|
||||||
{{logging/form-log-ssl
|
{{logging/form-log-ssl
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue