Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: tools/deep_memory_profiler/visualizer/index.html

Issue 24534002: Add share button to generate public url for dmprof visualizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/deep_memory_profiler/visualizer/app.py ('k') | tools/deep_memory_profiler/visualizer/services.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 170548e7a0dce311f444a4f3ff9f3538c3ebe2e0..5ddd7f744add918643c6f5c3d07f5419342cabee 100644
--- a/tools/deep_memory_profiler/visualizer/index.html
+++ b/tools/deep_memory_profiler/visualizer/index.html
@@ -5,8 +5,8 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<meta charset="utf-8">
-<link rel="stylesheet" href="static/index.css">
<link rel="stylesheet" href="static/third_party/jqTree/jqtree.css">
+<link rel="stylesheet" href="static/index.css">
<script src="static/third_party/flot/jquery.min.js"></script>
<script src="static/third_party/flot/jquery.flot.min.js"></script>
@@ -29,22 +29,53 @@ $(function() {
// initialize categories according to roots information.
profiler.reparse();
+
+ // Share feature only appears in server version, so it should be written
+ // here where the unique file different against local version, rather than
+ // written as a view which is shared with local version.
+ $('#share-btn').click(function() {
+ // Get run_id and current breakdown template and send them to server.
+ // Post data will be decoded weirdly at app engine side if content isn't
+ // encoded.
+ var req_data = {
+ run_id: profiler.getRunId(),
+ content: JSON.stringify(profiler.getTemplate())
+ };
+
+ $.ajax({
+ type: 'POST',
+ url: '/share',
+ data: req_data,
+ success: function(url) {
+ $('.url').val(url);
+ $('.url').select();
+ }
+ });
+ });
{% endif %}
});
</script>
<body>
- <h2>Deep Memory Profiler Visulaizer</h2>
- <form enctype="multipart/form-data" action="{{ upload_url }}" method="post">
- <input type="file" name="file"/>
- <input type="submit" value="Upload"/>
- <p><font color="red">
+ <h1>Deep Memory Profiler Visulaizer</h1>
Dai Mikurube (NOT FULLTIME) 2013/09/25 10:10:19 Found that s/Visulaizer/Visualizer/. :)
+ <div>
+ <form enctype="multipart/form-data" action="{{ upload_url }}" method="post">
+ <input type="file" name="file"/>
+ <input class="btn" type="submit" value="Upload"/>
+ </form>
+ <p class="error-message">
{{ upload_msg }}
- </font></p>
- </form>
- <div id="graph-div"></div>
- <div id="info-div">
- <div id="subs-dropdown"></div>
- <div id="category-menu"></div>
+ </p>
+ </div>
+ <div>
+ <button class="btn" id="share-btn">Share</button>
+ <input type="text" class="url">
+ </div>
+ <div id="view-div">
+ <div id="graph-div"></div>
+ <div id="info-div">
+ <div id="subs-dropdown"></div>
+ <div id="category-menu"></div>
+ </div>
</div>
</body>
« no previous file with comments | « tools/deep_memory_profiler/visualizer/app.py ('k') | tools/deep_memory_profiler/visualizer/services.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698