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

Unified Diff: appengine/findit/templates/crash/crash_config.html

Issue 1852383002: [Findit] Integrate with Fracas through Pub/Sub. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Just rebase. Created 4 years, 8 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 | « appengine/findit/queue.yaml ('k') | appengine/findit/third_party/googleapiclient » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/templates/crash/crash_config.html
diff --git a/appengine/findit/templates/crash/crash_config.html b/appengine/findit/templates/crash/crash_config.html
new file mode 100644
index 0000000000000000000000000000000000000000..6b6dad9e0aaa9d450a56aec60ba2c4a1e3b5487c
--- /dev/null
+++ b/appengine/findit/templates/crash/crash_config.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<head>
+ <meta charset="utf-8">
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
+ <link rel="stylesheet" href="/common.css"></link>
+ <title>Crash Configuration</title>
+ <script>
+ var crash = {};
+ crash.fracas = {{ fracas | tojson | safe }};
+
+ function getJsonOfTextarea(textId) {
+ return JSON.parse($('#' + textId).val());
+ }
+
+ function getStringFromJson(json) {
+ return JSON.stringify(json, null, ' ');
+ }
+
+ function save(e) {
+ var newConfig = {
+ 'fracas': getJsonOfTextarea('fracas'),
+ };
+ $.post('/crash/config', { data: JSON.stringify(newConfig) }).done(function() {
+ window.location.reload(); // Reload after successful saving.
+ }).fail(function(xhr) {
+ // Replace the whole page with errors from server side.
+ document.body.outerHTML = xhr.responseText;
+ });
+ e.preventDefault();
+ }
+
+ $(document).ready(function() {
+ $('#save-button').click(save);
+ $('#fracas').val(getStringFromJson(crash.fracas));
+ });
+ </script>
+</head>
+<body>
+ <h3>Crash Configuration</h3>
+ <div>
+ Settings for Fracas:<br>
+ <textarea id="fracas" rows="20" cols="80"></textarea>
+ </div>
+ <button type="submit" id="save-button">Save</button>
+</body>
« no previous file with comments | « appengine/findit/queue.yaml ('k') | appengine/findit/third_party/googleapiclient » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698