Commit 7c3449f3 authored by Edvard Rejthar's avatar Edvard Rejthar

malá vylepšení UI

parent a2c7179f
...@@ -35,14 +35,10 @@ class MetadataParser: ...@@ -35,14 +35,10 @@ class MetadataParser:
domainThreadNumber += 1 domainThreadNumber += 1
t = threading.Thread(target=self.addDomain, args=(crawl[domain], domain, domainThreadNumber)) t = threading.Thread(target=self.addDomain, args=(crawl[domain], domain, domainThreadNumber))
threads.append(t) threads.append(t)
t.start() t.start()
print("EDVARD 10")
#konsolidovat informace o domenach #konsolidovat informace o domenach
for thread in threads: for thread in threads:
thread.join() thread.join()
print("EDVARD 11")
print("EDVARD 12")
print("EDVARD END METADATA")
#sesumirovat informace o domene #sesumirovat informace o domene
...@@ -72,12 +68,11 @@ class MetadataParser: ...@@ -72,12 +68,11 @@ class MetadataParser:
#konsolidovat informace o IP v domenach #konsolidovat informace o IP v domenach
for thread in threads: for thread in threads:
thread.join() thread.join()
print("("+str(threadNumber),"EDVARD 9") #print("("+str(threadNumber),"EDVARD 9")
if len(threads) == 0: #domena zadne IP nema, je pozastavena if len(threads) == 0: #domena zadne IP nema, je pozastavena
#presto chceme evil host zapsat - alespon s ip null #presto chceme evil host zapsat - alespon s ip null
#vote = #vote =
self.addAddress(None, None, domainEncountered,crawlDomain.pdns,0,0) self.addAddress(None, None, domainEncountered,crawlDomain.pdns,0,0)
print("("+str(threadNumber),"EDVARD 8")
#if vote == None:vote = "" #if vote == None:vote = ""
#crawlDomain.vote = vote #crawlDomain.vote = vote
...@@ -119,21 +114,17 @@ class MetadataParser: ...@@ -119,21 +114,17 @@ class MetadataParser:
pass pass
#logging.debug("("+str(threadNumber)+","+str(domainThreadNumber)+") " + "ADDRESS " + " ip: " + str(ip)) #+ str(vote) #logging.debug("("+str(threadNumber)+","+str(domainThreadNumber)+") " + "ADDRESS " + " ip: " + str(ip)) #+ str(vote)
print("("+str(threadNumber),"EDVARD 4")
if ip != None: if ip != None:
#crawlDomainIp.vote = vote #crawlDomainIp.vote = vote
#kontaktovat externi geoIP sluzbu #kontaktovat externi geoIP sluzbu
print("("+str(threadNumber),"EDVARD 5")
crawlDomainIp.country, crawlDomainIp.city = Domains.ip2countryAndCity(ip) crawlDomainIp.country, crawlDomainIp.city = Domains.ip2countryAndCity(ip)
# kontaktovat PDNS # kontaktovat PDNS
items = Domains.ip2pdnsDomains(ip) items = Domains.ip2pdnsDomains(ip)
if items: if items:
pdns.update(items) pdns.update(items)
print("("+str(threadNumber),"EDVARD 6")
return None return None
else: #zadna ip neni k dispozici, domena je asi propadla, hlas patri jmenu domeny else: #zadna ip neni k dispozici, domena je asi propadla, hlas patri jmenu domeny
#return vote #return vote
print("("+str(threadNumber),"EDVARD 7")
return None return None
......
...@@ -44,8 +44,7 @@ class TrafficLogParser: ...@@ -44,8 +44,7 @@ class TrafficLogParser:
if (Whitelist.matches(url)): if (Whitelist.matches(url)):
continue continue
print("EDVARD") #print(Domains.url2domain(url), Domains.url2path(url), path)
print(Domains.url2domain(url), Domains.url2path(url), path)
crawl[Domains.url2domain(url)].urls[Domains.url2path(url)].addSourcefile(path) crawl[Domains.url2domain(url)].urls[Domains.url2path(url)].addSourcefile(path)
def nicifyFile(sourcefile): def nicifyFile(sourcefile):
......
...@@ -12,7 +12,7 @@ from urllib.parse import urlparse ...@@ -12,7 +12,7 @@ from urllib.parse import urlparse
#myDB.connect() #myDB.connect()
if(0): # Do not print all queries to stderr. if(1): # Do not print all queries to stderr.
logger = logging.getLogger('peewee') logger = logging.getLogger('peewee')
logger.setLevel(logging.WARNING) logger.setLevel(logging.WARNING)
......
...@@ -127,6 +127,8 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { ...@@ -127,6 +127,8 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) {
$(".analysis", analysisTemp).each(function () {// probehla jedina analyza, ale radsi to prozenu eachem $(".analysis", analysisTemp).each(function () {// probehla jedina analyza, ale radsi to prozenu eachem
$("body h1:eq(0)").append(safebrowsingIcon(this, $(this).attr("data-host"))); $("body h1:eq(0)").append(safebrowsingIcon(this, $(this).attr("data-host")));
$("#advice").remove();
$advice = $("<p/>", {id: "advice", "text" : "Když je to ! nebo wp a stránka není sundaná a ještě nemáme korespondenci, dát poslat."}).insertAfter($("body h1:eq(0)"));
$(".web", this).each(function () {//primerguje weby nalezene v nove analyze do stare analyzy. $(".web", this).each(function () {//primerguje weby nalezene v nove analyze do stare analyzy.
host = $.trim($(".domain", this).text()); host = $.trim($(".domain", this).text());
...@@ -346,7 +348,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { ...@@ -346,7 +348,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) {
correspondenceDays = Math.floor(((new Date) - d) / (24 * 60 * 60 * 1000));//kolik dni je zprava stara correspondenceDays = Math.floor(((new Date) - d) / (24 * 60 * 60 * 1000));//kolik dni je zprava stara
corrText = "počet: " + correspondenceCount + ", dnů: " + correspondenceDays; corrText = "počet: " + correspondenceCount + ", dnů: " + correspondenceDays;
} else {//jeste zadna konverzace, pisme novou zpravu } else {//jeste zadna konverzace, pisme novou zpravu
correspondenceUrl = $("#correspondence > div > a").attr("href"); correspondenceUrl = $("#correspondence > div > a").attr("href") + "#send";
correspondenceDays = "-"; correspondenceDays = "-";
corrText = "žádná"; corrText = "žádná";
......
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