editable schedule name, #101
Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
Tooltip,
|
||||
} from '@heroui/react'
|
||||
import { useMutation } from '@tanstack/react-query'
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
import { message } from '@tauri-apps/plugin-dialog'
|
||||
import { platform } from '@tauri-apps/plugin-os'
|
||||
import cronstrue from 'cronstrue'
|
||||
@@ -136,7 +137,18 @@ export default function Copy() {
|
||||
throw new Error('Invalid cron expression')
|
||||
}
|
||||
|
||||
const name = await invoke<string | null>('prompt', {
|
||||
title: 'Schedule Name',
|
||||
message: 'Enter a name for this schedule',
|
||||
default: `New Schedule ${new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: '2-digit' })}`,
|
||||
})
|
||||
|
||||
if (!name) {
|
||||
throw new Error('Schedule name is required')
|
||||
}
|
||||
|
||||
useHostStore.getState().addScheduledTask({
|
||||
name,
|
||||
operation: 'copy',
|
||||
cron: cronExpression,
|
||||
args: {
|
||||
|
||||
Reference in New Issue
Block a user