diff --git a/package-lock.json b/package-lock.json index e8fc304..aa0d331 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3,6 +3,7 @@ "version": "0.1.0", "lockfileVersion": 3, "requires": true, + "proxy": "http://manager.example.com:19876", "packages": { "": { "name": "llng-manager", @@ -24,7 +25,8 @@ "@types/react-dom": "^18.2.24", "@types/react-router-dom": "^5.3.3", "@types/react-router-redux": "^5.0.27", - "axios": "^1.6.8", + "axios": "^1.7.4", + "http-proxy-middleware": "^3.0.3", "i18next": "^23.10.1", "i18next-browser-languagedetector": "^7.2.1", "i18next-http-backend": "^2.5.0", @@ -3368,8 +3370,6 @@ }, "node_modules/@juggle/resize-observer": { "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@juggle/resize-observer/-/resize-observer-3.4.0.tgz", - "integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==", "dev": true, "license": "Apache-2.0" }, @@ -3753,20 +3753,14 @@ }, "node_modules/@react-dnd/asap": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@react-dnd/asap/-/asap-4.0.1.tgz", - "integrity": "sha512-kLy0PJDDwvwwTXxqTFNAAllPHD73AycE9ypWeln/IguoGBEbvFcPDbCV03G52bEcC5E+YgupBE0VzHGdC8SIXg==", "license": "MIT" }, "node_modules/@react-dnd/invariant": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@react-dnd/invariant/-/invariant-2.0.0.tgz", - "integrity": "sha512-xL4RCQBCBDJ+GRwKTFhGUW8GXa4yoDfJrPbLblc3U09ciS+9ZJXJ3Qrcs/x2IODOdIE5kQxvMmE2UKyqUictUw==", "license": "MIT" }, "node_modules/@react-dnd/shallowequal": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@react-dnd/shallowequal/-/shallowequal-2.0.0.tgz", - "integrity": "sha512-Pc/AFTdwZwEKJxFJvlxrSmGe/di+aAOBn60sremrpLo6VI/6cmiUYNNwlI5KNYttg7uypzA3ILPMPgxB2GYZEg==", "license": "MIT" }, "node_modules/@redux-devtools/extension": { @@ -4693,7 +4687,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true, "license": "MIT" }, @@ -4755,8 +4751,9 @@ "license": "MIT" }, "node_modules/@types/http-proxy": { - "version": "1.17.14", - "dev": true, + "version": "1.17.15", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.15.tgz", + "integrity": "sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==", "license": "MIT", "dependencies": { "@types/node": "*" @@ -5448,7 +5445,9 @@ } }, "node_modules/acorn": { - "version": "8.12.0", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "license": "MIT", "bin": { @@ -5467,14 +5466,6 @@ "acorn-walk": "^8.0.2" } }, - "node_modules/acorn-import-attributes": { - "version": "1.9.5", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^8" - } - }, "node_modules/acorn-jsx": { "version": "5.3.2", "dev": true, @@ -5955,8 +5946,6 @@ }, "node_modules/axios": { "version": "1.7.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", - "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -6330,7 +6319,9 @@ "license": "MIT" }, "node_modules/body-parser": { - "version": "1.20.2", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "license": "MIT", "dependencies": { @@ -6342,7 +6333,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -6354,6 +6345,8 @@ }, "node_modules/body-parser/node_modules/bytes": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true, "license": "MIT", "engines": { @@ -6362,6 +6355,8 @@ }, "node_modules/body-parser/node_modules/debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "license": "MIT", "dependencies": { @@ -6370,6 +6365,8 @@ }, "node_modules/body-parser/node_modules/iconv-lite": { "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "license": "MIT", "dependencies": { @@ -6381,11 +6378,15 @@ }, "node_modules/body-parser/node_modules/ms": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true, "license": "MIT" }, "node_modules/body-parser/node_modules/on-finished": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "license": "MIT", "dependencies": { @@ -6527,7 +6528,6 @@ }, "node_modules/braces": { "version": "3.0.3", - "dev": true, "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -6542,7 +6542,9 @@ "license": "BSD-2-Clause" }, "node_modules/browserslist": { - "version": "4.23.1", + "version": "4.24.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", + "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", "dev": true, "funding": [ { @@ -6560,10 +6562,10 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001629", - "electron-to-chromium": "^1.4.796", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.16" + "caniuse-lite": "^1.0.30001669", + "electron-to-chromium": "^1.5.41", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -6713,7 +6715,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001636", + "version": "1.0.30001680", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz", + "integrity": "sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==", "dev": true, "funding": [ { @@ -7096,6 +7100,8 @@ }, "node_modules/content-type": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "dev": true, "license": "MIT", "engines": { @@ -7107,7 +7113,9 @@ "license": "MIT" }, "node_modules/cookie": { - "version": "0.6.0", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "dev": true, "license": "MIT", "engines": { @@ -7768,10 +7776,12 @@ } }, "node_modules/debug": { - "version": "4.3.5", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -7915,6 +7925,8 @@ }, "node_modules/depd": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, "license": "MIT", "engines": { @@ -7930,6 +7942,8 @@ }, "node_modules/destroy": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true, "license": "MIT", "engines": { @@ -8025,8 +8039,6 @@ }, "node_modules/dnd-core": { "version": "14.0.1", - "resolved": "https://registry.npmjs.org/dnd-core/-/dnd-core-14.0.1.tgz", - "integrity": "sha512-+PVS2VPTgKFPYWo3vAFEA8WPbTf7/xo43TifH9G8S1KqnrQu0o77A3unrF5yOugy4mIz7K5wAVFHUcha7wsz6A==", "license": "MIT", "dependencies": { "@react-dnd/asap": "^4.0.0", @@ -8209,7 +8221,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.803", + "version": "1.5.56", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.56.tgz", + "integrity": "sha512-7lXb9dAvimCFdvUMTyucD4mnIndt/xhRKFAlky0CyFogdnNmdPQNoHI23msF/2V4mpTxMzgMdjK4+YRlFlRQZw==", "dev": true, "license": "ISC" }, @@ -8247,7 +8261,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.17.0", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "license": "MIT", "dependencies": { @@ -8445,7 +8461,9 @@ } }, "node_modules/escalade": { - "version": "3.1.2", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "license": "MIT", "engines": { @@ -9145,6 +9163,8 @@ }, "node_modules/etag": { "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "dev": true, "license": "MIT", "engines": { @@ -9153,7 +9173,6 @@ }, "node_modules/eventemitter3": { "version": "4.0.7", - "dev": true, "license": "MIT" }, "node_modules/events": { @@ -9356,36 +9375,38 @@ } }, "node_modules/express": { - "version": "4.19.2", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "dev": true, "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -9398,19 +9419,33 @@ }, "node_modules/express/node_modules/debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "license": "MIT", "dependencies": { "ms": "2.0.0" } }, + "node_modules/express/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/express/node_modules/finalhandler": { - "version": "1.2.0", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dev": true, "license": "MIT", "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -9423,11 +9458,15 @@ }, "node_modules/express/node_modules/ms": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true, "license": "MIT" }, "node_modules/express/node_modules/on-finished": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "license": "MIT", "dependencies": { @@ -9439,6 +9478,8 @@ }, "node_modules/express/node_modules/statuses": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true, "license": "MIT", "engines": { @@ -9585,7 +9626,6 @@ }, "node_modules/fill-range": { "version": "7.1.1", - "dev": true, "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -9972,6 +10012,8 @@ }, "node_modules/fresh": { "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "dev": true, "license": "MIT", "engines": { @@ -10628,6 +10670,8 @@ }, "node_modules/http-errors": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10643,6 +10687,8 @@ }, "node_modules/http-errors/node_modules/statuses": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true, "license": "MIT", "engines": { @@ -10656,7 +10702,6 @@ }, "node_modules/http-proxy": { "version": "1.18.1", - "dev": true, "license": "MIT", "dependencies": { "eventemitter3": "^4.0.0", @@ -10681,26 +10726,20 @@ } }, "node_modules/http-proxy-middleware": { - "version": "2.0.6", - "dev": true, + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.3.tgz", + "integrity": "sha512-usY0HG5nyDUwtqpiZdETNbmKtw3QQ1jwYFZ9wi5iHzX2BcILwQKtYDJPo7XHTsu5Z0B2Hj3W9NNnbd+AjFWjqg==", "license": "MIT", "dependencies": { - "@types/http-proxy": "^1.17.8", + "@types/http-proxy": "^1.17.15", + "debug": "^4.3.6", "http-proxy": "^1.18.1", - "is-glob": "^4.0.1", - "is-plain-obj": "^3.0.0", - "micromatch": "^4.0.2" + "is-glob": "^4.0.3", + "is-plain-object": "^5.0.0", + "micromatch": "^4.0.8" }, "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "@types/express": "^4.17.13" - }, - "peerDependenciesMeta": { - "@types/express": { - "optional": true - } + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/http2-wrapper": { @@ -11074,7 +11113,6 @@ }, "node_modules/is-extglob": { "version": "2.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -11123,7 +11161,6 @@ }, "node_modules/is-glob": { "version": "4.0.3", - "dev": true, "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -11187,7 +11224,6 @@ }, "node_modules/is-number": { "version": "7.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=0.12.0" @@ -11225,6 +11261,8 @@ }, "node_modules/is-plain-obj": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", + "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", "dev": true, "license": "MIT", "engines": { @@ -11234,6 +11272,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "dev": true, @@ -14538,6 +14585,8 @@ }, "node_modules/media-typer": { "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "dev": true, "license": "MIT", "engines": { @@ -14557,8 +14606,6 @@ }, "node_modules/memoize-one": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", - "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==", "license": "MIT" }, "node_modules/merge": { @@ -14567,9 +14614,14 @@ "license": "MIT" }, "node_modules/merge-descriptors": { - "version": "1.0.1", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/merge-stream": { "version": "2.0.0", @@ -14593,8 +14645,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "dev": true, + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "license": "MIT", "dependencies": { "braces": "^3.0.3", @@ -14606,6 +14659,8 @@ }, "node_modules/mime": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true, "license": "MIT", "bin": { @@ -14729,7 +14784,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/multicast-dns": { @@ -14851,7 +14908,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.14", + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", "dev": true, "license": "MIT" }, @@ -15334,7 +15393,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.7", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "dev": true, "license": "MIT" }, @@ -15351,12 +15412,13 @@ "license": "MIT" }, "node_modules/picocolors": { - "version": "1.0.1", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8.6" @@ -16832,11 +16894,13 @@ } }, "node_modules/qs": { - "version": "6.11.0", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -16906,6 +16970,8 @@ }, "node_modules/raw-body": { "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dev": true, "license": "MIT", "dependencies": { @@ -16920,6 +16986,8 @@ }, "node_modules/raw-body/node_modules/bytes": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true, "license": "MIT", "engines": { @@ -16928,6 +16996,8 @@ }, "node_modules/raw-body/node_modules/iconv-lite": { "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "license": "MIT", "dependencies": { @@ -16992,8 +17062,6 @@ }, "node_modules/react-arborist": { "version": "3.4.0", - "resolved": "https://registry.npmjs.org/react-arborist/-/react-arborist-3.4.0.tgz", - "integrity": "sha512-QI46oRGXJr0oaQfqqVobIiIoqPp5Y5gM69D2A2P7uHVif+X75XWnScR5drC7YDKgJ4CXVaDeFwnYKOWRRfncMg==", "license": "MIT", "dependencies": { "react-dnd": "^14.0.3", @@ -17009,8 +17077,6 @@ }, "node_modules/react-arborist/node_modules/redux": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", - "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", "license": "MIT" }, "node_modules/react-dev-utils": { @@ -17164,8 +17230,6 @@ }, "node_modules/react-dnd": { "version": "14.0.5", - "resolved": "https://registry.npmjs.org/react-dnd/-/react-dnd-14.0.5.tgz", - "integrity": "sha512-9i1jSgbyVw0ELlEVt/NkCUkxy1hmhJOkePoCH713u75vzHGyXhPDm28oLfc2NMSBjZRM1Y+wRjHXJT3sPrTy+A==", "license": "MIT", "dependencies": { "@react-dnd/invariant": "^2.0.0", @@ -17194,8 +17258,6 @@ }, "node_modules/react-dnd-html5-backend": { "version": "14.1.0", - "resolved": "https://registry.npmjs.org/react-dnd-html5-backend/-/react-dnd-html5-backend-14.1.0.tgz", - "integrity": "sha512-6ONeqEC3XKVf4eVmMTe0oPds+c5B9Foyj8p/ZKLb7kL2qh9COYxiBHv3szd6gztqi/efkmriywLUVlPotqoJyw==", "license": "MIT", "dependencies": { "dnd-core": "14.0.1" @@ -18974,8 +19036,6 @@ }, "node_modules/react-window": { "version": "1.8.10", - "resolved": "https://registry.npmjs.org/react-window/-/react-window-1.8.10.tgz", - "integrity": "sha512-Y0Cx+dnU6NLa5/EvoHukUD0BklJ8qITCtVEPY1C/nL8wwoZ0b5aEw8Ff1dOVHw7fCzMt55XfJDd8S8W8LCaUCg==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.0.0", @@ -19236,7 +19296,6 @@ }, "node_modules/requires-port": { "version": "1.0.0", - "dev": true, "license": "MIT" }, "node_modules/reselect": { @@ -19451,7 +19510,9 @@ } }, "node_modules/rollup": { - "version": "2.79.1", + "version": "2.79.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz", + "integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==", "dev": true, "license": "MIT", "bin": { @@ -19748,7 +19809,9 @@ } }, "node_modules/send": { - "version": "0.18.0", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, "license": "MIT", "dependencies": { @@ -19772,6 +19835,8 @@ }, "node_modules/send/node_modules/debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "license": "MIT", "dependencies": { @@ -19780,16 +19845,15 @@ }, "node_modules/send/node_modules/debug/node_modules/ms": { "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true, "license": "MIT" }, "node_modules/send/node_modules/on-finished": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "license": "MIT", "dependencies": { @@ -19801,6 +19865,8 @@ }, "node_modules/send/node_modules/statuses": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true, "license": "MIT", "engines": { @@ -19878,19 +19944,31 @@ "license": "ISC" }, "node_modules/serve-static": { - "version": "1.15.0", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dev": true, "license": "MIT", "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" } }, + "node_modules/serve-static/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/set-function-length": { "version": "1.2.2", "dev": true, @@ -19923,6 +20001,8 @@ }, "node_modules/setprototypeof": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true, "license": "ISC" }, @@ -21031,7 +21111,6 @@ }, "node_modules/to-regex-range": { "version": "5.0.1", - "dev": true, "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -21042,6 +21121,8 @@ }, "node_modules/toidentifier": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, "license": "MIT", "engines": { @@ -21289,6 +21370,8 @@ }, "node_modules/type-is": { "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, "license": "MIT", "dependencies": { @@ -21378,8 +21461,6 @@ }, "node_modules/typescript": { "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -21486,7 +21567,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.16", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", + "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", "dev": true, "funding": [ { @@ -21504,8 +21587,8 @@ ], "license": "MIT", "dependencies": { - "escalade": "^3.1.2", - "picocolors": "^1.0.1" + "escalade": "^3.2.0", + "picocolors": "^1.1.0" }, "bin": { "update-browserslist-db": "cli.js" @@ -21635,8 +21718,6 @@ }, "node_modules/use-resize-observer": { "version": "9.1.0", - "resolved": "https://registry.npmjs.org/use-resize-observer/-/use-resize-observer-9.1.0.tgz", - "integrity": "sha512-R25VqO9Wb3asSD4eqtcxk8sJalvIOYBqS8MNZlpDSQ4l4xMQxC/J7Id9HoTqPq8FwULIn0PVW+OAqF2dyYbjow==", "dev": true, "license": "MIT", "dependencies": { @@ -21794,20 +21875,21 @@ } }, "node_modules/webpack": { - "version": "5.92.0", + "version": "5.96.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", + "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", "dev": true, "license": "MIT", "dependencies": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.5", + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.7.1", - "acorn-import-attributes": "^1.9.5", - "browserslist": "^4.21.10", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -21919,6 +22001,31 @@ } } }, + "node_modules/webpack-dev-server/node_modules/http-proxy-middleware": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz", + "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/http-proxy": "^1.17.8", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.1", + "is-plain-obj": "^3.0.0", + "micromatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "@types/express": "^4.17.13" + }, + "peerDependenciesMeta": { + "@types/express": { + "optional": true + } + } + }, "node_modules/webpack-manifest-plugin": { "version": "4.1.1", "dev": true, diff --git a/package.json b/package.json index bf7131a..ce6b6c9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "llng-manager", "version": "0.1.0", "private": true, - "proxy": "http://manager.example.com:19876", + "allowedHosts": "all", "dependencies": { "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", @@ -21,6 +21,7 @@ "@types/react-router-dom": "^5.3.3", "@types/react-router-redux": "^5.0.27", "axios": "^1.7.4", + "http-proxy-middleware": "^3.0.3", "i18next": "^23.10.1", "i18next-browser-languagedetector": "^7.2.1", "i18next-http-backend": "^2.5.0", @@ -38,7 +39,7 @@ "web-vitals": "^2.1.4" }, "scripts": { - "start": "react-scripts start", + "start": "HOST=newmanager.example.com react-scripts start", "build": "react-scripts build", "test": "jest", "jest-preview": "jest-preview", diff --git a/src/App.tsx b/src/App.tsx index 2bd41cd..0736291 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -7,6 +7,7 @@ import { useAppSelector } from "./app/hooks"; import { history } from "./app/store"; import Navbar from "./components/Navbar"; import { Configuration } from "./pages/Configuration"; +import { PartialConfiguration } from "./pages/PartialConfiguration"; function App() { useTranslation(); @@ -26,14 +27,29 @@ function App() { type: infos ? infos[0] : "", info: infos ? { - name: infos.length === 3 ? infos[2] : infos[1], - type: infos.length === 3 ? infos[1] : "", - } + name: infos.length === 3 ? infos[2] : infos[1], + type: infos.length === 3 ? infos[1] : "", + } : { name: "", type: "" }, }} /> } /> + + } + /> diff --git a/src/components/SaveButton.tsx b/src/components/SaveButton.tsx index ba9b206..dbbcd89 100644 --- a/src/components/SaveButton.tsx +++ b/src/components/SaveButton.tsx @@ -3,11 +3,11 @@ import { Fab } from "@mui/material"; import { t } from "i18next"; import { useState } from "react"; import { useAppDispatch, useAppSelector } from "../app/hooks"; -import { saveConfigAsync } from "../features/config/configSlice"; +import { saveConfigAsync, savePartialConfigAsync } from "../features/config/configSlice"; import { ruleOIDC, ruleSAML } from "../utils/rules"; import "./SaveButton.css"; import { SavePopup } from "./SavePopup"; -export default function SaveButton() { +export default function SaveButton({ partial }: { partial?: boolean }) { const [openSavePopup, setOpenSavePopup] = useState(false); const [openErrorPopup, setOpenErrorPopup] = useState(false); const dispatch = useAppDispatch(); @@ -46,7 +46,7 @@ export default function SaveButton() { }); } if (stateOk) { - dispatch(saveConfigAsync(config.data.config)); + dispatch(partial ? savePartialConfigAsync(config.data.config) : saveConfigAsync(config.data.config)); setOpenSavePopup(true); } else { setOpenErrorPopup(true); diff --git a/src/dashboards/PartialManager.tsx b/src/dashboards/PartialManager.tsx new file mode 100644 index 0000000..9509fe4 --- /dev/null +++ b/src/dashboards/PartialManager.tsx @@ -0,0 +1,290 @@ +import ArrowBackIcon from "@mui/icons-material/ArrowBack"; +import ArrowForwardIcon from "@mui/icons-material/ArrowForward"; +import CachedIcon from "@mui/icons-material/Cached"; +import WidgetsOutlinedIcon from "@mui/icons-material/WidgetsOutlined"; +import { Button, Divider, Menu, MenuItem, Pagination } from "@mui/material"; +import { ChangeEvent, useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { useLocation } from "react-router-dom"; +import { push } from "redux-first-history"; +import { useAppDispatch, useAppSelector } from "../app/hooks"; +import AppCard from "../components/managerComponents/AppCard"; +import FilterToggle from "../components/managerComponents/Filters"; +import Issuers from "../components/managerComponents/Issuers"; +import { + getPartialConfigAsync, + removeError, + setError, +} from "../features/config/configSlice"; +import { ruleCAS, ruleOIDC, ruleSAML } from "../utils/rules"; +import "./Manager.css"; + +export default function PartialManager() { + const dispatch = useAppDispatch(); + const { t } = useTranslation(); + const config = useAppSelector((state) => state.config); + const configNum = useAppSelector((state) => + state.router.location?.hash.replace("#conf/", "") + ); + const [filters, setFilters] = useState({ alpha: false, search: "" }); + const location = useLocation(); + const [page, setPage] = useState(1); + const [anchorEl, setAnchorEl] = useState(null); + const handleClick = (event: React.MouseEvent) => { + setAnchorEl(event.currentTarget); + }; + const [configPresent, setConfigPresent] = useState( + Boolean(config.data.metadata && !config.loading && !config.error.has) + ); + + useEffect(() => { + if (!configPresent) { + setConfigPresent(true); + dispatch( + getPartialConfigAsync(configNum === "latest" ? undefined : Number(configNum)) + ); + } + const appNum = + (config.data.config.locationRules ? Object.keys(config.data.config.locationRules).length : 0) + + (config.data.config.samlSPMetaDataXML + ? Object.keys(config.data.config.samlSPMetaDataXML).length + : 0) + + (config.data.config.oidcRPMetaDataOptions + ? Object.keys(config.data.config.oidcRPMetaDataOptions).length + : 0) + + (config.data.config.casAppMetaDataOptions + ? Object.keys(config.data.config.casAppMetaDataOptions).length + : 0); + if (appNum === 1) { + const name = config.data.config.locationRules || config.data.config.samlSPMetaDataXML || config.data.config.oidcRPMetaDataOptions || config.data.config.casAppMetaDataOptions + const type = config.data.config.locationRules ? "native" : false || config.data.config.samlSPMetaDataXML ? "SPsaml" : false || config.data.config.oidcRPMetaDataOptions ? "RPoidc" : false || config.data.config.casAppMetaDataOptions ? "AppCas" : false + console.log(Object.keys(name ? name : {})[0]) + dispatch(push(`#app/${type}/${Object.keys(name ? name : {})[0]}`)) + } + }, [dispatch, configNum, config.data.metadata, location, configPresent]); + try { + if (config.loading) { + return ( +
+ {t("currentConfiguration")} + {t("loading")} +
+ ); + } else if (config.error.has) { + return ( +
+ {t("currentConfiguration")} + {t("failedLoading")} + {config.error.errorContent} +
+ ); + } else { + const renderedData: JSX.Element[] = []; + if (config.data.config.locationRules) { + renderedData.push( + ...Object.keys(config.data.config.locationRules).map((key) => ( + + )) + ); + } + if (config.data.config.samlSPMetaDataXML) { + renderedData.push( + ...Object.keys(config.data.config.samlSPMetaDataXML).map((key) => ( + + )) + ); + } + if (config.data.config.oidcRPMetaDataOptions) { + renderedData.push( + ...Object.keys(config.data.config.oidcRPMetaDataOptions).map( + (key) => ( + + ) + ) + ); + } + if (config.data.config.casAppMetaDataOptions) { + renderedData.push( + ...Object.keys(config.data.config.casAppMetaDataOptions).map( + (key) => ( + + ) + ) + ); + } + renderedData.filter((el) => { + return String(el.props.info.name).includes(filters.search); + }); + + if (filters.alpha) { + renderedData.sort((el1, el2) => + el1.props.info.name > el2.props.info.name ? 1 : -1 + ); + } + const pageLimit = 12; + const pageNb = Math.ceil(renderedData.length / pageLimit); + const pages = Array.from( + { length: Math.ceil(renderedData.length / pageLimit) }, + (v, i) => renderedData.slice(i * pageLimit, i * pageLimit + pageLimit) + ); + const handleChangePage = (event: ChangeEvent, value: number) => { + setPage(value); + }; + + return ( + <> + {t("currentConfiguration")} + + {false && } + {false && } + + +
{pages[page - 1]}
+ + { + setAnchorEl(null); + }} + > + { + dispatch(push(`#conf/${config.data.metadata.prev}`)); + setAnchorEl(null); + }} + > + + {t("previous")} + + + { + dispatch(push(`#conf/${config.data.metadata.next}`)); + setAnchorEl(null); + }} + > + + {t("next")} + + + { + dispatch(push(`#conf/latest`)); + setAnchorEl(null); + }} + > + + {t("latest")} + + + + ); + } + } catch (e) { + console.debug(e); + if (e instanceof Error) { + dispatch(setError(`${e.name} : ${e.message}`)); + dispatch(removeError()); + } + return
{config.error.errorContent}
; + } +} diff --git a/src/features/config/configAPI.ts b/src/features/config/configAPI.ts index 77c841a..9025c7c 100644 --- a/src/features/config/configAPI.ts +++ b/src/features/config/configAPI.ts @@ -1,9 +1,10 @@ -import axios from "axios"; import { llngConfig } from "../../utils/types"; +const baseUrl = "http://manager.example.com:19876" + export function getMetadataConfig(num?: number) { try { - const response = axios.get(`/confs/${num ? num : "latest"}`); + const response = window.fetch(`${baseUrl}/confs/${num ? num : "latest"}`); return response; } catch (error) { // console.error(error) @@ -13,7 +14,16 @@ export function getMetadataConfig(num?: number) { export function getConfig(num: number) { try { - const response = axios.get(`/manager.fcgi/confs/${num}?full=1`); + const response = window.fetch(`${baseUrl}/manager.fcgi/confs/${num}?full=1`); + return response; + } catch (error) { + throw new Error(JSON.stringify(error)); + } +} + +export function getPartialConfig(num: number) { + try { + const response = window.fetch(`${baseUrl}/partial`); return response; } catch (error) { throw new Error(JSON.stringify(error)); @@ -22,9 +32,34 @@ export function getConfig(num: number) { export function saveConfig(config: llngConfig) { try { - const response = axios.post("/manager.fcgi/confs/raw", config); + + const response = window.fetch(`${baseUrl}/manager.fcgi/confs/raw`, + { + method: 'POST', + headers: { 'content-type': 'application/json' }, + body: JSON.stringify(config), + // credentials: "include" + }); + return response; + } catch (error) { + console.log(error) + throw new Error(JSON.stringify(error)); + } +} + +export function savePartialConfig(config: llngConfig) { + try { + + const response = window.fetch(`${baseUrl}/partial/raw`, + { + method: 'POST', + headers: { 'content-type': 'application/json' }, + body: JSON.stringify(config), + // credentials: "include" + }); return response; } catch (error) { + console.log(error) throw new Error(JSON.stringify(error)); } } diff --git a/src/features/config/configSlice.ts b/src/features/config/configSlice.ts index 1b101c6..3b4888b 100644 --- a/src/features/config/configSlice.ts +++ b/src/features/config/configSlice.ts @@ -8,7 +8,7 @@ import attributes from "../../static/attributes.json"; import { treeFormat } from "../../utils/recursTree"; import { changeElementInConf } from "../../utils/searchIntree"; import { MetaData, llngConfig } from "../../utils/types"; -import { getConfig, getMetadataConfig, saveConfig } from "./configAPI"; +import { getConfig, getMetadataConfig, getPartialConfig, saveConfig, savePartialConfig } from "./configAPI"; export interface ConfigState { loading: boolean; @@ -26,25 +26,46 @@ export const initialState: ConfigState = { export const getConfigAsync = createAsyncThunk( "config/fetchConfig", async (num?: number): Promise => { - const configlatestMetadata = await getMetadataConfig(); - if (num && num <= configlatestMetadata.data.cfgNum) { - const configMetadata = await getMetadataConfig(num ? num : undefined); - const response = await getConfig(num ? num : configMetadata.data.cfgNum); - return { metadata: configMetadata.data, config: response.data }; + const latestMetaresponse = await getMetadataConfig(); + const configlatestMetadata = await latestMetaresponse.json(); + if (num && num <= configlatestMetadata.cfgNum) { + const metaresponse = await getMetadataConfig(num ? num : undefined); + const configMetadata = await metaresponse.json(); + const response = await getConfig(num ? num : configMetadata.cfgNum); + return { metadata: configMetadata, config: await response.json() }; } else { - const response = await getConfig(configlatestMetadata.data.cfgNum); - return { metadata: configlatestMetadata.data, config: response.data }; + const response = await getConfig(configlatestMetadata.cfgNum); + return { metadata: await configlatestMetadata, config: await response.json() }; } } ); + +export const getPartialConfigAsync = createAsyncThunk( + "config/fetchPartialConfig", + async (num?: number): Promise => { + const metaResponse = await getMetadataConfig(num ? num : undefined); + const configMetadata = await metaResponse.json() + const response = await getPartialConfig(num ? num : (configMetadata).cfgNum); + return { metadata: configMetadata, config: await response.json() } + } +) + export const saveConfigAsync = createAsyncThunk( "config/saveConfig", async (config: llngConfig): Promise => { const response = await saveConfig(config); - return response.data; + return response.json(); } ); +export const savePartialConfigAsync = createAsyncThunk( + "config/savePartialConfig", + async (config: llngConfig): Promise => { + const response = await savePartialConfig(config) + return response.json() + } +) + const configSlice = createSlice({ name: "config", initialState, @@ -69,22 +90,38 @@ const configSlice = createSlice({ } }, toggleSAML(state) { + if (!state.data.config.issuerDBSAMLActivation) { + state.data.config.issuerDBSAMLActivation = 0 + } state.data.config.issuerDBSAMLActivation = 1 - Number(state.data.config.issuerDBSAMLActivation); }, toggleOIDC(state) { + if (!state.data.config.issuerDBOpenIDConnectActivation) { + state.data.config.issuerDBOpenIDConnectActivation = 0 + } state.data.config.issuerDBOpenIDConnectActivation = 1 - Number(state.data.config.issuerDBOpenIDConnectActivation); }, toggleCAS(state) { + if (!state.data.config.issuerDBCASActivation) { + state.data.config.issuerDBCASActivation = 0 + } state.data.config.issuerDBCASActivation = 1 - Number(state.data.config.issuerDBCASActivation); + console.log(state.data.config.issuerDBCASActivation, 1 - Number(state.data.config.issuerDBCASActivation)) }, toggleOID2(state) { + if (!state.data.config.issuerDBOpenIDActivation) { + state.data.config.issuerDBOpenIDActivation = 0 + } state.data.config.issuerDBOpenIDActivation = 1 - Number(state.data.config.issuerDBOpenIDActivation); }, toggleGET(state) { + if (!state.data.config.issuerDBGetActivation) { + state.data.config.issuerDBGetActivation = 0 + } state.data.config.issuerDBGetActivation = 1 - Number(state.data.config.issuerDBGetActivation); }, @@ -926,10 +963,9 @@ const configSlice = createSlice({ if (!state.data.config.combModules[action.payload].over) { state.data.config.combModules[action.payload].over = {}; } - const id: string = `new${ - Object.keys(state.data.config.combModules[action.payload].over).length + + const id: string = `new${Object.keys(state.data.config.combModules[action.payload].over).length + 1 - }`; + }`; ( state.data.config.combModules[action.payload].over as unknown as Record< @@ -1208,11 +1244,11 @@ const configSlice = createSlice({ .map((key) => state.data.config.applicationList ? ( - state.data.config.applicationList as Record< - string, - Record - > - )[key].order + state.data.config.applicationList as Record< + string, + Record + > + )[key].order : 0 ) .filter((el) => typeof el === "number"), @@ -1254,19 +1290,18 @@ const configSlice = createSlice({ .map((key) => state.data.config.applicationList ? ( - state.data.config.applicationList[action.payload] as Record< - string, - Record - > - )[key].order + state.data.config.applicationList[action.payload] as Record< + string, + Record + > + )[key].order : 0 ) .filter((el) => typeof el === "number"), 0 ); state.data.config.applicationList[action.payload][ - `new_application${ - Object.keys(state.data.config.applicationList[action.payload]).length + `new_application${Object.keys(state.data.config.applicationList[action.payload]).length }` ] = { options: { name: "New Application" }, @@ -1320,11 +1355,11 @@ const configSlice = createSlice({ .filter((key: string) => state.data.config.applicationList ? ( - state.data.config.applicationList as Record< - string, - Record - > - )[key].order + state.data.config.applicationList as Record< + string, + Record + > + )[key].order ? true : false : false @@ -1357,9 +1392,18 @@ const configSlice = createSlice({ Record > )[action.payload.category].order; - + console.log(state); if (appIndex === -1) return; if (action.payload.direction === "up" && appIndex > 0) { + console.log((state.data.config.applicationList as Record< + string, + Record + > + )[categories[appIndex]], (state.data.config.applicationList as Record< + string, + Record + > + )[categories[appIndex - 1]]); ( state.data.config.applicationList as Record< string, @@ -1415,10 +1459,10 @@ const configSlice = createSlice({ .filter((key: string) => state.data.config.applicationList ? ( - state.data.config.applicationList[ - action.payload.category - ] as Record> - )[key].order + state.data.config.applicationList[ + action.payload.category + ] as Record> + )[key].order ? true : false : false @@ -1428,12 +1472,12 @@ const configSlice = createSlice({ return ( ( state.data.config.applicationList[ - action.payload.category + action.payload.category ] as Record> )[key1].order - ( state.data.config.applicationList[ - action.payload.category + action.payload.category ] as Record> )[key2].order ); @@ -1453,16 +1497,16 @@ const configSlice = createSlice({ if (action.payload.direction === "up" && appIndex > 0) { ( state.data.config.applicationList[ - action.payload.category + action.payload.category ] as Record> )[action.payload.appName].order = ( state.data.config.applicationList[ - action.payload.category + action.payload.category ] as Record> )[apps[appIndex - 1]].order; ( state.data.config.applicationList[ - action.payload.category + action.payload.category ] as Record> )[apps[appIndex - 1]].order = order; } else if ( @@ -1471,16 +1515,16 @@ const configSlice = createSlice({ ) { ( state.data.config.applicationList[ - action.payload.category + action.payload.category ] as Record> )[action.payload.appName].order = ( state.data.config.applicationList[ - action.payload.category + action.payload.category ] as Record> )[apps[appIndex + 1]].order; ( state.data.config.applicationList[ - action.payload.category + action.payload.category ] as Record> )[apps[appIndex + 1]].order = order; } @@ -1535,7 +1579,7 @@ const configSlice = createSlice({ saveConfigAsync.fulfilled, (state: ConfigState, action: PayloadAction) => { state.loading = false; - state.saveResponse = action.payload.details; + state.saveResponse = action.payload; } ) .addCase( @@ -1547,6 +1591,15 @@ const configSlice = createSlice({ state.error.errorContent = action.payload.message; } } + ).addCase(getPartialConfigAsync.pending, (state: ConfigState) => { + state.loading = true; + }) + .addCase( + getPartialConfigAsync.fulfilled, + (state: ConfigState, action: PayloadAction) => { + state.loading = false; + state.data = action.payload; + } ); }, }); diff --git a/src/pages/PartialConfiguration.tsx b/src/pages/PartialConfiguration.tsx new file mode 100644 index 0000000..55354a3 --- /dev/null +++ b/src/pages/PartialConfiguration.tsx @@ -0,0 +1,82 @@ +import { Breadcrumbs, Link } from "@mui/material"; +import { push } from "redux-first-history"; +import { useAppDispatch, useAppSelector } from "../app/hooks"; +import { ApplicationDashboard } from "../dashboards/ApplicationDashboard"; +import { CatAndAppList } from "../dashboards/CatAndAppList"; +import SaveButton from "../components/SaveButton"; +import { useTranslation } from "react-i18next"; +import PartialManager from "../dashboards/PartialManager"; + +export function PartialConfiguration({ + location, +}: { + location: { type: string; info: { name: string; type?: string } }; +}) { + const dispatch = useAppDispatch(); + const { t } = useTranslation(); + const config = useAppSelector((state) => state.config); + const metadata = useAppSelector((state) => state.config.data.metadata); + + switch (location.type) { + case "app": + return ( +
+ + + dispatch(push(``))}>{t("conf")} + + + dispatch(push(`#conf/${config.data.config.cfgNum}`))}> + {metadata.cfgNum} + + + + {location.type} + + + {location.info.type} + + + {location.info.name} + + + + +
+ ); + case "catandapp": + return ( +
+ + + dispatch(push(``))}>{t("conf")} + + + dispatch(push(`#conf/${metadata.cfgNum}`))}> + {metadata.cfgNum} + + + + {t("applicationList")} + + + + +
+ ); + default: + return ( +
+ + + dispatch(push(``))}>{t("conf")} + + + +
+ ); + } +}