-
Notifications
You must be signed in to change notification settings - Fork 2
/
template.go
134 lines (129 loc) · 2.16 KB
/
template.go
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
package ebpflog
import "fmt"
var header string = `
<html>
<head>
<style>
body {
font-family: Consolas;
background: #eaf7fa;
}
.src {
color:#833fcc;
}
.bpf {
color:#139f7c;
}
.err {
color:#ff0026;
font-weight:bold;
}
.bt {
color:#a0a362;
}
.result {
color:#009bb9;
}
.bttbl {
background:#3bf1c4;
}
.regdump {
background:#faf7c2;
display:inline-block;
}
.backtrace {
background:#c2f0fa;
display:inline-block;
}
.regdumpcontent {
display:none;
}
.registers {
display:inline-block;
}
.registerst td, .registerst th {
border:1px solid black;
margin:0;
background:#fbfae8;
}
.registerst th {
font-weight:bold;
}
.stack {
display:inline-block;
}
.btinfo {
border:1px solid green;
}
.pclnk, .pclnk:visited {
color: #3371db;
}
.icon {
text-decoration: none;
font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort;
}
.button {
cursor: pointer;
text-decoration: underline dotted;
}
.annotation {
padding-left:10px;
}
.starting {
height: 50px;
border-bottom: 1px dashed gray;
}
.ending {
height: 50px;
border-top: 3px dashed #04F013;
margin-top: 20px;
}
.bbtrans {
font-size:40px;
}
</style>
<script>
function toggleshow(e) {
x = e.parentElement.getElementsByClassName("regdumpcontent")[0]
if (x.style.display == "none" || x.style.display == "") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
var lasthlidx = 0
function onregclk(e) {
if (lasthlidx != 0) {
document.styleSheets[0].deleteRule(lasthlidx)
lasthlidx = 0
}
if (e == null) {
return
}
tgt = e.target
cl = tgt.className
lasthlidx = document.styleSheets[0].cssRules.length
document.styleSheets[0].addRule("."+cl, "background:#3b161f;color:#a4f32c;")
}
window.onload = function() {
var anchors = document.getElementsByTagName('span');
for(var i = 0; i < anchors.length; i++) {
var anchor = anchors[i];
if(anchor.className.startsWith("reg_")) {
anchor.onclick = function(e) {
onregclk(e);
}
}
}
}
</script>
</head>
<body>
`
var footer string = `
</body>
</html>
`
func getIcon(icon string) string {
return fmt.Sprintf("<span class=\"icon\">%s</span>", icon)
}