goadmingroup / go-admin Goto Github PK
View Code? Open in Web Editor NEWA golang framework helps gopher to build a data visualization and admin panel in ten minutes
Home Page: https://www.go-admin.com
License: Apache License 2.0
A golang framework helps gopher to build a data visualization and admin panel in ten minutes
Home Page: https://www.go-admin.com
License: Apache License 2.0
go run main.go
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET /uploads/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)
[GIN-debug] HEAD /uploads/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)
[GIN-debug] GET /admin/login --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] POST /admin/signin --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] GET /admin/install --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] POST /admin/install/database/check --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] GET /admin/assets/Ionicons/css/ionicons.css --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
...
[GIN-debug] GET /admin/logout --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] GET /admin/menu --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] POST /admin/menu/delete --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] POST /admin/menu/new --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] POST /admin/menu/edit --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] GET /admin/menu/edit/show --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] POST /admin/menu/order --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] GET /admin/info/:prefix --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] GET /admin/info/:prefix/edit --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] GET /admin/info/:prefix/new --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] POST /admin/edit/:prefix --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] POST /admin/delete/:prefix --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] POST /admin/new/:prefix --> github.com/chenhg5/go-admin/adapter/gin.(*Gin).Use.func1 (3 handlers)
[GIN-debug] Listening and serving HTTP on :5678
[GIN] 2019/03/12 - 05:49:46 | 404 | 16.7µs | 172.17.0.1 | GET /admin
[GIN] 2019/03/12 - 05:49:51 | 404 | 14.1µs | 172.17.0.1 | GET /admin
We appreciate you support if you or your organization is using GoAdmin. You are welcome to leave replies about your product and organization here, which could became the confidence of maintiners, communication and undecided watchers. And we may display your use case in our README.md and homepage if you allow.
Recommended reply format:
- Product:
- Company or Organization: (if ok)
- Link: (if ok)
- Screenshot: (if any)
此处用于收集 GoAdmin 的社区用户的使用案例,如果你在你的公司/组织或个人项目中使用了GoAdmin,欢迎在此留言。你的反馈会给社区成员更多信息和更强的信心。同时我们会将您的使用案例放在我们的README.md或官网主页,如果您觉得可以的话。
推荐回复格式:
- 产品:
- 公司或组织:(如果可以)
- 链接:(如果可以)
- 截图:(如果可以)
无关回复会定期删除。
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
panic: interface conversion: interface {} is int64, not *interface {}
goroutine 1 [running]:
github.com/chenhg5/go-admin/modules/db/converter.SetResultValue(0xc0001b51e0, 0xc000164c7c, 0x4, 0x47e24c0, 0xc000172e20, 0x0, 0x0)
/Users/liu/gofile/src/github.com/chenhg5/go-admin/modules/db/converter/sql.go:213 +0x22eb
github.com/chenhg5/go-admin/modules/db/performer.Query(0xc0003c80c0, 0x4936789, 0x39, 0xc0003f2ee0, 0x1, 0x1, 0x203000, 0x203000, 0xc0003fe600, 0xc0001b52e0)
/Users/liu/gofile/src/github.com/chenhg5/go-admin/modules/db/performer/performer.go:56 +0x384
github.com/chenhg5/go-admin/modules/db/mysql.(*Mysql).Query(0x56e4680, 0x4936789, 0x39, 0xc0003f2ee0, 0x1, 0x1, 0x4890960, 0xa, 0xc0001b5380, 0x80)
/Users/liu/gofile/src/github.com/chenhg5/go-admin/modules/db/mysql/mysql.go:112 +0x9c
github.com/chenhg5/go-admin/modules/db.Query(0x4936789, 0x39, 0xc0003f2ee0, 0x1, 0x1, 0x1, 0x0, 0x4894020, 0xc000196310)
/Users/liu/gofile/src/github.com/chenhg5/go-admin/modules/db/connection.go:38 +0x150
github.com/chenhg5/go-admin/plugins/admin/models.GetRolesTable(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/liu/gofile/src/github.com/chenhg5/go-admin/plugins/admin/models/generators.go:376 +0xbb
github.com/chenhg5/go-admin/plugins/admin/models.InitTableList()
/Users/liu/gofile/src/github.com/chenhg5/go-admin/plugins/admin/models/table.go:22 +0x112
github.com/chenhg5/go-admin/plugins/admin.(*Admin).InitPlugin(0xc0003ca140)
/Users/liu/gofile/src/github.com/chenhg5/go-admin/plugins/admin/admin.go:39 +0x4c5
github.com/chenhg5/go-admin/engine.(*Engine).AddPlugins(0xc0001b5ea8, 0xc0001b5e88, 0x2, 0x2, 0x491a58f)
/Users/liu/gofile/src/github.com/chenhg5/go-admin/engine/engine.go:43 +0x65
main.main()
/Users/liu/gofile/src/github.com/chenhg5/go-admin/demo/main.go:48 +0x237
exit status 2
typeName for 'db.Varbinary' should be 'db.VarBinary'
这个是php版本的,跟您的这个很类似,也是分为表格和表单,使用很简单方便,支持的组件很多,我以前一直用,现在转学go,也希望能找到一个类似的,终于找到您的这个项目了
加个富媒体编辑器呗
go/src/go-admin via 🐹 v1.13.1
➜ ll
total 8
-rw-r--r-- 1 linovo staff 1.6K 10 13 13:07 main.go
go/src/go-admin via 🐹 v1.13.1
➜ go run main.go
go: github.com/GoAdminGroup/go-admin/adapter/gin: github.com/GoAdminGroup/[email protected]: parsing go.mod:
module declares its path as: github.com/chenhg5/go-admin
but was required as: github.com/GoAdminGroup/go-admin
go/src/go-admin via 🐹 v1.13.1 took 6s
➜
1、将插件的模板文件放在自己的插件目录下面,比如admin插件的模板文件可以放在插件下面
2、支持模块化开发,比如开发一个博客模块,这个模块下面有后台的发布页面和前台的显示页面,都在这一个模块目录下面
3、支持数据库的填充功能,比如开发一个插件,这个插件有自己的数据库表,如果有填充功能,就可以不用使用手动导入sql文件了
UUID allows creating records more safely and easily use a default value for DB column
admin/info/ 页面 Show entries有bug
如果选50,
url会变成?page=1&pageSize=10&sort=id&sort_type=desc&pageSize=50
有两个pageSize
Buffalo is a popular framework for GO with over 4 700 stars and 120+ contributors.
It would be super cool, if you would suport it aswell.
https://github.com/gobuffalo/buffalo
Let me know if you have an adapter to test for Buffalo.
Thanks for this amazing work, looking forward to test it ;)
尝试在 linux mac ,均如此……
复现:任意一个表
问题描述 [详细地描述问题,让大家都能理解]
示例代码 [如果有必要,展示代码,线上示例,或仓库]
其他信息 [如截图等其他信息可以贴在这里]
Let's rename ExcuFun
to FilterFunc
or FilterFn
because it is too hard to guess what is this function and what does it must do.
The same logic can be applicable for FieldValueFun
=> FieldFilterFn
type FieldValueFun func(value RowModel) interface{}
type Field struct {
ExcuFun FieldValueFun
Field string
TypeName string
Head string
JoinTable []Join
Sortable bool
Filter bool
Hide bool
}
可登录,进入用户、角色、权限、菜单、操作日志都报错
{"code":500,"msg":"interface conversion: interface {} is string, not []uint8"}
plugins/admin/models/table.go 461
columns[key] = string(model["name"].([]uint8))
改为 columns[key] = string(model["name"].(string))
可浏览了
password 没有 EncodePassword
manager.go
import "github.com/chenhg5/go-admin/modules/auth"
21 "password": dataList["password"][0],
改为 "password": auth.EncodePassword([]byte(dataList["password"][0])),
问题解决
Adding Chi Router Support:
chi is a lightweight, idiomatic and composable router for building Go HTTP services. It's especially good at helping you write large REST API services that are kept maintainable as your project grows and changes. chi is built on the new context package introduced in Go 1.7 to handle signaling, cancelation and request-scoped values across a handler chain.
https://github.com/go-chi/chi
Dependabot can't resolve your Go dependency files.
As a result, Dependabot couldn't update your dependencies.
The error Dependabot encountered was:
go: verifying github.com/kataras/[email protected]+incompatible/go.mod: checksum mismatch
downloaded: h1:ki9XPua5SyAJbIxDdsssxevgGrbpBmmvoQmo/A0IodY=
go.sum: h1:KavHkm44uIT02MlheYqn0L8ZGpWhI34qhlknGmWEfHU=
If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.
You can mention @dependabot in the comments below to contact the Dependabot team.
{
Head: "状态",
Field: "state",
TypeName: db.Varchar,
Default: "",
Editable: true,
FormType: form.SelectSingle,
FilterFn: func(model types.RowModel) interface{} {
return []string{model.Value}
},
Options: []map[string]string{
{
"field": "待审核",
"value": common.WITHDRAWAL_STATE_WAIT_FOR_AUDIT,
},{
"field": "不通过",
"value": common.WITHDRAWAL_STATE_UNAPPROVED,
},
{
"field": "审核通过待转账",
"value": common.WITHDRAWAL_STATE_WAIT_FOR_TX,
},
{
"field": "转账失败",
"value": common.WITHDRAWAL_STATE_TRANSFER_FAIL,
},{
"field": "审核通过",
"value": common.WITHDRAWAL_STATE_APPROVED,
},
{
"field": "转账失败,数据回滚",
"value": common.WITHDRAWAL_STATE_ROLLBACK,
},
},
}
Like the code above, set formType to form.SelectSingle. In theory, there should be only one specific option selected on the edit page, but on the selectBox on the page, there are sometimes two and sometimes three.
/admin/info/user
ERRO[1425] Error 1146: Table 'goadmin.users' doesn't exist
ERRO[1425] goroutine 167 [running]:
...
[GIN] 2019/08/02 - 14:52:09 | 500 | 1m43s | ::1 | GET /admin/info/user?_pjax=%23pjax-container
INFO[1427] [GoAdmin] 200 GET /admin/info/user
ERRO[1427] Error 1146: Table 'goadmin.users' doesn't exist
ERRO[1427] goroutine 167 [running]:
求加列项动态设置、excel导入导出功能
interface conversion: interface {} is []uint8, not string
window操作系统,mysql数据库,总是报错。这个和go版本有关么?
go version go1.12.4 windows/amd64
mac sqlite3
UNIQUE constraint failed: goadmin_role_users.role_id, goadmin_role_users.user_id
demo页面无法访问,域名没有备案?
近期正在使用go-admin做一个后台,需要补充一些功能,大致开发计划如下
1.实现对不可编辑字段的处理(除file/iconpicker类型外 已完成)
对于标记为不可编辑的字段,前端应显示为不可修改,后端应禁止提交
2.Table修改为interface,以方便定制开发 (已完成)
将Table定义为接口可以方便用户自定义数据处理逻辑,以适应更加复杂的需要(如:多数据源、复杂关联查询、nosql数据源等)
3.将Row传递给FieldValueFun,以方便根据其它字段定制显示内容(已完成)
将整行数据传给字段处理函数,可以方便处理函数根据数据上下文定制显示内容,很多情况下某个字段在客户端展示的结果需要结合其它字段进行判断
4.列表页字段增加Hide参数(已完成)
有些数据字段在客户端并不需要展示,但在处理函数需要用到
5.筛选项支持使用选择列表
6. 筛选项支持直接在列表页显示
If you use some mysql qualified name, you will cause a mysql 1064 error.
Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit,mission_req,type,id from contract where id > 0 order by id desc LIMIT ? OF' at line 1
在测试中发现 角色管理模块,在给 operator 增加了 “” 权限后保存,再次修改取消“” 权限,虽然能保存成功,但是数据库不更新。
http://doc.go-admin.cn/#/
打开这个网站,搜索“开箱即用的”,可以看到一个错误,应该是“开箱即用的rbac认证系统”
plugins/admin/controller/show.go
wheres += key + " = ? and"
少一个空格,导致多个查询条件Sql报错
应该是
wheres += key + " = ? and "
go run example/gin/main.go 后登陆一直停留在登陆页面。
模版的性能和体验都不好
im run admincli generate, and got error no tables.
C:\Users\Dimas\go\src>admincli generate
�[H�[2JGoAdmin CLI v1.0.0
? choose a driver mysql
? sql address 127.0.0.1
? sql port 3306
? sql username root
? sql password
? sql database name godmin
�[31mgo-admin cli error: no tables�[0m
I've been having some headaches with generating templates and I'm honestly not having fun.. I will have some commits pushed to get admincli generating good templates..
如题:
func EncodePassword(pwd []byte) string {
hash := sha256.New()
hash.Write(pwd)
md := hash.Sum(nil)
return hex.EncodeToString(md)
}
Click join slack
link, it need Enter your workspace’s Slack URL
.
go get -v -u github.com/chenhg5/go-admin
github.com/chenhg5/go-admin (download)
package github.com/chenhg5/go-admin: no Go files in /Volumes/Data/Work/golang/src/github.com/chenhg5/go-admin
你好,感谢你的项目,最近把你的项目用与展示一个小的相关数据项目,在增加了示例仪表盘页面 ,怎么在里面websocket 推送功能,主要是监控服务器的 cpu 内存指标,以及指定程序的相关运行状态,就相当于一个简单的实时监控功能
错误信息提示不明显;
1、新增用户报错,但是数据库 增加了一条新的记录;
add new user error,but new info has been stored in goadmin_users;
2、点击查看 管理-用户 报一下错误;
click admin->users,error:
[GIN] 2019/08/02 - 15:56:03 | 500 | 1m16s | ::1 | GET /admin/info/manager?_pjax=%23pjax-container
INFO[5301] [GoAdmin] 200 GET /admin/info/manager
ERRO[5301] interface conversion: interface {} is nil, not string
Is this project supported RESTful json api?
当添加多个AreaChart的时候,生成的js代码会多次生成
let salesChartCanvas = $('#{{.ID}}').get(0).getContext('2d');
页面会报错
uncaught SyntaxError: Identifier 'salesChartCanvas' has already been declared
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.