File tree Expand file tree Collapse file tree 4 files changed +32
-6
lines changed
Expand file tree Collapse file tree 4 files changed +32
-6
lines changed Original file line number Diff line number Diff line change 148148 "@mongodb-js/compass-auth-ldap" : " ^0.0.2" ,
149149 "@mongodb-js/compass-auth-x509" : " ^0.0.3" ,
150150 "@mongodb-js/compass-collection-stats" : " ^1.0.1" ,
151- "@mongodb-js/compass-connect" : " ^0.3 .0" ,
151+ "@mongodb-js/compass-connect" : " ^0.4 .0" ,
152152 "@mongodb-js/compass-crud" : " ^0.10.0" ,
153153 "@mongodb-js/compass-deployment-awareness" : " ^5.0.0" ,
154154 "@mongodb-js/compass-document-validation" : " ^7.0.0" ,
210210 "marky" : " ^1.2.0" ,
211211 "moment" : " ^2.10.6" ,
212212 "mongodb-collection-model" : " ^0.4.0" ,
213- "mongodb-connection-model" : " ^10.5 .0" ,
214- "mongodb-data-service" : " ^8.5 .0" ,
213+ "mongodb-connection-model" : " ^10.6 .0" ,
214+ "mongodb-data-service" : " ^8.6 .0" ,
215215 "mongodb-database-model" : " ^0.1.2" ,
216216 "mongodb-explain-plan-model" : " ^0.2.2" ,
217217 "mongodb-extended-json" : " ^1.10.0" ,
Original file line number Diff line number Diff line change @@ -81,8 +81,8 @@ const InstanceStore = Reflux.createStore({
8181 const StatusAction = app . appRegistry . getAction ( 'Status.Actions' ) ;
8282 StatusAction . hide ( ) ;
8383
84- const instance = app . instance ;
85- this . setState ( { instance } ) ;
84+ this . state . instance = app . instance ;
85+ this . trigger ( this . state ) ;
8686 } ,
8787
8888 refreshInstance ( ) {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const HomeStore = Reflux.createStore({
1313 // set up listeners on external stores
1414 appRegistry . getStore ( 'App.InstanceStore' ) . listen ( this . onInstanceChange . bind ( this ) ) ;
1515 appRegistry . on ( 'data-service-connected' , this . onConnected . bind ( this , appRegistry ) ) ;
16+ appRegistry . on ( 'data-service-disconnected' , this . onDisconnected . bind ( this ) ) ;
1617 appRegistry . on ( 'collection-changed' , this . onCollectionChanged . bind ( this ) ) ;
1718 appRegistry . on ( 'database-changed' , this . onDatabaseChanged . bind ( this ) ) ;
1819 } ,
@@ -38,6 +39,19 @@ const HomeStore = Reflux.createStore({
3839 } ;
3940 } ,
4041
42+ onDisconnected ( ) {
43+ this . setState ( {
44+ errorMessage : '' ,
45+ namespace : '' ,
46+ isConnected : false ,
47+ isAtlas : false ,
48+ authentication : 'NONE' ,
49+ ssl : 'NONE' ,
50+ sshTunnel : 'NONE' ,
51+ uiStatus : UI_STATES . INITIAL
52+ } ) ;
53+ } ,
54+
4155 onConnected ( appRegistry , err , ds ) {
4256 const connection = ds . client . model ;
4357 this . instanceId = connection . instance_id ;
Original file line number Diff line number Diff line change @@ -87,8 +87,20 @@ function connectItem() {
8787 } ;
8888}
8989
90+ function disconnectItem ( ) {
91+ return {
92+ label : '&Disconnect' ,
93+ click : function ( ) {
94+ app . emit ( 'app:disconnect' ) ;
95+ }
96+ } ;
97+ }
98+
9099function connectSubMenu ( nonDarwin ) {
91- var subMenu = [ connectItem ( ) ] ;
100+ var subMenu = [
101+ connectItem ( ) ,
102+ disconnectItem ( )
103+ ] ;
92104
93105 if ( nonDarwin ) {
94106 subMenu . push ( separator ( ) ) ;
You can’t perform that action at this time.
0 commit comments