Index: tools/deep_memory_profiler/visualizer/index.html |
diff --git a/tools/deep_memory_profiler/visualizer/index.html b/tools/deep_memory_profiler/visualizer/index.html |
index 4d756c49a61e9c2a50ab8c678c35ce87b45840d1..23a72172159a7cca1bc4de672f6a5e5076cc579e 100644 |
--- a/tools/deep_memory_profiler/visualizer/index.html |
+++ b/tools/deep_memory_profiler/visualizer/index.html |
@@ -17,13 +17,33 @@ found in the LICENSE file. |
<script src="static/graph-view.js"></script> |
<script src="static/dropdown-view.js"></script> |
<script src="static/menu-view.js"></script> |
-<script src="static/index.js"></script> |
+<script> |
+$(function() { |
+ var json = {{ json|safe }}; |
+ var template = {{ template|safe }}; |
+ if (!json || !template) |
+ return; |
+ |
+ // Create model. |
+ var profiler = new Profiler(json, template); |
+ // Create views subscribing model events. |
+ var graphView = new GraphView(profiler); |
+ var dropdownView = new DropdownView(profiler); |
+ var menuView = new MenuView(profiler); |
+ |
+ // initialize categories according to roots information. |
+ profiler.reparse(); |
+}); |
+</script> |
<body> |
<h2>Deep Memory Profiler Visulaizer</h2> |
- <form action="/" method="post"> |
- <input type="file" action=name="data"/> |
- <input type="submit"/> |
+ <form enctype="multipart/form-data" action="{{ upload_url }}" method="post"> |
+ <input type="file" name="file"/> |
+ <input type="submit" value="Upload"/> |
+ <p><font color="red"> |
+ {{ upload_msg }} |
+ </font></p> |
</form> |
<div id="graph-div"></div> |
<div id="info-div"> |