Skip to content

Commit 7e05146

Browse files
committed
allow multiple CAs but only single client key/cert
see: http://mongodb.github.io/node-mongodb-native/2.0/tutorials/enterprise_features/
1 parent e91c605 commit 7e05146

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/connect/filereader-view.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ var BrowserWindow = remote.require('browser-window');
77
var format = require('util').format;
88
var bindings = require('ampersand-dom-bindings');
99
var fileReaderTemplate = require('./filereader-default.jade');
10+
var assert = require('assert');
1011

1112
// var debug = require('debug')('scout:connect:filereader-view');
1213

1314
module.exports = InputView.extend({
1415
template: fileReaderTemplate,
1516
props: {
17+
multi: {
18+
type: 'boolean',
19+
required: true,
20+
default: false
21+
},
1622
inputValue: {
1723
type: 'array',
1824
required: true,
@@ -31,10 +37,11 @@ module.exports = InputView.extend({
3137
deps: ['inputValue'],
3238
fn: function() {
3339
if (this.inputValue.length === 0) {
34-
return 'Choose file(s)';
40+
return this.multi ? 'Choose file(s)' : 'Choose file';
3541
} else if (this.inputValue.length === 1) {
3642
return path.basename(this.inputValue[0]);
3743
}
44+
assert.equal(this.multi, true);
3845
return format('%d files selected', this.inputValue.length);
3946
}
4047
},
@@ -78,6 +85,9 @@ module.exports = InputView.extend({
7885
*/
7986
initialize: function(spec) {
8087
spec = spec || {};
88+
if (spec.multi) {
89+
this.multi = spec.multi;
90+
}
8191
_.defaults(spec, {value: []});
8292
this.invalidClass = 'has-error';
8393
this.validityClassSelector = '.form-item-file';
@@ -173,8 +183,12 @@ module.exports = InputView.extend({
173183
this.runTests();
174184
},
175185
loadFileButtonClicked: function() {
186+
var properties = ['openFile'];
187+
if (this.multi) {
188+
properties.push('multiSelections');
189+
}
176190
dialog.showOpenDialog(BrowserWindow.getFocusedWindow(), {
177-
properties: ['openFile', 'multiSelections']
191+
properties: properties
178192
}, function(filenames) {
179193
this.inputValue = filenames || [];
180194
this.handleChange();

src/connect/ssl.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ var SERVER = {
3939
fields: [
4040
new FileReaderView({
4141
name: 'ssl_ca',
42+
multi: true,
4243
label: 'Certificate Authority',
4344
required: true
4445
})
@@ -56,6 +57,7 @@ var ALL = {
5657
fields: [
5758
new FileReaderView({
5859
name: 'ssl_ca',
60+
multi: true,
5961
label: 'Certificate Authority',
6062
required: true
6163
}),

0 commit comments

Comments
 (0)