Skip to content

Commit 11aa52c

Browse files
save
1 parent 9e6cbb5 commit 11aa52c

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

coffee/habitat.tracker.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ habitat.tracker =
5252
out = $('body')
5353

5454
for flight in list
55-
out.append "#{flight.start} #{flight.name} <br />"
55+
out.append "#{flight.start} #{flight.name} [#{flight._id}]<br />"

coffee/habitat.tracker.db.coffee

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
habitat.tracker.db =
22

33
# pulls latest flights from habitat
4-
get_flights: (callback, selector) ->
5-
ts = Math.floor (new Date()).getTime() / 1000
4+
get_flights: (callback, time) ->
5+
ts = if time? then time else Math.floor (new Date()).getTime() / 1000
66

77
habitat.db.view "flight/end_start_including_payloads", {
88
startkey: [ts]
@@ -36,3 +36,20 @@ habitat.tracker.db =
3636
list.concat(doc.payloads);
3737

3838
null
39+
40+
get_telemetry_by_flight_id: (callback, id) ->
41+
habitat.db.view "payload_telemetry/flight_payload_time", {
42+
startkey: [id]
43+
endkey: [id,{}]
44+
include_docs: true
45+
success: (data) -> callback data.rows
46+
}
47+
48+
get_telemetry_by_id: (callback, id, time = 0) ->
49+
habitat.db.view "payload_telemetry/payload_time", {
50+
startkey: [id,time]
51+
endkey: [id,{}]
52+
include_docs: true
53+
success: (data) -> callback data.rows
54+
}
55+

fabfile.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
from fabric.api import *
22

3+
def dothis(cmd):
4+
if len(env.hosts) == 0:
5+
local(cmd)
6+
else:
7+
run(cmd)
8+
39
def compile_coffee():
4-
local("/usr/lib/node_modules/coffee-script/bin/coffee -b -c -o js/ coffee/*.coffee")
10+
dothis("/usr/lib/node_modules/coffee-script/bin/coffee -b -c -o js/ coffee/*.coffee")
511

612
def build():
713
compile_coffee()
814

915
def clean():
10-
local("rm -f js/*js")
16+
dothis("rm -f js/*js")

0 commit comments

Comments
 (0)