mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 11:59:48 +00:00
Added draft for workspaces
This commit is contained in:
parent
aa1beb4340
commit
839c398209
@ -0,0 +1 @@
|
||||
<MudText Typo="Typo.body1">TODO</MudText>
|
@ -0,0 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
|
||||
public partial class Workspaces : ComponentBase
|
||||
{
|
||||
}
|
@ -2,7 +2,15 @@
|
||||
@using AIStudio.Chat
|
||||
@using AIStudio.Settings
|
||||
|
||||
<MudText Typo="Typo.h3" Class="mb-2">Chats</MudText>
|
||||
<MudStack Row="@true" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.h3" Class="mb-2 mr-3">
|
||||
Chats
|
||||
</MudText>
|
||||
<MudTooltip Text="Your workspaces" Placement="Placement.Bottom">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.SnippetFolder" Variant="Variant.Filled" Color="Color.Default" Size="Size.Large" OnClick="() => this.ToggleWorkspaces()"/>
|
||||
</MudTooltip>
|
||||
</MudStack>
|
||||
|
||||
<MudSelect T="Provider" @bind-Value="@this.selectedProvider" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Apps" Margin="Margin.Dense" Label="Provider" Class="mb-2 rounded-lg" Variant="Variant.Outlined">
|
||||
@foreach (var provider in this.SettingsManager.ConfigurationData.Providers)
|
||||
{
|
||||
@ -25,4 +33,18 @@
|
||||
<MudTextField T="string" @ref="@this.inputField" @bind-Text="@this.userInput" Variant="Variant.Outlined" AutoGrow="@true" Lines="3" MaxLines="12" Label="@this.InputLabel" Placeholder="@this.ProviderPlaceholder" Adornment="Adornment.End" AdornmentIcon="@Icons.Material.Filled.Send" OnAdornmentClick="() => this.SendMessage()" ReadOnly="!this.IsProviderSelected || this.isStreaming" Immediate="@true" OnKeyUp="this.InputKeyEvent" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
|
||||
</MudPaper>
|
||||
</FooterContent>
|
||||
</InnerScrolling>
|
||||
</InnerScrolling>
|
||||
|
||||
<MudDrawer @bind-Open="@this.workspacesVisible" Width="40em" Height="100%" Anchor="Anchor.Start" Variant="DrawerVariant.Temporary" Elevation="1">
|
||||
<MudDrawerHeader>
|
||||
<MudStack Row="@true" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.h6" Class="mr-3">
|
||||
Your workspaces
|
||||
</MudText>
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Close" Variant="Variant.Filled" Color="Color.Default" Size="Size.Small" OnClick="() => this.ToggleWorkspaces()"/>
|
||||
</MudStack>
|
||||
</MudDrawerHeader>
|
||||
<MudDrawerContainer Class="ml-6">
|
||||
<Workspaces/>
|
||||
</MudDrawerContainer>
|
||||
</MudDrawer>
|
@ -27,6 +27,7 @@ public partial class Chat : ComponentBase
|
||||
private ChatThread? chatThread;
|
||||
private bool isStreaming;
|
||||
private string userInput = string.Empty;
|
||||
private bool workspacesVisible;
|
||||
|
||||
// Unfortunately, we need the input field reference to clear it after sending a message.
|
||||
// This is necessary because we have to handle the key events ourselves. Otherwise,
|
||||
@ -132,4 +133,9 @@ public partial class Chat : ComponentBase
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleWorkspaces()
|
||||
{
|
||||
this.workspacesVisible = !this.workspacesVisible;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user