mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 03:57:59 +00:00
Open log file locations from the information page (#928)
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
This commit is contained in:
1 parent
67a0a39683
commit
ae948a959f
7 files changed
+141
-13
No files matched your search
@@ -276,21 +276,52 @@
|
||||
</MudJustifiedText>
|
||||
|
||||
<MudJustifiedText Class="mb-3" Typo="Typo.body1">
|
||||
@T("By clicking on the respective path, the path is copied to the clipboard. You might open these files with a text editor to view their contents.")
|
||||
@T("You can view and filter these files directly in AI Studio with the Log Viewer. Click a path to copy it to the clipboard, or use the folder button to open its location in your file manager. You can also open the files with a text editor.")
|
||||
</MudJustifiedText>
|
||||
|
||||
<MudButton Variant="Variant.Filled"
|
||||
StartIcon="@Icons.Material.Filled.Article"
|
||||
Href="@Routes.ASSISTANT_LOG_VIEWER"
|
||||
Class="mb-3">
|
||||
@T("Open Log Viewer")
|
||||
</MudButton>
|
||||
|
||||
<MudText Typo="Typo.h4">
|
||||
@T("Startup log file")
|
||||
</MudText>
|
||||
<MudList T="string" Class="mb-3">
|
||||
<MudListItem T="string" Icon="@Icons.Material.Outlined.Folder" Text="@this.logPaths.LogStartupPath" OnClick="@(() => this.CopyStartupLogPath())"/>
|
||||
<MudListItem T="string" Icon="@Icons.Material.Outlined.Folder">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Spacing="1" Style="width: 100%; min-width: 0;">
|
||||
<MudLink OnClick="@this.CopyStartupLogPath" Style="min-width: 0; overflow-wrap: anywhere;">
|
||||
@this.logPaths.LogStartupPath
|
||||
</MudLink>
|
||||
<MudTooltip Text="@T("Open in folder")">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.FolderOpen"
|
||||
Size="Size.Medium"
|
||||
Disabled="@string.IsNullOrWhiteSpace(this.logPaths.LogStartupPath)"
|
||||
OnClick="@(() => this.OpenLogInFileManager(this.logPaths.LogStartupPath))"/>
|
||||
</MudTooltip>
|
||||
</MudStack>
|
||||
</MudListItem>
|
||||
</MudList>
|
||||
|
||||
<MudText Typo="Typo.h4">
|
||||
@T("Usage log file")
|
||||
</MudText>
|
||||
<MudList T="string" Class="mb-3">
|
||||
<MudListItem T="string" Icon="@Icons.Material.Outlined.Folder" Text="@this.logPaths.LogAppPath" OnClick="@(() => this.CopyAppLogPath())"/>
|
||||
<MudListItem T="string" Icon="@Icons.Material.Outlined.Folder">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Spacing="1" Style="width: 100%; min-width: 0;">
|
||||
<MudLink OnClick="@this.CopyAppLogPath" Style="min-width: 0; overflow-wrap: anywhere;">
|
||||
@this.logPaths.LogAppPath
|
||||
</MudLink>
|
||||
<MudTooltip Text="@T("Open in folder")">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.FolderOpen"
|
||||
Size="Size.Medium"
|
||||
Disabled="@string.IsNullOrWhiteSpace(this.logPaths.LogAppPath)"
|
||||
OnClick="@(() => this.OpenLogInFileManager(this.logPaths.LogAppPath))"/>
|
||||
</MudTooltip>
|
||||
</MudStack>
|
||||
</MudListItem>
|
||||
</MudList>
|
||||
</ExpansionPanel>
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@ public partial class Information : MSGComponentBase
|
||||
[Inject]
|
||||
private RustService RustService { get; init; } = null!;
|
||||
|
||||
[Inject]
|
||||
private ILogger<Information> Logger { get; init; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IDialogService DialogService { get; init; } = null!;
|
||||
|
||||
@@ -536,6 +539,36 @@ public partial class Information : MSGComponentBase
|
||||
{
|
||||
await this.RustService.CopyText2Clipboard(this.logPaths.LogAppPath);
|
||||
}
|
||||
|
||||
private async Task OpenLogInFileManager(string path)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
{
|
||||
await this.MessageBus.SendWarning(new(Icons.Material.Filled.Folder, T("The log file path is not available yet.")));
|
||||
return;
|
||||
}
|
||||
|
||||
OpenPathResponse response;
|
||||
try
|
||||
{
|
||||
response = await this.RustService.TryOpenPathInRuntimeFileManager(path);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.Logger.LogWarning(e, "Could not open the log file location in the file manager.");
|
||||
await this.MessageBus.SendError(new(Icons.Material.Filled.Folder, T("Could not open the log file location.")));
|
||||
return;
|
||||
}
|
||||
|
||||
if (response.Success)
|
||||
{
|
||||
await this.MessageBus.SendSuccess(new(Icons.Material.Filled.FolderOpen, T("Opened the log file location.")));
|
||||
return;
|
||||
}
|
||||
|
||||
var issue = string.IsNullOrWhiteSpace(response.Issue) ? T("Unknown error") : response.Issue;
|
||||
await this.MessageBus.SendError(new(Icons.Material.Filled.Folder, string.Format(T("Could not open the log file location: {0}"), issue)));
|
||||
}
|
||||
|
||||
private const string LICENSE = """
|
||||
# Functional Source License, Version 1.1, MIT Future License
|
||||
@@ -689,4 +722,4 @@ public partial class Information : MSGComponentBase
|
||||
|
||||
await this.DialogService.ShowAsync<UpdateInstructionsDialog>(T("How to update"), parameters, DialogOptions.FULLSCREEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user