From c62329ce102df226cc62b832232d6e9d528bd0df Mon Sep 17 00:00:00 2001 From: Mantas <11616378+mistermantas@users.noreply.github.com> Date: Thu, 9 May 2019 21:20:38 +0300 Subject: #27 - 1st working API kinda --- exampleSite/content/issues/2018-05-25-us-east-conn-issues.md | 1 + 1 file changed, 1 insertion(+) (limited to 'exampleSite/content') diff --git a/exampleSite/content/issues/2018-05-25-us-east-conn-issues.md b/exampleSite/content/issues/2018-05-25-us-east-conn-issues.md index 524035b..8178189 100644 --- a/exampleSite/content/issues/2018-05-25-us-east-conn-issues.md +++ b/exampleSite/content/issues/2018-05-25-us-east-conn-issues.md @@ -8,6 +8,7 @@ severity: down affected: - API - Media Proxy + - Gateway section: issue --- -- cgit v1.2.3-70-g09d2 From a07a3ccb6d76f3bacc85eddf0c132aa29a1a610c Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Fri, 4 Oct 2019 18:59:16 +0300 Subject: Added symbols for severity, informational posts, yearly layout default --- exampleSite/config.yml | 2 +- .../issues/2018-06-13-maintenance-window.md | 3 +- .../issues/2019-10-04-testing-cstate-functions.md | 11 +++++ .../issues/2019-10-08-testing-new-pipeline.md | 13 ++++++ layouts/issues/issue.html | 13 +++++- layouts/issues/small.html | 52 +++++++++++++++------- layouts/partials/index/incidents-yearly.html | 4 +- 7 files changed, 78 insertions(+), 20 deletions(-) create mode 100644 exampleSite/content/issues/2019-10-04-testing-cstate-functions.md create mode 100644 exampleSite/content/issues/2019-10-08-testing-new-pipeline.md (limited to 'exampleSite/content') diff --git a/exampleSite/config.yml b/exampleSite/config.yml index f0a19cd..0a3afe1 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -170,7 +170,7 @@ params: # # Default: true # BOOLEAN; `true`, `false` - enableYearlyIncidentHistory: false + enableYearlyIncidentHistory: true # Should we show the logo or the title # of the status page? diff --git a/exampleSite/content/issues/2018-06-13-maintenance-window.md b/exampleSite/content/issues/2018-06-13-maintenance-window.md index 6b75810..dae3afb 100644 --- a/exampleSite/content/issues/2018-06-13-maintenance-window.md +++ b/exampleSite/content/issues/2018-06-13-maintenance-window.md @@ -1,7 +1,8 @@ --- title: Maintenance Window date: 2018-06-13 15:54:00 -resolved: false +resolved: true +resolvedWhen: 2018-06-13 16:54:00 # Possible severity levels: down, disrupted, notice severity: disrupted affected: diff --git a/exampleSite/content/issues/2019-10-04-testing-cstate-functions.md b/exampleSite/content/issues/2019-10-04-testing-cstate-functions.md new file mode 100644 index 0000000..e8e2250 --- /dev/null +++ b/exampleSite/content/issues/2019-10-04-testing-cstate-functions.md @@ -0,0 +1,11 @@ +--- +title: Testing New cState Features +date: 2019-10-04 18:05:00 +resolvedWhen: 2019-10-04 18:05:00 +informational: true +section: issue +--- + +There is a new feature in cState version 4 that lets you make what are called _informational_ posts. The main difference is that there will be no _Unresolved_ or _Resolved in under a minute_ text on the pages. + +This is essentially a page with a date and title. \ No newline at end of file diff --git a/exampleSite/content/issues/2019-10-08-testing-new-pipeline.md b/exampleSite/content/issues/2019-10-08-testing-new-pipeline.md new file mode 100644 index 0000000..c30358c --- /dev/null +++ b/exampleSite/content/issues/2019-10-08-testing-new-pipeline.md @@ -0,0 +1,13 @@ +--- +title: New Pipeline Rollout +date: 2019-10-05 16:24:00 +resolved: false +resolvedWhen: 2019-10-05 16:58:00 +# Possible severity levels: down, disrupted, notice +severity: disrupted +affected: + - API +section: issue +--- + +There may be disruptions in the rollout. \ No newline at end of file diff --git a/layouts/issues/issue.html b/layouts/issues/issue.html index c344f57..24cadd8 100644 --- a/layouts/issues/issue.html +++ b/layouts/issues/issue.html @@ -24,7 +24,8 @@ {{ end }}

- {{ if .Params.Resolved }} + {{ if .Params.informational }} + {{ else if .Params.Resolved }} {{ $t := (time .Params.ResolvedWhen) }} {{ $timeDiff := (sub $t.Unix .Date.Unix) }} {{ $diffInMin := (div $timeDiff 60) }} @@ -79,7 +80,15 @@ {{ end }} {{ end }} {{ else }} - {{ T "downtimeOngoing" }} + + {{ if eq .Params.severity "down" }} + ◼ + {{ else if eq .Params.severity "disrupted" }} + ▲ + {{ else }} + ◆ + {{ end }} + {{ T "downtimeOngoing" }} {{ end }}
diff --git a/layouts/issues/small.html b/layouts/issues/small.html index ef30b75..9349046 100644 --- a/layouts/issues/small.html +++ b/layouts/issues/small.html @@ -6,7 +6,23 @@ {{ $isDown := where $active "Params.severity" "=" "down" }} - {{ if .Params.Resolved }} + {{ if .Params.informational }} + + + {{ if .Site.Params.dateFormat }} + {{ .Date.Format .Site.Params.dateFormat }} + {{ else }} + {{ .Date.Format "January 2, 2006 at 3:04 PM" }} + {{ end }} + + +

+ {{ .Title }}  ℹ +

+ {{ .Summary | truncate 200 }} + + + {{ else if .Params.Resolved }} {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} @@ -49,24 +65,30 @@ {{ end }} {{ end }} - - {{ else }} - - {{ if .Site.Params.dateFormat }} - {{ .Date.Format .Site.Params.dateFormat }} - {{ else }} - {{ .Date.Format "January 2, 2006 at 3:04 PM" }} - {{ end }} - + + {{ if .Site.Params.dateFormat }} + {{ .Date.Format .Site.Params.dateFormat }} + {{ else }} + {{ .Date.Format "January 2, 2006 at 3:04 PM" }} + {{ end }} + -

- {{ .Title }} -

+

+ {{ .Title }} +

- -
{{ T "downtimeOngoing" }}
+ + + {{ if eq .Params.severity "down" }} + ◼ + {{ else if eq .Params.severity "disrupted" }} + ▲ + {{ else }} + ◆ + {{ end }} + {{ T "downtimeOngoing" }} {{ end }}
diff --git a/layouts/partials/index/incidents-yearly.html b/layouts/partials/index/incidents-yearly.html index 36f6e44..5cc323a 100644 --- a/layouts/partials/index/incidents-yearly.html +++ b/layouts/partials/index/incidents-yearly.html @@ -1,7 +1,9 @@ {{ $incidents := where .Site.RegularPages "Params.section" "issue" }} {{ range ((where .Site.RegularPages "Params.section" "issue").GroupByDate "2006") }} -

{{ .Key }}

+

{{ .Key }} + ({{ len .Pages }}) +

{{ range .Pages }} {{ .Render "small" }} -- cgit v1.2.3-70-g09d2 From 19d5be70f84c21011869b6c8340a0589f353beb8 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sat, 5 Oct 2019 19:43:56 +0300 Subject: Added API for index, fully added #43 with tweaks to yrly archive --- exampleSite/config.yml | 8 ++--- .../issues/2018-01-17-sending-dms-impacted.md | 4 +-- .../issues/2018-05-25-us-east-conn-issues.md | 4 +-- layouts/index.html | 4 ++- layouts/index.json | 39 ++++++++++++++++++++++ layouts/issues/single.json | 9 +++-- layouts/partials/index/incidents-monthly.html | 29 ++++++++++++++++ layouts/partials/index/incidents-yearly.html | 9 +++-- 8 files changed, 89 insertions(+), 17 deletions(-) create mode 100644 layouts/index.json create mode 100644 layouts/partials/index/incidents-monthly.html (limited to 'exampleSite/content') diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 0a3afe1..a894d26 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -164,13 +164,13 @@ params: useLargeHeaderDesign: false # Should incident history be separated - # yearly, in an archive view? + # like in an archive view? # # Note: This WILL disable pagination. # - # Default: true - # BOOLEAN; `true`, `false` - enableYearlyIncidentHistory: true + # Default: `yearly` + # STRING; `monthly`, `yearly`, `none` + incidentHistoryFormat: "yearly" # Should we show the logo or the title # of the status page? diff --git a/exampleSite/content/issues/2018-01-17-sending-dms-impacted.md b/exampleSite/content/issues/2018-01-17-sending-dms-impacted.md index 0af6136..b96139f 100644 --- a/exampleSite/content/issues/2018-01-17-sending-dms-impacted.md +++ b/exampleSite/content/issues/2018-01-17-sending-dms-impacted.md @@ -1,8 +1,8 @@ --- title: Issues Sending DMs -date: 2018-01-17 16:24:00 +date: 2017-12-17 16:24:00 resolved: true -resolvedWhen: 2018-01-17 16:58:00 +resolvedWhen: 2017-12-17 16:58:00 # Possible severity levels: down, disrupted, notice severity: disrupted affected: diff --git a/exampleSite/content/issues/2018-05-25-us-east-conn-issues.md b/exampleSite/content/issues/2018-05-25-us-east-conn-issues.md index 8178189..8d56cf2 100644 --- a/exampleSite/content/issues/2018-05-25-us-east-conn-issues.md +++ b/exampleSite/content/issues/2018-05-25-us-east-conn-issues.md @@ -1,8 +1,8 @@ --- title: US East Connection Issues -date: 2018-05-25 04:13:00 +date: 2018-04-25 04:13:00 resolved: true -resolvedWhen: 2018-05-25 04:13:59 +resolvedWhen: 2018-04-25 04:13:59 # Possible severity levels: down, disrupted, notice severity: down affected: diff --git a/layouts/index.html b/layouts/index.html index da6f6ad..c02224a 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -38,8 +38,10 @@
- {{ if .Site.Params.enableYearlyIncidentHistory }} + {{ if eq .Site.Params.incidentHistoryFormat "yearly" }} {{ partial "index/incidents-yearly" . }} + {{ else if eq .Site.Params.incidentHistoryFormat "monthly" }} + {{ partial "index/incidents-monthly" . }} {{ else }} {{ partial "index/incidents" . }} {{ end }} diff --git a/layouts/index.json b/layouts/index.json new file mode 100644 index 0000000..2495f60 --- /dev/null +++ b/layouts/index.json @@ -0,0 +1,39 @@ +{ + "version": "4.0", + "title": "{{ .Site.Title }}", + "languageCodeHTML": "{{ .Site.LanguageCode }}", + "languageCode": "{{ T "languageCode" }}", + "languageCode": "{{ T "languageCode" }}", + "baseURL": "{{ .Site.BaseURL }}", + "description": "{{ .Site.Params.Description }}", + "logo": "{{ .Site.Params.logo | absURL }}", + "categories": [ + {{ range $i, $e := .Site.Params.categories }}{{ if $i }},{{ end }} + { + "name": "{{ .name }}",{{ if .description }} + "description": "{{ .description }}",{{ end }} + "hideTitle": "{{ .untitled }}", + "closedByDefault": "{{ .closed }}" + } + {{ end }} + ], + "systems": [ + {{ range $i, $e := .Site.Params.systems }}{{ if $i }},{{ end }} + { + "name": "{{ .name }}",{{ if .description }} + "description": "{{ .description }}",{{ end }} + "category": "{{ .category }}", + "hideTitle": "{{ .untitled }}", + "closedByDefault": "{{ .closed }}" + } + {{ end }} + ], + + "colorBrand": "{{ .Site.Params.Brand }}", + "colorOk": "{{ .Site.Params.Ok }}", + "colorDisrupted": "{{ .Site.Params.Disrupted }}", + "colorDown": "{{ .Site.Params.Down }}", + "colorNotice": "{{ .Site.Params.Notice }}", + "alwaysKeepBrandColor": "{{ .Site.Params.alwaysKeepBrandColor }}", + "googleAnalytics": "{{ .Site.Params.googleAnalytics }}" +} \ No newline at end of file diff --git a/layouts/issues/single.json b/layouts/issues/single.json index 6287288..897998a 100644 --- a/layouts/issues/single.json +++ b/layouts/issues/single.json @@ -5,10 +5,9 @@ "created_at": "{{ .Date }}", "severity": "{{ .Params.severity }}", "resolved": "{{ .Params.resolved }}", + "informational": "{{ .Params.informational }}", "resolved_at": "{{ .Params.resolvedWhen }}", - "affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}'{{ . }}'{{ end }}], - - "body": {{ jsonify .Content }}, - - "filename": "{{ .File.LogicalName }}" + "affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}], + "filename": "{{ .File.LogicalName }}", + "body": {{ jsonify .Content }} } \ No newline at end of file diff --git a/layouts/partials/index/incidents-monthly.html b/layouts/partials/index/incidents-monthly.html new file mode 100644 index 0000000..263bc52 --- /dev/null +++ b/layouts/partials/index/incidents-monthly.html @@ -0,0 +1,29 @@ +{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} + + + +{{ range ($incidents.GroupByDate "1") }} +
+
+

+ + + {{ if gt .Key 9 }} + {{ $month := printf "2006-%s-02" .Key }} + {{ $monthDate := $month | time }} + {{ $monthDate.Format "January" }} + {{ else }} + {{ $month := printf "2006-0%s-02" .Key }} + {{ $monthDate := $month | time }} + {{ $monthDate.Format "January" }} + {{ end }} + {{ range first 1 .Pages }}{{ .Date.Format "2006" }}{{ end }} + ({{ len .Pages }}) +

+
+ + {{ range .Pages }} + {{ .Render "small" }} + {{ end }} +{{ end }} diff --git a/layouts/partials/index/incidents-yearly.html b/layouts/partials/index/incidents-yearly.html index 5cc323a..d07be9d 100644 --- a/layouts/partials/index/incidents-yearly.html +++ b/layouts/partials/index/incidents-yearly.html @@ -1,9 +1,12 @@ {{ $incidents := where .Site.RegularPages "Params.section" "issue" }} -{{ range ((where .Site.RegularPages "Params.section" "issue").GroupByDate "2006") }} -

{{ .Key }} + +{{ range ($incidents.GroupByDate "2006") }} +

+
+

{{ .Key }} ({{ len .Pages }}) -

+


{{ range .Pages }} {{ .Render "small" }} -- cgit v1.2.3-70-g09d2 From 91f464f8f67e172f7276b3644e16b3b89a992113 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sun, 15 Dec 2019 12:12:43 +0200 Subject: Design updates - dark mode finished, mini fixes --- README.md | 2 +- exampleSite/config.yml | 15 ++++ .../issues/2019-10-04-testing-cstate-functions.md | 1 - layouts/issues/issue.html | 6 +- layouts/issues/small.html | 6 +- layouts/partials/meta.html | 82 +++++++++++++++------- 6 files changed, 80 insertions(+), 32 deletions(-) (limited to 'exampleSite/content') diff --git a/README.md b/README.md index 809feca..5a047c5 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ git submodule add https://github.com/cstate/cstate 1. Clone this repository in the command line: ```bash -git clone --recurisve https://github.com/cstate/cstate.git +git clone --recursive -b master https://github.com/cstate/cstate.git ``` 2. Navigate to the theme directory: diff --git a/exampleSite/config.yml b/exampleSite/config.yml index a894d26..98f95c0 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -172,6 +172,21 @@ params: # STRING; `monthly`, `yearly`, `none` incidentHistoryFormat: "yearly" + # Disable dark mode + # + # If your OS and browser support the + # `prefers-color-scheme` media query, + # cState will automatically switch to + # a darker user interface. + # + # cState uses its built-in colors for + # most of the interface to ensure + # a good user experience. + # + # Default: false + # BOOLEAN; `true`, `false` + disableDarkMode: false + # Should we show the logo or the title # of the status page? # diff --git a/exampleSite/content/issues/2019-10-04-testing-cstate-functions.md b/exampleSite/content/issues/2019-10-04-testing-cstate-functions.md index e8e2250..efdf7d7 100644 --- a/exampleSite/content/issues/2019-10-04-testing-cstate-functions.md +++ b/exampleSite/content/issues/2019-10-04-testing-cstate-functions.md @@ -1,7 +1,6 @@ --- title: Testing New cState Features date: 2019-10-04 18:05:00 -resolvedWhen: 2019-10-04 18:05:00 informational: true section: issue --- diff --git a/layouts/issues/issue.html b/layouts/issues/issue.html index 24cadd8..62f3ab3 100644 --- a/layouts/issues/issue.html +++ b/layouts/issues/issue.html @@ -82,11 +82,11 @@ {{ else }} {{ if eq .Params.severity "down" }} - ◼ + ■ {{ else if eq .Params.severity "disrupted" }} - ▲ + ▲ {{ else }} - ◆ + ◆ {{ end }} {{ T "downtimeOngoing" }} {{ end }} diff --git a/layouts/issues/small.html b/layouts/issues/small.html index 9349046..0e1d5ed 100644 --- a/layouts/issues/small.html +++ b/layouts/issues/small.html @@ -82,11 +82,11 @@ {{ if eq .Params.severity "down" }} - ◼ + ■ {{ else if eq .Params.severity "disrupted" }} - ▲ + ▲ {{ else }} - ◆ + ◆ {{ end }} {{ T "downtimeOngoing" }} diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index a5f6472..bcd3967 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -29,7 +29,7 @@ margin: 0; background: #fff; color: #4d4d4d; - font: 100%/1.5 'Inter', "Inter UI", BlinkMacSystemFont, -apple-system, "San Francisco Text", "Roboto", "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font: 100%/1.5 "Inter", "Inter UI", BlinkMacSystemFont, -apple-system, "San Francisco Text", "Roboto", "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; box-sizing: border-box; -webkit-tap-highlight-color: rgba(0,0,0, 0.25); } @@ -66,7 +66,7 @@ h1, h2, h4 { font-weight: normal; color: #000; - font-family: 'Inter', "Inter UI", "Segoe UI", BlinkMacSystemFont, -apple-system, "San Francisco Display", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-family: "Inter", "Inter UI", "Segoe UI", BlinkMacSystemFont, -apple-system, "San Francisco Display", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; letter-spacing: -0.4px; } @@ -332,30 +332,64 @@ } } - /** - * Dark theme - */ + {{ if not .Site.Params.disableDarkMode }} + /** + * Dark theme + */ + + @media (prefers-color-scheme: dark) { + /* Basics */ + html, body { background: #181a1b; color: #ccc9c1; } + h1, h2, h3, h4, a, .bold { color: #fafafa; } + hr { border-bottom-color: #3d3d3d; } + + /* Sections */ + .footer { background: #1b1d1e; } + + .components { + border: 2px solid #ddd; + border-bottom: 0; + border-color: #3a3a3a; + } - @media (prefers-color-scheme: dark) { - html, body { background: #181a1b; color: #ccc9c1; } - h1, h2, h3, h4, a, .bold { color: #e8e6e3; } - hr { border-bottom-color: #3d3d3d; } - .footer { background: #1b1d1e; } - .date { color: #c3bfb6; } - .components { border: 2px solid #ddd; border-bottom: 0; border-color: #3a3a3a; } - .component { border-bottom: 2px solid #ddd; color: #e8e6e3; border-bottom-color: #3a3a3a; } - .tag { background-image: initial; background-color: #1d1f20; } - .tag:hover { background: #222; } - .issue:hover {background-color: #1b1d1e } - .error { color: #ff4242; } - .hinted, .faded { color: #c1bcb3; } - .warning {color: #ff8b52; } - .ok { color: #7fff7f; } - .component[data-status="disrupted"] - .component-status { color: #ff8b52; } - .component[data-status="ok"] - .component-status { color: #7fff7f; } + .component { + border-bottom: 2px solid #ddd; + color: #e8e6e3; + border-bottom-color: #3a3a3a; } + + .tabs { border-bottom-color: #3d3d3d; } + .tab--current { + border-color: #3d3d3d; + border-bottom-color: #181a1b; + } + .tab--other { color: #757575; } + .tab--other:hover { color: #fff; } + + .date { color: #c3bfb6; } + + .tag { background-color: #1d1f20; } + .tag:hover { background: #222; } + .issue:hover, + .category__head:hover { background-color: #212121; } + + /* Colors for dark mode */ + + .hinted, .faded { color: #c1bcb3; } + .error { color: #ff4242; } + .warning {color: #ffde7f; } + .ok { color: #7fff7f; } + + .component[data-status="ok"] + .component-status { color: #7fff7f; } + .component[data-status="disrupted"] + .component-status { color: #ffde7f; } + .component[data-status="notice"] + .component-status { color: #83a4e8; } + .component[data-status="down"] + .component-status { color: #ff8181; } + } + {{ end }} {{ if .Site.Params.enableCustomHTML }} {{ partial "custom/meta" . }} -- cgit v1.2.3-70-g09d2