Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

crash trends report skeleton

  • Loading branch information...
commit 4a83ef83c95ccae1a62a939454322bf6e8be9bf5 1 parent dbb1903
@schalkneethling schalkneethling authored brandonsavage committed
View
3  webapp-php/application/config/routes.php-dist
@@ -83,3 +83,6 @@ $config['/signature_summary'] =
$config['/signature_summary/json_data'] =
'signature_summary/json_data';
+
+$config['/crash_trends'] =
+ 'crash_trends/index';
View
20 webapp-php/application/controllers/crash_trends.php
@@ -0,0 +1,20 @@
+<?php defined('SYSPATH') or die('No direct script access.');
+
+require_once(Kohana::find_file('libraries', 'timeutil', TRUE, 'php'));
+
+class Crash_Trends_Controller extends Controller {
+
+ public function __construct() {
+ parent::__construct();
+ $this->crash_trends_model = new Crash_Trends_Model();
+ }
+
+ /**
+ * Public functions map to routes on the controller
+ * http://<base-url>/NewReport/index/[product, version, ?'foo'='bar', etc]
+ */
+ public function index() {
+
+ }
+}
+?>
View
7 webapp-php/application/models/crash_trends.php
@@ -0,0 +1,7 @@
+<?php
+class Crash_Trends_Model extends Model {
+ public function getCrashTrendsViaWebService() {
+
+ }
+}
+?>
View
44 webapp-php/application/views/crash_trends/index.php
@@ -0,0 +1,44 @@
+<?php slot::start('head') ?>
+ <title>New Report for ...</title>
+ <?php echo html::stylesheet(array('css/crash_trends.css'), 'screen')?>
+ <!--[if IE]><?php echo html::script('js/flot-0.7/excanvas.pack.js') ?><![endif]-->
+<?php slot::end() ?>
+
+<div class="page-heading">
+ <h2>Crash Trends</h2>
+</div>
+
+<form name="nightly_crash_trends" id="nightly_crash_trends" action="/" method="get">
+ <fieldset>
+ <legend>Select Report Criteria</legend>
+
+ <h4>Date Range</h4>
+ <div class="field">
+ <label for="from_date">From</label>
+ <input type="date" name="from_date" id="from_date" />
+ </div>
+
+ <div class="field">
+ <label for="to_date">To</label>
+ <input type="date" name="to_date" id="to_date" />
+ </div>
+
+ <div class="field">
+ <label for="version">Version</label>
+ <select name="version" id="version">
+ <option value="5.0a2">5.0a2</option>
+ <option value="6.0a2">6.0a2</option>
+ </select>
+ </div>
+
+ <input type="submit" name="generate" value="Generate" />
+ </fieldset>
+</form>
+<div id="graph_legend"></div>
+<div id="nightly_crash_trends_graph"></div>
+
+
+<?php echo html::script(array(
+ 'js/flot-0.7/jquery.flot.pack.js',
+ 'js/socorro/crash_trends.js'
+))?>
View
21 webapp-php/css/crash_trends.css
@@ -0,0 +1,21 @@
+#nightly_crash_trends {
+ float: left;
+ margin-right: 15px;
+ width: 250px;
+}
+#nightly_crash_trends_graph {
+ float: left;
+ width: 700px;
+ height: 300px;
+}
+#graph_legend table {
+ float: left;
+ margin-left: 40px;
+ margin-bottom: 10px;
+}
+#graph_legend td {
+ padding: 0 2px 0 2px;
+}
+.field {
+ margin: 1.2em 1.2em 1.2em 0;
+}
View
25 webapp-php/js/socorro/crash_trends.js
@@ -0,0 +1,25 @@
+$(function() {
+ var graph,
+ drawCrashTrends = function() {
+ var dates = ["20110905", "20110906", "20110907", "20110908", "20110909", "20110910", "20110911"],
+ i = 0,
+ options = {
+ legend: {
+ noColumns: 7,
+ container: "#graph_legend"
+ },
+ xaxis: {
+ tickFormatter: function(val, axis) {
+ val = dates[i];
+ i++;
+ return val;
+ }
+ }
+ },
+ graphData = $.getJSON("/webservice/nightlytrends", function(data) {
+ graph = $.plot("#nightly_crash_trends_graph", data.nightlyCrashes, options);
+ });
+ };
+
+ drawCrashTrends();
+});
Please sign in to comment.
Something went wrong with that request. Please try again.