Added a ConfigurationPageInfo stub class so that we're not serializing the Plugin

This commit is contained in:
LukePulverenti 2013-03-17 12:52:32 -04:00
parent 2c3bd71202
commit c1d38106c7
4 changed files with 38 additions and 4 deletions

View File

@ -0,0 +1,33 @@
using System;
using MediaBrowser.Controller.Plugins;
namespace MediaBrowser.WebDashboard.Api
{
public class ConfigurationPageInfo
{
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets the type of the configuration page.
/// </summary>
/// <value>The type of the configuration page.</value>
public ConfigurationPageType ConfigurationPageType { get; set; }
/// <summary>
/// Gets or sets the plugin id.
/// </summary>
/// <value>The plugin id.</value>
public Guid PluginId { get; set; }
public ConfigurationPageInfo(IPluginConfigurationPage page)
{
Name = page.Name;
ConfigurationPageType = page.ConfigurationPageType;
PluginId = page.Plugin.Id;
}
}
}

View File

@ -25,7 +25,7 @@ namespace MediaBrowser.WebDashboard.Api
/// Class GetDashboardConfigurationPages
/// </summary>
[Route("/dashboard/ConfigurationPages", "GET")]
public class GetDashboardConfigurationPages : IReturn<List<IPluginConfigurationPage>>
public class GetDashboardConfigurationPages : IReturn<List<ConfigurationPageInfo>>
{
/// <summary>
/// Gets or sets the type of the page.
@ -38,7 +38,7 @@ namespace MediaBrowser.WebDashboard.Api
/// Class GetDashboardConfigurationPage
/// </summary>
[Route("/dashboard/ConfigurationPage", "GET")]
public class GetDashboardConfigurationPage : IReturn<IPluginConfigurationPage>
public class GetDashboardConfigurationPage
{
/// <summary>
/// Gets or sets the name.
@ -174,7 +174,7 @@ namespace MediaBrowser.WebDashboard.Api
pages = pages.Where(p => p.ConfigurationPageType == request.PageType.Value);
}
return ToOptimizedResult(pages.ToList());
return ToOptimizedResult(pages.Select(p => new ConfigurationPageInfo(p)).ToList());
}
/// <summary>

View File

@ -36,7 +36,7 @@
var plugin = plugins[i];
var configPage = $.grep(pluginConfigurationPages, function (pluginConfigurationPage) {
return pluginConfigurationPage.Plugin.Id == plugin.Id;
return pluginConfigurationPage.PluginId == plugin.Id;
})[0];
html += "<li>";

View File

@ -81,6 +81,7 @@
<Compile Include="..\SharedVersion.cs">
<Link>Properties\SharedVersion.cs</Link>
</Compile>
<Compile Include="Api\ConfigurationPageInfo.cs" />
<Compile Include="Api\DashboardInfo.cs" />
<Compile Include="Api\DashboardService.cs" />
<Compile Include="Api\DashboardInfoWebSocketListener.cs" />