Skip to content

Commit

Permalink
fix razor routes, inherit pagebase
Browse files Browse the repository at this point in the history
  • Loading branch information
BeepBeepBopBop committed Dec 20, 2024
1 parent c1a5a2b commit d6615ea
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 37 deletions.
47 changes: 16 additions & 31 deletions LM-Kit-Maestro/UI/Pages/AssistantsPage.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
<ui:PageBase xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:local="clr-namespace:LMKit.Maestro"
Expand All @@ -12,38 +12,23 @@
xmlns:services="clr-namespace:LMKit.Maestro.Services"
x:DataType="vm:AssistantsPageViewModel"
x:Class="LMKit.Maestro.UI.AssistantsPage">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{x:Static ui:UIConstants.PageTopBarHeight}"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<!-- Header -->
<Grid
Margin="0, -8, 0, 0"
BackgroundColor="{StaticResource Surface}"
VerticalOptions="Start"
Grid.ColumnSpan="3"
ColumnDefinitions="auto, *, auto">
<ui:PageBase.Header>
<ui:ModelSelectionButton
BindingContext="{Binding ModelListViewModel}"
x:Name="modelSelectionButton"
Margin="16, 0"
MaximumWidthRequest="{x:Static ui:UIConstants.ModelSelectionButtonMaxWidth}"
HeightRequest="{x:Static ui:UIConstants.ModelSelectionButtonHeight}">
</ui:ModelSelectionButton>
</ui:PageBase.Header>

<ui:ModelSelectionButton
x:Name="modelSelectionButton"
BindingContext="{Binding ModelListViewModel}"
VerticalOptions="Start"
Margin="16, 0"
MaximumWidthRequest="{x:Static ui:UIConstants.ModelSelectionButtonMaxWidth}"
HeightRequest="{x:Static ui:UIConstants.ModelSelectionButtonHeight}"
Grid.Column="1">
</ui:ModelSelectionButton>
</Grid>

<BlazorWebView
x:Name="blazorWebView"
Grid.Row="1"
HostPage="wwwroot/index.html">
<ui:PageBase.Body>
<BlazorWebView HostPage="wwwroot/index.html" StartPath="/assistants">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type razor:Translation}" />
<RootComponent Selector="#app" ComponentType="{x:Type razor:Routes}" />
</BlazorWebView.RootComponents>
</BlazorWebView>
</Grid>
</ContentPage>
</ui:PageBase.Body>

</ui:PageBase>
2 changes: 1 addition & 1 deletion LM-Kit-Maestro/UI/Pages/AssistantsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace LMKit.Maestro.UI;

public partial class AssistantsPage : ContentPage
public partial class AssistantsPage : PageBase
{
private readonly AssistantsPageViewModel _assistantsPageViewModel;

Expand Down
9 changes: 5 additions & 4 deletions LM-Kit-Maestro/UI/Pages/ChatPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,15 @@
x:Name="chatsSidebar"
WidthRequest="{Binding Source={x:Reference chatPage}, Path=ChatsSidebarWidth, x:DataType=ui:ChatPage}"
Grid.Row="1"/>

<BlazorWebView
x:Name="blazorWebView"
Grid.RowSpan="2"
Grid.Column="1"
HostPage="wwwroot/index.html">
HostPage="wwwroot/index.html"
StartPath="/chat">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type razor:Chat}" />
<RootComponent Selector="#app" ComponentType="{x:Type razor:Routes}" />
</BlazorWebView.RootComponents>
</BlazorWebView>

Expand All @@ -148,4 +149,4 @@
BindingContext="{Binding SettingsViewModel}"/>
</Grid>
</ui:PageBase.Body>
</ui:PageBase>
</ui:PageBase>
4 changes: 3 additions & 1 deletion LM-Kit-Maestro/UI/Razor/Components/Chat.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@inject LMKitService LMKitService
@page "/chat"

@inject LMKitService LMKitService
@inject HttpClient Http
@inject IJSRuntime JS
@inject IScrollHandler ScrollHandler
Expand Down
File renamed without changes.

0 comments on commit d6615ea

Please sign in to comment.