Giter VIP home page Giter VIP logo

ops-frontend's Introduction

Introduction

This package contains code for the frontend of the TinyStacks OpsConsole project. If you are looking for a quick way to run the OpsConsole, please look at the Ops CLI for installation and usage instructions.

Usage

npm i;
npm run dev;

In order for this to work, you need to have the API running locally on port 8000.

Architecture

Frameworks

This frontend package is built on React, Redux, and Next.js. It uses component libraries from Chakra and rsuite.

Data flow

After launching the Ops Console Frontend and navigating to any root path, the GetConsoles api is requested. This returns a Console object that includes providers, dependencies, widgets, dahboards, and console details.

Paths

There are 2 main paths:

  1. /: This route uses the requested console to list all available dashboards as links.
  2. /[dashboard-route]: This route fetches all widgets and renders them in a dashboard view.

Widget data flow

When a /[dashboard-route] request is made, a few things happen with regards to widgets

  1. A full widget render tree is created. This includes widgets directly and transitively referenced by the selected dashboard
  2. The getWidget API is recursively requested for each widget in the render tree, leaf-widgets-first. Ops-API processes these requests by calling getData on each widget and returning a serialized populated widget object to the frontend
  3. The frontend deserializes each widget by calling Widget.fromJson.
  4. Each widget's render function is invoked and layed out according to the dashboard. Note that only widgets directly and trasitively referenced by the selected dashboard are requested and rendered. Other widgets will not call getData until they are in context of a requested dashboard

How it works with the API

Please see the README.md in ops-core.

Plugins

For an overview of plugins, please see PLUGINS.md in ops-core.

Developing plugins

Please see DEVELOPING_PLUGINS.md in ops-core.

ops-frontend's People

Contributors

zsimjee avatar calebcourier avatar nefertitirogers avatar akedia23 avatar dependabot[bot] avatar

Stargazers

Tim Kersey avatar

Watchers

 avatar  avatar  avatar

Forkers

akedia23

ops-frontend's Issues

API infinite retry

When the API request for /console fails, the frontend infinitely retries. We need to limit that retry to 3 requests and then show an error.

Better handling for JSON schema composition of complex types

Currently for any union or intersection keyword (allOf, anyOf, oneOf), we just spread the properties onto a single composite schema to prompt the user for input.

This approach is incorrect, particularly for oneOf.
Instead of spreading oneOf, we should present the subSchemas under it as variants that the user can choose from.

We may eventually need more nuanced handling of allOf and anyOf as well, but those lend themselves to a naive approach (spreading) more easily than oneOf because prompting the user for all sub-schema properties can be correct for those union types.

Originally posted by @zsimjee in #38 (comment)

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.