From 6700f45f3a640e2bc052d07dc54be32273752370 Mon Sep 17 00:00:00 2001 From: Leopoldthecoder Date: Tue, 19 Nov 2024 10:40:00 +0800 Subject: [PATCH] feat(entities-plugins): support service-protection plugin --- .../images/plugin-icons/service-protection.png | Bin 0 -> 2631 bytes .../src/components/PluginForm.vue | 4 ++-- .../entities-plugins/src/definitions/metadata.ts | 7 +++++++ .../entities-plugins/src/locales/en.json | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 packages/entities/entities-plugins/src/assets/images/plugin-icons/service-protection.png diff --git a/packages/entities/entities-plugins/src/assets/images/plugin-icons/service-protection.png b/packages/entities/entities-plugins/src/assets/images/plugin-icons/service-protection.png new file mode 100644 index 0000000000000000000000000000000000000000..7f519ef61d42e85c0dbb32e304abed18abe554db GIT binary patch literal 2631 zcmb_eX*84#8-8ZSSZ7d{iKc90DZ)!(EMtZ&C6X;mn4zKtlfg_V&sbt?NlIC2P%_Du z8QGgq31wc|L}&^jWtV02djEVszJK32-;e9Q&VAqKI_LUxo%?1uJJ}({6~zGnKpwI` z=(5G&zYrDPs_i&Z_ZEqf?Y$@fAg}%}ActHqvs*(5#l_AFsC?6P|DMLiX7xcYQXPfbFzYA$Lcg zqHw>a1sPRr55IP~<@D0t`mqd+ZQX(-)mK<5t?vgvIqa=h~7@SIL>ow&-p?;`Qc zMw8Jn;)7r9%?wNF_x@DmP|KW#r|-v`@!&!dV~!9#TZ%NU{vu+3t)CQl?BR#Z5baAq z)z7D`&Ju=4-dFhgTCxuT*Ab`o@Jxh{^i>1fli^t=I$#G0f{~O^zTgQk+M)Jnc|8CB zu*x*{r!5#BZTr}~zMH$TL7Tt{WVw_5yu86s5tHbMW{MOVpiP8)PlVi$q|8z0XN{xo zI{e4VY)91tb&KlNN*}s{u4bIs*BOe~e_5?njON!EFDK}rFg7e4J+%AmE(+sY?V8`+ zz&CPJC#cA&b3?1+#?8~Ig1aNJ$bj%)tx}(B`zC76IQRazlUthKtahvrnb!L&QTM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Dm`nu9d<}&q}LXD15#%}J^8I!!@Zr5jukCMe20BiYIvz%G%Bin;I~54V?W2(+ugJDS z^bok`#FZYMP};zlzrqS?DsAe3TW-%~F=CKGl4;8|)N{pLd3CT1@gUtE6)Hqt=<{Xs z78(sXAtFJY0~b|Fn66D$g?_y?1=~#XcBn2X(!3!Z`K69}M@6$2GpZ8R%YB??=6xJt zWl-Ge7{p#|P_XM$e&7pB?)e6DL4{0x8{VK;b8*ec=^L8}Nf#@8B|C(W4NY3~qQmud zv00qUuvj3B^%3$LV3FP{N>;SDjPa9s3OS0yU?!lMwFcD6E^P@J-OuQS*wdbC&QJpD zi(|4L&X2YjGb_UAe9?M4B|tc#v4Q>r_Q<5iDnkQ(B9b_1{~+hy(USKS=lNq%`tw9p zI*V{K<_Se{=Iq3%4R*5lZBzr!AT(e{NxV!+%{^pxtH8T{uo8kdd&Ui+V94!Z-QqVNW}!B#JxdMJAusPHc|35WyTH z-?g9tvnweQs<4aT?w-f!P4gxp)Y-En4~_d@^!yr646xbz)Vqn)1Lkube5DwC$_M(P zE9Si`!)DZ%nO$NhV7XK|B?<1mwzi9>DDT8?<>&i&U-uvK?hMe=PblqK?M|vt+I!yb zr?G9BlD~N^YZgJ3lWa?P{=^6Lnv>NP?C~;Le>}VLGrwuUZ0+-(a4eiWL0mN1`ul)G MHckgCt%&je0PBRWC;$Ke literal 0 HcmV?d00001 diff --git a/packages/entities/entities-plugins/src/components/PluginForm.vue b/packages/entities/entities-plugins/src/components/PluginForm.vue index 642e5047ff..1398913807 100644 --- a/packages/entities/entities-plugins/src/components/PluginForm.vue +++ b/packages/entities/entities-plugins/src/components/PluginForm.vue @@ -693,10 +693,10 @@ const buildFormSchema = (parentKey: string, response: Record, initi // pass the referenceable flag from elements to the parent initialFormSchema[field].referenceable = elements.referenceable - if ((elements.type === 'string' || elements.type === 'integer') && !elements.one_of) { + if (['string', 'integer', 'number'].includes(elements.type) && !elements.one_of) { const { id, help, label, hint, values, referenceable } = initialFormSchema[field] const { inputAttributes, ...overrides } = JSON.parse(JSON.stringify(ArrayInputFieldSchema)) - inputAttributes.type = elements.type === 'integer' ? 'number' : 'text' + inputAttributes.type = elements.type === 'string' ? 'text' : 'number' initialFormSchema[field] = { id, help, label, hint, values, referenceable, inputAttributes, ...overrides } } } diff --git a/packages/entities/entities-plugins/src/definitions/metadata.ts b/packages/entities/entities-plugins/src/definitions/metadata.ts index 950f226e7f..b1836e2bea 100644 --- a/packages/entities/entities-plugins/src/definitions/metadata.ts +++ b/packages/entities/entities-plugins/src/definitions/metadata.ts @@ -755,6 +755,13 @@ export const PLUGIN_METADATA: Record