Skip to content

Commit

Permalink
fix: plugin settings
Browse files Browse the repository at this point in the history
  • Loading branch information
romiekos committed May 11, 2023
1 parent 53d0feb commit 7eea174
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions grafana/data-source/src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/grafana/grafana/master/docs/sources/developers/plugins/plugin.schema.json",
"type": "datasource",
"name": "Archilogic Grafana Datasource plugin",
"id": "archilogic-datasource",
"id": "archilogic-archilogic-datasource",
"metrics": true,
"streaming": true,
"info": {
Expand All @@ -24,4 +24,4 @@
"grafanaDependency": "^9.2.5",
"plugins": []
}
}
}
8 changes: 7 additions & 1 deletion grafana/floor-panel/src/components/FloorPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Props extends PanelProps<FloorOptions> {}
const HIGHLIGHT_COLOR: [number, number, number] = [100, 200, 100]

export const FloorPanel: React.FC<Props> = props => {
const [floorPlan, setFloorPlan] = useState(undefined as FloorPlanEngine)
const [floorPlan, setFloorPlan] = useState(undefined as FloorPlanEngine | undefined)
const [isFloorPlanLoaded, setIsFloorPlanLoaded] = useState(false)

const { id, token, nodeId, colorFrom, colorTo } = props.options
Expand All @@ -21,6 +21,9 @@ export const FloorPanel: React.FC<Props> = props => {
const gradient = getGradients(colorFrom, colorTo)

function handleInputSourceData() {
if (!floorPlan) {
return
}
const nodes = getAssetsAndSpaces(floorPlan)
nodes.forEach((entity: any) => {
if (ids.includes(entity.id)) {
Expand All @@ -33,6 +36,9 @@ export const FloorPanel: React.FC<Props> = props => {
})
}
function handleSpaceId() {
if (!floorPlan) {
return
}
const node = getNodeById(floorPlan, nodeId)
if (node) {
node?.setHighlight({ fill: HIGHLIGHT_COLOR })
Expand Down

0 comments on commit 7eea174

Please sign in to comment.