Line | |
---|
1 | using System.Collections.Generic;
|
---|
2 | using System.Linq;
|
---|
3 | using System.Web.Http;
|
---|
4 | using DTO = HeuristicLab.Services.WebApp.Controllers.DataTransfer;
|
---|
5 |
|
---|
6 | namespace HeuristicLab.Services.WebApp.Controllers {
|
---|
7 |
|
---|
8 | [Authorize(Roles = "Hive Administrator")]
|
---|
9 | public class PluginController : ApiController {
|
---|
10 |
|
---|
11 | private readonly PluginManager pluginManager = PluginManager.Instance;
|
---|
12 |
|
---|
13 | public IEnumerable<DTO.Plugin> GetPlugins() {
|
---|
14 | var plugins = pluginManager.GetPlugins();
|
---|
15 | return plugins.Select(plugin => new DTO.Plugin {
|
---|
16 | Name = plugin.Name,
|
---|
17 | AssemblyName = plugin.AssemblyName,
|
---|
18 | LastReload = plugin.LastReload
|
---|
19 | });
|
---|
20 | }
|
---|
21 |
|
---|
22 | public bool ReloadPlugin(string name) {
|
---|
23 | var plugin = PluginManager.Instance.GetPlugin(name);
|
---|
24 | plugin.ReloadControllers();
|
---|
25 | return true;
|
---|
26 | }
|
---|
27 | }
|
---|
28 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.