Skip to content

Commit 519c63d

Browse files
committed
Merge branch 'master' of github.com:MDPvis/MDPvis.github.io
2 parents fd17b84 + 3957750 commit 519c63d

File tree

6 files changed

+37
-3
lines changed

6 files changed

+37
-3
lines changed

flask_server.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@
1111
from flask import Flask, jsonify, request, redirect
1212
import sys
1313

14+
print """
15+
Starting Flask Server...
16+
Note, you may be able to specify a domain at this point by adding it as a
17+
positional argument.
18+
"""
19+
20+
# Specify which domain should be selected from the domain bridge.
21+
# This is an optional argument that is used for domain_bridges that sit
22+
# atop a collection of MDP domains. You should leave this as the
23+
# empty string unless you must select between domains.
24+
domain = ""
25+
if len(sys.argv) > 1:
26+
domain = sys.argv[1]
27+
1428
# Add the parent folder path to the sys.path list so
1529
# we can include its bridge
1630
sys.path.insert(0, '..')

index.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,14 @@ <h4 class="panel-title">
364364
<button type="button" class="btn btn-default"
365365
data-open-link="https://github.com/MDPvis/MDPvis.github.io/issues/new?title=Add%20Simulator%20to%20List">
366366
<span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>
367-
Your Server Here
367+
Open an Issue to be Included
368+
</button>
369+
<div class="form-group">
370+
<label for="customServer">Custom Server</label>
371+
<input type="text" class="form-control" id="customServer" placeholder="http://example.com:80">
372+
</div>
373+
<button id="customServerSubmit" type="submit" class="btn btn-default" data-dismiss="modal">
374+
Open Connection
368375
</button>
369376
</p>
370377
</div>

js/charts/barchart.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ function BarChart (name, units, rollouts, accessor) {
5050
return bindex;
5151
}
5252
rollouts.forEach(function(rollout) {
53-
if ( skipFilter || data.filters.isActiveRollout(rollout) ) {
54-
bins[binIndex(rollout)] += 1;
53+
if( data.filters.filteredTimePeriod < rollout.length ) {
54+
if ( skipFilter || data.filters.isActiveRollout(rollout) ) {
55+
bins[binIndex(rollout)] += 1;
56+
}
5557
}
5658
});
5759
return bins;

js/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,11 @@ var MDPVis = {
705705
MDPVis.server.dataEndpoint = simulatorPath;
706706
MDPVis.initialize();
707707
});
708+
$("#customServerSubmit").click(function(elem){
709+
$(".post-modal-show").show();
710+
MDPVis.server.dataEndpoint = $("#customServer").val();
711+
MDPVis.initialize();
712+
});
708713
$('#serverSelectionModal').modal();
709714
}
710715

serve.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ echo "This script starts a simple Python server that will let you open MDPvis lo
33
echo "Once the server starts you can visit http://localhost:8000/index.html in your browser."
44
echo "to quit the server you should press ctrl-c."
55
echo ""
6+
echo "You should not use this server to start an MDP domain since this will only serve the visualization."
67
python -m SimpleHTTPServer

tornado_server.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
from tornado.httpserver import HTTPServer
33
from tornado.ioloop import IOLoop
44
from flask_server import app
5+
import sys
56

67
http_server = HTTPServer(WSGIContainer(app))
8+
# There is an optional parameter for selecting between multiple domains in the
9+
# domain bridge
10+
if len(sys.argv) > 2:
11+
domain = sys.argv[2]
712
http_server.listen(5000)
813
IOLoop.instance().start()

0 commit comments

Comments
 (0)