mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-07-27 21:42:56 +00:00
Adding Providers can now be disabled in the plugin
This commit is contained in:
parent
6116c03f7c
commit
9c32595d72
@ -75,7 +75,7 @@
|
||||
</MudText>
|
||||
}
|
||||
|
||||
<MudButton Variant="Variant.Filled" Color="@Color.Primary" StartIcon="@Icons.Material.Filled.AddRoad" Class="mt-3 mb-6" OnClick="@this.AddLLMProvider">
|
||||
<MudButton Variant="Variant.Filled" Color="@Color.Primary" StartIcon="@Icons.Material.Filled.AddRoad" Class="mt-3 mb-6" OnClick="@this.AddLLMProvider" Disabled="@this.SettingsManager.ConfigurationData.App.DontAllowUserToAddProvider">
|
||||
@T("Add Provider")
|
||||
</MudButton>
|
||||
|
||||
|
@ -64,4 +64,8 @@ CONFIG["SETTINGS"] = {}
|
||||
|
||||
-- Configure the update behavior:
|
||||
-- Allowed values are: NO_CHECK, ONCE_STARTUP, HOURLY, DAILY, WEEKLY
|
||||
-- CONFIG["SETTINGS"]["DataApp.UpdateBehavior"] = "NO_CHECK"
|
||||
-- CONFIG["SETTINGS"]["DataApp.UpdateBehavior"] = "NO_CHECK"
|
||||
|
||||
-- Configure the user permission to add providers:
|
||||
-- Allowed values are: true, false
|
||||
-- CONFIG["SETTINGS"]["DataApp.DontAllowUserToAddProvider"] = false
|
@ -58,9 +58,13 @@ public sealed class DataApp
|
||||
/// </summary>
|
||||
public string PreselectedProfile { get; set; } = string.Empty;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Should we preselect a chat template for the entire app?
|
||||
/// </summary>
|
||||
public string PreselectedChatTemplate { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Should the user be allowed to add providers?
|
||||
/// </summary>
|
||||
public bool DontAllowUserToAddProvider { get; set; }
|
||||
}
|
@ -53,6 +53,12 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
|
||||
SETTINGS_LOCKER.Register<DataApp>(x => x.UpdateBehavior, this.Id);
|
||||
SETTINGS_MANAGER.ConfigurationData.App.UpdateBehavior = updateBehavior;
|
||||
}
|
||||
|
||||
if (settingsTable.TryGetValue(SettingsManager.ToSettingName<DataApp>(x => x.DontAllowUserToAddProvider), out var dontAllowUserToAddProviderValue) && dontAllowUserToAddProviderValue.TryRead<bool>(out var dontAllowUserToAddProviderEntry))
|
||||
{
|
||||
SETTINGS_LOCKER.Register<DataApp>(x => x.DontAllowUserToAddProvider, this.Id);
|
||||
SETTINGS_MANAGER.ConfigurationData.App.DontAllowUserToAddProvider = dontAllowUserToAddProviderEntry;
|
||||
}
|
||||
|
||||
//
|
||||
// Configured providers
|
||||
|
Loading…
Reference in New Issue
Block a user