From 6f577b1cbe940866d7a2d63db005a3efdc338ff1 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 8 Jan 2024 21:25:10 +0100 Subject: [PATCH] server: add read only mode In read only mode the endpoint to save new effects or add new versions is deactivated. Also in the gallery the create button is deactivated and there is a notice that says: The server is in maintenance mode. You can not create or modify effects. The button to save effects in the editor is not deactivated as it will take a bit more time and wanted to have the page up as soon as possible. --- server/assets/gallery.html | 6 ++++++ server/cmd/glslsandbox/main.go | 2 ++ server/server.go | 15 +++++++++++---- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/server/assets/gallery.html b/server/assets/gallery.html index 20e60e0..c988e56 100644 --- a/server/assets/gallery.html +++ b/server/assets/gallery.html @@ -123,7 +123,13 @@

GLSL Sandbox @mrdoob
editor by @mrdoob, @mrkishi, @p01, @alteredq, @kusmabite and @emackey

+ +{{ if .ReadOnly }} +

The server is in maintenance mode. You can not create or modify effects.

+{{ else }} +{{ end }} +