Update dashboard create and widget-panel templates

This commit is contained in:
Turtuvshin
2024-01-30 16:01:46 +08:00
parent 6c8b09db61
commit 4424ed1754
2 changed files with 13 additions and 19 deletions

View File

@@ -1,9 +1,5 @@
<div class="fleetbase-dashboard-grid" ...attributes>
<GridStack
@options={{hash float=true animate=true acceptWidgets=true alwaysShowResizeHandle=@isEdit}}
@onChange={{this.onChangeGrid}}
@dragInOptions={{hash selector="test" options=(hash appendTo="body" helper="clone")}}
>
<GridStack @options={{hash float=true animate=true acceptWidgets=true alwaysShowResizeHandle=@isEdit}} @onChange={{this.onChangeGrid}}>
{{#each this.args.dashboard.widgets as |widget index|}}
<GridStackItem @options={{widget.grid_options}} class="relative">
{{component widget.component options=widget.options}}

View File

@@ -1,4 +1,4 @@
<Overlay @isOpen={{@isOpen}} @onLoad={{this.setOverlayContext}} @position="right" @noBackdrop={{true}} @fullHeight={{true}} @width={{or this.width @width "600px"}}>
<Overlay @isOpen={{@isOpen}} @onLoad={{this.setOverlayContext}} @position="right" @noBackdrop={{true}} @fullHeight={{true}} @width={{or this.width @width "400px"}}>
<Overlay::Header @title={{"Add widgets"}} @hideStatusDot={{true}} @titleWrapperClass="leading-5">
<div class="flex flex-1 justify-end">
<Button @icon={{"save"}} @type="primary" @text={{"Save Dashboard"}} @onClick={{this.save}} @wrapperClass="mr-2" />
@@ -7,20 +7,18 @@
</Overlay::Header>
<Overlay::Body @wrapperClass="new-service-rate-overlay-body px-4 space-y-4 pt-4" @increaseInnerBodyHeightBy={{1000}}>
<div class="grid grid-cols-3 gap-1 text-xs dark:text-gray-100">
<div class="grid grid-cols-2 gap-1 text-xs dark:text-gray-100">
{{#each this.availableWidgets as |widget|}}
<GridStackItem @options={{widget.grid_options}}>
<div
class="flex flex-col items-center justify-center rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-800 shadow-sm mr-1"
{{on "click" (fn this.addWidgetToDashboard widget)}}
>
{{log this.args}}
<p class="text-lg font-bold dark:text-gray-100 text-black p-4">
{{widget.name}}
widget
</p>
</div>
</GridStackItem>
<div
class="flex flex-col items-center justify-center rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-800 shadow-sm m-1"
{{on "click" (fn this.addWidgetToDashboard widget)}}
>
{{log this.args}}
<p class="text-sm font-bold dark:text-gray-100 text-black p-4">
{{widget.name}}
widget
</p>
</div>
{{/each}}
</div>