Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
eeaad76
feat(admin): improve online generator tool
Aug 15, 2020
6a90172
feat(security): improve csrf token
Aug 15, 2020
978963b
fix(admin): fixed form components linkage error
Aug 15, 2020
c7bdd8d
fix(admin): fixde form components linkage error
Aug 15, 2020
7c717f5
test(tests): update tests
Aug 15, 2020
c6c4016
fix(db): fixed db connection error
Aug 15, 2020
16e864b
feat(admin): improve admin form linkage
Aug 15, 2020
1a60505
feat(config): make sure config env item can not be modified
Aug 15, 2020
c523087
feat(admin): improve info table style
Aug 15, 2020
eaa473f
feat(plugin): improve plugin
Aug 15, 2020
467e624
test(tests): fixed ci test
Aug 15, 2020
8465674
feat(admin): improve form field APIs
Aug 15, 2020
7ea605d
feat(admin): improve form field APIs
Aug 15, 2020
c9f0fb7
feat(admin): improve online generator tool
Aug 15, 2020
f7ea604
feat(admin): improve online generator tool
Aug 15, 2020
440190e
test(tests): improve ci tests
Aug 15, 2020
32b3530
docs(readme): update readme
Aug 15, 2020
ecf8451
feat(cli): add adm init web command
Aug 17, 2020
2286704
feat(cli): improve cli
Aug 17, 2020
bbdeedc
feat(cli): improve cli
Aug 17, 2020
aec12a9
feat(admin): improve edit form
Aug 17, 2020
bb53287
feat(release): ready for v1.2.16
Aug 18, 2020
6252149
docs(readme): update readme
Aug 18, 2020
cd05962
feat(theme): support seperate frontend assets from the framework
Aug 18, 2020
d512542
fix(cli): fixed cli init web command error
Aug 18, 2020
316f282
feat(admin): support form ajax jump in new tab
Aug 21, 2020
2b35679
feat(admin): support table new form individually setting
Aug 21, 2020
c7e59b4
feat(admin): add API SetNoCompress for info table
Aug 25, 2020
798647d
fix(admin): fixed info table display API FieldLink error
Sep 2, 2020
4453415
feat(admin): improve online generator tool
Sep 9, 2020
45ef359
fix(data): fixed admin migration sql
Sep 11, 2020
8d8a093
fix(test): fixed travis ci
Sep 11, 2020
c4c4555
fix(data): improve sql data
Sep 11, 2020
1ce2e72
fix(data): rollback
Sep 11, 2020
31b3dbc
fix(admin): fixed file_upload action error
Sep 14, 2020
2ec4341
feat(release): update version
Sep 14, 2020
49ac2aa
feat(release): update version
Sep 15, 2020
4dac781
fix(admin): fixed custom new form
Sep 15, 2020
eaae4a2
fix(admin): info table display error
Sep 15, 2020
f24d359
fix(admin): fixed info table query filter linkage
Sep 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ before_install:
- createdb -U postgres go-admin-test

install:
- wget -N https://chromedriver.storage.googleapis.com/83.0.4103.39/chromedriver_linux64.zip -P ~/
- wget -N https://chromedriver.storage.googleapis.com/85.0.4183.87/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo chmod +x /home/travis/chromedriver
- ln --symbolic /home/travis/chromedriver "${HOME}/bin/chromedriver"
- chromedriver --version

before_script:
- google-chrome-stable --version
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
- echo "USE mysql;\nUPDATE user SET authentication_string=PASSWORD('root') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
- psql -c "ALTER USER postgres WITH PASSWORD 'root';" -U postgres
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
GOCMD = go
GOBUILD = $(GOCMD) build
BINARY_NAME = adm
LAST_VERSION = v1.2.14
VERSION = v1.2.15
LAST_VERSION = v1.2.16
VERSION = v1.2.17
CLI = adm

TEST_CONFIG_PATH=./../../common/config.json
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ We need your help: [https://github.com/GoAdminGroup/docs/issues/1](https://githu

Following three steps to run it.

Note: now you can quickly start by doing like this.

```shell
$ mkdir new_project && cd new_project
$ go install github.com/GoAdminGroup/go-admin/adm
$ adm init
```

Or (use adm whose version higher or equal than v1.2.16)

```shell
$ mkdir new_project && cd new_project
$ go install github.com/GoAdminGroup/go-admin/adm
$ adm init web
```

### Step 1: import sql

- [mysql](https://raw.githubusercontent.com/GoAdminGroup/go-admin/master/data/admin.sql)
Expand Down
21 changes: 21 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ GoAdmin+vue 例子: [https://github.com/GoAdminGroup/goadmin-vue-example](http

## 使用

提示:现在你也可以这样做。

```shell
$ mkdir new_project && cd new_project
$ go install github.com/GoAdminGroup/go-admin/adm
$ adm init -l cn
```

或者:(使用v1.2.16的adm)

```shell
$ mkdir new_project && cd new_project
$ go install github.com/GoAdminGroup/go-admin/adm
$ adm init web -l cn
```


通过以下三步运行:

### 第一步:导入 sql
Expand Down Expand Up @@ -170,6 +187,8 @@ GO111MODULE=on go run main.go

<strong>[点击这里加微信群](http://quick.go-admin.cn/resource/wechat_qrcode.jpg)</strong>

<strong>注:在社区中如有问题提问,请务必清晰描述,包括但不限于问题详叙/问题代码/复现方法/已经尝试过的方法,时间生命可贵,请珍惜自己和别人的时间!</strong>

## 十分感谢

inspired by [laravel-admin](https://github.com/z-song/laravel-admin)
Expand All @@ -179,5 +198,7 @@ inspired by [laravel-admin](https://github.com/z-song/laravel-admin)
留下您的github/gitee用户名,我们将会展示在[捐赠名单](DONATION.md)中。

> 恰饭所需,作者精力时间有限,目前GoAdmin项目捐赠达666元,联系[作者](http://quick.go-admin.cn/resource/wechat_qrcode.jpg)可进vip用户群,vip群中您的问题将得到优先解答,同时也会根据您的需求进行分析和优先安排,vip群也会提供其他关于golang的福利。🙏
>
> 同时您也可以联系我,雇佣我的时间帮助您干活。

<img src="http://quick.go-admin.cn/official/assets/imgs/shoukuan.jpg" width="650" />
1 change: 1 addition & 0 deletions adm/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func addPermission(cfgFile string) {
}

func insertPermissionOfTable(conn db.Connection, table string) {
table = strings.ToLower(table)
insertPermissionInfoDB(conn, table+" "+getWord("Query"), table+"_query", "GET", "/info/"+table)
insertPermissionInfoDB(conn, table+" "+getWord("Show Edit Form Page"), table+"_show_edit", "GET",
"/info/"+table+"/edit")
Expand Down
12 changes: 12 additions & 0 deletions adm/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ func main() {
setDefaultLangSet(*lang)
buildProject(*config)
}

cmd.Command("web", "generate a template project", func(cmd *cli.Cmd) {
var (
lang = cmd.StringOpt("l language", "en", "language")
port = cmd.StringOpt("p port", "6633", "port")
)

cmd.Action = func() {
setDefaultLangSet(*lang)
buildProjectWeb(*port)
}
})
})

app.Command("add", "generate user/permission/roles", func(cmd *cli.Cmd) {
Expand Down
111 changes: 111 additions & 0 deletions adm/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,114 @@ var langs = map[string]map[string]string{
"en": "英文",
"jp": "日文",
"tc": "繁体中文",

"web.database settings": "数据库设置",
"web.installation settings": "应用安装设置",
"web.application settings": "应用设置",
"web.optional settings": "可选设置",

"web.database type": "数据库类型",
"web.database host": "数据库主机",
"web.database user": "数据库用户",
"web.database password": "数据库用户密码",
"web.database name": "数据库名称",
"web.database file": "数据库文件路径",
"web.database port": "数据库端口",
"web.database schema": "数据库Schema",

"web.theme": "主题",
"web.language": "语言",
"web.web framework": "Web框架",
"web.module name": "模块名",
"web.http port": "HTTP 端口号",
"web.url prefix": "路由前缀",
"web.website title": "网站标题",
"web.login page logo": "登录页面logo",
"web.sidebar logo": "侧边栏logo",
"web.sidebar mini logo": "侧边栏缩小logo",
"web.use orm": "使用 ORM",
"web.no use": "不使用",
"web.input": "输入",

"web.simplified chinese": "简体中文",
"web.traditional chinese": "繁体中文",
"web.english": "英文",
"web.japanese": "日文",

"web.where the framework sql data install to": "GoAdmin框架数据表安装位置。",
"web.the file path of sqlite3 database": "SQLite3 数据库文件路径。",
"web.please use absolute path when you start as service": "作为服务启动时,请使用绝对路径。",
"web.module name is the path of go module": "模块名指在go module中的路径",
"web.port number which application will listen on": "应用监听的端口号。",
"web.url prefix of the running application": "运行访问的路由前缀。",

"web.official website": "官方网站",
"web.current version": "当前版本",
"web.goadmin web installation program": "GoAdmin Web安装程序",
"web.installation page": "安装页面",
"web.install now": "立即安装",

"web.result": "安装结果",
"web.ok": "好的",
"web.wrong parameter": "错误的参数",
"web.install success": "安装成功~~🍺🍺",
},
"en": {
"cn": "Chinese",
"en": "English",
"jp": "Japanese",
"tc": "Traditional Chinese",

"web.database settings": "Database Settings",
"web.installation settings": "Installation Settings",
"web.application settings": "Application General Settings",
"web.optional Settings": "Optional Settings",

"web.database type": "Database Type",
"web.database host": "Host",
"web.database user": "User",
"web.database password": "Password",
"web.database name": "Database Name",
"web.database file": "Path",
"web.database port": "port",
"web.database schema": "Schema",

"web.theme": "Theme",
"web.language": "Language",
"web.web framework": "Web Framework",
"web.module name": "Module Name",
"web.http port": "HTTP Port",
"web.url prefix": "Url Prefix",
"web.website title": "Website Title",
"web.login page logo": "Login Page Logo",
"web.sidebar logo": "SideBar Logo",
"web.sidebar mini logo": "SideBar Mini Logo",
"web.use orm": "Use ORM",
"web.no use": "No use",
"web.input": "Input",

"web.simplified chinese": "Simplified Chinese",
"web.traditional chinese": "Traditional Chinese",
"web.english": "English",
"web.japanese": "Japanese",

"web.where the framework sql data install to": "Where the framework sql data will be installed to。",
"web.the file path of sqlite3 database. ": "The file path of SQLite3 database. ",
"web.please use absolute path when you start as service": "Please use absolute path when you start as service.",
"web.module name is the path of go module": "Module name is the path of go module.",
"web.port number which application will listen on": "Port number which application will listen on.",
"web.url prefix of the running application": "Url prefix of the running application.",

"web.official website": "Official Website",
"web.current version": "Current Version",
"web.goadmin web installation program": "GoAdmin Web Installation Program",
"web.installation page": "Installation Page",
"web.install now": "Install GoAdmin",

"web.result": "Installation Result",
"web.ok": "Ok",
"web.wrong parameter": "Wrong parameter",
"web.install success": "Install Success~~🍺🍺",
},
}

Expand All @@ -96,6 +198,15 @@ func setDefaultLangSet(set string) {
}
}

func local(lang string) func(string) string {
if _, ok := langs[defaultLang]; ok {
return func(msg string) string {
return langs[lang][msg]
}
}
return nil
}

func getWord(msg string) string {
if word, ok := langs[defaultLang][msg]; ok {
return word
Expand Down
Loading