mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 10:52:56 +00:00
Add maintenance and deprecation message flags to plugins
This commit is contained in:
parent
24f5127785
commit
ff788b33f2
@ -28,6 +28,12 @@ CATEGORIES = { "CORE" }
|
||||
-- The target groups for the plugin:
|
||||
TARGET_GROUPS = { "EVERYONE" }
|
||||
|
||||
-- The flag for whether the plugin is maintained:
|
||||
IS_MAINTAINED = true
|
||||
|
||||
-- When the plugin is deprecated, this message will be shown to users:
|
||||
DEPRECATION_MESSAGE = nil
|
||||
|
||||
CONTENT = {
|
||||
Home_LetsGetStarted = "Lass uns anfangen",
|
||||
}
|
@ -30,6 +30,12 @@ CATEGORIES = { "CORE" }
|
||||
-- The target groups for the plugin:
|
||||
TARGET_GROUPS = { "EVERYONE" }
|
||||
|
||||
-- The flag for whether the plugin is maintained:
|
||||
IS_MAINTAINED = true
|
||||
|
||||
-- When the plugin is deprecated, this message will be shown to users:
|
||||
DEPRECATION_MESSAGE = nil
|
||||
|
||||
CONTENT = {
|
||||
HOME = CONTENT_HOME,
|
||||
}
|
@ -63,6 +63,16 @@ public abstract class PluginBase
|
||||
/// The target groups of this plugin.
|
||||
/// </summary>
|
||||
public PluginTargetGroup[] TargetGroups { get; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// True, when the plugin is maintained.
|
||||
/// </summary>
|
||||
public bool IsMaintained { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The message that should be displayed when the plugin is deprecated.
|
||||
/// </summary>
|
||||
public string? DeprecationMessage { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The issues that occurred during the initialization of this plugin.
|
||||
@ -146,6 +156,16 @@ public abstract class PluginBase
|
||||
else if(this is not NoPlugin)
|
||||
issues.Add(issue);
|
||||
|
||||
if(this.TryInitIsMaintained(out issue, out var isMaintained))
|
||||
this.IsMaintained = isMaintained;
|
||||
else if(this is not NoPlugin)
|
||||
issues.Add(issue);
|
||||
|
||||
if(this.TryInitDeprecationMessage(out issue, out var deprecationMessage))
|
||||
this.DeprecationMessage = deprecationMessage;
|
||||
else if(this is not NoPlugin)
|
||||
issues.Add(issue);
|
||||
|
||||
this.baseIssues = issues;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user