Skip to content

Commit

Permalink
Merge pull request Jexactyl#357 from TheGamer3514/patch-2
Browse files Browse the repository at this point in the history
Make Allow Server Deletion functional
  • Loading branch information
camwhit-e authored Dec 6, 2024
2 parents e1e6d5a + 1d8e994 commit 3ddb871
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/Http/ViewComposers/StoreComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import RenameServerBox from '@/components/server/settings/RenameServerBox';
import DeleteServerBox from '@/components/server/settings/DeleteServerBox';
import ReinstallServerBox from '@/components/server/settings/ReinstallServerBox';
import ChangeBackgroundBox from '@/components/server/settings/ChangeBackgroundBox';
import { useStoreState } from 'easy-peasy';

export default () => {
const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid);
const node = ServerContext.useStoreState((state) => state.server.data!.node);

const deletion = useStoreState((state) => state.storefront.data!.deletion.enabled);
return (
<ServerContentBlock
title={'Settings'}
Expand All @@ -34,7 +35,7 @@ export default () => {
</div>
</CopyOnClick>
</TitledGreyBox>
<DeleteServerBox />
{deletion && <DeleteServerBox />}
<ChangeBackgroundBox />
</div>
<div className={'w-full mt-6 md:flex-1 md:mt-0'}>
Expand Down
3 changes: 3 additions & 0 deletions resources/scripts/state/storefront.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export interface StorefrontSettings {
editing: {
enabled: boolean;
};
deletion: {
enabled: boolean;
};
referrals: {
enabled: boolean;
reward: number;
Expand Down

0 comments on commit 3ddb871

Please sign in to comment.