mirror of
https://github.com/Starlio-app/StarlioX
synced 2024-11-22 08:46:22 +03:00
added an error page if you access the site via phone
This commit is contained in:
parent
c5343511cb
commit
06fba69099
4 changed files with 55 additions and 6 deletions
|
@ -1,7 +1,28 @@
|
|||
package page
|
||||
|
||||
import "net/http"
|
||||
import (
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func AboutHandler(w http.ResponseWriter, r *http.Request) {
|
||||
con := functions.Connected()
|
||||
if con == false {
|
||||
http.ServeFile(w, r, "web/src/errors/504.html")
|
||||
return
|
||||
}
|
||||
|
||||
userAgent := r.UserAgent()
|
||||
if strings.Contains(userAgent, "Mobile") {
|
||||
http.ServeFile(w, r, "web/src/errors/mobile.html")
|
||||
return
|
||||
}
|
||||
|
||||
if r.URL.Path != "/about" {
|
||||
http.ServeFile(w, r, "web/src/errors/404.html")
|
||||
return
|
||||
}
|
||||
|
||||
http.ServeFile(w, r, "web/src/about.html")
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package page
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func GalleryHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -13,6 +13,13 @@ func GalleryHandler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
userAgent := r.UserAgent()
|
||||
|
||||
if strings.Contains(userAgent, "Mobile") {
|
||||
http.ServeFile(w, r, "web/src/errors/mobile.html")
|
||||
return
|
||||
}
|
||||
|
||||
if r.URL.Path != "/" {
|
||||
http.ServeFile(w, r, "web/src/errors/404.html")
|
||||
return
|
||||
|
|
|
@ -1,7 +1,28 @@
|
|||
package page
|
||||
|
||||
import "net/http"
|
||||
import (
|
||||
"github.com/Redume/EveryNasa/functions"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func SettingsHandler(w http.ResponseWriter, r *http.Request) {
|
||||
con := functions.Connected()
|
||||
if con == false {
|
||||
http.ServeFile(w, r, "web/src/errors/504.html")
|
||||
return
|
||||
}
|
||||
|
||||
userAgent := r.UserAgent()
|
||||
if strings.Contains(userAgent, "Mobile") {
|
||||
http.ServeFile(w, r, "web/src/errors/mobile.html")
|
||||
return
|
||||
}
|
||||
|
||||
if r.URL.Path != "/settings" {
|
||||
http.ServeFile(w, r, "web/src/errors/404.html")
|
||||
return
|
||||
}
|
||||
|
||||
http.ServeFile(w, r, "web/src/settings.html")
|
||||
}
|
||||
|
|
|
@ -48,5 +48,5 @@
|
|||
}
|
||||
|
||||
#createLabelButton {
|
||||
margin-left: -12em;
|
||||
margin-left: -12em;
|
||||
}
|
Loading…
Add table
Reference in a new issue