Coder Social home page Coder Social logo

mbrukman / kiali-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kiali/kiali-ui

0.0 1.0 0.0 5.85 MB

Frontend part of Kiali (use github.com/kiali/kiali to report issues)

Home Page: https://www.kiali.io

License: Apache License 2.0

Python 0.02% JavaScript 0.03% HTML 0.15% TypeScript 99.39% CSS 0.41%

kiali-ui's Introduction

Kiali UI

Introduction

A UI for the Kiali Istio Observability Project

Technologies

  • React.js

  • Redux

Quick Start

npm install -g yarn
yarn
yarn start

A new browser window should automatically open. But, if it doesn’t then use: http://localhost:3000

This launches a development environment that instantly reloads any changes to the browser for rapid development.

Directory Structure

  • build: Production build output

  • public: Home of index.html

  • src: Source and test code

  • src/actions: Redux actions

  • src/app: React top level component

  • src/assets: Images and other assets

  • src/config: Configuration

  • src/containers: Redux connected containers Deprecated

  • src/components: React Components

  • src/fonts: Fonts

  • src/images: Patternfly Images

  • src/pages: Top level pages and nested components

  • src/reducers: Redux reducers

  • src/services: Api services

  • src/store: Redux store definitions

  • src/types: Typescript definitions for all kinds of types

  • src/utils: Various Utilities

Developing

We use yarn as the package manager, if adding dependencies to package.json make sure you install them with yarn and commit the yarn.lock file.

Testing with Kiali

When developing, it is usual to run this application outside of kiali.

It is possible to proxy the API requests without having to push the changes to kiali. Add the proxy property to package.json with the url of kiali.

{
  "name": "kiali-ui",
  "version": "0.2.1",
  "proxy": "http://kiali-istio-system.127.0.0.1.nip.io",
  "bugs": {
...

Run yarn start and try it!

$ curl -u admin:admin http://localhost:3000/api
Namespaces: [default istio-system kube-public kube-system myproject openshift openshift-infra openshift-node]

Namespace: default Services [docker-registry kubernetes router]

Service Name: docker-registry
Service Labels:
docker-registry = default
Type: ClusterIP
...
Warning
The proxy will only serve requests without the text/html accept header, using the browser directly won’t work.

Styling

PatternFly is the main UI components framework. It defines style based on SASS preprocessor. All Patternfly build assets are copied to src. Any React component may have its related SCSS file (such as App.scss - this one includes all PatternFly Sass along with PatternFly React Sass extensions). Once Sass compiles, the resulting CSS can be found next to its SCSS counterpart (ex: src/app/App.css).

To compile CSS, run:

yarn build-css

Note: Only static assets which are import 'ed into your application will be included in your resulting build output.

RCUE Styling

To use the RCUE styled css instead of normal Patternfly

For development run:

env REACT_APP_RCUE=true yarn start

For production build run:

env REACT_APP_RCUE=true yarn build

Style Code Guide

Testing

To run the tests, the standard command yarn test is valid, but since some tests are using snapshots the preferred command is to update them in the same time:

yarn test -u

Then hit a to run all tests.

After running the tests, if any snapshot has been modified (check git status), the diff should be reviewed to make sure it’s an intentional or trivial change. Modified snapshots must be part of the commit so that they’re reviewed collectively and won’t make CI build fail.

Note: for OS/X users testing requires watchman to be installed

brew install watchman

Testing Libraries for Vulnerabilities

We use Snyk for JS vulnerability testing. Snyke will run automatically on every commit pushed to kiali-ui.

If you wish to run Snyk manually to test before you push, then the following command can be used:

yarn run snyk

Production Builds

Use yarn build which will bundle the build artifacts using webpack into the build directory.

Analyze Javascript Library Size

To produce a graphical representation of the all the libraries in the project (showing what % of total each one is).

yarn build
yarn run analyze

Which will then launch a browser with your graphical source map displayed.

Configure Kiali

Use the config file to configure Kiali-UI.

Environment Variable Name Description and YAML Setting

sessionTimeOut

Time in minutes when session will expire. (default is 30 minutes)

sessionTimeOut: 30 * UNIT_TIME.MINUTE * MILLISECONDS

defaultDuration

The default duration of charts in seconds. (default is 60 seconds)

toolbar: {
  defaultDuration: 1 * UNIT_TIME.MINUTE
}

intervalDuration

The options for the duration of charts.

toolbar: {
  intervalDuration: {
    60: 'Last minute',
    300: 'Last 5 minutes',
    600: 'Last 10 minutes',
    1800: 'Last 30 minutes',
    3600: 'Last hour',
    10800: 'Last 3 hours',
    21600: 'Last 6 hours',
    43200: 'Last 12 hours',
    86400: 'Last day',
    604800: 'Last 7 days',
    2592000: 'Last 30 days'
  }
}

defaultPollInterval

Time for the refresh of the information. (default is 15 seconds)

toolbar: {
  defaultPollInterval: 15 * MILLISECONDS
}

pollInterval

The options for the refresh of the information.

toolbar: {
  pollInterval: {
    0: 'Pause',
    5000: '5 seconds',
    10000: '10 seconds',
    15000: '15 seconds',
    30000: '30 seconds',
    60000: '1 minute',
    300000: '5 minutes'
  }
}

graphLayouts

The types of layouts for graph.

toolbar: {
  graphLayouts: {
    cola: 'Cola',
    'cose-bilkent': 'Cose',
    dagre: 'Dagre'
  }
}

threshold

The threshold limits to show in the charts.

toolbar: {
  threshold: {
    percentErrorSevere: 2.0,
    percentErrorWarn: 0.1
  }
}

See the LICENSE file.

kiali-ui's People

Contributors

jotak avatar jshaughn avatar josejulio avatar mtho11 avatar lucasponce avatar israel-hdez avatar aljesusg avatar xeviknal avatar jmazzitelli avatar mwringe avatar cfcosta avatar pilhuhn avatar vnugent avatar burmanm avatar vanillaslice avatar theute avatar abonas avatar jkandasa avatar aswinmprabhu avatar clyang82 avatar hhovsepy avatar rubenvp8510 avatar simonpasquier avatar jeremyxu2010 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.