Commit Graph

296 Commits

Author SHA1 Message Date
Ali Ariff 3505c913d8
Add spacing in CallToAction banner (#4095)
* Add spacing in CallToAction banner

The call to action banner  in control plane page is missing some spacing.

The CSS is defined but not yet used. So the solution is to add the class name to the corresponding banner.

After its merged the banner will have more space.

Fixes #3690

* Remove unused css

Signed-off-by: Ali Ariff <ali.ariff12@gmail.com>
2020-02-26 19:53:26 -08:00
Christy Jacob f46f372e08
Refactoring to suppress eslint warnings jsx-a11y/click-events-have-key-events (#3995)
* Refactoring to suppress eslint warnings

Upon enabling jsx-a11y/click-events-have-key-events flag in .eslintrc , a couple of warnings are raised because it is recommended
to provide a onKeyPress, onKeyDown or onKeyUp event handler for every onClick event handler.

The code has been refactored to follow the eslint spec.

Fixes #3926

Signed-off-by: Christy Jacob <christyjacob4@gmail.com>

* Remove jsx-a11y/click-events-have-key-events flag from eslintrc

	* During the review it was reuqested to remove the flag
	* The requested change has been done
2020-02-11 09:28:02 -08:00
Kohsheen Tiku 21f1d85c80
Refactoring to suppress eslint warnings (#3996)
* Refactoring to suppress eslint warnings

Enabling the eslint/no-param-reassign throws some warnings with the existing code.

Made necessary changes to suppress the warnings

Fixes #3927

Signed-off-by: Kohsheen Tiku <kohsheen.t@gmail.com>

* Refactoring to suppress eslint warnings

Enabling the eslint/no-param-reassign throws some warnings with the existing code.

Made necessary changes to suppress the warnings

Fixes #3927

Signed-off-by: Kohsheen Tiku <kohsheen.t@gmail.com>

* Enabling the eslint/no-param-reassign throws some warnings with the existing code.

Made necessary changes to suppress the warnings

Fixes #3927

Signed-off-by: Kohsheen Tiku <kohsheen.t@gmail.com>

* Enabling the eslint/no-param-reassign throws some warnings with the existing code.

Made necessary changes to suppress the warnings

Fixes #3927

Signed-off-by: Kohsheen Tiku <kohsheen.t@gmail.com>

* Enabling the eslint/no-param-reassign throws some warnings with the existing code.

Made necessary changes to suppress the warnings

Fixes #3927

Signed-off-by: Kohsheen Tiku <kohsheen.t@gmail.com>

* Enabling the eslint/no-param-reassign throws some warnings with the existing code.

Made necessary changes to suppress the warnings

Fixes #3927

Signed-off-by: Kohsheen Tiku <kohsheen.t@gmail.com>

* Enabling the eslint/no-param-reassign throws some warnings with the existing code.

Made necessary changes to suppress the warnings

Fixes #3927

Signed-off-by: Kohsheen Tiku <kohsheen.t@gmail.com>

* Enabling the eslint/no-param-reassign throws some warnings with the existing code.

Made necessary changes to suppress the warnings

Fixes #3927

Signed-off-by: Kohsheen Tiku <kohsheen.t@gmail.com>

* Enabling the eslint/no-param-reassign throws some warnings with the existing code.

Made necessary changes to suppress the warnings

Fixes #3927

Signed-off-by: Kohsheen Tiku <kohsheen.t@gmail.com>

* Enabling the eslint/no-param-reassign throws some warnings with the existing code.

Made necessary changes to suppress the warnings

Fixes #3927

Signed-off-by: Kohsheen Tiku <kohsheen.t@gmail.com>
2020-02-11 10:12:00 -05:00
Christy Jacob 15b1e46b4f
Refactoring to suppress eslint warnings react/no-did-update-set-state flag (#3974)
* Refactoring to suppress eslint warnings

Upon enabling react/no-did-update-set-state flag in .eslintrc , a couple of warnings are raised because it is a bad practice to use the setState() function within the componentDidUpdate() hook.

The code has been refactored to follow the eslint spec.

During the code review, it was pointed out that the react/no-did-update-set-state is enabled by default and can be removed from .eslintrc

The flag was removed from .eslintrc

Fixes #3928

Signed-off-by: Christy Jacob <christyjacob4@gmail.com>
2020-01-30 17:34:07 -08:00
Kevin Lingerfelt fed1eede8c
Enable no-use-before-define eslint rule (#3925)
This is a follow-up to #3882, which adopted a bunch of new linting rules
in our Javascript codebase. The no-use-before-define rule requires
moving some functions around, so I'm doing it in a separate branch.

Note that I was originally going to also enable the react/sort-comp rule
as part of this branch, but I decided that the sort ordering doesn't
work for our codebase.

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2020-01-17 14:29:54 -08:00
Kevin Lingerfelt 1ce6efaecf
Adopt more common Javascript linting conventions (#3882)
The current set of Javascript linting rules that we're using in this
project is outdated, and it has lead to a variety of competing styles
in the Javascript codebase.

Update the project's linting rules to match those provided by the latest
release of eslint-config-airbnb, but disable a bunch of rules that
aren't compatible with this project.

I've split this change into two commits. The first commit contains the
manual changes that I made to satisfy the new rules, and the second
commit contains all of the whitespace, quoting and commas changes that
were fixed automatically by eslint.

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2020-01-08 15:01:16 -08:00
Sergio C. Arteaga 36478312b2 Reduce unnecessary data requests for pod detail pages (#3768)
This PR restructures how the the array of apiRequests are constructed in the
`ResourceDetail` component to reduce unnecessary data requests. In the case of a
Pod detail page, we will no longer query the API for a list of pods in a
namespace, or request metrics for those pods, which we do for all other resource
detail pages.

Signed-off-by: Sergio Castaño Arteaga <tegioz@icloud.com>
2019-12-20 13:02:24 -08:00
Sergio C. Arteaga 7886938f4f Classify some gRPC status codes as non-errors (#3736)
Signed-off-by: Sergio Castaño Arteaga <tegioz@icloud.com>
2019-12-19 15:22:43 -05:00
Carol A. Scott 33b3544874
Updating the namespace change button with the Autocomplete MUI component (#3850)
* Updating the namespace change button with the Autocomplete MUI component

* Cintia feedback
2019-12-19 09:16:10 -08:00
Cynthia S. Garcia bd77dde63e Fix dense mode for MUI Table (#3844)
Deletes dense mode from padding prop in Octopus.jsx file to satisfy
Material-UI requirements.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-19 07:43:16 -08:00
Cynthia S. Garcia 609618424d Fix spacing unit to new MUI v4 format (#3841)
Replaces theme.spacing.unit in the TapQueryForm component, which is deprecated, 
with theme.spacing(1), as part of the upgrade to Material-UI v4.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-17 15:57:16 -08:00
Cynthia S. Garcia f55b2f4e38 Pause dashboard network activity when page is hidden (#3773)
This PR pauses the network activity when the dashboard is not visible, resuming
it as soon as the user goes back to it. To do that, we are using the
react-page-visibility library.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-17 15:34:18 -08:00
Cynthia S. Garcia 5eac50f62b Update dashboard to Material-UI 4.7.1 (#3710)
This PR updates Material-UI from v3.6.1 to v4.7.1. The Material-UI
icon library has also been updated from v3.0.1 to v4.5.1.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-17 13:04:26 -08:00
Carol A. Scott 43c394aa97
Pluralize dashboard breadcrumbs if appropriate (#3832)
Closes #3483.

This PR refactors and simplifies breadcrumb text pluralization. The redesigned
dashboard added a view that shows the user a list of all pods, deployments, etc.
in a namespace. The breadcrumb navigation text needed to be tweaked to correctly
pluralize the resource type selected.
2019-12-16 16:31:45 -08:00
Cynthia S. Garcia aec0f6b6df Fix issue with Community iframe height in dashboard (#3834)
Closes #3764.

This PR fixes an issue where the dashboard would cut off the bottom of the
Community Updates posts (displayed in an iframe) if the browser height was
shorter than the height of the iframe. Related to [#605 in the linkerd website
repo](https://github.com/linkerd/website/pull/605).

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-16 16:11:44 -08:00
Cynthia S. Garcia 9bda237ce3 Fix issue with grid for Tap/Top form (#3783)
Closes #3778. 

Fixes a formatting issue in the dashboard Tap/Top form where if a longer 
resource name was selected, the placement of the buttons was off.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-16 10:06:57 -08:00
Cynthia S. Garcia 2e1bde9ce1 Add some unit tests for namespace select button (#3782)
Adds unit tests for namespace select button in the dashboard.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-16 10:04:01 -08:00
Cynthia S. Garcia 0d93fd2a3b Update enzyme-adapter-react-16 library (#3820)
This PR updates enzyme-adapter-react-16 in preparation for Material UI upgrading
(#3710)

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-13 15:48:08 -08:00
Sergio C. Arteaga cee8e3d0ae Add CronJobs and ReplicaSets to dashboard and CLI (#3687)
This PR adds support for CronJobs and ReplicaSets to `linkerd inject`, the web
dashboard and CLI. It adds a new Grafana dashboard for each kind of resource. 

Closes #3614 
Closes #3630 
Closes #3584 
Closes #3585

Signed-off-by: Sergio Castaño Arteaga tegioz@icloud.com
Signed-off-by: Cintia Sanchez Garcia cynthiasg@icloud.com
2019-12-11 10:02:37 -08:00
Cynthia S. Garcia cda0f8dd15 Fix dashboard unit test warning (#3793)
This PR fixes a dashboard unit test added in #3666 that was passing, but
returning a warning.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-11 09:38:55 -08:00
Cynthia S. Garcia a36fee66e4 Fix Octopus graph styling in dashboard (#3698)
This PR fixes issues with Octopus graph line styling in the dashboard, and improves 
the UI of the collapsed neighbors display.

Closes #3577

Signed-off-by: Cintia Sanchez Garcia cynthiasg@icloud.com
2019-12-05 11:39:57 -08:00
Cynthia S. Garcia a564609ed5 Update dashboard to React 16.11.0 (#3737)
This PR updates `react` and `react-dom` to version 16.11.0, and `react-router`
and `react-router-dom` to version 5.1.2.

The following breaking changes have been fixed as part of the upgrade:

- Change deprecated `componentWillUpdate` to `componentDidUpdate` 
- Replace`react-url-query` library with `use-query-params` (a Hook) due 
to the deprecation of some React lifecycle methods. This required some 
changes in the Tap, Top, TapQueryForm and TopRoutes components.

Fixes #3617

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-12-04 10:10:56 -08:00
Sergio C. Arteaga 78ed5f8883 Make resource definition available to dashboard (#3666)
This PR allows the dashboard to query for a resource's definition in YAML
format, if the boolean `queryForDefinition` in the `ResourceDetail` component is
set to true. 

This change to the web API and the dashboard component was made for a future
redesigned dashboard detail page. At present, `queryForDefinition` is set to
false and there is no visible change to the user with this PR. 

Signed-off-by: Sergio Castaño Arteaga <tegioz@icloud.com> Signed-off-by: Cintia
Sanchez Garcia <cynthiasg@icloud.com>
2019-12-03 10:25:20 -08:00
Cynthia S. Garcia 62c254df13 Fix issue with EdgesTable Grid wrapper (#3740)
This PR fixes a table wrap issue in the dashboard resource detail view that was
making sidebar font size inconsistent.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-11-26 09:22:34 -08:00
Cynthia S. Garcia 65d5778b93 Stop using react-iframe library in dashboard (#3695)
This PR removes a JS dependency for the Community iFrame page.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-11-25 11:29:05 -08:00
Cynthia S. Garcia 6ed7a6ce54 Fix issue with check button in dashboard (#3723)
This PR fixes a positioning issue in the `linkerd check` button in the 
dashboard. 

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-11-16 20:24:48 -08:00
Cynthia S. Garcia 18eb984fd5 Display tap headers in dashboard (#3663)
Closes #3612. This PR adds tap headers to the dashboard. Headers are displayed
when the user clicks on the "expand view" icon of each tap row.

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-11-12 13:48:12 -08:00
Sergio C. Arteaga eff1714a08 Add `linkerd check` to dashboard (#3656)
`linkerd check` can now be run from the dashboard in the `/controlplane` view.
Once the check results are received, they are displayed in a modal in a similar
style to the CLI output.

Closes #3613
2019-11-12 12:37:36 -08:00
Carol A. Scott 825ad51bca
Add filter to namespace select button (#3667)
Fixes #3610

Adds a text input to the namespace selection button of the dashboard to allow users to filter the list of namespaces.
2019-11-06 16:13:31 -08:00
Cynthia S. Garcia 2a515921cb Improve how empty tables are displayed in dashboard (#3664)
Adds an `EmptyCard` component to be displayed when a table has no data. 

Signed-off-by: Cintia Sanchez Garcia <cynthiasg@icloud.com>
2019-11-05 14:07:09 -08:00
Alejandro Pedraza d3d8266c63
If tap source IP matches many running pods then only show the IP (#3513)
* If tap source IP matches many running pods then only show the IP

When an unmeshed source ip matched more than one running pod, tap was
showing the names for all those pods, even though the didn't necessary
originate the connection. This could be reproduced when using pod
network add-on such as Calico.

With this change, if a node matches, return it, otherwise we proceed to look for a matching pod. If exactly one running pod matches we return it. Otherwise we return just the IP.

Fixes #3103
2019-10-25 12:38:11 -05:00
Carol A. Scott 941fa3a6ed
Responsive dashboard sidebar behavior and refactoring Navigation component (#3547)
This PR improves the dashboard sidebar behavior for mobile, tablet and desktop
views, refactors the Navigation component, and changes navbar color to the color
of the linkerd.io website.
2019-10-18 10:14:47 -07:00
Carol A. Scott 9d18de5e62
Dashboard sidebar redesign (#3467)
This PR fixes #3400 and redesigns the dashboard to minimize load on Prometheus.
2019-09-25 16:54:11 -07:00
pierDipi 88de719233 Fix bad request in the top routes tab on empty fields (#3432)
This PR disables the `Start` button in the dashboard's top routes view if there
is no namespace or resource type selected. 

Previously, clicking `Start` on the top routes tab with empty namespace and
resource fields would result in a bad request error. 

Signed-off-by: pierdipi <pierangelodipilato@gmail.com>
2019-09-17 12:33:37 -07:00
Carol A. Scott a4b30b4931
Adding "external link" icons to outgoing sidebar menu items (#3371)
Fixes #2693.

Adds an "external link" icon to sidebar menu items that take you out of the dashboard.
2019-09-05 17:59:29 -07:00
Carol A. Scott 3e919692d8
Fixing row keys for edges (#3368)
This PR fixes an issue in `EdgesUtils` where some rows had duplicate keys,
leading to React console warnings.
2019-09-05 17:46:15 -07:00
Carol A. Scott d4f3f210ce
Add trafficsplit to dashboard (#3333)
Fixes #3261.

Adds trafficsplit data to the dashboard via the Resources sidebar.
2019-09-03 12:41:29 -07:00
Alejandro Pedraza 5d7499dc84
Avoid the dashboard requesting stats when not needed (#3338)
* Avoid the dashboard requesting stats when not needed

Create an alternative to `urlsForResource` called
`urlsForResourceNoStats` that makes use of the `skip_stats` parameter in
the stats API (created in #1871) that doesn't query Prometheus when not needed.

When testing using the dashboard looking at the linkerd namespace,
queries per second went down from 2874 to 2756, a 4% decrease.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-08-29 05:52:44 -05:00
Kevin Leimkuhler 5d7662fd90
Update web server to use tap APIService (#3208)
### Motivation

PR #3167 introduced the tap APIService and migrated `linkerd tap` to use it.
Subsequent PRs (#3186 and #3187) updated `linkerd top` and `linkerd profile
--tap` to use the tap APIService. This PR moves the web's Go server to now also
use the tap APIService instead of the public API. It also ensures an error
banner is shown to the user when unauthorized taps fail via `linkerd top`
command in *Overview* and *Top*, and `linkerd tap` command in *Tap*.

### Details

The majority of these changes are focused around piping through the HTTP error
that occurs and making sure the error banner generated displays the error
message explaining to view the tap RBAC docs.

`httpError` is now public (`HTTPError`) and the error message generated is short
enough to fit in a control frame (explained [here](https://github.com/linkerd/linkerd2/blob/kleimkuhler%2Fweb-tap-apiserver/web/srv/api_handlers.go#L173-L175)).

### Testing

The error we are testing for only occurs when the linkerd-web service account is
not authorzied to tap resources. Unforutnately that is not the case on Docker
For Mac (assuming that is what you use locally), so you'll need to test on a
different cluster. I chose a GKE cluster made through the GKE console--not made
through cluster-utils because it adds cluster-admin.

Checkout the branch locally and `bin/docker-build` or `ares-build` if you have
it setup. It should produce a linkerd with the version `git-04e61786`. I have
already pushed the dependent components, so you won't need to `bin/docker-push
git-04e61786`.

Install linkerd on this GKE cluster and try to run `tap` or `top` commands via
the web. You should see the following errors:

### Tap

![web-tap-unauthorized](https://user-images.githubusercontent.com/4572153/62661243-51464900-b925-11e9-907b-29d7ca3f815d.png)

### Top

![web-top-unauthorized](https://user-images.githubusercontent.com/4572153/62661308-894d8c00-b925-11e9-9498-6c9d38b371f6.png)

Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
2019-08-08 10:18:32 -07:00
Carol A. Scott a504e8c2d8
Expand and improve edges API endpoint (#3007)
Updates functionality of `linkerd edges`, including a new `--all-namespaces`
flag and returning namespace information for SRC and DST resources.
2019-06-28 15:46:04 -07:00
Carol A. Scott 210ab81fed
Improve UI for Edges table in dashboard (#2995)
This PR improves the UI for the Edges table in the dashboard, including changing column names, adding a "Secured" icon and showing an empty Edges table in the case of no returned edges.
2019-06-26 16:57:18 -07:00
Carol A. Scott dce462acd9
Add Edges table to resource detail view of dashboard (#2965)
Adds an Edges table to the resource detail view that shows the source,
destination name and identity for proxied connections to and from the resource
shown.
2019-06-20 10:50:11 -07:00
Alejandro Pedraza 928d4cb522
Remove unimplemented debug page on dashboard (#2952)
* Remove unimplemented debug page on dashboard

Fixes #2895

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-06-17 14:43:09 -05:00
Carol A. Scott 1ec9058f85
Importing specific font-awesome icons instead of the full CSS stylesheet and webfonts (#2917)
This PR allows components to import specific FontAwesome icons using the
@fortawesome/react-fontawesome library. This cuts down on package size and the
number of files loaded.
2019-06-17 11:41:44 -07:00
Risha Mars a46e69ce6e
Fix BaseTable ignoring sorting order (#2923)
I noticed that the tables weren't maintaining sort order.
This branch fixes sorting by using lodash orderBy.

Before: Look at the tables, for example in the Service Mesh page, the meshed
resource table, or in Top Routes. Note that both these tables have a default
sort order, but do not appear sorted.

After: These tables should be sorted by their default order.
2019-06-12 13:35:41 -07:00
Carol A. Scott 13f2698033
Hide Authorities table and Authorities sidebar link on dashboard (#2856)
Fixes #2103. Hides the Authorities table in the Overview and Namespace views on
the dashboard, and removes the link to Authorities in the Resources sidebar.
This change makes way for a future dashboard view incorporating traffic split
data and communicating Authority data in a more understandable way.
2019-05-29 15:38:48 -07:00
Dennis Adjei-Baah a0fa1dff59
Move tap service into its own pod. (#2773)
* Split tap into its own pod in the control plane

Signed-off-by: Dennis Adjei-Baah <dennis@buoyant.io>
2019-05-15 16:28:44 -05:00
Carol A. Scott b98ce335db
Making "overview" view of dashboard functional on mobile devices (#2678)
Makes the "overview" view of the Linkerd dashboard functional on mobile devices, with responsive tables and a minimized sidebar. 
Also lines up the sidebar icons and makes them a uniform size on both desktop and mobile views.
This is a first step towards a fully-responsive dashboard.
2019-04-11 12:00:21 -07:00
Alex Leong 98a74bccc3
Rename proxy-api to destination on debug page (#2652)
Signed-off-by: Alex Leong <alex@buoyant.io>
2019-04-10 15:06:57 -07:00
Alejandro Pedraza edb225069c
Add validation webhook for service profiles (#2623)
Add validation webhook for service profiles

Fixes #2075

Todo in a follow-up PRs: remove the SP check from the CLI check.

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
2019-04-05 16:10:47 -05:00