├── .env.example ├── .eslintrc.json ├── .gitattributes ├── .github └── FUNDING.yml ├── .gitignore ├── .node-version ├── .prettierignore ├── LICENSE ├── README.md ├── components.json ├── css └── globals.css ├── messages ├── de.json ├── en.json └── nl.json ├── next.config.ts ├── open-next.config.ts ├── package.json ├── pnpm-lock.yaml ├── postcss.config.mjs ├── public ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon.png ├── favicon-16x16.png ├── favicon-32x32.png ├── humans.txt ├── images │ └── bg.jpg ├── logos │ └── logo.svg └── site.webmanifest ├── sentry.edge.config.ts ├── sentry.server.config.ts ├── src ├── app │ ├── [locale] │ │ ├── (auth) │ │ │ ├── layout.tsx │ │ │ ├── logout │ │ │ │ └── page.tsx │ │ │ ├── page.client.tsx │ │ │ └── page.tsx │ │ └── (dashboard) │ │ │ ├── dashboard │ │ │ ├── groups │ │ │ │ ├── [groupId] │ │ │ │ │ ├── page.client.tsx │ │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ ├── modules │ │ │ │ ├── [moduleId] │ │ │ │ │ ├── page.client.tsx │ │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ ├── nodes │ │ │ │ ├── [nodeId] │ │ │ │ │ ├── page.client.tsx │ │ │ │ │ └── page.tsx │ │ │ │ ├── console │ │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ ├── page.tsx │ │ │ ├── players │ │ │ │ ├── [playerId] │ │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ ├── services │ │ │ │ ├── [serviceId] │ │ │ │ │ ├── page.client.tsx │ │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ ├── tasks │ │ │ │ ├── [taskId] │ │ │ │ │ ├── page.client.tsx │ │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ ├── templates │ │ │ │ ├── [storageId] │ │ │ │ │ ├── [storagePrefix] │ │ │ │ │ │ ├── [templateId] │ │ │ │ │ │ │ ├── [...fileId] │ │ │ │ │ │ │ │ └── page.tsx │ │ │ │ │ │ │ └── page.tsx │ │ │ │ │ │ └── page.tsx │ │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ └── users │ │ │ │ ├── [userId] │ │ │ │ ├── options.ts │ │ │ │ ├── page.client.tsx │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ └── layout.tsx │ ├── api │ │ ├── auth │ │ │ ├── getCookies │ │ │ │ └── route.ts │ │ │ ├── getPermissions │ │ │ │ └── route.ts │ │ │ ├── getUser │ │ │ │ └── route.ts │ │ │ ├── jwt │ │ │ │ └── route.ts │ │ │ ├── logout │ │ │ │ └── route.ts │ │ │ ├── signin │ │ │ │ └── route.tsx │ │ │ └── ticket │ │ │ │ └── route.ts │ │ ├── group │ │ │ ├── [id] │ │ │ │ ├── delete │ │ │ │ │ └── route.ts │ │ │ │ └── get │ │ │ │ │ └── route.ts │ │ │ ├── list │ │ │ │ └── route.ts │ │ │ └── update │ │ │ │ └── route.ts │ │ ├── module │ │ │ ├── [id] │ │ │ │ ├── getConfig │ │ │ │ │ └── route.ts │ │ │ │ ├── getInfo │ │ │ │ │ └── route.ts │ │ │ │ ├── lifecycle │ │ │ │ │ └── route.ts │ │ │ │ ├── uninstall │ │ │ │ │ └── route.ts │ │ │ │ ├── unload │ │ │ │ │ └── route.ts │ │ │ │ └── update │ │ │ │ │ └── route.ts │ │ │ ├── available │ │ │ │ └── route.ts │ │ │ ├── loaded │ │ │ │ └── route.ts │ │ │ ├── present │ │ │ │ └── route.ts │ │ │ └── reload │ │ │ │ └── route.ts │ │ ├── node │ │ │ ├── [id] │ │ │ │ ├── get │ │ │ │ │ └── route.ts │ │ │ │ └── update │ │ │ │ │ └── route.ts │ │ │ └── list │ │ │ │ └── route.ts │ │ ├── player │ │ │ ├── [id] │ │ │ │ ├── command │ │ │ │ │ └── route.ts │ │ │ │ ├── connect │ │ │ │ │ └── route.ts │ │ │ │ ├── connectFallback │ │ │ │ │ └── route.ts │ │ │ │ ├── connectService │ │ │ │ │ └── route.ts │ │ │ │ ├── kick │ │ │ │ │ └── route.ts │ │ │ │ └── message │ │ │ │ │ └── route.ts │ │ │ └── online │ │ │ │ ├── amount │ │ │ │ └── route.ts │ │ │ │ └── route.ts │ │ ├── service │ │ │ ├── [id] │ │ │ │ ├── command │ │ │ │ │ └── route.ts │ │ │ │ ├── delete │ │ │ │ │ └── route.ts │ │ │ │ ├── get │ │ │ │ │ └── route.ts │ │ │ │ ├── lifecycle │ │ │ │ │ └── route.ts │ │ │ │ └── logLines │ │ │ │ │ └── route.ts │ │ │ └── list │ │ │ │ └── route.ts │ │ ├── task │ │ │ ├── [id] │ │ │ │ ├── delete │ │ │ │ │ └── route.ts │ │ │ │ └── get │ │ │ │ │ └── route.ts │ │ │ ├── list │ │ │ │ └── route.ts │ │ │ └── update │ │ │ │ └── route.ts │ │ ├── templateStorage │ │ │ └── list │ │ │ │ ├── route.ts │ │ │ │ └── templates │ │ │ │ └── route.ts │ │ ├── templates │ │ │ └── [storageId] │ │ │ │ └── [prefixId] │ │ │ │ └── [name] │ │ │ │ ├── delete │ │ │ │ └── route.ts │ │ │ │ ├── directory │ │ │ │ └── list │ │ │ │ │ └── route.ts │ │ │ │ └── file │ │ │ │ ├── delete │ │ │ │ └── route.ts │ │ │ │ ├── get │ │ │ │ └── route.ts │ │ │ │ └── update │ │ │ │ └── route.ts │ │ └── user │ │ │ ├── [id] │ │ │ ├── delete │ │ │ │ └── route.ts │ │ │ ├── get │ │ │ │ └── route.ts │ │ │ └── update │ │ │ │ └── route.ts │ │ │ ├── create │ │ │ └── route.ts │ │ │ └── list │ │ │ └── route.ts │ ├── error.tsx │ ├── favicon.ico │ ├── global-error.tsx │ ├── layout.tsx │ ├── loading.tsx │ ├── not-found.tsx │ └── robots.ts ├── components │ ├── Pagination.tsx │ ├── ThemeToggle.tsx │ ├── autoRefresh.tsx │ ├── checkAuth.tsx │ ├── console.tsx │ ├── dashboardCard.tsx │ ├── fields │ │ ├── CheckboxField.tsx │ │ ├── ComboboxField.tsx │ │ ├── CommandSelectField.tsx │ │ ├── InputField.tsx │ │ ├── InputFieldNoForm.tsx │ │ ├── MultiSelectField.tsx │ │ ├── NumberField.tsx │ │ ├── SelectField.tsx │ │ ├── TagsInputField.tsx │ │ └── TextareaField.tsx │ ├── formatBytes.ts │ ├── formatDate.ts │ ├── header │ │ ├── data.tsx │ │ ├── header-nav.tsx │ │ ├── header-resizable.tsx │ │ ├── header-server.tsx │ │ └── mobile-nav.tsx │ ├── modules │ │ ├── groups │ │ │ └── createGroup.tsx │ │ ├── players │ │ │ ├── executeCommand.tsx │ │ │ ├── kickPlayer.tsx │ │ │ ├── sendChatMessage.tsx │ │ │ └── sendToService.tsx │ │ └── users │ │ │ └── createUser.tsx │ ├── pageLayout.tsx │ ├── refresh.tsx │ ├── static │ │ ├── doesNotExist.tsx │ │ ├── maintenance.tsx │ │ ├── noAccess.tsx │ │ └── noRecords.tsx │ ├── system │ │ └── changeLanguage.tsx │ ├── templates │ │ ├── fileBrowser.tsx │ │ └── fileEditor.tsx │ └── ui │ │ ├── accordion.tsx │ │ ├── alert-dialog.tsx │ │ ├── alert.tsx │ │ ├── aspect-ratio.tsx │ │ ├── avatar.tsx │ │ ├── badge.tsx │ │ ├── breadcrumb.tsx │ │ ├── button.tsx │ │ ├── calendar.tsx │ │ ├── card.tsx │ │ ├── carousel.tsx │ │ ├── checkbox.tsx │ │ ├── collapsible.tsx │ │ ├── command.tsx │ │ ├── context-menu.tsx │ │ ├── custom │ │ ├── image-upload.tsx │ │ └── multi-select.tsx │ │ ├── dialog.tsx │ │ ├── drawer.tsx │ │ ├── dropdown-menu.tsx │ │ ├── form.tsx │ │ ├── hover-card.tsx │ │ ├── input-otp.tsx │ │ ├── input.tsx │ │ ├── label.tsx │ │ ├── menubar.tsx │ │ ├── navigation-menu.tsx │ │ ├── pagination.tsx │ │ ├── popover.tsx │ │ ├── progress.tsx │ │ ├── radio-group.tsx │ │ ├── resizable.tsx │ │ ├── scroll-area.tsx │ │ ├── select.tsx │ │ ├── separator.tsx │ │ ├── sheet.tsx │ │ ├── skeleton.tsx │ │ ├── slider.tsx │ │ ├── switch.tsx │ │ ├── table.tsx │ │ ├── tabs.tsx │ │ ├── textarea.tsx │ │ ├── toast.tsx │ │ ├── toaster.tsx │ │ ├── toggle-group.tsx │ │ ├── toggle.tsx │ │ ├── tooltip.tsx │ │ └── use-toast.ts ├── instrumentation-client.ts ├── instrumentation.ts ├── lib │ ├── api-helpers.ts │ ├── client-api.ts │ ├── server-api.ts │ ├── server-calls.ts │ └── utils.ts ├── loadDictionary.ts ├── middleware.tsx └── utils │ ├── revalidatePathAction.ts │ ├── server-api │ └── getPermissions.ts │ └── types │ ├── groups.ts │ ├── modules.ts │ ├── nodes.ts │ ├── players.ts │ ├── services.ts │ ├── tasks.ts │ ├── templateStorages.ts │ ├── templates.ts │ ├── user │ └── permissions.ts │ └── users.ts ├── tailwind.config.ts ├── tsconfig.json └── wrangler.jsonc /.env.example: -------------------------------------------------------------------------------- 1 | ## Customization 2 | NEXT_PUBLIC_LOGO_PATH='/logos/logo.svg' 3 | NEXT_PUBLIC_NAME=CloudNet 4 | 5 | ## Self-hosted domain name 6 | NEXT_PUBLIC_DOMAIN=http://localhost:3000 7 | 8 | ## Cloudnet server address 9 | NEXT_PUBLIC_CLOUDNET_ADDRESS= 10 | ## Hide the Cloudnet server address from input fields 11 | NEXT_PUBLIC_CLOUDNET_ADDRESS_HIDDEN=false 12 | 13 | # Use Sentry 14 | SENTRY_URL= 15 | SENTRY_ORG= 16 | SENTRY_PROJECT= 17 | SENTRY_DSN= 18 | SENTRY_ENABLED=false 19 | SENTRY_AUTH_TOKEN= 20 | SENTRY_SPOTLIGHT=false 21 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Normalize as LF in the repository, OS native locally 2 | * text eol=lf 3 | 4 | # These are explicitly windows files and should use crlf 5 | *.bat text eol=crlf 6 | 7 | *.html text diff=html 8 | 9 | # These files are binary and should be left untouched 10 | # (binary is a macro for -text -diff) 11 | *.a binary 12 | *.lib binary 13 | *.icns binary 14 | *.png binary 15 | *.jpg binary 16 | *.jpeg binary 17 | *.gif binary 18 | *.ico binary 19 | *.mov binary 20 | *.mp4 binary 21 | *.mp3 binary 22 | *.flv binary 23 | *.fla binary 24 | *.swf binary 25 | *.gz binary 26 | *.zip binary 27 | *.jar binary 28 | *.tar binary 29 | *.tar.gz binary 30 | *.7z binary 31 | *.ttf binary 32 | *.pyc binary 33 | *.gpg binary 34 | *.bin binary 35 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: fayevr 2 | github: docimin 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # local env files 28 | .env*.local 29 | .env 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | 38 | # IDEA Jetbrains 39 | .idea 40 | 41 | # Cloudflare Wrangler 42 | .wrangler 43 | 44 | # Sentry Config File 45 | .sentryclirc 46 | 47 | # VSCode 48 | .vscode 49 | 50 | # Open-Next 51 | .open-next 52 | -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 20.18.0 -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | src/components/ui 2 | .github 3 | .next 4 | node_modules 5 | .dockerignore 6 | Dockerfile 7 | package.json 8 | package-lock.json 9 | pnpm-lock.yaml 10 | .open-next -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 CloudNet & Faye 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cloudnet Webinterface 2 | 3 |

4 | CloudNet is a modern application that can dynamically and easily deliver Minecraft oriented software. 5 |

6 | 7 | # Supported Versions 8 | 9 | The current supported cloudnet versions. If your version is not supported, please upgrade to the newest one. 10 | 11 | | Version | Supported | 12 | | ------- | ------------------ | 13 | | RC-11 | :white_check_mark: | 14 | | RC-10 | :x: | 15 | 16 | ## My dashboard is empty 17 | 18 | You forgot to give yourself permissions. Create a user by following these simple steps: 19 | 20 | 1. Install the "CloudNet-Rest" module using `modules install CloudNet-Rest` in your CloudNet console. 21 | 2. Create a new user with the `rest user create ` command in your CloudNet console. (Example: `rest user create notch foobar`, will create user "notch" with password "foobar") 22 | 3. Assign the required permissions using `rest user add scope global:admin` in your CloudNet console. (Example: `rest user notch add scope global:admin` will grant user "notch" admin permissions on your web interface) 23 | 4. If the webinterface is started, log in with the username and password you just created. 24 | 25 | ## Getting Started 26 | 27 | Make sure you have pnpm installed using: 28 | 29 | ```bash 30 | npm i -g pnpm 31 | ``` 32 | 33 | First, install the packages using: 34 | 35 | ```bash 36 | pnpm install 37 | ``` 38 | 39 | To start the server, use the following command: 40 | 41 | ```bash 42 | pnpm run dev 43 | ``` 44 | 45 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 46 | 47 | ## .env 48 | 49 | Want to host the website yourself? 50 | 51 | Copy .env.example to .env and change `NEXT_PUBLIC_DOMAIN` to your own domain (including http or https). 52 | 53 | ## Pre-fill CloudNet address 54 | 55 | So you want to fill in your user/pass without the address every single time? 56 | 57 | Fill in `NEXT_PUBLIC_CLOUDNET_ADDRESS` in your .env file, like for example: `NEXT_PUBLIC_CLOUDNET_ADDRESS=127.0.0.1:2812`, this will autofill it for you. 58 | 59 | If you want to use a domain: `NEXT_PUBLIC_CLOUDNET_ADDRESS=https://cloudnet.example.com`. 60 | 61 | ## Bugs may occur! 62 | 63 | Meaning if you encounter any issues, please open up an issue. You are welcome to contribute to this project and create a PR. 64 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "css/globals.css", 9 | "baseColor": "slate", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /css/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer base { 6 | :root { 7 | --background: 0 0% 100%; 8 | --foreground: 240 10% 3.9%; 9 | --muted: 240 4.8% 95.9%; 10 | --muted-foreground: 240 3.8% 46.1%; 11 | --popover: 0 0% 100%; 12 | --popover-foreground: 240 10% 3.9%; 13 | --card: 0 0% 100%; 14 | --card-foreground: 240 10% 3.9%; 15 | --border: 240 5.9% 90%; 16 | --input: 240 5.9% 90%; 17 | --primary: 240 5.9% 10%; 18 | --primary-foreground: 0 0% 98%; 19 | --secondary: 240 4.8% 95.9%; 20 | --secondary-foreground: 240 5.9% 10%; 21 | --accent: 240 4.8% 95.9%; 22 | --accent-foreground: 240 5.9% 10%; 23 | --destructive: 0 84.2% 60.2%; 24 | --destructive-foreground: 0 0% 98%; 25 | --ring: 240 5.9% 10%; 26 | --radius: 0.5rem; 27 | --success: 160 100% 25%; 28 | --loading: 240 3.7% 40.9%; 29 | } 30 | 31 | .dark { 32 | --background: 230 43% 3%; 33 | --foreground: 0 0% 98%; 34 | --muted: 240 3.7% 15.9%; 35 | --muted-foreground: 240 5% 64.9%; 36 | --popover: 240 10% 3.9%; 37 | --popover-foreground: 0 0% 98%; 38 | --card: 240 10% 3.9%; 39 | --card-foreground: 0 0% 98%; 40 | --border: 240 3.7% 15.9%; 41 | --input: 240 3.7% 15.9%; 42 | --primary: 0 0% 98%; 43 | --primary-foreground: 240 5.9% 10%; 44 | --secondary: 240 3.7% 15.9%; 45 | --secondary-foreground: 0 0% 98%; 46 | --accent: 240 3.7% 15.9%; 47 | --accent-foreground: 0 0% 98%; 48 | --destructive: 0 62.8% 30.6%; 49 | --destructive-foreground: 0 0% 98%; 50 | --ring: 240 4.9% 83.9%; 51 | --success: 160 100% 25%; 52 | --loading: 240 3.7% 15.9%; 53 | } 54 | } 55 | 56 | .blur { 57 | backdrop-filter: blur(10px); 58 | } 59 | 60 | /* Animation for lines */ 61 | .lines { 62 | position: absolute; 63 | top: 0; 64 | left: 0; 65 | right: 0; 66 | height: 100%; 67 | margin: auto; 68 | width: 90vw; 69 | z-index: 0; 70 | } 71 | 72 | .line { 73 | position: absolute; 74 | width: 1px; 75 | height: 100%; 76 | top: 0; 77 | left: 50%; 78 | overflow: hidden; 79 | @apply dark:bg-gray-800 bg-gray-200; 80 | } 81 | 82 | .line::after { 83 | content: ''; 84 | display: block; 85 | position: absolute; 86 | height: 15vh; 87 | width: 100%; 88 | top: -50%; 89 | left: 0; 90 | animation: drop 7s 0s infinite; 91 | animation-fill-mode: forwards; 92 | animation-timing-function: cubic-bezier(0.4, 0.26, 0, 0.97); 93 | @apply dark:bg-gradient-to-b bg-gradient-to-t from-transparent dark:to-black to-white; 94 | } 95 | 96 | .line:nth-child(1) { 97 | margin-left: -25%; 98 | } 99 | 100 | .line:nth-child(1)::after { 101 | animation-delay: 2s; 102 | } 103 | 104 | .line:nth-child(3) { 105 | margin-left: 25%; 106 | } 107 | 108 | .line:nth-child(3)::after { 109 | animation-delay: 2.5s; 110 | } 111 | 112 | @keyframes drop { 113 | 0% { 114 | top: -50%; 115 | } 116 | 100% { 117 | top: 110%; 118 | } 119 | } 120 | 121 | .sonner-loader { 122 | position: static !important; 123 | transform: none !important; 124 | top: auto !important; 125 | left: auto !important; 126 | } 127 | -------------------------------------------------------------------------------- /open-next.config.ts: -------------------------------------------------------------------------------- 1 | import { defineCloudflareConfig } from "@opennextjs/cloudflare"; 2 | 3 | export default defineCloudflareConfig(); -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /public/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docimin/cloudnet-webinterface/71b392396e7d3fa3dc294c9728e68ef8bc1365f0/public/android-chrome-192x192.png -------------------------------------------------------------------------------- /public/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docimin/cloudnet-webinterface/71b392396e7d3fa3dc294c9728e68ef8bc1365f0/public/android-chrome-512x512.png -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docimin/cloudnet-webinterface/71b392396e7d3fa3dc294c9728e68ef8bc1365f0/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docimin/cloudnet-webinterface/71b392396e7d3fa3dc294c9728e68ef8bc1365f0/public/favicon-16x16.png -------------------------------------------------------------------------------- /public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docimin/cloudnet-webinterface/71b392396e7d3fa3dc294c9728e68ef8bc1365f0/public/favicon-32x32.png -------------------------------------------------------------------------------- /public/humans.txt: -------------------------------------------------------------------------------- 1 | The humans.txt file explains the team, technology, 2 | and graphic assets behind this site humanstxt.org. 3 | 4 | _______________________________________________________________________________ 5 | 6 | DESIGNER & DEVELOPER 7 | 8 | Faye 9 | Game & Web developer as a Freelancer 10 | 11 | twitter.com/fayeofficial_ 12 | github.com/docimin 13 | 14 | _______________________________________________________________________________ 15 | 16 | TECHNOLOGY 17 | 18 | React 19 | Next.JS 20 | TailwindCSS -------------------------------------------------------------------------------- /public/images/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docimin/cloudnet-webinterface/71b392396e7d3fa3dc294c9728e68ef8bc1365f0/public/images/bg.jpg -------------------------------------------------------------------------------- /public/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CloudNet Dashboard", 3 | "short_name": "", 4 | "icons": [ 5 | { 6 | "src": "/android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/android-chrome-512x512.png", 12 | "sizes": "512x512", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#ffffff", 17 | "background_color": "#ffffff", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /sentry.edge.config.ts: -------------------------------------------------------------------------------- 1 | // This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on). 2 | // The config you add here will be used whenever one of the edge features is loaded. 3 | // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally. 4 | // https://docs.sentry.io/platforms/javascript/guides/nextjs/ 5 | 6 | import * as Sentry from '@sentry/nextjs' 7 | 8 | Sentry.init({ 9 | dsn: process.env.SENTRY_DSN, 10 | enabled: process.env.SENTRY_ENABLED !== 'false', 11 | 12 | // Adjust this value in production, or use tracesSampler for greater control 13 | tracesSampleRate: 1, 14 | 15 | // Setting this option to true will print useful information to the console while you're setting up Sentry. 16 | debug: false 17 | }) 18 | -------------------------------------------------------------------------------- /sentry.server.config.ts: -------------------------------------------------------------------------------- 1 | // This file configures the initialization of Sentry on the server. 2 | // The config you add here will be used whenever the server handles a request. 3 | // https://docs.sentry.io/platforms/javascript/guides/nextjs/ 4 | 5 | import * as Sentry from '@sentry/nextjs' 6 | 7 | Sentry.init({ 8 | dsn: process.env.SENTRY_DSN, 9 | enabled: process.env.SENTRY_ENABLED !== 'false', 10 | 11 | // Adjust this value in production, or use tracesSampler for greater control 12 | tracesSampleRate: 1, 13 | 14 | // Setting this option to true will print useful information to the console while you're setting up Sentry. 15 | debug: false, 16 | 17 | // enable Spotlight (https://spotlightjs.com) 18 | spotlight: process.env.SENTRY_SPOTLIGHT !== 'false' 19 | }) 20 | -------------------------------------------------------------------------------- /src/app/[locale]/(auth)/layout.tsx: -------------------------------------------------------------------------------- 1 | export default async function LocaleLayout(props) { 2 | return props.children 3 | } 4 | -------------------------------------------------------------------------------- /src/app/[locale]/(auth)/logout/page.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import { useMemo, useState } from 'react' 3 | import { useRouter } from 'next/navigation' 4 | import * as Sentry from '@sentry/nextjs' 5 | import { useDict } from 'gt-next/client' 6 | 7 | export default function LogoutPage() { 8 | const [error, setError] = useState(null) 9 | const router = useRouter() 10 | const authT = useDict('Auth') 11 | 12 | useMemo(() => { 13 | fetch(`/api/auth/logout`, { 14 | method: 'POST' 15 | }) 16 | .then((response) => { 17 | if (!response.ok) { 18 | throw response 19 | } 20 | return response.json() // we only get here if there is no error 21 | }) 22 | .then(() => { 23 | Sentry.addBreadcrumb({ 24 | category: 'auth', 25 | message: 'Logged out', 26 | level: 'info' 27 | }) 28 | router.push('/') 29 | }) 30 | .catch((err) => { 31 | setError(err) 32 | }) 33 | }, [router]) 34 | 35 | if (error) { 36 | return ( 37 |
38 | {authT('logoutError')}: {error.message} 39 |
40 | ) 41 | } 42 | 43 | return null 44 | } 45 | -------------------------------------------------------------------------------- /src/app/[locale]/(auth)/page.tsx: -------------------------------------------------------------------------------- 1 | import Client from './page.client' 2 | 3 | export default async function Page() { 4 | return ( 5 |
6 | 7 |
8 | ) 9 | } 10 | -------------------------------------------------------------------------------- /src/app/[locale]/(dashboard)/dashboard/groups/[groupId]/page.client.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import { Button } from '@/components/ui/button' 3 | import { Label } from '@/components/ui/label' 4 | import { useRouter } from 'next/navigation' 5 | import { Textarea } from '@/components/ui/textarea' 6 | import { useState, FormEvent } from 'react' 7 | import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert' 8 | import { Terminal } from 'lucide-react' 9 | import { toast } from 'sonner' 10 | import { groupApi } from '@/lib/client-api' 11 | import { useDict } from 'gt-next/client' 12 | 13 | export default function GroupClientPage({ 14 | group, 15 | groupId 16 | }: { 17 | group: Group 18 | groupId: string 19 | }) { 20 | const groupsT = useDict('Groups') 21 | const mainT = useDict('Main') 22 | 23 | const router = useRouter() 24 | const [groupConfigData, setGroupConfigData] = useState( 25 | JSON.stringify(group, null, 2) 26 | ) 27 | const handleModuleConfigSave = async (event: FormEvent) => { 28 | event.preventDefault() 29 | 30 | try { 31 | const updatedGroup = JSON.parse(groupConfigData) 32 | if (updatedGroup.name !== group.name) { 33 | toast.warning(groupsT('groupNameChanged')) 34 | return 35 | } 36 | 37 | const response = await groupApi.update(updatedGroup) 38 | 39 | if (response) { 40 | toast.success(groupsT('groupConfigUpdated')) 41 | } 42 | } catch (error) { 43 | toast.error(mainT('invalidJson')) 44 | } 45 | } 46 | 47 | const handleUninstall = async () => { 48 | const response = await groupApi.delete(groupId) 49 | if (response.status === 204) { 50 | toast.success(groupsT('groupUninstalled')) 51 | router.push('/dashboard/groups') 52 | } 53 | } 54 | 55 | return ( 56 | <> 57 |
58 |
59 | {groupConfigData && ( 60 | 67 | )} 68 |
69 |
70 | 77 |
78 |
79 | 80 | 81 | 82 | {groupsT('headsUp')} 83 | {groupsT('editingGroupName')} 84 | 85 | 86 | {groupConfigData && ( 87 |
88 | 89 |
90 |