Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Weather Page more useful for Network Monitoring [2/2] #6

Merged
merged 30 commits into from
May 31, 2018

Conversation

raleighlittles
Copy link
Contributor

This PR addresses the remaining tasks from the story that were not addressed in the 1st pull request, the main features being:

  1. Now displays number of sites opened/closed/unknown in the sidebar along with each's site basic status (Y, N, or '?' for unknown).

  2. Adjusted the labeling for closure thresholds to distinguish between minimum value thresholds or maximum value thresholds.

  3. Removed node-sass package, which according to npm, had the vulnerable package 'hoek' in its dependency tree.

  4. Now shows the times the site was closed on its "Ok to Open" plot, and hovering over the closed section shows a tool-tip which tells you why the site was closed.

  5. Added a 14-day option.

Raleigh Littles added 18 commits May 18, 2018 15:21
…n issue with the asynchronous calback nature of JS
…nnect dots so that theres no gaps in charts, added min/max coloring for thresholds
…ge had a vulnerable package in its dependency tree
@markBowman
Copy link

The client fails to build for me:

ERROR in /node_modules/css-loader!/node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-3a24dfec","scoped":false,"hasInlineConfig":false}!/node_modules/sass-loader/lib/loader.js!/node_modules/vue-loader/lib/selector.js?type=styles&index=0!/src/App.vue
Module build failed: Error: Cannot find module 'node-sass'

@raleighlittles
Copy link
Contributor Author

@markBowman My apologies, it worked when I tested it locally (using NPM) and I assumed that meant it would be okay when built with Docker.

I tested it just now with docker and was able to build and run successfully:

[[email protected] client]$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                NAMES
265509512d6f        weatherclient       "node /srv/weather..."   About a minute ago   Up About a minute   0.0.0.0:80->80/tcp   serene_lumiere
c71907a58ac0        weatherserver       "go-wrapper run"         About a minute ago   Up About a minute   80/tcp               tender_dijkstra

The weird issue that I'm encountering now is that Docker is still showing that we have a security vulnerability in our dependency tree, even though NPM shows that I'm using the latest version of the package that's that vulnerability.
Running $ npm ls hoekgives me:

[email protected] /home/rlittles/git_projects/weather/client
└─┬ [email protected]
  └── [email protected] 

but during the Docker image build step, it still gives the vulnerability error:

npm WARN notice [SECURITY] hoek has 1 moderate vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=hoek&version=2.16.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.

You can see that earlier, NPM is reporting that its only the safe version of hoek (5.0.3) is installed, so there appears to be some conflicting info here.

@markBowman
Copy link

Air Temperature threshold is a minimum, so should be green in the new way of displaying thresholds

@markBowman
Copy link

TFN open state is showing as unknown but it is open. What causes this?

@raleighlittles
Copy link
Contributor Author

@Fingel @markBowman To add on to the security vulnerability issue, it looks like we've reached an impasse: the node-sass package (https://www.npmjs.com/package/node-sass) that we use is requiring an older version of the request package, which has the unsafe package in its dependecy tree.

[[email protected] client]$ npm ls hoek
[email protected] /home/rlittles/git_projects/weather/client
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]  deduped
│ ├── [email protected] 
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ ├─┬ [email protected]
│   │ │ └── [email protected]  deduped
│   │ └── [email protected] 
│   └── [email protected]  deduped
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      ├─┬ [email protected]
      │ └── [email protected]  deduped
      ├── [email protected] 
      └─┬ [email protected]
        └── [email protected]  deduped

Someone opened an issue on the node-sass project a while ago (see: sass/node-sass#2355) but its still open. I tried reverting to an older version of node-sass (4.7.1) but this had an issue building on my system (see: nodejs/node-gyp#1217). Not quite sure what to do here.

Copy link
Contributor

@Fingel Fingel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few things to look at.

@@ -1,14 +1,14 @@
<template>
<div id="app">
<section class="section">
<div class="container">
<div class="container is-fluid is-marginless">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove is-marginless? The page is much easier to read with a bit of a margin.

</div>
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading">Pressure mbar</p>
<p class="title">{{ datums['Weather Barometric Pressure Value'].data | latestVal }}</p>
<p class="title">{{ this.$options.filters.latestResult(datums['Weather Barometric Pressure Value'].data, 'Value') }}</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is a filter, it should be used as a filter, like this: {{ datums['Weather Barometric Pressure Value'] | latestResult }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duly noted. VueJS shows that the two syntaxes are equivalent so I didn't think it mattered which was used; but its fixed in the latest commit.

{
enabled: true,
position: 'left',
content: (this.limit_direction === 'min') ? 'minimum' : '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label is super distracting, I think it would be a lot better as a legend.

Copy link
Contributor Author

@raleighlittles raleighlittles May 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite think this is supported by the plugin that we use. ChartJS obviously has legends,(https://www.chartjs.org/docs/latest/configuration/legend.html) but I don't see any support for legends in the ChartJS annotation plugin -- the only way I see to mark an annotation is through labels, which is what I'm using now. I can control the location of the label within the plot but thats about it. What I could maybe try doing is only showing the annotation label if you hover over the chart? That could make the chart less busy on first glance but still present the information if needed.

}
else {
var last_val = resp[resp.length - 1].ValueString;
var last_letter = this.$options.filters.statusMsgToLetter(last_val);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filters are only meant to be used in templates. If this is just a helper method, no need to place it in filters. Use a computed or normal method instead.

Copy link
Contributor Author

@raleighlittles raleighlittles May 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, the global filter was removed and code was moved to methods() section.

Raleigh Littles added 3 commits May 29, 2018 16:06
…unction, changed syntax used for filter in Site template, removed the filters js file since no global filters are used anymore
… offset for labels so that they dont show up off screen
@raleighlittles
Copy link
Contributor Author

@Fingel @markBowman The changes requested are up, but with regards to the label as a legend, I couldn't quite find a way to display the label as a legend. My approach now was to hide the label, and instead let the user click on the threshold line to toggle the label (minimum or maximum). I originally wanted to use the mouseover/mouseleave events (so you when you hover over the plot it shows up, and when you leave it goes away) but the plugin we used appears to have issues with events (chartjs/chartjs-plugin-annotation#88) so I couldn't quite get that working.

I also added some text below the first plot to tell the user about the functionality -- see:

screenshot from 2018-05-29 17-50-08

Let me know what you think.

…ed a bit of spacing between the menu list and the site open/closed counts
@Fingel
Copy link
Contributor

Fingel commented May 31, 2018

Looks good!

@markBowman
Copy link

The legend to the Sky transparency minimum green line has a value of 0 even though the line is at 25%

@markBowman
Copy link

OPINION: I would lose the Minimum/Maximum legend from the left side panel because it is not obvious it applies to the plots. You could put it at the very bottom of the main panel under all the plots.

@markBowman
Copy link

We're getting into the real nitty-gritty of things you weren't asked to do but....

  • "current values" should be bold (maybe) to make it clear it is a section label
  • The time period title (e.g. "LAST 24 Hours") is also hard to pick out. Possibly add some space or line separation from the current values. You could also move the Time range picker to here rather than duplicating the information.

@markBowman
Copy link

If I increase the size of my browser window the graph scale to take advantage but if I shrink it again they do not get smaller so the right side is out of view.

@markBowman markBowman closed this May 31, 2018
@markBowman
Copy link

Sorry, didn't mean to hit close.

The green and yellow widgets with number of open and closed sites are clickable buttons with no obvious behavior.

@markBowman markBowman reopened this May 31, 2018
Copy link

@markBowman markBowman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good. Impressive work.

…lue in label since it was incorrect for sky transparency threshold; changed X/Y open/closed buttons to tags so that they cant be clicked; increased size of current values heading and timerange setting heading
@raleighlittles
Copy link
Contributor Author

@markBowman @Fingel Thanks for the feedback. The latest commit has the following changes.

  • Increased size of "Current Values" heading
  • Increased size of "Last " heading
  • Moved legend from sidebar to underneath all plots
  • Changed buttons to tags so that they're not clickable but still look the same
  • Removed the minimum/maximum value display from the plot annotation -- I'm not sure why the values weren't working for the Sky Transparency closure, since they worked fine for all the other plots. This wasn't defined in the scope of the story anyways, and I don't think being able to tell the exact value of the threshold is a huge deal, as you can easily discern what the threshold is with relatively good accuracy (i.e. do we really need to tell if the threshold is at 25 and not 22.5, etc.)

Regarding the issue about page resizing, you have to refresh the page if you change the size of the window in the x direction -- the existing version of the LCO Weather page has similar behaviour.

Below are screenshots of the changes.
screenshot from 2018-05-31 13-13-01
screenshot from 2018-05-31 13-13-20

@raleighlittles raleighlittles merged commit d42a5e7 into master May 31, 2018
@wrosing
Copy link

wrosing commented May 31, 2018 via email

@irasnyd irasnyd deleted the 156576199-visualization-improvements-2 branch May 2, 2019 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants