Browse Source

Merge pull request #558 from colinin/5.2.0

optimize webhook list queries
pull/580/head
yx lin 4 years ago
committed by GitHub
parent
commit
bd22388f85
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      apps/vue/src/views/webhooks/subscriptions/components/SubscriptionModal.vue

25
apps/vue/src/views/webhooks/subscriptions/components/SubscriptionModal.vue

@ -36,13 +36,21 @@
<InputPassword v-model:value="modelRef.secret" autocomplete="off" /> <InputPassword v-model:value="modelRef.secret" autocomplete="off" />
</FormItem> </FormItem>
<FormItem name="webhooks" :label="L('DisplayName:Webhooks')"> <FormItem name="webhooks" :label="L('DisplayName:Webhooks')">
<Select v-model:value="modelRef.webhooks" mode="multiple"> <Select v-model:value="modelRef.webhooks" mode="multiple" :filterOption="optionFilter">
<SelectGroup v-for="group in webhooksGroupRef" :key="group.name" :label="group.displayName"> <SelectGroup v-for="group in webhooksGroupRef" :key="group.name" :label="group.displayName">
<SelectOption <SelectOption
v-for="option in group.webhooks" v-for="option in group.webhooks"
:key="option.name" :key="option.name"
:value="option.name" :value="option.name"
>{{ option.displayName }}</SelectOption> :displayName="option.displayName"
>
<Tooltip placement="right">
<template #title>
{{ option.description }}
</template>
{{ option.displayName }}
</Tooltip>
</SelectOption>
</SelectGroup> </SelectGroup>
</Select> </Select>
</FormItem> </FormItem>
@ -62,6 +70,7 @@
Checkbox, Checkbox,
Form, Form,
Select, Select,
Tooltip,
Input, Input,
InputPassword InputPassword
} from 'ant-design-vue'; } from 'ant-design-vue';
@ -181,6 +190,16 @@
}); });
} }
function optionFilter(onputValue: string, option: any) {
if (option.displayName) {
return option.displayName.includes(onputValue);
}
if (option.label) {
return option.label.includes(onputValue);
}
return true;
}
function getDefaultModel() : WebhookSubscription { function getDefaultModel() : WebhookSubscription {
return { return {
id: '', id: '',

Loading…
Cancel
Save