-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
189 lines (164 loc) · 5.41 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
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
181
182
183
184
185
186
187
188
189
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TheoremOne | LLM Benchmarking Metrics</title>
<!-- Add Bootstrap CSS link -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<!-- Add DataTables CSS link -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css">
<!-- Custom CSS -->
<style>
/* Custom styles for header, navbar, and sidebar */
#header {
background-color: #007bff;
color: #fff;
padding: 10px;
display: flex; /* Use Flexbox */
align-items: center; /* Center the items vertically */
}
#theoremone-logo {
width: 50px;
height: 50px;
margin-right: 10px; /* Add some space between the logo and the heading */
}
#header h1 {
margin: 0; /* Remove the default margin on the heading */
}
#navbar {
background-color: #f8f9fa;
border-right: 1px solid #ccc;
min-height: 100vh;
padding: 20px;
}
#sidebar-logo {
width: 50px;
height: 50px;
margin: 10px auto;
}
#main-content {
padding: 20px;
}
/* Custom styles for footer */
#footer {
background-color: #f8f9fa;
padding: 10px;
text-align: center;
}
</style>
</head>
<body>
<!-- Header -->
<div id="header">
<!-- SVG Icon -->
<div id="theoremone-logo">
<svg id="icon" width="50" height="50" viewBox="0 0 600 600" xmlns="http://www.w3.org/2000/svg">
<!-- Include the SVG code from your th1-icon-round.svg file here -->
<use xlink:href="assets/th1-icon-round.svg#icon"></use>
</svg>
</div>
<h1>TheoremOne</h1>
</div>
<!-- Navbar and Sidebar -->
<div class="container-fluid">
<div class="row">
<!-- Navbar -->
<div class="col-md-3" id="navbar">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="aboutus.html">About Us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contactus.html">Contact</a>
</li>
</ul>
</div>
<!-- Main Content -->
<div class="col-md-9" id="main-content">
<h2>LLM Benchmarking Metrics</h2>
<div id="table-container"></div>
</div>
</div>
</div>
<!-- Footer -->
<div id="footer">
<p>© 2023 TheoremOne. All rights reserved.</p>
</div>
<!-- Add Bootstrap and jQuery JS links -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<!-- Add DataTables JS link -->
<script src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"></script>
<script>
const csvFilePath = 'sample1.csv'; // Replace with your CSV file path
const refreshInterval = 5000; // Refresh interval in milliseconds (e.g., 5000 = 5 seconds)
window.addEventListener('DOMContentLoaded', handleDOMContentLoaded);
function handleDOMContentLoaded() {
refreshTable();
setInterval(refreshTable, refreshInterval);
}
function refreshTable() {
fetchCSVFile(csvFilePath)
.then(csvContent => {
const table = createTableFromCSV(csvContent);
const tableContainer = document.getElementById('table-container');
tableContainer.innerHTML = '';
tableContainer.appendChild(table);
// Initialize DataTables on the created table
$(table).DataTable({
// You can add additional DataTables options here if needed
});
})
.catch(error => {
console.error('Error:', error);
});
}
function fetchCSVFile(filePath) {
return fetch(filePath)
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
});
}
function createTableFromCSV(csv) {
const table = document.createElement('table');
table.classList.add('table', 'table-bordered', 'table-striped');
const lines = csv.split('\n');
// Create table headers
const headers = lines[0].split(',');
const thead = document.createElement('thead');
const headerRow = document.createElement('tr');
for (let i = 0; i < headers.length; i++) {
const th = document.createElement('th');
th.textContent = headers[i];
headerRow.appendChild(th);
}
thead.appendChild(headerRow);
table.appendChild(thead);
// Create table rows
const tbody = document.createElement('tbody');
for (let i = 1; i < lines.length; i++) {
const rowData = lines[i].split(',');
if (rowData.length === headers.length) {
const row = document.createElement('tr');
for (let j = 0; j < rowData.length; j++) {
const cell = document.createElement('td');
cell.textContent = rowData[j];
row.appendChild(cell);
}
tbody.appendChild(row);
}
}
table.appendChild(tbody);
return table;
}
</script>
</body>
</html>