mirror of
https://github.com/geohot/qira
synced 2025-01-27 12:49:30 +03:00
add tags view, make flat work
This commit is contained in:
parent
fac560bc00
commit
a1e6ec14fb
@ -57,6 +57,15 @@ def gettagsa():
|
||||
ret.append(rret)
|
||||
return json.dumps(ret)
|
||||
|
||||
@app.route('/gettagss', methods=["POST"])
|
||||
def gettagss():
|
||||
arr = json.loads(request.data)
|
||||
ret = []
|
||||
for i in arr:
|
||||
i = fhex(i)
|
||||
ret.append(program.static[i].todict());
|
||||
return json.dumps(ret)
|
||||
|
||||
@socketio.on('gotoname', namespace='/qira')
|
||||
@socket_method
|
||||
def gotoname(name):
|
||||
|
@ -503,6 +503,13 @@ class Tags:
|
||||
self.static = static
|
||||
self.address = address
|
||||
|
||||
def todict(self):
|
||||
ret = {}
|
||||
for k in self.backing:
|
||||
# TODO: add proper type conversions as needed
|
||||
ret[k] = str(self.backing[k])
|
||||
return ret
|
||||
|
||||
def __contains__(self, tag):
|
||||
return tag in self.backing
|
||||
|
||||
|
@ -128,16 +128,16 @@ function zoom_out_max(dontforce) {
|
||||
push_history("zoom out cview");
|
||||
}
|
||||
|
||||
function sync_tags_request(addrs) {
|
||||
function sync_tags_request(addrs, call='gettagsa') {
|
||||
var req = new XMLHttpRequest();
|
||||
req.open('POST', '/gettagsa', false);
|
||||
req.open('POST', '/'+call, false);
|
||||
req.send(JSON.stringify(addrs));
|
||||
return JSON.parse(req.response);
|
||||
}
|
||||
|
||||
function async_tags_request(addrs, cb) {
|
||||
function async_tags_request(addrs, cb, call='gettagsa') {
|
||||
var req = new XMLHttpRequest();
|
||||
req.open('POST', '/gettagsa', true);
|
||||
req.open('POST', '/'+call, true);
|
||||
req.onreadystatechange = function() {
|
||||
if (req.readyState == 4 && req.status == 200) {
|
||||
cb(JSON.parse(req.response));
|
||||
|
@ -37,14 +37,14 @@ Deps.autorun(function() { DA("update itags view");
|
||||
var addr = Session.get('iaddr');
|
||||
async_tags_request([addr], function(x) {
|
||||
$("#itags-static").html(draw_tags(addr, x[0]));
|
||||
})
|
||||
}, 'gettagss')
|
||||
});
|
||||
|
||||
Deps.autorun(function() { DA("update dtags view");
|
||||
var addr = Session.get('daddr');
|
||||
async_tags_request([addr], function(x) {
|
||||
$("#dtags-static").html(draw_tags(addr, x[0]));
|
||||
})
|
||||
}, 'gettagss')
|
||||
});
|
||||
|
||||
// TODO: this code is replicated in idump.js
|
||||
|
@ -139,6 +139,7 @@ td {
|
||||
min-height: 18px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
background-color: #BBBBBB;
|
||||
}
|
||||
|
||||
#itags-static {
|
||||
|
Loading…
Reference in New Issue
Block a user