revenz / Fenrus

A personal home page for quick access to all your personal apps/sites.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New item with type of Dashboard doesn't work

loli71 opened this issue · comments

Hi,

I just migrate to last version 23.06.3.985
In a group, I tried to add new item of type Dashboard and have windows freeze.
image

log:

warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
      Unhandled exception rendering component: Unknown type: Dashboard
      System.Exception: Unknown type: Dashboard
         at Fenrus.Components.SideEditors.GroupItemEditor.Save() in /app/Components/SideEditors/GroupItemEditor/GroupItemEditor.razor.cs:line 327
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
      Unhandled exception in circuit 'HUhynAMfZv5U-aRLLRerL8EwK0nINRqpldj7uKa6WWA'.
      System.Exception: Unknown type: Dashboard
         at Fenrus.Components.SideEditors.GroupItemEditor.Save() in /app/Components/SideEditors/GroupItemEditor/GroupItemEditor.razor.cs:line 327
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

I think I found the explanation for this issue of adding dashboard type in group:

add new item allow following type chooses in Components/SideEditors/GroupItemEditor/GroupItemEditor.razor

            <InputSelect Page="GroupItem" TItem="string" Label="Type" @bind-Value="@Model.ItemType">
                <InputSelectOption TItem="string" StringValue="DashboardApp" Label="App" />
                <InputSelectOption TItem="string" StringValue="DashboardLink" Label="Link" />
                <InputSelectOption TItem="string" StringValue="Dashboard" Label="Dashboard" />
                <InputSelectOption TItem="string" StringValue="DashboardTerminal" Label="Terminal" />
            </InputSelect>

But "save" task have only case "DashboardApp" and "DashboardLink" in Components/SideEditors/GroupItemEditor/GroupItemEditor.razor.cs

So if we choose Dashboard or DashboardTerminal option, go thrue exception /app/Components/SideEditors/GroupItemEditor/GroupItemEditor.razor.cs:line 327

fixed