Skip to content
Snippets Groups Projects
Unverified Commit e212795a authored by jkrvivian's avatar jkrvivian Committed by GitHub
Browse files

Refactor: Rename SPA to Dashboard (#336)

parent 02e044d0
No related branches found
No related tags found
No related merge requests found
Showing
with 16 additions and 16 deletions
...@@ -10,7 +10,7 @@ const ( ...@@ -10,7 +10,7 @@ const (
PriorityAutopeering PriorityAutopeering
PriorityGossip PriorityGossip
PriorityWebAPI PriorityWebAPI
PrioritySPA PriorityDashboard
PriorityGraph PriorityGraph
PrioritySpammer PrioritySpammer
PriorityBadgerGarbageCollection PriorityBadgerGarbageCollection
......
...@@ -2,11 +2,11 @@ package ui ...@@ -2,11 +2,11 @@ package ui
import ( import (
"github.com/iotaledger/goshimmer/plugins/graph" "github.com/iotaledger/goshimmer/plugins/graph"
"github.com/iotaledger/goshimmer/plugins/spa" "github.com/iotaledger/goshimmer/plugins/dashboard"
"github.com/iotaledger/hive.go/node" "github.com/iotaledger/hive.go/node"
) )
var PLUGINS = node.Plugins( var PLUGINS = node.Plugins(
spa.PLUGIN, dashboard.PLUGIN,
graph.PLUGIN, graph.PLUGIN,
) )
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
// You can use the "packr clean" command to clean up this, // You can use the "packr clean" command to clean up this,
// and any other packr generated files. // and any other packr generated files.
package spa package dashboard
import _ "github.com/iotaledger/goshimmer/plugins/spa/packrd" import _ "github.com/iotaledger/goshimmer/plugins/dashboard/packrd"
package spa package dashboard
import ( import (
"encoding/hex" "encoding/hex"
...@@ -42,14 +42,14 @@ func runDrngLiveFeed() { ...@@ -42,14 +42,14 @@ func runDrngLiveFeed() {
} }
}) })
daemon.BackgroundWorker("SPA[DRNGUpdater]", func(shutdownSignal <-chan struct{}) { daemon.BackgroundWorker("Dashboard[DRNGUpdater]", func(shutdownSignal <-chan struct{}) {
drng.Instance.Events.Randomness.Attach(notifyNewRandomness) drng.Instance.Events.Randomness.Attach(notifyNewRandomness)
drngLiveFeedWorkerPool.Start() drngLiveFeedWorkerPool.Start()
<-shutdownSignal <-shutdownSignal
log.Info("Stopping SPA[DRNGUpdater] ...") log.Info("Stopping Dashboard[DRNGUpdater] ...")
drng.Instance.Events.Randomness.Detach(notifyNewRandomness) drng.Instance.Events.Randomness.Detach(notifyNewRandomness)
newMsgRateLimiter.Stop() newMsgRateLimiter.Stop()
drngLiveFeedWorkerPool.Stop() drngLiveFeedWorkerPool.Stop()
log.Info("Stopping SPA[DRNGUpdater] ... done") log.Info("Stopping Dashboard[DRNGUpdater] ... done")
}, shutdown.PrioritySPA) }, shutdown.PriorityDashboard)
} }
package spa package dashboard
import ( import (
"net/http" "net/http"
......
# GoShimmer SPA # GoShimmer Dashboard
Programmed using modern web technologies. Programmed using modern web technologies.
### SPA in dev mode ### Dashboard in dev mode
1. Make sure to set `dashboard.dev` to true, to enable GoShimmer to serve assets 1. Make sure to set `dashboard.dev` to true, to enable GoShimmer to serve assets
from the webpack-dev-server. from the webpack-dev-server.
...@@ -10,15 +10,15 @@ Programmed using modern web technologies. ...@@ -10,15 +10,15 @@ Programmed using modern web technologies.
3. Run a webpack-dev-server instance by running `yarn start` within the `frontend` directory. 3. Run a webpack-dev-server instance by running `yarn start` within the `frontend` directory.
4. Using default port config, you should now be able to access the dashboard under http://127.0.0.1:8081 4. Using default port config, you should now be able to access the dashboard under http://127.0.0.1:8081
The SPA is hot-reload enabled. The Dashboard is hot-reload enabled.
### Pack your changes ### Pack your changes
We are using [packr2](https://github.com/gobuffalo/packr/tree/master/v2) to wrap all built frontend files into Go files. We are using [packr2](https://github.com/gobuffalo/packr/tree/master/v2) to wrap all built frontend files into Go files.
1. [Install `packr2`](https://github.com/gobuffalo/packr/tree/master/v2#binary-installation) if not already done. 1. [Install `packr2`](https://github.com/gobuffalo/packr/tree/master/v2#binary-installation) if not already done.
2. Build SPA by running `yarn build` within the `frontend` directory. 2. Build Dashboard by running `yarn build` within the `frontend` directory.
3. Change to the `plugins/spa` directory. 3. Change to the `plugins/spa` directory.
4. Run `packr2`. 4. Run `packr2`.
5. `plugins/spa/packrd` should have been modified. 5. `plugins/spa/packrd` should have been modified.
6. Done. Now you can build goShimmer and your SPA changes will be included within the binary. 6. Done. Now you can build goShimmer and your Dashboard changes will be included within the binary.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment