Skip to content

Commit 0587af1

Browse files
committed
Merge pull request #155 from 10gen/INT-586-instance-details-rebased-on-master
INT-586 instance details rebased on master
2 parents 449c36f + 4d5a58d commit 0587af1

25 files changed

+485
-124
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"ampersand-state",
3131
"scout-server",
3232
"glob",
33-
"electron-squirrel-startup"
33+
"electron-squirrel-startup",
34+
"ipc"
3435
]
3536
},
3637
"fonts": [

src/app.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,6 @@ var Application = View.extend({
223223
event.preventDefault();
224224
this.router.history.navigate(pathname);
225225
}
226-
},
227-
sendMessage: function(msg) {
228-
ipc.send('message', msg);
229-
},
230-
onMessageReceived: function(msg) {
231-
debug('message received from main process:', msg);
232-
this.trigger(msg);
233226
}
234227
});
235228

@@ -262,6 +255,13 @@ app.extend({
262255
isFeatureEnabled: function(id) {
263256
return FEATURES[id] === true;
264257
},
258+
sendMessage: function(msg) {
259+
ipc.send('message', msg);
260+
},
261+
onMessageReceived: function(msg) {
262+
debug('message received from main process:', msg);
263+
this.trigger(msg);
264+
},
265265
init: function() {
266266
domReady(function() {
267267
state.render();
@@ -298,7 +298,7 @@ app.extend({
298298
});
299299
});
300300
// set up ipc
301-
ipc.on('message', state.onMessageReceived.bind(this));
301+
ipc.on('message', this.onMessageReceived.bind(this));
302302
},
303303
navigate: state.navigate.bind(state)
304304
});

src/collection-stats/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var CollectionStatsView = AmpersandView.extend({
3434
format: function(propertyName) {
3535
var value = this.model.get(propertyName) || 0;
3636
var precision = value <= 1000 ? '0' : '0.0';
37-
var format = propertyName.indexOf('_size') > -1 ? 'b' : 'a';
37+
var format = propertyName.indexOf('_size') > -1 ? ' b' : 'a';
3838
return numeral(value).format(precision + format);
3939
},
4040
derived: {

src/collection-stats/index.less

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,59 @@
44
position: absolute;
55
right: 20px;
66
text-align: right;
7-
min-width: 450px;
7+
min-width: 520px;
88
}
99
.collection-stats {
1010
display: inline-block;
11+
position: relative;
1112
font-weight: 200;
1213
list-style: none;
13-
padding: 0 30px 0 0;
14-
margin: 11px 30px 0 0;
15-
border-right: 1px solid @gray7;
14+
padding: 0 20px 0 0;
15+
margin: 0 20px 0 0;
16+
17+
&::after {
18+
content: '';
19+
display: block;
20+
position: absolute;
21+
right: 0;
22+
top: 2px;
23+
width: 1px;
24+
height: 24px;
25+
background: @gray7;
26+
}
1627

1728
&:last-child {
18-
border-right: none;
1929
padding: 0;
2030
margin: 11px 0 0 0;
31+
32+
&::after {
33+
display: none;
34+
}
2135
}
2236
}
2337
.collection-stats-item {
2438
display: inline-block;
25-
margin-right: 10px;
39+
margin-right: 12px;
2640

2741
&:last-child {
2842
margin-right: 0;
2943
}
3044
}
3145
.collection-stats-primary-label {
46+
display: inline-block;
3247
text-transform: uppercase;
33-
letter-spacing: 1px;
3448
font-size: 12px;
3549
color: @gray3;
50+
margin-right: 5px;
3651
}
3752
.collection-stats-primary-value {
38-
font-size: 36px;
39-
line-height: 36px;
53+
display: inline-block;
54+
font-size: 24px;
55+
line-height: 24px;
4056
}
4157
.collection-stats-label {
4258
font-size: 11px;
59+
line-height: 11px;
4360
color: @gray3;
4461
}
4562
.collection-stats-value {

src/electron/config/windows.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/**
66
* The outer dimensions to use for new windows.
77
*/
8-
exports.DEFAULT_WIDTH = 1024;
9-
exports.DEFAULT_HEIGHT = 700;
8+
exports.DEFAULT_WIDTH = 1280;
9+
exports.DEFAULT_HEIGHT = 800;
1010

1111
/**
1212
* The outer window dimensions to use for new dialog

src/electron/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ if (!process.env.NODE_ENV) {
77
// will be created in `/tmp/Compass`
88
// (`~\AppData\Local\Temp\Compass` on Windows).
99
require('./crash-reporter');
10+
var debug = require('debug')('electron:index');
1011

1112
if (!require('electron-squirrel-startup')) {
1213
var app = require('app');
1314
var serverctl = require('./scout-server-ctl');
14-
var debug = require('debug')('scout-electron');
1515

1616
app.on('window-all-closed', function() {
1717
debug('All windows closed. Quitting app.');

src/electron/window-manager.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,9 @@ app.on('show connect dialog', function(opts) {
128128
app.on('ready', function() {
129129
app.emit('show connect dialog');
130130
});
131+
132+
var ipc = require('ipc');
133+
ipc.on('message', function(event, msg) {
134+
debug('message received in main process', msg);
135+
app.emit(msg);
136+
});

src/field-list/field.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.schema-field.schema-field-basic
2-
hr.field-divider
32
.row
43
.col-sm-4
54
.schema-field-name
@@ -10,3 +9,4 @@
109
div(data-hook='minichart-container')
1110
div(data-hook='fields-subview')
1211
div(data-hook='arrayfields-subview')
12+
hr.field-divider

src/home/collection.jade

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.collection-view.clearfix
2-
div(data-hook='sampling-message-subview')
32
div.modal.fade(tabindex='-1', role='dialog', arialabelledby='Share Schema Confirmation', data-hook='share-schema-confirmation')
43
div.modal-dialog.modal-sm
54
.modal-content

src/home/collection.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ var CollectionStatsView = require('../collection-stats');
33
var FieldListView = require('../field-list');
44
var DocumentListView = require('../document-list');
55
var RefineBarView = require('../refine-view');
6-
var SamplingMessageView = require('../sampling-message');
76
var MongoDBCollection = require('../models/mongodb-collection');
87
var SampledSchema = require('../models/sampled-schema');
98
var app = require('ampersand-app');
@@ -161,15 +160,6 @@ var MongoDBCollectionView = View.extend({
161160
collection: this.schema.documents
162161
});
163162
}
164-
},
165-
sampling_message: {
166-
hook: 'sampling-message-subview',
167-
prepareView: function(el) {
168-
return new SamplingMessageView({
169-
el: el,
170-
parent: this
171-
});
172-
}
173163
}
174164
}
175165
});

0 commit comments

Comments
 (0)