Skip to content

Commit 665a7ef

Browse files
committed
Merge branch 'master' of baltig.sandia.gov:scot/SCOT
2 parents 76fa65b + c090cc9 commit 665a7ef

File tree

9 files changed

+28
-7
lines changed

9 files changed

+28
-7
lines changed

demo/reset.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ db.user.drop();
2020
db.apikey.drop();
2121
db.signature.drop();
2222
db.sigbody.drop();
23+
db.getCollection('group').drop()
2324

2425
print ("Creating indexes...");
26+
db.getCollection('group').ensureIndex({"name": 1},{unique: true, dropDups:true});
2527
db.alertgroup.ensureIndex( { "id": 1}, {unique: true, dropDups:true} );
2628
db.alertgroup.ensureIndex( { "message_id": 1} );
2729
db.alertgroup.ensureIndex( { "updated": 1} );

docker-configs/mongodb/set_mongodb_config.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ set='$set'
2222

2323
if [ ! -f /var/lib/mongodb/mongodb_password_set ]; then
2424
mongo scot-prod --host mongodb /opt/scot/install/src/mongodb/admin_user.js
25+
mongo scot-prod --host mongodb /opt/scot/install/src/mongodb/reset.js
2526
mongo scot-prod --host mongodb --eval "db.user.update({username:'admin'}, {$set:{pwhash:'$HASH'}}, {multi:true})"
2627
echo "Mapping set for Mongo" > /var/lib/mongodb/mongodb_password_set
2728
fi

install/install_scot.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ function setup_scot_admin {
333333
HASH=`$SCOT_CONFIG_SRC/mongodb/passwd.pl`
334334

335335
mongo scot-prod $SCOT_CONFIG_SRC/mongodb/admin_user.js
336+
mongo scot-prod $SCOT_CONFIG_SRC/mongodb/defaultgroups.js
336337
mongo scot-prod --eval "db.user.update({username:'admin'}, {$set:{pwhash:'$HASH'}})"
337338
fi
338339
}

install/src/mongodb/admin_user.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ db.user.insert({
2121
"last_activity_check" : 4
2222
})
2323
db.user.ensureIndex({username: 1});
24+

install/src/mongodb/indexes.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,6 @@ db.guide.ensureIndex ( { "applies_to": 1} );
7575

7676
db.user.ensureIndex ( {"id": 1},{unique: true, dropDups:true} );
7777
db.user.ensureIndex ( {"username": 1} );
78+
79+
db.getCollection('group').ensureIndex({"name": 1},{unique: true, dropDups:true});
80+

install/src/mongodb/reset.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ db.apikey.drop();
2525
db.handler.drop();
2626
db.stat.drop();
2727
db.entitytype.drop();
28+
db.getCollection('group').drop()
2829

2930
print ("Creating indexes...");
3031
load("./src/mongodb/indexes.js");

pubdev/jsdev/react_components/modal/entity_detail.jsx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ let EntityDetail = React.createClass( {
4545
entityobj: this.props.entityobj,
4646
height: null,
4747
isMounted: false,
48+
width: 0,
49+
entityModalHeight:0
50+
4851
};
4952
},
5053
componentWillMount: function () {
@@ -221,18 +224,21 @@ let EntityDetail = React.createClass( {
221224
});
222225
});
223226
this.props.watcher();
227+
const varheight = document.getElementById('container').clientHeight;
228+
this.setState({entityModalHeight:varheight})
229+
this.updateWindowDimensions();
230+
window.addEventListener('resize', this.updateWindowDimensions);
224231
},
225232

233+
updateWindowDimensions: function(){
234+
this.setState({ width: window.innerWidth, height: window.innerHeight });
235+
},
226236

227237
componentWillUnmount: function() {
228238
this.setState( {isMounted: false} );
229239
//removes escHandler bind
230240
$( document ).off( 'keydown' );
231-
//This makes the size that was last used hold for future entities
232-
/*let height = $('#dragme').height();
233-
let width = $('#dragme').width();
234-
entityPopUpHeight = height;
235-
entityPopUpWidth = width;*/
241+
window.removeEventListener('resize', this.updateWindowDimensions);
236242
},
237243
componentWillReceiveProps: function( nextProps ) {
238244
this.onLoad();
@@ -474,12 +480,17 @@ let EntityDetail = React.createClass( {
474480
}
475481
}
476482
},
483+
484+
485+
486+
477487
render: function() {
478488
//This makes the size that was last used hold for future entities
479489
/*if (entityPopUpHeight && entityPopUpWidth) {
480490
entityHeight = entityPopUpHeight;
481491
entityWidth = entityPopUpWidth;
482492
}*/
493+
let heightboundary = 200- this.state.defaultEntityOffset.top
483494
let defaultOffsetY;
484495
let defaultOffsetX;
485496
let tabsArr = [];
@@ -530,7 +541,7 @@ let EntityDetail = React.createClass( {
530541
);
531542
} else {
532543
return (
533-
<Draggable handle="#handle" onMouseDown={this.moveDivInit}>
544+
<Draggable handle="#handle" bounds={{top: heightboundary}} onMouseDown={this.moveDivInit}>
534545
<div id="dragme" className={DragmeClass} style={{width:this.state.entityWidth, left:defaultOffsetX, maxHeight:'90vh'}}>
535546
<div id='popup-flex-container' style={{height: '100%', display:'flex', flexFlow:'row'}}>
536547
<div id="entity_detail_container" style={{flexFlow: 'column', display: 'flex', width:'100%'}}>

public/admin/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<div class="navbar-inner">
3131
<div class="container">
3232
<ul class="nav" id="admin_nav">
33+
<li><a href=/>Home</li>
3334
<li class="active"><a href="#info">Info</a></li>
3435
<!--<li><a href="#backup">Backup</a></li>-->
3536
<li><a href="#auth">Auth</a></li>

public/scot.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)