Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

use Spatie\LaravelSettings\Migrations\SettingsMigration;

return new class extends SettingsMigration
{
public function up(): void
{
rescue(fn () => $this->migrator->add('app.show_site_name', false));
rescue(fn () => $this->migrator->add('app.show_about', true));
}
};
4 changes: 4 additions & 0 deletions resources/lang/de/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
'support_cachet_helper' => 'Zeige einen kleinen Link an, der Besucher dazu ermutigt, die Entwicklung von Cachet zu unterstützen.',
'show_dashboard_link' => 'Dashboard-Link anzeigen',
'show_dashboard_link_helper' => 'Zeige einen Link zum Dashboard auf der öffentlichen Statusseite an.',
'show_site_name' => 'Seitennamen anzeigen',
'show_site_name_helper' => 'Den Seitennamen auf der öffentlichen Statusseite anzeigen.',
'show_about' => '„Über diese Seite“ anzeigen',
'show_about_helper' => 'Den Inhalt von „Über diese Seite“ auf der öffentlichen Statusseite anzeigen.',
'display_graphs' => 'Diagramme anzeigen',
'display_graphs_helper' => 'Metrik-Diagramme auf der Statusseite anzeigen.',
'enable_external_dependencies' => 'Externe Abhängigkeiten aktivieren',
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/de_AT/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
'support_cachet_helper' => 'Zeige einen kleinen Link an, der Besucher dazu ermutigt, die Entwicklung von Cachet zu unterstützen.',
'show_dashboard_link' => 'Dashboard-Link anzeigen',
'show_dashboard_link_helper' => 'Zeige einen Link zum Dashboard auf der öffentlichen Statusseite an.',
'show_site_name' => 'Seitennamen anzeigen',
'show_site_name_helper' => 'Den Seitennamen auf der öffentlichen Statusseite anzeigen.',
'show_about' => '„Über diese Seite“ anzeigen',
'show_about_helper' => 'Den Inhalt von „Über diese Seite“ auf der öffentlichen Statusseite anzeigen.',
'display_graphs' => 'Diagramme anzeigen',
'display_graphs_helper' => 'Metrik-Diagramme auf der Statusseite anzeigen.',
'enable_external_dependencies' => 'Externe Abhängigkeiten aktivieren',
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/de_CH/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
'support_cachet_helper' => 'Zeige einen kleinen Link an, der Besucher dazu ermutigt, die Entwicklung von Cachet zu unterstützen.',
'show_dashboard_link' => 'Dashboard-Link anzeigen',
'show_dashboard_link_helper' => 'Zeige einen Link zum Dashboard auf der öffentlichen Statusseite an.',
'show_site_name' => 'Seitennamen anzeigen',
'show_site_name_helper' => 'Den Seitennamen auf der öffentlichen Statusseite anzeigen.',
'show_about' => '„Über diese Seite“ anzeigen',
'show_about_helper' => 'Den Inhalt von „Über diese Seite“ auf der öffentlichen Statusseite anzeigen.',
'display_graphs' => 'Diagramme anzeigen',
'display_graphs_helper' => 'Metrik-Diagramme auf der Statusseite anzeigen.',
'enable_external_dependencies' => 'Externe Abhängigkeiten aktivieren',
Expand Down
8 changes: 6 additions & 2 deletions resources/lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
return [
'manage_cachet' => [
'site_name_label' => 'Site name',
'site_name_helper' => 'Displayed in the browser tab and across your status page.',
'site_name_helper' => 'Used in browser tabs and status page metadata.',
'about_this_site_label' => 'About this site',
'about_this_site_helper' => 'A short Markdown introduction shown on the home page of your status page.',
'about_this_site_helper' => 'A short Markdown introduction for the home page of your status page.',
'timezone_label' => 'Timezone',
'timezone_other' => 'Other',
'browser_default' => 'Browser default',
Expand All @@ -22,6 +22,10 @@
'support_cachet_helper' => 'Display a small link encouraging visitors to support Cachet\'s development.',
'show_dashboard_link' => 'Show dashboard link',
'show_dashboard_link_helper' => 'Show a link to the dashboard from the public status page.',
'show_site_name' => 'Show site name',
'show_site_name_helper' => 'Display the site name on the public status page.',
'show_about' => 'Show About this site',
'show_about_helper' => 'Display the About this site content on the public status page.',
'display_graphs' => 'Display graphs',
'display_graphs_helper' => 'Render metric charts on the status page.',
'enable_external_dependencies' => 'Enable external dependencies',
Expand Down
8 changes: 8 additions & 0 deletions resources/lang/en_GB/settings.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?php

return [
'manage_cachet' => [
'toggles' => [
'show_site_name' => 'Show site name',
'show_site_name_helper' => 'Display the site name on the public status page.',
'show_about' => 'Show About this site',
'show_about_helper' => 'Display the About this site content on the public status page.',
],
],
'manage_theme' => [
'status_page_accent' => [
'description' => 'Customise the accent colour of your status page. Cachet can automatically select a matching base colour.',
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/es_ES/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
'show_timezone' => 'Mostrar Zona Horaria',
'show_dashboard_link' => 'Mostrar Enlace al Panel',
'show_dashboard_link_helper' => 'Muestra un enlace al panel desde la página de estado pública.',
'show_site_name' => 'Mostrar nombre del sitio',
'show_site_name_helper' => 'Muestra el nombre del sitio en la página de estado pública.',
'show_about' => 'Mostrar Acerca de este sitio',
'show_about_helper' => 'Muestra el contenido de Acerca de este sitio en la página de estado pública.',
'display_graphs' => 'Mostrar Gráficos',
'display_graphs_helper' => 'Renderiza gráficos de métricas en la página de estado.',
'only_show_disrupted_days' => 'Mostrar Solo Días con Problemas',
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/fr/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
'show_timezone' => 'Afficher le fuseau horaire',
'show_dashboard_link' => 'Afficher le lien du tableau de bord',
'show_dashboard_link_helper' => 'Affiche un lien vers le tableau de bord depuis la page de statut publique.',
'show_site_name' => 'Afficher le nom du site',
'show_site_name_helper' => 'Affiche le nom du site sur la page de statut publique.',
'show_about' => 'Afficher À propos de ce site',
'show_about_helper' => 'Affiche le contenu de À propos de ce site sur la page de statut publique.',
'display_graphs' => 'Afficher les graphiques',
'display_graphs_helper' => "Affiche les graphiques des m\u{00E9}triques sur la page de statut.",
'enable_external_dependencies' => "Activer les d\u{00E9}pendances externes",
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/ko/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
'show_timezone' => '시간대 표시',
'show_dashboard_link' => '대시보드 링크 표시',
'show_dashboard_link_helper' => '공개 상태 페이지에서 대시보드로 가는 링크를 표시합니다.',
'show_site_name' => '사이트 이름 표시',
'show_site_name_helper' => '공개 상태 페이지에 사이트 이름을 표시합니다.',
'show_about' => '이 사이트 소개 표시',
'show_about_helper' => '공개 상태 페이지에 이 사이트 소개 내용을 표시합니다.',
'display_graphs' => '그래프 표시',
'display_graphs_helper' => '상태 페이지에 메트릭 차트를 렌더링합니다.',
'only_show_disrupted_days' => '중단된 날만 표시',
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/nl/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
'show_timezone' => 'Tijdzone weergeven',
'show_dashboard_link' => 'Dashboardlink weergeven',
'show_dashboard_link_helper' => 'Toon een link naar het dashboard vanaf de openbare statuspagina.',
'show_site_name' => 'Sitenaam weergeven',
'show_site_name_helper' => 'Geef de sitenaam weer op de openbare statuspagina.',
'show_about' => 'Over deze site weergeven',
'show_about_helper' => 'Geef de inhoud van Over deze site weer op de openbare statuspagina.',
'display_graphs' => 'Diagrammen weergeven',
'display_graphs_helper' => 'Geef metriekgrafieken weer op de statuspagina.',
'enable_external_dependencies' => 'Externe afhankelijkheden inschakelen',
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/ph/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
'show_timezone' => 'Ipakita ang Oras na Rehiyon',
'show_dashboard_link' => 'Ipakita ang Link ng Dashboard',
'show_dashboard_link_helper' => 'Magpakita ng link patungo sa dashboard mula sa pampublikong status na pahina.',
'show_site_name' => 'Ipakita ang pangalan ng site',
'show_site_name_helper' => 'Ipakita ang pangalan ng site sa pampublikong status na pahina.',
'show_about' => 'Ipakita ang Tungkol sa Site na Ito',
'show_about_helper' => 'Ipakita ang nilalaman ng Tungkol sa Site na Ito sa pampublikong status na pahina.',
'display_graphs' => 'Ipakita ang Mga Graph',
'display_graphs_helper' => 'I-render ang mga chart ng metric sa status na pahina.',
'only_show_disrupted_days' => 'Ipakita lamang ang Mga Araw ng Pagka-aberya',
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/pt_BR/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
'show_timezone' => 'Exibir Fuso Horário',
'show_dashboard_link' => 'Exibir Link do Painel',
'show_dashboard_link_helper' => 'Exibe um link para o painel a partir da página de status pública.',
'show_site_name' => 'Exibir nome do site',
'show_site_name_helper' => 'Exibe o nome do site na página de status pública.',
'show_about' => 'Exibir Sobre este site',
'show_about_helper' => 'Exibe o conteúdo de Sobre este site na página de status pública.',
'display_graphs' => 'Exibir Gráficos',
'display_graphs_helper' => 'Renderiza gráficos de métricas na página de status.',
'only_show_disrupted_days' => 'Exibir Apenas Dias com Interrupções',
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/zh_CN/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
'show_timezone' => '显示时区',
'show_dashboard_link' => '显示仪表板链接',
'show_dashboard_link_helper' => '在公开状态页面上显示通往仪表板的链接。',
'show_site_name' => '显示网站名称',
'show_site_name_helper' => '在公开状态页面上显示网站名称。',
'show_about' => '显示关于此网站',
'show_about_helper' => '在公开状态页面上显示“关于此网站”内容。',
'display_graphs' => '显示图表',
'display_graphs_helper' => '在状态页面上渲染指标图表。',
'only_show_disrupted_days' => '仅显示受干扰天数',
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/zh_TW/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
'show_timezone' => '顯示時區',
'show_dashboard_link' => '顯示儀表板鏈接',
'show_dashboard_link_helper' => '在公開狀態頁面上顯示通往儀表板的連結。',
'show_site_name' => '顯示網站名稱',
'show_site_name_helper' => '在公開狀態頁面上顯示網站名稱。',
'show_about' => '顯示關於此網站',
'show_about_helper' => '在公開狀態頁面上顯示「關於此網站」內容。',
'display_graphs' => '顯示圖表',
'display_graphs_helper' => '在狀態頁面上呈現指標圖表。',
'only_show_disrupted_days' => '僅顯示受干擾天數',
Expand Down
6 changes: 4 additions & 2 deletions resources/views/components/about.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{{ \Cachet\Facades\CachetView::renderHook(\Cachet\View\RenderHook::STATUS_PAGE_ABOUT_BEFORE) }}

<div class="flex flex-col gap-3">
<h1 class="text-xl font-semibold tracking-tight text-zinc-900 dark:text-zinc-100 sm:text-2xl">{{ $title }}</h1>
@if ($showSiteName)
<h1 class="text-xl font-semibold tracking-tight text-zinc-900 dark:text-zinc-100 sm:text-2xl">{{ $title }}</h1>
@endif

@if ($about !== '')
@if ($showAbout && $about !== '')
<div class="prose prose-zinc max-w-none dark:prose-invert
prose-headings:tracking-tight prose-headings:text-zinc-900 dark:prose-headings:text-zinc-100
prose-p:leading-relaxed prose-p:text-zinc-600 dark:prose-p:text-zinc-300
Expand Down
6 changes: 6 additions & 0 deletions src/Filament/Pages/Settings/ManageCachet.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ public function form(Schema $schema): Schema
Toggle::make('dashboard_login_link')
->label(__('cachet::settings.manage_cachet.toggles.show_dashboard_link'))
->helperText(__('cachet::settings.manage_cachet.toggles.show_dashboard_link_helper')),
Toggle::make('show_site_name')
->label(__('cachet::settings.manage_cachet.toggles.show_site_name'))
->helperText(__('cachet::settings.manage_cachet.toggles.show_site_name_helper')),
Toggle::make('show_about')
->label(__('cachet::settings.manage_cachet.toggles.show_about'))
->helperText(__('cachet::settings.manage_cachet.toggles.show_about_helper')),
Toggle::make('show_support')
->label(__('cachet::settings.manage_cachet.toggles.support_cachet'))
->helperText(__('cachet::settings.manage_cachet.toggles.support_cachet_helper')),
Expand Down
4 changes: 4 additions & 0 deletions src/Settings/AppSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ class AppSettings extends Settings

public ?string $about;

public bool $show_site_name = false;

public bool $show_about = true;

public bool $show_support = true;

public string $locale = 'en';
Expand Down
2 changes: 2 additions & 0 deletions src/View/Components/About.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public function render(): View|Closure|string
return view('cachet::components.about', [
'title' => $this->settings->name ?: config('cachet.title', 'Cachet'),
'about' => Cachet::markdown(Str::of($this->settings->about)->trim()->toString()),
'showSiteName' => $this->settings->show_site_name,
'showAbout' => $this->settings->show_about,
]);
}
}
15 changes: 15 additions & 0 deletions tests/Feature/Filament/Settings/ManageCachetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@
expect(app(AppSettings::class)->refresh()->dynamic_favicon)->toBeTrue();
});

it('saves the status page title and about visibility settings', function () {
expect(app(AppSettings::class))
->show_site_name->toBeFalse()
->show_about->toBeTrue();

livewire(ManageCachet::class)
->fillForm(['show_site_name' => true, 'show_about' => false])
->call('save')
->assertHasNoFormErrors();

expect(app(AppSettings::class)->refresh())
->show_site_name->toBeTrue()
->show_about->toBeFalse();
});

it('saves the mcp settings', function () {
expect(app(AppSettings::class))
->mcp_enabled->toBeFalse()
Expand Down
21 changes: 21 additions & 0 deletions tests/Feature/StatusPage/StatusPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,33 @@
use Cachet\Models\Incident;
use Cachet\Models\Schedule;
use Cachet\Settings\AppSettings;
use Illuminate\Support\Str;

it('renders the status page', function () {
$this->get(route('cachet.status-page'))
->assertOk();
});

it('can hide the site name and about content without changing status page metadata', function () {
$settings = app(AppSettings::class);
$settings->name = 'Acme Status';
$settings->about = 'A private production system.';
$settings->show_site_name = false;
$settings->show_about = false;
$settings->save();

$response = $this->get(route('cachet.status-page'))->assertOk();
$body = Str::after($response->getContent(), '<body');

expect($body)
->not->toContain('Acme Status')
->not->toContain('A private production system.');

$response
->assertSee('<title>Acme Status</title>', escape: false)
->assertSee('<meta name="description" content="A private production system." />', escape: false);
});

it('renders the status page in the configured locale', function () {
$settings = app(AppSettings::class);
$settings->locale = 'de';
Expand Down
Loading