-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
152 lines (133 loc) · 3.99 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Apply Mappings</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #f4f4f9;
padding: 20px;
}
.container {
background: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
max-width: 90%;
width: 500px;
min-width: 300px;
min-height: 300px;
resize: horizontal;
overflow: auto;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.container h1 {
font-size: 1.5em;
margin-bottom: 20px;
text-align: center;
color: #333;
}
label {
font-weight: bold;
display: block;
margin-bottom: 8px;
color: #555;
}
.file-input-container {
position: relative;
margin-bottom: 20px;
}
.file-input-container input[type="file"] {
position: absolute;
opacity: 0;
width: 100%;
height: 100%;
cursor: pointer;
}
.shared-button {
display: block;
width: 100%;
padding: 10px;
background: #007BFF;
color: #fff;
text-align: center;
border-radius: 4px;
font-size: 1em;
cursor: pointer;
transition: background 0.3s, transform 0.2s;
border: none;
}
.shared-button:hover {
background: #0056b3;
transform: translateY(-2px);
}
.file-name {
margin-top: 8px;
font-size: 0.9em;
color: #555;
}
textarea {
width: 100%;
padding: 10px;
margin-bottom: 20px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1em;
transition: border-color 0.3s;
resize: none;
height: 150px;
}
textarea:focus {
border-color: #007BFF;
outline: none;
}
pre {
background: #f8f9fa;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
overflow-x: auto;
font-family: monospace;
color: #333;
}
</style>
</head>
<body>
<div class="container">
<h1>Apply Mappings</h1>
<label for="mapping-file">Mapping File (.tiny)</label>
<div class="file-input-container">
<input type="file" id="mapping-file" accept=".tiny">
<label class="shared-button file-input-label" for="mapping-file">Choose File</label>
<span class="file-name" id="file-name">No file selected</span>
</div>
<label for="LogArea">Log</label>
<textarea id="LogArea" placeholder="Enter the log to apply mappings to..."></textarea>
<button class="shared-button" id="applyMappingsButton">Apply Mappings</button>
<label for="LogWithMappings">Mapped Log</label>
<pre id="LogWithMappings"></pre>
</div>
<script>
const fileInput = document.getElementById('mapping-file');
const fileNameDisplay = document.getElementById('file-name');
fileInput.addEventListener('change', () => {
const fileName = fileInput.files[0]?.name || 'No file selected';
fileNameDisplay.textContent = fileName;
});
</script>
<script src="script.js" type="module"></script>
</body>
</html>