* notifier panic fix

* portainer template

* remove default host from discord notifier

* fix for updating fields

* fix for updating fields

* fixed notifier panic

* fixed notifier panic

* test fix

* test fix

* missing login banner image

* dont delete admin if DEMO_MODE

* updatess to service on Dashboard

* notifier endpoint fixes, timeframe rounding chart data

* modal for UI confirmations

* UI fixes, import/export views

* export HTTP test

* start/end time

* i18n language generate script from aws

* i18n language generate script from aws

* i18n language generate

* bug: use v-model.number instead of v-model to capture notify_before (#813)

Co-authored-by: Hunter Long <Info@socialeck.com>

* theme editor fixes, config changes

* css fix

Co-authored-by: Marc Binder <marcandrebinder@gmail.com>
pull/821/head^2
Hunter Long 2020-09-14 19:34:51 -07:00 committed by GitHub
parent 6d8f78db09
commit a216187055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 138 additions and 12 deletions

View File

@ -1,3 +1,7 @@
# 0.90.67 (09-14-2020)
- Modified core settings to update config.yml on save
- Modified Theme Editor to restart the HTTP router on create/delete (fixing 404's)
# 0.90.66 (09-08-2020)
- Added Import and Export views in Dashboard
- Modified services list sparkline to use start/end of day timestamp

View File

@ -21,7 +21,7 @@ A:HOVER {
z-index: 1040;
width: 100%;
height: 100%;
background-color: rgb(0 0 0 / 50%);
background-color: rgba(0, 0, 0, 0.5);
}
.modal {

View File

@ -50,6 +50,11 @@ const chinese = {
service_offline_time: "服务已脱机",
days_ago: "天前",
today: "今天",
week: "周",
month: "月份",
day: "日",
hour: "小时",
minute: "分钟",
failures_24_hours: "过去 24 小时失败",
no_services: "您目前没有任何服务!",
theme: "主题",
@ -125,9 +130,12 @@ const chinese = {
follow_redir: "跟随重定向",
verify_ssl: "验证 SSL",
tls_cert: "使用 TLS 证书",
notification_opts: "通知选项",
notifications_enable: "启用通知",
notify_after: "故障后通知",
notify_all: "通知所有更改"
notify_all: "通知所有更改",
service_update: "更新服务",
service_create: "创建服务"
}
export default chinese

View File

@ -50,6 +50,11 @@ service_online_check,Online checked
service_offline_time,Service has been offline for
days_ago,Days Ago
today,Today
week,Week
month,Month
day,Day
hour,Hour
minute,Minute
failures_24_hours,Failures last 24 hours
no_services,You currently don't have any services!
theme,Theme

1 key en
50 service_offline_time Service has been offline for
51 days_ago Days Ago
52 today Today
53 week Week
54 month Month
55 day Day
56 hour Hour
57 minute Minute
58 failures_24_hours Failures last 24 hours
59 no_services You currently don't have any services!
60 theme Theme

View File

@ -50,6 +50,11 @@ const english = {
service_offline_time: "Service has been offline for",
days_ago: "Days Ago",
today: "Today",
week: "Week",
month: "Month",
day: "Day",
hour: "Hour",
minute: "Minute",
failures_24_hours: "Failures last 24 hours",
no_services: "You currently don't have any services!",
theme: "Theme",
@ -125,9 +130,12 @@ const english = {
follow_redir: "Follow Redirects",
verify_ssl: "Verify SSL",
tls_cert: "Use TLS Cert",
notification_opts: "Notification Options",
notifications_enable: "Enable Notifications",
notify_after: "Notify After Failures",
notify_all: "Notify All Changes"
notify_all: "Notify All Changes",
service_update: "Update Service",
service_create: "Create Service"
}
export default english

View File

@ -50,6 +50,11 @@ const french = {
service_offline_time: "Le service a été hors ligne pour",
days_ago: "Il y a jours",
today: "Aujourd'hui",
week: "Semaine",
month: "Mois",
day: "Jour",
hour: "Heure",
minute: "Minute",
failures_24_hours: "Les échecs durent 24 heures",
no_services: "Vous n'avez actuellement aucun service !",
theme: "Thème",
@ -125,9 +130,12 @@ const french = {
follow_redir: "Suivre les redirections",
verify_ssl: "Vérifier SSL",
tls_cert: "Utiliser le certificat TLS",
notification_opts: "Options de notification",
notifications_enable: "Activer les notifications",
notify_after: "Notification après les échecs",
notify_all: "Notifier toutes les modifications"
notify_all: "Notifier toutes les modifications",
service_update: "Mise à jour Service",
service_create: "Créer un service"
}
export default french

View File

@ -50,6 +50,11 @@ const german = {
service_offline_time: "Dienst war offline für",
days_ago: "Vor Tagen",
today: "Heute",
week: "Woche",
month: "Monat",
day: "Tag",
hour: "Stunde",
minute: "Minute",
failures_24_hours: "Ausfälle dauern 24 Stunden",
no_services: "Sie haben derzeit keine Dienste!",
theme: "Thema",
@ -125,9 +130,12 @@ const german = {
follow_redir: "Weiterleitungen folgen",
verify_ssl: "SSL verifizieren",
tls_cert: "TLS-Zertifikat verwenden",
notification_opts: "Benachrichtigungsoptionen",
notifications_enable: "Benachrichtigungen aktivieren",
notify_after: "Benachrichtigung nach Fehlern",
notify_all: "Alle Änderungen benachrichtigen"
notify_all: "Alle Änderungen benachrichtigen",
service_update: "Dienst aktualisieren",
service_create: "Dienst erstellen"
}
export default german

View File

@ -50,6 +50,11 @@ const italian = {
service_offline_time: "Il servizio è stato offline per",
days_ago: "Giorni fa",
today: "Oggi",
week: "Settimana",
month: "Mese",
day: "Giorno",
hour: "Ora",
minute: "Minuti",
failures_24_hours: "Errori nelle ultime 24 ore",
no_services: "Al momento non hai alcun servizio!",
theme: "Tema",
@ -125,9 +130,12 @@ const italian = {
follow_redir: "Segui i reindirizzamenti",
verify_ssl: "Verifica SSL",
tls_cert: "Usa certificato TLS",
notification_opts: "Opzioni di notifica",
notifications_enable: "Abilita notifiche",
notify_after: "Notify dopo gli errori",
notify_all: "Notifichi tutte le modifiche"
notify_all: "Notifichi tutte le modifiche",
service_update: "Servizio di aggiornamento",
service_create: "Crea servizio"
}
export default italian

View File

@ -50,6 +50,11 @@ const japanese = {
service_offline_time: "のサービスがオフラインになりました",
days_ago: "日前",
today: "今日",
week: "週数",
month: "月",
day: "日",
hour: "アワー",
minute: "分",
failures_24_hours: "過去 24 時間の障害",
no_services: "現在、サービスをお持ちになりません。",
theme: "テーマ",
@ -125,9 +130,12 @@ const japanese = {
follow_redir: "リダイレクトに従う",
verify_ssl: "SSL の確認",
tls_cert: "TLS 証明書を使用",
notification_opts: "通知オプション",
notifications_enable: "通知を有効にする",
notify_after: "障害発生後に通知する",
notify_all: "すべての変更を通知"
notify_all: "すべての変更を通知",
service_update: "サービスの更新",
service_create: "サービスの作成"
}
export default japanese

View File

@ -50,6 +50,11 @@ const korean = {
service_offline_time: "서비스가 에 대해 오프라인되었습니다.",
days_ago: "일 전",
today: "오늘",
week: "주",
month: "월",
day: "일",
hour: "시간",
minute: "분",
failures_24_hours: "지난 24시간 동안 장애 발생",
no_services: "현재 서비스가 없습니다!",
theme: "테마",
@ -125,9 +130,12 @@ const korean = {
follow_redir: "리다이렉트 따르기",
verify_ssl: "SSL 확인",
tls_cert: "TLS 인증서 사용",
notification_opts: "알림 옵션",
notifications_enable: "알림 활성화",
notify_after: "실패 후 알림",
notify_all: "모든 변경 사항 알림"
notify_all: "모든 변경 사항 알림",
service_update: "서비스 업데이트",
service_create: "서비스 만들기"
}
export default korean

View File

@ -50,6 +50,11 @@ const russian = {
service_offline_time: "Служба была отключена для",
days_ago: "Дней назад",
today: "Сегодня",
week: "Недели",
month: "Месяц",
day: "День",
hour: "Час",
minute: "Минута",
failures_24_hours: "Сбои за 24 часа",
no_services: "В настоящее время у вас нет услуг!",
theme: "Тема",
@ -125,9 +130,12 @@ const russian = {
follow_redir: "Следуйте за перенаправленными",
verify_ssl: "Проверить SSL",
tls_cert: "Использовать сертификат TLS",
notification_opts: "Параметры уведомления",
notifications_enable: "Включить уведомления",
notify_after: "Уведомлять после сбоев",
notify_all: "Уведомлять обо всех изменениях"
notify_all: "Уведомлять обо всех изменениях",
service_update: "Обновить службу",
service_create: "Создать службу"
}
export default russian

View File

@ -50,6 +50,11 @@ const spanish = {
service_offline_time: "El servicio ha estado desconectado para",
days_ago: "Hace días",
today: "Hoy",
week: "Semana",
month: "Mes",
day: "Día",
hour: "Hora",
minute: "Minuto",
failures_24_hours: "Fallos de las últimas 24 horas",
no_services: "¡Actualmente no tienes ningún servicio!",
theme: "Tema",
@ -125,9 +130,12 @@ const spanish = {
follow_redir: "Seguir redirecciones",
verify_ssl: "Verificar SSL",
tls_cert: "Usar Cert TLS",
notification_opts: "Opciones de notificación",
notifications_enable: "Habilitar notificaciones",
notify_after: "Notificar después de errores",
notify_all: "Notificar todos los cambios"
notify_all: "Notificar todos los cambios",
service_update: "Servicio de actualización",
service_create: "Crear servicio"
}
export default spanish

View File

@ -3,6 +3,7 @@ package handlers
import (
"fmt"
"github.com/statping/statping/types/checkins"
"github.com/statping/statping/types/configs"
"github.com/statping/statping/types/core"
"github.com/statping/statping/types/errors"
"github.com/statping/statping/types/groups"
@ -90,10 +91,22 @@ func apiCoreHandler(w http.ResponseWriter, r *http.Request) {
if c.Domain != app.Domain {
app.Domain = c.Domain
}
if c.Language != app.Language {
app.Language = c.Language
}
utils.Params.Set("LANGUAGE", app.Language)
app.UseCdn = null.NewNullBool(c.UseCdn.Bool)
app.AllowReports = null.NewNullBool(c.AllowReports.Bool)
utils.SentryInit(app.AllowReports.Bool)
err = app.Update()
if err := app.Update(); err != nil {
sendErrorJson(err, w, r)
return
}
if err := configs.Save(); err != nil {
sendErrorJson(err, w, r)
return
}
returnJson(core.App, w, r)
}

View File

@ -157,6 +157,7 @@ func apiThemeRemoveHandler(w http.ResponseWriter, r *http.Request) {
if err := source.DeleteAllAssets(utils.Directory); err != nil {
log.Errorln(fmt.Errorf("error deleting all assets %v", err))
}
resetRouter()
sendJsonAction(utils.Directory+"/assets", "deleted", w, r)
}

View File

@ -7,6 +7,37 @@ import (
"os"
)
func Save() error {
p := utils.Params
configs := &DbConfig{
DbConn: p.GetString("DB_CONN"),
DbHost: p.GetString("DB_HOST"),
DbUser: p.GetString("DB_USER"),
DbPass: p.GetString("DB_PASS"),
DbData: p.GetString("DB_DATABASE"),
DbPort: p.GetInt("DB_PORT"),
Project: p.GetString("NAME"),
Description: p.GetString("DESCRIPTION"),
Domain: p.GetString("DOMAIN"),
Email: p.GetString("EMAIL"),
Username: p.GetString("ADMIN_USER"),
Password: p.GetString("ADMIN_PASSWORD"),
Location: utils.Directory,
SqlFile: p.GetString("SQL_FILE"),
Language: p.GetString("LANGUAGE"),
AllowReports: p.GetBool("ALLOW_REPORTS"),
LetsEncryptEnable: p.GetBool("LETSENCRYPT_ENABLE"),
LetsEncryptHost: p.GetString("LETSENCRYPT_HOST"),
LetsEncryptEmail: p.GetString("LETSENCRYPT_EMAIL"),
ApiSecret: p.GetString("API_SECRET"),
SampleData: p.GetBool("SAMPLE_DATA"),
MaxOpenConnections: p.GetInt("MAX_OPEN_CONN"),
MaxIdleConnections: p.GetInt("MAX_IDLE_CONN"),
MaxLifeConnections: int(p.GetDuration("MAX_LIFE_CONN").Seconds()),
}
return configs.Save(utils.Directory)
}
func LoadConfigs(cfgFile string) (*DbConfig, error) {
writeAble, err := utils.DirWritable(utils.Directory)
if err != nil {

View File

@ -1 +1 @@
0.90.66
0.90.67