From 39ec6c8025a2f26087543eaf8eddbc031b11be9b Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 10 Jan 2025 13:10:58 +0800 Subject: [PATCH] Fix/setting model page crash (#12594) Co-authored-by: JzoNg --- .../assets/public/llm/Anthropic-dark.svg | 186 +++ .../assets/public/llm/Anthropic-light.svg | 186 +++ .../icons/src/public/llm/AnthropicDark.json | 1046 +++++++++++++++++ .../icons/src/public/llm/AnthropicDark.tsx | 16 + .../icons/src/public/llm/AnthropicLight.json | 1046 +++++++++++++++++ .../icons/src/public/llm/AnthropicLight.tsx | 16 + .../base/icons/src/public/llm/index.ts | 2 + .../model-provider-page/model-icon/index.tsx | 7 +- .../provider-icon/index.tsx | 16 +- web/app/components/plugins/card/card-mock.ts | 160 --- web/hooks/use-i18n.ts | 1 + 11 files changed, 2514 insertions(+), 168 deletions(-) create mode 100644 web/app/components/base/icons/assets/public/llm/Anthropic-dark.svg create mode 100644 web/app/components/base/icons/assets/public/llm/Anthropic-light.svg create mode 100644 web/app/components/base/icons/src/public/llm/AnthropicDark.json create mode 100644 web/app/components/base/icons/src/public/llm/AnthropicDark.tsx create mode 100644 web/app/components/base/icons/src/public/llm/AnthropicLight.json create mode 100644 web/app/components/base/icons/src/public/llm/AnthropicLight.tsx delete mode 100644 web/app/components/plugins/card/card-mock.ts diff --git a/web/app/components/base/icons/assets/public/llm/Anthropic-dark.svg b/web/app/components/base/icons/assets/public/llm/Anthropic-dark.svg new file mode 100644 index 0000000000..57abb737e7 --- /dev/null +++ b/web/app/components/base/icons/assets/public/llm/Anthropic-dark.svg @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/app/components/base/icons/assets/public/llm/Anthropic-light.svg b/web/app/components/base/icons/assets/public/llm/Anthropic-light.svg new file mode 100644 index 0000000000..3e587ccc9e --- /dev/null +++ b/web/app/components/base/icons/assets/public/llm/Anthropic-light.svg @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/app/components/base/icons/src/public/llm/AnthropicDark.json b/web/app/components/base/icons/src/public/llm/AnthropicDark.json new file mode 100644 index 0000000000..4f3af3ce79 --- /dev/null +++ b/web/app/components/base/icons/src/public/llm/AnthropicDark.json @@ -0,0 +1,1046 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "90", + "height": "10", + "viewBox": "0 0 90 10", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Anthropic", + "clip-path": "url(#clip0_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask0_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_2" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector", + "d": "M89.375 -0.00195312H0V9.99805H89.375V-0.00195312Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask0_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_2" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask1_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_4" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_2", + "d": "M0 -0.00390625H89.375V9.99609H0V-0.00390625Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask1_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_2" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_3" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask2_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_12" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_3", + "d": "M0 -0.00585938H89.375V9.99414H0V-0.00585938Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask2_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_3" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_4" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask3_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_89" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_4", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask3_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_4" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_5" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_6" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_5", + "d": "M18.1273 6.92438L13.7773 0.15625H11.4297V9.82501H13.4321V3.05688L17.7821 9.82501H20.1297V0.15625H18.1273V6.92438Z", + "fill": "black", + "fill-opacity": "0.95" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_5" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask4_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_80" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_6", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask4_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_7" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_8" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_9" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_7", + "d": "M21.7969 2.02094H25.0423V9.82501H27.1139V2.02094H30.3594V0.15625H21.7969V2.02094Z", + "fill": "black", + "fill-opacity": "0.95" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_6" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask5_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_71" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_8", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask5_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_10" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_12" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_9", + "d": "M38.6442 4.00994H34.0871V0.15625H32.0156V9.82501H34.0871V5.87463H38.6442V9.82501H40.7156V0.15625H38.6442V4.00994Z", + "fill": "black", + "fill-opacity": "0.95" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_7" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask6_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_62" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_10", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask6_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_13" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_14" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_15" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_11", + "d": "M45.3376 2.02094H47.893C48.9152 2.02094 49.4539 2.39387 49.4539 3.09831C49.4539 3.80275 48.9152 4.17569 47.893 4.17569H45.3376V2.02094ZM51.5259 3.09831C51.5259 1.27506 50.186 0.15625 47.9897 0.15625H43.2656V9.82501H45.3376V6.04037H47.6443L49.7164 9.82501H52.0094L49.715 5.75211C50.8666 5.30941 51.5259 4.37721 51.5259 3.09831Z", + "fill": "black", + "fill-opacity": "0.95" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_8" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask7_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_53" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_12", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask7_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_16" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_17" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_18" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_13", + "d": "M57.8732 8.05653C56.2438 8.05653 55.2496 6.89631 55.2496 5.00404C55.2496 3.08416 56.2438 1.92394 57.8732 1.92394C59.4887 1.92394 60.4691 3.08416 60.4691 5.00404C60.4691 6.89631 59.4887 8.05653 57.8732 8.05653ZM57.8732 -0.00976562C55.0839 -0.00976562 53.1094 2.06206 53.1094 5.00404C53.1094 7.91841 55.0839 9.99023 57.8732 9.99023C60.6486 9.99023 62.6094 7.91841 62.6094 5.00404C62.6094 2.06206 60.6486 -0.00976562 57.8732 -0.00976562Z", + "fill": "black", + "fill-opacity": "0.95" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_9" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask8_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_44" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_14", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask8_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_19" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_20" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_21" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_15", + "d": "M69.1794 4.45194H66.6233V2.02094H69.1794C70.2019 2.02094 70.7407 2.43532 70.7407 3.23644C70.7407 4.03756 70.2019 4.45194 69.1794 4.45194ZM69.2762 0.15625H64.5508V9.82501H66.6233V6.31662H69.2762C71.473 6.31662 72.8133 5.15637 72.8133 3.23644C72.8133 1.3165 71.473 0.15625 69.2762 0.15625Z", + "fill": "black", + "fill-opacity": "0.95" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_10" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask9_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_35" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_16", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask9_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_22" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_23" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_24" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_17", + "d": "M86.8413 6.57863C86.4823 7.51786 85.7642 8.05653 84.7837 8.05653C83.1542 8.05653 82.16 6.89631 82.16 5.00404C82.16 3.08416 83.1542 1.92394 84.7837 1.92394C85.7642 1.92394 86.4823 2.46261 86.8413 3.40183H89.0369C88.4984 1.33002 86.8827 -0.00976562 84.7837 -0.00976562C81.9942 -0.00976562 80.0195 2.06206 80.0195 5.00404C80.0195 7.91841 81.9942 9.99023 84.7837 9.99023C86.8965 9.99023 88.5122 8.63664 89.0508 6.57863H86.8413Z", + "fill": "black", + "fill-opacity": "0.95" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_11" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask10_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_26" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_18", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask10_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_25" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_26" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_27" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_19", + "d": "M73.6484 0.15625L77.5033 9.82501H79.6172L75.7624 0.15625H73.6484Z", + "fill": "black", + "fill-opacity": "0.95" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_12" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask11_5981_49007", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_17" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_20", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask11_5981_49007)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_28" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_29" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_30" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_21", + "d": "M3.64038 5.99893L4.95938 2.60106L6.27838 5.99893H3.64038ZM3.85422 0.15625L0 9.82501H2.15505L2.9433 7.79456H6.97558L7.76371 9.82501H9.91875L6.06453 0.15625H3.85422Z", + "fill": "black", + "fill-opacity": "0.95" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "defs", + "attributes": {}, + "children": [ + { + "type": "element", + "name": "clipPath", + "attributes": { + "id": "clip0_5981_49007" + }, + "children": [ + { + "type": "element", + "name": "rect", + "attributes": { + "width": "89.375", + "height": "10", + "fill": "white" + }, + "children": [] + } + ] + } + ] + } + ] + }, + "name": "AnthropicDark" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/llm/AnthropicDark.tsx b/web/app/components/base/icons/src/public/llm/AnthropicDark.tsx new file mode 100644 index 0000000000..d358b0c111 --- /dev/null +++ b/web/app/components/base/icons/src/public/llm/AnthropicDark.tsx @@ -0,0 +1,16 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './AnthropicDark.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconBaseProps, IconData } from '@/app/components/base/icons/IconBase' + +const Icon = React.forwardRef, Omit>(( + props, + ref, +) => ) + +Icon.displayName = 'AnthropicDark' + +export default Icon diff --git a/web/app/components/base/icons/src/public/llm/AnthropicLight.json b/web/app/components/base/icons/src/public/llm/AnthropicLight.json new file mode 100644 index 0000000000..3e84eb4dd6 --- /dev/null +++ b/web/app/components/base/icons/src/public/llm/AnthropicLight.json @@ -0,0 +1,1046 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "90", + "height": "10", + "viewBox": "0 0 90 10", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Anthropic", + "clip-path": "url(#clip0_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask0_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_2" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector", + "d": "M89.375 -0.00195312H0V9.99805H89.375V-0.00195312Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask0_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_2" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask1_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_4" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_2", + "d": "M0 -0.00390625H89.375V9.99609H0V-0.00390625Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask1_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_2" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_3" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask2_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_12" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_3", + "d": "M0 -0.00585938H89.375V9.99414H0V-0.00585938Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask2_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_3" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_4" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask3_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_89" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_4", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask3_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_4" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_5" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_6" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_5", + "d": "M18.1273 6.92438L13.7773 0.15625H11.4297V9.82501H13.4321V3.05688L17.7821 9.82501H20.1297V0.15625H18.1273V6.92438Z", + "fill": "white", + "fill-opacity": "0.8" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_5" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask4_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_80" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_6", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask4_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_7" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_8" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_9" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_7", + "d": "M21.7969 2.02094H25.0423V9.82501H27.1139V2.02094H30.3594V0.15625H21.7969V2.02094Z", + "fill": "white", + "fill-opacity": "0.8" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_6" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask5_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_71" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_8", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask5_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_10" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_12" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_9", + "d": "M38.6442 4.00994H34.0871V0.15625H32.0156V9.82501H34.0871V5.87463H38.6442V9.82501H40.7156V0.15625H38.6442V4.00994Z", + "fill": "white", + "fill-opacity": "0.8" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_7" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask6_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_62" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_10", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask6_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_13" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_14" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_15" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_11", + "d": "M45.3376 2.02094H47.893C48.9152 2.02094 49.4539 2.39387 49.4539 3.09831C49.4539 3.80275 48.9152 4.17569 47.893 4.17569H45.3376V2.02094ZM51.5259 3.09831C51.5259 1.27506 50.186 0.15625 47.9897 0.15625H43.2656V9.82501H45.3376V6.04037H47.6443L49.7164 9.82501H52.0094L49.715 5.75211C50.8666 5.30941 51.5259 4.37721 51.5259 3.09831Z", + "fill": "white", + "fill-opacity": "0.8" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_8" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask7_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_53" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_12", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask7_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_16" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_17" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_18" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_13", + "d": "M57.8732 8.05653C56.2438 8.05653 55.2496 6.89631 55.2496 5.00404C55.2496 3.08416 56.2438 1.92394 57.8732 1.92394C59.4887 1.92394 60.4691 3.08416 60.4691 5.00404C60.4691 6.89631 59.4887 8.05653 57.8732 8.05653ZM57.8732 -0.00976562C55.0839 -0.00976562 53.1094 2.06206 53.1094 5.00404C53.1094 7.91841 55.0839 9.99023 57.8732 9.99023C60.6486 9.99023 62.6094 7.91841 62.6094 5.00404C62.6094 2.06206 60.6486 -0.00976562 57.8732 -0.00976562Z", + "fill": "white", + "fill-opacity": "0.8" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_9" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask8_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_44" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_14", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask8_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_19" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_20" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_21" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_15", + "d": "M69.1794 4.45194H66.6233V2.02094H69.1794C70.2019 2.02094 70.7407 2.43532 70.7407 3.23644C70.7407 4.03756 70.2019 4.45194 69.1794 4.45194ZM69.2762 0.15625H64.5508V9.82501H66.6233V6.31662H69.2762C71.473 6.31662 72.8133 5.15637 72.8133 3.23644C72.8133 1.3165 71.473 0.15625 69.2762 0.15625Z", + "fill": "white", + "fill-opacity": "0.8" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_10" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask9_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_35" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_16", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask9_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_22" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_23" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_24" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_17", + "d": "M86.8413 6.57863C86.4823 7.51786 85.7642 8.05653 84.7837 8.05653C83.1542 8.05653 82.16 6.89631 82.16 5.00404C82.16 3.08416 83.1542 1.92394 84.7837 1.92394C85.7642 1.92394 86.4823 2.46261 86.8413 3.40183H89.0369C88.4984 1.33002 86.8827 -0.00976562 84.7837 -0.00976562C81.9942 -0.00976562 80.0195 2.06206 80.0195 5.00404C80.0195 7.91841 81.9942 9.99023 84.7837 9.99023C86.8965 9.99023 88.5122 8.63664 89.0508 6.57863H86.8413Z", + "fill": "white", + "fill-opacity": "0.8" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_11" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask10_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_26" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_18", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask10_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_25" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_26" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_27" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_19", + "d": "M73.6484 0.15625L77.5033 9.82501H79.6172L75.7624 0.15625H73.6484Z", + "fill": "white", + "fill-opacity": "0.8" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "id": "Clip path group_12" + }, + "children": [ + { + "type": "element", + "name": "mask", + "attributes": { + "id": "mask11_5981_52010", + "style": "mask-type:luminance", + "maskUnits": "userSpaceOnUse", + "x": "0", + "y": "-1", + "width": "90", + "height": "11" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "__lottie_element_17" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_20", + "d": "M0 -0.0078125H89.375V9.99219H0V-0.0078125Z", + "fill": "white" + }, + "children": [] + } + ] + } + ] + }, + { + "type": "element", + "name": "g", + "attributes": { + "mask": "url(#mask11_5981_52010)" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_28" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_29" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Group_30" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Vector_21", + "d": "M3.64038 5.99893L4.95938 2.60106L6.27838 5.99893H3.64038ZM3.85422 0.15625L0 9.82501H2.15505L2.9433 7.79456H6.97558L7.76371 9.82501H9.91875L6.06453 0.15625H3.85422Z", + "fill": "white", + "fill-opacity": "0.8" + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "element", + "name": "defs", + "attributes": {}, + "children": [ + { + "type": "element", + "name": "clipPath", + "attributes": { + "id": "clip0_5981_52010" + }, + "children": [ + { + "type": "element", + "name": "rect", + "attributes": { + "width": "89.375", + "height": "10", + "fill": "white" + }, + "children": [] + } + ] + } + ] + } + ] + }, + "name": "AnthropicLight" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/llm/AnthropicLight.tsx b/web/app/components/base/icons/src/public/llm/AnthropicLight.tsx new file mode 100644 index 0000000000..34df60f28c --- /dev/null +++ b/web/app/components/base/icons/src/public/llm/AnthropicLight.tsx @@ -0,0 +1,16 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './AnthropicLight.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconBaseProps, IconData } from '@/app/components/base/icons/IconBase' + +const Icon = React.forwardRef, Omit>(( + props, + ref, +) => ) + +Icon.displayName = 'AnthropicLight' + +export default Icon diff --git a/web/app/components/base/icons/src/public/llm/index.ts b/web/app/components/base/icons/src/public/llm/index.ts index 3545049795..cc9b531ebf 100644 --- a/web/app/components/base/icons/src/public/llm/index.ts +++ b/web/app/components/base/icons/src/public/llm/index.ts @@ -1,3 +1,5 @@ +export { default as AnthropicDark } from './AnthropicDark' +export { default as AnthropicLight } from './AnthropicLight' export { default as AnthropicText } from './AnthropicText' export { default as Anthropic } from './Anthropic' export { default as AzureOpenaiServiceText } from './AzureOpenaiServiceText' diff --git a/web/app/components/header/account-setting/model-provider-page/model-icon/index.tsx b/web/app/components/header/account-setting/model-provider-page/model-icon/index.tsx index 0576672a4f..9fa12825fc 100644 --- a/web/app/components/header/account-setting/model-provider-page/model-icon/index.tsx +++ b/web/app/components/header/account-setting/model-provider-page/model-icon/index.tsx @@ -7,6 +7,7 @@ import { useLanguage } from '../hooks' import { Group } from '@/app/components/base/icons/src/vender/other' import { OpenaiBlue, OpenaiViolet } from '@/app/components/base/icons/src/public/llm' import cn from '@/utils/classnames' +import { renderI18nObject } from '@/hooks/use-i18n' type ModelIconProps = { provider?: Model | ModelProvider @@ -22,16 +23,16 @@ const ModelIcon: FC = ({ }) => { const language = useLanguage() if (provider?.provider.includes('openai') && modelName?.includes('gpt-4o')) - return
+ return
if (provider?.provider.includes('openai') && modelName?.startsWith('gpt-4')) - return
+ return
if (provider?.icon_small) { return (
model-icon
diff --git a/web/app/components/header/account-setting/model-provider-page/provider-icon/index.tsx b/web/app/components/header/account-setting/model-provider-page/provider-icon/index.tsx index 25105b1193..e669b4a38b 100644 --- a/web/app/components/header/account-setting/model-provider-page/provider-icon/index.tsx +++ b/web/app/components/header/account-setting/model-provider-page/provider-icon/index.tsx @@ -1,7 +1,11 @@ import type { FC } from 'react' import type { ModelProvider } from '../declarations' import { useLanguage } from '../hooks' -import { AnthropicText, Openai } from '@/app/components/base/icons/src/vender/other' +import { useAppContext } from '@/context/app-context' +import { Openai } from '@/app/components/base/icons/src/vender/other' +import { AnthropicDark, AnthropicLight } from '@/app/components/base/icons/src/public/llm' +import { renderI18nObject } from '@/hooks/use-i18n' +import { Theme } from '@/types/app' import cn from '@/utils/classnames' type ProviderIconProps = { @@ -12,12 +16,14 @@ const ProviderIcon: FC = ({ provider, className, }) => { + const { theme } = useAppContext() const language = useLanguage() if (provider.provider === 'langgenius/anthropic/anthropic') { return ( -
- +
+ {theme === Theme.dark && } + {theme === Theme.light && }
) } @@ -34,11 +40,11 @@ const ProviderIcon: FC = ({
provider-icon
- {provider.label[language] || provider.label.en_US} + {renderI18nObject(provider.label, language)}
) diff --git a/web/app/components/plugins/card/card-mock.ts b/web/app/components/plugins/card/card-mock.ts deleted file mode 100644 index 201a7bc65d..0000000000 --- a/web/app/components/plugins/card/card-mock.ts +++ /dev/null @@ -1,160 +0,0 @@ -import type { PluginDeclaration } from '../types' -import { PluginType } from '../types' - -export const toolNeko: PluginDeclaration = { - plugin_unique_identifier: 'xxxxxx', - version: '0.0.1', - author: 'langgenius', - name: 'neko', - description: { - en_US: 'Neko is a cute cat.', - zh_Hans: '这是一只可爱的小猫。', - pt_BR: 'Neko is a cute cat.', - ja_JP: 'Neko is a cute cat.', - }, - icon: '241e5209ecc8b5ce6b7a29a8e50388e9c75b89c3047c6ecd8e552f26de758883.svg', - label: { - en_US: 'Neko', - zh_Hans: 'Neko', - pt_BR: 'Neko', - ja_JP: 'Neko', - }, - category: 'extension' as any, - created_at: '2024-07-12T08:03:44.658609Z', - resource: { - memory: 1048576, - permission: { - tool: { - enabled: true, - }, - model: { - enabled: true, - llm: true, - text_embedding: false, - rerank: false, - tts: false, - speech2text: false, - moderation: false, - }, - node: null, - endpoint: { - enabled: true, - }, - storage: { - enabled: true, - size: 1048576, - }, - }, - }, - plugins: { - tools: null, - models: null, - endpoints: [ - 'provider/neko.yaml', - ], - }, - tags: [], - verified: false, - tool: null, - model: null, - endpoint: null, -} - -export const toolNotion = { - type: PluginType.tool, - org: 'Notion', - name: 'notion page search', - version: '1.2.0', - latest_version: '1.3.0', - icon: 'https://via.placeholder.com/150', - label: { - 'en-US': 'Notion Page Search', - 'zh-Hans': 'Notion 页面搜索', - }, - brief: { - 'en-US': 'Description: Search Notion pages and open visited ones faster. No admin access required.More and more info...More and more info...More and more info...', - 'zh-Hans': '搜索 Notion 页面并更快地打开已访问的页面。无需管理员访问权限。More and more info...More and more info...More and more info...', - }, -} - -export const toolNotionManifest: PluginDeclaration = { - version: '1.2.0', - author: 'Notion', - icon: 'https://via.placeholder.com/150', - name: 'notion page search', - category: PluginType.tool, - label: { - 'en-US': 'Notion Page Search', - 'zh-Hans': 'Notion 页面搜索', - }, - description: { - 'en-US': 'Description: Search Notion pages and open visited ones faster. No admin access required.More and more info...More and more info...More and more info...', - 'zh-Hans': '搜索 Notion 页面并更快地打开已访问的页面。无需管理员访问权限。More and more info...More and more info...More and more info...', - }, - created_at: '2022-01-01', - resource: {}, - plugins: {}, - verified: true, - endpoint: { - settings: [], - endpoints: [], - }, - tool: { - } as any, - model: {}, -} - -export const extensionDallE = { - type: PluginType.extension, - org: 'OpenAI', - name: 'DALL-E', - version: '1.1.0', - latest_version: '1.2.0', - install_count: 1234, - icon: 'https://via.placeholder.com/150', - label: { - 'en-US': 'DALL-E', - 'zh-Hans': 'DALL-E', - }, - brief: { - 'en-US': 'Description: A simple plugin to use OpenAI DALL-E model.', - 'zh-Hans': '一个使用 OpenAI DALL-E 模型的简单插件。', - }, -} - -export const modelGPT4 = { - type: PluginType.model, - org: 'OpenAI', - name: 'GPT-4', - version: '1.0.0', - latest_version: '1.0.0', - install_count: 99999, - icon: 'https://via.placeholder.com/150', - label: { - 'en-US': 'GPT-4', - 'zh-Hans': 'GPT-4', - }, - brief: { - 'en-US': 'Description: A simple plugin to use OpenAI GPT-4 model.', - 'zh-Hans': '一个使用 OpenAI GPT-4 模型的简单插件。', - }, -} - -export const customTool = { - type: PluginType.tool, - name: 'notion page search', - version: '1.2.0', - latest_version: '1.3.0', - icon: { - content: '🕵️', - background: '#FEF7C3', - }, - label: { - 'en-US': 'Notion Page Search', - 'zh-Hans': 'Notion 页面搜索', - }, - brief: { - 'en-US': 'Description: Search Notion pages and open visited ones faster. No admin access required.More and more info...More and more info...More and more info...', - 'zh-Hans': '搜索 Notion 页面并更快地打开已访问的页面。无需管理员访问权限。More and more info...More and more info...More and more info...', - }, -} diff --git a/web/hooks/use-i18n.ts b/web/hooks/use-i18n.ts index 261293c86d..d95ef0d114 100644 --- a/web/hooks/use-i18n.ts +++ b/web/hooks/use-i18n.ts @@ -1,6 +1,7 @@ import { useLanguage } from '@/app/components/header/account-setting/model-provider-page/hooks' export const renderI18nObject = (obj: Record, language: string) => { + if (!obj) return '' if (obj?.[language]) return obj[language] if (obj?.en_US) return obj.en_US return Object.values(obj)[0]