This commit is contained in:
Adle Ben Salem 2025-04-17 16:18:33 +02:00 committed by GitHub
commit 2fcef7ba3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 2 deletions

View File

@ -9,10 +9,21 @@
</head> </head>
<body class="h-screen overflow-hidden font-mono text-white" x-data="{ <body class="h-screen overflow-hidden font-mono text-white" x-data="{
inputValue: '', inputValue: '',
errorMessage: '',
navigateToDataset() { navigateToDataset() {
const trimmedValue = this.inputValue.trim(); const trimmedValue = this.inputValue.trim();
if (trimmedValue) { if (trimmedValue) {
fetch(`/${trimmedValue}`, { method: 'HEAD' })
.then(response => {
if (response.ok) {
window.location.href = `/${trimmedValue}`; window.location.href = `/${trimmedValue}`;
} else {
this.errorMessage = `Error when trying to visualize the dataset. Please make sure you uploaded the dataset ${trimmedValue}`;
}
})
.catch(error => {
this.errorMessage = `Error when trying to visualize the dataset. Please make sure you uploaded the dataset ${trimmedValue}`;
});
} }
} }
}"> }">
@ -54,7 +65,8 @@
Go Go
</button> </button>
</div> </div>
<!-- Display error message if dataset not found -->
<div x-show="errorMessage" class="text-red-500 mt-2" x-text="errorMessage"></div>
<details class="mt-4 max-w-full px-4"> <details class="mt-4 max-w-full px-4">
<summary>More example datasets</summary> <summary>More example datasets</summary>
<ul class="list-disc list-inside max-h-28 overflow-y-auto break-all"> <ul class="list-disc list-inside max-h-28 overflow-y-auto break-all">