renzholy / mongood Goto Github PK
View Code? Open in Web Editor NEWA MongoDB GUI with Fluent Design
License: GNU Affero General Public License v3.0
A MongoDB GUI with Fluent Design
License: GNU Affero General Public License v3.0
Watch!
Star!
Hi @renzholy, in this change (737e5dc), I noticed you have switched client render from wails to lorca.
But it can be a big challenge to use client application for the one who does not have Chrome installed.
(Indeed, Chrome is a large dependency.)
For me, I usually use safari and Microsoft Edge on my Mac (without Chrome installed).
Then it will give me a Fatal error:
./mongood
2020/08/05 10:28:12 /Users/user/Library/Caches/Mongood/Mongood
2020/08/05 10:28:12 fork/exec : no such file or directory
Besides, in the document of lorca, it says:
Also, limitations by design:
No control over the Chrome window yet (e.g. you can't remove border, make it transparent, control position or size).
Users cannot control window position or resize window.
Could we use a compile option or environment variable at go side to pick lorca or wails as client render, so that users like me can still use wails as client render.
I'm testing it by the development server.
I have a database with 2 documents. One includes 2 rows, one includes 1 row. It automatically duplicate rows when I switch between 2 documents almost randomly.
Once connected, I received the following error under "Operations" and "Profilling" (might be more)
error parsing uri: must have a / before the query ?
From the devtools of the browser, I can see the following
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
Request URL: http://localhost:3000/api/runCommand?d=admin&c=currentOp
Request Payload: {"connection":"mongodb://username:password@localhost:27017?connect=direct","database":"admin","command":"{\"currentOp\":1,\"ns\":{\"$regex\":{\"$regularExpression\":{\"pattern\":\"zbaffi.*\",\"options\":\"\"}}}}"}
I think the problem is caused by the ?connect=direct
part. Then I removed the line
Line 19 in ce925d2
The error disappeared.
when i run yarn build
console output a error message:
Type error: Type '() => any' is not a constructor function type.
13 | * @see https://github.com/microsoft/fluentui/wiki/Server-side-rendering-and-browserless-testing
14 | */
15 | export default class MyDocument extends Document<{
| ^
16 | styleTags: string
17 | serializedStylesheet: string
18 | }> {
In the New Connection
modal,
mongodb://username:password@mongo:27017
gives me
server selection error: server selection timeout, current topology: {
Type: ReplicaSetNoPrimary,
Servers: [{
Addr: localhost:27017,
Type: Unknown,
Last error: connection() error occured during connection handshake: dial tcp [::1]:27017: connect: connection refused
},]
}
The host
in the error message is clearly incorrect.
However,
mongodb://username:password@mongo:2701
gives
server selection error: server selection timeout, current topology: {
Type: Unknown,
Servers: [{
Addr: mongo:2701,
Type: Unknown,
Last error: connection() error occured during connection handshake: dial tcp 10.88.2.4:2701: connect: connection refused
}, ]
}
This time the host is correct, but that's not the address I need.
I tried
mongodb://username:[email protected]:27017
The error message is the same as the first one.
BTW, I am running mongood
and mongo
via docker-compose. I can confirm that the hostname mongo
(corresponds to IP 10.88.2.4
) can be resolved from the mongood
container.
Moreover, from the devtools in the browser, I can see that the payload send to http://localhost:3000/api/runCommand?d=admin&c=ping
is always correct.
mongo客户端目前nosqlbooster用的最多,其中一个痛点就是nosqlbooster无法展示gui地图位置信息。
试用了一下这个软件我觉得界面还可以,很多功能可以深挖。
国内大部分做geo相关的公司mongo库里存的都是gcj02,针对这个能否出一个切换按钮,使地图渲染使用高德?
key的话可以让用户自己填自己的。
另一个痛点是无法展示轨迹信息,比如多选了多个带有geo point 的点,能否按照查询结果的顺序调用高德的轨迹渲染api在地图上展示轨迹。
解决了这两点那真的其它的客户端都可以卸载了。
(还有个小问题,新建索引的时候真的有点迷惑
return { background: true }
看到这个有点迷惑,没有nosqlbooster的可视化来的直观
It seams there is mongo client leak at go server side.
I added a print call (log.Println("Hello, new connection from ", uri);
) after the client creation.
// main.go
func create(uri string) (*mongo.Client, error) {
cached, ok := clients.Load(uri)
if ok && cached != nil {
return cached.(*mongo.Client), nil
}
client, err := mongo.NewClient(options.Client().ApplyURI(uri))
if err != nil {
return nil, err
}
err = client.Connect(ctx)
log.Println("Hello, new connection from ", uri); // I added a print here
if err != nil {
return nil, err
}
clients.Store(uri, client)
return client, nil
}
But it may print more than one time after I launch Mongood, e.g.
2020/08/15 11:33:27 admin {"listDatabases":1}
2020/08/15 11:33:27 admin {"serverStatus":1}
2020/08/15 11:33:27 Hello, new connection from mongodb://127.0.0.1:27017
2020/08/15 11:33:27 Hello, new connection from mongodb://127.0.0.1:27017
2020/08/15 11:33:27 Hello, new connection from mongodb://127.0.0.1:27017
2020/08/15 11:33:27 admin {"serverStatus":1}
2020/08/15 11:33:27 admin {"listCollections":1}
2020/08/15 11:33:27 config {"listCollections":1}
2020/08/15 11:33:27 local {"listCollections":1}
2020/08/15 11:33:27 misa {"listCollections":1}
2020/08/15 11:33:28 misa {"listCollections":1}
In the log above, Mongood created 3 clients. I think it should create more clients if the network between Mongood and Mongodb server is slower.
Because it need some time (maybe milliseconds to seconds) to wait mongo.NewClient
returning a client instance, then the client cache can be empty when other new create(uri)
calls come, and these new calls will also create new client instances via mongo.NewClient
.
mongo.NewClient
to make sure there is only one create call can fall into mongo.NewClient
calling.I'm very glad to create a PR for this if you need any help.
Thanks for your good application.
Currently, Mongood can only be launched from command line by ./mongood
(client mode).
Can we provide an app with an icon, then we can launch mongood by just double clicking the app file (just like what we launch WeChat app on Mac or windows system).
For packaging a graphical app written in go, we may use fyne, which is designed for building cross platform GUI in go.
Fyne provide command to package a GUI application (see document).
For example, we can:
go get fyne.io/fyne/cmd/fyne
cd go
# MacOS
CC=clang CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o mongood-darwin
CC=clang CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 fyne package -os darwin -icon mongood.png -release --executable ./mongood-darwin
# windows
CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -o mongood-windows.exe
CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows GOARCH=amd64 fyne package -os windows -icon mongood.png -release --executable mongood-windows.exe
Maybe we can provide a script or makefile for packaging.
We need to design or find an app icon.
No Database
(Unauthorized) not authorized on admin to execute command { serverStatus: 1 }
always use admin database, but database is provided in mongo uri.
http://localhost:54034/api/runCommand?d=admin&c=listDatabases
Hi,
Thanks for making this available. I downloaded the windowsx64 executable. The edit connection window didn't allow me to edit the connection details, didn;t seem to respond to keyboard or mouse input, so I haven't got beyond there. I will try downloading the linux version and then the source code to see if the connection is hard coded but thought I should alert you to this as it looks like it might be a useful tool but shame to have this as first hurdle.
一台windows server 2016 能打开
还有个win10打开闪退
没有报错信息,我也没法给你反馈点啥
I'm trying to open the app but it closes after opening it.
Not sure if it's because of my mac os version or what
Version: MacOs Monterey 12.3 Beta (21E5206e)
用了一段时间,感觉mongood基本上是我在网页端用过最舒服的mongo客户端了,不过好像不支持对collection的操作?还是说我没注意到
I tried downloading the pre-built Mac binary and running, and no windows pop up, nothing. No errors. Just simply doesn't open.
I make sure to right-click open, and no prompt about un-verified developer.
I'm on macOS Big Sur 11.6, MacBook Pro 16" with intel processor
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.