was the presetup configuration even used, deploy new dashboard stuff
Some checks failed
Code quality checks / build (23) (push) Successful in 33s
Push code / build (push) Failing after 3s

This commit is contained in:
Lara 2024-11-02 15:51:07 +02:00
parent f0ab9c6200
commit 1dea7721e5
Signed by: laratheprotogen
GPG key ID: 5C0296EB3165F98B
41 changed files with 1626 additions and 1370 deletions

View file

@ -10,13 +10,15 @@ ARG API_URL
# Install dependencies before copying over any other files
RUN corepack prepare --activate pnpm@latest
COPY --chown=node:node package.json pnpm-lock.yaml pnpm-workspace.yaml /zeppelin
COPY --chown=node:node package.json pnpm-lock.yaml pnpm-workspace.yaml /zeppelin/
RUN mkdir /zeppelin/backend
COPY --chown=node:node backend/package.json /zeppelin/backend
COPY --chown=node:node backend/package.json /zeppelin/backend/
RUN mkdir /zeppelin/shared
COPY --chown=node:node shared/package.json /zeppelin/shared
COPY --chown=node:node shared/package.json /zeppelin/shared/
RUN mkdir /zeppelin/dashboard
COPY --chown=node:node dashboard/package.json /zeppelin/dashboard
COPY --chown=node:node dashboard/package.json /zeppelin/dashboard/
RUN mkdir /zeppelin/revampdashboard
COPY --chown=node:node revampdashboard/package.json /zeppelin/revampdashboard/
WORKDIR /zeppelin
RUN pnpm i
@ -31,6 +33,9 @@ RUN pnpm run build
WORKDIR /zeppelin/dashboard
RUN pnpm run build
WORKDIR /zeppelin/revampdashboard/
RUN pnpm run build
# Prune dev dependencies
WORKDIR /zeppelin
RUN pnpm prune --prod

View file

@ -100,7 +100,7 @@
"@types/twemoji": "^12.1.0",
"@types/uuid": "^9.0.2",
"ava": "^5.3.1",
"rimraf": "^2.6.2",
"rimraf": "^6.0.1",
"source-map-support": "^0.5.16",
"zod-to-json-schema": "^3.22.3"
},

View file

@ -1,5 +1,3 @@
version: '3'
name: zeppelin-prod
volumes:
mysql-data:
services:
@ -88,3 +86,15 @@ services:
- .env
working_dir: /zeppelin/dashboard
command: ["node", "serve.js"]
revampdashboard:
depends_on:
migrate:
condition: service_completed_successfully
build: *build
restart: on-failure
environment: *env
env_file:
- .env
working_dir: /zeppelin/revampdashboard
command: ["node", "build"]

View file

@ -21,3 +21,15 @@ server {
client_max_body_size 200M;
}
}
server {
listen 80;
server_name new.zappyzep.xyz;
set $dashboard_upstream "http://revampdashboard:3000";
location / {
resolver 127.0.0.11;
proxy_pass $dashboard_upstream$uri$is_args$args;
}
}

1384
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -2,3 +2,4 @@ packages:
- 'shared'
- 'backend'
- 'dashboard'
- 'revampdashboard'

View file

@ -1 +0,0 @@
/build

View file

@ -1 +0,0 @@
/build

View file

@ -1,739 +0,0 @@
{
"name": "zeppelin-presetup-configurator",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "zeppelin-presetup-configurator",
"dependencies": {
"js-yaml": "^4.0.0",
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"@snowpack/plugin-typescript": "^1.2.1",
"@types/node": "^14.14.21",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"snowpack": "^3.0.11"
}
},
"node_modules/@snowpack/plugin-typescript": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@snowpack/plugin-typescript/-/plugin-typescript-1.2.1.tgz",
"integrity": "sha512-wU+JNaMVkqGsqTaUY7TnEMhGt/3URTgA9dpMCtZX6wn/ceA7Gwlmue/sOLynf0OTNLygHPvjiQECQYkEi3LTtg==",
"dev": true,
"dependencies": {
"execa": "^5.0.0",
"npm-run-path": "^4.0.1"
},
"peerDependencies": {
"typescript": "*"
}
},
"node_modules/@types/node": {
"version": "14.14.21",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.21.tgz",
"integrity": "sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A==",
"dev": true
},
"node_modules/@types/prop-types": {
"version": "15.7.3",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==",
"dev": true
},
"node_modules/@types/react": {
"version": "17.0.0",
"resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.0.tgz",
"integrity": "sha512-aj/L7RIMsRlWML3YB6KZiXB3fV2t41+5RBGYF8z+tAKU43Px8C3cYUZsDvf1/+Bm4FK21QWBrDutu8ZJ/70qOw==",
"dev": true,
"dependencies": {
"@types/prop-types": "*",
"csstype": "^3.0.2"
}
},
"node_modules/@types/react-dom": {
"version": "17.0.0",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.0.tgz",
"integrity": "sha512-lUqY7OlkF/RbNtD5nIq7ot8NquXrdFrjSOR6+w9a9RFQevGi1oZO1dcJbXMeONAPKtZ2UrZOEJ5UOCVsxbLk/g==",
"dev": true,
"dependencies": {
"@types/react": "*"
}
},
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
},
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/csstype": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.6.tgz",
"integrity": "sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw==",
"dev": true
},
"node_modules/esbuild": {
"version": "0.8.32",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.8.32.tgz",
"integrity": "sha512-5IzQapMW/wFy5oxziHCJzawk26K3xeyrIAQPnPN3c0Q84hqRw6IfGDGfGWOdJNw5tAx77yvwqZ4r1QMpo6emJA==",
"dev": true,
"hasInstallScript": true,
"bin": {
"esbuild": "bin/esbuild"
}
},
"node_modules/execa": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz",
"integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==",
"dev": true,
"dependencies": {
"cross-spawn": "^7.0.3",
"get-stream": "^6.0.0",
"human-signals": "^2.1.0",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.1",
"onetime": "^5.1.2",
"signal-exit": "^3.0.3",
"strip-final-newline": "^2.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sindresorhus/execa?sponsor=1"
}
},
"node_modules/fsevents": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.1.tgz",
"integrity": "sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/get-stream": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz",
"integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==",
"dev": true,
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/human-signals": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
"integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
"dev": true,
"engines": {
"node": ">=10.17.0"
}
},
"node_modules/is-docker": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz",
"integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==",
"dev": true,
"bin": {
"is-docker": "cli.js"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
"integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/is-wsl": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
"dev": true,
"dependencies": {
"is-docker": "^2.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true
},
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"node_modules/js-yaml": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz",
"integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==",
"dependencies": {
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"dependencies": {
"js-tokens": "^3.0.0 || ^4.0.0"
},
"bin": {
"loose-envify": "cli.js"
}
},
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
"dev": true
},
"node_modules/mimic-fn": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
"dev": true,
"engines": {
"node": ">=6"
}
},
"node_modules/npm-run-path": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
"integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
"dev": true,
"dependencies": {
"path-key": "^3.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/onetime": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
"integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
"dev": true,
"dependencies": {
"mimic-fn": "^2.1.0"
},
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/open": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/open/-/open-7.3.1.tgz",
"integrity": "sha512-f2wt9DCBKKjlFbjzGb8MOAW8LH8F0mrs1zc7KTjAJ9PZNQbfenzWbNP1VZJvw6ICMG9r14Ah6yfwPn7T7i646A==",
"dev": true,
"dependencies": {
"is-docker": "^2.0.0",
"is-wsl": "^2.1.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/react": {
"version": "17.0.1",
"resolved": "https://registry.npmjs.org/react/-/react-17.0.1.tgz",
"integrity": "sha512-lG9c9UuMHdcAexXtigOZLX8exLWkW0Ku29qPRU8uhF2R9BN96dLCt0psvzPLlHc5OWkgymP3qwTRgbnw5BKx3w==",
"dependencies": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/react-dom": {
"version": "17.0.1",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.1.tgz",
"integrity": "sha512-6eV150oJZ9U2t9svnsspTMrWNyHc6chX0KzDeAOXftRa8bNeOKTTfCJ7KorIwenkHd2xqVTBTCZd79yk/lx/Ug==",
"dependencies": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"scheduler": "^0.20.1"
},
"peerDependencies": {
"react": "17.0.1"
}
},
"node_modules/rollup": {
"version": "2.36.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.36.2.tgz",
"integrity": "sha512-qjjiuJKb+/8n0EZyQYVW+gFU4bNRBcZaXVzUgSVrGw0HlQBlK2aWyaOMMs1Ufic1jV69b9kW3u3i9B+hISDm3A==",
"dev": true,
"bin": {
"rollup": "dist/bin/rollup"
},
"engines": {
"node": ">=10.0.0"
},
"optionalDependencies": {
"fsevents": "~2.1.2"
}
},
"node_modules/rollup/node_modules/fsevents": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
"deprecated": "\"Please update to latest v2.3 or v2.2\"",
"dev": true,
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/scheduler": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.1.tgz",
"integrity": "sha512-LKTe+2xNJBNxu/QhHvDR14wUXHRQbVY5ZOYpOGWRzhydZUqrLb2JBvLPY7cAqFmqrWuDED0Mjk7013SZiOz6Bw==",
"dependencies": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
}
},
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"dependencies": {
"shebang-regex": "^3.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
"dev": true
},
"node_modules/snowpack": {
"version": "3.0.11",
"resolved": "https://registry.npmjs.org/snowpack/-/snowpack-3.0.11.tgz",
"integrity": "sha512-lBxgkvWTgdg0szE31JUt01wQkA9Lnmm+6lxqeV9rxDfflpx7ASnldVHFvu7Se70QJmPTQB0UJjfKI+xmYGwiiQ==",
"dev": true,
"dependencies": {
"esbuild": "^0.8.7",
"open": "^7.0.4",
"rollup": "^2.34.0"
},
"bin": {
"snowpack": "index.bin.js",
"sp": "index.bin.js"
},
"engines": {
"node": ">=10.19.0"
},
"optionalDependencies": {
"fsevents": "^2.2.0"
}
},
"node_modules/strip-final-newline": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
"dev": true,
"engines": {
"node": ">=6"
}
},
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"node-which": "bin/node-which"
},
"engines": {
"node": ">= 8"
}
}
},
"dependencies": {
"@snowpack/plugin-typescript": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@snowpack/plugin-typescript/-/plugin-typescript-1.2.1.tgz",
"integrity": "sha512-wU+JNaMVkqGsqTaUY7TnEMhGt/3URTgA9dpMCtZX6wn/ceA7Gwlmue/sOLynf0OTNLygHPvjiQECQYkEi3LTtg==",
"dev": true,
"requires": {
"execa": "^5.0.0",
"npm-run-path": "^4.0.1"
}
},
"@types/node": {
"version": "14.14.21",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.21.tgz",
"integrity": "sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A==",
"dev": true
},
"@types/prop-types": {
"version": "15.7.3",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==",
"dev": true
},
"@types/react": {
"version": "17.0.0",
"resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.0.tgz",
"integrity": "sha512-aj/L7RIMsRlWML3YB6KZiXB3fV2t41+5RBGYF8z+tAKU43Px8C3cYUZsDvf1/+Bm4FK21QWBrDutu8ZJ/70qOw==",
"dev": true,
"requires": {
"@types/prop-types": "*",
"csstype": "^3.0.2"
}
},
"@types/react-dom": {
"version": "17.0.0",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.0.tgz",
"integrity": "sha512-lUqY7OlkF/RbNtD5nIq7ot8NquXrdFrjSOR6+w9a9RFQevGi1oZO1dcJbXMeONAPKtZ2UrZOEJ5UOCVsxbLk/g==",
"dev": true,
"requires": {
"@types/react": "*"
}
},
"argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
},
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
}
},
"csstype": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.6.tgz",
"integrity": "sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw==",
"dev": true
},
"esbuild": {
"version": "0.8.32",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.8.32.tgz",
"integrity": "sha512-5IzQapMW/wFy5oxziHCJzawk26K3xeyrIAQPnPN3c0Q84hqRw6IfGDGfGWOdJNw5tAx77yvwqZ4r1QMpo6emJA==",
"dev": true
},
"execa": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz",
"integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.3",
"get-stream": "^6.0.0",
"human-signals": "^2.1.0",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.1",
"onetime": "^5.1.2",
"signal-exit": "^3.0.3",
"strip-final-newline": "^2.0.0"
}
},
"fsevents": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.1.tgz",
"integrity": "sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw==",
"dev": true,
"optional": true
},
"get-stream": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz",
"integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==",
"dev": true
},
"human-signals": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
"integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
"dev": true
},
"is-docker": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz",
"integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==",
"dev": true
},
"is-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
"integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
"dev": true
},
"is-wsl": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
"dev": true,
"requires": {
"is-docker": "^2.0.0"
}
},
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"js-yaml": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz",
"integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==",
"requires": {
"argparse": "^2.0.1"
}
},
"loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"requires": {
"js-tokens": "^3.0.0 || ^4.0.0"
}
},
"merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
"dev": true
},
"mimic-fn": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
"dev": true
},
"npm-run-path": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
"integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
"dev": true,
"requires": {
"path-key": "^3.0.0"
}
},
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"onetime": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
"integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
"dev": true,
"requires": {
"mimic-fn": "^2.1.0"
}
},
"open": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/open/-/open-7.3.1.tgz",
"integrity": "sha512-f2wt9DCBKKjlFbjzGb8MOAW8LH8F0mrs1zc7KTjAJ9PZNQbfenzWbNP1VZJvw6ICMG9r14Ah6yfwPn7T7i646A==",
"dev": true,
"requires": {
"is-docker": "^2.0.0",
"is-wsl": "^2.1.1"
}
},
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true
},
"react": {
"version": "17.0.1",
"resolved": "https://registry.npmjs.org/react/-/react-17.0.1.tgz",
"integrity": "sha512-lG9c9UuMHdcAexXtigOZLX8exLWkW0Ku29qPRU8uhF2R9BN96dLCt0psvzPLlHc5OWkgymP3qwTRgbnw5BKx3w==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
}
},
"react-dom": {
"version": "17.0.1",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.1.tgz",
"integrity": "sha512-6eV150oJZ9U2t9svnsspTMrWNyHc6chX0KzDeAOXftRa8bNeOKTTfCJ7KorIwenkHd2xqVTBTCZd79yk/lx/Ug==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"scheduler": "^0.20.1"
}
},
"rollup": {
"version": "2.36.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.36.2.tgz",
"integrity": "sha512-qjjiuJKb+/8n0EZyQYVW+gFU4bNRBcZaXVzUgSVrGw0HlQBlK2aWyaOMMs1Ufic1jV69b9kW3u3i9B+hISDm3A==",
"dev": true,
"requires": {
"fsevents": "~2.1.2"
},
"dependencies": {
"fsevents": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
"dev": true,
"optional": true
}
}
},
"scheduler": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.1.tgz",
"integrity": "sha512-LKTe+2xNJBNxu/QhHvDR14wUXHRQbVY5ZOYpOGWRzhydZUqrLb2JBvLPY7cAqFmqrWuDED0Mjk7013SZiOz6Bw==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
}
},
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"requires": {
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
"dev": true
},
"snowpack": {
"version": "3.0.11",
"resolved": "https://registry.npmjs.org/snowpack/-/snowpack-3.0.11.tgz",
"integrity": "sha512-lBxgkvWTgdg0szE31JUt01wQkA9Lnmm+6lxqeV9rxDfflpx7ASnldVHFvu7Se70QJmPTQB0UJjfKI+xmYGwiiQ==",
"dev": true,
"requires": {
"esbuild": "^0.8.7",
"fsevents": "^2.2.0",
"open": "^7.0.4",
"rollup": "^2.34.0"
}
},
"strip-final-newline": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
"dev": true
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
}
}
}

View file

@ -1,21 +0,0 @@
{
"name": "zeppelin-presetup-configurator",
"private": true,
"scripts": {
"watch": "snowpack dev",
"build": "snowpack build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"@snowpack/plugin-typescript": "^1.2.1",
"@types/node": "^14.14.21",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"snowpack": "^3.0.11"
},
"dependencies": {
"js-yaml": "^4.0.0",
"react": "^17.0.1",
"react-dom": "^17.0.1"
}
}

View file

@ -1,6 +0,0 @@
module.exports = {
mount: {
src: "/",
},
plugins: ["@snowpack/plugin-typescript"],
};

View file

@ -1,8 +0,0 @@
.App {
display: flex;
justify-content: center;
}
.App .wrapper {
flex: 0 1 800px;
}

View file

@ -1,13 +0,0 @@
import React from "react";
import "./App.css";
import { Configurator } from "./Configurator";
export function App() {
return (
<div className="App">
<div className="wrapper">
<Configurator />
</div>
</div>
);
}

View file

@ -1,50 +0,0 @@
.Configurator {
}
.Configurator .options {
display: grid;
grid-auto-columns: min-content auto;
grid-gap: 1px;
overflow: hidden;
border: 1px solid #444;
border-radius: 4px;
background-color: #fff;
}
.Configurator .options > h2 {
grid-column: 1;
margin: 0;
padding: 8px 24px 8px 8px;
white-space: nowrap;
text-align: right;
font-size: 16px;
font-weight: 600;
box-shadow: 0 0 0 1px #444;
}
.Configurator .options > .control {
grid-column: 2;
padding: 8px;
box-shadow: 0 0 0 1px #444;
}
.Configurator label {
display: block;
padding: 0 0 8px;
}
.Configurator .result {
margin-top: 16px;
width: 100%;
background-color: #eee;
padding: 8px;
border: 1px solid #444;
border-radius: 4px;
box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2);
cursor: copy;
}

View file

@ -1,198 +0,0 @@
import yaml from "js-yaml";
import React, { useEffect, useState } from "react";
import "./Configurator.css";
import { LevelEntry, Levels } from "./Levels";
import { LogChannel, LogChannels } from "./LogChannels";
export function Configurator() {
const [prefix, setPrefix] = useState("!");
const [levels, setLevels] = useState<LevelEntry[]>([]);
const [withModCommands, setWithModCommands] = useState(false);
const [muteRoleId, setMuteRoleId] = useState("");
const [caseChannelId, setCaseChannelId] = useState("");
const [dmModActionReasons, setDmModActionReasons] = useState(false);
const [withLogs, setWithLogs] = useState(false);
const [logChannels, setLogChannels] = useState<LogChannel[]>([]);
const [result, setResult] = useState({});
useEffect(() => {
const resultObj: any = {
prefix,
levels: levels.reduce((obj, entry) => {
obj[entry[0]] = entry[1];
return obj;
}, {}),
plugins: {
utility: {},
},
};
if (withModCommands) {
resultObj.plugins.cases = {
config: {
case_log_channel: caseChannelId,
},
};
resultObj.plugins.mod_actions = {};
if (muteRoleId) {
resultObj.plugins.mutes = {
config: {
mute_role: muteRoleId,
},
};
if (dmModActionReasons) {
resultObj.plugins.mutes.config.dm_on_mute = true;
}
}
if (dmModActionReasons) {
resultObj.plugins.mod_actions = {
config: {
dm_on_warn: true,
dm_on_kick: true,
dm_on_ban: true,
},
};
}
}
if (withLogs) {
resultObj.plugins.logs = {
config: {
channels: logChannels.reduce((obj, logChannel) => {
if (logChannel.includeExclude === "include") {
obj[logChannel.id] = {
include: Array.from(logChannel.logTypes.values()),
};
} else {
obj[logChannel.id] = {
exclude: Array.from(logChannel.logTypes.values()),
};
}
return obj;
}, {}),
},
};
}
setResult(resultObj);
}, [prefix, levels, withModCommands, muteRoleId, caseChannelId, dmModActionReasons, withLogs, logChannels]);
const [formattedResult, setFormattedResult] = useState("");
useEffect(() => {
let _formattedResult = yaml.dump(result);
// Add line break before each unquoted top-level or second-level property
_formattedResult = _formattedResult.replace(/^ {0,2}[a-z_]+:/gm, "\n$&").trim();
// Add additional line break at the end
_formattedResult += "\n";
// Explain "exclude: []"
_formattedResult = _formattedResult.replace(/exclude: \[]/, "$& # Exclude nothing = include everything");
setFormattedResult(_formattedResult);
}, [result]);
const resultRows = formattedResult.split("\n").length || 1;
const [copied, setCopied] = useState(false);
function copyResultText(textarea: HTMLTextAreaElement) {
textarea.select();
document.execCommand("copy");
setCopied(true);
}
const [copyResetTimeout, setCopyResetTimeout] = useState<number | null>(null);
useEffect(() => {
if (!copied) {
return;
}
if (copyResetTimeout != null) {
window.clearTimeout(copyResetTimeout);
}
const timeout = window.setTimeout(() => setCopied(false), 3000);
setCopyResetTimeout(timeout);
}, [copied]);
return (
<div className="Configurator">
{/* Options */}
<div className="options">
<h2>Prefix</h2>
<div className="control">
<label>
Bot prefix
<br />
<input value={prefix} onChange={(e) => setPrefix(e.target.value)} />
</label>
</div>
<h2>Levels</h2>
<div className="control">
<Levels levels={levels} setLevels={setLevels} />
</div>
<h2>Mod commands</h2>
<div className="control">
<label>
<input type="checkbox" checked={withModCommands} onChange={(e) => setWithModCommands(e.target.checked)} />
Start with a basic mod command setup
</label>
{withModCommands && (
<div>
<label>
Mute role ID
<br />
<input value={muteRoleId} onChange={(e) => setMuteRoleId(e.target.value)} />
</label>
<label>
Case channel ID
<br />
<input value={caseChannelId} onChange={(e) => setCaseChannelId(e.target.value)} />
</label>
<label>
<input
type="checkbox"
checked={dmModActionReasons}
onChange={(e) => setDmModActionReasons(e.target.checked)}
/>
DM reason with mod actions
</label>
</div>
)}
</div>
<h2>Logs</h2>
<div className="control">
<label>
<input type="checkbox" checked={withLogs} onChange={(e) => setWithLogs(e.target.checked)} />
Start with a basic logging setup
</label>
{withLogs && <LogChannels logChannels={logChannels} setLogChannels={setLogChannels} />}
</div>
</div>
{/* Result */}
<textarea
className="result"
rows={resultRows}
readOnly={true}
value={formattedResult}
onClick={(e) => copyResultText(e.target as HTMLTextAreaElement)}
/>
{copied ? <em>Copied!</em> : <em>Click textarea to copy</em>}
</div>
);
}

View file

@ -1,46 +0,0 @@
import React from "react";
const LEVEL_ADMIN = 100;
const LEVEL_MODERATOR = 50;
export type LevelEntry = [string, number]; // id, level
export function Levels({ levels, setLevels }) {
function addLevel() {
setLevels((arr) => [...arr, ["", LEVEL_MODERATOR]]);
}
function removeLevel(index) {
setLevels((arr) => [...arr].splice(index, 1));
}
function updateLevelId(index, id) {
const validId = id.replace(/[^0-9]/g, "");
setLevels((arr) => {
arr[index][0] = validId;
return [...arr];
});
}
function updateLevelLevel(index, level) {
setLevels((arr) => {
arr[index][1] = parseInt(level, 10);
return [...arr];
});
}
return (
<div>
{levels.map(([id, level], index) => (
<div key={index}>
<input value={id} onChange={(e) => updateLevelId(index, e.target.value)} />
<select value={level} onChange={(e) => updateLevelLevel(index, e.target.value)}>
<option value={LEVEL_ADMIN}>Admin</option>
<option value={LEVEL_MODERATOR}>Moderator</option>
</select>
</div>
))}
<button onClick={addLevel}>Add</button>
</div>
);
}

View file

@ -1,12 +0,0 @@
.LogChannels .log-channel {
margin: 16px 0;
}
.LogChannels .log-types {
height: 200px;
overflow-y: scroll;
border: 1px solid #aaa;
border-radius: 3px;
padding: 4px;
margin-top: 8px;
}

View file

@ -1,191 +0,0 @@
import React, { SetStateAction } from "react";
import "./LogChannels.css";
const LOG_TYPES = {
MEMBER_WARN: "Member warned",
MEMBER_MUTE: "Member muted",
MEMBER_UNMUTE: "Member unmuted",
MEMBER_MUTE_EXPIRED: "Mute expired",
MEMBER_KICK: "Member kicked",
MEMBER_BAN: "Member banned",
MEMBER_UNBAN: "Member unbanned",
MEMBER_FORCEBAN: "Member forcebanned",
MEMBER_SOFTBAN: "Member softbanned",
MEMBER_JOIN: "Member joined",
MEMBER_LEAVE: "Member left",
MEMBER_ROLE_ADD: "Member, role added",
MEMBER_ROLE_REMOVE: "Member, role removed",
MEMBER_NICK_CHANGE: "Member nickname changed",
MEMBER_USERNAME_CHANGE: "Member username changed",
MEMBER_RESTORE: "Member roles restored",
CHANNEL_CREATE: "Channel created",
CHANNEL_DELETE: "Channel deleted",
CHANNEL_UPDATE: "Channel updated",
THREAD_CREATE: "Thread created",
THREAD_DELETE: "Thread deleted",
THREAD_UPDATE: "Thread updated",
ROLE_CREATE: "Role created",
ROLE_DELETE: "Role deleted",
ROLE_UPDATE: "Role updated",
MESSAGE_EDIT: "Message edited",
MESSAGE_DELETE: "Message deleted",
MESSAGE_DELETE_BULK: "Messages deleted in bulk",
MESSAGE_DELETE_BARE: "Message deleted (bare)",
VOICE_CHANNEL_JOIN: "Voice channel join",
VOICE_CHANNEL_LEAVE: "Voice channel leave",
VOICE_CHANNEL_MOVE: "Voice channel move",
STAGE_INSTANCE_CREATE: "Stage created",
STAGE_INSTANCE_DELETE: "Stage deleted",
STAGE_INSTANCE_UPDATE: "Stage updated",
EMOJI_CREATE: "Emoji created",
EMOJI_DELETE: "Emoji deleted",
EMOJI_UPDATE: "Emoji updated",
STICKER_CREATE: "Sticker created",
STICKER_DELETE: "Sticker deleted",
STICKER_UPDATE: "Sticker updated",
COMMAND: "Command used",
MESSAGE_SPAM_DETECTED: "Message spam detected",
CENSOR: "Message censored",
CLEAN: "Messages cleaned",
CASE_CREATE: "Case created",
MASSBAN: "Massbanned",
MASSMUTE: "Massmuted",
MEMBER_TIMED_MUTE: "Member temporarily muted",
MEMBER_TIMED_UNMUTE: "Member, scheduled unmute",
MEMBER_JOIN_WITH_PRIOR_RECORDS: "Member joined with prior records",
OTHER_SPAM_DETECTED: "Non-message spam detected",
MEMBER_ROLE_CHANGES: "Member roles changed",
VOICE_CHANNEL_FORCE_MOVE: "Force-moved to a voice channel",
CASE_UPDATE: "Case updated",
MEMBER_MUTE_REJOIN: "Muted member rejoined",
SCHEDULED_MESSAGE: "Scheduled message to be posted",
POSTED_SCHEDULED_MESSAGE: "Posted scheduled message",
BOT_ALERT: "Bot alert",
AUTOMOD_ACTION: "Automod action",
SCHEDULED_REPEATED_MESSAGE: "Scheduled message to be posted repeatedly",
REPEATED_MESSAGE: "Set a message to be posted repeatedly",
MESSAGE_DELETE_AUTO: "Message deleted (auto)",
SET_ANTIRAID_USER: "Set antiraid (user)",
SET_ANTIRAID_AUTO: "Set antiraid (auto)",
MEMBER_NOTE: "Member noted",
CASE_DELETE: "Case deleted",
DM_FAILED: "Failed to DM member",
};
const sortedLogTypes = Object.fromEntries(
Object.entries(LOG_TYPES).sort((a, b) => {
if (a[1].toLowerCase() > b[1].toLowerCase()) return 1;
if (a[1].toLowerCase() < b[1].toLowerCase()) return -1;
if (a[0].toLowerCase() > b[0].toLowerCase()) return 1;
if (a[0].toLowerCase() < b[0].toLowerCase()) return -1;
return 0;
}),
) as typeof LOG_TYPES;
type LOG_TYPE = keyof typeof LOG_TYPES;
export interface LogChannel {
id: string;
includeExclude: "include" | "exclude";
logTypes: Set<LOG_TYPE>;
}
interface Props {
logChannels: LogChannel[];
setLogChannels: React.Dispatch<SetStateAction<LogChannel[]>>;
}
export function LogChannels({ logChannels, setLogChannels }: Props) {
function addLogChannel(props: Partial<LogChannel> = {}) {
setLogChannels((_logChannels) => {
return [
..._logChannels,
{
id: "",
includeExclude: "include",
logTypes: new Set(),
...props,
},
];
});
}
function deleteLogChannel(index) {
setLogChannels((_logChannels) => {
const newArr = [..._logChannels];
newArr.splice(index, 1);
return newArr;
});
}
function addReverseLogChannel() {
const includedLogTypesInOtherLogChannels = new Set(logChannels.map((l) => Array.from(l.logTypes)).flat());
addLogChannel({
includeExclude: "exclude",
logTypes: includedLogTypesInOtherLogChannels,
});
}
function setId(index: number, id: string) {
setLogChannels((_logChannels) => {
_logChannels[index].id = id;
return [..._logChannels];
});
}
function setIncludeExclude(index: number, includeExclude: LogChannel["includeExclude"]) {
setLogChannels((_logChannels) => {
_logChannels[index].includeExclude = includeExclude;
return [..._logChannels];
});
}
function toggleLogType(index: number, logType: LOG_TYPE, enabled: boolean) {
setLogChannels((_logChannels) => {
if (enabled) {
_logChannels[index].logTypes.add(logType);
} else {
_logChannels[index].logTypes.delete(logType);
}
return [..._logChannels];
});
}
return (
<div className="LogChannels">
{logChannels.map((logChannel, index) => (
<div className="log-channel">
<label>
ID: <input value={logChannel.id} onChange={(e) => setId(index, e.target.value)} />
</label>
<label>
Mode:
<select
value={logChannel.includeExclude}
onChange={(e) => setIncludeExclude(index, e.target.value as LogChannel["includeExclude"])}
>
<option value={"include"}>Include</option>
<option value={"exclude"}>Exclude</option>
</select>
</label>
<div className="log-types">
{Object.entries(sortedLogTypes).map(([logType, description]) => (
<label>
<input
type="checkbox"
checked={logChannel.logTypes.has(logType as LOG_TYPE)}
onChange={(e) => toggleLogType(index, logType as LOG_TYPE, e.target.checked)}
/>
{description}
</label>
))}
</div>
<button onClick={() => deleteLogChannel(index)}>Delete</button>
</div>
))}
<button onClick={() => addLogChannel()}>Add</button>
<button onClick={() => addReverseLogChannel()}>Add "everything else"</button>
</div>
);
}

View file

@ -1,14 +0,0 @@
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
font-family: Arial, sans-serif;
}
body {
background-color: #f8f8f8;
color: #222;
}

View file

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="./index.js"></script>
</body>
</html>

View file

@ -1,15 +0,0 @@
import React from "react";
import ReactDOM from "react-dom";
import { App } from "./App";
import "./index.css";
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root"),
);
if ((import.meta as any).hot) {
(import.meta as any).hot.accept();
}

View file

@ -1,21 +0,0 @@
{
"compilerOptions": {
"moduleResolution": "node",
"module": "esnext",
"target": "es2018",
"sourceMap": true,
"noImplicitAny": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"alwaysStrict": true,
"noImplicitThis": true,
"strictPropertyInitialization": false,
"lib": ["esnext", "dom"],
"baseUrl": ".",
"resolveJsonModule": true,
"esModuleInterop": true,
"allowJs": true,
"jsx": "react",
"skipLibCheck": true
}
}

22
revampdashboard/.gitignore vendored Normal file
View file

@ -0,0 +1,22 @@
test-results
node_modules
# Output
.output
.vercel
/.svelte-kit
/build
# OS
.DS_Store
Thumbs.db
# Env
.env
.env.*
!.env.example
!.env.test
# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

1
revampdashboard/.npmrc Normal file
View file

@ -0,0 +1 @@
engine-strict=true

38
revampdashboard/README.md Normal file
View file

@ -0,0 +1,38 @@
# sv
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npx sv create
# create a new project in my-app
npx sv create my-app
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.

View file

@ -0,0 +1,6 @@
import { expect, test } from "@playwright/test";
test("home page has expected h1", async ({ page }) => {
await page.goto("/");
await expect(page.locator("h1")).toBeVisible();
});

View file

@ -0,0 +1,32 @@
{
"name": "revampdashboard",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig tsconfig.json --watch",
"test:e2e": "playwright test",
"test": "npm run test:e2e && npm run test:unit -- --run",
"test:unit": "vitest"
},
"devDependencies": {
"@playwright/test": "^1.45.3",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-node": "^5.2.9",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"autoprefixer": "^10.4.20",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.9",
"typescript": "^5.0.0",
"vite": "^5.0.3",
"vitest": "^2.0.4"
},
"dependencies": {
"dotenv": "^16.4.5"
}
}

View file

@ -0,0 +1,10 @@
import { defineConfig } from "@playwright/test";
export default defineConfig({
webServer: {
command: "npm run build && npm run preview",
port: 4173,
},
testDir: "e2e",
});

View file

@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};

View file

@ -0,0 +1,3 @@
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities'

13
revampdashboard/src/app.d.ts vendored Normal file
View file

@ -0,0 +1,13 @@
// See https://svelte.dev/docs/kit/types#app.d.ts
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}
export {};

View file

@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View file

@ -0,0 +1,7 @@
import { describe, it, expect } from "vitest";
describe("sum test", () => {
it("adds 1 + 2 to equal 3", () => {
expect(1 + 2).toBe(3);
});
});

View file

@ -0,0 +1 @@
// place files you want to import through the `$lib` alias in this folder.

View file

@ -0,0 +1,6 @@
<script lang="ts">
import '../app.css';
let { children } = $props();
</script>
{@render children()}

View file

@ -0,0 +1,2 @@
<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,18 @@
import adapter from '@sveltejs/adapter-node';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter()
}
};
export default config;

View file

@ -0,0 +1,11 @@
import type { Config } from "tailwindcss";
export default {
content: ["./src/**/*.{html,js,svelte,ts}"],
theme: {
extend: {},
},
plugins: [],
} satisfies Config;

View file

@ -0,0 +1,19 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler"
}
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}

View file

@ -0,0 +1,11 @@
import { defineConfig } from "vitest/config";
import { sveltekit } from "@sveltejs/kit/vite";
export default defineConfig({
plugins: [sveltekit()],
test: {
include: ["src/**/*.{test,spec}.{js,ts}"],
},
envDir: "..",
});