From 6552488748f27a8adbdbda77d5bf6c17795eeabf Mon Sep 17 00:00:00 2001 From: majormjr Date: Thu, 12 May 2016 07:31:05 -0400 Subject: [PATCH] moved backend application to src directory --- Makefile | 3 ++- conf.json.example | 5 ++--- auth.go => src/auth.go | 2 +- gameconfig.go => src/gameconfig.go | 0 gamelog.go => src/gamelog.go | 0 handlers.go => src/handlers.go | 0 main.go => src/main.go | 0 mods.go => src/mods.go | 0 mods_test.go => src/mods_test.go | 0 routes.go => src/routes.go | 0 saves.go => src/saves.go | 0 server.go => src/server.go | 0 ui/App/components/ConfigContent.jsx | 7 ++++--- 13 files changed, 9 insertions(+), 8 deletions(-) rename auth.go => src/auth.go (97%) rename gameconfig.go => src/gameconfig.go (100%) rename gamelog.go => src/gamelog.go (100%) rename handlers.go => src/handlers.go (100%) rename main.go => src/main.go (100%) rename mods.go => src/mods.go (100%) rename mods_test.go => src/mods_test.go (100%) rename routes.go => src/routes.go (100%) rename saves.go => src/saves.go (100%) rename server.go => src/server.go (100%) diff --git a/Makefile b/Makefile index 4bc7b05..26f8162 100644 --- a/Makefile +++ b/Makefile @@ -2,5 +2,6 @@ # build: - go build -o $(HOME)/factorio-server/factorio-server-manager + go build -o $(HOME)/factorio-server/factorio-server-manager src/* cp -r app/ $(HOME)/factorio-server/ + cp conf.json.example $(HOME)/factorio-server/conf.json diff --git a/conf.json.example b/conf.json.example index ed2e252..30a375d 100644 --- a/conf.json.example +++ b/conf.json.example @@ -1,6 +1,5 @@ { - "factorio_dir": "/home/mitch/.factorio", - "username": "name", - "password": "$111", + "username": "admin", + "password": "factorio", "database_file": "auth.leveldb" } diff --git a/auth.go b/src/auth.go similarity index 97% rename from auth.go rename to src/auth.go index b166bb8..14dc6ab 100644 --- a/auth.go +++ b/src/auth.go @@ -80,7 +80,7 @@ func (auth *AuthHTTP) listUsers() ([]User, error) { userResponse = append(userResponse, u) } - log.Printf("listing users: %+v", users) + log.Printf("listing users: %v found", len(users)) return userResponse, nil } diff --git a/gameconfig.go b/src/gameconfig.go similarity index 100% rename from gameconfig.go rename to src/gameconfig.go diff --git a/gamelog.go b/src/gamelog.go similarity index 100% rename from gamelog.go rename to src/gamelog.go diff --git a/handlers.go b/src/handlers.go similarity index 100% rename from handlers.go rename to src/handlers.go diff --git a/main.go b/src/main.go similarity index 100% rename from main.go rename to src/main.go diff --git a/mods.go b/src/mods.go similarity index 100% rename from mods.go rename to src/mods.go diff --git a/mods_test.go b/src/mods_test.go similarity index 100% rename from mods_test.go rename to src/mods_test.go diff --git a/routes.go b/src/routes.go similarity index 100% rename from routes.go rename to src/routes.go diff --git a/saves.go b/src/saves.go similarity index 100% rename from saves.go rename to src/saves.go diff --git a/server.go b/src/server.go similarity index 100% rename from server.go rename to src/server.go diff --git a/ui/App/components/ConfigContent.jsx b/ui/App/components/ConfigContent.jsx index 0f42047..9bba69a 100644 --- a/ui/App/components/ConfigContent.jsx +++ b/ui/App/components/ConfigContent.jsx @@ -19,9 +19,10 @@ class ConfigContent extends React.Component { $.ajax({ url: "/api/config", dataType: "json", - success: (data) => { - this.setState({config: data.data}) - console.log(this.state.config) + success: (resp) => { + if (resp.success === true) { + this.setState({config: resp.data}) + } }, error: (xhr, status, err) => { console.log('/api/config/get', status, err.toString());