func GetNodes(c *gin.Context) { nodes, err := store.GetNodeList(c) if err != nil { c.String(400, err.Error()) } else { c.JSON(200, nodes) } }
func ShowNodes(c *gin.Context) { user := session.User(c) nodes, _ := store.GetNodeList(c) token, _ := token.New(token.CsrfToken, user.Login).Sign(user.Hash) c.HTML(http.StatusOK, "nodes.html", gin.H{"User": user, "Nodes": nodes, "Csrf": token}) }