feat: update workflow run button to Test Run with keyboard shortcut (#24071)

This commit is contained in:
lyzno1 2025-08-18 10:44:17 +08:00 committed by GitHub
parent 74ad21b145
commit e9c7dc7464
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 28 additions and 21 deletions

View File

@ -22,6 +22,7 @@ import {
import { useEventEmitterContextContext } from '@/context/event-emitter'
import { EVENT_WORKFLOW_STOP } from '@/app/components/workflow/variable-inspect/types'
import useTheme from '@/hooks/use-theme'
import ShortcutsName from '../shortcuts-name'
const RunMode = memo(() => {
const { t } = useTranslation()
@ -64,6 +65,7 @@ const RunMode = memo(() => {
<>
<RiPlayLargeLine className='mr-1 h-4 w-4' />
{t('workflow.common.run')}
<ShortcutsName keys={['alt', 'r']} className="ml-1" textColor="secondary" />
</>
)
}

View File

@ -5,10 +5,12 @@ import cn from '@/utils/classnames'
type ShortcutsNameProps = {
keys: string[]
className?: string
textColor?: 'default' | 'secondary'
}
const ShortcutsName = ({
keys,
className,
textColor = 'default',
}: ShortcutsNameProps) => {
return (
<div className={cn(
@ -19,7 +21,10 @@ const ShortcutsName = ({
keys.map(key => (
<div
key={key}
className='system-kbd flex h-4 min-w-4 items-center justify-center rounded-[4px] bg-components-kbd-bg-gray capitalize'
className={cn(
'system-kbd flex h-4 min-w-4 items-center justify-center rounded-[4px] bg-components-kbd-bg-gray capitalize',
textColor === 'secondary' && 'text-text-secondary',
)}
>
{getKeyboardKeyNameBySystem(key)}
</div>

View File

@ -8,7 +8,7 @@ const translation = {
published: 'Veröffentlicht',
publish: 'Veröffentlichen',
update: 'Aktualisieren',
run: 'Ausführen',
run: 'Test ausführen',
running: 'Wird ausgeführt',
inRunMode: 'Im Ausführungsmodus',
inPreview: 'In der Vorschau',

View File

@ -9,7 +9,7 @@ const translation = {
publish: 'Publish',
update: 'Update',
publishUpdate: 'Publish Update',
run: 'Run',
run: 'Test Run',
running: 'Running',
inRunMode: 'In Run Mode',
inPreview: 'In Preview',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'Publicado',
publish: 'Publicar',
update: 'Actualizar',
run: 'Ejecutar',
run: 'Ejecutar prueba',
running: 'Ejecutando',
inRunMode: 'En modo de ejecución',
inPreview: 'En vista previa',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'منتشر شده',
publish: 'انتشار',
update: 'به‌روزرسانی',
run: 'اجرا',
run: 'اجرای تست',
running: 'در حال اجرا',
inRunMode: 'در حالت اجرا',
inPreview: 'در پیش‌نمایش',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'Publié',
publish: 'Publier',
update: 'Mettre à jour',
run: 'Exécuter',
run: 'Exécuter test',
running: 'En cours d\'exécution',
inRunMode: 'En mode exécution',
inPreview: 'En aperçu',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'प्रकाशित',
publish: 'प्रकाशित करें',
update: 'अपडेट करें',
run: 'चलाएं',
run: 'परीक्षण चलाएं',
running: 'चल रहा है',
inRunMode: 'रन मोड में',
inPreview: 'पूर्वावलोकन में',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'Pubblicato',
publish: 'Pubblica',
update: 'Aggiorna',
run: 'Esegui',
run: 'Esegui test',
running: 'In esecuzione',
inRunMode: 'In modalità di esecuzione',
inPreview: 'In anteprima',

View File

@ -9,7 +9,7 @@ const translation = {
publish: '公開する',
update: '更新',
publishUpdate: '更新を公開',
run: '実行',
run: 'テスト実行',
running: '実行中',
inRunMode: '実行モード中',
inPreview: 'プレビュー中',

View File

@ -8,7 +8,7 @@ const translation = {
published: '게시됨',
publish: '게시하기',
update: '업데이트',
run: '실행',
run: '테스트 실행',
running: '실행 중',
inRunMode: '실행 모드',
inPreview: '미리보기 중',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'Opublikowane',
publish: 'Opublikuj',
update: 'Aktualizuj',
run: 'Uruchom',
run: 'Uruchom test',
running: 'Uruchamianie',
inRunMode: 'W trybie uruchamiania',
inPreview: 'W podglądzie',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'Publicado',
publish: 'Publicar',
update: 'Atualizar',
run: 'Executar',
run: 'Executar teste',
running: 'Executando',
inRunMode: 'No modo de execução',
inPreview: 'Em visualização',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'Publicat',
publish: 'Publică',
update: 'Actualizează',
run: 'Rulează',
run: 'Rulează test',
running: 'Rulând',
inRunMode: 'În modul de rulare',
inPreview: 'În previzualizare',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'Опубликовано',
publish: 'Опубликовать',
update: 'Обновить',
run: 'Запустить',
run: 'Тестовый запуск',
running: 'Выполняется',
inRunMode: 'В режиме выполнения',
inPreview: 'В режиме предпросмотра',

View File

@ -18,7 +18,7 @@ const translation = {
},
versionHistory: 'Zgodovina različic',
published: 'Objavljeno',
run: 'Teči',
run: 'Testni tek',
featuresDocLink: 'Nauči se več',
notRunning: 'Še ne teče',
exportImage: 'Izvozi sliko',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'เผย แพร่',
publish: 'ตีพิมพ์',
update: 'อัพเดต',
run: 'วิ่ง',
run: 'ทดสอบการทำงาน',
running: 'กำลัง เรียก ใช้',
inRunMode: 'ในโหมดเรียกใช้',
inPreview: 'ในการแสดงตัวอย่าง',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'Yayınlandı',
publish: 'Yayınla',
update: 'Güncelle',
run: 'Çalıştır',
run: 'Test çalıştır',
running: 'Çalışıyor',
inRunMode: 'Çalıştırma Modunda',
inPreview: 'Ön İzlemede',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'Опубліковано',
publish: 'Опублікувати',
update: 'Оновити',
run: 'Запустити',
run: 'Тестовий запуск',
running: 'Запущено',
inRunMode: 'У режимі запуску',
inPreview: 'У режимі попереднього перегляду',

View File

@ -8,7 +8,7 @@ const translation = {
published: 'Đã xuất bản',
publish: 'Xuất bản',
update: 'Cập nhật',
run: 'Chạy',
run: 'Chạy thử nghiệm',
running: 'Đang chạy',
inRunMode: 'Chế độ chạy',
inPreview: 'Trong chế độ xem trước',

View File

@ -9,7 +9,7 @@ const translation = {
publish: '发布',
update: '更新',
publishUpdate: '发布更新',
run: '运行',
run: '测试运行',
running: '运行中',
inRunMode: '在运行模式中',
inPreview: '预览中',

View File

@ -8,7 +8,7 @@ const translation = {
published: '已發佈',
publish: '發佈',
update: '更新',
run: '運行',
run: '測試運行',
running: '運行中',
inRunMode: '在運行模式中',
inPreview: '預覽中',