fix: [Domain] domain was up

This commit is contained in:
Terrtia 2019-12-16 15:24:47 +01:00
parent dee5e8490f
commit fffb4464c6
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
2 changed files with 22 additions and 1 deletions

View file

@ -148,6 +148,9 @@ def sanathyse_port(port, domain, domain_type, strict=False, current_port=None):
port = get_random_domain_port(domain, domain_type)
return port
def domain_was_up(domain, domain_type):
return r_serv_onion.hexists('{}_metadata:{}'.format(domain_type, domain), 'ports')
def is_domain_up(domain, domain_type, ports=[]):
if not ports:
ports = get_domain_all_ports(domain, domain_type)
@ -581,6 +584,12 @@ class Domain(object):
'''
return get_domain_last_origin(self.domain, self.type)
def domain_was_up(self):
'''
Return True if this domain was UP at least one time
'''
return domain_was_up(self.domain, self.type)
def is_domain_up(self): # # TODO: handle multiple ports
'''
Return True if this domain is UP

View file

@ -443,7 +443,19 @@ if (d.popover) {
var desc = pop_header + "<div class=\"card-body bg-dark pb-1 pt-2\"><dl class=\"row py-0 my-0\">"
Object.keys(data).forEach(function(key) {
if (key=="status") {
desc = desc + "<dt class=\"col-sm-3 px-0\">status</dt><dd class=\"col-sm-9 px-0\"><div class=\"badge badge-pill badge-light flex-row-reverse\" style=\"color:Green;\"><i class=\"fas fa-check-circle\"></i>UP</div></dd>"
desc = desc + "<dt class=\"col-sm-3 px-0\">status</dt><dd class=\"col-sm-9 px-0\"><div class=\"badge badge-pill badge-light flex-row-reverse\" style=\"color:"
if (data["status"]) {
desc = desc + "Green"
} else {
desc = desc + "Red"
}
desc = desc + ";\"><i class=\"fas"
if (data["status"]) {
desc = desc + "fa-check-circle"
} else {
desc = desc + "fa-times-circle"
}
desc = desc + "\"></i>UP</div></dd>"
} else if (key!="tags" && key!="id") {
desc = desc + "<dt class=\"col-sm-3 px-0\">" + sanitize_text(key) + "</dt><dd class=\"col-sm-9 px-0\">" + sanitize_text(data[key]) + "</dd>"
}