mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-11 09:54:36 +00:00
Format numerical values in DataFetcher component for better readability
This commit is contained in:
parent
db6369f3c6
commit
72c987d1f0
1 changed files with 10 additions and 4 deletions
|
@ -38,6 +38,7 @@ const DataFetcher: React.FC = () => {
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
const [itemsPerPage, setItemsPerPage] = useState(25);
|
const [itemsPerPage, setItemsPerPage] = useState(25);
|
||||||
const [sortConfig, setSortConfig] = useState<{ key: string; direction: "ascending" | "descending" } | null>(null);
|
const [sortConfig, setSortConfig] = useState<{ key: string; direction: "ascending" | "descending" } | null>(null);
|
||||||
|
const nf = new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchSummary = async () => {
|
const fetchSummary = async () => {
|
||||||
|
@ -129,19 +130,24 @@ const DataFetcher: React.FC = () => {
|
||||||
<p className="text-lg font-bold mt-4"> </p>
|
<p className="text-lg font-bold mt-4"> </p>
|
||||||
<div className="mb-4 flex justify-between items-center">
|
<div className="mb-4 flex justify-between items-center">
|
||||||
<p className="text-lg font-bold">
|
<p className="text-lg font-bold">
|
||||||
{summary?.total_entries}
|
{nf.format(
|
||||||
|
summary?.total_entries ?? 0,
|
||||||
|
)}
|
||||||
{" "}
|
{" "}
|
||||||
results found
|
results found
|
||||||
</p>
|
</p>
|
||||||
<p className="text-lg font">
|
<p className="text-lg font">
|
||||||
Status Legend: 🔄 installing
|
Status Legend: 🔄 installing
|
||||||
{summary?.status_count.installing ?? 0}
|
{" "}
|
||||||
|
{nf.format(summary?.status_count.installing ?? 0)}
|
||||||
{" "}
|
{" "}
|
||||||
| ✔️ completed
|
| ✔️ completed
|
||||||
{summary?.status_count.done ?? 0}
|
{" "}
|
||||||
|
{nf.format(summary?.status_count.done ?? 0)}
|
||||||
{" "}
|
{" "}
|
||||||
| ❌ failed
|
| ❌ failed
|
||||||
{summary?.status_count.failed ?? 0}
|
{" "}
|
||||||
|
{nf.format(summary?.status_count.failed ?? 0)}
|
||||||
{" "}
|
{" "}
|
||||||
| ❓ unknown
|
| ❓ unknown
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue