mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
major code repair from old to new API -- WIP
This commit is contained in:
parent
25b576f861
commit
792c3e2ce8
46 changed files with 3403 additions and 171 deletions
|
@ -17,20 +17,10 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/documize/community/core/api"
|
||||
"github.com/documize/community/core/env"
|
||||
"github.com/documize/community/core/secrets"
|
||||
)
|
||||
|
||||
const (
|
||||
// SiteModeNormal serves app
|
||||
SiteModeNormal = ""
|
||||
// SiteModeOffline serves offline.html
|
||||
SiteModeOffline = "1"
|
||||
// SiteModeSetup tells Ember to serve setup route
|
||||
SiteModeSetup = "2"
|
||||
// SiteModeBadDB redirects to db-error.html page
|
||||
SiteModeBadDB = "3"
|
||||
)
|
||||
|
||||
// SiteInfo describes set-up information about the site
|
||||
var SiteInfo struct {
|
||||
DBname, DBhash, Issue string
|
||||
|
@ -44,11 +34,11 @@ func init() {
|
|||
func EmberHandler(w http.ResponseWriter, r *http.Request) {
|
||||
filename := "index.html"
|
||||
switch api.Runtime.Flags.SiteMode {
|
||||
case SiteModeOffline:
|
||||
case env.SiteModeOffline:
|
||||
filename = "offline.html"
|
||||
case SiteModeSetup:
|
||||
case env.SiteModeSetup:
|
||||
// NoOp
|
||||
case SiteModeBadDB:
|
||||
case env.SiteModeBadDB:
|
||||
filename = "db-error.html"
|
||||
default:
|
||||
SiteInfo.DBhash = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue