Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f0e64cbc34 | |||
| e7587dae2d | |||
| 2e264ecaf1 | |||
| 046c6627ec | |||
| 36f49749ad | |||
| aacebe5c5f | |||
| 80d230be98 | |||
| 27c9621833 | |||
| 082502c7e6 | |||
| f4684673e7 | |||
| 0dc5c2878f | |||
| efdb188aba |
@@ -5,6 +5,7 @@ mode:regex
|
|||||||
^clientpack/
|
^clientpack/
|
||||||
|
|
||||||
^_dist/
|
^_dist/
|
||||||
|
^node_modules/
|
||||||
^vendor/
|
^vendor/
|
||||||
|
|
||||||
^nmdc-webfrontend$
|
^nmdc-webfrontend$
|
||||||
|
|||||||
2
.hgtags
2
.hgtags
@@ -9,3 +9,5 @@ d14041daa7bbbd37ea2ff47aa978b9595af67ca3 v1.1.1
|
|||||||
0eeab5594ba4d683e6a268ef971675c73b226bd0 v1.2.0
|
0eeab5594ba4d683e6a268ef971675c73b226bd0 v1.2.0
|
||||||
c8cd84947e4516215e50639914adfaecf350fe91 v1.2.1
|
c8cd84947e4516215e50639914adfaecf350fe91 v1.2.1
|
||||||
0c6b957de43252f89688ba73c4857f6d912b2912 v1.2.2
|
0c6b957de43252f89688ba73c4857f6d912b2912 v1.2.2
|
||||||
|
e7de5d5504b9a2bf368279d6a691458398a638bf v1.2.3
|
||||||
|
4dc4a77c8db3170b284e12e33171994ad18ffa29 v1.3.0
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ type Config struct {
|
|||||||
|
|
||||||
Hub struct {
|
Hub struct {
|
||||||
Address string `json:"address"`
|
Address string `json:"address"`
|
||||||
Port int `json:"port"`
|
Port int `json:"port,omitempty"`
|
||||||
Tag string `json:"tag"`
|
Tag string `json:"tag"`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
12
Gopkg.lock
generated
12
Gopkg.lock
generated
@@ -4,8 +4,14 @@
|
|||||||
[[projects]]
|
[[projects]]
|
||||||
name = "code.ivysaur.me/libnmdc"
|
name = "code.ivysaur.me/libnmdc"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "21847db9fdc1b983285de44e789cd9e921bdf1bb"
|
revision = "a23cc9e61d24bb9b16b1126bdddd514e01d64792"
|
||||||
version = "v0.14.0"
|
version = "v0.16.0"
|
||||||
|
|
||||||
|
[[projects]]
|
||||||
|
branch = "master"
|
||||||
|
name = "github.com/cxmcc/tiger"
|
||||||
|
packages = ["."]
|
||||||
|
revision = "bde35e2713d7f674987c2ecb21a6b0fc33749516"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
@@ -28,6 +34,6 @@
|
|||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "928468c40a3a664870459e1d5a1fa97fcbc45802fdd498ebf89bcffe0b44ec6e"
|
inputs-digest = "7ac2438222289730d49b803fd1c631629921f95fd406c3154a54d34e11fb6947"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "code.ivysaur.me/libnmdc"
|
name = "code.ivysaur.me/libnmdc"
|
||||||
version = "0.14.0"
|
version = "0.16.0"
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
BINNAME=nmdc-webfrontend
|
BINNAME=nmdc-webfrontend
|
||||||
|
|
||||||
VERSION=1.2.3
|
VERSION=1.3.0
|
||||||
|
|
||||||
GOFLAGS=-a \
|
GOFLAGS=-a \
|
||||||
-ldflags "-s -w -X main.VERSION=$(BINNAME)/$(VERSION)" \
|
-ldflags "-s -w -X main.VERSION=$(BINNAME)/$(VERSION)" \
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
A web interface to an NMDC hub.
|
A web interface to an NMDC/ADC hub.
|
||||||
|
|
||||||
Chat in real-time on your NMDC hub using a web browser. This project forks and deprecates my earlier `dcwebui2` project since Go seems to use less memory than node.
|
Chat in real-time on your NMDC/ADC hub using a web browser. This project forks and deprecates my earlier `dcwebui2` project since Go seems to use less memory than node.
|
||||||
|
|
||||||
Written in Golang
|
Written in Golang
|
||||||
|
|
||||||
@@ -29,6 +29,13 @@ This project supercedes [entry=dcwebui]dcwebui[/entry], [entry=flexdc]flexdc[/en
|
|||||||
|
|
||||||
=CHANGELOG=
|
=CHANGELOG=
|
||||||
|
|
||||||
|
2017-11-26 1.3.0
|
||||||
|
- Update libnmdc to 0.16 (adds ADC hub support)
|
||||||
|
- Configuration: The `hub.port` property is now optional. You can specify a full URI in the `hub.address` property instead.
|
||||||
|
|
||||||
|
2017-11-14 1.2.3
|
||||||
|
- Update libnmdc to 0.15
|
||||||
|
|
||||||
2017-10-28 1.2.2
|
2017-10-28 1.2.2
|
||||||
- Enhancement: Simplify build process
|
- Enhancement: Simplify build process
|
||||||
- Fix an issue with closing PM tabs
|
- Fix an issue with closing PM tabs
|
||||||
|
|||||||
19
main.go
19
main.go
@@ -48,14 +48,19 @@ func (this *App) HubWorker(Nick, Pass string, so socketio.Socket, done chan stru
|
|||||||
selfUser.ClientTag = this.cfg.Hub.Tag
|
selfUser.ClientTag = this.cfg.Hub.Tag
|
||||||
selfUser.ClientVersion = libnmdc.DEFAULT_CLIENT_VERSION
|
selfUser.ClientVersion = libnmdc.DEFAULT_CLIENT_VERSION
|
||||||
|
|
||||||
hco := libnmdc.HubConnectionOptions{
|
url := this.cfg.Hub.Address
|
||||||
Address: libnmdc.HubAddress(fmt.Sprintf("%s:%d", this.cfg.Hub.Address, this.cfg.Hub.Port)),
|
if this.cfg.Hub.Port == 0 {
|
||||||
Self: *selfUser,
|
url = fmt.Sprintf("%s:%d", this.cfg.Hub.Address, this.cfg.Hub.Port)
|
||||||
NickPassword: Pass,
|
|
||||||
NumEventsToBuffer: 0,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hub := hco.Connect()
|
hco := libnmdc.HubConnectionOptions{
|
||||||
|
Address: libnmdc.HubAddress(url),
|
||||||
|
Self: selfUser,
|
||||||
|
NickPassword: Pass,
|
||||||
|
}
|
||||||
|
|
||||||
|
hubEvents := make(chan libnmdc.HubEvent, 10)
|
||||||
|
hub := libnmdc.ConnectAsync(&hco, hubEvents)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
hub.Disconnect()
|
hub.Disconnect()
|
||||||
@@ -105,7 +110,7 @@ func (this *App) HubWorker(Nick, Pass string, so socketio.Socket, done chan stru
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
|
||||||
case hev, ok := <-hub.OnEvent:
|
case hev, ok := <-hubEvents:
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Printf("[%s] hub chan closed\n", so.Id())
|
log.Printf("[%s] hub chan closed\n", so.Id())
|
||||||
return // abandon
|
return // abandon
|
||||||
|
|||||||
@@ -12,9 +12,8 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"hub": {
|
"hub": {
|
||||||
"address": "127.0.0.1",
|
"address": "nmdc://127.0.0.1:411",
|
||||||
"port": 411,
|
|
||||||
"tag": "nmdc-webfrontend"
|
"tag": "nmdc-webfrontend"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user