1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-02-01 16:31:50 +00:00

update page.tsx

This commit is contained in:
Michel Roegl-Brunner 2025-01-29 18:37:23 +01:00
parent 86d841c4c2
commit 9f84566baf

View File

@ -25,14 +25,9 @@ interface DataModel {
pve_version: string; pve_version: string;
} }
interface Aotd {
nsapp: string;
count: number;
}
const DataFetcher: React.FC = () => { const DataFetcher: React.FC = () => {
const [data, setData] = useState<DataModel[]>([]); const [data, setData] = useState<DataModel[]>([]);
const [aotd, setAotd] = useState<Aotd[]>([]);
const [loading, setLoading] = useState<boolean>(true); const [loading, setLoading] = useState<boolean>(true);
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);
const [searchQuery, setSearchQuery] = useState(''); const [searchQuery, setSearchQuery] = useState('');
@ -54,16 +49,6 @@ const DataFetcher: React.FC = () => {
} finally { } finally {
setLoading(false); setLoading(false);
} }
try {
const response = await fetch("http://api.htl-braunau.at/data/json/appoftheday");
if (!response.ok) throw new Error("Failed to fetch data: ${response.statusText}");
const result: Aotd[] = await response.json();
setAotd(result);
} catch (err) {
setError((err as Error).message);
} finally {
setLoading(false);
}
}; };
fetchData(); fetchData();
@ -137,10 +122,6 @@ const DataFetcher: React.FC = () => {
return ( return (
<div className="p-6 mt-20"> <div className="p-6 mt-20">
<h1 className="text-2xl font-bold mb-4 text-center">Created LXCs</h1> <h1 className="text-2xl font-bold mb-4 text-center">Created LXCs</h1>
<div className="mb-4">
<h3 className="text-xl font-bold">Application of the Day</h3>
{aotd.nsapp} ({aotd.count} times)
</div>
<div className="mb-4 flex space-x-4"> <div className="mb-4 flex space-x-4">
<div> <div>
<input <input