Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion console/atest-ui/src/views/DataManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ const executeQueryWithoutShowingNativeSQL = () => {
executeWithQuery(sqlQuery.value)
}

Magic.LoadMagicKeys(import.meta.url, new Map([
Magic.LoadMagicKeys('DataManager', new Map([
["executeQuery", executeQuery],
["executeWithSelectedQuery", executeWithSelectedQuery],
["executeQueryWithoutShowingNativeSQL", executeQueryWithoutShowingNativeSQL],
Expand Down
8 changes: 4 additions & 4 deletions console/atest-ui/src/views/StoreManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ function addStore() {
createAction.value = true
}

Magic.LoadMagicKeys(import.meta.url, {
"addStore": addStore,
"loadStores": loadStores,
})
Magic.LoadMagicKeys('StoreManager', new Map([
["addStore", addStore],
["loadStores", loadStores],
]))

const rules = reactive<FormRules<Store>>({
name: [{ required: true, message: 'Name is required', trigger: 'blur' }],
Expand Down
16 changes: 8 additions & 8 deletions console/atest-ui/src/views/TestCase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -935,14 +935,14 @@ const openQueryTab = () => {
testResultActiveTab.value = 'query'
}

Magic.LoadMagicKeys(import.meta.url), {
"sendRequest": sendRequest,
"openDuplicateTestCaseDialog": openDuplicateTestCaseDialog,
"openOutputTab": openOutputTab,
"openBodyTab": openBodyTab,
"openHeaderTab": openHeaderTab,
"openQueryTab": openQueryTab
}
Magic.LoadMagicKeys('TestCase', new Map([
["sendRequest", sendRequest],
["openDuplicateTestCaseDialog", openDuplicateTestCaseDialog],
["openOutputTab", openOutputTab],
["openBodyTab", openBodyTab],
["openHeaderTab", openHeaderTab],
["openQueryTab", openQueryTab]
]))
</script>

<template>
Expand Down
8 changes: 4 additions & 4 deletions console/atest-ui/src/views/TestSuite.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ function openNewTestCaseDialog() {
querySuggestedAPIs = NewSuggestedAPIsQuery(Cache.GetCurrentStore().name!, props.name!)
}

Magic.LoadMagicKeys(import.meta.url, {
"openNewTestCaseDialog": openNewTestCaseDialog,
"saveTestSuite": saveTestSuite,
})
Magic.LoadMagicKeys('TestSuite', new Map([
["openNewTestCaseDialog", openNewTestCaseDialog],
["saveTestSuite", saveTestSuite],
]))

const submitTestCaseForm = async (formEl: FormInstance | undefined) => {
if (!formEl) return
Expand Down
5 changes: 2 additions & 3 deletions console/atest-ui/src/views/magicKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ interface KeyBinding {
action: string
}

const LoadMagicKeys = (url: String, mapping: Map<String, Function>) => {
const fileName = url.substring(url.lastIndexOf('/') + 1);
const pageName = fileName.split(".vue")[0];
const LoadMagicKeys = (pageName: String, mapping: Map<String, Function>) => {
console.log(`Loading magic keys for page: ${pageName}`);
API.GetBinding("default", (data) => {
const bindings = JSON.parse(data.message) as KeyBindings;
bindings.pages.forEach((page: Page) => {
Expand Down
Loading