mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
a8f56e55e3
commit
957a928959
6 changed files with 82 additions and 19 deletions
|
|
@ -29,6 +29,7 @@ import (
|
|||
"github.com/88250/lute/parse"
|
||||
"github.com/88250/lute/render"
|
||||
"github.com/emirpasic/gods/sets/hashset"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/av"
|
||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||
"github.com/siyuan-note/siyuan/kernel/sql"
|
||||
|
|
@ -37,6 +38,42 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func PushReloadPlugin(upsertPluginSet, removePluginNameSet *hashset.Set, excludeApp string) {
|
||||
pushReloadPlugin(upsertPluginSet, removePluginNameSet, excludeApp)
|
||||
}
|
||||
|
||||
func pushReloadPlugin(upsertPluginSet, removePluginNameSet *hashset.Set, excludeApp string) {
|
||||
upsertPlugins, removePlugins := []string{}, []string{}
|
||||
if nil != upsertPluginSet {
|
||||
for _, n := range upsertPluginSet.Values() {
|
||||
upsertPlugins = append(upsertPlugins, n.(string))
|
||||
}
|
||||
}
|
||||
if nil != removePluginNameSet {
|
||||
for _, n := range removePluginNameSet.Values() {
|
||||
removePlugins = append(removePlugins, n.(string))
|
||||
}
|
||||
}
|
||||
|
||||
pushReloadPlugin0(upsertPlugins, removePlugins, excludeApp)
|
||||
}
|
||||
|
||||
func pushReloadPlugin0(upsertPlugins, removePlugins []string, excludeApp string) {
|
||||
logging.LogInfof("reload plugins [upserts=%v, removes=%v]", upsertPlugins, removePlugins)
|
||||
if "" == excludeApp {
|
||||
util.BroadcastByType("main", "reloadPlugin", 0, "", map[string]interface{}{
|
||||
"upsertPlugins": upsertPlugins,
|
||||
"removePlugins": removePlugins,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
util.BroadcastByTypeAndExcludeApp(excludeApp, "main", "reloadPlugin", 0, "", map[string]interface{}{
|
||||
"upsertPlugins": upsertPlugins,
|
||||
"removePlugins": removePlugins,
|
||||
})
|
||||
}
|
||||
|
||||
func refreshDocInfo(tree *parse.Tree) {
|
||||
if nil == tree {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue