Skip to content

Commit

Permalink
feat: add icon and labels to plugin installing task
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Nov 11, 2024
1 parent 93a40fb commit 6d9f3d4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/service/install_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/langgenius/dify-plugin-daemon/internal/types/entities/plugin_entities"
"github.com/langgenius/dify-plugin-daemon/internal/types/models"
"github.com/langgenius/dify-plugin-daemon/internal/types/models/curd"
"github.com/langgenius/dify-plugin-daemon/internal/utils/cache/helper"
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
"github.com/langgenius/dify-plugin-daemon/internal/utils/routine"
"github.com/langgenius/dify-plugin-daemon/internal/utils/stream"
Expand Down Expand Up @@ -48,6 +49,12 @@ func InstallPluginRuntimeToTenant(
}

for i, plugin_unique_identifier := range plugin_unique_identifiers {
// fetch plugin declaration first, before installing, we need to ensure pkg is uploaded
plugin_declaration, err := helper.CombinedGetPluginDeclaration(plugin_unique_identifier)
if err != nil {
return nil, err
}

// check if plugin is already installed
plugin, err := db.GetOne[models.Plugin](
db.Equal("plugin_unique_identifier", plugin_unique_identifier.String()),
Expand All @@ -57,8 +64,8 @@ func InstallPluginRuntimeToTenant(
PluginUniqueIdentifier: plugin_unique_identifier,
PluginID: plugin_unique_identifier.PluginID(),
Status: models.InstallTaskStatusPending,
Labels: plugin.Declaration.Label,
Icon: plugin.Declaration.Icon,
Icon: plugin_declaration.Icon,
Labels: plugin_declaration.Label,
Message: "",
})

Expand Down

0 comments on commit 6d9f3d4

Please sign in to comment.