mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-22 01:13:48 +00:00
Migrated the data & config directory retrieval from Tauri JS to the runtime API
This commit is contained in:
3 files changed
+59
-9
No files matched your search
@@ -87,6 +87,30 @@ public sealed class RustService(string apiPort) : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> GetConfigDirectory()
|
||||
{
|
||||
var response = await this.http.GetAsync("/system/directories/config");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
this.logger!.LogError($"Failed to get the config directory from Rust: '{response.StatusCode}'");
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
public async Task<string> GetDataDirectory()
|
||||
{
|
||||
var response = await this.http.GetAsync("/system/directories/data");
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
this.logger!.LogError($"Failed to get the data directory from Rust: '{response.StatusCode}'");
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to copy the given text to the clipboard.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user