mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-02-01 14:51:50 +00:00
update page.tsx
This commit is contained in:
parent
86d841c4c2
commit
9f84566baf
@ -25,14 +25,9 @@ interface DataModel {
|
||||
pve_version: string;
|
||||
}
|
||||
|
||||
interface Aotd {
|
||||
nsapp: string;
|
||||
count: number;
|
||||
}
|
||||
|
||||
const DataFetcher: React.FC = () => {
|
||||
const [data, setData] = useState<DataModel[]>([]);
|
||||
const [aotd, setAotd] = useState<Aotd[]>([]);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
@ -54,16 +49,6 @@ const DataFetcher: React.FC = () => {
|
||||
} finally {
|
||||
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();
|
||||
@ -137,10 +122,6 @@ const DataFetcher: React.FC = () => {
|
||||
return (
|
||||
<div className="p-6 mt-20">
|
||||
<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>
|
||||
<input
|
||||
|
Loading…
x
Reference in New Issue
Block a user