mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 04:17:59 +00:00
Added backups of all data, restorable on another computer (#1008)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
ab45580473
commit
936043319c
144 files changed
+10417
-424
No files matched your search
@@ -0,0 +1,32 @@
|
||||
using AIStudio.Settings.DataModel;
|
||||
|
||||
using Lua;
|
||||
|
||||
namespace AIStudio.Tools.PluginSystem;
|
||||
|
||||
/// <summary>
|
||||
/// Describes the data sources which configuration plugins provide.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The settings keep every data source in a list of IDataSource, and a data source of a configuration
|
||||
/// plugin is a record struct rather than a ConfigurationBaseObject. That is why data sources are read
|
||||
/// in a way of their own.
|
||||
/// </remarks>
|
||||
public sealed class DataSourceConfigurationObjectDescriptor : PluginConfigurationObjectDescriptor
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override PluginConfigurationObjectType Type => PluginConfigurationObjectType.DATA_SOURCE;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool TryParse(LuaTable mainTable, Guid configPluginId, List<PluginConfigurationObject> configObjects, bool dryRun, string pluginPath) => PluginConfigurationObject.TryParseDataSources(mainTable, configPluginId, configObjects, dryRun);
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// The secret of a data source is not necessarily an API key, e.g., it is a password, so it is
|
||||
/// deleted as a secret.
|
||||
/// </remarks>
|
||||
public override Task<bool> CleanLeftOverAsync(IList<IAvailablePlugin> availablePlugins, IReadOnlySet<Guid> deployedEnterpriseConfigPluginIds, IReadOnlySet<Guid> notStartedConfigPluginIds, IList<PluginConfigurationObject> configObjectList) => PluginConfigurationObject.CleanLeftOverConfigurationObjects(this.Type, x => x.DataSources, availablePlugins, deployedEnterpriseConfigPluginIds, notStartedConfigPluginIds, configObjectList, SecretStoreType.DATA_SOURCE, deleteSecret: true);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int RemovePluginObjects(Data settings) => settings.DataSources.RemoveAll(dataSource => dataSource.IsEnterpriseConfiguration);
|
||||
}
|
||||
Reference in new issue
Block a user