-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
91 lines (86 loc) · 2.81 KB
/
index.html
File metadata and controls
91 lines (86 loc) · 2.81 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Stacktrace Filter</title>
<style>
body {
background-color: #f6f8fa;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
h1 {
font-size: 32px;
padding: 20px 0;
text-align: center;
}
.textbox {
width: calc(100% - 50px);
margin: 10px 15px;
font-size: 14px;
padding: 10px;
border: 1px solid #d1d5da;
border-radius: 3px;
}
#stackTraceInput {
color: grey;
}
#filteredOutput {
background-color: white;
}
.btn-github {
color: #fff;
background-color: #4d4d4d;
border-color: #4d4d4d;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
padding: 10px 20px;
border-radius: 3px;
}
.btn-github:hover {
color: #fff;
background-color: #3a3a3a;
border-color: #3a3a3a;
}
.text-center {
text-align: center;
}
</style>
</head>
<body>
<h1>Stacktrace Filter</h1>
<div class="container mt-5">
<div class="row">
<div class="col-md-6 offset-md-3 mx-auto">
<textarea id="stackTraceInput" class="form-control textbox" rows="20" placeholder="Enter stacktrace here..."></textarea>
<div class="text-center">
<button id="filterButton" class="btn btn-secondary btn-github mt-3">Filter Stacktrace</button>
</div>
<div id="filteredOutput" class="textbox"></div>
<div class="text-center">
<button id="copyButton" class="btn btn-secondary btn-github mt-3">Copy to Clipboard</button>
</div>
</div>
</div>
</div>
<script>
const stackTraceInput = document.getElementById('stackTraceInput');
const filterButton = document.getElementById('filterButton');
const filteredOutput = document.getElementById('filteredOutput');
const copyButton = document.getElementById('copyButton');
const exclusions = ['from lib/', 'from vendor/', 'from bin/', 'from packages/management_tools/'];
filterButton.addEventListener('click', () => {
const lines = stackTraceInput.value.split('\n');
const filteredLines = lines.filter(line => !exclusions.some(exclusion => line.includes(exclusion)));
const filteredText = filteredLines.join('\n');
filteredOutput.innerText = filteredText;
});
copyButton.addEventListener('click', () => {
const range = document.createRange();
range.selectNode(filteredOutput);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand('copy');
window.getSelection().removeAllRanges();
});
</script>
</body>
</html>