diff --git a/luciexpress/htdocs/js/config.js b/luciexpress/htdocs/js/config.js
index 273a045a4..9f11eb2a2 100644
--- a/luciexpress/htdocs/js/config.js
+++ b/luciexpress/htdocs/js/config.js
@@ -79,6 +79,9 @@ angular.module("luci")
"asterisk.call_log.list",
"asterisk.status",
"luci2.system.password_set",
+ "luci2.system.backup_restore",
+ "luci2.system.reset_test",
+ "luci2.system.reset_start",
// local stuff for the node server.
"local.features",
"local.set_rpc_host"
diff --git a/luciexpress/htdocs/plugins/settings/pages/settings.configuration.html b/luciexpress/htdocs/plugins/settings/pages/settings.configuration.html
index b7c45811d..4e9d40db6 100644
--- a/luciexpress/htdocs/plugins/settings/pages/settings.configuration.html
+++ b/luciexpress/htdocs/plugins/settings/pages/settings.configuration.html
@@ -5,18 +5,56 @@
{{ 'settings.config.info' | translate }}
-
+
-
-
-
-
{{'Factory Settings'|translate}}
-
-
-
+
+
+
{{'Factory Settings'|translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js b/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js
index 3921db442..70c454221 100644
--- a/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js
+++ b/luciexpress/htdocs/plugins/settings/pages/settings.configuration.js
@@ -1,4 +1,67 @@
$juci.module("settings")
-.controller("SettingsConfigurationCtrl", function($scope){
-
+.controller("SettingsConfigurationCtrl", function($scope, $rpc, $session){
+ $scope.sessionID = $session.sid;
+ $scope.resetPossible = 0;
+ $rpc.luci2.system.reset_test().done(function(result){
+ if(result && result.supported) {
+ $scope.resetPossible = 1;
+ $scope.$apply();
+ }
+ });
+ $scope.onReset = function(){
+ $rpc.luci2.system.reset_start().done(function(result){
+ console.log("Performing reset: "+JSON.stringify(result));
+ });
+ }
+ $scope.onSaveConfig = function(){
+ $scope.showModal = 1;
+
+ }
+ $scope.onRestoreConfig = function(){
+ $scope.showUploadModal = 1;
+ }
+ $scope.onCancelRestore = function(){
+ $scope.showUploadModal = 0;
+ }
+ $scope.restore = {};
+ /*setInterval(function checkUpload(){
+ var iframe = $("#postiframe").load(function(){;
+ var json = iframe.contents().text();
+ try {
+ if(json.length && JSON.parse(json)) {
+ $scope.onUploadComplete(JSON.parse(json));
+ }
+ } catch(e){}
+ iframe.each(function(e){$(e).contents().html("");}); ;
+ }, 500); */
+ $scope.onUploadConfig = function(){
+ $("#postiframe").bind("load", function(){
+ var json = $(this).contents().text();
+ try {
+ var obj = JSON.parse(json);
+ $scope.onUploadComplete(JSON.parse(json));
+ } catch(e){}
+ $(this).unbind("load");
+ });
+ $("form[name='restoreForm']").submit();
+ }
+ $scope.onUploadComplete = function(result){
+ console.log("Result: "+JSON.stringify(result)+": "+$scope.restore.password);
+ $rpc.luci2.system.backup_restore({
+ password: $scope.restore.password
+ }).done(function(result){
+ if(result.code){
+ alert(result.stderr);
+ } else {
+ $scope.showUploadModal = 0;
+ }
+ });
+ }
+ $scope.onAcceptModal = function(){
+ $("form[name='backupForm']").submit();
+ $scope.showModal = 0;
+ }
+ $scope.onDismissModal = function(){
+ $scope.showModal = 0;
+ }
});
diff --git a/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html b/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html
index 78175dc08..d85b0640b 100644
--- a/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html
+++ b/luciexpress/htdocs/plugins/settings/pages/settings.upgrade.html
@@ -13,10 +13,10 @@