-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
638 lines (561 loc) · 23.9 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no, viewport-fit=cover" />
<title>Data Search XY</title>
<link rel="shortcut icon" href="https://github.githubassets.com/favicons/favicon.svg" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" />
<style>
.container {
max-width: 100%;
margin: 0 auto;
padding: 0 10px;
box-sizing: border-box;
}
.input-container {
display: flex;
align-items: center;
margin-bottom: 10px;
border: 1px solid #ddd;
border-radius: 5px;
overflow: hidden;
}
#filterInput {
padding: 8px;
width: 100%;
font-size: 16px;
border: none;
box-sizing: border-box;
}
.btn, .clear-btn {
padding: 8px 12px;
font-size: 16px;
cursor: pointer;
border: none;
background-color: #f5f5f5;
transition: background-color 0.2s;
}
.btn:hover, .clear-btn:hover {
background-color: #e5e5e5;
}
.icon {
font-size: 16px;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 8px;
text-align: left;
border: 1px solid #ddd;
}
th {
cursor: pointer;
}
th:hover {
background-color: #f5f5f5;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
.delete-btn {
background-color: #ff4d4d; /* Red background */
color: white; /* White text */
border: none; /* No border */
border-radius: 5px; /* Rounded corners */
padding: 5px 10px; /* Padding */
cursor: pointer; /* Pointer cursor */
}
.delete-btn:hover {
background-color: #ff1a1a; /* Darker red on hover */
}
/* Hide Hyperlink and Action columns on mobile */
@media screen and (max-width: 767px) {
#myTable th:nth-child(4), /* Hyperlink column */
#myTable td:nth-child(4),
#myTable th:nth-child(5), /* Action column */
#myTable td:nth-child(5) {
display: none;
}
/* Hide specific buttons */
.btn {
display: none;
}
}
/* Hide specific buttons on mobile */
/* 在手机上确保显示这两个按钮 */
@media screen and (max-width: 767px) {
.add-xlsx-btn, .download-xlsx-btn {
display: inline-block; /* 确保按钮显示为内联块元素 */
}
}
/* 为表格单元格设置换行 */
td {
word-wrap: break-word; /* 允许单元格内容换行 */
overflow-wrap: break-word; /* 兼容性增强 */
}
/* 针对手机屏幕缩小字体大小 */
@media screen and (max-width: 767px) {
table {
font-size: 14px; /* 当屏幕宽度小于767px时,缩小字体 */
}
td, th {
padding: 5px; /* 调整单元格内边距以节省空间 */
}
#filterInput {
font-size: 14px; /* 搜索框字体大小调整 */
}
.btn, .clear-btn {
font-size: 14px; /* 按钮字体调整 */
}
}
</style>
<script>
function sortDefault() {
sortTable(4);
}
function sortTable(n) {
var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
table = document.getElementById("myTable");
switching = true;
dir = "asc";
while (switching) {
switching = false;
rows = table.getElementsByTagName("TR");
for (i = 1; i < (rows.length - 1); i++) {
shouldSwitch = false;
x = rows[i].getElementsByTagName("TD")[n];
y = rows[i + 1].getElementsByTagName("TD")[n];
var xContent = x.innerText || x.textContent;
var yContent = y.innerText || y.textContent;
var xNum = parseFloat(xContent.replace(/[^0-9.]/g, ''));
var yNum = parseFloat(yContent.replace(/[^0-9.]/g, ''));
if (dir == "asc") {
if (!isNaN(xNum) && !isNaN(yNum)) {
if (xNum > yNum) {
shouldSwitch = true;
break;
}
} else {
if (xContent.toLowerCase() > yContent.toLowerCase()) {
shouldSwitch = true;
break;
}
}
} else if (dir == "desc") {
if (!isNaN(xNum) && !isNaN(yNum)) {
if (xNum < yNum) {
shouldSwitch = true;
break;
}
} else {
if (xContent.toLowerCase() < yContent.toLowerCase()) {
shouldSwitch = true;
break;
}
}
}
}
if (shouldSwitch) {
rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
switching = true;
switchcount++;
} else {
if (switchcount == 0 && dir == "asc") {
dir = "desc";
switching = true;
}
}
}
}
function filterTable() {
var input, filter, table, tr, td, i, j, txtValue;
input = document.getElementById("filterInput");
filter = input.value.toLowerCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
for (i = 1; i < tr.length; i++) {
tr[i].style.display = "none";
td = tr[i].getElementsByTagName("td");
for (j = 0; j < td.length; j++) {
if (td[j]) {
txtValue = td[j].textContent || td[j].innerText;
if (txtValue.toLowerCase().indexOf(filter) > -1) {
tr[i].style.display = "";
break;
}
}
}
}
}
function startSpeechRecognition() {
var recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
recognition.lang = 'en-US';
recognition.onresult = function(event) {
var transcript = event.results[0][0].transcript;
transcript = transcript.replace(/[^a-zA-Z0-9\s]/g, '');
document.getElementById('filterInput').value = transcript;
filterTable();
}
recognition.start();
}
function clearInput() {
document.getElementById('filterInput').value = '';
filterTable();
}
// Add a new row to the table
function addRow() {
var table = document.getElementById("myTable");
var row = table.insertRow(-1); // Insert at the end of the table
var name = prompt("Enter Name:");
var year = prompt("Enter Year:");
var dataType = prompt("Enter Data Type:");
var capacity = prompt("Enter Domain (x.com):");
var hyperlink = prompt("Enter Hyperlink (https://x.com):");
// Ask if the user wants to add a hyperlink for the name
var addLink = confirm("Do you want to add a hyperlink for the name?");
var nameCell = addLink && hyperlink ? `<a target="_blank" href="${hyperlink}">${name}</a>` : name;
// For Hyperlink column: if there's a hyperlink, make the text a clickable link
var displayText = capacity || 'N/A'; // Default to 'N/A' if nothing is entered
// If hyperlink is provided, wrap the text in an <a> tag to make it clickable
var displayContent = hyperlink ? `<a target="_blank" href="${hyperlink}">${displayText}</a>` : displayText;
row.innerHTML = `
<td>${nameCell}</td>
<td>${year}</td>
<td>${dataType}</td>
<td contenteditable="true" onblur="updateLink(this.parentNode, 3)">
${displayContent}
</td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
`;
// Save the current table data to localStorage
saveTableToLocalStorage();
}
// Update the hyperlink in the table when the user edits the cell
function updateLink(row, cellIndex) {
var cell = row.cells[cellIndex];
var url = cell.innerText.trim();
// Check if the content is a valid URL
if (url && (url.startsWith('http://') || url.startsWith('https://'))) {
cell.innerHTML = `<a target="_blank" href="${url}">${url}</a>`;
} else {
// If the text is not a valid URL, leave it as plain text or 'N/A'
cell.innerHTML = url || 'N/A';
}
// After updating the link, save the table to localStorage again
saveTableToLocalStorage();
}
// Delete a row
function deleteRow(btn) {
var row = btn.parentNode.parentNode;
row.parentNode.removeChild(row);
// After deleting the row, save the updated table to localStorage
saveTableToLocalStorage();
}
// Save the current table data to localStorage
function saveTableToLocalStorage() {
var table = document.getElementById("myTable");
var rows = table.getElementsByTagName("tr");
var tableData = [];
for (var i = 1; i < rows.length; i++) { // Skip the header row
var row = rows[i];
var rowData = [];
for (var j = 0; j < row.cells.length - 1; j++) { // Skip the last cell (Action)
var cell = row.cells[j];
rowData.push(cell.innerHTML);
}
tableData.push(rowData);
}
// Save table data to localStorage
localStorage.setItem('tableData', JSON.stringify(tableData));
}
// Load the table data from localStorage
function loadTableFromLocalStorage() {
var tableData = localStorage.getItem('tableData');
if (tableData) {
tableData = JSON.parse(tableData);
var table = document.getElementById("myTable");
tableData.forEach(function(rowData) {
var row = table.insertRow(-1);
rowData.forEach(function(cellData) {
var cell = row.insertCell();
cell.innerHTML = cellData;
});
var deleteCell = row.insertCell();
deleteCell.innerHTML = `<button class="delete-btn" onclick="deleteRow(this)">Delete</button>`;
});
}
}
// Call this function when the page loads to restore table data
window.onload = function() {
loadTableFromLocalStorage();
};
// Update the link if user modifies the hyperlink column
function updateLink(row, cellIndex) {
var cell = row.cells[cellIndex];
var text = cell.innerText.trim();
// Check if the content is a valid URL and if so, update the cell to be a hyperlink
if (text && (text.startsWith('http://') || text.startsWith('https://'))) {
cell.innerHTML = `<a target="_blank" href="${text}">${text}</a>`;
} else {
cell.innerHTML = text || 'N/A';
}
}
function updateLink(row, cellIndex) {
var cell = row.cells[cellIndex];
var url = cell.innerText.trim();
// Check if the content is a valid URL
if (url && (url.startsWith('http://') || url.startsWith('https://'))) {
cell.innerHTML = `<a target="_blank" href="${url}">${url}</a>`;
} else {
// If the text is not a valid URL, leave it as plain text or 'N/A'
cell.innerHTML = url || 'N/A';
}
}
function deleteRow(btn) {
var row = btn.parentNode.parentNode;
row.parentNode.removeChild(row);
}
function downloadPage() {
const link = document.createElement('a');
link.href = 'data:text/html;charset=utf-8,' + encodeURIComponent(document.documentElement.outerHTML);
link.download = 'data_page.html';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
function downloadXLSX() {
var table = document.getElementById("myTable");
var workbook = XLSX.utils.book_new();
var wsData = [];
// Extract the header row
var headers = [];
var headerCells = table.getElementsByTagName("th");
for (var i = 0; i < headerCells.length; i++) {
headers.push(headerCells[i].innerText);
}
wsData.push(headers); // Add headers as the first row
// Extract the data rows
var rows = table.getElementsByTagName("tr");
for (var i = 1; i < rows.length; i++) { // Skip the first row (header)
var row = rows[i];
var rowData = [];
var cells = row.getElementsByTagName("td");
for (var j = 0; j < cells.length - 1; j++) { // Exclude the last cell (Action button)
var cell = cells[j];
// Check if the cell contains a link
if (cell.firstChild && cell.firstChild.tagName === 'A') {
// If it's a link, store the text content
rowData.push(cell.firstChild.innerText); // Use innerText of the link (not HTML)
} else {
rowData.push(cell.innerText || cell.textContent); // Regular text content
}
}
wsData.push(rowData); // Add the data row
}
// Create a worksheet from the data
var ws = XLSX.utils.aoa_to_sheet(wsData);
// Add the worksheet to the workbook
XLSX.utils.book_append_sheet(workbook, ws, "Sheet1");
// Write the XLSX file with the correct extension
XLSX.writeFile(workbook, "data.xlsx");
}
function handleFileUpload(event) {
var file = event.target.files[0];
if (file && file.name.endsWith('.xlsx')) {
var reader = new FileReader();
reader.onload = function(e) {
var data = new Uint8Array(e.target.result);
var workbook = XLSX.read(data, { type: 'array' });
// Get the first sheet
var sheetName = workbook.SheetNames[0];
var worksheet = workbook.Sheets[sheetName];
var jsonData = XLSX.utils.sheet_to_json(worksheet);
// Add data to the table
jsonData.forEach(function(rowData) {
var name = rowData.Name || 'N/A';
var hyperlink = rowData.Hyperlink || 'N/A';
var year = rowData.Year || 'N/A';
var dataType = rowData['Data type'] || 'N/A';
// Check if the row is a duplicate
if (!isRowDuplicate(name, hyperlink, year, dataType)) {
var table = document.getElementById("myTable");
var row = table.insertRow(-1); // Insert at the end of the table
var nameCell = `<a target="_blank" href="${hyperlink}">${name}</a>`;
var displayContent = hyperlink ? `<a target="_blank" href="${hyperlink}">${hyperlink}</a>` : 'N/A';
row.innerHTML = `
<td>${nameCell}</td>
<td>${year}</td>
<td>${dataType}</td>
<td contenteditable="true" onblur="updateLink(this.parentNode, 3)">
${displayContent}
</td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
`;
}
});
};
reader.readAsArrayBuffer(file);
} else {
alert('Please upload a valid XLSX file.');
}
}
// Check if the row already exists based on all columns (Name, Hyperlink, Year, Data type)
function isRowDuplicate(name, hyperlink, year, dataType) {
var table = document.getElementById("myTable");
var rows = table.getElementsByTagName("tr");
for (var i = 1; i < rows.length; i++) { // Skip the header row
var cells = rows[i].getElementsByTagName("td");
// Compare each column (Name, Hyperlink, Year, Data type)
var existingName = cells[0].textContent.trim();
var existingHyperlink = cells[3].textContent.trim();
var existingYear = cells[1].textContent.trim();
var existingDataType = cells[2].textContent.trim();
// If any column differs, it's not a duplicate
if (existingName === name && existingHyperlink === hyperlink && existingYear === year && existingDataType === dataType) {
return true; // Row is a duplicate
}
}
return false; // Row is not a duplicate
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.1/xlsx.full.min.js"></script>
</head>
<body onload="sortDefault()">
<div class="container">
<div class="input-container">
<input type="text" id="filterInput" onkeyup="filterTable()" placeholder="Search for Data.." />
<button class="clear-btn" onclick="clearInput()">✕</button>
<button class="btn" onclick="startSpeechRecognition()"><i class="fas fa-microphone icon"></i></button>
<button class="btn add add-xlsx-btn" title="upload xlsx" onclick="document.getElementById('file-input').click()">
<i class="fas fa-plus icon"></i>
</button>
<input type="file" id="file-input" style="display: none;" accept=".xlsx" onchange="handleFileUpload(event)" />
<button class="btn download-xlsx-btn" title="download xlsx" onclick="downloadXLSX()">
<i class="fa fa-download"></i>
</button>
<button class="btn" title="download html" onclick="downloadPage()"><i class="fab fa-chrome"></i></button>
<button class="btn" title="DatXY Project"onclick="window.open('https://github.com/feeday/DatXY')"><i class="fas fa-cog"></i></button>
<!--
<button class="btn" title="add data" onclick="addRow()"><i class="fas fa-plus icon"></i></button>
<button class="btn" title="add data" onclick="addRow()"><i class="fas fa-plus icon"></i></button>
<button class="btn download-xlsx-btn" title="download xlsx" onclick="downloadXLSX()"><i class="fa fa-download"></i></button>
<button class="btn" title="download add xlsx" onclick="window.open('https://datxy.com/add.xlsx', '_blank')">
<i class="fas fa-file-excel icon"></i>
</button>
-->
</div>
<table id="myTable">
<tbody>
<tr>
<th onclick="sortTable(0)">Name</th>
<th onclick="sortTable(1)">Year</th>
<th onclick="sortTable(2)">Data type</th>
<th onclick="sortTable(3)">Hyperlink</th>
<th>Action</th>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/deepseek-ai/DeepSeek-R1">DeepSeek-R1</a></td>
<td>202501</td>
<td>Code-LLM</td>
<td><a target="_blank" href="https://github.com/deepseek-ai/DeepSeek-R1">https://github.com/deepseek-ai/DeepSeek-R1</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://chat.scnet.cn">DeepSeek-R1</a></td>
<td>202502</td>
<td>Web-LLM</td>
<td><a target="_blank" href="https://chat.scnet.cn">https://chat.scnet.cn</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://www.superclueai.com">SuperCLUE</a></td>
<td>202502</td>
<td>Ranking-AIGC</td>
<td><a target="_blank" href="https://www.superclueai.com/">https://www.superclueai.com</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://www.iresearch.com.cn/report.shtml">IResearch</a></td>
<td>202502</td>
<td>PDF-Report</td>
<td><a target="_blank" href="https://www.iresearch.com.cn/report.shtml">https://www.iresearch.com.cn/report.shtml</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://www.tradingview.com/markets/?aff_id=149508">TradingView</a></td>
<td>202502</td>
<td>Deal-Price</td>
<td><a target="_blank" href="https://www.tradingview.com/markets/?aff_id=149508">https://www.tradingview.com/markets</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://www.w3schools.com/icons/icons_reference.asp">Font Awesome 5</a></td>
<td>201707</td>
<td>Web-Image</td>
<td><a target="_blank" href="https://www.w3schools.com/icons/icons_reference.asp">https://www.w3schools.com/icons/icons_reference.asp</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://chatgpt.com/">ChatGPT</a></td>
<td>202303</td>
<td>Web-LLM</td>
<td><a target="_blank" href="https://chatgpt.com/">https://chatgpt.com</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://jimeng.jianying.com/ai-tool/home">Jimeng</a></td>
<td>202502</td>
<td>Web-AIGC</td>
<td><a target="_blank" href="https://jimeng.jianying.com/ai-tool/home">https://jimeng.jianying.com/ai-tool/home</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://www.midjourney.com/explore">Midjourney</a></td>
<td>202502</td>
<td>Web-AIGC</td>
<td><a target="_blank" href="https://www.midjourney.com/explore">https://www.midjourney.com/explore</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://ai-bot.cn/ai-tools/">AI-Bot</a></td>
<td>202502</td>
<td>Message-AIGC</td>
<td><a target="_blank" href="https://ai-bot.cn/ai-tools/">https://ai-bot.cn/ai-tools</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://huggingface.co/spaces/Sanster/Lama-Cleaner-lama">Lama-Cleaner</a></td>
<td>202502</td>
<td>Web-Image</td>
<td><a target="_blank" href="https://huggingface.co/spaces/Sanster/Lama-Cleaner-lama">https://huggingface.co/spaces/Sanster/Lama-Cleaner-lama</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://chat18.aichatos18.com/">AIchatOS2</a></td>
<td>202502</td>
<td>Web-LLM</td>
<td><a target="_blank" href="https://chat18.aichatos18.com/">https://chat18.aichatos18.com</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://wormhole.app/">Wormhole</a></td>
<td>202502</td>
<td>Files-Share</td>
<td><a target="_blank" href="https://wormhole.app">https://wormhole.app</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
<tr>
<td><a target="_blank" href="https://www.seeprettyface.com/mydataset.html">StyleGAN</a></td>
<td>202012</td>
<td>Dataset-Image-Face</td>
<td><a target="_blank" href="https://www.seeprettyface.com">https://www.seeprettyface.com</a></td>
<td><button class="delete-btn" onclick="deleteRow(this)">Delete</button></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>