forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🛠️: refactor
Webhook
to composition API and ts
- Loading branch information
Showing
1 changed file
with
25 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
<script setup lang="ts"> | ||
import { onMounted, ref } from "vue"; | ||
import Webhooks from "@/utils/webhooks"; | ||
interface Props { | ||
type: string; | ||
toolId?: string; | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
toolId: undefined, | ||
}); | ||
const webhook = ref(null); | ||
onMounted(() => { | ||
new Webhooks.WebhookView({ | ||
webhook, | ||
type: props.type, | ||
toolId: props.toolId, | ||
}); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div id="webhook-view" ref="webhook" /> | ||
</template> | ||
<script> | ||
import Webhooks from "utils/webhooks"; | ||
export default { | ||
props: { | ||
type: { | ||
type: String, | ||
required: true, | ||
}, | ||
toolId: { | ||
type: String, | ||
default: null, | ||
}, | ||
}, | ||
mounted() { | ||
const el = this.$refs["webhook"]; | ||
new Webhooks.WebhookView({ | ||
el, | ||
type: this.type, | ||
toolId: this.toolId, | ||
}); | ||
}, | ||
}; | ||
</script> |