Show node ID in regular text not disabled control (fixes #162)

This commit is contained in:
Jakob Borg 2014-04-30 22:42:39 +02:00
parent aff3cd01c5
commit 4f2fe07ae4
4 changed files with 9 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,7 @@ import (
"encoding/base64" "encoding/base64"
"encoding/json" "encoding/json"
"io/ioutil" "io/ioutil"
"log"
"math/rand" "math/rand"
"net/http" "net/http"
"runtime" "runtime"
@ -26,7 +27,7 @@ var (
guiErrors = []guiError{} guiErrors = []guiError{}
guiErrorsMut sync.Mutex guiErrorsMut sync.Mutex
static = embeddedStatic() static = embeddedStatic()
staticFunc = static.(func(http.ResponseWriter, *http.Request)) staticFunc = static.(func(http.ResponseWriter, *http.Request, *log.Logger))
) )
const ( const (
@ -69,7 +70,7 @@ func startGUI(cfg GUIConfiguration, m *Model) {
func getRoot(w http.ResponseWriter, r *http.Request) { func getRoot(w http.ResponseWriter, r *http.Request) {
r.URL.Path = "/index.html" r.URL.Path = "/index.html"
staticFunc(w, r) staticFunc(w, r, nil)
} }
func restMiddleware(w http.ResponseWriter, r *http.Request) { func restMiddleware(w http.ResponseWriter, r *http.Request) {

View File

@ -4,6 +4,7 @@ package main
import ( import (
"fmt" "fmt"
"log"
"mime" "mime"
"net/http" "net/http"
"path/filepath" "path/filepath"
@ -15,7 +16,7 @@ import (
func embeddedStatic() interface{} { func embeddedStatic() interface{} {
var modt = time.Now().UTC().Format(http.TimeFormat) var modt = time.Now().UTC().Format(http.TimeFormat)
return func(res http.ResponseWriter, req *http.Request) { return func(res http.ResponseWriter, req *http.Request, log *log.Logger) {
file := req.URL.Path file := req.URL.Path
if file[0] == '/' { if file[0] == '/' {

View File

@ -361,8 +361,9 @@
<form role="form"> <form role="form">
<div class="form-group"> <div class="form-group">
<label for="nodeID">Node ID</label> <label for="nodeID">Node ID</label>
<input ng-disabled="editingExisting" id="nodeID" class="form-control" type="text" ng-model="currentNode.NodeID"></input> <input ng-if="!editingExisting" id="nodeID" class="form-control" type="text" ng-model="currentNode.NodeID"></input>
<p class="help-block">The node ID can be found in the logs or in the "Add Node" dialog on the other node.</p> <div ng-if="editingExisting" class="well well-sm">{{currentNode.NodeID}}</div>
<p class="help-block">The node ID can be found in the "Add Node" dialog on the other node.</p>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="name">Name</label> <label for="name">Name</label>