mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-07-28 06:42:57 +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>
|
</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")
|
@T("Add Provider")
|
||||||
</MudButton>
|
</MudButton>
|
||||||
|
|
||||||
|
@ -65,3 +65,7 @@ CONFIG["SETTINGS"] = {}
|
|||||||
-- Configure the update behavior:
|
-- Configure the update behavior:
|
||||||
-- Allowed values are: NO_CHECK, ONCE_STARTUP, HOURLY, DAILY, WEEKLY
|
-- 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>
|
/// </summary>
|
||||||
public string PreselectedProfile { get; set; } = string.Empty;
|
public string PreselectedProfile { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Should we preselect a chat template for the entire app?
|
/// Should we preselect a chat template for the entire app?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PreselectedChatTemplate { get; set; } = string.Empty;
|
public string PreselectedChatTemplate { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Should the user be allowed to add providers?
|
||||||
|
/// </summary>
|
||||||
|
public bool DontAllowUserToAddProvider { get; set; }
|
||||||
}
|
}
|
@ -54,6 +54,12 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
|
|||||||
SETTINGS_MANAGER.ConfigurationData.App.UpdateBehavior = updateBehavior;
|
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
|
// Configured providers
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user