From abe26e5c137ee0c46bca765f655187ebf00d2cc7 Mon Sep 17 00:00:00 2001 From: "minghao.yang" Date: Mon, 2 Dec 2024 21:45:33 +0800 Subject: [PATCH 01/11] Prompts Router --- frontend/src/main.js | 6 +++- frontend/src/views/prompts/assistant.html | 5 +++ frontend/src/views/prompts/index.html | 10 ++++++ internal/handlers/render/prompts.go | 37 +++++++++++++++++++++++ internal/handlers/render/registry.go | 3 ++ internal/routes/prompts.go | 10 ++++++ internal/routes/router.go | 3 ++ 7 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 frontend/src/views/prompts/assistant.html create mode 100644 frontend/src/views/prompts/index.html create mode 100644 internal/handlers/render/prompts.go create mode 100644 internal/routes/prompts.go diff --git a/frontend/src/main.js b/frontend/src/main.js index 3ee1f7c3d..b38437a13 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -53,6 +53,8 @@ import Unauthorized from "./components/error/Unauthorized.vue" import LoginFailed from "./components/error/LoginFailed.vue" import FlashMessage from "./components/shared/FlashMessage.vue" import ResourceConsoleIndex from "./components/resource_console/ResourceConsoleIndex.vue" +import PromptsHub from "./components/prompts/PromptsHub.vue" +import PromptsAssistantHub from "./components/prompts/PromptsAssistantHub.vue" // Admin pages import AdminNavbar from "./components/new_admin/AdminNavbar.vue" @@ -107,7 +109,9 @@ const app = createApp({ Unauthorized, LoginFailed, FlashMessage, - ResourceConsoleIndex + ResourceConsoleIndex, + PromptsHub, + PromptsAssistantHub }, provide:{ defaultTags: DEFAULT_TAGS, diff --git a/frontend/src/views/prompts/assistant.html b/frontend/src/views/prompts/assistant.html new file mode 100644 index 000000000..7bf18bbac --- /dev/null +++ b/frontend/src/views/prompts/assistant.html @@ -0,0 +1,5 @@ +{{ define "content" }} +
+ +
+{{ end }} diff --git a/frontend/src/views/prompts/index.html b/frontend/src/views/prompts/index.html new file mode 100644 index 000000000..dfe2bd2af --- /dev/null +++ b/frontend/src/views/prompts/index.html @@ -0,0 +1,10 @@ +{{ define "content" }} +
+ +
+{{ end }} diff --git a/internal/handlers/render/prompts.go b/internal/handlers/render/prompts.go new file mode 100644 index 000000000..a931e38d9 --- /dev/null +++ b/internal/handlers/render/prompts.go @@ -0,0 +1,37 @@ +package renderHandlers + +import ( + "github.com/gin-gonic/gin" +) + +type PromptsHandler interface { + Index(ctx *gin.Context) + Assistant(ctx *gin.Context) +} + +type PromptsHandlerImpl struct { + isSmallFooter bool +} + +func NewPromptsHandler() PromptsHandler { + return &PromptsHandlerImpl{ + isSmallFooter: true, + } +} + +func (i *PromptsHandlerImpl) Index(ctx *gin.Context) { + data := map[string]interface{}{ + "namespace": ctx.Param("namespace"), + "name": ctx.Param("name"), + "path": ctx.Param("path"), + "licenses": string(DefaultLicensesJSON), + "isSmallFooter": i.isSmallFooter, + } + RenderBaseInstance.RenderTemplate(ctx, "prompts_index", data) +} +func (i *PromptsHandlerImpl) Assistant(ctx *gin.Context) { + data := map[string]interface{}{ + "isSmallFooter": i.isSmallFooter, + } + RenderBaseInstance.RenderTemplate(ctx, "prompts_assistant", data) +} diff --git a/internal/handlers/render/registry.go b/internal/handlers/render/registry.go index 4618c43b9..f820df15b 100644 --- a/internal/handlers/render/registry.go +++ b/internal/handlers/render/registry.go @@ -21,6 +21,7 @@ type RenderHandlerRegistry struct { SettingHandler SettingHandler AdminHandler AdminHandler ResourceConsoleHandler ResourceConsoleHandler + PromptsHandler PromptsHandler } func NewHandlersRegistry(svcCtx *svc.ServiceContext) (*RenderHandlerRegistry, error) { @@ -32,6 +33,7 @@ func NewHandlersRegistry(svcCtx *svc.ServiceContext) (*RenderHandlerRegistry, er endpointHandler := NewEndpointHandler() finetuneHandler := NewFinetuneHandler() resourceConsoleHandler := NewResourceConsoleHandler() + promptsHandler := NewPromptsHandler() sessionHandler, err := NewSessionHandler(svcCtx.Config) if err != nil { return nil, fmt.Errorf("failed to create session handler: %w", err) @@ -56,5 +58,6 @@ func NewHandlersRegistry(svcCtx *svc.ServiceContext) (*RenderHandlerRegistry, er SettingHandler: settingHandler, AdminHandler: adminHandler, ResourceConsoleHandler: resourceConsoleHandler, + PromptsHandler: promptsHandler, }, nil } diff --git a/internal/routes/prompts.go b/internal/routes/prompts.go new file mode 100644 index 000000000..ecb047f43 --- /dev/null +++ b/internal/routes/prompts.go @@ -0,0 +1,10 @@ +package routes + +import "github.com/gin-gonic/gin" + +func registerPromptsRoutes(engine *gin.Engine, handlersRegistry *HandlersRegistry) { + engine.GET("/prompts/library/:namespace/:name/:path", handlersRegistry.RenderHandler.PromptsHandler.Index) + engine.GET("/prompts/library/:namespace/:name", handlersRegistry.RenderHandler.PromptsHandler.Index) + engine.GET("/prompts/library", handlersRegistry.RenderHandler.PromptsHandler.Index) + engine.GET("/prompts/optimization-assistant", handlersRegistry.RenderHandler.PromptsHandler.Assistant) +} diff --git a/internal/routes/router.go b/internal/routes/router.go index 0101795e0..6d0c7acbd 100644 --- a/internal/routes/router.go +++ b/internal/routes/router.go @@ -152,6 +152,8 @@ func createRender() multitemplate.Renderer { "settings_starship_access_token": "settings/starship_access_token.html", "settings_sync_access_token": "settings/sync_access_token.html", "settings_ssh_keys": "settings/ssh_keys.html", + "prompts_index": "prompts/index.html", + "prompts_assistant": "prompts/assistant.html", } for name, page := range pages { @@ -212,6 +214,7 @@ func setupViewsRouter(engine *gin.Engine, handlersRegistry *HandlersRegistry) { registerSettingRoutes(engine, handlersRegistry) registerResourceConsoleRoutes(engine, handlersRegistry) registerAdminRoutes(engine, handlersRegistry) + registerPromptsRoutes(engine, handlersRegistry) } func setupStaticRouter(engine *gin.Engine) { From c62b8328e493f47daa3ea1bb40afa2c4a2f97957 Mon Sep 17 00:00:00 2001 From: "minghao.yang" Date: Mon, 2 Dec 2024 21:52:17 +0800 Subject: [PATCH 02/11] Prompts Icon --- .../images/icons/prompt_card_settgins.svg | 6 ++ .../public/images/icons/prompting_navbar.svg | 3 + frontend/public/images/icons/prompts_Code.svg | 3 + .../images/icons/prompts_CreativeWriting.svg | 10 ++ .../images/icons/prompts_DataAnalysis.svg | 3 + .../public/images/icons/prompts_Design.svg | 10 ++ .../public/images/icons/prompts_Education.svg | 3 + .../public/images/icons/prompts_Image.svg | 3 + .../public/images/icons/prompts_Marketing.svg | 10 ++ .../public/images/icons/prompts_Music.svg | 3 + .../images/icons/prompts_Personalization.svg | 10 ++ .../public/images/icons/prompts_Research.svg | 10 ++ .../images/icons/prompts_TechnicalWriting.svg | 10 ++ .../public/images/icons/prompts_Video.svg | 4 + frontend/public/images/icons/prompts_bg.svg | 87 +++++++++++++++ .../public/images/icons/prompts_bg_user.svg | 100 ++++++++++++++++++ frontend/public/images/icons/prompts_copy.svg | 10 ++ frontend/public/images/icons/prompts_file.svg | 4 + .../images/icons/prompts_file_selected.svg | 4 + .../public/images/icons/prompts_history.svg | 3 + .../images/icons/prompts_layout_left.svg | 3 + .../public/images/icons/prompts_library.svg | 4 + .../images/icons/prompts_library_selected.svg | 4 + .../images/icons/prompts_model_comparison.svg | 4 + .../prompts_model_comparison_selected.svg | 4 + .../icons/prompts_optimization_assistant.svg | 4 + ...rompts_optimization_assistant_selected.svg | 4 + frontend/public/images/icons/prompts_pipe.svg | 3 + .../public/images/icons/prompts_reAnswer.svg | 14 +++ .../icons/prompts_relations_library.svg | 11 ++ .../public/images/icons/prompts_source.svg | 10 ++ 31 files changed, 361 insertions(+) create mode 100644 frontend/public/images/icons/prompt_card_settgins.svg create mode 100644 frontend/public/images/icons/prompting_navbar.svg create mode 100644 frontend/public/images/icons/prompts_Code.svg create mode 100644 frontend/public/images/icons/prompts_CreativeWriting.svg create mode 100644 frontend/public/images/icons/prompts_DataAnalysis.svg create mode 100644 frontend/public/images/icons/prompts_Design.svg create mode 100644 frontend/public/images/icons/prompts_Education.svg create mode 100644 frontend/public/images/icons/prompts_Image.svg create mode 100644 frontend/public/images/icons/prompts_Marketing.svg create mode 100644 frontend/public/images/icons/prompts_Music.svg create mode 100644 frontend/public/images/icons/prompts_Personalization.svg create mode 100644 frontend/public/images/icons/prompts_Research.svg create mode 100644 frontend/public/images/icons/prompts_TechnicalWriting.svg create mode 100644 frontend/public/images/icons/prompts_Video.svg create mode 100644 frontend/public/images/icons/prompts_bg.svg create mode 100644 frontend/public/images/icons/prompts_bg_user.svg create mode 100644 frontend/public/images/icons/prompts_copy.svg create mode 100644 frontend/public/images/icons/prompts_file.svg create mode 100644 frontend/public/images/icons/prompts_file_selected.svg create mode 100644 frontend/public/images/icons/prompts_history.svg create mode 100644 frontend/public/images/icons/prompts_layout_left.svg create mode 100644 frontend/public/images/icons/prompts_library.svg create mode 100644 frontend/public/images/icons/prompts_library_selected.svg create mode 100644 frontend/public/images/icons/prompts_model_comparison.svg create mode 100644 frontend/public/images/icons/prompts_model_comparison_selected.svg create mode 100644 frontend/public/images/icons/prompts_optimization_assistant.svg create mode 100644 frontend/public/images/icons/prompts_optimization_assistant_selected.svg create mode 100644 frontend/public/images/icons/prompts_pipe.svg create mode 100644 frontend/public/images/icons/prompts_reAnswer.svg create mode 100644 frontend/public/images/icons/prompts_relations_library.svg create mode 100644 frontend/public/images/icons/prompts_source.svg diff --git a/frontend/public/images/icons/prompt_card_settgins.svg b/frontend/public/images/icons/prompt_card_settgins.svg new file mode 100644 index 000000000..053e29f16 --- /dev/null +++ b/frontend/public/images/icons/prompt_card_settgins.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompting_navbar.svg b/frontend/public/images/icons/prompting_navbar.svg new file mode 100644 index 000000000..0761f66f8 --- /dev/null +++ b/frontend/public/images/icons/prompting_navbar.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_Code.svg b/frontend/public/images/icons/prompts_Code.svg new file mode 100644 index 000000000..2448fbc5c --- /dev/null +++ b/frontend/public/images/icons/prompts_Code.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_CreativeWriting.svg b/frontend/public/images/icons/prompts_CreativeWriting.svg new file mode 100644 index 000000000..d0bea1333 --- /dev/null +++ b/frontend/public/images/icons/prompts_CreativeWriting.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_DataAnalysis.svg b/frontend/public/images/icons/prompts_DataAnalysis.svg new file mode 100644 index 000000000..fc9c721ee --- /dev/null +++ b/frontend/public/images/icons/prompts_DataAnalysis.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_Design.svg b/frontend/public/images/icons/prompts_Design.svg new file mode 100644 index 000000000..c3921bb3d --- /dev/null +++ b/frontend/public/images/icons/prompts_Design.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_Education.svg b/frontend/public/images/icons/prompts_Education.svg new file mode 100644 index 000000000..60479fcc0 --- /dev/null +++ b/frontend/public/images/icons/prompts_Education.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_Image.svg b/frontend/public/images/icons/prompts_Image.svg new file mode 100644 index 000000000..2e7f45e9d --- /dev/null +++ b/frontend/public/images/icons/prompts_Image.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_Marketing.svg b/frontend/public/images/icons/prompts_Marketing.svg new file mode 100644 index 000000000..a595f15b2 --- /dev/null +++ b/frontend/public/images/icons/prompts_Marketing.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_Music.svg b/frontend/public/images/icons/prompts_Music.svg new file mode 100644 index 000000000..ff69db266 --- /dev/null +++ b/frontend/public/images/icons/prompts_Music.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_Personalization.svg b/frontend/public/images/icons/prompts_Personalization.svg new file mode 100644 index 000000000..7aba2a88d --- /dev/null +++ b/frontend/public/images/icons/prompts_Personalization.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_Research.svg b/frontend/public/images/icons/prompts_Research.svg new file mode 100644 index 000000000..78e09afca --- /dev/null +++ b/frontend/public/images/icons/prompts_Research.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_TechnicalWriting.svg b/frontend/public/images/icons/prompts_TechnicalWriting.svg new file mode 100644 index 000000000..895060933 --- /dev/null +++ b/frontend/public/images/icons/prompts_TechnicalWriting.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_Video.svg b/frontend/public/images/icons/prompts_Video.svg new file mode 100644 index 000000000..d07d4a7a8 --- /dev/null +++ b/frontend/public/images/icons/prompts_Video.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_bg.svg b/frontend/public/images/icons/prompts_bg.svg new file mode 100644 index 000000000..c8dd87956 --- /dev/null +++ b/frontend/public/images/icons/prompts_bg.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_bg_user.svg b/frontend/public/images/icons/prompts_bg_user.svg new file mode 100644 index 000000000..0951ebb95 --- /dev/null +++ b/frontend/public/images/icons/prompts_bg_user.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_copy.svg b/frontend/public/images/icons/prompts_copy.svg new file mode 100644 index 000000000..106a5c975 --- /dev/null +++ b/frontend/public/images/icons/prompts_copy.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_file.svg b/frontend/public/images/icons/prompts_file.svg new file mode 100644 index 000000000..b0d93f98f --- /dev/null +++ b/frontend/public/images/icons/prompts_file.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_file_selected.svg b/frontend/public/images/icons/prompts_file_selected.svg new file mode 100644 index 000000000..0bd844cba --- /dev/null +++ b/frontend/public/images/icons/prompts_file_selected.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_history.svg b/frontend/public/images/icons/prompts_history.svg new file mode 100644 index 000000000..cb0c75da2 --- /dev/null +++ b/frontend/public/images/icons/prompts_history.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_layout_left.svg b/frontend/public/images/icons/prompts_layout_left.svg new file mode 100644 index 000000000..ddbd6c8ad --- /dev/null +++ b/frontend/public/images/icons/prompts_layout_left.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_library.svg b/frontend/public/images/icons/prompts_library.svg new file mode 100644 index 000000000..1b463cbac --- /dev/null +++ b/frontend/public/images/icons/prompts_library.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_library_selected.svg b/frontend/public/images/icons/prompts_library_selected.svg new file mode 100644 index 000000000..d689d6498 --- /dev/null +++ b/frontend/public/images/icons/prompts_library_selected.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_model_comparison.svg b/frontend/public/images/icons/prompts_model_comparison.svg new file mode 100644 index 000000000..e5c7874d0 --- /dev/null +++ b/frontend/public/images/icons/prompts_model_comparison.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_model_comparison_selected.svg b/frontend/public/images/icons/prompts_model_comparison_selected.svg new file mode 100644 index 000000000..46522576e --- /dev/null +++ b/frontend/public/images/icons/prompts_model_comparison_selected.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_optimization_assistant.svg b/frontend/public/images/icons/prompts_optimization_assistant.svg new file mode 100644 index 000000000..e24a30067 --- /dev/null +++ b/frontend/public/images/icons/prompts_optimization_assistant.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_optimization_assistant_selected.svg b/frontend/public/images/icons/prompts_optimization_assistant_selected.svg new file mode 100644 index 000000000..66b49ece4 --- /dev/null +++ b/frontend/public/images/icons/prompts_optimization_assistant_selected.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_pipe.svg b/frontend/public/images/icons/prompts_pipe.svg new file mode 100644 index 000000000..23b9c246a --- /dev/null +++ b/frontend/public/images/icons/prompts_pipe.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_reAnswer.svg b/frontend/public/images/icons/prompts_reAnswer.svg new file mode 100644 index 000000000..184e6286a --- /dev/null +++ b/frontend/public/images/icons/prompts_reAnswer.svg @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_relations_library.svg b/frontend/public/images/icons/prompts_relations_library.svg new file mode 100644 index 000000000..2d1eb7a92 --- /dev/null +++ b/frontend/public/images/icons/prompts_relations_library.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/public/images/icons/prompts_source.svg b/frontend/public/images/icons/prompts_source.svg new file mode 100644 index 000000000..7fd3af385 --- /dev/null +++ b/frontend/public/images/icons/prompts_source.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file From 48ede5e6f500d0c183279ad6a1d611d3b3c719af Mon Sep 17 00:00:00 2001 From: "minghao.yang" Date: Mon, 2 Dec 2024 21:53:15 +0800 Subject: [PATCH 03/11] Prompts components --- .../src/components/prompts/EditPrompt.vue | 329 ++++++++++ frontend/src/components/prompts/NewPrompt.vue | 324 ++++++++++ .../src/components/prompts/NewPromptsList.vue | 332 ++++++++++ .../prompts/PromptRelationsCard.vue | 80 +++ .../components/prompts/PromptsAssistant.vue | 398 ++++++++++++ .../prompts/PromptsAssistantHub.vue | 19 + .../components/prompts/PromptsBreadCrumbs.vue | 83 +++ .../src/components/prompts/PromptsCard.vue | 160 +++++ .../src/components/prompts/PromptsChat.vue | 589 ++++++++++++++++++ .../prompts/PromptsDatasetsCard.vue | 54 ++ .../src/components/prompts/PromptsDetails.vue | 192 ++++++ .../src/components/prompts/PromptsHub.vue | 32 + .../src/components/prompts/PromptsIndex.vue | 117 ++++ .../src/components/prompts/PromptsLibrary.vue | 86 +++ .../src/components/prompts/PromptsList.vue | 359 +++++++++++ .../prompts/PromptsListSettings.vue | 439 +++++++++++++ .../src/components/prompts/PromptsMenu.vue | 62 ++ .../components/prompts/PromptsMobileMenu.vue | 92 +++ .../src/components/prompts/PromptsTags.vue | 33 + .../src/components/prompts/promptsOptions.js | 30 + 20 files changed, 3810 insertions(+) create mode 100644 frontend/src/components/prompts/EditPrompt.vue create mode 100644 frontend/src/components/prompts/NewPrompt.vue create mode 100644 frontend/src/components/prompts/NewPromptsList.vue create mode 100644 frontend/src/components/prompts/PromptRelationsCard.vue create mode 100644 frontend/src/components/prompts/PromptsAssistant.vue create mode 100644 frontend/src/components/prompts/PromptsAssistantHub.vue create mode 100644 frontend/src/components/prompts/PromptsBreadCrumbs.vue create mode 100644 frontend/src/components/prompts/PromptsCard.vue create mode 100644 frontend/src/components/prompts/PromptsChat.vue create mode 100644 frontend/src/components/prompts/PromptsDatasetsCard.vue create mode 100644 frontend/src/components/prompts/PromptsDetails.vue create mode 100644 frontend/src/components/prompts/PromptsHub.vue create mode 100644 frontend/src/components/prompts/PromptsIndex.vue create mode 100644 frontend/src/components/prompts/PromptsLibrary.vue create mode 100644 frontend/src/components/prompts/PromptsList.vue create mode 100644 frontend/src/components/prompts/PromptsListSettings.vue create mode 100644 frontend/src/components/prompts/PromptsMenu.vue create mode 100644 frontend/src/components/prompts/PromptsMobileMenu.vue create mode 100644 frontend/src/components/prompts/PromptsTags.vue create mode 100644 frontend/src/components/prompts/promptsOptions.js diff --git a/frontend/src/components/prompts/EditPrompt.vue b/frontend/src/components/prompts/EditPrompt.vue new file mode 100644 index 000000000..6a88c132c --- /dev/null +++ b/frontend/src/components/prompts/EditPrompt.vue @@ -0,0 +1,329 @@ + + + + diff --git a/frontend/src/components/prompts/NewPrompt.vue b/frontend/src/components/prompts/NewPrompt.vue new file mode 100644 index 000000000..9f8763e61 --- /dev/null +++ b/frontend/src/components/prompts/NewPrompt.vue @@ -0,0 +1,324 @@ + + + + diff --git a/frontend/src/components/prompts/NewPromptsList.vue b/frontend/src/components/prompts/NewPromptsList.vue new file mode 100644 index 000000000..7cdce7525 --- /dev/null +++ b/frontend/src/components/prompts/NewPromptsList.vue @@ -0,0 +1,332 @@ + + + + diff --git a/frontend/src/components/prompts/PromptRelationsCard.vue b/frontend/src/components/prompts/PromptRelationsCard.vue new file mode 100644 index 000000000..001baa70c --- /dev/null +++ b/frontend/src/components/prompts/PromptRelationsCard.vue @@ -0,0 +1,80 @@ + + + diff --git a/frontend/src/components/prompts/PromptsAssistant.vue b/frontend/src/components/prompts/PromptsAssistant.vue new file mode 100644 index 000000000..5338bb542 --- /dev/null +++ b/frontend/src/components/prompts/PromptsAssistant.vue @@ -0,0 +1,398 @@ + + + + diff --git a/frontend/src/components/prompts/PromptsAssistantHub.vue b/frontend/src/components/prompts/PromptsAssistantHub.vue new file mode 100644 index 000000000..a0e9c59e0 --- /dev/null +++ b/frontend/src/components/prompts/PromptsAssistantHub.vue @@ -0,0 +1,19 @@ + + + diff --git a/frontend/src/components/prompts/PromptsBreadCrumbs.vue b/frontend/src/components/prompts/PromptsBreadCrumbs.vue new file mode 100644 index 000000000..0eccf9f02 --- /dev/null +++ b/frontend/src/components/prompts/PromptsBreadCrumbs.vue @@ -0,0 +1,83 @@ + + + diff --git a/frontend/src/components/prompts/PromptsCard.vue b/frontend/src/components/prompts/PromptsCard.vue new file mode 100644 index 000000000..0310266a6 --- /dev/null +++ b/frontend/src/components/prompts/PromptsCard.vue @@ -0,0 +1,160 @@ + + + diff --git a/frontend/src/components/prompts/PromptsChat.vue b/frontend/src/components/prompts/PromptsChat.vue new file mode 100644 index 000000000..6d1fbebce --- /dev/null +++ b/frontend/src/components/prompts/PromptsChat.vue @@ -0,0 +1,589 @@ + + + + diff --git a/frontend/src/components/prompts/PromptsDatasetsCard.vue b/frontend/src/components/prompts/PromptsDatasetsCard.vue new file mode 100644 index 000000000..94cff7fa7 --- /dev/null +++ b/frontend/src/components/prompts/PromptsDatasetsCard.vue @@ -0,0 +1,54 @@ + + + diff --git a/frontend/src/components/prompts/PromptsDetails.vue b/frontend/src/components/prompts/PromptsDetails.vue new file mode 100644 index 000000000..ea4190b83 --- /dev/null +++ b/frontend/src/components/prompts/PromptsDetails.vue @@ -0,0 +1,192 @@ + + + + diff --git a/frontend/src/components/prompts/PromptsHub.vue b/frontend/src/components/prompts/PromptsHub.vue new file mode 100644 index 000000000..0ccde8345 --- /dev/null +++ b/frontend/src/components/prompts/PromptsHub.vue @@ -0,0 +1,32 @@ + + + diff --git a/frontend/src/components/prompts/PromptsIndex.vue b/frontend/src/components/prompts/PromptsIndex.vue new file mode 100644 index 000000000..50ce8475c --- /dev/null +++ b/frontend/src/components/prompts/PromptsIndex.vue @@ -0,0 +1,117 @@ + + + + diff --git a/frontend/src/components/prompts/PromptsLibrary.vue b/frontend/src/components/prompts/PromptsLibrary.vue new file mode 100644 index 000000000..8f03092c5 --- /dev/null +++ b/frontend/src/components/prompts/PromptsLibrary.vue @@ -0,0 +1,86 @@ + + + + diff --git a/frontend/src/components/prompts/PromptsList.vue b/frontend/src/components/prompts/PromptsList.vue new file mode 100644 index 000000000..f7b37897b --- /dev/null +++ b/frontend/src/components/prompts/PromptsList.vue @@ -0,0 +1,359 @@ + + + + + diff --git a/frontend/src/components/prompts/PromptsListSettings.vue b/frontend/src/components/prompts/PromptsListSettings.vue new file mode 100644 index 000000000..c13402765 --- /dev/null +++ b/frontend/src/components/prompts/PromptsListSettings.vue @@ -0,0 +1,439 @@ + + + diff --git a/frontend/src/components/prompts/PromptsMenu.vue b/frontend/src/components/prompts/PromptsMenu.vue new file mode 100644 index 000000000..466d1d2ae --- /dev/null +++ b/frontend/src/components/prompts/PromptsMenu.vue @@ -0,0 +1,62 @@ + + + diff --git a/frontend/src/components/prompts/PromptsMobileMenu.vue b/frontend/src/components/prompts/PromptsMobileMenu.vue new file mode 100644 index 000000000..f15c8a04f --- /dev/null +++ b/frontend/src/components/prompts/PromptsMobileMenu.vue @@ -0,0 +1,92 @@ + + + diff --git a/frontend/src/components/prompts/PromptsTags.vue b/frontend/src/components/prompts/PromptsTags.vue new file mode 100644 index 000000000..1e85061f6 --- /dev/null +++ b/frontend/src/components/prompts/PromptsTags.vue @@ -0,0 +1,33 @@ + + + diff --git a/frontend/src/components/prompts/promptsOptions.js b/frontend/src/components/prompts/promptsOptions.js new file mode 100644 index 000000000..40c5cd825 --- /dev/null +++ b/frontend/src/components/prompts/promptsOptions.js @@ -0,0 +1,30 @@ +// src/options.js +import { useI18n } from 'vue-i18n' + +export const useLangOptions = () => { + const { t } = useI18n() + return [ + { id: 0, label: t('prompts.placeholderLang'), value: '' }, + { id: 1, label: t('languages.Chinese'), value: 'zh' }, + { id: 2, label: t('languages.English'), value: 'en' } + ] +} + +export const useTagOptions = () => { + const { t } = useI18n() + return [ + { id: 0, value: '', label: t('prompts.placeholderTag') }, + { id: 1, value: 'Image', label: t('prompts.tag.Image') }, + { id: 2, value: 'Video', label: t('prompts.tag.Video') }, + { id: 3, value: 'Music', label: t('prompts.tag.Music') }, + { id: 4, value: 'Code', label: t('prompts.tag.Code') }, + { id: 5, value: 'DataAnalysis', label: t('prompts.tag.DataAnalysis') }, + { id: 6, value: 'Research', label: t('prompts.tag.Research') }, + { id: 7, value: 'Personalization', label: t('prompts.tag.Personalization') }, + { id: 8, value: 'CreativeWriting', label: t('prompts.tag.CreativeWriting') }, + { id: 9, value: 'TechnicalWriting', label: t('prompts.tag.TechnicalWriting') }, + { id: 10, value: 'Design', label: t('prompts.tag.Design') }, + { id: 11, value: 'Marketing', label: t('prompts.tag.Marketing') }, + { id: 12, value: 'Education', label: t('prompts.tag.Education') } + ] +} \ No newline at end of file From 80155d693fadb31c6fe8bc1f11001214b6a13f92 Mon Sep 17 00:00:00 2001 From: "minghao.yang" Date: Mon, 2 Dec 2024 21:56:32 +0800 Subject: [PATCH 04/11] Prompts pic --- frontend/public/images/opencsg_avatar.png | Bin 0 -> 1769 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 frontend/public/images/opencsg_avatar.png diff --git a/frontend/public/images/opencsg_avatar.png b/frontend/public/images/opencsg_avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..15090a667593cdc199236ee023fcf878c8ad5acc GIT binary patch literal 1769 zcmV`p}n7ANtnXKD0CKv?K4% zRN6XYm#Nqptn8a4-m z!Q;5F4-K%TfKIaM>1l@VouqeRxuA&se*f{AnHjcRkR!APt@W_R&7n}pCMDvfKx@!i zi)BN$fblAoO4X2;mzVWIC^iF~6Hf4iL*S1@pdc>~60@@qiN`@96QD?^h3cXbP$?8y zh9Z%OJrD>SG8&C-i#kAFqVda_#xW2$-*+FPXy{=1CK#KVf)=L(CV~OLLWE+i4l0es zP@>mE`}i2d5(#+LydLC&kmUr9{aB#(EC*h%<6Ts;7pW_2c{SrXMQX=g2V4)UtPPzufO+n zFq_YtRTE?@Ed!ML+}vCnjcI_&UR;cDn~IpJ{S4*vX#-3qyK1r%!XL9fb%Xd(_X zID*j`zFMWx#JALQLEGG z(mbpzDh91m1#fTP$p$l+w#e!KVT{vNqdKi?c=8pK+U=hu*Fye)=3YP zs|w+biYnY085C*LZD7G0kYQ_O_~)cXqj?u3fQ-NXb3MP8qhl4AUNuHZwUR``;iEiz zQh>ZrufV2K1rqUT;{|@DXup5u2y84g^8X#82(SI}9p{HHuU>>Rhu@R59@!S~WSFH) zwuzH`D+nL$tw|Xtlo|~1!R}}H{hiTaaD@U=mZa@9qZ5LpMj?j7sr!Xe{8X7Gb?**^ zKnlpV01_dW|38&_LMHr?X;=;fJW`T`15vMHj@y4glF7uW_7;AnIhKNzAO&Qb+Lj&1 zl7*;6*4vBc`0CIgoNjOB#B^x$HqH^}`?}!Q&Ie8I#f@7)jYK06b|RvBgTe5Ql-Wej zum1F)+84qatsWYV90gOxnO_V@$MphAs4K*5^Kogg51NriiH-@@NjD7PDNrkvaOTaU zJW3*{B#4rqLjt1X7oSbQSilc`9ykAu+VeldHn?c*O|wBZNk8&7OnPsA$GT=8V7}=v z`x?6%?_QB<)?~A?&hatc^=O2!6Lz`Ac_$2^Y@=sL&8*MsVwVT|Q{9oeDAF@)xZln) zKsgozCAMekj?Ul|JdcWr=AQ0o<*k|M`|*;pw6#$c(fB;=A$n9tl6pQ! zOq}cK;!%8ay^*JqKoRzOTnr@{Pj$Czf{Ak}$NgttH2uYT-4m>F5XH=-Crglcz23T{ zT}hJcx_uB{+O(DH!f}jpcgb4VxN=oWWDxZZOnTwwupPUe7HZ7pSir-aF-!H?lFa3D zRa-0;G0g#j)9Ezp_4+JPO6hI1_4Cg61gaaW*8{ha^ONjHDX%t_V1HNzSOc7lUdEFm zEFelnQQU7bne15^NCLg9%FoYVP?nPh=*8oO1;~#f9XYBAl4N?78dji8uUKv34rO97 zS-v1B6ZA2WSrf}a^23DIgogpu1Qq7=TyZT2^jSv*XS3NJ?$azY8${RSh?I;_#6)bw zEmESEfkaRgDBWsNyw;$i-Hx`*Ni8wgQSInp8%EuP#?L0Jd@1|~&D*nFcwLyg00000 LNkvXXu0mjfHhxbo literal 0 HcmV?d00001 From d193332547fcf3067aa7d01610baad5075c66209 Mon Sep 17 00:00:00 2001 From: "minghao.yang" Date: Mon, 2 Dec 2024 22:01:14 +0800 Subject: [PATCH 05/11] Prompts i18n --- frontend/src/locales/en.js | 4 +- frontend/src/locales/en_js/prompts.js | 119 ++++++++++++++++++++++++++ frontend/src/locales/zh.js | 4 +- frontend/src/locales/zh_js/prompts.js | 118 +++++++++++++++++++++++++ 4 files changed, 243 insertions(+), 2 deletions(-) create mode 100644 frontend/src/locales/en_js/prompts.js create mode 100644 frontend/src/locales/zh_js/prompts.js diff --git a/frontend/src/locales/en.js b/frontend/src/locales/en.js index 946681704..6a256dea9 100644 --- a/frontend/src/locales/en.js +++ b/frontend/src/locales/en.js @@ -26,6 +26,7 @@ import { resourceConsole } from './en_js/resource_console'; import { tags } from './en_js/tags'; import { languages } from './en_js/languages'; import { errors_page } from './en_js/error'; +import { prompts } from './en_js/prompts'; export default { all, @@ -55,5 +56,6 @@ export default { resourceConsole, tags, languages, - errors_page + errors_page, + prompts }; diff --git a/frontend/src/locales/en_js/prompts.js b/frontend/src/locales/en_js/prompts.js new file mode 100644 index 000000000..db78f1a37 --- /dev/null +++ b/frontend/src/locales/en_js/prompts.js @@ -0,0 +1,119 @@ +export const prompts = { + relationModel: "Correlation model:", + relationPrompts: "Correlation prompts", + openUp: "Open up", + closeUp: "Close up", + updateAt:"Change time:", + placeholder: "Search prompts", + placeholderLang:"Language", + placeholderTag:"Tag", + promptLibrary: "Prompt Library", + optimizationAssistant: "Prompt Optimizer", + modelComparison: "Model Arena", + promptContent: "Prompt Content", + copy: "Copy", + edit: "Edit", + title:'Title', + history:'History', + historyChat:'History', + newConversation:'New Conversation', + new:'New', + edit:'Edit', + del:'Delete', + chatTip:'I can help you generate or optimize prompt words!', + chatTip1:'Please click on historical conversations or create a new conversation.', + reAnswer:'ReAnswer', + send:'Send', + startChat:'Start chat', + titlePlaceholder:'Please enter a title', + newPrompt: 'New', + newPromptsList: 'Create', + settings: 'Settings', + noPrompt: 'No prompt word is available', + promptsName: 'Prompt library name', + promptsNameTips: 'This parameter is used to display the prompt library name and cannot be changed after creation', + promptsNickName: 'Prompt Library alias', + promptsDesc: 'Prompt Library description', + relatedModel: 'Correlation model', + editPrompt: "Edit Prompt", + delTitle: "Delete Content", + delContent: "Are you sure you want to remove the prompt word? This action cannot be undone", + tag: { + Image: 'Image Generation', + Video: 'Video Generation', + Music: 'Music Generation', + Code: 'Code Generation', + DataAnalysis: 'Data Analysis', + Research: 'Research', + Personalization: 'Personalization', + CreativeWriting: 'Creative Writing', + TechnicalWriting: 'Technical Writing', + Design: 'Design', + Marketing: 'Marketing', + Education: 'Education' + }, + tips:{ + tip1:'Help me to optimize this prompt for image generation: a cute puppy', + tip2:'Help me to design a prompt for restaurant review ', + tip3:'Help me to create a prompt for article generation' + }, + newList: { + title: "New Prompt Library", + titleTips: "This parameter applies to the prompt library and cannot be changed after it is created", + titleDesc: "The repository contains a history of all model files and revisions", + owner: "Owner", + promptsName: "Prompt library English name of the vocabulary", + promptsNickName: "Prompt library alias", + license: "License", + promptsDesc: "Prompt library description", + public: "Public", + publicDesc: "Anyone on the internet can see this prompt library. Only you (personal model) or members of your organization can commit.", + private: "Private", + privateDesc: "Only you (personal prompt library) or members of your organization can see and commit to this prompt library.", + createPrompts: "Create", + createSuccess: "prompt library created successfully", + tip: "Applies to prompt library data and cannot be changed after creation", + createFail: "Prompt library creation failed", + PromptsEnName: "Prompt library English name", + promptsName: "Prompt library name" + }, + new: { + titleTips: "This parameter applies to the prompt and cannot be changed after it is created", + newPrompt: "New Prompt", + title: "Title", + language: "Language", + scene: "Tag", + content: "Content", + origin: "Source", + promptName: "Prompt name", + promptContent: "Prompt content", + createSuccess: "Prompt is created successfully", + createFail: "Failed to create a prompt", + }, + update: { + updateSuccess: "Prompt is updated successfully", + updateFail: "Failed to update a prompt", + }, + listSettings: { + settings: "Settings", + tips: "Will be displayed on the prompt list page, optional", + tips2: "An introduction about the prompt, optional", + tips3: "Select industry labels, users can filter prompts by labels", + changeVisibility: "Change prompt visibility", + statusText: "The current prompt is now", + status: "Status.", + promptsVisibility: "Prompt visibility", + delPrompts: "Delete prompt", + canNot: "cannot", + delTips: "This operation will", + delTips2: "be undone and will permanently delete the prompt repository", + delTips3: "and all its files.", + privateVis: "Only creator or members of your organization can see", + publicVis: "Anyone can see this prompt", + confirmDel: "I understand and confirm deletion", + privateInfo: ", only the creator or organization admin can make submissions", + publicInfo: ", visible to anyone on the internet.", + needPromptsName: "Please provide a prompt nickname first", + needPromptsDesc: "Please provide a prompt description first" + } +} \ No newline at end of file diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js index fa64e8a82..6b1ff450d 100644 --- a/frontend/src/locales/zh.js +++ b/frontend/src/locales/zh.js @@ -26,6 +26,7 @@ import { resourceConsole } from './zh_js/resource_console'; import { tags } from './zh_js/tags'; import { languages } from './zh_js/languages'; import { errors_page } from './zh_js/error'; +import { prompts } from './zh_js/prompts'; export default { all, @@ -55,5 +56,6 @@ export default { resourceConsole, tags, languages, - errors_page + errors_page, + prompts }; diff --git a/frontend/src/locales/zh_js/prompts.js b/frontend/src/locales/zh_js/prompts.js new file mode 100644 index 000000000..f8ac9a0dd --- /dev/null +++ b/frontend/src/locales/zh_js/prompts.js @@ -0,0 +1,118 @@ +export const prompts = { + relationModel: "关联模型:", + relationPrompts: "关联提示词库", + openUp: "展开", + closeUp: "收起", + updateAt:"变更时间:", + placeholder: "搜索", + placeholderLang:"语言", + placeholderTag:"场景", + promptLibrary: "提示词库", + optimizationAssistant: "优化助手", + modelComparison: "模型对比", + promptContent: "词库内容", + copy:"复制", + edit:"编辑", + title:'标题', + history:'历史记录', + historyChat:'历史对话', + newConversation:'新建对话', + edit:'编辑', + del:'删除', + chatTip:'我可以帮助您生成或者优化提示词!', + chatTip1:'请点击历史对话或者新建对话。', + reAnswer:'重新生成', + send:'发送', + startChat:'开始对话', + titlePlaceholder:'请输入标题', + newPrompt: '新建提示词', + newPromptsList: '新建提示词库', + settings: '设置', + noPrompt: '当前暂无提示词', + promptsName: '提示词库名称', + promptsNameTips: '应用于提示库名称展示,创建后不可更改', + promptsNickName: '提示词库别名', + promptsDesc: '提示词库介绍', + relatedModel: '关联模型', + editPrompt: "编辑提示词", + delTitle: "删除内容", + delContent: "你确定要删除该提示词吗?此操作不能撤消", + tag: { + Image: '图像生成', + Video: '视频生成', + Music: '音乐生成', + Code: '代码生成', + DataAnalysis: '数据分析', + Research: '研究', + Personalization: '个性化', + CreativeWriting: '创意写作', + TechnicalWriting: '技术写作', + Design: '设计', + Marketing: '市场营销', + Education: '教育' + }, + tips:{ + tip1:'帮我优化图片生成的提示:一只可爱的小狗', + tip2:'帮我设计一个写餐厅好评的提示词', + tip3:'帮我设计一段文案生成提示词' + }, + newList: { + title: "新建提示词库", + titleTips: "应用于提示词库,创建后不可更改", + titleDesc: "仓库包含所有的模型文件和修订的历史记录", + owner: "所有者", + promptsName: "提示词库英文名称", + promptsNickName: "提示词库别名", + license: "许可证", + promptsDesc: "提示词库介绍", + public: "公开", + publicDesc: "任何互联网上的人都可以看到这个提示词库。只有你(个人)或你所在组织的成员可以提交。", + private: "私有", + privateDesc: "只有你(个人)或你所在组织的成员可以看到并提交到这个提示词库。", + createPrompts: "创建提示词库", + createSuccess: "提示词库创建成功", + tip: "应用于提示词库数据,创建后不可更改", + createFail: "创建提示词库失败", + PromptsEnName: "提示词库英文名称", + promptsName: "提示词库名称", + }, + new: { + titleTips: "应用于提示词,创建后不可更改", + newPrompt: "新建提示词", + title: "提示词标题", + language: "语言", + scene: "场景", + content: "提示词内容", + origin: "来源", + promptName: "提示词名称", + promptContent: "提示词内容", + createSuccess: "提示词库创建成功", + createFail: "创建提示词库失败", + }, + update: { + updateSuccess: "提示词库更新成功", + updateFail: "更新提示词库失败", + }, + listSettings: { + settings: "设置", + tips: "将会显示在提示词库列表页面中,选填", + tips2: "一段关于提示词库的介绍,选填", + tips3: "将会显示在提示词列表页面中,选填", + changeVisibility: "修改提示词库可见性", + statusText: "当前提示词库目前是", + status: "状态。", + promptsVisibility: "提示词库可见性", + delPrompts: "删除提示词库", + canNot: "无法", + delTips: "此操作", + delTips2: "撤销,这将永久删除", + delTips3: "提示词库及其所有文件。", + privateVis: "只有创建者或组织成员可见", + publicVis: "任何人都可以看到此提示词库", + confirmDel: "我已知晓,确认删除", + privateInfo: ",仅创建者或者组织管理员可进行提交", + publicInfo: ", 任何互联网上的人都可以看到此提示词库", + needPromptsName: "请先提供提示词库别名", + needPromptsDesc: "请先提供提示词库介绍" + } +} \ No newline at end of file From b54e7777b43ac449b30d72f2fc5ecb9efe1c5885 Mon Sep 17 00:00:00 2001 From: "minghao.yang" Date: Mon, 2 Dec 2024 22:07:30 +0800 Subject: [PATCH 06/11] Prompts relations --- frontend/src/components/shared/RepoSummary.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/components/shared/RepoSummary.vue b/frontend/src/components/shared/RepoSummary.vue index 744b66c11..11d68b21d 100644 --- a/frontend/src/components/shared/RepoSummary.vue +++ b/frontend/src/components/shared/RepoSummary.vue @@ -37,6 +37,11 @@ :datasets="relations['datasets']" /> + + Date: Tue, 3 Dec 2024 22:40:36 +0800 Subject: [PATCH 07/11] Fix prompts source href --- frontend/src/components/prompts/PromptsDetails.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/prompts/PromptsDetails.vue b/frontend/src/components/prompts/PromptsDetails.vue index ea4190b83..746f436dd 100644 --- a/frontend/src/components/prompts/PromptsDetails.vue +++ b/frontend/src/components/prompts/PromptsDetails.vue @@ -32,10 +32,10 @@ - +
Date: Tue, 3 Dec 2024 23:07:16 +0800 Subject: [PATCH 08/11] Update Prompts details text btn --- frontend/src/components/prompts/PromptsDetails.vue | 14 +++++++------- frontend/src/locales/en_js/prompts.js | 2 +- frontend/src/locales/zh_js/prompts.js | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/prompts/PromptsDetails.vue b/frontend/src/components/prompts/PromptsDetails.vue index 746f436dd..985c13fb4 100644 --- a/frontend/src/components/prompts/PromptsDetails.vue +++ b/frontend/src/components/prompts/PromptsDetails.vue @@ -42,28 +42,28 @@ class="text-base font-medium flex md:gap-[16px] justify-between items-center py-3 px-5 border-b rounded-t-lg bg-[#F9FAFB]" > {{ $t('prompts.promptContent') }} -
+
- + {{ $t('prompts.del') }} - + {{ $t('prompts.edit') }} - + {{ $t('prompts.copy') }}
diff --git a/frontend/src/locales/en_js/prompts.js b/frontend/src/locales/en_js/prompts.js index db78f1a37..3404db383 100644 --- a/frontend/src/locales/en_js/prompts.js +++ b/frontend/src/locales/en_js/prompts.js @@ -10,7 +10,7 @@ export const prompts = { promptLibrary: "Prompt Library", optimizationAssistant: "Prompt Optimizer", modelComparison: "Model Arena", - promptContent: "Prompt Content", + promptContent: "Content", copy: "Copy", edit: "Edit", title:'Title', diff --git a/frontend/src/locales/zh_js/prompts.js b/frontend/src/locales/zh_js/prompts.js index f8ac9a0dd..afd294727 100644 --- a/frontend/src/locales/zh_js/prompts.js +++ b/frontend/src/locales/zh_js/prompts.js @@ -10,7 +10,7 @@ export const prompts = { promptLibrary: "提示词库", optimizationAssistant: "优化助手", modelComparison: "模型对比", - promptContent: "词库内容", + promptContent: "内容", copy:"复制", edit:"编辑", title:'标题', From 56cae5353bb10c4d80bdada17b7adf83ffa54cf7 Mon Sep 17 00:00:00 2001 From: "minghao.yang" Date: Tue, 3 Dec 2024 23:18:22 +0800 Subject: [PATCH 09/11] Update prompts navbar --- frontend/src/components/navbar/MenuItems.vue | 6 ++++++ frontend/src/components/navbar/Navbar.vue | 2 +- frontend/src/views/layouts/navbar.html | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/navbar/MenuItems.vue b/frontend/src/components/navbar/MenuItems.vue index 92f2d25cf..bdfe25a97 100644 --- a/frontend/src/components/navbar/MenuItems.vue +++ b/frontend/src/components/navbar/MenuItems.vue @@ -222,6 +222,12 @@ class: menuItemClass, style: 'border:none', }, + { + title: t('prompts.promptLibrary'), + index: '/prompts/library', + class: menuItemClass, + style: 'border:none', + } ]) diff --git a/frontend/src/components/navbar/Navbar.vue b/frontend/src/components/navbar/Navbar.vue index 42a54e83e..3ba98aa52 100644 --- a/frontend/src/components/navbar/Navbar.vue +++ b/frontend/src/components/navbar/Navbar.vue @@ -1,5 +1,5 @@