From 2b4e00c33d6576dba4f5cee7ae81acb395ed1022 Mon Sep 17 00:00:00 2001 From: TonyBunce Date: Tue, 15 Oct 2019 09:15:31 -0400 Subject: [PATCH 1/2] New-UDTable creates unnamed endpoint Add a deterministic ID to the UDElement created by New-UDTable. Without this any UDTable will create an endpoint with a new random GUID every time the dashboard is restarted. That causes clients with their browser open during a dashboard restart to suddenly get 404 errors. --- src/UniversalDashboard.Materialize/Scripts/table.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UniversalDashboard.Materialize/Scripts/table.ps1 b/src/UniversalDashboard.Materialize/Scripts/table.ps1 index 7a74c3ef..c8292135 100644 --- a/src/UniversalDashboard.Materialize/Scripts/table.ps1 +++ b/src/UniversalDashboard.Materialize/Scripts/table.ps1 @@ -60,7 +60,7 @@ function New-UDTable { New-UDElement -Tag 'tbody' -Content $Content } else { - New-UDElement -Tag 'tbody' -Endpoint $Endpoint -AutoRefresh:$AutoRefresh -RefreshInterval $RefreshInterval -ArgumentList $ArgumentList + New-UDElement -Tag 'tbody' -Endpoint $Endpoint -AutoRefresh:$AutoRefresh -RefreshInterval $RefreshInterval -ArgumentList $ArgumentList -Id "$Id-tbody' } From 331787bef75934dadaf4d50bf30d40441fe4d57e Mon Sep 17 00:00:00 2001 From: TonyBunce Date: Tue, 15 Oct 2019 10:57:53 -0400 Subject: [PATCH 2/2] Fix quoting issue --- src/UniversalDashboard.Materialize/Scripts/table.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UniversalDashboard.Materialize/Scripts/table.ps1 b/src/UniversalDashboard.Materialize/Scripts/table.ps1 index c8292135..ba85b7d6 100644 --- a/src/UniversalDashboard.Materialize/Scripts/table.ps1 +++ b/src/UniversalDashboard.Materialize/Scripts/table.ps1 @@ -60,7 +60,7 @@ function New-UDTable { New-UDElement -Tag 'tbody' -Content $Content } else { - New-UDElement -Tag 'tbody' -Endpoint $Endpoint -AutoRefresh:$AutoRefresh -RefreshInterval $RefreshInterval -ArgumentList $ArgumentList -Id "$Id-tbody' + New-UDElement -Tag 'tbody' -Endpoint $Endpoint -AutoRefresh:$AutoRefresh -RefreshInterval $RefreshInterval -ArgumentList $ArgumentList -Id "$Id-tbody" }