pass the mouse click to the area
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
7e5e36dd13
commit
9a2b03fc96
5
Makefile
5
Makefile
|
@ -1,18 +1,19 @@
|
||||||
GITCOMMIT = $(shell git rev-list -1 HEAD)
|
GITCOMMIT = $(shell git rev-list -1 HEAD)
|
||||||
GOVERSION = $(shell go version | cut -d' ' -f 3)
|
GOVERSION = $(shell go version | cut -d' ' -f 3)
|
||||||
BUILDTIME = $(shell date -u --iso-8601=seconds)
|
BUILDTIME = $(shell date -u --iso-8601=seconds)
|
||||||
|
VERSION = $(shell cat VERSION)
|
||||||
|
|
||||||
# try go get github.com/ahmetb/govvv
|
# try go get github.com/ahmetb/govvv
|
||||||
# this will add branch info & build RFC3339 date also
|
# this will add branch info & build RFC3339 date also
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@echo your version of go must be greater than 2.10. Your version is ${GOVERSION}
|
@echo your version of go must be greater than 2.10. Your version is ${GOVERSION}
|
||||||
go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}'"
|
go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}' -X main.VERSION=${VERSION}"
|
||||||
./cloud-control-panel
|
./cloud-control-panel
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
@echo your version of go must be greater than 2.10. Your version is ${GOVERSION}
|
@echo your version of go must be greater than 2.10. Your version is ${GOVERSION}
|
||||||
go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}'"
|
go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}' -X main.VERSION=${VERSION}"
|
||||||
./cloud-control-panel --debug
|
./cloud-control-panel --debug
|
||||||
|
|
||||||
nogui:
|
nogui:
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
2019/06/01 21:11:47 connecting to ws://v000185.testing.com.customers.wprod.wit.com:9000/event
|
||||||
|
2019/06/01 21:11:47 fqdn.Get() = librem15.lab.wit.com
|
||||||
|
INFO[0000] *** error: read udp [2604:bbc0:1:22::f5d3:7f44]:50435->[2001:500:12::d0d]:53: i/o timeout
|
||||||
|
|
||||||
|
make: *** [Makefile:52: config-default-config] Error 1
|
|
@ -0,0 +1,37 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Get Fully Qualified Domain Name
|
||||||
|
// returns "unknown" or hostanme in case of error
|
||||||
|
func FqdnGet() string {
|
||||||
|
hostname, err := os.Hostname()
|
||||||
|
if err != nil {
|
||||||
|
return "unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
addrs, err := net.LookupIP(hostname)
|
||||||
|
if err != nil {
|
||||||
|
return hostname
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, addr := range addrs {
|
||||||
|
if ipv4 := addr.To4(); ipv4 != nil {
|
||||||
|
ip, err := ipv4.MarshalText()
|
||||||
|
if err != nil {
|
||||||
|
return hostname
|
||||||
|
}
|
||||||
|
hosts, err := net.LookupAddr(string(ip))
|
||||||
|
if err != nil || len(hosts) == 0 {
|
||||||
|
return hostname
|
||||||
|
}
|
||||||
|
fqdn := hosts[0]
|
||||||
|
return strings.TrimSuffix(fqdn, ".") // return fqdn without trailing dot
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return hostname
|
||||||
|
}
|
10
main.go
10
main.go
|
@ -16,13 +16,10 @@ import "git.wit.com/jcarr/dnssecsocket"
|
||||||
import "github.com/gobuffalo/packr"
|
import "github.com/gobuffalo/packr"
|
||||||
import "github.com/davecgh/go-spew/spew"
|
import "github.com/davecgh/go-spew/spew"
|
||||||
|
|
||||||
// will try to get this hosts FQDN
|
|
||||||
import "github.com/Showmax/go-fqdn"
|
|
||||||
|
|
||||||
var GITCOMMIT string // this is passed in as an ldflag
|
var GITCOMMIT string // this is passed in as an ldflag
|
||||||
var GOVERSION string // this is passed in as an ldflag
|
var GOVERSION string // this is passed in as an ldflag
|
||||||
var BUILDTIME string // this is passed in as an ldflag
|
var BUILDTIME string // this is passed in as an ldflag
|
||||||
const VERSION = "0.2"
|
var VERSION string // this is passed in as an ldflag
|
||||||
|
|
||||||
// use mergo to merge structs
|
// use mergo to merge structs
|
||||||
// import "github.com/imdario/mergo"
|
// import "github.com/imdario/mergo"
|
||||||
|
@ -104,13 +101,10 @@ func main() {
|
||||||
onExit(err)
|
onExit(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// gui.Data.Width = int(config.Width)
|
|
||||||
// gui.Data.Height = int(config.Height)
|
|
||||||
|
|
||||||
// use this to discover what the OS thinks it's hostname is
|
// use this to discover what the OS thinks it's hostname is
|
||||||
// seems to be cross platform (?)
|
// seems to be cross platform (?)
|
||||||
// Windows: WMIC computersystem where caption='current_pc_name' rename new_pc_name
|
// Windows: WMIC computersystem where caption='current_pc_name' rename new_pc_name
|
||||||
hostname := fqdn.Get()
|
hostname := FqdnGet()
|
||||||
log.Println("fqdn.Get() = ", hostname)
|
log.Println("fqdn.Get() = ", hostname)
|
||||||
gui.Data.Hostname = hostname
|
gui.Data.Hostname = hostname
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import pb "git.wit.com/wit/witProtobuf"
|
||||||
func showSplashBox(gw *gui.GuiWindow) *gui.GuiBox {
|
func showSplashBox(gw *gui.GuiWindow) *gui.GuiBox {
|
||||||
log.Println("ShowSplashBox() START")
|
log.Println("ShowSplashBox() START")
|
||||||
text := getNEWTEXT()
|
text := getNEWTEXT()
|
||||||
box := gui.ShowTextBox(gw, text)
|
box := gui.ShowTextBox(gw, text, splashClick)
|
||||||
|
|
||||||
if runtime.GOOS == "linux" {
|
if runtime.GOOS == "linux" {
|
||||||
gui.NewLabel(box,"OS: Linux")
|
gui.NewLabel(box,"OS: Linux")
|
||||||
|
|
Loading…
Reference in New Issue