@@ -44,9 +44,6 @@ const emit = defineEmits(['updated','toHistoryPanel'])
4444let querySuggestedAPIs = NewSuggestedAPIsQuery (Cache .GetCurrentStore ().name ! , props .suite ! )
4545const testResultActiveTab = ref (Cache .GetPreference ().responseActiveTab )
4646watch (testResultActiveTab , Cache .WithResponseActiveTab )
47- Magic .Keys (() => {
48- testResultActiveTab .value = ' output'
49- }, [' Alt+KeyO' ])
5047
5148const parameters = ref ([] as Pair [])
5249const requestLoading = ref (false )
@@ -59,7 +56,6 @@ const sendRequest = async () => {
5956 runTestCase ()
6057 }
6158}
62- Magic .Keys (sendRequest , [' Alt+S' , ' Alt+ß' ])
6359
6460const runTestCaseResultHandler = (e : any ) => {
6561 requestLoading .value = false
@@ -712,15 +708,6 @@ const deleteAllHistory = async (formEl) => {
712708const options = GetHTTPMethods ()
713709const requestActiveTab = ref (Cache .GetPreference ().requestActiveTab )
714710watch (requestActiveTab , Cache .WatchRequestActiveTab )
715- Magic .Keys (() => {
716- requestActiveTab .value = ' query'
717- }, [' Alt+KeyQ' ])
718- Magic .Keys (() => {
719- requestActiveTab .value = ' header'
720- }, [' Alt+KeyH' ])
721- Magic .Keys (() => {
722- requestActiveTab .value = ' body'
723- }, [' Alt+KeyB' ])
724711
725712function bodyFiledExpectChange() {
726713 const data = testCaseWithSuite .value .data .response .bodyFieldsExpect
@@ -910,7 +897,6 @@ const openDuplicateTestCaseDialog = () => {
910897 duplicateTestCaseDialog .value = true
911898 targetTestCaseName .value = props .name + ' -copy'
912899}
913- Magic .Keys (openDuplicateTestCaseDialog , [' Alt+KeyD' ])
914900const duplicateTestCase = () => {
915901 API .DuplicateTestCase (props .suite , props .suite , props .name , targetTestCaseName .value ,(d ) => {
916902 duplicateTestCaseDialog .value = false
@@ -922,18 +908,50 @@ const duplicateTestCase = () => {
922908 emit (' updated' )
923909 })
924910}
925- Magic .Keys (() => {
926- if (duplicateTestCaseDialog .value ) {
927- duplicateTestCase ()
928- }
929- }, [' Alt+KeyO' ])
930911
931912const renameTestCase = (name : string ) => {
932913 const suiteName = props .suite
933914 API .RenameTestCase (suiteName , suiteName , props .name , name , (d ) => {
934915 emit (' updated' , suiteName , name )
935916 })
936917}
918+
919+ Magic .AdvancedKeys ([{
920+ Keys: [' Alt+S' , ' Alt+ß' ],
921+ Func: sendRequest ,
922+ Description: ' Send the request'
923+ }, {
924+ Keys: [' Alt+KeyD' ],
925+ Func: openDuplicateTestCaseDialog ,
926+ Description: ' Duplicate the test case'
927+ }, {
928+ Keys: [' Alt+KeyO' ],
929+ Func : () => {
930+ if (duplicateTestCaseDialog .value ) {
931+ duplicateTestCase ()
932+ }
933+ testResultActiveTab .value = ' output'
934+ },
935+ Description: ' Open the output tab'
936+ }, {
937+ Keys: [' Alt+KeyB' ],
938+ Func : () => {
939+ testResultActiveTab .value = ' body'
940+ },
941+ Description: ' Open the body tab'
942+ }, {
943+ Keys: [' Alt+KeyH' ],
944+ Func : () => {
945+ testResultActiveTab .value = ' header'
946+ },
947+ Description: ' Open the header tab'
948+ }, {
949+ Keys: [' Alt+KeyQ' ],
950+ Func : () => {
951+ testResultActiveTab .value = ' query'
952+ },
953+ Description: ' Open the query tab'
954+ }])
937955 </script >
938956
939957<template >
0 commit comments