62 lines
1.4 KiB
Go
62 lines
1.4 KiB
Go
package finder
|
|
|
|
import (
|
|
"personalwebsite/apps/appCtx"
|
|
"personalwebsite/wde"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func (f *FinderApplication) RenderAdminWindow(appCtx appCtx.AppContext) gin.H {
|
|
|
|
return gin.H{}
|
|
}
|
|
func (f *FinderApplication) RenderPrivateContextMenu(context string, filePath string, data string) gin.H {
|
|
islands := [][]wde.ContexMenuRow{}
|
|
// islands = append(islands, []wde.ContexMenuRow{})
|
|
|
|
islands = append(islands, []wde.ContexMenuRow{
|
|
{Label: "Get Info", Action: "getInfo"},
|
|
})
|
|
|
|
if context == "FileTileView" {
|
|
islands = append(islands, []wde.ContexMenuRow{
|
|
{Label: "New Directory", Action: "createDir"},
|
|
})
|
|
return gin.H{
|
|
"Islands": islands,
|
|
}
|
|
}
|
|
|
|
islands = append(islands, []wde.ContexMenuRow{
|
|
{Label: "Create path link", Action: "createPathLink"},
|
|
})
|
|
|
|
switch context {
|
|
case "directory":
|
|
switch f.fs.GetExtension(filePath) {
|
|
case "app":
|
|
islands = append(islands, []wde.ContexMenuRow{
|
|
{Label: "Open as Directory", Action: "openAsDir"},
|
|
})
|
|
case "blog":
|
|
islands = append(islands, []wde.ContexMenuRow{
|
|
{Label: "Open as Directory", Action: "openAsDir"},
|
|
})
|
|
}
|
|
default:
|
|
islands = append(islands, []wde.ContexMenuRow{
|
|
{Label: "temp Menu 1", Action: ""},
|
|
{Label: "temp Menu 2", Action: ""},
|
|
})
|
|
}
|
|
|
|
islands = append(islands, []wde.ContexMenuRow{
|
|
{Label: "Delete File", Action: "deleteFile"},
|
|
})
|
|
|
|
return gin.H{
|
|
"Islands": islands,
|
|
}
|
|
}
|