From e5b36556cd020b545a7043472ed32973e91c7a0f Mon Sep 17 00:00:00 2001 From: Daniel Barton Date: Thu, 25 Jul 2024 10:19:24 +0800 Subject: [PATCH 1/2] ci(Tests): Add PHP 8.3 to test matrix --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1c8130552d..5813cab4a0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - php: [8.1, 8.2] + php: [8.1, 8.2, 8.3] database: ["mariadb:10.2", "mysql:8"] services: database: From 08139ba1b5ad5f1c107f7852f9baa1e1d5d5738b Mon Sep 17 00:00:00 2001 From: MrLiam2614 Date: Sat, 17 Aug 2024 11:58:16 +0200 Subject: [PATCH 2/2] The servers will now be sorted based on their description. If it starts with "[$number]" then the number will be used. If the description has no number or multiple server have the same one then the server will be ordered Alphabetical (A to Z) --- .../dashboard/DashboardContainer.tsx | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/resources/scripts/components/dashboard/DashboardContainer.tsx b/resources/scripts/components/dashboard/DashboardContainer.tsx index 25e0e4d28c..1267497fa9 100644 --- a/resources/scripts/components/dashboard/DashboardContainer.tsx +++ b/resources/scripts/components/dashboard/DashboardContainer.tsx @@ -29,8 +29,30 @@ export default () => { () => getServers({ page, type: showOnlyAdmin && rootAdmin ? 'admin' : undefined }) ); + const [sortedServers, setSortedServers] = useState([]); + useEffect(() => { if (!servers) return; + + const sorted = servers.items.slice().sort((a, b) => { + const aDescription = a.description || ''; + const bDescription = b.description || ''; + + const aMatch = aDescription.match(/^\[(\d+)\]/); + const bMatch = bDescription.match(/^\[(\d+)\]/); + + const aNumber = aMatch ? parseInt(aMatch[1], 10) : Number.MAX_SAFE_INTEGER; + const bNumber = bMatch ? parseInt(bMatch[1], 10) : Number.MAX_SAFE_INTEGER; + + if (aNumber === bNumber) { + // Se i numeri sono uguali, ordina per nome + return a.name.localeCompare(b.name); + } + + return aNumber - bNumber; + }); + setSortedServers(sorted); + if (servers.pagination.currentPage > 1 && !servers.items.length) { setPage(1); } @@ -65,7 +87,7 @@ export default () => { {!servers ? ( ) : ( - + {({ items }) => items.length > 0 ? ( items.map((server, index) => (