Switch dashboard storage to SQL Server
Replaced file-based dashboard storage with SQL Server-backed storage using the new SqlDashboardStorage class and TBDD_SMF_CONFIG table. Updated Program.cs to use the new storage and ensure default dashboards are loaded into the database. Simplified DefaultDashboard.xml to remove old items. Added SQL script for the dashboard storage table. Cleaned up unused folder references in the project file. This centralizes dashboard management and supports multi-instance scenarios.
This commit is contained in:
17
DbFirst.API/Data/Dashboards/DashboardStorage.sql
Normal file
17
DbFirst.API/Data/Dashboards/DashboardStorage.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE dbo.TBDD_SMF_CONFIG (
|
||||
[GUID] [bigint] IDENTITY(1,1) NOT NULL,
|
||||
[ACTIVE] [bit] NOT NULL,
|
||||
DashboardId NVARCHAR(128) NOT NULL,
|
||||
DashboardName NVARCHAR(256) NOT NULL,
|
||||
DashboardData VARBINARY(MAX) NOT NULL,
|
||||
--- INSERT YOUR COLUMNS HERE ---
|
||||
[ADDED_WHO] [nvarchar](50) NOT NULL,
|
||||
[ADDED_WHEN] [datetime] NOT NULL,
|
||||
[CHANGED_WHO] [nvarchar](50) NULL,
|
||||
[CHANGED_WHEN] [datetime] NULL,
|
||||
CONSTRAINT [PK_TBDD_SMF_CONFIG_DashboardStorage] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[GUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = ON, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
@@ -10,48 +10,6 @@
|
||||
</JsonDataSource>
|
||||
</DataSources>
|
||||
<Items>
|
||||
<Grid ComponentName="gridDashboardItem1" Name="Grid 1" DataSource="jsonDataSource1">
|
||||
<DataItems>
|
||||
<Dimension DataMember="Address" DefaultId="DataItem0" />
|
||||
<Dimension DataMember="City" DefaultId="DataItem1" />
|
||||
<Dimension DataMember="CompanyName" DefaultId="DataItem2" />
|
||||
</DataItems>
|
||||
<GridColumns>
|
||||
<GridDimensionColumn>
|
||||
<Dimension DefaultId="DataItem0" />
|
||||
</GridDimensionColumn>
|
||||
<GridDimensionColumn>
|
||||
<Dimension DefaultId="DataItem1" />
|
||||
</GridDimensionColumn>
|
||||
<GridDimensionColumn>
|
||||
<Dimension DefaultId="DataItem2" />
|
||||
</GridDimensionColumn>
|
||||
</GridColumns>
|
||||
<GridOptions />
|
||||
<ColumnFilterOptions />
|
||||
</Grid>
|
||||
<Chart ComponentName="chartDashboardItem1" Name="Chart 1" DataSource="jsonDataSource1">
|
||||
<DataItems>
|
||||
<Measure DataMember="Address" SummaryType="Count" DefaultId="DataItem0" />
|
||||
<Measure DataMember="City" SummaryType="Count" DefaultId="DataItem1" />
|
||||
<Measure DataMember="CompanyName" SummaryType="Count" DefaultId="DataItem2" />
|
||||
</DataItems>
|
||||
<Panes>
|
||||
<Pane Name="Pane 1">
|
||||
<Series>
|
||||
<Simple>
|
||||
<Value DefaultId="DataItem0" />
|
||||
</Simple>
|
||||
<Simple>
|
||||
<Value DefaultId="DataItem1" />
|
||||
</Simple>
|
||||
<Simple>
|
||||
<Value DefaultId="DataItem2" />
|
||||
</Simple>
|
||||
</Series>
|
||||
</Pane>
|
||||
</Panes>
|
||||
</Chart>
|
||||
<Grid ComponentName="gridDashboardItem2" Name="Grid 2" DataSource="catalogsDataSource">
|
||||
<DataItems>
|
||||
<Measure DataMember="guid" DefaultId="DataItem0" />
|
||||
@@ -91,13 +49,7 @@
|
||||
</Items>
|
||||
<LayoutTree>
|
||||
<LayoutGroup>
|
||||
<LayoutGroup Orientation="Vertical">
|
||||
<LayoutGroup>
|
||||
<LayoutItem DashboardItem="gridDashboardItem1" />
|
||||
<LayoutItem DashboardItem="gridDashboardItem2" />
|
||||
</LayoutGroup>
|
||||
<LayoutItem DashboardItem="chartDashboardItem1" />
|
||||
</LayoutGroup>
|
||||
<LayoutItem DashboardItem="gridDashboardItem2" />
|
||||
</LayoutGroup>
|
||||
</LayoutTree>
|
||||
</Dashboard>
|
||||
Reference in New Issue
Block a user