add RenderMode to IModuleControl

This commit is contained in:
sbwalker 2024-02-01 09:59:28 -05:00
parent 156d39490e
commit abd235f332
6 changed files with 12 additions and 2 deletions

View File

@ -50,6 +50,8 @@ namespace Oqtane.Modules
public virtual List<Resource> Resources { get; set; }
public virtual string RenderMode { get { return RenderModes.Interactive; } }
// url parameters
public virtual string UrlParametersTemplate { get; set; }

View File

@ -478,6 +478,8 @@
{
// retrieve module component resources
var moduleobject = Activator.CreateInstance(moduletype) as IModuleControl;
module.RenderMode = moduleobject.RenderMode;
page.Resources = ManagePageResources(page.Resources, moduleobject.Resources, ResourceLevel.Module, alias, "Modules", moduletype.Namespace);
if (action.ToLower() == "settings" && module.ModuleDefinition != null)
{

View File

@ -20,7 +20,7 @@ else
{
Parameters = new Dictionary<string, object>();
Parameters.Add(new KeyValuePair<string, object>("AntiForgeryToken", ""));
Parameters.Add(new KeyValuePair<string, object>("RenderMode", RenderModes.Hybrid));
Parameters.Add(new KeyValuePair<string, object>("RenderMode", RenderModes.Interactive));
Parameters.Add(new KeyValuePair<string, object>("Runtime", Runtimes.Hybrid));
Parameters.Add(new KeyValuePair<string, object>("VisitorId", -1));
Parameters.Add(new KeyValuePair<string, object>("RemoteIPAddress", ""));

View File

@ -30,5 +30,10 @@ namespace Oqtane.Modules
/// Identifies all resources in a module
/// </summary>
List<Resource> Resources { get; }
/// <summary>
/// Specifies the required render mode for the module control ie. Static,Interactive
/// </summary>
string RenderMode { get; }
}
}

View File

@ -115,6 +115,8 @@ namespace Oqtane.Models
public string Actions { get; set; }
[NotMapped]
public bool UseAdminContainer { get; set; }
[NotMapped]
public string RenderMode{ get; set; }
#endregion

View File

@ -3,6 +3,5 @@ namespace Oqtane.Shared {
public const string Static = "Static";
public const string Interactive = "Interactive";
public const string Headless = "Headless";
public const string Hybrid = "Hybrid"; // used at runtime by .NET MAUI clients
}
}