Git Product home page Git Product logo

grafana-schedule-panel's People

Contributors

raibnod avatar sanjevshakya avatar zero88 avatar

Watchers

 avatar  avatar  avatar

grafana-schedule-panel's Issues

Fix: Event schema

See the schema:

{
  "yearly": {
    "eae5e0c1-a5fd-4b93-8d4c-8af0355cead5": {
      "id": "eae5e0c1-a5fd-4b93-8d4c-8af0355cead5",
      "name": "Test",
      "color": "",
      "date": "01-02",
      "value": 30
    },
    "e2ced422-001e-497a-bb51-777f591d7a96": {
      "id": "e2ced422-001e-497a-bb51-777f591d7a96",
      "name": "Test",
      "color": "#6e4545",
      "date": "03-03",
      "value": 33
    }
  },
  "weekly": {
    "fe94fbc4-56a5-40f4-a3d2-3ffe3499341d": {
      "name": "Test",
      "days": [
        "saturday"
      ],
      "start": "18:15",
      "end": "19:15",
      "value": 27,
      "color": "#5c4444"
    }
  },
  "events": {
    "57fc351b-7816-4cb7-8fdc-e79b9a7423d6": {
      "name": "Test1",
      "dates": [
        {
          "start": "2021-03-02T03:31",
          "end": "2021-03-02T04:31"
        }
      ],
      "eventNames": [
        {
          
        }
      ],
      "inputDates": [
        {
          "start": "2021-03-02T09:16",
          "end": "2021-03-02T10:16"
        }
      ],
      "value": 22,
      "color": "#682323"
    }
  }
}

Here, on events we have keys eventNames and inputDates which is not suppose to be there. Use dates instead of inputDates as before.

Add `Default Value` input to schedule options

We need a Default Value field (set in schedule options). This Default Value should be the default when a new weekly or event schedule is created (currently it goes to the minimum value).

image

Schedule Panel Improvements

  1. Holiday should no longer be used, it should be called Exception
  2. Exception creator popup should have ability to select dates and TIMES for the exception period. THE UI POPUP FOR Event and Exception SHOULD BE THE SAME (just a different title).
  3. Payload/Value selector should be disabled from settings (like Weekly and Event already are).

Exception popup should look like this:
image

image

Replace value with new JSON, if value is invalid

For example: on a schedule topic we inserted a random value ('23.2') and then we try to insert new schedule value. It shows error with following details:

Warning: An unhandled error was caught from submitForm() TypeError: Cannot create property 'weekly' on number '23.2'

  const handleModalSubmit = (event: Weekly | Event, id: string) => {
    let output: RawData = _cloneDeep(value) || {};
    if (isWeekly) {
      if (!output.weekly) {
        output['weekly'] = {};
      }
      output.weekly[id] = event;
    } else {
      if (!output.events) {
        output['events'] = {};
      }
      output.events[id] = event;
    }
    syncOnMqttServer(JSON.stringify(output));
  };

Add `Payload Title` to settings

Currently when the user creates schedule the payload field is called Value. We need to add an extra setting field where the title of the payload can be changed. The default payload title should be Value but change to the text from the new Payload Title settings field.

image

Schedule JSON is invalid!!

Please update schedule json MQTT payload to use " instead of '. Currently parsing the Schedule JSON is JS produces the following error SyntaxError: Unexpected token ' in JSON at position 1

Schedule JSON > Events > Dates > Start/End `Z` on timestamp string has been dropped

Old Schedule JSON: (note that the start/end timestamp strings have Z at the end)

events:
   25308195-6005-49fb-a648-031ea925b9e7: 
      color: "#4a90e2"
      name: "Test run"
      dates: 
         0:
            start: "2020-11-25T17:00:00.000Z"
            end: "2020-11-25T20:00:00.000Z"
      id: "25308195-6005-49fb-a648-031ea925b9e7"
      value: 12

New Schedule JSON:

events: 
   02374294-028b-47ce-af5e-17869ee1d760:
      name: "TRAINING"
      dates: 
         0:
            start: "2021-06-24T22:00"
            end: "2021-06-24T23:00"
      value: 10
      color: "#4a90e2"

Critical Schedule Improvements

Schedule Name Select:
The field currently called 'title' should be called 'Schedule Name'. Options should be selected from a dropdown. The dropdown items should be defined in settings. (This is the same as in the old dashboard schedule widget).

Interface when creating Schedule Events:
image

Schedule Settings:
image

Add 'Weekday' and 'Everyday' options to weely day select

Currently to add a schedule that runs everyday it takes significant time to select each day. Can we please add 2 additional options:
Weekdays - This option would add Monday Tuesday Wednesday Thursday and Friday
Everyday - This option would add Monday Tuesday Wednesday Thursday Friday Saturday and Sunday

image

Schedule Name Selector

The Schedule Name selector currently allows the dashboard user to add Schedule Names. This should not be possible.

The Schedule Names should be configured only from the grafana panel edit menu. Within the edit menu, there should be a field to add to a list of pre-defined Schedule Names. The user should only be able to select from this list of pre-defined names.

image

image

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.