Commit 1f694c14 authored by Bruce Flynn's avatar Bruce Flynn

Mod to sample html for new changes

parent 16d1bd5e
Pipeline #1404 passed with stage
in 1 minute and 48 seconds
......@@ -92,7 +92,6 @@
</div>
<div class="col-md-12">
<div class="form-group">
<label for="nc">NetCDF</label>
<input type="radio" name="format" ng-model="form.format" value="nc"/>
......@@ -101,10 +100,19 @@
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="rdr">RDR</label>
<input type="radio" name="type" ng-model="form.type" value="rdr"/>
<label for="csv">Q1H</label>
<input type="radio" name="type" ng-model="form.type" value="q1h"/>
</div>
</div>
<div class="col-md-12">
<button class="btn btn-success" type="submit">Submit</button>
</div>
<!--
<div class="footer col-md-12">
<h4>DEBUG</h4>
<p>
......@@ -115,6 +123,7 @@
API URL: <pre>{{url}}</pre>
</p>
</div>
-->
</form>
</div> <!-- /.row -->
......@@ -122,7 +131,8 @@
</div>
<script>
var API_URL = 'http://amrc.ssec.wisc.edu:5000';
// var API_URL = 'http://amrc.ssec.wisc.edu:5000';
var API_URL = 'http://localhost:5010';
angular.module('app', ['ui.bootstrap'])
.factory('Api', function($http) {
......@@ -139,7 +149,16 @@
return {
getStations: function() {
return $http.get(API_URL + '/stations.json').then(function(resp) {
return resp.data;
var data = resp.data;
var stations = [];
for (var stationName in data) {
if (data.hasOwnProperty(stationName)) {
stations.push({name: stationName,
rdr: data[stationName]['rdr'],
q1h: data[stationName]['q1h']});
}
}
return stations;
});
},
dataUrl: function(form) {
......@@ -148,6 +167,7 @@
url += '&end=' + strftime(form.end);
url += '&stations=' + arrParam(form.stations, 'name');
url += '&symbols=' + arrParam(form.symbols, 'id');
url += '&type=' + form.type;
return url;
}
};
......@@ -163,7 +183,8 @@
start: undefined,
end: undefined,
symbols: [],
format: 'csv'
format: 'csv',
type: 'q1h'
};
$scope.symbols = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment