Update: New Plugin Framework
Plugin Framework re-written. Initial commit.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.Services.Plugins;
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public partial class PluginController : dbAdminController
|
||||
{
|
||||
|
||||
public virtual ActionResult Uninstall(string id, bool UninstallData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(id))
|
||||
throw new ArgumentNullException("id");
|
||||
|
||||
PluginManifest manifest = Plugins.GetPlugin(id);
|
||||
|
||||
var status = UninstallPluginTask.UninstallPlugin(manifest, UninstallData);
|
||||
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||
}
|
||||
|
||||
public virtual ActionResult Install(HttpPostedFileBase Plugin)
|
||||
{
|
||||
if (Plugin == null || Plugin.ContentLength <= 0 || string.IsNullOrWhiteSpace(Plugin.FileName))
|
||||
throw new ArgumentException("A discoPlugin file must be uploaded", "Plugin");
|
||||
|
||||
var tempPluginLocation = Path.Combine(dbContext.DiscoConfiguration.PluginPackagesLocation, Path.GetFileName(Plugin.FileName));
|
||||
|
||||
if (!Directory.Exists(dbContext.DiscoConfiguration.PluginPackagesLocation))
|
||||
Directory.CreateDirectory(dbContext.DiscoConfiguration.PluginPackagesLocation);
|
||||
|
||||
if (System.IO.File.Exists(tempPluginLocation))
|
||||
System.IO.File.Delete(tempPluginLocation);
|
||||
|
||||
|
||||
Plugin.SaveAs(tempPluginLocation);
|
||||
|
||||
var status = InstallPluginTask.InstallPlugin(tempPluginLocation, true);
|
||||
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,99 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Web.Areas.Config.Models.Plugins;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class PluginsController : dbAdminController
|
||||
{
|
||||
[HttpGet]
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
Models.Plugins.IndexViewModel vm = new Models.Plugins.IndexViewModel()
|
||||
{
|
||||
PluginManifests = Plugins.GetPlugins()
|
||||
};
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
#region Plugin Configuration
|
||||
[HttpPost]
|
||||
public virtual ActionResult Configure(string PluginId, FormCollection form)
|
||||
{
|
||||
if (string.IsNullOrEmpty(PluginId))
|
||||
return RedirectToAction(MVC.Config.Plugins.Index());
|
||||
|
||||
PluginManifest manifest = Plugins.GetPlugin(PluginId);
|
||||
|
||||
using (PluginConfigurationHandler configHandler = manifest.CreateConfigurationHandler())
|
||||
{
|
||||
if (configHandler.Post(dbContext, form, this))
|
||||
{
|
||||
dbContext.SaveChanges();
|
||||
|
||||
PluginsLog.LogPluginConfigurationSaved(manifest.Id, DiscoApplication.CurrentUser.Id);
|
||||
|
||||
return RedirectToAction(MVC.Config.Plugins.Index());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Config Errors
|
||||
PluginConfigurationViewModel vm = new PluginConfigurationViewModel(configHandler.Get(dbContext, this));
|
||||
return View(Views.Configure, vm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public virtual ActionResult Configure(string PluginId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(PluginId))
|
||||
return RedirectToAction(MVC.Config.Plugins.Index());
|
||||
|
||||
PluginManifest manifest = Plugins.GetPlugin(PluginId);
|
||||
|
||||
using (PluginConfigurationHandler configHandler = manifest.CreateConfigurationHandler())
|
||||
{
|
||||
PluginConfigurationViewModel vm = new PluginConfigurationViewModel(configHandler.Get(dbContext, this));
|
||||
PluginsLog.LogPluginConfigurationLoaded(manifest.Id, DiscoApplication.CurrentUser.Id);
|
||||
return View(Views.Configure, vm);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
//public virtual ActionResult PluginAction(string PluginId, string PluginAction)
|
||||
//{
|
||||
// if (string.IsNullOrEmpty(PluginId))
|
||||
// return HttpNotFound("PluginId is Required");
|
||||
// if (string.IsNullOrEmpty(PluginAction))
|
||||
// return HttpNotFound("PluginAction is Required");
|
||||
|
||||
// PluginManifest def = Plugins.GetPlugin(PluginId);
|
||||
|
||||
// using (Plugin instance = def.CreateInstance())
|
||||
// {
|
||||
// IPluginWebController instanceController = instance as IPluginWebController;
|
||||
|
||||
// if (instanceController == null)
|
||||
// return HttpNotFound("Plugin is not a Web Controller");
|
||||
|
||||
// PluginsLog.LogPluginWebControllerAccessed(instance.Id, PluginAction, DiscoApplication.CurrentUser.Id);
|
||||
|
||||
// try
|
||||
// {
|
||||
// return instanceController.ExecuteAction(PluginAction, this);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// PluginsLog.LogPluginException("Disco Plugin Web Controller Action", new PluginWebControllerException(instance.Id, PluginAction, ex));
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Web.Areas.Config.Models.Plugins;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class PluginsController : dbAdminController
|
||||
{
|
||||
[HttpGet]
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
Models.Plugins.IndexViewModel vm = new Models.Plugins.IndexViewModel()
|
||||
{
|
||||
PluginManifests = Plugins.GetPlugins()
|
||||
};
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
#region Plugin Configuration
|
||||
[HttpPost]
|
||||
public virtual ActionResult Configure(string PluginId, FormCollection form)
|
||||
{
|
||||
if (string.IsNullOrEmpty(PluginId))
|
||||
return RedirectToAction(MVC.Config.Plugins.Index());
|
||||
|
||||
PluginManifest manifest = Plugins.GetPlugin(PluginId);
|
||||
|
||||
using (PluginConfigurationHandler configHandler = manifest.CreateConfigurationHandler())
|
||||
{
|
||||
if (configHandler.Post(dbContext, form, this))
|
||||
{
|
||||
dbContext.SaveChanges();
|
||||
|
||||
PluginsLog.LogPluginConfigurationSaved(manifest.Id, DiscoApplication.CurrentUser.Id);
|
||||
|
||||
return RedirectToAction(MVC.Config.Plugins.Index());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Config Errors
|
||||
PluginConfigurationViewModel vm = new PluginConfigurationViewModel(configHandler.Get(dbContext, this));
|
||||
return View(Views.Configure, vm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public virtual ActionResult Configure(string PluginId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(PluginId))
|
||||
return RedirectToAction(MVC.Config.Plugins.Index());
|
||||
|
||||
PluginManifest manifest = Plugins.GetPlugin(PluginId);
|
||||
|
||||
using (PluginConfigurationHandler configHandler = manifest.CreateConfigurationHandler())
|
||||
{
|
||||
PluginConfigurationViewModel vm = new PluginConfigurationViewModel(configHandler.Get(dbContext, this));
|
||||
PluginsLog.LogPluginConfigurationLoaded(manifest.Id, DiscoApplication.CurrentUser.Id);
|
||||
return View(Views.Configure, vm);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,76 +1,201 @@
|
||||
@model Disco.Web.Areas.Config.Models.Plugins.IndexViewModel
|
||||
@using Disco.Services.Plugins;
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins");
|
||||
}
|
||||
@{
|
||||
if (Model.PluginManifests.Count == 0)
|
||||
{
|
||||
<div class="form" style="width: 450px">
|
||||
<span class="smallMessage">No Plugins Installed</span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
var pluginGroups = Model.PluginManifestsByType;
|
||||
|
||||
|
||||
int itemsPerColumn = pluginGroups.Count / 3;
|
||||
var itemNextId = 0;
|
||||
|
||||
<table id="pageMenu">
|
||||
<tr>
|
||||
@for (int i = 0; i < 3; i++)
|
||||
{
|
||||
<td>
|
||||
@{
|
||||
int itemsForThisColumn = itemsPerColumn + (pluginGroups.Count % 3 > i ? 1 : 0);
|
||||
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < pluginGroups.Count; i2++)
|
||||
{
|
||||
var pluginGroup = pluginGroups[itemNextId];
|
||||
itemNextId++;
|
||||
<div class="pageMenuArea">
|
||||
<h2>@Plugins.PluginFeatureCategoryDisplayName(pluginGroup.Item1)</h2>
|
||||
@foreach (var pluginDefinition in pluginGroup.Item2)
|
||||
{
|
||||
@Html.ActionLink(pluginDefinition.Name, MVC.Config.Plugins.Configure(pluginDefinition.Id))
|
||||
<div class="pageMenuBlurb">
|
||||
@pluginDefinition.Id | v@(pluginDefinition.Version.ToString(3))
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@*
|
||||
foreach (var pluginGroup in pluginGroups)
|
||||
{
|
||||
<div class="form" style="width: 450px">
|
||||
<h2>@DiscoPlugins.PluginCategoryDisplayName(pluginGroup.Key)</h2>
|
||||
<table>
|
||||
@foreach (var pluginDefinition in pluginGroup)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@if (pluginDefinition.HasConfiguration)
|
||||
{
|
||||
@Html.ActionLink(pluginDefinition.Name, MVC.Config.Plugins.Configure(pluginDefinition.Id))<br />
|
||||
<span class="smallMessage">@pluginDefinition.Id | v@(pluginDefinition.Version.ToString(3))</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
@pluginDefinition.Name <br />
|
||||
<span class="smallMessage">@pluginDefinition.Id | v@(pluginDefinition.Version.ToString(2))
|
||||
| Not Configurable</span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</div> *@
|
||||
}
|
||||
}
|
||||
@model Disco.Web.Areas.Config.Models.Plugins.IndexViewModel
|
||||
@using Disco.Services.Plugins;
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins");
|
||||
}
|
||||
@{
|
||||
if (Model.PluginManifests.Count == 0)
|
||||
{
|
||||
<div class="form" style="width: 450px; padding: 100px 0;">
|
||||
<h2>No Plugins are Installed</h2>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
var pluginGroups = Model.PluginManifestsByType;
|
||||
|
||||
|
||||
int itemsPerColumn = pluginGroups.Count / 3;
|
||||
var itemNextId = 0;
|
||||
|
||||
<table id="pageMenu">
|
||||
<tr>
|
||||
@for (int i = 0; i < 3; i++)
|
||||
{
|
||||
<td>
|
||||
@{
|
||||
int itemsForThisColumn = itemsPerColumn + (pluginGroups.Count % 3 > i ? 1 : 0);
|
||||
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < pluginGroups.Count; i2++)
|
||||
{
|
||||
var pluginGroup = pluginGroups[itemNextId];
|
||||
itemNextId++;
|
||||
<div class="pageMenuArea">
|
||||
<h2>@Plugins.PluginFeatureCategoryDisplayName(pluginGroup.Item1)</h2>
|
||||
@foreach (var pluginDefinition in pluginGroup.Item2)
|
||||
{
|
||||
@Html.ActionLink(pluginDefinition.Name, MVC.Config.Plugins.Configure(pluginDefinition.Id))
|
||||
<div class="pageMenuBlurb">
|
||||
@pluginDefinition.Id | v@(pluginDefinition.Version.ToString(3))
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
</table>
|
||||
<div id="dialogUninstallPlugins" title="Uninstall Plugin">
|
||||
<div>
|
||||
@Html.DropDownList("uninstallPlugin", Model.PluginManifests.ToSelectListItems(null, true, "Select a Plugin to Uninstall"))
|
||||
</div>
|
||||
<div>
|
||||
<input id="uninstallPluginData" type="checkbox" /><label for="uninstallPluginData"> Uninstall Plugin Data</label>
|
||||
<div id="uninstallPluginDataAlert" style="display: none; padding: 0.7em 0.7em; margin-top: 8px;" class="ui-state-error ui-corner-all">
|
||||
<span style="margin-right: 0.3em; float: left;" class="ui-icon ui-icon-alert"></span>NOTE: Data will be permanently deleted
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dialogUninstallPluginConfirm" title="Confirm Plugin Uninstall">
|
||||
<div style="padding: 0.7em 0.7em; margin-top: 8px;" class="ui-state-highlight ui-corner-all">
|
||||
<span style="margin-right: 0.3em; float: left;" class="ui-icon ui-icon-help"></span>Are you sure you want to uninstall this plugin?
|
||||
<h4 id="uninstallPluginConfirm"></h4>
|
||||
</div>
|
||||
<div id="uninstallPluginDataConfirm" style="display: none; padding: 0.7em 0.7em; margin-top: 8px;" class="ui-state-error ui-corner-all">
|
||||
<span style="margin-right: 0.3em; float: left;" class="ui-icon ui-icon-alert"></span>NOTE: Data will be permanently deleted
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
// Uninstall
|
||||
var uninstallUrl = '@(Url.Action(MVC.API.Plugin.Uninstall()))/';
|
||||
var uninstallPlugin, uninstallPluginData, $dialogConfirm, uninstallPluginConfirm, uninstallPluginDataConfirm;
|
||||
|
||||
var pluginId, pluginName, pluginUninstallData;
|
||||
|
||||
var $dialog = $('#dialogUninstallPlugins').dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
width: 350,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Uninstall": function () {
|
||||
pluginId = uninstallPlugin.val();
|
||||
pluginName = uninstallPlugin.find('option:selected').text();
|
||||
pluginUninstallData = uninstallPluginData.is(':checked');
|
||||
|
||||
if (!pluginId) {
|
||||
alert('Select a plugin to uninstall');
|
||||
} else {
|
||||
uninstallPluginConfirm.text(pluginName + ' [' + pluginId + ']');
|
||||
if (pluginUninstallData)
|
||||
uninstallPluginDataConfirm.show();
|
||||
else
|
||||
uninstallPluginDataConfirm.hide();
|
||||
|
||||
$dialogConfirm.dialog('open');
|
||||
$(this).dialog("close");
|
||||
}
|
||||
},
|
||||
Cancel: function () {
|
||||
uninstallPluginData.removeAttr('checked');
|
||||
$('#uninstallPluginDataAlert').hide();
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$dialogConfirm = $('#dialogUninstallPluginConfirm').dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
width: 350,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Confirm Uninstall": function () {
|
||||
var url = uninstallUrl + pluginId;
|
||||
if (pluginUninstallData)
|
||||
url += '?UninstallData=true'
|
||||
else
|
||||
url += '?UninstallData=false'
|
||||
|
||||
window.location.href = url;
|
||||
$(this).dialog("disable");
|
||||
},
|
||||
Cancel: function () {
|
||||
uninstallPluginData.removeAttr('checked');
|
||||
$('#uninstallPluginDataAlert').hide();
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
uninstallPlugin = $('#uninstallPlugin');
|
||||
uninstallPluginData = $('#uninstallPluginData');
|
||||
uninstallPluginConfirm = $('#uninstallPluginConfirm');
|
||||
uninstallPluginDataConfirm = $('#uninstallPluginDataConfirm');
|
||||
|
||||
$('#buttonUninstall').click(function () {
|
||||
$dialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#uninstallPluginData').change(function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#uninstallPluginDataAlert').slideDown();
|
||||
} else {
|
||||
$('#uninstallPluginDataAlert').slideUp();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
}
|
||||
<div id="dialogInstallPlugin" title="Install Plugin">
|
||||
<div style="padding-bottom: 10px;">
|
||||
@using (Html.BeginForm(MVC.API.Plugin.Install(), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
<label for="pluginFile">Plugin Package: </label>
|
||||
<input id="pluginFile" name="Plugin" type="file" />
|
||||
}
|
||||
</div>
|
||||
<div style="padding: 0.7em 0.7em; margin-top: 8px;" class="ui-state-error ui-corner-all">
|
||||
<span style="margin-right: 0.3em; margin-bottom: 2em; float: left;" class="ui-icon ui-icon-alert"></span>Warning: All plugins run with the same level of network privileges as the Disco Web App.<br />
|
||||
<strong>Only install plugins from a trusted source.</strong>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
// Install
|
||||
var $dialogInstall = $('#dialogInstallPlugin').dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
width: 350,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Upload & Install": function () {
|
||||
var pluginFile = $('#pluginFile');
|
||||
if (pluginFile.val()) {
|
||||
pluginFile.closest('form').submit();
|
||||
$(this).dialog('disable');
|
||||
} else {
|
||||
alert('Choose a Plugin Package to Install');
|
||||
}
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#buttonInstall').click(function () {
|
||||
$dialogInstall.dialog('open');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="actionBar">
|
||||
@if (Model.PluginManifests.Count > 0)
|
||||
{
|
||||
@Html.ActionLinkButton("Uninstall Plugins", MVC.Config.Plugins.Index(), "buttonUninstall")
|
||||
}
|
||||
@Html.ActionLinkButton("Install Plugins", MVC.Config.Plugins.Index(), "buttonInstall")
|
||||
</div>
|
||||
|
||||
@@ -1,251 +1,512 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.Plugins
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
using Disco.Services.Plugins;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Plugins/Index.cshtml")]
|
||||
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Plugins.IndexViewModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 3 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 6 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
if (Model.PluginManifests.Count == 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 450px\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">No Plugins Installed</span>\r\n </div> \r\n");
|
||||
|
||||
|
||||
#line 12 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
var pluginGroups = Model.PluginManifestsByType;
|
||||
|
||||
|
||||
int itemsPerColumn = pluginGroups.Count / 3;
|
||||
var itemNextId = 0;
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" id=\"pageMenu\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n");
|
||||
|
||||
|
||||
#line 23 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 23 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <td>\r\n");
|
||||
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
int itemsForThisColumn = itemsPerColumn + (pluginGroups.Count % 3 > i ? 1 : 0);
|
||||
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < pluginGroups.Count; i2++)
|
||||
{
|
||||
var pluginGroup = pluginGroups[itemNextId];
|
||||
itemNextId++;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuArea\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Plugins.PluginFeatureCategoryDisplayName(pluginGroup.Item1));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</h2>\r\n");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
foreach (var pluginDefinition in pluginGroup.Item2)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Html.ActionLink(pluginDefinition.Name, MVC.Config.Plugins.Configure(pluginDefinition.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(pluginDefinition.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" | v");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(pluginDefinition.Version.ToString(3));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 42 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n");
|
||||
|
||||
|
||||
#line 45 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tr>\r\n </table>\r\n");
|
||||
|
||||
|
||||
#line 48 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 74 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.Plugins
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
using Disco.Services.Plugins;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Plugins/Index.cshtml")]
|
||||
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Plugins.IndexViewModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 3 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 6 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
if (Model.PluginManifests.Count == 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 450px; padding: 100px 0;\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>No Plugins are Installed</h2>\r\n </div> \r\n");
|
||||
|
||||
|
||||
#line 12 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
var pluginGroups = Model.PluginManifestsByType;
|
||||
|
||||
|
||||
int itemsPerColumn = pluginGroups.Count / 3;
|
||||
var itemNextId = 0;
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" id=\"pageMenu\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n");
|
||||
|
||||
|
||||
#line 23 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 23 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <td>\r\n");
|
||||
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
int itemsForThisColumn = itemsPerColumn + (pluginGroups.Count % 3 > i ? 1 : 0);
|
||||
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < pluginGroups.Count; i2++)
|
||||
{
|
||||
var pluginGroup = pluginGroups[itemNextId];
|
||||
itemNextId++;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuArea\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Plugins.PluginFeatureCategoryDisplayName(pluginGroup.Item1));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</h2>\r\n");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
foreach (var pluginDefinition in pluginGroup.Item2)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Html.ActionLink(pluginDefinition.Name, MVC.Config.Plugins.Configure(pluginDefinition.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(pluginDefinition.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" | v");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(pluginDefinition.Version.ToString(3));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 42 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n");
|
||||
|
||||
|
||||
#line 45 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tr>\r\n </table>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogUninstallPlugins\"");
|
||||
|
||||
WriteLiteral(" title=\"Uninstall Plugin\"");
|
||||
|
||||
WriteLiteral(">\r\n <div>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 50 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Html.DropDownList("uninstallPlugin", Model.PluginManifests.ToSelectListItems(null, true, "Select a Plugin to Uninstall")));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n <div>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"uninstallPluginData\"");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"uninstallPluginData\"");
|
||||
|
||||
WriteLiteral("> Uninstall Plugin Data</label>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"uninstallPluginDataAlert\"");
|
||||
|
||||
WriteLiteral(" style=\"display: none; padding: 0.7em 0.7em; margin-top: 8px;\"");
|
||||
|
||||
WriteLiteral(" class=\"ui-state-error ui-corner-all\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" style=\"margin-right: 0.3em; float: left;\"");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral("></span>NOTE: Data will be permanently deleted\r\n </div>\r\n </div" +
|
||||
">\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogUninstallPluginConfirm\"");
|
||||
|
||||
WriteLiteral(" title=\"Confirm Plugin Uninstall\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" style=\"padding: 0.7em 0.7em; margin-top: 8px;\"");
|
||||
|
||||
WriteLiteral(" class=\"ui-state-highlight ui-corner-all\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" style=\"margin-right: 0.3em; float: left;\"");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-help\"");
|
||||
|
||||
WriteLiteral("></span>Are you sure you want to uninstall this plugin?\r\n <h4");
|
||||
|
||||
WriteLiteral(" id=\"uninstallPluginConfirm\"");
|
||||
|
||||
WriteLiteral("></h4>\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"uninstallPluginDataConfirm\"");
|
||||
|
||||
WriteLiteral(" style=\"display: none; padding: 0.7em 0.7em; margin-top: 8px;\"");
|
||||
|
||||
WriteLiteral(" class=\"ui-state-error ui-corner-all\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" style=\"margin-right: 0.3em; float: left;\"");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral("></span>NOTE: Data will be permanently deleted\r\n </div>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script>\r\n $(function () {\r\n // Uninstall\r\n var " +
|
||||
"uninstallUrl = \'");
|
||||
|
||||
|
||||
#line 71 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Url.Action(MVC.API.Plugin.Uninstall()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\';\r\n var uninstallPlugin, uninstallPluginData, $dialogConfirm, uninst" +
|
||||
"allPluginConfirm, uninstallPluginDataConfirm;\r\n\r\n var pluginId, plugi" +
|
||||
"nName, pluginUninstallData;\r\n\r\n var $dialog = $(\'#dialogUninstallPlug" +
|
||||
"ins\').dialog({\r\n resizable: false,\r\n modal: true,\r" +
|
||||
"\n width: 350,\r\n autoOpen: false,\r\n " +
|
||||
"buttons: {\r\n \"Uninstall\": function () {\r\n " +
|
||||
" pluginId = uninstallPlugin.val();\r\n pluginName = unin" +
|
||||
"stallPlugin.find(\'option:selected\').text();\r\n pluginUnins" +
|
||||
"tallData = uninstallPluginData.is(\':checked\');\r\n\r\n if (!p" +
|
||||
"luginId) {\r\n alert(\'Select a plugin to uninstall\');\r\n" +
|
||||
" } else {\r\n uninstallPluginCon" +
|
||||
"firm.text(pluginName + \' [\' + pluginId + \']\');\r\n if (" +
|
||||
"pluginUninstallData)\r\n uninstallPluginDataConfirm" +
|
||||
".show();\r\n else\r\n unin" +
|
||||
"stallPluginDataConfirm.hide();\r\n\r\n $dialogConfirm.dia" +
|
||||
"log(\'open\');\r\n $(this).dialog(\"close\");\r\n " +
|
||||
" }\r\n },\r\n Cancel: function () {" +
|
||||
"\r\n uninstallPluginData.removeAttr(\'checked\');\r\n " +
|
||||
" $(\'#uninstallPluginDataAlert\').hide();\r\n $(" +
|
||||
"this).dialog(\"close\");\r\n }\r\n }\r\n })" +
|
||||
";\r\n\r\n $dialogConfirm = $(\'#dialogUninstallPluginConfirm\').dialog({\r\n " +
|
||||
" resizable: false,\r\n modal: true,\r\n " +
|
||||
"width: 350,\r\n autoOpen: false,\r\n buttons: {\r\n " +
|
||||
" \"Confirm Uninstall\": function () {\r\n var u" +
|
||||
"rl = uninstallUrl + pluginId;\r\n if (pluginUninstallData)\r" +
|
||||
"\n url += \'?UninstallData=true\'\r\n " +
|
||||
" else\r\n url += \'?UninstallData=false\'\r\n\r\n " +
|
||||
" window.location.href = url;\r\n $(this).dialo" +
|
||||
"g(\"disable\");\r\n },\r\n Cancel: function () {" +
|
||||
"\r\n uninstallPluginData.removeAttr(\'checked\');\r\n " +
|
||||
" $(\'#uninstallPluginDataAlert\').hide();\r\n $(" +
|
||||
"this).dialog(\"close\");\r\n }\r\n }\r\n })" +
|
||||
";\r\n\r\n uninstallPlugin = $(\'#uninstallPlugin\');\r\n uninstall" +
|
||||
"PluginData = $(\'#uninstallPluginData\');\r\n uninstallPluginConfirm = $(" +
|
||||
"\'#uninstallPluginConfirm\');\r\n uninstallPluginDataConfirm = $(\'#uninst" +
|
||||
"allPluginDataConfirm\');\r\n\r\n $(\'#buttonUninstall\').click(function () {" +
|
||||
"\r\n $dialog.dialog(\'open\');\r\n return false;\r\n " +
|
||||
" });\r\n\r\n $(\'#uninstallPluginData\').change(function () {\r\n " +
|
||||
" if ($(this).is(\':checked\')) {\r\n $(\'#uninstallPluginD" +
|
||||
"ataAlert\').slideDown();\r\n } else {\r\n $(\'#unins" +
|
||||
"tallPluginDataAlert\').slideUp();\r\n }\r\n });\r\n })" +
|
||||
";\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 151 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"dialogInstallPlugin\"");
|
||||
|
||||
WriteLiteral(" title=\"Install Plugin\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" style=\"padding-bottom: 10px;\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 155 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 155 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
using (Html.BeginForm(MVC.API.Plugin.Install(), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <label");
|
||||
|
||||
WriteLiteral(" for=\"pluginFile\"");
|
||||
|
||||
WriteLiteral(">Plugin Package: </label>\r\n");
|
||||
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" id=\"pluginFile\"");
|
||||
|
||||
WriteLiteral(" name=\"Plugin\"");
|
||||
|
||||
WriteLiteral(" type=\"file\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
|
||||
#line 159 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" style=\"padding: 0.7em 0.7em; margin-top: 8px;\"");
|
||||
|
||||
WriteLiteral(" class=\"ui-state-error ui-corner-all\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" style=\"margin-right: 0.3em; margin-bottom: 2em; float: left;\"");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral(@"></span>Warning: All plugins run with the same level of network privileges as the Disco Web App.<br />
|
||||
<strong>Only install plugins from a trusted source.</strong>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
// Install
|
||||
var $dialogInstall = $('#dialogInstallPlugin').dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
width: 350,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
""Upload & Install"": function () {
|
||||
var pluginFile = $('#pluginFile');
|
||||
if (pluginFile.val()) {
|
||||
pluginFile.closest('form').submit();
|
||||
$(this).dialog('disable');
|
||||
} else {
|
||||
alert('Choose a Plugin Package to Install');
|
||||
}
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog(""close"");
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#buttonInstall').click(function () {
|
||||
$dialogInstall.dialog('open');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 196 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 196 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
if (Model.PluginManifests.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 198 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Uninstall Plugins", MVC.Config.Plugins.Index(), "buttonUninstall"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 198 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 200 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Install Plugins", MVC.Config.Plugins.Index(), "buttonInstall"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
||||
@@ -1,306 +1,308 @@
|
||||
using System;
|
||||
using System.Data.SqlClient;
|
||||
using System.Threading;
|
||||
using System.Web.Mvc;
|
||||
using Disco.Web.Models.InitialConfig;
|
||||
using Disco.Data.Repository;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO.Compression;
|
||||
using System.Management;
|
||||
|
||||
namespace Disco.Web.Controllers
|
||||
{
|
||||
[OutputCache(Duration = 0, Location = System.Web.UI.OutputCacheLocation.None)]
|
||||
public partial class InitialConfigController : Controller
|
||||
{
|
||||
|
||||
#region Determine Server Is Core SKU
|
||||
// Added 2012-11-01 G#
|
||||
// http://www.discoict.com.au/forum/support/2012/10/install-on-server-core.aspx
|
||||
private static Lazy<bool> ServerIsCoreSKU = new Lazy<bool>(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
uint osSKU = 0;
|
||||
using (var mSearcher = new ManagementObjectSearcher("SELECT OperatingSystemSKU FROM Win32_OperatingSystem"))
|
||||
{
|
||||
using (var mResults = mSearcher.Get())
|
||||
{
|
||||
foreach (ManagementObject mResult in mResults)
|
||||
{
|
||||
osSKU = (uint)mResult.Properties["OperatingSystemSKU"].Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (osSKU)
|
||||
{
|
||||
case 12: // Datacenter Server Core Edition
|
||||
case 13: // Standard Server Core Edition
|
||||
case 14: // Enterprise Server Core Edition
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Ignore Exceptions
|
||||
}
|
||||
|
||||
// Default to "Not Core"
|
||||
return false;
|
||||
});
|
||||
// End Added 2012-11-01 G#
|
||||
#endregion
|
||||
|
||||
protected override void OnActionExecuting(ActionExecutingContext filterContext)
|
||||
{
|
||||
// Updated 2012-11-01 G# - Consider ServerIsCoreSKU
|
||||
if (!Request.IsLocal && !ServerIsCoreSKU.Value)
|
||||
{
|
||||
filterContext.Result = new HttpStatusCodeResult(System.Net.HttpStatusCode.ServiceUnavailable, "Initial Configuration of Disco is only allowed via a local connection");
|
||||
}
|
||||
base.OnActionExecuting(filterContext);
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Install/
|
||||
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
return RedirectToAction(MVC.InitialConfig.Welcome());
|
||||
}
|
||||
|
||||
#region Welcome
|
||||
public virtual ActionResult Welcome()
|
||||
{
|
||||
var m = new WelcomeModel();
|
||||
|
||||
m.AutodetectOrganisation();
|
||||
|
||||
return View(m);
|
||||
}
|
||||
[HttpPost]
|
||||
public virtual ActionResult Welcome(WelcomeModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
DiscoApplication.OrganisationName = model.OrganisationName;
|
||||
|
||||
return RedirectToAction(MVC.InitialConfig.Database());
|
||||
}
|
||||
|
||||
return View(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Database
|
||||
public virtual ActionResult Database()
|
||||
{
|
||||
var cs = Disco.Data.Repository.DiscoDatabaseConnectionFactory.DiscoDataContextConnectionString;
|
||||
|
||||
DatabaseModel m;
|
||||
|
||||
if (cs == null)
|
||||
m = new DatabaseModel(); // Just use Defaults
|
||||
else
|
||||
m = DatabaseModel.FromConnectionString(cs); // Import from existing Connection String
|
||||
|
||||
return View(m);
|
||||
}
|
||||
[HttpPost]
|
||||
public virtual ActionResult Database(DatabaseModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Continue with Configuration
|
||||
var connectionString = model.ToConnectionString();
|
||||
|
||||
// Try Creating/Migrating
|
||||
connectionString.ConnectTimeout = 5;
|
||||
Disco.Data.Repository.DiscoDatabaseConnectionFactory.SetDiscoDataContextConnectionString(connectionString.ToString(), false);
|
||||
|
||||
try
|
||||
{
|
||||
Disco.Data.Migrations.DiscoDataMigrator.MigrateLatest(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Find inner exception
|
||||
SqlException sqlException = null;
|
||||
Exception innermostException = ex;
|
||||
do
|
||||
{
|
||||
if (sqlException == null)
|
||||
sqlException = innermostException as SqlException;
|
||||
if (innermostException.InnerException != null)
|
||||
innermostException = innermostException.InnerException;
|
||||
else
|
||||
break;
|
||||
} while (true);
|
||||
|
||||
if (sqlException != null)
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, string.Format("Unable to create or migrate the database to the latest version: [{0}] {1}", sqlException.GetType().Name, sqlException.Message));
|
||||
}
|
||||
else
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, string.Format("Unable to create or migrate the database to the latest version: [{0}] {1}", innermostException.GetType().Name, innermostException.Message));
|
||||
}
|
||||
}
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Save Connection String
|
||||
//Disco.Data.Repository.DiscoDatabaseConnectionFactory.SetDiscoDataContextConnectionString(model.ToConnectionString().ToString(), true);
|
||||
// Write Organisation Name into DB
|
||||
using (DiscoDataContext db = new DiscoDataContext())
|
||||
{
|
||||
db.DiscoConfiguration.OrganisationName = DiscoApplication.OrganisationName;
|
||||
db.SaveChanges();
|
||||
}
|
||||
|
||||
return RedirectToAction(MVC.InitialConfig.FileStore());
|
||||
}
|
||||
}
|
||||
|
||||
return View(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region FileStore
|
||||
public virtual ActionResult FileStore()
|
||||
{
|
||||
// Try and retrieve FileStore path from DB
|
||||
string FileStoreLocation = null;
|
||||
try
|
||||
{
|
||||
using (DiscoDataContext db = new DiscoDataContext())
|
||||
FileStoreLocation = db.ConfigurationItems.Where(ci => ci.Scope == "System" && ci.Key == "DataStoreLocation").Select(ci => ci.Value).FirstOrDefault();
|
||||
}
|
||||
catch (Exception) { } // Ignore All Errors
|
||||
|
||||
FileStoreModel m = new FileStoreModel();
|
||||
|
||||
// Test for valid Format
|
||||
if (!string.IsNullOrEmpty(FileStoreLocation))
|
||||
if (!Regex.IsMatch(FileStoreLocation, @"^[A-z]:(\\[^\\/:*?""<>|0x0-0x1F]+)+(\\)?$", RegexOptions.Singleline))
|
||||
FileStoreLocation = null;
|
||||
m.FileStoreLocation = FileStoreLocation;
|
||||
if (m.FileStoreLocation != null && m.FileStoreLocation.EndsWith(@"\"))
|
||||
m.FileStoreLocation = m.FileStoreLocation.TrimEnd('\\');
|
||||
|
||||
m.ExpandDirectoryModel();
|
||||
|
||||
return View(m);
|
||||
}
|
||||
[HttpPost]
|
||||
public virtual ActionResult FileStore(FileStoreModel m)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Ensure Path Exists
|
||||
using (DiscoDataContext db = new DiscoDataContext())
|
||||
{
|
||||
var configItem = db.ConfigurationItems.Where(ci => ci.Scope == "System" && ci.Key == "DataStoreLocation").FirstOrDefault();
|
||||
if (configItem == null)
|
||||
{ // Create Config
|
||||
db.ConfigurationItems.Add(new Disco.Models.Repository.ConfigurationItem()
|
||||
{
|
||||
Scope = "System",
|
||||
Key = "DataStoreLocation",
|
||||
Value = m.FileStoreLocation
|
||||
});
|
||||
}
|
||||
else
|
||||
{ // Update Config
|
||||
configItem.Value = m.FileStoreLocation;
|
||||
}
|
||||
db.SaveChanges();
|
||||
}
|
||||
|
||||
// Extract DataStore Template into FileStore
|
||||
var templatePath = Server.MapPath("~/ClientBin/DataStoreTemplate.zip");
|
||||
if (System.IO.File.Exists(templatePath))
|
||||
{
|
||||
try
|
||||
{
|
||||
using (ZipArchive templateArchive = ZipFile.Open(templatePath, ZipArchiveMode.Read))
|
||||
{
|
||||
foreach (var entry in templateArchive.Entries)
|
||||
{
|
||||
var entryDestinationPath = Path.Combine(m.FileStoreLocation, entry.FullName);
|
||||
if (System.IO.File.Exists(entryDestinationPath))
|
||||
System.IO.File.Delete(entryDestinationPath);
|
||||
}
|
||||
templateArchive.ExtractToDirectory(m.FileStoreLocation);
|
||||
}
|
||||
return RedirectToAction(MVC.InitialConfig.Complete());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, string.Format("Unable to extract File Store template: [{0}] {1}", ex.GetType().Name, ex.Message));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return RedirectToAction(MVC.InitialConfig.Complete());
|
||||
}
|
||||
}
|
||||
|
||||
m.ExpandDirectoryModel();
|
||||
|
||||
return View(m);
|
||||
}
|
||||
public virtual ActionResult FileStoreBranch(string Path)
|
||||
{
|
||||
return Json(FileStoreModel.FileStoreDirectoryModel.FromPath(Path, true), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Complete
|
||||
public virtual ActionResult Complete()
|
||||
{
|
||||
var m = new CompleteModel();
|
||||
|
||||
m.PerformTests();
|
||||
|
||||
return View(m);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Restart WebApp
|
||||
|
||||
public virtual ActionResult RestartWebApp()
|
||||
{
|
||||
RestartWebApp(1500);
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
private static object _restartTimerLock = new object();
|
||||
private static Timer _restartTimer;
|
||||
private void RestartWebApp(int DelayMilliseconds)
|
||||
{
|
||||
lock (_restartTimerLock)
|
||||
{
|
||||
if (_restartTimer != null)
|
||||
{
|
||||
_restartTimer.Dispose();
|
||||
}
|
||||
|
||||
_restartTimer = new Timer((state) =>
|
||||
{
|
||||
AppDomain.Unload(AppDomain.CurrentDomain);
|
||||
}, null, DelayMilliseconds, Timeout.Infinite);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Data.SqlClient;
|
||||
using System.Threading;
|
||||
using System.Web.Mvc;
|
||||
using Disco.Web.Models.InitialConfig;
|
||||
using Disco.Data.Repository;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO.Compression;
|
||||
using System.Management;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Controllers
|
||||
{
|
||||
[OutputCache(Duration = 0, Location = System.Web.UI.OutputCacheLocation.None)]
|
||||
public partial class InitialConfigController : Controller
|
||||
{
|
||||
|
||||
#region Determine Server Is Core SKU
|
||||
// Added 2012-11-01 G#
|
||||
// http://www.discoict.com.au/forum/support/2012/10/install-on-server-core.aspx
|
||||
private static Lazy<bool> ServerIsCoreSKU = new Lazy<bool>(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
uint osSKU = 0;
|
||||
using (var mSearcher = new ManagementObjectSearcher("SELECT OperatingSystemSKU FROM Win32_OperatingSystem"))
|
||||
{
|
||||
using (var mResults = mSearcher.Get())
|
||||
{
|
||||
foreach (ManagementObject mResult in mResults)
|
||||
{
|
||||
osSKU = (uint)mResult.Properties["OperatingSystemSKU"].Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (osSKU)
|
||||
{
|
||||
case 12: // Datacenter Server Core Edition
|
||||
case 13: // Standard Server Core Edition
|
||||
case 14: // Enterprise Server Core Edition
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Ignore Exceptions
|
||||
}
|
||||
|
||||
// Default to "Not Core"
|
||||
return false;
|
||||
});
|
||||
// End Added 2012-11-01 G#
|
||||
#endregion
|
||||
|
||||
protected override void OnActionExecuting(ActionExecutingContext filterContext)
|
||||
{
|
||||
// Updated 2012-11-01 G# - Consider ServerIsCoreSKU
|
||||
if (!Request.IsLocal && !ServerIsCoreSKU.Value)
|
||||
{
|
||||
filterContext.Result = new HttpStatusCodeResult(System.Net.HttpStatusCode.ServiceUnavailable, "Initial Configuration of Disco is only allowed via a local connection");
|
||||
}
|
||||
base.OnActionExecuting(filterContext);
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Install/
|
||||
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
return RedirectToAction(MVC.InitialConfig.Welcome());
|
||||
}
|
||||
|
||||
#region Welcome
|
||||
public virtual ActionResult Welcome()
|
||||
{
|
||||
var m = new WelcomeModel();
|
||||
|
||||
m.AutodetectOrganisation();
|
||||
|
||||
return View(m);
|
||||
}
|
||||
[HttpPost]
|
||||
public virtual ActionResult Welcome(WelcomeModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
DiscoApplication.OrganisationName = model.OrganisationName;
|
||||
|
||||
return RedirectToAction(MVC.InitialConfig.Database());
|
||||
}
|
||||
|
||||
return View(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Database
|
||||
public virtual ActionResult Database()
|
||||
{
|
||||
var cs = Disco.Data.Repository.DiscoDatabaseConnectionFactory.DiscoDataContextConnectionString;
|
||||
|
||||
DatabaseModel m;
|
||||
|
||||
if (cs == null)
|
||||
m = new DatabaseModel(); // Just use Defaults
|
||||
else
|
||||
m = DatabaseModel.FromConnectionString(cs); // Import from existing Connection String
|
||||
|
||||
return View(m);
|
||||
}
|
||||
[HttpPost]
|
||||
public virtual ActionResult Database(DatabaseModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Continue with Configuration
|
||||
var connectionString = model.ToConnectionString();
|
||||
|
||||
// Try Creating/Migrating
|
||||
connectionString.ConnectTimeout = 5;
|
||||
Disco.Data.Repository.DiscoDatabaseConnectionFactory.SetDiscoDataContextConnectionString(connectionString.ToString(), false);
|
||||
|
||||
try
|
||||
{
|
||||
Disco.Data.Migrations.DiscoDataMigrator.MigrateLatest(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Find inner exception
|
||||
SqlException sqlException = null;
|
||||
Exception innermostException = ex;
|
||||
do
|
||||
{
|
||||
if (sqlException == null)
|
||||
sqlException = innermostException as SqlException;
|
||||
if (innermostException.InnerException != null)
|
||||
innermostException = innermostException.InnerException;
|
||||
else
|
||||
break;
|
||||
} while (true);
|
||||
|
||||
if (sqlException != null)
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, string.Format("Unable to create or migrate the database to the latest version: [{0}] {1}", sqlException.GetType().Name, sqlException.Message));
|
||||
}
|
||||
else
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, string.Format("Unable to create or migrate the database to the latest version: [{0}] {1}", innermostException.GetType().Name, innermostException.Message));
|
||||
}
|
||||
}
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Save Connection String
|
||||
//Disco.Data.Repository.DiscoDatabaseConnectionFactory.SetDiscoDataContextConnectionString(model.ToConnectionString().ToString(), true);
|
||||
// Write Organisation Name into DB
|
||||
using (DiscoDataContext db = new DiscoDataContext())
|
||||
{
|
||||
db.DiscoConfiguration.OrganisationName = DiscoApplication.OrganisationName;
|
||||
db.SaveChanges();
|
||||
}
|
||||
|
||||
return RedirectToAction(MVC.InitialConfig.FileStore());
|
||||
}
|
||||
}
|
||||
|
||||
return View(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region FileStore
|
||||
public virtual ActionResult FileStore()
|
||||
{
|
||||
// Try and retrieve FileStore path from DB
|
||||
string FileStoreLocation = null;
|
||||
try
|
||||
{
|
||||
using (DiscoDataContext db = new DiscoDataContext())
|
||||
FileStoreLocation = db.ConfigurationItems.Where(ci => ci.Scope == "System" && ci.Key == "DataStoreLocation").Select(ci => ci.Value).FirstOrDefault();
|
||||
}
|
||||
catch (Exception) { } // Ignore All Errors
|
||||
|
||||
FileStoreModel m = new FileStoreModel();
|
||||
|
||||
// Test for valid Format
|
||||
if (!string.IsNullOrEmpty(FileStoreLocation))
|
||||
if (!Regex.IsMatch(FileStoreLocation, @"^[A-z]:(\\[^\\/:*?""<>|0x0-0x1F]+)+(\\)?$", RegexOptions.Singleline))
|
||||
FileStoreLocation = null;
|
||||
m.FileStoreLocation = FileStoreLocation;
|
||||
if (m.FileStoreLocation != null && m.FileStoreLocation.EndsWith(@"\"))
|
||||
m.FileStoreLocation = m.FileStoreLocation.TrimEnd('\\');
|
||||
|
||||
m.ExpandDirectoryModel();
|
||||
|
||||
return View(m);
|
||||
}
|
||||
[HttpPost]
|
||||
public virtual ActionResult FileStore(FileStoreModel m)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Ensure Path Exists
|
||||
using (DiscoDataContext db = new DiscoDataContext())
|
||||
{
|
||||
var configItem = db.ConfigurationItems.Where(ci => ci.Scope == "System" && ci.Key == "DataStoreLocation").FirstOrDefault();
|
||||
if (configItem == null)
|
||||
{ // Create Config
|
||||
db.ConfigurationItems.Add(new Disco.Models.Repository.ConfigurationItem()
|
||||
{
|
||||
Scope = "System",
|
||||
Key = "DataStoreLocation",
|
||||
Value = m.FileStoreLocation
|
||||
});
|
||||
}
|
||||
else
|
||||
{ // Update Config
|
||||
configItem.Value = m.FileStoreLocation;
|
||||
}
|
||||
db.SaveChanges();
|
||||
}
|
||||
|
||||
// Extract DataStore Template into FileStore
|
||||
var templatePath = Server.MapPath("~/ClientBin/DataStoreTemplate.zip");
|
||||
if (System.IO.File.Exists(templatePath))
|
||||
{
|
||||
try
|
||||
{
|
||||
using (ZipArchive templateArchive = ZipFile.Open(templatePath, ZipArchiveMode.Read))
|
||||
{
|
||||
foreach (var entry in templateArchive.Entries)
|
||||
{
|
||||
var entryDestinationPath = Path.Combine(m.FileStoreLocation, entry.FullName);
|
||||
if (System.IO.File.Exists(entryDestinationPath))
|
||||
System.IO.File.Delete(entryDestinationPath);
|
||||
}
|
||||
templateArchive.ExtractToDirectory(m.FileStoreLocation);
|
||||
}
|
||||
return RedirectToAction(MVC.InitialConfig.Complete());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ModelState.AddModelError(string.Empty, string.Format("Unable to extract File Store template: [{0}] {1}", ex.GetType().Name, ex.Message));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return RedirectToAction(MVC.InitialConfig.Complete());
|
||||
}
|
||||
}
|
||||
|
||||
m.ExpandDirectoryModel();
|
||||
|
||||
return View(m);
|
||||
}
|
||||
public virtual ActionResult FileStoreBranch(string Path)
|
||||
{
|
||||
return Json(FileStoreModel.FileStoreDirectoryModel.FromPath(Path, true), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Complete
|
||||
public virtual ActionResult Complete()
|
||||
{
|
||||
var m = new CompleteModel();
|
||||
|
||||
m.PerformTests();
|
||||
|
||||
return View(m);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Restart WebApp
|
||||
|
||||
public virtual ActionResult RestartWebApp()
|
||||
{
|
||||
RestartWebApp(1500);
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
private static object _restartTimerLock = new object();
|
||||
private static Timer _restartTimer;
|
||||
private void RestartWebApp(int DelayMilliseconds)
|
||||
{
|
||||
lock (_restartTimerLock)
|
||||
{
|
||||
if (_restartTimer != null)
|
||||
{
|
||||
_restartTimer.Dispose();
|
||||
}
|
||||
|
||||
_restartTimer = new Timer((state) =>
|
||||
{
|
||||
HttpRuntime.UnloadAppDomain();
|
||||
//AppDomain.Unload(AppDomain.CurrentDomain);
|
||||
}, null, DelayMilliseconds, Timeout.Infinite);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1824
-1823
File diff suppressed because it is too large
Load Diff
@@ -1,35 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Disco ICT Management Website")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Disco ICT Management")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("2e74ba84-f784-4006-b99c-1967612fe48f")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.2.0131.2002")]
|
||||
[assembly: AssemblyFileVersion("1.2.0131.2002")]
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Disco ICT Management Website")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Disco ICT Management")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("2e74ba84-f784-4006-b99c-1967612fe48f")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.2.0207.1727")]
|
||||
[assembly: AssemblyFileVersion("1.2.0207.1727")]
|
||||
|
||||
+8989
-8895
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user