From 89c8f9080b2b792ea5a9bb23493c3fb57bd2914b Mon Sep 17 00:00:00 2001 From: DJO <790521+Alenar@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:30:31 +0100 Subject: [PATCH 1/7] chore(explorer): upgrade dependencies + fix vulnerability - upgrade NextJs to `15.0.3` - fix `cross-spawn` vulnerability by upgrading from version `7.0.3` to `7.0.5` --- mithril-explorer/package-lock.json | 420 ++++++----------------------- mithril-explorer/package.json | 4 +- 2 files changed, 90 insertions(+), 334 deletions(-) diff --git a/mithril-explorer/package-lock.json b/mithril-explorer/package-lock.json index ee2bfbb3f8d..4197a984468 100644 --- a/mithril-explorer/package-lock.json +++ b/mithril-explorer/package-lock.json @@ -14,7 +14,7 @@ "bootstrap": "^5.3.3", "bootstrap-icons": "^1.11.3", "chart.js": "^4.4.6", - "next": "^15.0.2", + "next": "^15.0.3", "react": "^18.3.1", "react-bootstrap": "^2.10.5", "react-chartjs-2": "^5.2.0", @@ -25,7 +25,7 @@ "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.0.1", "eslint": "^8.57.1", - "eslint-config-next": "^15.0.2", + "eslint-config-next": "^15.0.3", "fantasticon": "^3.0.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", @@ -669,15 +669,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@emnapi/runtime": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz", - "integrity": "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "dev": true, @@ -765,123 +756,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/@img/sharp-darwin-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", - "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.0.4" - } - }, - "node_modules/@img/sharp-darwin-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", - "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.0.4" - } - }, - "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", - "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", - "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", - "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", - "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", - "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", - "cpu": [ - "s390x" - ], - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, "node_modules/@img/sharp-libvips-linux-x64": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", @@ -897,21 +771,6 @@ "url": "https://opencollective.com/libvips" } }, - "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", - "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "funding": { - "url": "https://opencollective.com/libvips" - } - }, "node_modules/@img/sharp-libvips-linuxmusl-x64": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", @@ -927,69 +786,6 @@ "url": "https://opencollective.com/libvips" } }, - "node_modules/@img/sharp-linux-arm": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", - "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.0.5" - } - }, - "node_modules/@img/sharp-linux-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", - "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.0.4" - } - }, - "node_modules/@img/sharp-linux-s390x": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", - "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", - "cpu": [ - "s390x" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.0.4" - } - }, "node_modules/@img/sharp-linux-x64": { "version": "0.33.5", "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", @@ -1011,27 +807,6 @@ "@img/sharp-libvips-linux-x64": "1.0.4" } }, - "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", - "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" - } - }, "node_modules/@img/sharp-linuxmusl-x64": { "version": "0.33.5", "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", @@ -1053,60 +828,6 @@ "@img/sharp-libvips-linuxmusl-x64": "1.0.4" } }, - "node_modules/@img/sharp-wasm32": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", - "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", - "cpu": [ - "wasm32" - ], - "optional": true, - "dependencies": { - "@emnapi/runtime": "^1.2.0" - }, - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-win32-ia32": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", - "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, - "node_modules/@img/sharp-win32-x64": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", - "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - } - }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "dev": true, @@ -1686,15 +1407,17 @@ "link": true }, "node_modules/@next/env": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@next/env/-/env-15.0.2.tgz", - "integrity": "sha512-c0Zr0ModK5OX7D4ZV8Jt/wqoXtitLNPwUfG9zElCZztdaZyNVnN40rDXVZ/+FGuR4CcNV5AEfM6N8f+Ener7Dg==" + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.0.3.tgz", + "integrity": "sha512-t9Xy32pjNOvVn2AS+Utt6VmyrshbpfUMhIjFO60gI58deSo/KgLOp31XZ4O+kY/Is8WAGYwA5gR7kOb1eORDBA==", + "license": "MIT" }, "node_modules/@next/eslint-plugin-next": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-15.0.2.tgz", - "integrity": "sha512-R9Jc7T6Ge0txjmqpPwqD8vx6onQjynO9JT73ArCYiYPvSrwYXepH/UY/WdKDY8JPWJl72sAE4iGMHPeQ5xdEWg==", + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-15.0.3.tgz", + "integrity": "sha512-3Ln/nHq2V+v8uIaxCR6YfYo7ceRgZNXfTd3yW1ukTaFbO+/I8jNakrjYWODvG9BuR2v5kgVtH/C8r0i11quOgw==", "dev": true, + "license": "MIT", "dependencies": { "fast-glob": "3.3.1" } @@ -1704,6 +1427,7 @@ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -1720,6 +1444,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -1728,12 +1453,13 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.0.2.tgz", - "integrity": "sha512-GK+8w88z+AFlmt+ondytZo2xpwlfAR8U6CRwXancHImh6EdGfHMIrTSCcx5sOSBei00GyLVL0ioo1JLKTfprgg==", + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.0.3.tgz", + "integrity": "sha512-s3Q/NOorCsLYdCKvQlWU+a+GeAd3C8Rb3L1YnetsgwXzhc3UTWrtQpB/3eCjFOdGUj5QmXfRak12uocd1ZiiQw==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1743,12 +1469,13 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.0.2.tgz", - "integrity": "sha512-KUpBVxIbjzFiUZhiLIpJiBoelqzQtVZbdNNsehhUn36e2YzKHphnK8eTUW1s/4aPy5kH/UTid8IuVbaOpedhpw==", + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.0.3.tgz", + "integrity": "sha512-Zxl/TwyXVZPCFSf0u2BNj5sE0F2uR6iSKxWpq4Wlk/Sv9Ob6YCKByQTkV2y6BCic+fkabp9190hyrDdPA/dNrw==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1758,12 +1485,13 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.0.2.tgz", - "integrity": "sha512-9J7TPEcHNAZvwxXRzOtiUvwtTD+fmuY0l7RErf8Yyc7kMpE47MIQakl+3jecmkhOoIyi/Rp+ddq7j4wG6JDskQ==", + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.0.3.tgz", + "integrity": "sha512-T5+gg2EwpsY3OoaLxUIofmMb7ohAUlcNZW0fPQ6YAutaWJaxt1Z1h+8zdl4FRIOr5ABAAhXtBcpkZNwUcKI2fw==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -1773,12 +1501,13 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.0.2.tgz", - "integrity": "sha512-BjH4ZSzJIoTTZRh6rG+a/Ry4SW0HlizcPorqNBixBWc3wtQtj4Sn9FnRZe22QqrPnzoaW0ctvSz4FaH4eGKMww==", + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.0.3.tgz", + "integrity": "sha512-WkAk6R60mwDjH4lG/JBpb2xHl2/0Vj0ZRu1TIzWuOYfQ9tt9NFsIinI1Epma77JVgy81F32X/AeD+B2cBu/YQA==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -1788,12 +1517,13 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.0.2.tgz", - "integrity": "sha512-i3U2TcHgo26sIhcwX/Rshz6avM6nizrZPvrDVDY1bXcLH1ndjbO8zuC7RoHp0NSK7wjJMPYzm7NYL1ksSKFreA==", + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.0.3.tgz", + "integrity": "sha512-gWL/Cta1aPVqIGgDb6nxkqy06DkwJ9gAnKORdHWX1QBbSZZB+biFYPFti8aKIQL7otCE1pjyPaXpFzGeG2OS2w==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -1803,12 +1533,13 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.0.2.tgz", - "integrity": "sha512-AMfZfSVOIR8fa+TXlAooByEF4OB00wqnms1sJ1v+iu8ivwvtPvnkwdzzFMpsK5jA2S9oNeeQ04egIWVb4QWmtQ==", + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.0.3.tgz", + "integrity": "sha512-QQEMwFd8r7C0GxQS62Zcdy6GKx999I/rTO2ubdXEe+MlZk9ZiinsrjwoiBL5/57tfyjikgh6GOU2WRQVUej3UA==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -1818,12 +1549,13 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.0.2.tgz", - "integrity": "sha512-JkXysDT0/hEY47O+Hvs8PbZAeiCQVxKfGtr4GUpNAhlG2E0Mkjibuo8ryGD29Qb5a3IOnKYNoZlh/MyKd2Nbww==", + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.0.3.tgz", + "integrity": "sha512-9TEp47AAd/ms9fPNgtgnT7F3M1Hf7koIYYWCMQ9neOwjbVWJsHZxrFbI3iEDJ8rf1TDGpmHbKxXf2IFpAvheIQ==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -1833,12 +1565,13 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.0.2.tgz", - "integrity": "sha512-foaUL0NqJY/dX0Pi/UcZm5zsmSk5MtP/gxx3xOPyREkMFN+CTjctPfu3QaqrQHinaKdPnMWPJDKt4VjDfTBe/Q==", + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.0.3.tgz", + "integrity": "sha512-VNAz+HN4OGgvZs6MOoVfnn41kBzT+M+tB+OK4cww6DNyWS6wKaDpaAm/qLeOUbnMh0oVx1+mg0uoYARF69dJyA==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -1916,6 +1649,7 @@ "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -1938,6 +1672,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.3.0.tgz", "integrity": "sha512-WC7Yd6cNGfHx8zf+iu+Q1UPTfEcXhQ+ATi7CV1hlrSAaQBdlPzg7Ww/wJHNQem7qG9rxmWoFCDCPubSvFObGzA==", + "license": "MIT", "dependencies": { "immer": "^10.0.3", "redux": "^5.0.1", @@ -2084,6 +1819,7 @@ "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.6.3.tgz", "integrity": "sha512-IteBhl4XqYNkM54f4ejhLRJiZNqcSCoXUOG2CPK7qbD322KjQozM4kHQOfkG2oln9b9HTYqs+Sae8vBATubxxA==", "dev": true, + "license": "MIT", "dependencies": { "@adobe/css-tools": "^4.4.0", "aria-query": "^5.0.0", @@ -2104,6 +1840,7 @@ "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.0.1.tgz", "integrity": "sha512-dSmwJVtJXmku+iocRhWOUFbrERC76TX2Mnf0ATODz8brzAZrMBbzLwQixlBSanZxR6LddK3eiwpSFZgDET1URg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5" }, @@ -3189,6 +2926,7 @@ "url": "https://opencollective.com/bootstrap" } ], + "license": "MIT", "peerDependencies": { "@popperjs/core": "^2.11.8" } @@ -3206,7 +2944,8 @@ "type": "opencollective", "url": "https://opencollective.com/bootstrap" } - ] + ], + "license": "MIT" }, "node_modules/brace-expansion": { "version": "1.1.11", @@ -3465,6 +3204,7 @@ "version": "4.4.6", "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.6.tgz", "integrity": "sha512-8Y406zevUPbbIBA/HRk33khEmQPk5+cxeflWE/2rx1NJsjVWMPw/9mSP9rxHP5eqi6LNoPBVMfZHxbwLSgldYA==", + "license": "MIT", "dependencies": { "@kurkle/color": "^0.3.0" }, @@ -3717,7 +3457,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz", + "integrity": "sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==", "dev": true, "license": "MIT", "dependencies": { @@ -4346,6 +4088,7 @@ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -4397,12 +4140,13 @@ } }, "node_modules/eslint-config-next": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-15.0.2.tgz", - "integrity": "sha512-N8o6cyUXzlMmQbdc2Kc83g1qomFi3ITqrAZfubipVKET2uR2mCStyGRcx/r8WiAIVMul2KfwRiCHBkTpBvGBmA==", + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-15.0.3.tgz", + "integrity": "sha512-IGP2DdQQrgjcr4mwFPve4DrCqo7CVVez1WoYY47XwKSrYO4hC0Dlb+iJA60i0YfICOzgNADIb8r28BpQ5Zs0wg==", "dev": true, + "license": "MIT", "dependencies": { - "@next/eslint-plugin-next": "15.0.2", + "@next/eslint-plugin-next": "15.0.3", "@rushstack/eslint-patch": "^1.10.3", "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", @@ -5021,6 +4765,7 @@ "resolved": "https://registry.npmjs.org/fantasticon/-/fantasticon-3.0.0.tgz", "integrity": "sha512-PylulixZA8I0SeiUKtuyOhwrz/ojZTSA1KXddipvEyQXCVrpPMTnSXzaE9nXXK7nCjJWFkqoBAQ1aBdaxMltrg==", "dev": true, + "license": "MIT", "dependencies": { "case": "^1.6.3", "cli-color": "^2.0.4", @@ -6312,6 +6057,7 @@ "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, + "license": "MIT", "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -6707,6 +6453,7 @@ "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz", "integrity": "sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA==", "dev": true, + "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", @@ -8092,11 +7839,12 @@ "license": "MIT" }, "node_modules/next": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/next/-/next-15.0.2.tgz", - "integrity": "sha512-rxIWHcAu4gGSDmwsELXacqAPUk+j8dV/A9cDF5fsiCMpkBDYkO2AEaL1dfD+nNmDiU6QMCFN8Q30VEKapT9UHQ==", + "version": "15.0.3", + "resolved": "https://registry.npmjs.org/next/-/next-15.0.3.tgz", + "integrity": "sha512-ontCbCRKJUIoivAdGB34yCaOcPgYXr9AAkV/IwqFfWWTXEPUgLYkSkqBhIk9KK7gGmgjc64B+RdoeIDM13Irnw==", + "license": "MIT", "dependencies": { - "@next/env": "15.0.2", + "@next/env": "15.0.3", "@swc/counter": "0.1.3", "@swc/helpers": "0.5.13", "busboy": "1.6.0", @@ -8108,25 +7856,25 @@ "next": "dist/bin/next" }, "engines": { - "node": ">=18.18.0" + "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "15.0.2", - "@next/swc-darwin-x64": "15.0.2", - "@next/swc-linux-arm64-gnu": "15.0.2", - "@next/swc-linux-arm64-musl": "15.0.2", - "@next/swc-linux-x64-gnu": "15.0.2", - "@next/swc-linux-x64-musl": "15.0.2", - "@next/swc-win32-arm64-msvc": "15.0.2", - "@next/swc-win32-x64-msvc": "15.0.2", + "@next/swc-darwin-arm64": "15.0.3", + "@next/swc-darwin-x64": "15.0.3", + "@next/swc-linux-arm64-gnu": "15.0.3", + "@next/swc-linux-arm64-musl": "15.0.3", + "@next/swc-linux-x64-gnu": "15.0.3", + "@next/swc-linux-x64-musl": "15.0.3", + "@next/swc-win32-arm64-msvc": "15.0.3", + "@next/swc-win32-x64-msvc": "15.0.3", "sharp": "^0.33.5" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.41.2", "babel-plugin-react-compiler": "*", - "react": "^18.2.0 || 19.0.0-rc-02c0e824-20241028", - "react-dom": "^18.2.0 || 19.0.0-rc-02c0e824-20241028", + "react": "^18.2.0 || 19.0.0-rc-66855b96-20241106", + "react-dom": "^18.2.0 || 19.0.0-rc-66855b96-20241106", "sass": "^1.3.0" }, "peerDependenciesMeta": { @@ -8149,6 +7897,7 @@ "resolved": "https://registry.npmjs.org/next-router-mock/-/next-router-mock-0.9.13.tgz", "integrity": "sha512-906n2RRaE6Y28PfYJbaz5XZeJ6Tw8Xz1S6E31GGwZ0sXB6/XjldD1/2azn1ZmBmRk5PQRkzjg+n+RHZe5xQzWA==", "dev": true, + "license": "MIT", "peerDependencies": { "next": ">=10.0.0", "react": ">=17.0.0" @@ -8690,6 +8439,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -8705,6 +8455,7 @@ "resolved": "https://registry.npmjs.org/prettier-eslint/-/prettier-eslint-16.3.0.tgz", "integrity": "sha512-Lh102TIFCr11PJKUMQ2kwNmxGhTsv/KzUg9QYF2Gkw259g/kPgndZDWavk7/ycbRvj2oz4BPZ1gCU8bhfZH/Xg==", "dev": true, + "license": "MIT", "dependencies": { "@typescript-eslint/parser": "^6.7.5", "common-tags": "^1.4.0", @@ -8903,6 +8654,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" }, @@ -8914,6 +8666,7 @@ "version": "2.10.5", "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.10.5.tgz", "integrity": "sha512-XueAOEn64RRkZ0s6yzUTdpFtdUXs5L5491QU//8ZcODKJNDLt/r01tNyriZccjgRImH1REynUc9pqjiRMpDLWQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.24.7", "@restart/hooks": "^0.4.9", @@ -8943,6 +8696,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-5.2.0.tgz", "integrity": "sha512-98iN5aguJyVSxp5U3CblRLH67J8gkfyGNbiK3c+l1QI/G4irHMPQw44aEPmjVag+YKTyQ260NcF82GTQ3bdscA==", + "license": "MIT", "peerDependencies": { "chart.js": "^4.1.1", "react": "^16.8.0 || ^17.0.0 || ^18.0.0" @@ -8952,6 +8706,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -8974,6 +8729,7 @@ "version": "9.1.2", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.1.2.tgz", "integrity": "sha512-0OA4dhM1W48l3uzmv6B7TXPCGmokUU4p1M44DGN2/D9a1FjVPukVjER1PcPX97jIg6aUeLq1XJo1IpfbgULn0w==", + "license": "MIT", "dependencies": { "@types/use-sync-external-store": "^0.0.3", "use-sync-external-store": "^1.0.0" diff --git a/mithril-explorer/package.json b/mithril-explorer/package.json index 4ec0d2e9ded..b1158046cf1 100644 --- a/mithril-explorer/package.json +++ b/mithril-explorer/package.json @@ -19,7 +19,7 @@ "bootstrap": "^5.3.3", "bootstrap-icons": "^1.11.3", "chart.js": "^4.4.6", - "next": "^15.0.2", + "next": "^15.0.3", "react": "^18.3.1", "react-bootstrap": "^2.10.5", "react-chartjs-2": "^5.2.0", @@ -30,7 +30,7 @@ "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.0.1", "eslint": "^8.57.1", - "eslint-config-next": "^15.0.2", + "eslint-config-next": "^15.0.3", "fantasticon": "^3.0.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", From b9c014b3422e7e58c1c66a1a308160a6110533de Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:43:17 +0100 Subject: [PATCH 2/7] feat(explorer): implement `AggregatorStatus` component and fetch data from `/status` route --- mithril-explorer/src/app/page.js | 8 +- .../src/components/AggregatorStatus/index.js | 173 ++++++++++++++++++ 2 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 mithril-explorer/src/components/AggregatorStatus/index.js diff --git a/mithril-explorer/src/app/page.js b/mithril-explorer/src/app/page.js index 22d7db39b5d..3dba55bcde0 100644 --- a/mithril-explorer/src/app/page.js +++ b/mithril-explorer/src/app/page.js @@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { useSearchParams } from "next/navigation"; import dynamic from "next/dynamic"; -import { Col, Form, Row, Stack, Tab, Tabs } from "react-bootstrap"; +import { Form, Row, Stack, Tab, Tabs } from "react-bootstrap"; import { ArcElement, BarElement, @@ -30,6 +30,7 @@ import { selectedAggregatorSignedEntities as currentAggregatorSignedEntities, } from "@/store/settingsSlice"; import { updatePoolsForAggregator } from "@/store/poolsSlice"; +import AggregatorStatus from "@/components/AggregatorStatus"; // Disable SSR for the following components since they use data from the store that are not // available server sides (because those data can be read from the local storage). @@ -115,8 +116,11 @@ export default function Explorer() { - + {/* + */} + + setCurrentTab(key)}> diff --git a/mithril-explorer/src/components/AggregatorStatus/index.js b/mithril-explorer/src/components/AggregatorStatus/index.js new file mode 100644 index 00000000000..b1387157909 --- /dev/null +++ b/mithril-explorer/src/components/AggregatorStatus/index.js @@ -0,0 +1,173 @@ +import React, { useEffect, useState } from "react"; +import { Card, Row, Col, Container, Table } from "react-bootstrap"; +import { useSelector } from "react-redux"; +import RawJsonButton from "#/RawJsonButton"; +import ProtocolParameters from "#/ProtocolParameters"; +import Stake from "#/Stake"; +import { selectedAggregator } from "@/store/settingsSlice"; +import { checkUrl } from "@/utils"; + +export default function AggregatorStatus() { + const [aggregatorStatus, setAggregatorStatus] = useState({}); + const currentAggregator = useSelector((state) => state.settings.selectedAggregator); + const aggregatorStatusEndpoint = useSelector((state) => `${selectedAggregator(state)}/status`); + const autoUpdate = useSelector((state) => state.settings.autoUpdate); + const updateInterval = useSelector((state) => state.settings.updateInterval); + + useEffect(() => { + let fetchAggregatorStatus = () => { + fetch(aggregatorStatusEndpoint) + .then((response) => (response.status === 200 ? response.json() : {})) + .then((data) => setAggregatorStatus(data)) + .catch((error) => { + setAggregatorStatus({}); + console.error("Fetch status error:", error); + }); + }; + + // Fetch it once without waiting + fetchAggregatorStatus(); + + if (autoUpdate) { + const interval = setInterval(() => { + fetchAggregatorStatus(); + }, updateInterval); + return () => clearInterval(interval); + } + }, [aggregatorStatusEndpoint, updateInterval, autoUpdate]); + + useEffect(() => { + if (checkUrl(currentAggregator) && Number.isInteger(aggregatorStatus?.epoch)) { + const params = new URLSearchParams(); + params.set("aggregator", currentAggregator); + params.set("epoch", aggregatorStatus.epoch); + } + }, [currentAggregator, aggregatorStatus]); + + return ( + +
+

+ Aggregator Status + +

+ + + + + + +
Epoch {aggregatorStatus.epoch}
+ + + + + + + + + + + +
+ Cardano Era: + {aggregatorStatus.cardano_era}
+ Mithril Era: + {aggregatorStatus.mithril_era}
+
+
+ + + + +
Protocol Parameters
+ Current: + + Next: + +
+
+ + + + +
Nodes Versions
+
+ Cardano node: {aggregatorStatus.cardano_node_version} +
+
+ Aggregator node: {aggregatorStatus.aggregator_node_version} +
+
+
+ + + + +
Participants
+ + + + + + + + + + + + + + + +
+ Total SPOs: + {aggregatorStatus.total_cardano_spo ?? 0}
+ Total Signers: + {aggregatorStatus.total_signers ?? 0}
+ Total Next Signers: + {aggregatorStatus.total_next_signers ?? 0}
+
+
+ + + + +
Stakes
+ + + + + + + + + + + + + + + +
+ Total SPOs: + + +
+ Total Signers: + + +
+ Total Next Signers: + + +
+
+
+ +
+
+
+
+ ); +} From bbf71d9c5997cd39ea719558b8584a33bd4bbef4 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:06:30 +0100 Subject: [PATCH 3/7] feat(explorer): improve breakpoints handling and UI enhancements Co-authored-by: DJO --- .../src/components/AggregatorStatus/index.js | 239 +++++++++--------- .../src/components/ProtocolParameters.js | 10 +- 2 files changed, 126 insertions(+), 123 deletions(-) diff --git a/mithril-explorer/src/components/AggregatorStatus/index.js b/mithril-explorer/src/components/AggregatorStatus/index.js index b1387157909..2abd92d73ca 100644 --- a/mithril-explorer/src/components/AggregatorStatus/index.js +++ b/mithril-explorer/src/components/AggregatorStatus/index.js @@ -1,14 +1,52 @@ import React, { useEffect, useState } from "react"; -import { Card, Row, Col, Container, Table } from "react-bootstrap"; +import { Card, Row, Col, Container, OverlayTrigger, Tooltip } from "react-bootstrap"; import { useSelector } from "react-redux"; import RawJsonButton from "#/RawJsonButton"; import ProtocolParameters from "#/ProtocolParameters"; import Stake from "#/Stake"; import { selectedAggregator } from "@/store/settingsSlice"; -import { checkUrl } from "@/utils"; +import { checkUrl, formatStake } from "@/utils"; + +function InfoGroupCard({ children, title, ...props }) { + return ( + + + +
{title}
+
{children}
+
+
+ + ); +} + +function InfoRow({ label, children, ...props }) { + return ( + <> +
+
+ {label}: +
+
{children}
+
+
+ + ); +} + +function PercentTooltip({ value, total, ...props }) { + return ( + {`${value} out of ${total}`}}> + + + + + ); +} export default function AggregatorStatus() { const [aggregatorStatus, setAggregatorStatus] = useState({}); + const [aggregatorVersion, setAggregatorVersion] = useState({}); const currentAggregator = useSelector((state) => state.settings.selectedAggregator); const aggregatorStatusEndpoint = useSelector((state) => `${selectedAggregator(state)}/status`); const autoUpdate = useSelector((state) => state.settings.autoUpdate); @@ -37,134 +75,97 @@ export default function AggregatorStatus() { }, [aggregatorStatusEndpoint, updateInterval, autoUpdate]); useEffect(() => { - if (checkUrl(currentAggregator) && Number.isInteger(aggregatorStatus?.epoch)) { - const params = new URLSearchParams(); - params.set("aggregator", currentAggregator); - params.set("epoch", aggregatorStatus.epoch); + if (!checkUrl(currentAggregator)) { + return; } + + const split_version = aggregatorStatus?.aggregator_node_version?.split("+") ?? []; + setAggregatorVersion({ + number: split_version[0] ?? "0.0.0", + sha: split_version[1] ?? undefined, + }); }, [currentAggregator, aggregatorStatus]); + // Calculate percentage without decimal + function percent(value, total) { + return ((value / total) * 100).toFixed(0); + } + + function capitalizeFirstLetter(string) { + return string.charAt(0).toUpperCase() + string.slice(1); + } + return (

- Aggregator Status + Status

- - - - -
Epoch {aggregatorStatus.epoch}
- - - - - - - - - - - -
- Cardano Era: - {aggregatorStatus.cardano_era}
- Mithril Era: - {aggregatorStatus.mithril_era}
-
-
- - - - -
Protocol Parameters
- Current: - - Next: - -
-
- - - - -
Nodes Versions
-
- Cardano node: {aggregatorStatus.cardano_node_version} -
-
- Aggregator node: {aggregatorStatus.aggregator_node_version} -
-
-
- - - - -
Participants
- - - - - - - - - - - - - - - -
- Total SPOs: - {aggregatorStatus.total_cardano_spo ?? 0}
- Total Signers: - {aggregatorStatus.total_signers ?? 0}
- Total Next Signers: - {aggregatorStatus.total_next_signers ?? 0}
-
-
- - - - -
Stakes
- - - - - - - - - - - - - - - -
- Total SPOs: - - -
- Total Signers: - - -
- Total Next Signers: - - -
-
-
- + + + {aggregatorStatus.cardano_era} + + {aggregatorStatus.mithril_era + ? capitalizeFirstLetter(aggregatorStatus.mithril_era) + : ""} + + + + + {aggregatorStatus.total_signers ?? 0} + {aggregatorStatus.total_next_signers ?? 0} + + {percent(aggregatorStatus.total_signers, aggregatorStatus.total_cardano_spo)}%{" "} + + + + + + + + + + + + + {percent( + aggregatorStatus.total_stakes_signers, + aggregatorStatus.total_cardano_stake, + )} + %{" "} + {/* */} + + + + + + Current: + + Next: + + + + + + {aggregatorVersion.number} + {aggregatorVersion.sha && ({aggregatorVersion.sha})} + + {aggregatorStatus.cardano_node_version} +
diff --git a/mithril-explorer/src/components/ProtocolParameters.js b/mithril-explorer/src/components/ProtocolParameters.js index 3e910e37059..4e50e961131 100644 --- a/mithril-explorer/src/components/ProtocolParameters.js +++ b/mithril-explorer/src/components/ProtocolParameters.js @@ -1,16 +1,18 @@ import React from "react"; import { ListGroup } from "react-bootstrap"; -export default function ProtocolParameters({ protocolParameters, ...props }) { +export default function ProtocolParameters({ protocolParameters, padding, ...props }) { + const padding_class = `p-${padding ?? "auto"}`; + return ( - + k: {protocolParameters?.k} - + m: {protocolParameters?.m} - + f: {protocolParameters?.phi_f} From 0366554f6eabcceaf727c261488151ee3ecf2535 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:54:32 +0100 Subject: [PATCH 4/7] feat(explorer): add Registered Signers and In/Out Registrations buttons --- .../src/components/AggregatorStatus/index.js | 166 ++++++++++-------- .../src/components/RawJsonButton.js | 6 +- 2 files changed, 96 insertions(+), 76 deletions(-) diff --git a/mithril-explorer/src/components/AggregatorStatus/index.js b/mithril-explorer/src/components/AggregatorStatus/index.js index 2abd92d73ca..793c3beef59 100644 --- a/mithril-explorer/src/components/AggregatorStatus/index.js +++ b/mithril-explorer/src/components/AggregatorStatus/index.js @@ -1,6 +1,7 @@ import React, { useEffect, useState } from "react"; -import { Card, Row, Col, Container, OverlayTrigger, Tooltip } from "react-bootstrap"; +import { Card, Row, Col, Container, OverlayTrigger, Stack, Tooltip } from "react-bootstrap"; import { useSelector } from "react-redux"; +import LinkButton from "#/LinkButton"; import RawJsonButton from "#/RawJsonButton"; import ProtocolParameters from "#/ProtocolParameters"; import Stake from "#/Stake"; @@ -49,6 +50,8 @@ export default function AggregatorStatus() { const [aggregatorVersion, setAggregatorVersion] = useState({}); const currentAggregator = useSelector((state) => state.settings.selectedAggregator); const aggregatorStatusEndpoint = useSelector((state) => `${selectedAggregator(state)}/status`); + const [registrationPageUrl, setRegistrationPageUrl] = useState(undefined); + const [inOutRegistrationsPageUrl, setInOutRegistrationsPageUrl] = useState(undefined); const autoUpdate = useSelector((state) => state.settings.autoUpdate); const updateInterval = useSelector((state) => state.settings.updateInterval); @@ -84,6 +87,18 @@ export default function AggregatorStatus() { number: split_version[0] ?? "0.0.0", sha: split_version[1] ?? undefined, }); + + const params = new URLSearchParams(); + params.set("aggregator", currentAggregator); + setInOutRegistrationsPageUrl(`/registrations-in-out?${params.toString()}`); + + if (Number.isInteger(aggregatorStatus?.epoch)) { + const params = new URLSearchParams(); + params.set("aggregator", currentAggregator); + params.set("epoch", aggregatorStatus.epoch); + + setRegistrationPageUrl(`/registrations?${params.toString()}`); + } }, [currentAggregator, aggregatorStatus]); // Calculate percentage without decimal @@ -97,78 +112,83 @@ export default function AggregatorStatus() { return ( -
-

- Status - -

- - - - - {aggregatorStatus.cardano_era} - - {aggregatorStatus.mithril_era - ? capitalizeFirstLetter(aggregatorStatus.mithril_era) - : ""} - - - - - {aggregatorStatus.total_signers ?? 0} - {aggregatorStatus.total_next_signers ?? 0} - - {percent(aggregatorStatus.total_signers, aggregatorStatus.total_cardano_spo)}%{" "} - - - - - - - - - - - - - {percent( - aggregatorStatus.total_stakes_signers, - aggregatorStatus.total_cardano_stake, - )} - %{" "} - {/* */} - - - - - - Current: - - Next: - - - - - - {aggregatorVersion.number} - {aggregatorVersion.sha && ({aggregatorVersion.sha})} - - {aggregatorStatus.cardano_node_version} - - - -
+ + + {aggregatorStatus.cardano_era} + + {aggregatorStatus.mithril_era + ? capitalizeFirstLetter(aggregatorStatus.mithril_era) + : ""} + + + + + {aggregatorStatus.total_signers ?? 0} + {aggregatorStatus.total_next_signers ?? 0} + + {percent(aggregatorStatus.total_signers, aggregatorStatus.total_cardano_spo)}%{" "} + + + + + + + + + + + + + {percent(aggregatorStatus.total_stakes_signers, aggregatorStatus.total_cardano_stake)}%{" "} + + + + + + Current: + + Next: + + + + + + {aggregatorVersion.number} + {aggregatorVersion.sha && ({aggregatorVersion.sha})} + + {aggregatorStatus.cardano_node_version} + + + + + + Registered Signers + + + In/Out Registrations + + + +
); } diff --git a/mithril-explorer/src/components/RawJsonButton.js b/mithril-explorer/src/components/RawJsonButton.js index 543cc3e3c71..8d79220af41 100644 --- a/mithril-explorer/src/components/RawJsonButton.js +++ b/mithril-explorer/src/components/RawJsonButton.js @@ -1,11 +1,11 @@ import React from "react"; import { Button, OverlayTrigger, Tooltip } from "react-bootstrap"; -export default function RawJsonButton(props) { +export default function RawJsonButton({ tooltip = "Raw JSON", color = "black", ...props }) { return ( - Raw JSON}> + {tooltip}}> ); From 2db03c723a8c0f953d88a54f14979fe39bf1bf93 Mon Sep 17 00:00:00 2001 From: DJO <790521+Alenar@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:10:56 +0100 Subject: [PATCH 5/7] feat(explorer): fallback to epoch settings when status is unavailable To handle aggregators that don't have the new status route yet. --- mithril-explorer/src/app/page.js | 4 ---- .../src/components/AggregatorStatus/index.js | 15 ++++++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/mithril-explorer/src/app/page.js b/mithril-explorer/src/app/page.js index 3dba55bcde0..f376df71251 100644 --- a/mithril-explorer/src/app/page.js +++ b/mithril-explorer/src/app/page.js @@ -16,7 +16,6 @@ import { Tooltip, } from "chart.js"; import initMithrilClient from "@mithril-dev/mithril-client-wasm"; -import EpochSettings from "#/EpochSettings"; import CardanoDbSnapshotsList from "#/Artifacts/CardanoDbSnapshotsList"; import CardanoStakeDistributionsList from "#/Artifacts/CardanoStakeDistributionsList"; import CardanoTransactionsSnapshotsList from "#/Artifacts/CardanoTransactionsSnapshotsList"; @@ -116,9 +115,6 @@ export default function Explorer() { - {/* - - */} diff --git a/mithril-explorer/src/components/AggregatorStatus/index.js b/mithril-explorer/src/components/AggregatorStatus/index.js index 793c3beef59..581b28f49d5 100644 --- a/mithril-explorer/src/components/AggregatorStatus/index.js +++ b/mithril-explorer/src/components/AggregatorStatus/index.js @@ -1,6 +1,7 @@ import React, { useEffect, useState } from "react"; import { Card, Row, Col, Container, OverlayTrigger, Stack, Tooltip } from "react-bootstrap"; import { useSelector } from "react-redux"; +import EpochSettings from "#/EpochSettings"; import LinkButton from "#/LinkButton"; import RawJsonButton from "#/RawJsonButton"; import ProtocolParameters from "#/ProtocolParameters"; @@ -54,15 +55,21 @@ export default function AggregatorStatus() { const [inOutRegistrationsPageUrl, setInOutRegistrationsPageUrl] = useState(undefined); const autoUpdate = useSelector((state) => state.settings.autoUpdate); const updateInterval = useSelector((state) => state.settings.updateInterval); + const [fallbackToEpochSetting, setFallbackToEpochSetting] = useState(false); useEffect(() => { let fetchAggregatorStatus = () => { fetch(aggregatorStatusEndpoint) .then((response) => (response.status === 200 ? response.json() : {})) - .then((data) => setAggregatorStatus(data)) + .then((data) => { + setAggregatorStatus(data); + setFallbackToEpochSetting(false); + }) .catch((error) => { setAggregatorStatus({}); - console.error("Fetch status error:", error); + setFallbackToEpochSetting(true); + // todo: uncomment when the fallback is removed + // console.error("Fetch status error:", error); }); }; @@ -110,7 +117,9 @@ export default function AggregatorStatus() { return string.charAt(0).toUpperCase() + string.slice(1); } - return ( + return fallbackToEpochSetting ? ( + + ) : ( From 621eaa73af13723e20adf7acc9b15f52ddce3243 Mon Sep 17 00:00:00 2001 From: DJO <790521+Alenar@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:15:24 +0100 Subject: [PATCH 6/7] feat(explorer): make aggregator status block collapsable --- .../src/components/AggregatorStatus/index.js | 136 +++++++++++------- 1 file changed, 82 insertions(+), 54 deletions(-) diff --git a/mithril-explorer/src/components/AggregatorStatus/index.js b/mithril-explorer/src/components/AggregatorStatus/index.js index 581b28f49d5..f7a077b5099 100644 --- a/mithril-explorer/src/components/AggregatorStatus/index.js +++ b/mithril-explorer/src/components/AggregatorStatus/index.js @@ -1,5 +1,14 @@ import React, { useEffect, useState } from "react"; -import { Card, Row, Col, Container, OverlayTrigger, Stack, Tooltip } from "react-bootstrap"; +import { + Card, + Row, + Col, + Collapse, + Container, + OverlayTrigger, + Stack, + Tooltip, +} from "react-bootstrap"; import { useSelector } from "react-redux"; import EpochSettings from "#/EpochSettings"; import LinkButton from "#/LinkButton"; @@ -56,6 +65,7 @@ export default function AggregatorStatus() { const autoUpdate = useSelector((state) => state.settings.autoUpdate); const updateInterval = useSelector((state) => state.settings.updateInterval); const [fallbackToEpochSetting, setFallbackToEpochSetting] = useState(false); + const [showContent, setShowContent] = useState(true); useEffect(() => { let fetchAggregatorStatus = () => { @@ -121,59 +131,77 @@ export default function AggregatorStatus() { ) : ( - - - {aggregatorStatus.cardano_era} - - {aggregatorStatus.mithril_era - ? capitalizeFirstLetter(aggregatorStatus.mithril_era) - : ""} - - - - - {aggregatorStatus.total_signers ?? 0} - {aggregatorStatus.total_next_signers ?? 0} - - {percent(aggregatorStatus.total_signers, aggregatorStatus.total_cardano_spo)}%{" "} - - - - - - - - - - - - - {percent(aggregatorStatus.total_stakes_signers, aggregatorStatus.total_cardano_stake)}%{" "} - - - - - - Current: - - Next: - - - - - - {aggregatorVersion.number} - {aggregatorVersion.sha && ({aggregatorVersion.sha})} - - {aggregatorStatus.cardano_node_version} - - +

+ setShowContent(!showContent)} + aria-expanded={showContent} + aria-controls="contentRow"> + Aggregator Status + +

+ + +
+ + + {aggregatorStatus.cardano_era} + + {aggregatorStatus.mithril_era + ? capitalizeFirstLetter(aggregatorStatus.mithril_era) + : ""} + + + + + {aggregatorStatus.total_signers ?? 0} + {aggregatorStatus.total_next_signers ?? 0} + + {percent(aggregatorStatus.total_signers, aggregatorStatus.total_cardano_spo)}%{" "} + + + + + + + + + + + + + {percent( + aggregatorStatus.total_stakes_signers, + aggregatorStatus.total_cardano_stake, + )} + %{" "} + + + + + + Current: + + Next: + + + + + + {aggregatorVersion.number} + {aggregatorVersion.sha && ({aggregatorVersion.sha})} + + {aggregatorStatus.cardano_node_version} + + +
+
Date: Mon, 18 Nov 2024 17:51:12 +0100 Subject: [PATCH 7/7] chore: bump explorer package version from `0.7.16` to `0.7.17` --- mithril-explorer/package-lock.json | 4 ++-- mithril-explorer/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mithril-explorer/package-lock.json b/mithril-explorer/package-lock.json index 4197a984468..0ffe0171cb1 100644 --- a/mithril-explorer/package-lock.json +++ b/mithril-explorer/package-lock.json @@ -1,12 +1,12 @@ { "name": "mithril-explorer", - "version": "0.7.16", + "version": "0.7.17", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mithril-explorer", - "version": "0.7.16", + "version": "0.7.17", "dependencies": { "@mithril-dev/mithril-client-wasm": "file:../mithril-client-wasm/pkg", "@popperjs/core": "^2.11.8", diff --git a/mithril-explorer/package.json b/mithril-explorer/package.json index b1158046cf1..2a06e780858 100644 --- a/mithril-explorer/package.json +++ b/mithril-explorer/package.json @@ -1,6 +1,6 @@ { "name": "mithril-explorer", - "version": "0.7.16", + "version": "0.7.17", "private": true, "scripts": { "dev": "next dev",