personal-website/apps/finder/finderadmin.go

62 lines
1.4 KiB
Go
Raw Permalink Normal View History

2023-05-03 21:50:08 +00:00
package finder
import (
2023-05-18 01:57:44 +00:00
"personalwebsite/apps/appCtx"
2023-05-16 12:12:55 +00:00
"personalwebsite/wde"
"github.com/gin-gonic/gin"
2023-05-03 21:50:08 +00:00
)
2023-05-18 01:57:44 +00:00
func (f *FinderApplication) RenderAdminWindow(appCtx appCtx.AppContext) gin.H {
2023-05-03 21:50:08 +00:00
2023-05-18 01:57:44 +00:00
return gin.H{}
2023-05-03 21:50:08 +00:00
}
2023-05-16 12:12:55 +00:00
func (f *FinderApplication) RenderPrivateContextMenu(context string, filePath string, data string) gin.H {
islands := [][]wde.ContexMenuRow{}
2023-05-18 01:57:44 +00:00
// islands = append(islands, []wde.ContexMenuRow{})
2023-05-16 12:12:55 +00:00
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":
2023-05-18 01:57:44 +00:00
switch f.fs.GetExtension(filePath) {
case "app":
islands = append(islands, []wde.ContexMenuRow{
{Label: "Open as Directory", Action: "openAsDir"},
})
case "blog":
2023-05-16 12:12:55 +00:00
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,
}
}