diff --git a/configRoutes.go b/configRoutes.go index 604c7f79..c34056b1 100644 --- a/configRoutes.go +++ b/configRoutes.go @@ -14,6 +14,15 @@ func getAllSettings(w http.ResponseWriter, r *http.Request) { } } +func saveAllSettings(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + + if err := json.NewEncoder(w).Encode(true); err != nil { + panic(err) + } +} + var configRoutes = Routes{ Route{ "GetAllSettings", @@ -21,4 +30,11 @@ var configRoutes = Routes{ "/config/all", getAllSettings, }, + + Route{ + "SaveAllSettings", + "POST", + "/config/all/save", + saveAllSettings, + }, } diff --git a/web/app/app.js b/web/app/app.js index bb0aef2a..c3760c57 100644 --- a/web/app/app.js +++ b/web/app/app.js @@ -3,12 +3,23 @@ // Declare app level module which depends on views, and components angular.module('myApp', [ 'ngRoute', + 'ui-notification', 'myApp.home', 'myApp.about', 'myApp.settings', 'myApp.version' ]). -config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) { +config(['$locationProvider', '$routeProvider' ,'NotificationProvider', function($locationProvider, $routeProvider, NotificationProvider) { + NotificationProvider.setOptions({ + delay: 10000, + startTop: 60, + startRight: 10, + verticalSpacing: 10, + horizontalSpacing: 20, + positionX: 'right', + positionY: 'top' + }); + $locationProvider.hashPrefix('!'); $routeProvider.otherwise({redirectTo: '/'}); diff --git a/web/app/index.html b/web/app/index.html index b6ff3be1..f5f1b470 100644 --- a/web/app/index.html +++ b/web/app/index.html @@ -11,12 +11,14 @@ + - + + - +