From 3cd9577cbf3715bcc8d2f4e57993ee81e161d941 Mon Sep 17 00:00:00 2001 From: Dunemask Date: Tue, 26 Dec 2023 12:26:16 -0700 Subject: [PATCH] [FIX] Fixed Chonky styling & abused liveness & readiness probes --- .../configs/containers/minecraft-server.yml | 12 ++--- src/components/files/MineclusterFiles.jsx | 4 +- src/components/servers/ServerCard.jsx | 1 - src/css/header.css | 31 ----------- src/nav/MCLMenu.jsx | 54 +++++++++++++++---- src/nav/MCLPages.jsx | 3 ++ src/util/theme.js | 4 ++ 7 files changed, 58 insertions(+), 51 deletions(-) delete mode 100644 src/css/header.css diff --git a/lib/k8s/configs/containers/minecraft-server.yml b/lib/k8s/configs/containers/minecraft-server.yml index 4034e36..63efc13 100644 --- a/lib/k8s/configs/containers/minecraft-server.yml +++ b/lib/k8s/configs/containers/minecraft-server.yml @@ -73,10 +73,10 @@ image: itzg/minecraft-server:latest imagePullPolicy: IfNotPresent livenessProbe: exec: - command: - - mc-health + # command: ["mc-health"] # This is super unsafe... but why not :) + command: ["echo"] failureThreshold: 20 - initialDelaySeconds: 30 + initialDelaySeconds: 5 periodSeconds: 5 successThreshold: 1 timeoutSeconds: 1 @@ -90,10 +90,10 @@ ports: protocol: TCP readinessProbe: exec: - command: - - mc-health + # command: ["mc-health"] # This is super unsafe... but why not :) + command: ["echo"] failureThreshold: 20 - initialDelaySeconds: 30 + initialDelaySeconds: 5 periodSeconds: 5 successThreshold: 1 timeoutSeconds: 1 diff --git a/src/components/files/MineclusterFiles.jsx b/src/components/files/MineclusterFiles.jsx index 93f5698..ee5b26b 100644 --- a/src/components/files/MineclusterFiles.jsx +++ b/src/components/files/MineclusterFiles.jsx @@ -18,8 +18,6 @@ import { getServerItem, } from "@mcl/queries"; -import "@mcl/css/header.css"; - export default function MineclusterFiles(props) { // Chonky configuration setChonkyDefaults({ iconComponent: ChonkyIconFA }); @@ -140,7 +138,6 @@ export default function MineclusterFiles(props) { onChange={uploadFileSelection} multiple /> - + diff --git a/src/components/servers/ServerCard.jsx b/src/components/servers/ServerCard.jsx index e0d5063..c2d5ee8 100644 --- a/src/components/servers/ServerCard.jsx +++ b/src/components/servers/ServerCard.jsx @@ -11,7 +11,6 @@ import Typography from "@mui/material/Typography"; import StopIcon from "@mui/icons-material/Stop"; import TerminalIcon from "@mui/icons-material/Terminal"; import PlayArrowIcon from "@mui/icons-material/PlayArrow"; -import PendingIcon from "@mui/icons-material/Pending"; import DeleteForeverIcon from "@mui/icons-material/DeleteForever"; import EditIcon from "@mui/icons-material/Edit"; import FolderIcon from "@mui/icons-material/Folder"; diff --git a/src/css/header.css b/src/css/header.css deleted file mode 100644 index efa6fa9..0000000 --- a/src/css/header.css +++ /dev/null @@ -1,31 +0,0 @@ -.appbar-items { - font-size: 1.25rem; - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - font-weight: 500; - line-height: 1.6; - letter-spacing: 0.0075em; -} - -.view > header { - transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; - box-shadow: - 0px 2px 4px -1px rgba(0, 0, 0, 0.2), - 0px 4px 5px 0px rgba(0, 0, 0, 0.14), - 0px 1px 10px 0px rgba(0, 0, 0, 0.12); - display: flex; - flex-direction: column; - width: 100%; - box-sizing: border-box; - flex-shrink: 0; - position: fixed; - top: 0; - left: auto; - right: 0; - color: rgba(0, 0, 0, 0.87); - z-index: 1302; - background-color: #29985c; -} -.view > header > div > div > a { - height: 40px; - width: 40px; -} diff --git a/src/nav/MCLMenu.jsx b/src/nav/MCLMenu.jsx index 706c971..6108f0a 100644 --- a/src/nav/MCLMenu.jsx +++ b/src/nav/MCLMenu.jsx @@ -13,7 +13,7 @@ import IconButton from "@mui/material/IconButton"; import Typography from "@mui/material/Typography"; import MenuIcon from "@mui/icons-material/Menu"; import Drawer from "@mui/material/Drawer"; -import HomeIcon from "@mui/icons-material/Home"; +import ListItemIcon from "@mui/material/ListItemIcon"; import ListItemText from "@mui/material/ListItemText"; import List from "@mui/material/List"; import ListItemButton from "@mui/material/ListItemButton"; @@ -36,18 +36,52 @@ export default function MCLMenu() { theme.zIndex.modal + 2 - (isDrawer ? 1 : 0); return ( - - + + - - + + - + + + + + {pages.map( + (page, index) => + page.visible && ( + + {page.icon} + + + ), + )} + + + + {navHeader()} - + diff --git a/src/nav/MCLPages.jsx b/src/nav/MCLPages.jsx index d13364e..56ab52e 100644 --- a/src/nav/MCLPages.jsx +++ b/src/nav/MCLPages.jsx @@ -11,17 +11,20 @@ export default [ path: "/mcl/home", icon: , component: , + visible: true, }, { name: "Create", path: "/mcl/create", icon: , component: , + visible: true, }, { name: "Edit", path: "/mcl/files", icon: , component: , + visible: false, }, ]; diff --git a/src/util/theme.js b/src/util/theme.js index 2e9bf46..f694037 100644 --- a/src/util/theme.js +++ b/src/util/theme.js @@ -1,5 +1,9 @@ // Generated using https://zenoo.github.io/mui-theme-creator/ import { createTheme } from "@mui/material/styles"; +import { unstable_ClassNameGenerator as ClassNameGenerator } from "@mui/material/className"; +// This fixes style clashing with Chonky which has not been updated to Material 5 +// see https://github.com/TimboKZ/Chonky/issues/101#issuecomment-1362949314 +ClassNameGenerator.configure((componentName) => `mcl-${componentName}`); const themeOptions = { palette: {