Skip to content

Commit

Permalink
feat: Java Version editor (Should probably make it more intuitive tho…
Browse files Browse the repository at this point in the history
…ugh)
  • Loading branch information
LynithDev committed Sep 10, 2024
1 parent 641a728 commit bfaa6ce
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 74 deletions.
62 changes: 21 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ tauri = { version = "=2.0.0-rc.8", features = [
"protocol-asset"
] }

# tauri-utils is a collection of utilities for tauri apps.
tauri-utils = { version = "=2.0.0-rc.7" }
# tauri-build is the codegen utility for our tauri buildscript.
tauri-build = { version = "=2.0.0-rc.7" }
# tauri-plugin-shell adds a bridge for opening urls and paths in the frontend.
Expand Down Expand Up @@ -174,8 +176,8 @@ cocoa = { version = "0.26" }
objc = { version = "0.2" }
cc = { version = "1.1" }
libc = { version = "0.2" }
# https://github.com/tauri-apps/tauri/blob/tauri-v2.0.0-rc.0/core/tauri/Cargo.toml#L86
webkit2gtk = { version = "=2.0.1", features = [ "v2_38" ] }
# https://github.com/tauri-apps/tauri/blob/dev/crates/tauri/Cargo.toml#L102
webkit2gtk = { version = "=2.0.1", features = [ "v2_40" ] }

[workspace.dependencies.prisma-client-rust]
git = "https://github.com/brendonovich/prisma-client-rust"
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tauri-plugin-updater = { workspace = true }
tauri-plugin-clipboard-manager = { workspace = true }
tauri-plugin-dialog = { workspace = true }
tauri-plugin-deep-link = { workspace = true }
tauri-utils = { workspace = true }
tauri-specta = { workspace = true }
specta = { workspace = true }
specta-typescript = { workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions apps/frontend/src/ui/components/content/SearchResults.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ChevronDownIcon, Download01Icon, HeartIcon } from '@untitled-theme/icons-solid';
import useBrowser from '~ui/hooks/useBrowser';
import useSettings from '~ui/hooks/useSettings';
import { abbreviateNumber } from '~utils';
import { createSignal, For, Match, Show, Switch } from 'solid-js';
import { For, Match, Show, Switch, createSignal } from 'solid-js';

Check failure on line 2 in apps/frontend/src/ui/components/content/SearchResults.tsx

View workflow job for this annotation

GitHub Actions / EcmaScript Checks

Expected "createSignal" to come before "Switch"
import type { Providers, SearchResult } from '@onelauncher/client/bindings';
import type { JSX } from 'solid-js';
import Button from '../base/Button';
import { abbreviateNumber } from '~utils';

Check failure on line 6 in apps/frontend/src/ui/components/content/SearchResults.tsx

View workflow job for this annotation

GitHub Actions / EcmaScript Checks

Expected "~utils" to come before "../base/Button"
import useSettings from '~ui/hooks/useSettings';

Check failure on line 7 in apps/frontend/src/ui/components/content/SearchResults.tsx

View workflow job for this annotation

GitHub Actions / EcmaScript Checks

Expected "~ui/hooks/useSettings" to come before "~utils"
import useBrowser from '~ui/hooks/useBrowser';

Check failure on line 8 in apps/frontend/src/ui/components/content/SearchResults.tsx

View workflow job for this annotation

GitHub Actions / EcmaScript Checks

Expected "~ui/hooks/useBrowser" to come before "~ui/hooks/useSettings"

interface SearchResultsContainerProps {
provider: Providers;
Expand Down
24 changes: 13 additions & 11 deletions apps/frontend/src/ui/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ import {
RefreshCw01Icon,
SearchMdIcon,
} from '@untitled-theme/icons-solid';
import { For, Show, onMount } from 'solid-js';

Check failure on line 9 in apps/frontend/src/ui/pages/Home.tsx

View workflow job for this annotation

GitHub Actions / EcmaScript Checks

Expected "onMount" to come before "Show"
import type { Cluster } from '@onelauncher/client/bindings';
import BannerBackground from '../../assets/images/header.png';
import Button from '../components/base/Button';
import TextField from '../components/base/TextField';
import ClusterRoot from './cluster/ClusterRoot';
import { bridge } from '~imports';

Check failure on line 15 in apps/frontend/src/ui/pages/Home.tsx

View workflow job for this annotation

GitHub Actions / EcmaScript Checks

Expected "~imports" to come before "./cluster/ClusterRoot"

import ClusterCover from '~ui/components/game/ClusterCover';
import { useClusterCreator } from '~ui/components/overlay/cluster/ClusterCreationModal';
import { useLaunchCluster, useRecentCluster } from '~ui/hooks/useCluster';
import useCommand from '~ui/hooks/useCommand';
import { formatAsDuration, upperFirst } from '~utils';
import { For, onMount, Show } from 'solid-js';
import type { Cluster } from '@onelauncher/client/bindings';
import BannerBackground from '../../assets/images/header.png';
import Button from '../components/base/Button';
import TextField from '../components/base/TextField';
import ClusterRoot from './cluster/ClusterRoot';

type GroupedClusters = Record<string, Cluster[]>;

Expand Down Expand Up @@ -72,11 +72,13 @@ function HomePage() {

<Show
children={(
<For each={Object.entries(clusters() ?? {})}>
{([group, clusters]) => (
<ClusterGroup clusters={clusters} title={group} />
)}
</For>
<div class="flex flex-col gap-y-8 pb-8">
<For each={Object.entries(clusters() ?? {})}>
{([group, clusters]) => (
<ClusterGroup clusters={clusters} title={group} />
)}
</For>
</div>
)}
fallback={(
<div class="max-h-64 flex flex-1 flex-col items-center justify-center gap-y-4">
Expand Down
10 changes: 7 additions & 3 deletions apps/frontend/src/ui/pages/cluster/ClusterSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useBeforeLeave } from '@solidjs/router';
import { type Accessor, Show } from 'solid-js';
import type { Cluster } from '@onelauncher/client/bindings';
import { GameSettings, JvmSettings, LauncherSettings, ProcessSettings, createSetting } from '../settings/game/SettingsMinecraft';

Check failure on line 4 in apps/frontend/src/ui/pages/cluster/ClusterSettings.tsx

View workflow job for this annotation

GitHub Actions / EcmaScript Checks

Expected "createSetting" to come before "ProcessSettings"
import { bridge } from '~imports';

Check failure on line 5 in apps/frontend/src/ui/pages/cluster/ClusterSettings.tsx

View workflow job for this annotation

GitHub Actions / EcmaScript Checks

Expected "~imports" to come before "../settings/game/SettingsMinecraft"
import ScrollableContainer from '~ui/components/ScrollableContainer';
import Sidebar from '~ui/components/Sidebar';
import useClusterContext from '~ui/hooks/useCluster';
import { tryResult } from '~ui/hooks/useCommand';
import useSettings from '~ui/hooks/useSettings';
import { type Accessor, Show } from 'solid-js';
import type { Cluster } from '@onelauncher/client/bindings';
import { createSetting, GameSettings, JvmSettings, LauncherSettings, ProcessSettings } from '../settings/game/SettingsMinecraft';

function ClusterSettings() {
const [cluster] = useClusterContext();
Expand Down Expand Up @@ -40,6 +40,7 @@ function PageSettings(cluster: Accessor<Cluster>) {
const postCommand = createSetting(cluster().init_hooks?.post, settings().init_hooks.post ?? '');

// JVM
const javaVersion = createSetting(cluster().java?.custom_version || null);
const javaArgs = createSetting(cluster().java?.custom_arguments, settings().custom_java_args);
const envVars = createSetting(cluster().java?.custom_env_arguments, settings().custom_env_args);

Expand All @@ -61,6 +62,7 @@ function PageSettings(cluster: Accessor<Cluster>) {

// JVM
java: {
custom_version: javaVersion.getRaw(),
custom_arguments: javaArgs.getRaw(),
custom_env_arguments: envVars.getRaw(),
},
Expand Down Expand Up @@ -94,6 +96,8 @@ function PageSettings(cluster: Accessor<Cluster>) {

<JvmSettings
{...{
javaVersion,
javaVersions: undefined,
javaArgs,
envVars,
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { InfoCircleIcon, Trash01Icon, UserPlus02Icon } from '@untitled-theme/icons-solid';
import { For, Match, Show, Switch, createSignal, mergeProps } from 'solid-js';

Check failure on line 2 in apps/frontend/src/ui/pages/settings/game/SettingsAccounts.tsx

View workflow job for this annotation

GitHub Actions / EcmaScript Checks

Expected "createSignal" to come before "Switch"
import Button from '~ui/components/base/Button';

Check failure on line 3 in apps/frontend/src/ui/pages/settings/game/SettingsAccounts.tsx

View workflow job for this annotation

GitHub Actions / EcmaScript Checks

Expected "~ui/components/base/Button" to come before "solid-js"
import Tooltip from '~ui/components/base/Tooltip';
import PlayerHead from '~ui/components/game/PlayerHead';
import useAccountController from '~ui/components/overlay/account/AddAccountModal';
import ScrollableContainer from '~ui/components/ScrollableContainer';
import Sidebar from '~ui/components/Sidebar';
import { createSignal, For, Match, mergeProps, Show, Switch } from 'solid-js';

function SettingsAccounts() {
const controller = useAccountController();
Expand Down
Loading

0 comments on commit bfaa6ce

Please sign in to comment.