GithubHelp home page GithubHelp logo

renzholy / mongood Goto Github PK

View Code? Open in Web Editor NEW
733.0 11.0 60.0 13.18 MB

A MongoDB GUI with Fluent Design

License: GNU Affero General Public License v3.0

TypeScript 97.40% Go 2.12% Dockerfile 0.29% Shell 0.03% JavaScript 0.08% CSS 0.08%
mongodb fluent-design database-management monaco-editor dark-theme darkmode react swr vite

mongood's People

Contributors

codacy-badger avatar dependabot[bot] avatar genshen avatar renzholy avatar wenyxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mongood's Issues

Client webview support on machine without chrome installed

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.

uri parser problem?

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

connect: 'direct',

The error disappeared.

Connection Error. uri parser problem?

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.

Geo preview功能能否加入腾讯或高德地图支持?

mongo客户端目前nosqlbooster用的最多,其中一个痛点就是nosqlbooster无法展示gui地图位置信息。
试用了一下这个软件我觉得界面还可以,很多功能可以深挖。
国内大部分做geo相关的公司mongo库里存的都是gcj02,针对这个能否出一个切换按钮,使地图渲染使用高德?
key的话可以让用户自己填自己的。
另一个痛点是无法展示轨迹信息,比如多选了多个带有geo point 的点,能否按照查询结果的顺序调用高德的轨迹渲染api在地图上展示轨迹。
解决了这两点那真的其它的客户端都可以卸载了。
(还有个小问题,新建索引的时候真的有点迷惑
return { background: true }
看到这个有点迷惑,没有nosqlbooster的可视化来的直观

Mongo client leak at go server side

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.

possible fixes

  1. Maybe we can add a lock(sync. Mutex) before mongo.NewClient to make sure there is only one create call can fall into mongo.NewClient calling.
  2. Don't create client instances in http Handle, setup mongo client instances once Mongood is launched.
  3. Don't fix this problem if leak is not serious.

I'm very glad to create a PR for this if you need any help.

[Feature Request] Can we provide a script and icon for packaging a graphical app

Motivation

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).

Suggestion

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.

Todo

We need to design or find an app icon.

Connection editing

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.

App not opening in MacOs

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)

Pre-built Mac binary does not open

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.