Skip to content

admin pages renders incorrectly when using bindatafs #153

@sugacube

Description

@sugacube

It seems thatadmin pages render incorrectly when using bindatafs

try following program without, and with bindatafas
first run as is.
then run with bindata (first run ">bindatafs bindatafs" and change "false" to "true" to create bindata)
with bindata, renders differently -> in html it appears as part of the header is rendered in the wrong place.

main.go:

package main

import (
	"fmt"
	"net/http"
	"os"

	_ "github.com/admpub/go-sqlite3-win64"
	"github.com/jinzhu/gorm"
	"github.com/qor/admin"

	"playground/qortest/bindatafs"
)

type User struct {
	ID   int
	Name string
}

func main() {

	if false {
		bindatafs.AssetFS.RegisterPath("vendor\\github.com\\qor\\admin\\views")
		bindatafs.AssetFS.Compile()
		os.Exit(1)
	}

	DB, _ := gorm.Open("sqlite3", "test.db")
	DB.AutoMigrate(&User{})

	Admin := admin.New(&admin.AdminConfig{
		DB:      DB,
		AssetFS: bindatafs.AssetFS,
	})
	Admin.AddResource(&User{})

	mux := http.NewServeMux()
	Admin.MountTo("/admin", mux)

	fmt.Println("Listening on: 9000")
	http.ListenAndServe(":9000", mux)

}


without bindatafs:
image

with bindatafs:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions