diff --git a/app/Console/Commands/Schedule/RenewalCommand.php b/app/Console/Commands/Schedule/RenewalCommand.php index a2539cf26..a4c283f82 100644 --- a/app/Console/Commands/Schedule/RenewalCommand.php +++ b/app/Console/Commands/Schedule/RenewalCommand.php @@ -6,7 +6,7 @@ use Illuminate\Console\Command; use Jexactyl\Services\Servers\SuspensionService; use Jexactyl\Services\Servers\ServerDeletionService; -use Exception; + class RenewalCommand extends Command { /** @@ -51,19 +51,19 @@ protected function process(Server $server) foreach ($servers as $svr) { try { $this->line('Renewing server ' . $svr->name, false); - + $svr->update(['renewal' => $svr->renewal - 1]); - + if ($svr->renewal <= 0) { $this->line('Suspending server ' . $svr->name, false); $this->suspensionService->toggle($svr, 'suspend'); } - + if ($svr->renewal <= -7) { $this->line('Deleting server ' . $svr->name, false); $this->deletionService->handle($svr); } - } catch (Exception $e) { + } catch (\Exception $e) { $this->line('Error processing server ' . $svr->name . ': ' . $e->getMessage()); } } diff --git a/app/Http/Controllers/Api/Client/DiscordController.php b/app/Http/Controllers/Api/Client/DiscordController.php index 6ec6ac2d8..ea6501cd9 100644 --- a/app/Http/Controllers/Api/Client/DiscordController.php +++ b/app/Http/Controllers/Api/Client/DiscordController.php @@ -36,6 +36,7 @@ public function unlink(): JsonResponse return new JsonResponse(['error' => 'No authenticated user'], 401); } $user->update(['discord_id' => null]); + return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT); } diff --git a/app/Http/ViewComposers/StoreComposer.php b/app/Http/ViewComposers/StoreComposer.php index e2c6e33ba..ca068251e 100644 --- a/app/Http/ViewComposers/StoreComposer.php +++ b/app/Http/ViewComposers/StoreComposer.php @@ -38,6 +38,10 @@ public function compose(View $view) 'enabled' => $this->setting('renewal:editing', Composer::TYPE_BOOL), ], + 'deletion' => [ + 'enabled' => $this->setting('renewal:deletion', Composer::TYPE_BOOL), + ], + 'referrals' => [ 'enabled' => $this->setting('referrals:enabled', Composer::TYPE_BOOL), 'reward' => $this->setting('referrals:reward', Composer::TYPE_INT), diff --git a/resources/scripts/components/auth/LoginContainer.tsx b/resources/scripts/components/auth/LoginContainer.tsx index 2aa6a9f5f..afa8e6830 100644 --- a/resources/scripts/components/auth/LoginContainer.tsx +++ b/resources/scripts/components/auth/LoginContainer.tsx @@ -6,7 +6,7 @@ import useFlash from '@/plugins/useFlash'; import { useStoreState } from 'easy-peasy'; import { Formik, FormikHelpers } from 'formik'; import { FaDiscord } from 'react-icons/fa'; -import { MdOutlineEmail } from "react-icons/md"; +import { MdOutlineEmail } from 'react-icons/md'; import Field from '@/components/elements/Field'; import React, { useEffect, useRef, useState } from 'react'; import { Button } from '@/components/elements/button/index'; @@ -108,19 +108,25 @@ const LoginContainer = ({ history }: RouteComponentProps) => {
- The API key you have requested is shown below. For safety reasons, please store this in a safe location, it will not be - shown again. + The API key you have requested is shown below. For safety reasons, please store this in a safe location, + it will not be shown again.
diff --git a/resources/scripts/components/dashboard/DashboardContainer.tsx b/resources/scripts/components/dashboard/DashboardContainer.tsx index 43edab2b9..d38a40e30 100644 --- a/resources/scripts/components/dashboard/DashboardContainer.tsx +++ b/resources/scripts/components/dashboard/DashboardContainer.tsx @@ -59,7 +59,8 @@ export default () => { {showOnlyAdmin ? 'Showing other servers' : 'Showing your servers'} - Select a server to view, update or modify. Go to storefront in the sidebar to create a new server. + Select a server to view, update or modify. Go to storefront in the sidebar to create a + new server.
{ ) : ( - Doesn't look like you have any servers here. Create one in storefront from the sidebar if it's open. + Doesn't look like you have any servers here. Create one in storefront from the + sidebar if it's open.
) } diff --git a/resources/scripts/components/dashboard/ServerRow.tsx b/resources/scripts/components/dashboard/ServerRow.tsx index 96ee7b187..7fa16ef83 100644 --- a/resources/scripts/components/dashboard/ServerRow.tsx +++ b/resources/scripts/components/dashboard/ServerRow.tsx @@ -37,7 +37,7 @@ const StatusIndicatorBox = styled(GreyRowBox)<{ $status: ServerPowerState | unde ? tw`bg-green-500` : tw`bg-yellow-500`}; } - + &:hover .status-bar { ${tw`opacity-75`}; } @@ -89,19 +89,17 @@ export default ({ server, className }: { server: Server; className?: string }) = >- )} + )} ); diff --git a/resources/scripts/components/tickets/OverviewContainer.tsx b/resources/scripts/components/tickets/OverviewContainer.tsx index 19e382c0f..b451410d3 100644 --- a/resources/scripts/components/tickets/OverviewContainer.tsx +++ b/resources/scripts/components/tickets/OverviewContainer.tsx @@ -38,7 +38,11 @@ export default () => {-- {server.name || "No Server Name"} -
+{server.name || 'No Server Name'}
- {server.allocations.length > 0 + {server.allocations.length > 0 ? server.allocations - .filter((alloc) => alloc.isDefault) - .map((allocation) => ( -
- {allocation.alias || ip(allocation.ip)}:{allocation.port} - - )) - : "No Allocations"} + .filter((alloc) => alloc.isDefault) + .map((allocation) => ( ++ {allocation.alias || ip(allocation.ip)}:{allocation.port} + + )) + : 'No Allocations'}@@ -136,9 +134,7 @@ export default ({ server, className }: { server: Server; className?: string }) =diff --git a/resources/scripts/components/server/files/ChmodFileModal.tsx b/resources/scripts/components/server/files/ChmodFileModal.tsx index 6f823efe9..8008720a2 100644 --- a/resources/scripts/components/server/files/ChmodFileModal.tsx +++ b/resources/scripts/components/server/files/ChmodFileModal.tsx @@ -53,7 +53,7 @@ const ChmodFileModal = ({ files, ...props }: OwnProps) => { }; // Generate a title based on the files being chmoded - const title = `Changing Permissions for: ${files.map(f => f.file).join(', ')}`; + const title = `Changing Permissions for: ${files.map((f) => f.file).join(', ')}`; return (diff --git a/resources/scripts/components/server/console/PowerButtons.tsx b/resources/scripts/components/server/console/PowerButtons.tsx index 1cad68670..7dd4e1ea0 100644 --- a/resources/scripts/components/server/console/PowerButtons.tsx +++ b/resources/scripts/components/server/console/PowerButtons.tsx @@ -55,12 +55,12 @@ export default ({ className }: PowerButtonProps) => { disabled={status !== 'offline'} onClick={onButtonClick.bind(this, 'start')} > -- - {stats.cpuUsagePercent.toFixed(2)}% - +{stats.cpuUsagePercent.toFixed(2)}% Start + Start - Restart + Restart @@ -69,7 +69,7 @@ export default ({ className }: PowerButtonProps) => { disabled={status === 'offline'} onClick={onButtonClick.bind(this, killable ? 'stop' : 'stop')} > - {killable ? 'Stop' : 'Stop'} + {killable ? 'Stop' : 'Stop'} @@ -78,7 +78,7 @@ export default ({ className }: PowerButtonProps) => { disabled={status === 'offline'} onClick={onButtonClick.bind(this, killable ? 'kill' : 'kill')} > - {killable ? 'Kill' : 'Kill'} + {killable ? 'Kill' : 'Kill'} 1 ? '' : files[0].mode || '' }}> @@ -64,7 +64,13 @@ const ChmodFileModal = ({ files, ...props }: OwnProps) => { diff --git a/resources/scripts/routers/StoreRouter.tsx b/resources/scripts/routers/StoreRouter.tsx index 5bbb2fd7d..81c4dea61 100644 --- a/resources/scripts/routers/StoreRouter.tsx +++ b/resources/scripts/routers/StoreRouter.tsx @@ -15,7 +15,6 @@ import ResourcesContainer from '@/components/store/ResourcesContainer'; import SubNavigation from '@/components/elements/SubNavigation'; import CouponContainer from '@/components/dashboard/CouponContainer'; - export default () => { const location = useLocation(); const { width } = useWindowDimensions(); diff --git a/resources/scripts/state/settings.ts b/resources/scripts/state/settings.ts index aa247ed83..1c78ae875 100644 --- a/resources/scripts/state/settings.ts +++ b/resources/scripts/state/settings.ts @@ -4,7 +4,7 @@ export interface SiteSettings { name: string; logo: string; locale: string; - + approvals: boolean; tickets: boolean; coupons: boolean; diff --git a/resources/scripts/state/storefront.ts b/resources/scripts/state/storefront.ts index ab677ed87..9e8032f87 100644 --- a/resources/scripts/state/storefront.ts +++ b/resources/scripts/state/storefront.ts @@ -10,6 +10,9 @@ export interface StorefrontSettings { editing: { enabled: boolean; }; + deletion: { + enabled: boolean; + }; referrals: { enabled: boolean; reward: number;{ticket.title}
- + {ticket.status}