diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 74c2a58..b415843 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -13,6 +13,7 @@ "menu:default", "tray:default", "shell:allow-open", + "shell:allow-execute", "dialog:default", "dialog:allow-open", { diff --git a/src-tauri/src/model.rs b/src-tauri/src/model.rs index 3ed3ef4..39776c7 100644 --- a/src-tauri/src/model.rs +++ b/src-tauri/src/model.rs @@ -127,6 +127,7 @@ pub enum PlatformKind { Kuaishou, Douyu, Twitch, + Youtube, Unknown, } diff --git a/src/lib/components/button.svelte b/src/lib/components/button.svelte index a74b3cc..ad0699b 100644 --- a/src/lib/components/button.svelte +++ b/src/lib/components/button.svelte @@ -5,18 +5,22 @@ onClick, black, white, - red + red, + autoFocus }: { - children: any; - className: string; + children?: any; + className?: string; onClick: any; black?: boolean; white?: boolean; red?: boolean; + autoFocus?: boolean; } = $props(); + - (config = JSON.parse(JSON.stringify(rawConfig)))}>{$t('cancel')} + {/if} diff --git a/src/routes/live/+page.svelte b/src/routes/live/+page.svelte index e154ce9..bbc9555 100644 --- a/src/routes/live/+page.svelte +++ b/src/routes/live/+page.svelte @@ -6,15 +6,19 @@ import { scale } from 'svelte/transition'; import { backOut } from 'svelte/easing'; import { onMount } from 'svelte'; + import { Command } from '@tauri-apps/plugin-shell'; const xiaohongshuPushServer = 'rtmp://live-push.xhscdn.com/live'; let key = $state(''); let inputFile = $state(''); let visible = $state(false); - onMount(() => { + onMount(async () => { visible = true; + let result = await Command.create('exec-sh', ['-c', "echo 'hello world'"]).execute(); + console.log('result: ', result); }); + async function push() { try { let info = await getImageInfo(inputFile); diff --git a/src/routes/record/+page.svelte b/src/routes/record/+page.svelte index cb59c8a..c969406 100644 --- a/src/routes/record/+page.svelte +++ b/src/routes/record/+page.svelte @@ -5,7 +5,6 @@ closeDialog, openDialog, debounce, - getResolutionName, getLiveInfoForPlatform, getPlatformIcon } from '$lib/utils'; @@ -296,7 +295,9 @@ ? 'mt-16' : 'mt-32'}" > -