diff --git a/rootfs/standard/var/www/mynode/device_info.py b/rootfs/standard/var/www/mynode/device_info.py index 5c68918a..38a81140 100644 --- a/rootfs/standard/var/www/mynode/device_info.py +++ b/rootfs/standard/var/www/mynode/device_info.py @@ -701,6 +701,24 @@ def toggle_darkmode(): else: enable_darkmode() +def set_background(background): + ui_settings = read_ui_settings() + ui_settings['background'] = background + write_ui_settings(ui_settings) + +def get_background(): + ui_settings = read_ui_settings() + return ui_settings['background'] + +# def get_background_choices(): +# choices = [] +# choices.append("none") +# for filename in os.listdir("/var/www/mynode/static/images/backgrounds/"): +# if filename.endswith(".png") or filename.endswith(".jpg"): +# name = filename.replace(".png","").replace(".jpg","") +# choices.append(name) +# return choices + def is_https_forced(): return os.path.isfile('/home/bitcoin/.mynode/https_forced') diff --git a/rootfs/standard/var/www/mynode/settings.py b/rootfs/standard/var/www/mynode/settings.py index 33fabf5a..be717d05 100644 --- a/rootfs/standard/var/www/mynode/settings.py +++ b/rootfs/standard/var/www/mynode/settings.py @@ -903,6 +903,18 @@ def toggle_darkmode_page_home(): toggle_darkmode() return redirect("/") +@mynode_settings.route("/settings/set-background", methods=['POST']) +def set_background_page(): + check_logged_in() + + if not request.form.get('background'): + flash("No background specified", category="error") + return redirect("/settings") + + bg = request.form.get('background') + set_background(bg) + + return redirect("/settings") @mynode_settings.route("/settings/toggle-netdata") def toggle_netdata_page(): diff --git a/rootfs/standard/var/www/mynode/static/images/backgrounds/laser_eyes.png b/rootfs/standard/var/www/mynode/static/images/backgrounds/laser_eyes.png new file mode 100644 index 00000000..cca4155a Binary files /dev/null and b/rootfs/standard/var/www/mynode/static/images/backgrounds/laser_eyes.png differ diff --git a/rootfs/standard/var/www/mynode/static/images/backgrounds/moon.png b/rootfs/standard/var/www/mynode/static/images/backgrounds/moon.png new file mode 100644 index 00000000..c69ece56 Binary files /dev/null and b/rootfs/standard/var/www/mynode/static/images/backgrounds/moon.png differ diff --git a/rootfs/standard/var/www/mynode/templates/includes/head.html b/rootfs/standard/var/www/mynode/templates/includes/head.html index b72a839e..cafe2d63 100644 --- a/rootfs/standard/var/www/mynode/templates/includes/head.html +++ b/rootfs/standard/var/www/mynode/templates/includes/head.html @@ -10,3 +10,14 @@ + +{% if ui_settings['background'] and ui_settings['background'] != "none" %} + +{% endif %} \ No newline at end of file diff --git a/rootfs/standard/var/www/mynode/templates/settings.html b/rootfs/standard/var/www/mynode/templates/settings.html index e6ee10a4..7b2ee6ee 100644 --- a/rootfs/standard/var/www/mynode/templates/settings.html +++ b/rootfs/standard/var/www/mynode/templates/settings.html @@ -364,6 +364,11 @@ window.location.href='/settings/reinstall-app?app='+reinstall_app_choice }); + $("#logout_days").selectmenu({width: 70}); + $("#logout_hours").selectmenu({width: 70}); + + $("#background").selectmenu(); + var swap_choice=""; $("#swap_size").selectmenu( { change: function( event, data ) { @@ -535,6 +540,21 @@
+
Background
+ For fun, you can set a background image. +

+ +
+ + +
+ +
+
Automatic Logout
Your myNode will logout automatically after a period of inactivity. It can be changed below.

@@ -554,7 +574,7 @@ {% endfor %} - +