Merge pull request #922 from statping/uifixes

UI Fixes
pull/895/head^2
Hunter Long 2020-12-20 02:57:04 -08:00 committed by GitHub
commit b6ca1a5c66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 29 additions and 111 deletions

View File

@ -1,3 +1,7 @@
# 0.90.75 (12-20-2020)
- Removed favicons and PNG files from assets, now using base64 images
- Cleaned up some issues with UI
# 0.90.74 (12-18-2020)
- Fixed issue with favicon/manifest.json throwing 404 errors
- Modified language go:generate script to slowdown for 429 errors

View File

@ -146,10 +146,7 @@ frontend-build:
cd frontend && yarn && yarn build
@cp -r frontend/dist source/
@cp -r frontend/src/assets/scss source/dist/
@cp frontend/public/favicon.ico source/dist/
@cp frontend/public/robots.txt source/dist/
@cp frontend/public/banner.png source/dist/
@cp -r frontend/public/favicon source/dist/
@echo "Frontend build complete at ./source/dist"
yarn:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,41 +0,0 @@
{
"name": "Statping",
"icons": [
{
"src": "favicon\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "favicon\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "favicon\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "favicon\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "favicon\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "favicon\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

View File

@ -5,7 +5,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1.0, user-scalable=0">
<base href="/">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<title>Statping</title>
</head>
<body>

View File

@ -8,7 +8,7 @@ const tokenKey = "statping_auth";
class Api {
constructor() {
this.version = "0.90.74";
this.commit = "2612402a7782f28ca0b7fc10c941d8c4a1a5acc6";
this.commit = "df8e1f73d9f7fdf218bc5c26130d7d8a6af6719a";
}
async oauth() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 KiB

View File

@ -89,7 +89,7 @@
}
.chartmarker SPAN {
font-size: 4pt;
font-size: 8pt;
display: block;
color: #b1b1b1;
}

View File

@ -23,7 +23,7 @@
<div v-if="success_event && !failureBefore" class="col-12 font-2 m-0 mb-2">
<span class="text-success"><font-awesome-icon icon="check" class="mr-1" size="1x"/>No New Events</span>
<span class="font-italic d-inline-block text-truncate text-dim mt-1" style="max-width: 270px">
<span v-if="!this.isZero(service.last_error)" class="font-italic d-inline-block text-truncate text-dim mt-1" style="max-width: 270px">
Last failure was {{ago(service.last_error)}} ago.
</span>
</div>

View File

@ -9,21 +9,15 @@
</h6>
</div>
<div class="card-body">
<div class="card-body pb-1">
<div v-if="loaded" class="row pl-2">
<div class="col-md-6 col-sm-12 pl-2 mt-2 mt-md-0 mb-3">
<div class="col-md-12 col-sm-12 pl-2 mt-2 mt-md-0 mb-3">
<ServiceSparkLine :title="set2_name" subtitle="Latency Last 24 Hours" :series="set2"/>
</div>
<div class="col-md-6 col-sm-12 pl-0 mt-4 mt-md-0 mb-3">
<ServiceSparkLine :title="set1_name" subtitle="Latency Last 7 Days" :series="set1"/>
</div>
<ServiceEvents :service="service"/>
</div>
<div v-else class="row mb-5">
<div class="col-12 col-md-6 text-center">
<font-awesome-icon icon="circle-notch" class="text-dim" size="2x" spin/>
</div>
<div class="col-12 col-md-6 text-center text-dim">
<div class="col-12 col-md-12 text-center">
<font-awesome-icon icon="circle-notch" class="text-dim" size="2x" spin/>
</div>
</div>
@ -44,7 +38,8 @@
<font-awesome-icon icon="calendar-check"/>
</button>
<button @click="$router.push({path: `/dashboard/service/${service.id}/failures`, params: {id: service.id}})" @mouseleave="unsetHover" @mouseover="setHover($t('failures'))" class="btn btn-sm btn-white failures">
<font-awesome-icon icon="exclamation-triangle"/> <span v-if="service.stats.failures !== 0" class="badge badge-danger ml-1">{{service.stats.failures}}</span>
<font-awesome-icon icon="exclamation-triangle"/>
<span v-if="service.stats.failures !== 0" class="badge badge-danger ml-1">{{service.stats.failures}}</span>
</button>
</div>
</div>
@ -91,10 +86,8 @@
hovered: false,
hoverbtn: "",
openTab: "",
set1: [],
set2: [],
loaded: false,
set1_name: "",
set2_name: "",
failures: null,
visible: false
@ -111,7 +104,7 @@
this.hoverbtn = name
},
unsetHover() {
this.hoverbtn = this.$t('uptime', [this.service.online_7_days])
this.hoverbtn = this.$t('uptime') + " "+ this.service.online_7_days + "%"
},
async setVisible(isVisible, entry) {
if (isVisible && !this.visible) {
@ -126,9 +119,7 @@
this.uptime = await Api.service_uptime(this.service.id, this.toUnix(start), this.toUnix(end))
},
async loadInfo() {
this.set1 = await this.getHits(86400 * 7, "12h")
this.set1_name = this.calc(this.set1)
this.set2 = await this.getHits(86400, "60m")
this.set2 = await this.getHits(86400 * 3, "60m")
this.set2_name = this.calc(this.set2)
this.loaded = true
},

View File

@ -57,13 +57,13 @@
let ts = w.globals.seriesX[seriesIndex][dataPointIndex];
const dt = new Date(ts).toLocaleDateString("en-us", timeoptions)
let val = series[seriesIndex][dataPointIndex];
return `<div class="chartmarker"><span class="font-3">Average Response Time: ${this.humanTime(val)}</span><span>${dt}</span></div>`
return `<div class="chartmarker"><span class="">Average Response Time: ${this.humanTime(val)}</span><span>${dt}</span></div>`
},
fixed: {
enabled: true,
position: 'bottomLeft',
offsetX: 0,
offsetY: -30,
offsetY: -15,
},
x: {
show: true,

File diff suppressed because one or more lines are too long

View File

@ -2321,7 +2321,7 @@ OluFxewsEO0QNDrfFb+0gnjYlnGqOFcZjUMXbDdY5oLSPtXohynuTK1qyQ==
</div>
<div class="text-center small text-dim" v-pre>
Automatically generated from Statping's Wiki on 2020-12-18 10:22:03.386528 &#43;0000 UTC
Automatically generated from Statping's Wiki on 2020-12-20 10:21:49.484474 &#43;0000 UTC
</div>
</div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -39,5 +39,8 @@ var handlerFuncs = func(w http.ResponseWriter, r *http.Request) template.FuncMap
"BasePath": func() string {
return basePath
},
"Icon": func() string {
return basePath
},
}
}

View File

@ -67,17 +67,13 @@ func Router() *mux.Router {
indexHandler := http.FileServer(http.Dir(dir + "/assets/"))
r.PathPrefix("/css/").Handler(http.StripPrefix(basePath, staticAssets("css")))
r.PathPrefix("/favicon/").Handler(http.StripPrefix(basePath, staticAssets("favicon")))
r.PathPrefix("/robots.txt").Handler(http.StripPrefix(basePath, indexHandler))
r.PathPrefix("/banner.png").Handler(http.StripPrefix(basePath, indexHandler))
} else {
tmplFileSrv := http.FileServer(source.TmplBox.HTTPBox())
tmplBoxHandler := http.StripPrefix(basePath, tmplFileSrv)
r.PathPrefix("/css/").Handler(http.StripPrefix(basePath, tmplFileSrv))
r.PathPrefix("/favicon/").Handler(http.StripPrefix(basePath, tmplFileSrv))
r.PathPrefix("/robots.txt").Handler(tmplBoxHandler)
r.PathPrefix("/banner.png").Handler(tmplBoxHandler)
}
r.PathPrefix("/js/").Handler(http.StripPrefix(basePath, http.FileServer(source.TmplBox.HTTPBox())))

View File

@ -29,13 +29,11 @@ var (
"scss/mixin.scss",
"scss/mobile.scss",
"scss/variables.scss",
"banner.png",
"favicon.ico",
"robots.txt",
}
)
// Assets will load the Rice boxes containing the CSS, SCSS, favicon, and HTML files.
// Assets will load the Rice boxes containing the CSS, SCSS, and HTML files.
func Assets() error {
if utils.Params.GetBool("DISABLE_HTTP") {
return nil
@ -130,7 +128,7 @@ func OpenAsset(path string) string {
return data
}
// CreateAllAssets will dump HTML, CSS, SCSS, and favicon assets into the '/assets' directory
// CreateAllAssets will dump HTML, CSS, and SCSS assets into the '/assets' directory
func CreateAllAssets(folder string) error {
log.Infoln(fmt.Sprintf("Dump Statping assets into %s/assets", folder))
fp := filepath.Join
@ -141,13 +139,10 @@ func CreateAllAssets(folder string) error {
if err := MakePublicFolder(fp(folder, "assets", "css")); err != nil {
return err
}
if err := MakePublicFolder(fp(folder, "assets", "favicon")); err != nil {
return err
}
if err := MakePublicFolder(fp(folder, "assets", "scss")); err != nil {
return err
}
log.Infoln("Inserting scss, css, and favicon files into assets folder")
log.Infoln("Inserting scss, and css files into assets folder")
if err := CopyAllToPublic(TmplBox); err != nil {
log.Errorln(err)
@ -157,12 +152,6 @@ func CreateAllAssets(folder string) error {
if err := CopyToPublic(TmplBox, "", "robots.txt"); err != nil {
return err
}
if err := CopyToPublic(TmplBox, "", "banner.png"); err != nil {
return err
}
if err := CopyToPublic(TmplBox, "", "favicon.ico"); err != nil {
return err
}
log.Infoln("Compiling CSS from SCSS style...")
if err := CompileSASS(); err != nil {
return err

View File

@ -1 +1 @@
0.90.74
0.90.75