Problem/Motivation

Now that the designs are almost finalized, the data support for each component in the design needs to be setup and passed through to the front end.

User interface changes

Add a refresh timeout option onto status page configuration forms to allow expiring the cached values on the status page on a regular basis. This cached value should be a select list field as follows:

  • Label
    • Historical Data Time Limit
  • Values
    • Interval select
      • 7 days
      • 14 days
      • 30 days
      • 60 days
      • 120 days
  • Description
    • Select how far back the system should show when displaying historical incident data.

Data model changes

Make the following data structure available to the front end for use when creating the markup for the status page.

{
  "header": {
    "title": "Status Page Title",
    "menu": [
      {
        "title": "Dashboard",
        "url": "path to status page"
      },
      {
        "title": "Issues",
        "url": "path to issues page"
      }
    ],
    "status": "Healthy", // Healthy, Experiencing an issue, or experiencing downtime.
    "last_checked": "Since {date}"
  },
  "content": {
    "timeline": {
      "title": "History",
      "timespan": "Past XX days/hours/etc", // Pulled from system monitor log truncation value.
      "statuses": {
        "outage": "Downtime",
        "issue": "Issue",
        "healthy": "Healthy"
      },
      "date_span": {
        "start": "start date",
        "end": "end date"
      },
      "events": [ // Only events that are non-healthy and part of montiors that are tracked by the status page
        {
          "title": "title of issue",
          "url": "link to issue page",
          "reported_date": "last reported date",
          "resolved_date": "next OK reported date after reported outage"
        },
        {
          "title": "title of issue",
          "url": "link to issue page",
          "reported_date": "last reported date",
          "resolved_date": "next OK reported date after reported outage"
        },
        {
          "title": "title of issue",
          "url": "link to issue page",
          "reported_date": "last reported date",
          "resolved_date": "next OK reported date after reported outage"
        }
      ]
    },
    "cards": [ // monitors tracked by the status page that are active.
      {
        "title": "monitor name",
        "image": "monitor icon",
        "status": "overall status of the monitor",
        "detail": {
          "description": "description",
          "tasks": [
            {
              "title": "task name",
              "status": "task status based on system monitor status"
            },
            {
              "title": "task name",
              "status": "task status based on system monitor status"
            }
          ]
        }
      },
      {
        "title": "monitor name",
        "image": "monitor icon",
        "status": "overall status of the monitor",
        "detail": {
          "description": "description",
          "tasks": [
            {
              "title": "task name",
              "status": "task status"
            },
            {
              "title": "task name",
              "status": "task status"
            }
          ]
        }
      }
    ],
    "history": {
      "title": "Issue History",
      "issues": [
        {
          "title": "title",
          "description": "description",
          "status": "Resolved",
          "date": "last updated date",
          "url": "link to issue page"
        },
        {
          "title": "title",
          "description": "description",
          "status": "Resolved",
          "date": "last updated date",
          "url": "link to issue page"
        }
      ],
      "url": "link to issue history page"
    }
  },
  "footer": {
    "logo": "path to logo",
    "menu": [
      {
        "title": "link title",
        "url": "path to link"
      },
      {
        "title": "link title",
        "url": "path to link"
      }
    ],
    "copyright": "copyright text" // Appended like so: "Copyright (c) {auto_year} {copyright}
  }
}

Comments

merauluka created an issue. See original summary.

merauluka’s picture

Issue tags: +GlobalContributionWeekend2020, +ContributionWeekend2020

Adding Contribution Weekend tags.

c-logemann’s picture

Issue tags: -GlobalContributionWeekend2020

"ContributionWeekend2020“ is the "official" tag suggested on global event page.

merauluka’s picture

Issue summary: View changes

I am updating the original ticket description. The refresh interval allowed too narrow a window to provide meaningful timelines for the status page.

merauluka’s picture

Attached is the first patch for this work. It adds basic css simply to help show if the data is structured correctly. It will require additional UX work that will be covered in #3083707: Implement Status Page UX.

Diff in Gitlab
https://git.drupalcode.org/project/system_monitor/compare/8.x-1.x...task...

merauluka’s picture

Status: Active » Needs review

Switching to "Needs review" to kick off testing.

merauluka’s picture

Linking UX ticket.

merauluka’s picture

StatusFileSize
new247.54 KB

Updated a commented out section of code that was bypassing state.

merauluka’s picture

Below are basic testing instruction to guide review of the given patch.

Testing instructions for the given patch:

If you already have this module installed, you will need to uninstall and reinstall it to incorporate the given changes.

  • Run: drush cex -y
  • Run: drush pm-uninstall system_monitor -y
  • Run: drush en sm_status_page -y
    • If you have the example module installed, you will need to reinstall it at this time.
  • Run: drush cim -y
  • Visit /admin/config/system/system-monitor/status-page and create a status page if necessary.
  • Generate log files using the example module's drush command: drush smt-gen-logs
  • Visit your status page and note that the error logs generate a timeline, the active system monitors are shown in the middle and if they are reporting an error status, then the header shows that the site is "experiencing an issue".
merauluka’s picture

StatusFileSize
new247.62 KB

A final update for the issue listing that allows showing a Resolved status.

robpowell’s picture

StatusFileSize
new207.92 KB

Followed steps as stated above, status page looks gorgeous. Two nitpicks:

* History view doesn't show downtime/issues
* Have a broken image in the section below image history

<img src="/modules/contrib/system_monitor/assets/images/icons/">

merauluka’s picture

StatusFileSize
new248.86 KB

@robpowell The broken image looks like it's due to the update I made on the system monitor entity form. There's an icon selector now that you can use to select an icon for the section below the history. This icon is required on the form so newly created (or updated) monitors will have the icon.

The downtime/issues hover effect will be added later in the UX ticket. I only added enough markup so we could verify the data that was coming over from the logs.

I also realized I forgot to wire up the footer logo option. It was added to the status page entity type, but not the form. So I added that and passed it through to the status page on the front end.

merauluka’s picture

StatusFileSize
new248.68 KB

A new patch to remove a pesky .DS_Store that made it into the code.

merauluka’s picture

StatusFileSize
new848.3 KB

Updating the patch to handle binary files.

merauluka’s picture

StatusFileSize
new249.94 KB

Update icon paths in system monitor that were broken in last patch.

merauluka’s picture

StatusFileSize
new247.73 KB

Remove binary PNG files in icon library that aren't necessary for the system.

merauluka’s picture

StatusFileSize
new251.4 KB

I updated the patch to resolve php coding standards issues.

robpowell’s picture

I reviewed the commits since the last time I reviewed the branch locally and this looks great. I think we are good to merge in and trust the passed tests. Great work.

robpowell’s picture

Status: Needs review » Reviewed & tested by the community
merauluka’s picture

Status: Reviewed & tested by the community » Fixed

Merged! Thanks!

  • merauluka committed 0a68c44 on 8.x-1.x
    Issue #3105815 by merauluka, robpowell: Build backend data support for...

  • merauluka committed 74a17ad on 9.x-1.x
    Issue #3105815 by merauluka, robpowell: Build backend data support for...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.