Skip to content

Commit

Permalink
updated license to Apache 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Towey committed Mar 23, 2012
1 parent 1915222 commit 9c6656d
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 29 deletions.
3 changes: 3 additions & 0 deletions LICENSE
@@ -0,0 +1,3 @@
This software is licensed under the Apache 2.0 license. This includes all files created by the authors in this distribution. This project includes work from third parties as well. Third party included files fall under their own license terms.

The full text of the license agreement is at http://www.apache.org/licenses/LICENSE-2.0
10 changes: 10 additions & 0 deletions index.php
@@ -1,8 +1,18 @@
<?php
/**
* This is the main loader and controller init script for the Anemometer project
* It just loads the config, creates a controller and invokes it. See
* lib/Anemometer.php for the main project code.
* @author Gavin Towey <gavin@box.com>, Geoffrey Anderson <ganderson@box.com>
* @created 2012-01-01
* @license Apache 2.0 license. See LICENSE document for more info
**/

set_include_path( get_include_path() . PATH_SEPARATOR . "./lib");
require "Helpers.php";
require "Anemometer.php";
/*
* move these to github
* todo: implement exra fields ... somehow<br> or remove extra fields for version 1
* todo: add reviewed_status to search fields ... tab for extended search?<br>
* todo: possible report for reviewed (aggregate by reviewd type, reviwed/unreviewed / new or old, etc)<br>
Expand Down
2 changes: 1 addition & 1 deletion lib/Anemometer.php
Expand Up @@ -15,7 +15,7 @@
*
* @author Gavin Towey <gavin@box.com> and Geoff Anderson <geoff@box.com>
* @created 2012-01-01
* @license please contact the authors for licensing information
* @license Apache 2.0 license. See LICENSE document for more info
*
*/
class Anemometer {
Expand Down
2 changes: 1 addition & 1 deletion lib/AnemometerModel.php
Expand Up @@ -11,7 +11,7 @@
*
* @author Gavin Towey <gavin@box.com> and Geoff Anderson <geoff@box.com>
* @created 2012-01-01
* @license please contact the authors for licensing information
* @license Apache 2.0 license. See LICENSE document for more info
*/
class AnemometerModel {

Expand Down
2 changes: 1 addition & 1 deletion lib/Helpers.php
Expand Up @@ -3,7 +3,7 @@
*
* Global helper functions for the weatherstation app
* @author Gavin Towey <gavin@box.net>
* @license please contact the authors for licensing information
* @license Apache 2.0 license. See LICENSE document for more info
* @created 2012-01-01
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/Loader.php
Expand Up @@ -4,7 +4,7 @@
*
* @author Gavin Towey <gavin@box.com>
* @created 2012-01-01
* @license please contact the authors for licensing information
* @license Apache 2.0 license. See LICENSE document for more info
*/
class Loader
{
Expand Down
2 changes: 1 addition & 1 deletion lib/MySQLTableReport.php
Expand Up @@ -87,7 +87,7 @@
*
* @author Gavin Towey <gavin@box.com>
* @created 2012-01-01
* @license contact the author for details and permissions
* @license Apache 2.0 license. See LICENSE document for more info
*
* @todo create a base class
* @todo create a pear package out of this
Expand Down
2 changes: 1 addition & 1 deletion lib/QueryExplain.php
Expand Up @@ -38,7 +38,7 @@
*
* @author Gavin Towey <gavin@box.com>
* @created 2012-01-01
*
* @license Apache 2.0 license. See LICENSE document for more info
*
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/QueryTableParser.php
Expand Up @@ -13,7 +13,7 @@
*
* @author Gavin Towey <gavin@box.com>
* @created 2012-01-01
* @license Please contact the author for licensing
* @license Apache 2.0 license. See LICENSE document for more info
*
* @todo handle table names with spaces wrapped in backticks or quotes
* @todo stop parsing early if possible -- after the JOIN clause (if any)
Expand Down
Binary file added views/.graph_search.php.swp
Binary file not shown.
40 changes: 18 additions & 22 deletions views/graph_search.php
Expand Up @@ -32,7 +32,7 @@
<option value="<?php echo $f ?>" <?php if (get_var('plot_field') == $f) { echo "SELECTED"; } ?>><?php echo $f ?></option>
<?php } ?>
</optgroup>

<?php foreach (array_keys($table_fields) as $table) { ?>
<optgroup label="<?php echo $table; ?>">
<?php foreach ($table_fields[$table] as $f) { ?>
Expand All @@ -53,23 +53,23 @@
<?php } ?>
</select>
</div>

<div class="span4" >
<input type="checkbox" name="dimension-pivot-hostname_max" value='ts_cnt'<?php echo (isset($dimension_pivot_hostname_max) ? ' CHECKED ' : '') ?>> Show each host as a separate series

</div>

<div class="span4">

<input type="submit" class="btn-primary btn-large" name="submit" value="Search">

</div>
</div>

</form>
</div>
<hr>

<div class="row">
<div id="theplot" class="span12" style="height: 300px;"></div>
</div>
Expand All @@ -85,17 +85,14 @@
<script language="javascript" type="text/javascript" src="js/flot/jquery.flot.js"></script>
<script language="javascript" type="text/javascript" src="js/flot/jquery.flot.selection.js"></script>
<script>
// Temporarily commenting out all graphing JS code due to browser crashes.

//var dataurl = "http://dba1001.ve.box.net:90/weatherstation/index.php?action=api&datasource=Live&dimension-ts_min_start=2012-03-06+21%3A16%3A00&dimension-ts_min_end=2012-03-07+21%3A16%3A00&fact-first_seen=&table_fields%5B%5D=hour_ts&table_fields%5B%5D=Query_time_sum&dimension-hostname_max=&fact-group=hour_ts&fact-order=hour_ts&fact-having=&fact-limit=999&submit=Search&fact-where=&fact-sample=&fact-checksum=&output=json2&noheader=1"
//var dataurl = "http://dba1001.ve.box.net:90/weatherstation/index.php?action=api&datasource=Live&dimension-ts_min_start=2012-03-06+21%3A16%3A00&dimension-ts_min_end=2012-03-07+21%3A16%3A00&fact-first_seen=&table_fields%5B%5D=hour_ts&table_fields%5B%5D=Query_time_sum&table_fields%5B%5D=ts_cnt&dimension-hostname_max=&fact-group=hour_ts&fact-order=hour_ts&fact-having=&fact-limit=999&submit=Search&fact-where=&fact-sample=&fact-checksum=&output=json2&noheader=1"
// url to retrieve JSON from
var dataurl = "<?php echo $ajax_request_url ?>";
var graph_data_url = "<?php echo $ajax_request_url ?>";
var table_base_url = "<?php echo $ajax_table_request_url_base ?>"
var table_url_time_start_param = "<?php echo $table_url_time_start_param ?>"
var table_url_time_end_param = "<?php echo $table_url_time_end_param ?>"

// Setup options for the plot
var thefreakingoptions = {
var flot_opts = {
series: {
lines: { show: true },
points: { show: true},
Expand Down Expand Up @@ -123,7 +120,7 @@ function newPlotData(data) {
}
var theplot = $("#theplot");
thedamndata = data;
the_freaking_plot_with_freaking_lasers_on_its_freaking_head = $.plot(theplot, thedamndata, thefreakingoptions);
the_freaking_plot_with_freaking_lasers_on_its_freaking_head = $.plot(theplot, thedamndata, flot_opts);
setupSelection(theplot);
}

Expand All @@ -148,7 +145,6 @@ function leftPadThisThingYo(padThis, padding, amount)

function getMeAGoodDamnDate(d)
{

thedate = d.getFullYear();
thedate += '-';
thedate += leftPadThisThingYo(d.getMonth()+1, '0', 2);
Expand All @@ -167,7 +163,7 @@ function setupSelection(theplot) {
// Add event handlers to the plot div that allow interactive selection of data
theplot.bind("plotselected", function (event, ranges) {
//$("#selection").text(ranges.xaxis.from.toFixed(1) + " to " + ranges.xaxis.to.toFixed(1));
plot = $.plot(theplot, thedamndata, $.extend ( true, {}, thefreakingoptions, {
plot = $.plot(theplot, thedamndata, $.extend ( true, {}, flot_opts, {
xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }
}));

Expand Down Expand Up @@ -212,12 +208,12 @@ function showTableData(data) {
var theplot = $("#theplot");

// Create the plot!
var the_freaking_plot_with_freaking_lasers_on_its_freaking_head = $.plot(theplot, thedamndata, thefreakingoptions);
var the_freaking_plot_with_freaking_lasers_on_its_freaking_head = $.plot(theplot, thedamndata, flot_opts);

// If the clear button is hit, reset the plot with the new values
$("#clear_selection").click(function () {
//the_freaking_plot_with_freaking_lasers_on_its_freaking_head = $.plot($("#theplot"), thedamndata, thefreakingoptions);
the_freaking_plot_with_freaking_lasers_on_its_freaking_head = $.plot($("#theplot"), thedamndata, thefreakingoptions);
//the_freaking_plot_with_freaking_lasers_on_its_freaking_head = $.plot($("#theplot"), thedamndata, flot_opts);
the_freaking_plot_with_freaking_lasers_on_its_freaking_head = $.plot($("#theplot"), thedamndata, flot_opts);
the_freaking_plot_with_freaking_lasers_on_its_freaking_head.clearSelection();
var new_table_url_now = table_base_url + '&' + escape(table_url_time_start_param) + '=' + escape($('#dimension-ts_min_start').val()) + '&' + escape(table_url_time_end_param) + '=' + escape($('#dimension-ts_min_end').val());
$('#report_table').html('<center><img src="img/ajax-loader.gif"></center>');
Expand All @@ -232,12 +228,12 @@ function showTableData(data) {


$.ajax({
url: dataurl,
url: graph_data_url,
method: 'GET',
dataType: 'json',
success: newPlotData
});

var table_url_now = table_base_url + '&' + escape(table_url_time_start_param) + '=' + escape($('#dimension-ts_min_start').val()) + '&' + escape(table_url_time_end_param) + '=' + escape($('#dimension-ts_min_end').val());
$.ajax({
url: table_url_now,
Expand Down

0 comments on commit 9c6656d

Please sign in to comment.