From 92696669315e30e82d114bc79ad1be338e77e2d1 Mon Sep 17 00:00:00 2001 From: Umputun Date: Wed, 6 Nov 2019 13:47:45 -0600 Subject: [PATCH] add simple-view param and env (SIMPLE_VIEW) #474 --- README.md | 1 + backend/app/cmd/server.go | 2 ++ backend/app/rest/api/rest.go | 3 +++ 3 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 7005b8ac..f3f52ebd 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,7 @@ _this is the recommended way to run remark42_ | read-age | READONLY_AGE | | read-only age of comments, days | | img-proxy | IMG_PROXY | `false` | enable http->https proxy for images | | emoji | EMOJI | `false` | enable emoji support | +| simple-view | SIMPLE_VIEW | `false` | minimized UI with basic info only | | port | REMARK_PORT | `8080` | web server port | | web-root | REMARK_WEB_ROOT | `./web` | web server root directory | | update-limit | UPDATE_LIMIT | `0.5` | updates/sec limit | diff --git a/backend/app/cmd/server.go b/backend/app/cmd/server.go index 63688752..6fac7b89 100644 --- a/backend/app/cmd/server.go +++ b/backend/app/cmd/server.go @@ -69,6 +69,7 @@ type ServerCommand struct { UpdateLimit float64 `long:"update-limit" env:"UPDATE_LIMIT" default:"0.5" description:"updates/sec limit"` RestrictedWords []string `long:"restricted-words" env:"RESTRICTED_WORDS" description:"words prohibited to use in comments" env-delim:","` EnableEmoji bool `long:"emoji" env:"EMOJI" description:"enable emoji"` + SimpleView bool `long:"simpler-view" env:"SIMPLE_VIEW" description:"minimal comment editor mode"` Auth struct { TTL struct { @@ -349,6 +350,7 @@ func (s *ServerCommand) newServerApp() (*serverApp, error) { MaxActive: int32(s.Stream.MaxActive), }, EmojiEnabled: s.EnableEmoji, + SimpleView: s.SimpleView, } srv.ScoreThresholds.Low, srv.ScoreThresholds.Critical = s.LowScore, s.CriticalScore diff --git a/backend/app/rest/api/rest.go b/backend/app/rest/api/rest.go index 9d139945..ea6dea9f 100644 --- a/backend/app/rest/api/rest.go +++ b/backend/app/rest/api/rest.go @@ -56,6 +56,7 @@ type Rest struct { } UpdateLimiter float64 EmojiEnabled bool + SimpleView bool SSLConfig SSLConfig httpsServer *http.Server @@ -395,6 +396,7 @@ func (s *Rest) configCtrl(w http.ResponseWriter, r *http.Request) { ReadOnlyAge int `json:"readonly_age"` MaxImageSize int `json:"max_image_size"` EmojiEnabled bool `json:"emoji_enabled"` + SimpleView bool `json:"simple_view"` }{ Version: s.Version, EditDuration: int(s.DataService.EditDuration.Seconds()), @@ -407,6 +409,7 @@ func (s *Rest) configCtrl(w http.ResponseWriter, r *http.Request) { ReadOnlyAge: s.ReadOnlyAge, MaxImageSize: s.ImageService.Store.SizeLimit(), EmojiEnabled: s.EmojiEnabled, + SimpleView: s.SimpleView, } cnf.Auth = []string{}