-
Notifications
You must be signed in to change notification settings - Fork 32
/
Generate_Report.py
180 lines (174 loc) · 10.4 KB
/
Generate_Report.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#!/usr/bin/env python
# coding=utf-8
################
# AabyssZG #
################
from tqdm import tqdm
from typing import Optional, Tuple
from termcolor import cprint
html='''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The report</title>
<style>
.container{
justify-content: center;
align-items: center;
position: relative;
}
a{
text-decoration: none;
color: #0590d8ee;
}
.justify-center{
justify-content: center;
}
.items-center{
align-items: center;
}
.relative{
position: relative;
}
.flex{
display: flex;
}
.flex-row{
flex-direction: row;
}
.flex-col{
flex-direction: column;
}
.space-around{
justify-content: space-around;
}
li{
list-style-type: none;
border-radius: 0.25rem;
margin-bottom: 4px;
}
.p-1{
padding: .25rem;
}
.p-2{
padding: .5rem;
}
.r-1{
border-radius: 0.25rem;
}
.w-30{
width: 30%;
}
.stat{
width: 80%;
}
.gap-1{
gap: 1 0;
}
.record-list{
width: 80%;
}
.list-item{
padding: 4px;
border: 3px;
}
.status{
font-weight: bold;
}
.status-servival{
color: hsl(125.31deg 62.03% 46.47%);
background-color: hsl(125.31deg 62.03% 46.47% / 14.9%);
}
.status-deaed{
color: hsl(0deg 63.43% 53.06%);
background-color: hsl(0deg 63.43% 53.06%/14.9%);
}
.status-reject{
color: hsl(0deg 0% 60.16%);
background-color: hsl(0deg 0% 60.16%/14.9%);
}
.logo{}
</style>
<script>
var reportData = {{}}
</script>
</head>
<body>
<div class="logo p-1">
<div class="flex items-center justify-center p-1">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaIAAACeCAYAAABwxA4NAAAAAXNSR0IArs4c6QAADrNJREFUeF7t3T+OHlUWhvHyMpDllMASsmRLCIhnB5YIxhESZLACMwkyEgvAicmZAIkNeGI7IcEbIJmAXfRo3J5x425/9636TtX5/vwmmZHmrXPufe6perrahrr122+/XUxv/vPgwYP//U//jQACCCCAwCYEbhHRJpw1QQABBBB4DwEiMhoIIIAAAq0EiKgVv+YIIIAAAkRkBhBAAAEEWgkQUSt+zRFAAAEEiMgMIIAAAgi0EiCiVvyaI4AAAggQkRlAAAEEEGglQESt+DVHAAEEECAiM4AAAggg0EqAiFrxa44AAgggQERmAAEEEECglQARteLXHAEEEECAiMwAAggggEArASJqxa85AggggAARmQEEEEAAgVYCRNSKX3MEEEAAASIyAwgggAACrQSIqBW/5ggggAACRGQGEEAAAQRaCRBRK37NEUAAAQSIyAwggAACCLQSIKJW/JojgAACCBCRGUAAAQQQaCVARK34NUcAAQQQICIzgAACCCDQSoCIWvFrvpvAy+n7W59N3waYnry8mB5/MgpW1xv18/8jgEBCgIgSSjJnT+DPfz6cPvj7r9c4/G2apn8FdG7OPZleXDyePt1x/by+43rBUkUQ2JwAEW2OXMOcwA1vMN+9mC6++GN6eOfRdFULi9+IwnqXQrg/FEe6t7RedS5dnxwCWxIgoi1p67UHgT+nnz//YHr00VsR3Y9+Hfe+lvPqpUJIN5jWq86l65NDYEsCRLQlbb32IDBPHONG8+qlQhj3vUyk9apz6frkENiSABFtSVuvPQjME8e40bx6qRDGfYkoZSR3PgSI6HzO+sh3Ok8c483Oq0dEY6ISCCwlQERLybluYwLzxDFe3Lx6RDQmKoHAUgJEtJSc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84M+FcJl7smONyIHggAC6xEgovXYqowAAgggEBAgogCSCAIIIIDAegSIaD22KiOAAAIIBASIKIAkggACCCCwHgEiWo+tyggggAACAQEiCiCJIIAAAgisR4CI1mOrMgIIIIBAQICIAkgiCCCAAALrESCi9diqjAACCCAQECCiAJIIAggggMB6BIhoPbYqI4AAAggEBIgogCSCAAIIILAeASJaj63KCCCAAAIBASIKIIkggAACCKxHgIjWY6syAggggEBAgIgCSCIIIIAAAusRaBSRD52td6wqI7A2Affv2oTPqX6/iD56MV2s/unnl9P3tz6bvg1ONvtKZ16v4suhV5edfXI6X1+23wDc60jet5pL1z7e7bvNp71zzrVcrs6BT7eP78vr9012/16/bt5cPZleXDyePt1x276v3nrzsvsZchgi+uKP6eGdR9OvV9a6+EH13Yvp4k29+zs+/Xx5EPeHB5Y+gtN6ae7Q+3atr5pf1z4Ove94fVdE5P4d43pPIp3nrtzijc288KBEtEsc431dvzGI6C21dJDHnOcl0r7VuXmrHKe71tfVNyAy/fz5B9Oj//5GI/jBr7peymXc9zKR1ktzXX3T9aW5dB/75oho8AqbAk4PNs0det+u9VXz69rHofcdr2/eD37V9arnIK2X5sb7XUeA6frSXLqPfXNERET7ztDO69OBr85Vb6prfV19x/yIaNefwYz5EdFVRkREROk9syhX/SBN6y1a7I6L0r5pLl1fWi/NpX3HOSIiovGUpAkiIqJ0Vhbl0gdkdW7RYoloBjYiIqIZ4zKIEhER1U3TDZWqBZPWq95U2jfNpetL66W5tO84R0RENJ6SNEFERJTOyqJc+oCszi1arDeiGdiIiIhmjMvhvhG9mr6+c296+uGz6eKH36fbHz+d7v50MT3/cunm5t0Yr765Pd378e707OL59NXSlleuS+uluXRJab00l/ZNc2nf6ly6vjTXtb6uvmMup3X/pj8Ipecx5neZSOt15dJ97Js7oTeieSjSwUurpvXS3KH37VpfNb+ufRx63/H65v3gN643L3Hoc5DuJt1HVy7dx745IvKruX1naOf1p3IDVe8jhd7Vd7w+IvKrufGUpAkiIqJ0Vhblqh+kab1Fi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7au6914/7yeg8TLm1UsPdtx33it72jfNpetLc2nfNFfdt7qefdxMdMxl3v02Prd59cbrG3f0RjT+d0rOo7g87Y3IG5E3Im9E3oi8ES23SMGVREREREREREREBTpZXoKIiIiIiIiIiGi5RQquPCgRlXwq3Ifx9hqL9HfvaS5dTFe9rr7VXLbfx0qfCj+R+7frfNM5SHPpPvbNHYaI2j4VvvYnf19O39/6bPo2OKUnLy+mx5+8DV4OyvL1vVsvWMLryLy+409x39x3OZfT3kfOZfEXjN8DcP4nyg/hU+HL749sv/l5ZPdbXi9b3/XD3Ob+Te/CPNcvoupPDV/ZezYcOSxJBBD4H4GVPhXu/j3LEWsU0VnytmkEEEAAgXcIEJGRQAABBBBoJUBErfg1RwABBBAgIjOAAAIIINBKgIha8WuOAAIIIEBEZgABBBBAoJUAEbXi1xwBBBBAgIjMAAIIIIBAKwEiasWvOQIIIIAAEZkBBBBAAIFWAkTUil9zBBBAAAEiMgMIIIAAAq0EiKgVv+YIIIAAAkRkBhBAAAEEWgkQUSt+zRFAAAEEiMgMIIAAAgi0EiCiVvyaI4AAAggQkRlAAAEEEGglQESt+DVHAAEEECAiM4AAAggg0EqAiFrxa44AAgggQERmAAEEEECglQARteLXHAEEEECAiMwAAggggEArASJqxa85AggggAARmQEEEEAAgVYCRNSKX3MEEEAAASIyAwgggAACrQSIqBW/5ggggAACRGQGEEAAAQRaCRBRK37NEUAAAQSIyAwggAACCLQSIKJW/JojgAACCPwHemqfvLiiOiEAAAAASUVORK5CYII=" />
</div>
<div class="flex items-center justify-center p-1">By <a href="https://github.com/AabyssZG">曾哥(AabyssZG)</a> && <a href="https://github.com/jingyuexing">jingyuexing</a></div>
</div>
<div class="container relative flex flex-col">
<div class="stat flex space-around">
</div>
<ul class="record-list">
</ul>
</div>
<script>
function createRecord(item){
let listItem = document.createElement("li")
listItem.classList.add("list-item","flex","space-around")
let urlRecord = document.createElement("div")
urlRecord.innerText = item.url
urlRecord.classList.add("link","w-30","flex","items-center")
let statusCode = document.createElement("div")
statusCode.innerText = item.statusCode
statusCode.classList.add("w-30","flex","justify-center")
let state = document.createElement("div")
state.classList.add("status","w-30","flex","items-center")
state.innerText = item.title
let itemType = ""
switch(item.status){
case "deaed":
itemType = "status-deaed"
break
case "reject":
itemType = "status-reject"
break
case "servival":
itemType = "status-servival"
break
}
listItem.classList.add(itemType)
listItem.appendChild(urlRecord)
listItem.appendChild(statusCode)
listItem.appendChild(state)
return listItem
}
let recordList = document.getElementsByClassName("record-list")[0]
let stat = document.getElementsByClassName("stat")[0];
let Count = [reportData.filter(item=>item.status === "servival").length,reportData.filter(item=>item.status === "reject").length,reportData.filter(item=>item.status === "deaed").length];
let statName =["servival","reject","deaed"]
for(let idx in Count){
let box = document.createElement("div")
let title = document.createElement("span")
title.innerText = statName[idx]+":"
let nums = document.createElement("span")
nums.innerText = Count[idx]
box.classList.add("status-"+statName[idx],"p-2","r-1")
box.appendChild(title)
box.appendChild(nums)
stat.append(box)
}
for(let item of reportData){
recordList.appendChild(createRecord(item))
}
</script>
</body>
</html>
'''
def generaterReport():
global html
data = ""
with open(".data/report.json",encoding="utf-8",mode="r+") as file:
data = file.read()
html = html.replace("{{}}",data)
with open("report.html",encoding="utf-8",mode="+w") as file:
file.write(html)
cprint(f"[+][+][+] 已经将存活目标生成至HTML,导出至 report.html","red")
if __name__ == '__main__':
generaterReport()