diff options
24 files changed, 862 insertions, 241 deletions
@@ -6,14 +6,12 @@ WORKDIR /cstate # Install hugo & git RUN apk add --no-cache hugo git -# -- First Run -- - # Download the example site -RUN git clone https://github.com/cstate/example /cstate +RUN git clone -b master --depth=1 https://github.com/cstate/example /cstate # Copy files from this repo into themes/cstate RUN mkdir -p /cstate/themes/cstate COPY . /cstate/themes/cstate -# Prepare the entrypoint files +# Copy entrypoint script into the container image, this runs everytime the container cold-starts. COPY ./docker/entrypoint.sh /docker-entrypoint.d/10-build-hugo.sh @@ -1,16 +1,12 @@ -<p align="center"><img src="images/cstate-logo-bg.svg?sanitize=true" alt="cState example illustration"></p> - -<p align="center"><a href="https://github.com/cstate/cstate/releases"><img src="https://img.shields.io/github/release/cstate/cstate/all.svg?style=flat-square" alt="GitHub release" /></a> <a href="https://github.com/cstate/cstate/commits/master"><img src="https://img.shields.io/github/last-commit/cstate/cstate.svg?style=flat-square" alt="GitHub last commit" /></a> <a href="https://github.com/cstate/cstate/tree/master/"><img src="https://img.shields.io/github/repo-size/cstate/cstate.svg?style=flat-square" alt="GitHub repo size in bytes" /></a> <a href="https://discord.gg/zYCjzys"><img src="https://img.shields.io/badge/discord-support-7289DA.svg?logo=discord&style=flat-square" alt="Discord Chat" /></a> <a href="https://twitter.com/cstate"><img src="https://img.shields.io/twitter/follow/mistermantas.svg?style=social&label=Follow" alt="Twitter" /></a> <a href="https://github.com/ivbeg/awesome-status-pages"><img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome status page" /></a></p> +<p align="center"><img src="images/cstate-logo-bg.svg?sanitize=true" width="500" height="auto" alt="cState example illustration"></p> > Über fast, backwards compatible (IE8+), tiny, and simple status page built with Hugo. Completely _free_ with Netlify. Comes with Netlify CMS, read-only API, and other useful features. -## Sponsors 🏅 - -<a href="//statuspal.io"><img src="images/statuspal-logo-with-text.png" alt="Statuspal" width="200"></a> +<a href="https://github.com/cstate/cstate/commits/master"><img src="https://img.shields.io/github/last-commit/cstate/cstate.svg?style=flat-square" alt="GitHub last commit" /></a> <a href="https://github.com/ivbeg/awesome-status-pages"><img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome status page" /></a> -You can also support the creator of this project by **starring, sharing, and using cState**. Thank you! +<a href="//statuspal.io">Sponsored by <img src="images/statuspal-logo-with-text.png" alt="Statuspal" width="150"></a> -[*Learn more about sponsorships*](https://github.com/sponsors/mistermantas) +You can also support the creator of this project by **starring, sharing, using cState and/or [financially supporting the author](https://github.com/sponsors/mistermantas)**. Thank you! ## Examples 🥳 @@ -30,6 +26,8 @@ You can also support the creator of this project by **starring, sharing, and usi * [Content Ignite](https://status.contentignite.com/) * [FSCI](https://status.fsci.in/) * [Storehouse](https://status.sthse.co) +* [Hyrousek](https://status.hyrousek.tk) +* [josh.win](https://status.josh.win) *Want your status page here? [Create a PR](https://github.com/cstate/cstate/edit/dev/README.md)!* @@ -57,6 +55,8 @@ There are other commercial options that may update faster because of their archi ### List of possibilities +**Please note that with all that cState _can_ do, it cannot do automatic monitoring. [See this thread](https://github.com/cstate/cstate/issues/124)** + | **cState is designed with care** | **Fast, reliable, and free (even with host)** | **Easy to setup, manage, use** | |-------------------------------------------------------------------------------------------------------------------------- |-------------------------------------------------------------------------------------------------------------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------- | | A simple and focused user interface & experience with [instant loading](https://github.com/cstate/cstate/issues/117), suitable for any brand | Built with [Hugo](https://gohugo.io), a hyperfast Golang static site generator (SSG) | As easy as WordPress: if you don't like getting into the code, try Netlify CMS | @@ -71,10 +71,9 @@ There are other commercial options that may update faster because of their archi ## Getting started 💻 This is how you create a **new site powered by cState.** What you are generating is a Hugo site with specific, already existing modifications (to Hugo, cState is a theme). + -### — The easy way — - -#### 💚 Netlify and Netlify CMS +### 💚 Netlify and Netlify CMS cState was built to work best with Netlify and comes with the neccesary files to enable Netlify CMS. @@ -99,38 +98,49 @@ These are the settings you should be using: + Publish directory: **public** + Add one build environment variable + Key: **HUGO_VERSION** - + Value: **0.48** (or later) + + Value: **0.80** (or later) ++ Also **for the Build image selection, pick Ubuntu Xenial 16.04 or later** +### 🧡 Other great hosting and CMS options -#### 🧡 GitLab Pages (Experimental) +The most popular options, apart from Netlify's offers, are: -GitLab Pages, unlike GitHub Pages, supports Hugo, so you can let GitLab build and serve cState without needing to do it on your own machine ([similarly to how you can blog with GitLab Pages from your phone](https://about.gitlab.com/blog/2016/08/19/posting-to-your-gitlab-pages-blog-from-ios/)). +* **Hosting:** + * GitHub Pages + * GitLab Pages + * Cloudflare Pages + * Vercel +* **Admin panels / CMS:** + * Forestry.io + * Or just use your Git provider (github.com, gitlab.com, etc) -[GitLab has a good guide for getting started with GitLab Pages in their documentation.](https://docs.gitlab.com/ee/user/project/pages/#getting-started) +You can also look at [other headless CMS options **(we use Git-based CMS types)** on jamstack.org](https://jamstack.org/headless-cms/). -**In short: a `.gitlab-ci.yml` file** is responsible for making cState work. As of v4.2.1, the [cState automatically ships with this file](https://github.com/cstate/cstate/releases/tag/v4.2.1). +### GitLab Pages -As of this time, this is a relatively untested option, but Hugo does seem to generate the right things (this can be checked by downloading the **CI/CD artificats**). +Here is a [good guide for getting started with the service.](https://docs.gitlab.com/ee/user/project/pages/#getting-started) -According to GitLab, it may take up to 30 minutes before the site is available after the first deployment. +**In short: a `.gitlab-ci.yml` file** is responsible for making cState work. As of v4.2.1, the [cState automatically ships with this file](https://github.com/cstate/cstate/releases/tag/v4.2.1), but support is still experimental. -You can [make Netlify CMS work on GitLab](https://www.netlifycms.org/docs/gitlab-backend/), but that requires overriding an existing file in the theme. Create a file in `static/admin/config.yml` and follow the instructions linked earlier. (cState by default ships with Git Gateway.) +As of this time, this is a relatively untested option, but Hugo does seem to generate the right things (this can be checked by downloading the **CI/CD artificats**). +According to GitLab, it may take up to 30 minutes before the site is available after the first deployment. -#### 🖤 Other platforms +You can [make Netlify CMS work on GitLab](https://www.netlifycms.org/docs/gitlab-backend/), but that requires overriding an existing file in the theme. Create a file in `static/admin/config.yml` and follow the instructions linked earlier. (cState by default ships with Git Gateway for Netlify.) -At this time, as of the author's knowledge, there are no other platforms that support 'easy' deployment (if you know any — [let us know](#contribute-)). +### GitHub Pages, Cloudflare Pages, Vercel, Forestry, and others -Keep reading to see how to deploy manually. +There is no official, separate documentation for these, but if you look below to see how to deploy manually, the instructions will be the same everywhere. +### Doing it on your PC +Keep reading to see how to deploy manually. Developers wishing to contribute, scroll to the very bottom. -### — Manual builds — +### Manual builds For this tutorial, it is assumed that you have Hugo and Git installed (check with `hugo version` & `git --version`). -> A minimum version of `0.48` is required for Hugo, starting with v3. - +> A minimum version of `0.80` is required for Hugo, starting with v5. #### I want to use my site in production @@ -158,31 +168,7 @@ And the folder `public` can now be hosted. The downside with manual building is that, if you do not want to use a solution like GitLab Pages or Netlify, this process will need to happen on your computer. This can be tedious. - -#### I want to contribute to the development - -1. Clone this repository in the command line: - -```bash -git clone --recursive -b master https://github.com/cstate/cstate.git -``` - -2. Navigate to the theme directory: - -```bash -cd cstate/exampleSite -``` - -3. Launch the development setup like this: - -```bash -hugo serve --baseUrl=http://localhost/ --theme=cstate --themesDir=../.. --verbose -``` - -The main directory is the theme itself (the cState guts, basically) and the `exampleSite` folder houses all content. Use this local setup to experiment before making a PR. - - -### — Docker — +### Docker cState comes with a Dockerfile and Netlify ([according to their article from 2016](https://www.netlify.com/blog/2016/10/18/how-our-build-bots-build-sites/)) uses a similar Docker system to build cState. This is an option for people who prefer Docker and NGINX instead of serverless, but serverless still has the priority in our development. @@ -277,21 +263,43 @@ Check out [the wiki](https://github.com/cstate/cstate/wiki). ## Contribute 💥 -**Making a change in the code** +### Making a change in the code PRs should be submitted to the `dev` branch, if it exists. Before submitting a pull request, create an issue to [discuss the implications of your proposal](https://github.com/cstate/cstate/issues). -**For translators** +Here is a guide for how you should develop: + +1. Clone this repository in the command line: + +```bash +git clone --recursive -b master https://github.com/cstate/cstate.git +``` + +2. Navigate to the theme directory: + +```bash +cd cstate/exampleSite +``` + +3. Launch the development setup like this: + +```bash +hugo serve --baseUrl=http://localhost/ --theme=cstate --themesDir=../.. --verbose +``` + +The main directory is the theme itself (the cState guts, basically) and the `exampleSite` folder houses all content. Use this local setup to experiment before making a PR. + +### For translators [See this](https://github.com/cstate/cstate/wiki/Translations#add-your-translations). -**Code of conduct** +### Code of conduct [Be kind](/CODE_OF_CONDUCT.md). ## License ✍ -[MIT](https://github.com/cstate/cstate/blob/master/LICENSE.md) © [Mantas Vilčinskas](https://mnts.lt) +[MIT](https://github.com/cstate/cstate/blob/master/LICENSE.md) © [Mantas Vilčinskas](https://vilcinskas.me) A special thanks to all [the contributors](https://github.com/cstate/cstate/graphs/contributors) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index f8068c1..a90e37d 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,21 +1,23 @@ WORK_DIR="/app" SRC_DIR="/cstate" +echo "[CSTATE-DOCKER] Initalising container..." + # Check if the working dir is empty, if it is we'll need to copy # the files in from src directory (usually /cstate) if ! [ "$(ls -A $WORK_DIR)" ]; then # First run, copy cstate's files in. - echo "First time run! Hello, World :)" + echo "[CSTATE-DOCKER] Copying cState into staging area. First Start." cp -R $SRC_DIR/* $WORK_DIR fi -# Continue with building - -# CD into working dir -cd /app +cd $WORK_DIR # Build the hugo site +echo "[CSTATE-DOCKER] Running hugo build service..." hugo # Copy built files into NGINX directory -cp -r /app/public/* /usr/share/nginx/html
\ No newline at end of file +cp -r /$WORK_DIR/public/* /usr/share/nginx/html + +echo "[CSTATE-DOCKER] Initalisation complete."
\ No newline at end of file diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 85665f6..1d3149d 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -89,9 +89,29 @@ defaultContentLanguage: en # version 3. If you are just testing, # localhost should automatically work. # -# Example: https://status.example.com/ +# Example: +# baseUrl: https://status.example.com/ +# +# For testing: +# baseUrl: http://localhost +# +# Broken example: +# baseUrl: / baseURL: https://cstate.mnts.lt +# For features like Last modified, you +# need to use a Git repository. If you +# are using Netlify, you are already +# using Git (with GitHub, GitLab, etc) +# +# So, should Git information be used +# for this website? +# +# We recommend to keep this at `true`. +# BOOLEAN; `true`, `false` +enableGitInfo: true + + ############################################################ # +------------------------------------------------------+ # # | Preferences | # @@ -118,26 +138,30 @@ params: # because you need to set an 'Uncategorized' category. # Or it can be used alongside other categories. # + # These are case sensitive. + # # For help, see the wiki: # https://github.com/cstate/cstate/wiki/Customization categories: - name: North Coast description: The main servers are located here. closed: true - - name: East Coast + - name: Empty Category - name: Uncategorized untitled: true # These are your systems. Change them to # change the amount of components. # + # These are case sensitive. + # # For help, see the wiki: # https://github.com/cstate/cstate/wiki/Customization systems: - name: Gateway category: North Coast - name: Backup Gateway - category: East Coast + category: North Coast - name: API description: The guts of the application. category: Uncategorized @@ -154,12 +178,56 @@ params: # # dateFormat Default: "January 2, 2006 at 3:04 PM" # shortDateFormat Default: "15:04 — Jan 2" - dateFormat: January 2, 2006 at 3:04 PM - shortDateFormat: 15:04 — Jan 2 + dateFormat: January 2, 2006 at 3:04 PM UTC + shortDateFormat: 15:04 UTC — Jan 2 + + # Should relative time (x min ago) be used? + # + # IMPORTANT: In the frontmatter, the dates MUST be in + # the UTC time zone for this to work preperly. If you + # use Netlify CMS, all good — the CMS picks UTC time + # by default. Otherwise, there may be very inaccurate + # times if multiple time zones are in your issue files. + # + # FOR YOUR CONSIDERATION: This feature was introduced in + # v5. It may be a breaking change in the case when you + # wish to use relative time but old issues do not have + # UTC time (and therefore are out of sync by ±24 hours) + # + # Read the wiki for more: + # https://github.com/cstate/cstate/wiki/Customization#time + # + # If enabled, will display relative times in places like + # the incident history and summaries instead of using + # dateFormat and shortDateFormat (except for if you use + # the old shortcode). + # + # Default: `true` + # BOOLEAN; `true`, `false` + useRelativeTime: true + + # If enabled, doesn't show seconds on relative times. + # + # With option ON (true): + # "Last checked <1 min ago" + # + # With option OFF (false; default): + # "Last checked 20s ago" + # + # Default: `false` + # BOOLEAN; `true`, `false` + skipSeconds: false + + # Should there be an automatic "Last updated" + # text shown below issues? + # + # Default: `true` + # BOOLEAN; `true`, `false` + enableLastMod: true # What header design should we use? # - # Default: true + # Default: `true` # BOOLEAN; `true`, `false` useLargeHeaderDesign: false @@ -202,7 +270,7 @@ params: # Should we show the logo or the title # of the status page? # - # Default: false + # Default: `false` # BOOLEAN; `true`, `false` useLogo: true @@ -239,7 +307,7 @@ params: # for average downtime on # systems ("/affected/") pages # - # Default: false + # Default: `false` # BOOLEAN; `true`, `false` disableComplexCalculations: false @@ -277,7 +345,7 @@ params: # Default: `true` # BOOLEAN; `true`, `false` alwaysKeepBrandColor: true - + # Introduced in v4.0.1 for consistent # site title text color. # @@ -330,6 +398,10 @@ outputs: - json - rss - svg + term: + - html + - json + - rss outputFormats: svg: diff --git a/exampleSite/content/issues/2019-10-08-testing-new-pipeline.md b/exampleSite/content/issues/2019-10-08-testing-new-pipeline.md index 4f139de..4e9da4f 100644 --- a/exampleSite/content/issues/2019-10-08-testing-new-pipeline.md +++ b/exampleSite/content/issues/2019-10-08-testing-new-pipeline.md @@ -1,7 +1,7 @@ --- title: New Pipeline Rollout date: 2019-10-05 16:24:00 -resolved: false +resolved: true resolvedWhen: 2019-10-05 16:58:00 # Possible severity levels: down, disrupted, notice severity: disrupted diff --git a/exampleSite/content/issues/2020-06-13-maintenance-window.md b/exampleSite/content/issues/2021-02-13-maintenance-window.md index 404ccc4..d6c8b14 100644 --- a/exampleSite/content/issues/2020-06-13-maintenance-window.md +++ b/exampleSite/content/issues/2021-02-13-maintenance-window.md @@ -1,13 +1,14 @@ --- title: Maintenance Window -date: 2020-06-13 15:54:00 -resolved: true -resolvedWhen: 2020-06-13 16:54:00 +#date: 24 Feb 21 12:35 +0200 +date: 2021-02-24 10:35:00 +resolved: false +resolvedWhen: 2021-02-24 12:10:00 # Possible severity levels: down, disrupted, notice -severity: disrupted +severity: notice affected: - - API + - Gateway section: issue --- -*Just began* - We're currently shutting down the network. {{< track "2018-06-13 15:54:00" >}} +*Just began* - We're currently shutting down the network. {{< track "2018-06-13 12:54:00" >}} diff --git a/exampleSite/content/issues/2019-10-04-testing-cstate-functions.md b/exampleSite/content/issues/i-testing-cstate-functions.md index efdf7d7..cf833ac 100644 --- a/exampleSite/content/issues/2019-10-04-testing-cstate-functions.md +++ b/exampleSite/content/issues/i-testing-cstate-functions.md @@ -7,4 +7,4 @@ 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 +This is essentially a page with a date and title that shows up in the incident history.
\ No newline at end of file diff --git a/exampleSite/netlify.toml b/exampleSite/netlify.toml index d649777..5def631 100644 --- a/exampleSite/netlify.toml +++ b/exampleSite/netlify.toml @@ -4,7 +4,7 @@ functions = "functions" [build.environment] - HUGO_VERSION = "0.48" + HUGO_VERSION = "0.80" [context.production.environment] HUGO_ENV = "production" @@ -14,4 +14,9 @@ command = "hugo -b $DEPLOY_PRIME_URL" [context.branch-deploy] - command = "hugo -b $DEPLOY_PRIME_URL"
\ No newline at end of file + command = "hugo -b $DEPLOY_PRIME_URL" + +[[headers]] + for = "/*.json" + [headers.values] + Access-Control-Allow-Origin = "*"
\ No newline at end of file diff --git a/i18n/en.yaml b/i18n/en.yaml index f5c7103..2fa284b 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -21,7 +21,7 @@ - id: isNotice translation: Please read announcement - id: isOk - translation: All systems operational + translation: No issues detected # No JS warning - id: noScriptingIntro @@ -42,7 +42,7 @@ # "Last checked" + "just now" - id: lastChecked - translation: Last checked + translation: Last updated - id: justNow translation: just now - id: someTimeAgo diff --git a/i18n/it.yaml b/i18n/it.yaml new file mode 100644 index 0000000..66da467 --- /dev/null +++ b/i18n/it.yaml @@ -0,0 +1,160 @@ +# Italian language file for cState +# Version 4.4 + +- id: languageCode + translation: it +- id: languageName + translation: Italian +- id: languageNameShort + translation: ITA + +## +## INDEX.HTML +## + +# Summary status message +- id: isDown + translation: Si riscontrano problemi gravi +- id: isDisrupted + translation: Si riscontrano alcune interruzioni +- id: isNotice + translation: Per favore leggi l'annuncio +- id: isOk + translation: Tutti i sistemi sono operativi + +# No JS warning +- id: noScriptingIntro + translation: Uh Oh! Sembra che tu abbia disabilitato JavaScript. Per favore +- id: noScriptingLink + translation: abilita gli script +- id: noScriptingOutro + translation: per migliorare la tua esperienza su questo sito web. + +- id: thisIsDown + translation: Disservizio +- id: thisIsDisrupted + translation: Irregolare +- id: thisIsNotice + translation: Manutenzione +- id: thisIsOk + translation: Operativo + +# "Last checked" + "just now" +- id: lastChecked + translation: Ultimo controllo +- id: justNow + translation: in questo momento +- id: someTimeAgo + translation: fa + +# Example usage: `5` + `years` +# Final result: 'Last checked 5 years ago' +# Number goes before string +# Use short variants until months +- id: yearsAgo + translation: anni +- id: monthsAgo + translation: mesi +- id: daysAgo + translation: g +- id: hoursAgo + translation: o +- id: minsAgo + translation: min +- id: secondsAgo + translation: s + +- id: autoRefreshNotice + translation: Proveremo ad aggiornare ogni 5 secondi + +# Incidents +- id: incidents + translation: Incidenti +- id: incidentHistory + translation: Storia degli incidenti + +- id: resolved + translation: Risolto # if it's less than a min +- id: inUnderAMinute + translation: in meno di un minuto # continuing the last string +- id: resolvedAfter + translation: Risolto dopo # + 19 min +- id: ofDowntime + translation: di disservizio + +- id: downtimeOngoing + translation: Questo problema non è ancora risolto + + +- id: calmBeforeTheStorm + translation: E' la quiete prima della tempesta? +- id: noIncidentsDesc + translation: Questa pagina di stato non ha registrato incidenti. Questo potrebbe accedere perché il proprietario (o i proprietari) hanno creato questa pagina di recente, non hanno mai avuto disservizi o non hanno mai registrato un disservizio. + + +- id: continueReading + translation: Continua a leggere +- id: prev + translation: Precedente +- id: next + translation: Successivo + +## +## OTHER +## + +- id: goBack + translation: Torna a +- id: backToTop + translation: Torna all'inizio +- id: poweredBy + translation: Fatto da + +- id: notFound + translation: Non c'è nulla qui. +- id: notFoundText + translation: Questo potrebbe essere un problema da parte nostra. Forse abbiamo spostato una risorsa e ora non c'è più. È anche possibile che la risorsa che stai cercando di visualizzare sia vuota. Ti dispiace ricontrollare l'indirizzo? + +- id: rss + translation: Sottoscriviti tramite RSS +- id: toAllUpdates + translation: per tutti gli aggiornamenti +- id: or + translation: o +- id: onlyThisFeed + translation: solo per questo feed + +## +## v3 +## +- id: entries + translation: voci +- id: newestToOldest + translation: dalle nuove alle vecchie + +## +## v4 +## +- id: notFoundAffected + translation: Sembra che questo sistema non esista o non abbia mai registrato disservizi. + +## +## v4.1 +## + +- id: averageSystemsDowntime + translation: Di recente, in base ai dati medi, sembra che questo sistema abbia avuto disservizi per circa +- id: averageSystemsDowntimeSecondPart + translation: minuti per volta + + +## +## v4.4 +## + +- id: in + translation: in +- id: weeksAgo + translation: " sett" +- id: yearAgo + translation: " anni" diff --git a/i18n/tl.yaml b/i18n/tl.yaml new file mode 100644 index 0000000..1600abc --- /dev/null +++ b/i18n/tl.yaml @@ -0,0 +1,159 @@ +# Tagalog language file for cState +# Version 4.4 + +- id: languageCode + translation: tl +- id: languageName + translation: Tagalog +- id: languageNameShort + translation: TGL + +## +## INDEX.HTML +## + +# Summary status message +- id: isDown + translation: Nakakaranas ng malaking isyu +- id: isDisrupted + translation: Nakakaranas ng pagkagambala +- id: isNotice + translation: Pakiusap paki-basa ang anunsyo +- id: isOk + translation: Lahat ng sistema ay gumagana + +# No JS warning +- id: noScriptingIntro + translation: Ay! Mukhang naka-diseybol ang Javascript mo. Pakiusap +- id: noScriptingLink + translation: i-eneybol ang skripting +- id: noScriptingOutro + translation: para mas maganda ang iyong eksperyensha sa websayt na ito. +- id: thisIsDown + translation: Hindi gumagana +- id: thisIsDisrupted + translation: May pagkagambala +- id: thisIsNotice + translation: Pagpapanatili +- id: thisIsOk + translation: Gumagana + +# "Last checked" + "just now" +- id: lastChecked + translation: Huling na-chek +- id: justNow + translation: ngayon lamang +- id: someTimeAgo + translation: nakaraan + +# Example usage: `5` + `years` +# Final result: 'Last checked 5 years ago' +# Number goes before string +# Use short variants until months +- id: yearsAgo + translation: mga taon +- id: monthsAgo + translation: mga buwan +- id: daysAgo + translation: a +- id: hoursAgo + translation: o +- id: minsAgo + translation: min +- id: secondsAgo + translation: s + +- id: autoRefreshNotice + translation: Susubukan naming mag-refresh bawat 5 min + +# Incidents +- id: incidents + translation: Mga insidente +- id: incidentHistory + translation: Kasaysayan ng mga insidente + +- id: resolved + translation: Na-resolba # if it's less than a min +- id: inUnderAMinute + translation: sa ilalim ng isang minuto # continuing the last string +- id: resolvedAfter + translation: Na-resolba pagkatapos ng # + 19 min +- id: ofDowntime + translation: ng dawntaym + +- id: downtimeOngoing + translation: Ang isyung ito ay hindi pa na-reresolba + + +- id: calmBeforeTheStorm + translation: Ito ba ang katahimikan bago ang bagyo? +- id: noIncidentsDesc + translation: Ang status peyg na ito ay walang na-itala na insidente. This status page has no logged incidents. This may be because the status page owner (or owners) have recently set up their status page, have had no downtime, or have not logged any downtime. + + +- id: continueReading + translation: Ipagpatuloy ang pagbabasa +- id: prev + translation: Dati +- id: next + translation: Susunod + +## +## OTHER +## + +- id: goBack + translation: Bumalik sa +- id: backToTop + translation: Bumalik sa ibabaw +- id: poweredBy + translation: Pinapatakbo ng + +- id: notFound + translation: Walang dito. +- id: notFoundText + translation: Ito'y maaaring problema sa amin. Maaring may nilipat kami na resors at ngayon ay nawala na ito. Posible din na ang resors na nais mong makita ay walang laman. Pero, ayos lang ba sa iyo ang dobol-check sa link? + +- id: rss + translation: Mag-subskrayb sa pamamagitan ng RSS +- id: toAllUpdates + translation: sa lahat ng mga updeyt +- id: or + translation: o +- id: onlyThisFeed + translation: sa feed lamang na ito + +## +## v3 +## +- id: entries + translation: mga entri +- id: newestToOldest + translation: mula sa pinaka-bago hanggang sa pinaka-luma + +## +## v4 +## +- id: notFoundAffected + translation: Mukang ang sistemang ito ay hindi na nag-eesist o di kailan mang nagkaroon ng na-rekord na dawntaym. + +## +## v4.1 +## + +- id: averageSystemsDowntime + translation: Kamakailan, base sa iyong average na data, mukang ang sistemang ito ay nag-dawn ng mga +- id: averageSystemsDowntimeSecondPart + translation: minuto nang paisa-isa. + + +## +## v4.4 +## + +- id: in + translation: sa +- id: weeksAgo + translation: " l" +- id: yearAgo + translation: " taon" diff --git a/layouts/404.json b/layouts/404.json new file mode 100644 index 0000000..82681f1 --- /dev/null +++ b/layouts/404.json @@ -0,0 +1,4 @@ +{ + "is" : "404", + "title" : "Error - Not Found" +}
\ No newline at end of file diff --git a/layouts/_default/list.json b/layouts/_default/list.json new file mode 100644 index 0000000..f469523 --- /dev/null +++ b/layouts/_default/list.json @@ -0,0 +1,32 @@ +{{ $incidents := where .Site.RegularPages "Params.section" "issue" }}{{ $active := where $incidents "Params.resolved" "=" false }}{{ $isNotice := where $active "Params.severity" "=" "notice" }}{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }}{{ $isDown := where $active "Params.severity" "=" "down" }}{ + "is": "{{ .Section }}", + "title": "{{ .Title }}", + "baseURL": "{{ .Site.BaseURL }}", + "description": "{{ if .Params.Description }}{{ .Params.description }}{{ else }}{{ end }}", + "pages": [{{ range $i, $e := .Pages }}{{ if $i }},{{ end }}{{ if eq .Section "issues" }} + { + "is": "issue", + "title": "{{ .Title }}", + "createdAt": "{{ .Date }}", + "lastMod": "{{ .Lastmod }}", + "permalink": "{{ .Permalink }}", + "severity": "{{ .Params.severity }}", + "resolved": {{ if .Params.resolved }}true{{ else }}false{{ end }}, + "informational": {{ if .Params.informational }}true{{ else }}false{{ end }}, + "resolvedAt": "{{ .Params.resolvedWhen }}", + "affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}], + "filename": "{{ .File.LogicalName }}" + } + {{ else }} + { + "is": "page", + "title": "{{ .Title }}", + "createdAt": "{{ .Date }}", + "lastMod": "{{ .Lastmod }}", + "permalink": "{{ .Permalink }}", + "filename": "{{ .File.LogicalName }}", + "summary": {{ jsonify .Summary }} + } + {{ end }}{{ end }} + ], +} diff --git a/layouts/affected/list.json b/layouts/affected/list.json new file mode 100644 index 0000000..1fde8d1 --- /dev/null +++ b/layouts/affected/list.json @@ -0,0 +1,37 @@ +{{ $incidents := .Pages }}{{ $active := where $incidents "Params.resolved" "=" false }}{{ $isNotice := where $active "Params.severity" "=" "notice" }}{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }}{{ $isDown := where $active "Params.severity" "=" "down" }}{ + "is": "system", + "title": "{{ .Title }}", + "permalink": "{{ .Permalink }}", + "status": {{ if $isDown }}"down",{{ else }}{{ if $isDisrupted }}"disrupted",{{ else }}{{ if $isNotice }}"notice",{{ else }}"ok",{{ end }}{{ end }}{{ end }} + "pages": [{{ range $i, $e := .Pages }}{{ if $i }},{{ end }}{{ if eq .Section "issues" }} + { + "is": "issue", + "title": "{{ .Title }}", + "createdAt": "{{ .Date }}", + "lastMod": "{{ .Lastmod }}", + "permalink": "{{ .Permalink }}", + "severity": "{{ .Params.severity }}", + "resolved": {{ if .Params.resolved }}true{{ else }}false{{ end }}, + "informational": {{ if .Params.informational }}true{{ else }}false{{ end }}, + "resolvedAt": "{{ .Params.resolvedWhen }}", + "affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}], + "filename": "{{ .File.LogicalName }}" + } + {{ else }} + { + "is": "page", + "title": "{{ .Title }}", + "createdAt": "{{ .Date }}", + "lastMod": "{{ .Lastmod }}", + "permalink": "{{ .Permalink }}", + "filename": "{{ .File.LogicalName }}", + "summary": {{ jsonify .Summary }} + } + {{ end }}{{ end }} + ], +} + + + + + diff --git a/layouts/index.json b/layouts/index.json index 5c47558..9834cec 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -1,20 +1,14 @@ -{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} -{{ $active := where $incidents "Params.resolved" "=" false }} -{{ $isNotice := where $active "Params.severity" "=" "notice" }} -{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }} -{{ $isDown := where $active "Params.severity" "=" "down" }} -{ +{{ $incidents := where .Site.RegularPages "Params.section" "issue" }}{{ $active := where $incidents "Params.resolved" "=" false }}{{ $isNotice := where $active "Params.severity" "=" "notice" }}{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }}{{ $isDown := where $active "Params.severity" "=" "down" }}{ "is": "index", - "cStateVersion": "4.4", - "apiVersion": "1.0.0", + "cStateVersion": "5.0", + "apiVersion": "2.0", "title": "{{ .Site.Title }}", "languageCodeHTML": "{{ .Site.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 }} + "summaryStatus": {{ if $isDown }}"down",{{ else }}{{ if $isDisrupted }}"disrupted",{{ else }}{{ if $isNotice }}"notice",{{ else }}"ok",{{ end }}{{ end }}{{ end }} + "categories": [{{ range $i, $e := .Site.Params.categories }}{{ if $i }},{{ end }} { "name": "{{ .name }}",{{ if .description }} "description": "{{ .description }}",{{ end }} @@ -28,32 +22,48 @@ { "name": "{{ .name }}",{{ if .description }} "description": "{{ .description }}",{{ end }} - "category": "{{ .category }}" + "category": "{{ .category }}", + {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .name) }}{{ $thisIsNotice := where $activeComponentIssues "Params.severity" "=" "notice" }}{{ $thisIsDisrupted := where $activeComponentIssues "Params.severity" "=" "disrupted" }}{{ $thisIsDown := where $activeComponentIssues "Params.severity" "=" "down" }} + "status": {{ if $thisIsDown }}"down"{{ else }}{{ if $thisIsDisrupted }}"disrupted"{{ else }}{{ if $thisIsNotice }}"notice"{{ else }}"ok"{{ end }}{{ end }}{{ end }}, + {{ if not $activeComponentIssues }} + "unresolvedIssues": [] + {{ else }} + "unresolvedIssues": [{{ range $i, $e := $activeComponentIssues }}{{ if $i }},{{ end }} + { + "is": "issue", + "title": "{{ .Title }}", + "createdAt": "{{ .Date }}", + "lastMod": "{{ .Lastmod }}", + "permalink": "{{ .Permalink }}", + "severity": "{{ .Params.severity }}", + "resolved": {{ if .Params.resolved }}true{{ else }}false{{ end }}, + "informational": {{ if .Params.informational }}true{{ else }}false{{ end }}, + "resolvedAt": "{{ .Params.resolvedWhen }}", + "affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}], + "filename": "{{ .File.LogicalName }}" + } + {{ end }} + ]{{ end }} + }{{ end }} + ], + {{ if .Site.Params.customTabs }} + "tabs": [{{ range $i, $e := .Site.Params.customTabs }}{{ if $i }},{{ end }} + { + "name": "{{ .name }}", + "link": "{{ .description }}" } {{ end }} - ], - + ],{{ end }} "buildDate": "{{ now.Format "2006-01-02" }}", "buildTime": "{{ now.Format "15:04" }}", "buildTimezone": "{{ now.Format "MST" }}", - "summaryStatus":{{ if $isDown }} - "down", - {{ else }} - {{ if $isDisrupted }} - "disrupted", - {{ else }} - {{ if $isNotice }} - "notice", - {{ else }} - "ok", - {{ end }}{{ end }}{{ 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 }}", - + "logo": "{{ .Site.Params.logo | absURL }}", "googleAnalytics": "{{ .Site.Params.googleAnalytics }}" } diff --git a/layouts/issues/single.html b/layouts/issues/single.html index 5761477..402c794 100644 --- a/layouts/issues/single.html +++ b/layouts/issues/single.html @@ -13,9 +13,24 @@ </div> <div class="contain"> - {{ .Render "issue" }} + {{ .Render "issue" }} </div> + + {{ if .Site.Params.enableLastMod }} + <div class="contain center"> + <p>{{ T "lastChecked" }}: + {{ if .Site.Params.dateFormat }} + {{ .Lastmod.UTC.Format .Site.Params.dateFormat }} + {{ else }} + {{ .Lastmod.Format "January 2, 2006 at 3:04 PM" }} + {{ end }} + </p> + </div> + {{ end }} + + + {{ partial "js" . }} {{ partial "footer" . }} diff --git a/layouts/issues/single.json b/layouts/issues/single.json index 36b0f67..fb78ee7 100644 --- a/layouts/issues/single.json +++ b/layouts/issues/single.json @@ -2,12 +2,12 @@ "is": "issue", "title": "{{ .Title }}", "createdAt": "{{ .Date }}", + "lastMod": "{{ .Lastmod }}", "permalink": "{{ .Permalink }}", "severity": "{{ .Params.severity }}", - "resolved": "{{ .Params.resolved }}", - "informational": "{{ .Params.informational }}", + "resolved": {{ if .Params.resolved }}true{{ else }}false{{ end }}, + "informational": {{ if .Params.informational }}true{{ else }}false{{ end }}, "resolvedAt": "{{ .Params.resolvedWhen }}", "affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}], - "filename": "{{ .File.LogicalName }}", - "body": {{ jsonify .Content }} + "filename": "{{ .File.LogicalName }}" }
\ No newline at end of file diff --git a/layouts/issues/small.html b/layouts/issues/small.html index 6ed2cce..531b47b 100644 --- a/layouts/issues/small.html +++ b/layouts/issues/small.html @@ -7,8 +7,8 @@ <a href="{{ .Permalink }}" class="issue no-underline"> {{ if .Params.informational }} - - <small class="date float-right"> + + <small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ .Date.Format "Jan 2 15:04:05 2006 UTC" }}"> {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} {{ else }} @@ -21,9 +21,9 @@ </h3> <span class="faded">{{ .Summary | truncate 200 }} </span> - + {{ else if .Params.Resolved }} - <small class="date float-right"> + <small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ .Date.Format "Jan 2 15:04:05 2006" }}"> {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} {{ else }} @@ -65,9 +65,10 @@ </div> {{ end }} {{ end }} - {{ else }} - <small class="date float-right"> + {{ else }} + <!-- If not resolved --> + <small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ .Date.Format "Jan 2 15:04:05 2006 UTC" }}"> {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} {{ else }} @@ -82,17 +83,17 @@ <!-- Marker --> {{ if eq .Params.severity "notice" }} <strong class="warning"> - ◆ + ◆ {{ T "downtimeOngoing" }} </strong> {{ else }} <strong class="error"> {{ if eq .Params.severity "down" }} - ■ + ■ {{ else if eq .Params.severity "disrupted" }} - ▲ + ▲ {{ else }} - ◆ + ◆ {{ end }} {{ T "downtimeOngoing" }} </strong> diff --git a/layouts/partials/index/components.html b/layouts/partials/index/components.html index 82964fe..acb1aa7 100644 --- a/layouts/partials/index/components.html +++ b/layouts/partials/index/components.html @@ -10,18 +10,8 @@ {{ $systems := .Site.Params.systems }} {{ $categories := .Site.Params.categories }} - <script> - function toggleCategoryHead(el) { - if (el.parentNode.className == 'category category--open') { - el.parentNode.className = 'category category--closed'; - } else { - el.parentNode.className = 'category category--open'; - } - } - </script> - {{ range $categories }} - <div class="category {{ if .closed }}category--closed{{ else }}category--open{{ end }}" id="{{ .name | urlize }}"> + <div class="category {{ if .closed }}category--closed{{ else }}category--open{{ end }}{{ if not .untitled }} category--titled{{ end }}" id="{{ .name | urlize }}"> {{ if not .untitled }} <div class="bold padding clicky category__head" onclick="toggleCategoryHead(this)"> <span class="hide-without-js"> @@ -42,6 +32,8 @@ </span> </span> {{ end }} + + <span class="category-status"></span> </div> {{ else }} @@ -94,8 +86,54 @@ {{ end }} </div> {{ end }} - </div> + </div> + + <!-- + Get category status + --> + <script> + // We will look at all components in one category + thisCategory = document.currentScript.parentNode + + componentsOfThisCategory = thisCategory.querySelectorAll('.component') + + // We will cycle through all components and show + // the worst status found + // + // By default, all is good but we change this value + // for progressively worse statuses + var highlestLevelStatus = ''; + + function checkStatus(element) { + var status = element.getAttribute('data-status'); + + if (status === 'down') { + highlestLevelStatus = 'down' + } else if (status === 'disrupted' && highlestLevelStatus !== 'down') { + highlestLevelStatus = 'disrupted' + } else if (status === 'notice' && highlestLevelStatus !== 'down' && highlestLevelStatus !== 'disrupted') { + highlestLevelStatus = 'notice' + } + } + + componentsOfThisCategory.forEach(element => checkStatus(element)); + + // Human readable (i18n) status name variable + var highlestLevelStatusReadable = highlestLevelStatus; + + if (highlestLevelStatus === 'ok') { highlestLevelStatusReadable = '{{ T "thisIsOk" }}' } + if (highlestLevelStatus === 'notice') { highlestLevelStatusReadable = '{{ T "thisIsNotice" }}' } + if (highlestLevelStatus === 'dsirupted') { highlestLevelStatusReadable = '{{ T "thisIsDisrupted" }}' } + if (highlestLevelStatus === 'down') { highlestLevelStatusReadable = '{{ T "thisIsDown" }}' } + + // Finally we can show the status + // (but only for categories with a name) + if (thisCategory.classList.contains('category--titled')) { + thisCategory.querySelector('.category__head').setAttribute('data-status', highlestLevelStatus); + thisCategory.querySelector('.category-status').innerHTML = highlestLevelStatusReadable; + } + </script> </div> {{ end }} -</div> +</div>
\ No newline at end of file diff --git a/layouts/partials/index/summary.html b/layouts/partials/index/summary.html index de6bceb..41f285b 100644 --- a/layouts/partials/index/summary.html +++ b/layouts/partials/index/summary.html @@ -20,5 +20,5 @@ {{ end }}{{ end }}{{ end }} </strong> - <div class="summary__date clicky float-right" onclick="location.reload()"></div> -</div>
\ No newline at end of file + <div class="summary__date clicky float-right relative-time" onclick="location.reload()" data-time-prefix="{{ T "lastChecked" }} "></div> +</div> diff --git a/layouts/partials/js.html b/layouts/partials/js.html index b398fbe..765e787 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -3,11 +3,11 @@ * Dev toolset */ - console.log('cState v4.4 - https://github.com/cstate/cstate'); + console.log('cState v5 Dev - https://github.com/cstate/cstate'); document.getElementsByTagName('html')[0].className = 'js'; /** - * Make theme color pretty + * Change header color based on status */ if (document.body.className === 'change-header-color') { @@ -40,65 +40,86 @@ document.location.pathname = '/admin'; } - /** - * Timer + /** + * Category logic */ - function hasClass(element, className) { - return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1; + function toggleCategoryHead(el) { + if (el.parentNode.className == 'category category--open category--titled') { + el.parentNode.className = 'category category--closed category--titled'; + } else { + el.parentNode.className = 'category category--open category--titled'; + } } - if (hasClass(document.querySelector('body'), 'status-homepage')) { - var lastUpdated = document.querySelector('.summary__date'); - lastUpdated.innerHTML = '{{ T "lastChecked" }} {{ T "justNow" }}'; - - var lastUpdate = new Date(); + /** + * Returns a relative date string for the given date. + */ + + function timeSince(date) { + var seconds = Math.floor((new Date() - date) / 1000); - function timeSince(date) { - var seconds = Math.floor((new Date() - date) / 1000); + var interval = Math.floor(seconds / 31536000); - var interval = Math.floor(seconds / 31536000); + if (interval > 1) { + return interval + ' {{ T "yearsAgo" }}'; + } + interval = Math.floor(seconds / 2592000); + if (interval > 1) { + return interval + ' {{ T "monthsAgo" }}'; + } + interval = Math.floor(seconds / 86400); + if (interval > 1) { + return interval + '{{ T "daysAgo" }}'; + } + interval = Math.floor(seconds / 3600); + if (interval > 1) { + return interval + '{{ T "hoursAgo" }}'; + } + interval = Math.floor(seconds / 60); + if (interval > 1) { + return interval + ' {{ T "minsAgo" }}'; + } + {{ if .Site.Params.skipSeconds }} + return '<1 {{ T "minsAgo" }}' + {{ else }} + return Math.floor(seconds) + '{{ T "secondsAgo" }}'; + {{ end }} + } - if (interval > 1) { - return interval + ' {{ T "yearsAgo" }}'; - } - interval = Math.floor(seconds / 2592000); - if (interval > 1) { - return interval + ' {{ T "monthsAgo" }}'; - } - interval = Math.floor(seconds / 86400); - if (interval > 1) { - return interval + '{{ T "daysAgo" }}'; - } - interval = Math.floor(seconds / 3600); - if (interval > 1) { - return interval + '{{ T "hoursAgo" }}'; - } - interval = Math.floor(seconds / 60); - if (interval > 1) { - return interval + ' {{ T "minsAgo" }}'; + /** + * Changes elements with the class 'relative-time' into relative times and + * moves the timestamp to a title attribute tooltip. + */ + + function updateRelativeTimes() { + var elements = document.querySelectorAll('.relative-time'); + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + var time = Date.parse(element.getAttribute('title')); + var html = element.getAttribute('data-time-prefix') || ''; + if (!time) { + time = element.innerText; + element.setAttribute('title', time || new Date); + html += '{{ T "justNow" }}'; + } else { + html += timeSince(time) + ' {{ T "someTimeAgo" }}'; } - return Math.floor(seconds) + '{{ T "secondsAgo" }}'; + html += element.getAttribute('data-time-suffix') || ''; + element.innerHTML = html.trim(); } - var aDay = 24*60*60*1000; } - window.setInterval(function() { - if (hasClass(document.querySelector('body'), 'status-homepage')) { - lastUpdated.innerHTML = '{{ T "lastChecked" }} ' + timeSince(lastUpdate) + ' {{ T "someTimeAgo" }}'; + updateRelativeTimes(); - // Refresh almost every 5m - if (lastUpdate > 290000) { - location.reload; - } - } - }, 5000) + // Update "time since" feature every 5s + setInterval(updateRelativeTimes, 5000); </script> {{ if ne .Site.Params.googleAnalytics "UA-00000000-1" }} <!-- Global site tag (gtag.js) - Google Analytics --> - <script type="text/javascript" defer src="https://www.googletagmanager.com/gtag/js?id=UA-109775664-1"></script> + <script type="text/javascript" defer src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Params.googleAnalytics }}"></script> <script type="text/javascript" defer> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index 77c66db..dfb5a98 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -12,7 +12,7 @@ {{ range .AlternativeOutputFormats -}} {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} - <meta name="generator" content="cState v4.4 - https://github.com/cstate/cstate"> + <meta name="generator" content="cState v5 Dev - https://github.com/cstate/cstate"> <meta name="theme-color" content="{{ .Site.Params.brand }}"> <script> var themeBrandColor = '{{ .Site.Params.brand }}'; @@ -319,14 +319,23 @@ .status-notice .announcement-box { border-top: 0; } /** - * Dynamically show individual component statuses + * Dynamically show component statuses */ - .component-status { float: right; } - .component[data-status="ok"] .component-status { color: {{ .Site.Params.ok }}; } - .component[data-status="disrupted"] .component-status { color: {{ .Site.Params.disrupted }}; } - .component[data-status="down"] .component-status { color: {{ .Site.Params.down }}; } - .component[data-status="notice"] .component-status { color: {{ .Site.Params.notice }}; } + .category--open .category-status { display: none; } + .component-status, .category-status { float: right; } + .component[data-status="ok"] .component-status, + .category__head[data-status="ok"] .category-status + { color: {{ .Site.Params.ok }}; } + .component[data-status="disrupted"] .component-status, + .category__head[data-status="disrupted"] .category-status + { color: {{ .Site.Params.disrupted }}; } + .component[data-status="notice"] .component-status, + .category__head[data-status="notice"] .category-status + { color: {{ .Site.Params.notice }}; } + .component[data-status="down"] .component-status, + .category__head[data-status="down"] .category-status + { color: {{ .Site.Params.down }}; } /** * Responsiveness @@ -386,15 +395,19 @@ .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; } + + .component[data-status="ok"] .component-status, + .category__head[data-status="ok"] .category-status + { color: #7fff7f; } + .component[data-status="disrupted"] .component-status, + .category__head[data-status="disrupted"] .category-status + { color: #ffde7f; } + .component[data-status="notice"] .component-status, + .category__head[data-status="notice"] .category-status + { color: #83a4e8; } + .component[data-status="down"] .component-status, + .category__head[data-status="down"] .category-status + { color: #ff8181; } } {{ end }} </style> diff --git a/static/admin/config.yml b/static/admin/config.yml index 9ce91d9..3de63dc 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -128,8 +128,10 @@ collections: - { label: "🇩🇪 Deutsch", value: "de" } - { label: "🇳🇱 Dutch", value: "nl" } - { label: "🇫🇷 French", value: "fr" } + - { label: "🇮🇹 Italiano", value: "it" } - { label: "🇧🇷 Portuguese", value: "pt"} - { label: "🇲🇰 Македонски", value: "mk" } + - { label: "🏳️ Tagalog", value: "tl" } - label: 'Site language in code for html[lang]' hint: 'Use the ISO 639-1 defined abbreviations. Examples: en, lt, de. Fully explained here: https://github.com/cstate/cstate/wiki/Customization#changing-site-language' name: 'languageCode' @@ -138,7 +140,7 @@ collections: - label: 'Base URL / Hostname' name: 'baseURL' widget: 'string' - hint: 'Where is the site hosted? What is the hostname or path to the root? Slash forces relative links but may not work in all setups.' + hint: 'Where is the site hosted? Hostname (and path) to the root. Prior to version 3, a slash was used which now works in local testing, but breaks certain features of cState like RSS feeds, so a correct example for production is: https://cstate.mnts.lt' default: '/' # PARAMS - label: "Params" @@ -175,19 +177,37 @@ collections: - {label: "Name", name: "name", widget: string} - {label: "Link", name: "link", widget: string} # Dates + - label: 'Show last modified date at bottom of issues' + name: 'enableLastMod' + widget: 'boolean' + hint: 'Experimental feature shows when changes occured based on Git info. Read the wiki for more: https://github.com/cstate/cstate/wiki/Customization#time' + required: false + default: false + - label: 'Use relative time (issue began x min ago)' + name: 'useRelativeTime' + widget: 'boolean' + hint: 'IMPORTANT: In the frontmatter, the dates MUST be in the UTC time zone. If you use Netlify CMS, the CMS picks UTC time by default, so no need to worry. However, there may be very inaccurate times, if you manually define non-UTC time in your issues. Read the wiki for more: https://github.com/cstate/cstate/wiki/Customization#time' + required: false + default: true + - label: 'Skip seconds in relative time calculations?' + name: 'skipSeconds' + widget: 'boolean' + hint: 'For users of relative time. With option ON (true): "Last checked <1 min ago". With option OFF (false; default): "Last checked 20s ago". Read the wiki for more: https://github.com/cstate/cstate/wiki/Customization#skip-seconds-v50' + required: false + default: false - label: 'Long date format' name: 'dateFormat' widget: 'string' - hint: 'Default: January 2, 2006 at 3:04 PM. Hugo formatting docs: https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference' - default: 'January 2, 2006 at 3:04 PM' + hint: 'Default: January 2, 2006 at 3:04 PM UTC. Docs: https://github.com/cstate/cstate/wiki/Customization#changing-date-formats-v30' + default: 'January 2, 2006 at 3:04 PM UTC' - label: 'Short date format' name: 'shortDateFormat' widget: 'string' - hint: 'Default: 15:04 — Jan 2. Hugo formatting docs: https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference' - default: '15:04 — Jan 2' + hint: 'Default: 15:04 UTC — Jan 2. Docs: https://github.com/cstate/cstate/wiki/Customization#changing-date-formats-v30' + default: '15:04 UTC — Jan 2' # Design site title color toggle in v4.0.1 - label: 'Site title text color' - hint: 'This is irrelevant, if you use a logo in your header. Docs: https://github.com/cstate/cstate/wiki/Customization#site-title-text-color-v401' + hint: 'This is irrelevant, if you use a logo in your header.' name: 'headerTextColor' widget: 'select' default: 'white' @@ -289,36 +309,61 @@ collections: name: 'enableCustomHTML' widget: 'boolean' default: 'false' - # REQUIRED BUT HIDDEN - - label: 'theme' - name: 'theme' - widget: 'hidden' - default: 'cstate' - - label: 'preserveTaxonomyNames' - name: 'preserveTaxonomyNames' - widget: 'hidden' - default: 'true' - - label: "taxonomies" - name: taxonomies - widget: "hidden" - fields: - - {label: "affected", name: "affected", widget: "hidden", default: "affected"} - - label: "outputs (Do not touch!)" - name: outputs - widget: "hidden" - fields: - - label: "page" - name: page - widget: "list" - allow_add: false - default: ['html', 'json'] - - label: "section" - name: section - widget: "list" - allow_add: false - default: ['html', 'json', 'rss'] - - label: "home" - name: home - widget: "list" - allow_add: false - default: ['html', 'json', 'rss'] + # REQUIRED BUT HIDDEN + - label: 'theme' + name: 'theme' + widget: 'hidden' + default: 'cstate' + - label: 'preserveTaxonomyNames' + name: 'preserveTaxonomyNames' + widget: 'hidden' + default: 'true' + - label: "taxonomies" + name: taxonomies + widget: "hidden" + fields: + - {label: "affected", name: "affected", widget: "hidden", default: "affected"} + - label: "Outputs (Do not touch!)" + name: outputs + widget: "hidden" + fields: + - label: "page" + name: page + widget: "list" + allow_add: false + default: ['html', 'json'] + - label: "section" + name: section + widget: "list" + allow_add: false + default: ['html', 'json', 'rss'] + - label: "home" + name: home + widget: "list" + allow_add: false + default: ['html', 'json', 'rss', 'svg'] + - label: "term" + name: term + widget: "list" + allow_add: false + default: ['html', 'json', 'rss'] + - label: "Output formats (Do not touch!)" + name: outputFormats + widget: "hidden" + fields: + - label: "svg" + name: svg + fields: + - label: "isPlainText" + name: isPlainText + widget: "boolean" + default: true + - label: "mediaType" + name: mediaType + default: "image/svg+xml" + - label: 'Enable Git info' + name: 'enableGitInfo' + widget: 'hidden' + hint: 'Docs: https://github.com/cstate/cstate/wiki/Customization#time' + required: false + default: true
\ No newline at end of file diff --git a/static/admin/index.html b/static/admin/index.html index 3071a98..00bc051 100644 --- a/static/admin/index.html +++ b/static/admin/index.html @@ -14,7 +14,7 @@ /admin/ directory. --> - <script>console.log('You are using cState. The version can be looked at from the console on the homepage or incidents view.+ https://github.com/cstate')</script> + <script>console.log('You are using cState. The version can be looked at from the console on the homepage or incidents view. https://github.com/cstate')</script> <script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script> <script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script> <script> |