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

feat: Added an adaptation layer to simplify dashboard operation logic #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

by-night
Copy link

New Adapter Layer Added

  1. Directly Reference Hooks in the View for Quick Data Handling
const { data } = useModel({
      viewProps: props,
      adapter: {
          model: 'entityStatus',
      },
  });
  const { value } = data || {};
  1. Alternatively, Use config.json to Introduce Quick Components Without Writing View Layer Code
{
  "view": [
      {
          "tag": "div",
          "class": "line-chart-wrapper",
          "style": "display: flex; flex-direction: column; min-width: 100%; height: 100%; padding: 16px; background: var(--main-background);",
          "children": [
              {
                  "tag": "Tooltip",
                  "class": "name",
                  "style": "font-size: 16px; font-weight: bold;",
                  "props": {
                      "autoEllipsis": true
                  },
                  "params": ["title"]
              },
              {
                  "tag": "div",
                  "class": "area-chart-content",
                  "style": "display: flex; flex: 1; align-items: center; justify-content: center; overflow: hidden;",
                  "children": [
                      {
                          "tag": "AreaChart",
                          "style": "flex: 1; width: 100%;",
                          "adapter": {
                              "model": "getHistory"
                          }
                      }
                  ]
              }
          ]
      }
  ]
}
  1. You Can Also Implement Quick Calls by Customizing Charts

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants