系统监视悬浮窗用Go+QML重写.前后端分离,可远程监视
Tofloor
poster avatar
myml
Super Moderator
Developer
2017-08-12 19:22
Author
之前写了个纯QML实现的系统监视器 https://bbs.deepin.org/post/143677 。
有些想法QML无法实现,就用Go重写了后端,前端界面也重写了,更贴近深度的颜色(ps:不会设计)


前后端使用http通信,可以远程监控,具体教程可以看https://github.com/myml/go-monitor/

监控用了https://github.com/shirou/gopsutil/这个golang库,支持跨平台,先只在linux下测试,计划开发windows和android版本

下载体验 https://github.com/myml/go-monitor/releases/tag/0.1
这个是用Qt5.9.1静态编译的,go静态库附加里面,所以有点大

什么时候深度内置Qt5.9运行库啊,好歹也是个LTS

Reply Favorite View the author
All Replies
avatar
justforlxz
deepin
2017-08-12 21:19
#1
所以,,为啥不是c++和qml使用信号槽通信,应该比go+qml更方便些。
Reply View the author
avatar
myml
Super Moderator
Developer
2017-08-12 21:52
#2
本帖最后由 myml 于 2017-8-12 13:55 编辑
https://bbs.deepin.org/post/144072
所以,,为啥不是c++和qml使用信号槽通信,应该比go+qml更方便些。

因为不会C++,go开发效率要高一些,信号槽也没法实现远程通信吧
Reply View the author
avatar
justforlxz
deepin
2017-08-12 23:28
#3
https://bbs.deepin.org/post/144072
因为不会C++,go开发效率要高一些,信号槽也没法实现远程通信吧

当然是在qt程序内部实现咯,qml也是qt的一个类去实例化和加载的,通过元对象来完成两边的信号槽的注册,虽然有些麻烦 2333
Reply View the author
avatar
BingoLove
deepin
2017-08-13 06:02
#4
https://bbs.deepin.org/post/144072
当然是在qt程序内部实现咯,qml也是qt的一个类去实例化和加载的,通过元对象来完成两边的信号槽的注册, ...

楼主说的是远程
意思应该是比如服务器监控这类的
Reply View the author
avatar
justforlxz
deepin
2017-08-13 17:49
#5
https://bbs.deepin.org/post/144072
楼主说的是远程
意思应该是比如服务器监控这类的

没注意到还有远程功能
Reply View the author
avatar
myml
Super Moderator
Developer
2017-08-13 18:42
#6
https://bbs.deepin.org/post/144072
楼主说的是远程
意思应该是比如服务器监控这类的

是的,不只服务器,还有路由器,树莓派都可以
Reply View the author
avatar
tmacy
deepin
2017-08-13 19:23
#7
所以我理解是qml负责显示界面,go只是个服务?
Reply View the author
avatar
myml
Super Moderator
Developer
2017-08-13 20:34
#8
https://bbs.deepin.org/post/144072
所以我理解是qml负责显示界面,go只是个服务?

恩,go负责后端的数据采集,qml前端显示,中间用http通信
Reply View the author
avatar
akxf
deepin
2017-08-16 03:54
#9
怎样才能开机自动运行?
Reply View the author
avatar
myml
Super Moderator
Developer
2017-08-16 17:13
#10
https://bbs.deepin.org/post/144072
怎样才能开机自动运行?

只能手动创建快捷方式到~/.config/autostart 下个版本我会加这个
Reply View the author
avatar
catbb49294929
deepin
2017-08-16 17:55
#11
编译出错:# command-line-arguments
./main.go:19: undefined: sync.Map
Reply View the author
avatar
myml
Super Moderator
Developer
2017-08-16 19:35
#12
https://bbs.deepin.org/post/144072
编译出错:# command-line-arguments
./main.go:19: undefined: sync.Map

sync.Map是go1.9新加的并发安全的map类型,需要你升级go版本
Reply View the author
avatar
electricface
deepin
2017-08-17 06:03
#13
Reply View the author
avatar
myml
Super Moderator
Developer
2017-08-17 17:25
#14
https://bbs.deepin.org/post/144072
https://github.com/therecipe/qt 用这个库试试

之前尝试过,这个库在linux下不支持静态编译,打包起来太大了
Reply View the author