Update: Plugin Updating
Updating plugins from the plugin catalogue, and automatic updating of plugins after a newer version of Disco is installed.
This commit is contained in:
@@ -1,89 +1,106 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Data.Repository;
|
||||
|
||||
namespace Disco.Web
|
||||
{
|
||||
public static class AppConfig
|
||||
{
|
||||
public static bool InitializeDatabase()
|
||||
{
|
||||
// Modified Connection Factory
|
||||
System.Data.Entity.Database.DefaultConnectionFactory = new DiscoDatabaseConnectionFactory(System.Data.Entity.Database.DefaultConnectionFactory);
|
||||
|
||||
if (Disco.Data.Repository.DiscoDatabaseConnectionFactory.DiscoDataContextConnectionString == null)
|
||||
{
|
||||
// Database Connection String not configured - Trigger 'Install'
|
||||
return false;
|
||||
}
|
||||
|
||||
// Migrate Database
|
||||
Disco.Data.Migrations.DiscoDataMigrator.MigrateLatest(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void InitalizeEnvironment()
|
||||
{
|
||||
using (var dbContext = new DiscoDataContext())
|
||||
{
|
||||
// Initialize Logging
|
||||
Disco.Services.Logging.LogContext.Initalize(dbContext, DiscoApplication.SchedulerFactory);
|
||||
|
||||
// Load Organisation Name
|
||||
DiscoApplication.OrganisationName = dbContext.DiscoConfiguration.OrganisationName;
|
||||
DiscoApplication.MultiSiteMode = dbContext.DiscoConfiguration.MultiSiteMode;
|
||||
|
||||
// Setup Global Proxy
|
||||
DiscoApplication.SetGlobalProxy(dbContext.DiscoConfiguration.ProxyAddress,
|
||||
dbContext.DiscoConfiguration.ProxyPort,
|
||||
dbContext.DiscoConfiguration.ProxyUsername,
|
||||
dbContext.DiscoConfiguration.ProxyPassword);
|
||||
|
||||
// Initialize Expressions
|
||||
BI.Expressions.Expression.InitializeExpressions();
|
||||
|
||||
// Initialize Warranty Providers Plugins
|
||||
Disco.Services.Plugins.Plugins.InitalizePlugins(dbContext);
|
||||
|
||||
// Initialize Scheduled Tasks
|
||||
Disco.Services.Tasks.ScheduledTasks.InitalizeScheduledTasks(dbContext, DiscoApplication.SchedulerFactory);
|
||||
|
||||
// Schedule Immediate Check for Update (if a new version was installed, never updated, last updated over 2 days ago)
|
||||
var currentVersion = Disco.BI.Interop.Community.UpdateCheck.CurrentDiscoVersion();
|
||||
if (dbContext.DiscoConfiguration.InstalledDatabaseVersion == null ||
|
||||
dbContext.DiscoConfiguration.InstalledDatabaseVersion != currentVersion ||
|
||||
dbContext.DiscoConfiguration.UpdateLastCheck == null ||
|
||||
dbContext.DiscoConfiguration.UpdateLastCheck.ResponseTimestamp < DateTime.Now.AddDays(-2))
|
||||
{
|
||||
Disco.BI.Interop.Community.UpdateCheckTask.ScheduleNow();
|
||||
dbContext.DiscoConfiguration.InstalledDatabaseVersion = currentVersion;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
|
||||
// Setup Attachment Monitor
|
||||
DiscoApplication.DocumentDropBoxMonitor = new BI.DocumentTemplateBI.Importer.DocumentDropBoxMonitor(dbContext, DiscoApplication.SchedulerFactory, HttpContext.Current.Cache);
|
||||
}
|
||||
DiscoApplication.DocumentDropBoxMonitor.StartWatching();
|
||||
DiscoApplication.DocumentDropBoxMonitor.ScheduleCurrentFiles(10);
|
||||
}
|
||||
|
||||
public static void DisposeEnvironment()
|
||||
{
|
||||
if (DiscoApplication.DocumentDropBoxMonitor != null)
|
||||
DiscoApplication.DocumentDropBoxMonitor.Dispose();
|
||||
|
||||
if (DiscoApplication.SchedulerFactory != null)
|
||||
{
|
||||
foreach (var item in DiscoApplication.SchedulerFactory.AllSchedulers.ToArray())
|
||||
{
|
||||
item.Shutdown(false);
|
||||
}
|
||||
}
|
||||
|
||||
Disco.Services.Logging.SystemLog.LogUninitialized();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Data.Repository;
|
||||
|
||||
namespace Disco.Web
|
||||
{
|
||||
public static class AppConfig
|
||||
{
|
||||
public static bool InitializeDatabase()
|
||||
{
|
||||
// Modified Connection Factory
|
||||
System.Data.Entity.Database.DefaultConnectionFactory = new DiscoDatabaseConnectionFactory(System.Data.Entity.Database.DefaultConnectionFactory);
|
||||
|
||||
if (Disco.Data.Repository.DiscoDatabaseConnectionFactory.DiscoDataContextConnectionString == null)
|
||||
{
|
||||
// Database Connection String not configured - Trigger 'Install'
|
||||
return false;
|
||||
}
|
||||
|
||||
// Migrate Database
|
||||
Disco.Data.Migrations.DiscoDataMigrator.MigrateLatest(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void InitalizeEnvironment()
|
||||
{
|
||||
using (var dbContext = new DiscoDataContext())
|
||||
{
|
||||
// Initialize Logging
|
||||
Disco.Services.Logging.LogContext.Initalize(dbContext, DiscoApplication.SchedulerFactory);
|
||||
|
||||
// Load Organisation Name
|
||||
DiscoApplication.OrganisationName = dbContext.DiscoConfiguration.OrganisationName;
|
||||
DiscoApplication.MultiSiteMode = dbContext.DiscoConfiguration.MultiSiteMode;
|
||||
|
||||
// Setup Global Proxy
|
||||
DiscoApplication.SetGlobalProxy(dbContext.DiscoConfiguration.ProxyAddress,
|
||||
dbContext.DiscoConfiguration.ProxyPort,
|
||||
dbContext.DiscoConfiguration.ProxyUsername,
|
||||
dbContext.DiscoConfiguration.ProxyPassword);
|
||||
|
||||
// Initialize Expressions
|
||||
BI.Expressions.Expression.InitializeExpressions();
|
||||
|
||||
// Initialize Warranty Providers Plugins
|
||||
Disco.Services.Plugins.Plugins.InitalizePlugins(dbContext);
|
||||
|
||||
// Initialize Scheduled Tasks
|
||||
Disco.Services.Tasks.ScheduledTasks.InitalizeScheduledTasks(dbContext, DiscoApplication.SchedulerFactory, true);
|
||||
|
||||
// Schedule Immediate Check for Update (if never updated, or last updated over 2 days ago)
|
||||
if (dbContext.DiscoConfiguration.UpdateLastCheck == null ||
|
||||
dbContext.DiscoConfiguration.UpdateLastCheck.ResponseTimestamp < DateTime.Now.AddDays(-2))
|
||||
{
|
||||
Disco.BI.Interop.Community.UpdateCheckTask.ScheduleNow();
|
||||
}
|
||||
|
||||
// Setup Attachment Monitor
|
||||
DiscoApplication.DocumentDropBoxMonitor = new BI.DocumentTemplateBI.Importer.DocumentDropBoxMonitor(dbContext, DiscoApplication.SchedulerFactory, HttpContext.Current.Cache);
|
||||
}
|
||||
DiscoApplication.DocumentDropBoxMonitor.StartWatching();
|
||||
DiscoApplication.DocumentDropBoxMonitor.ScheduleCurrentFiles(10);
|
||||
}
|
||||
|
||||
public static void InitializeUpdateEnvironment()
|
||||
{
|
||||
using (var dbContext = new DiscoDataContext())
|
||||
{
|
||||
// Initialize Logging
|
||||
Disco.Services.Logging.LogContext.Initalize(dbContext, DiscoApplication.SchedulerFactory);
|
||||
|
||||
// Load Organisation Name
|
||||
DiscoApplication.OrganisationName = dbContext.DiscoConfiguration.OrganisationName;
|
||||
DiscoApplication.MultiSiteMode = dbContext.DiscoConfiguration.MultiSiteMode;
|
||||
|
||||
// Setup Global Proxy
|
||||
DiscoApplication.SetGlobalProxy(dbContext.DiscoConfiguration.ProxyAddress,
|
||||
dbContext.DiscoConfiguration.ProxyPort,
|
||||
dbContext.DiscoConfiguration.ProxyUsername,
|
||||
dbContext.DiscoConfiguration.ProxyPassword);
|
||||
|
||||
// Initialize Scheduled Tasks
|
||||
Disco.Services.Tasks.ScheduledTasks.InitalizeScheduledTasks(dbContext, DiscoApplication.SchedulerFactory, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DisposeEnvironment()
|
||||
{
|
||||
if (DiscoApplication.DocumentDropBoxMonitor != null)
|
||||
DiscoApplication.DocumentDropBoxMonitor.Dispose();
|
||||
|
||||
if (DiscoApplication.SchedulerFactory != null)
|
||||
{
|
||||
foreach (var item in DiscoApplication.SchedulerFactory.AllSchedulers.ToArray())
|
||||
{
|
||||
item.Shutdown(false);
|
||||
}
|
||||
}
|
||||
|
||||
Disco.Services.Logging.SystemLog.LogUninitialized();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace Disco.Web
|
||||
{
|
||||
public class RouteConfig
|
||||
{
|
||||
public static void RegisterInstallRoutes(RouteCollection routes)
|
||||
{
|
||||
// Install Route
|
||||
routes.MapRoute(
|
||||
name: "InitialConfig", // Route name
|
||||
url: "{controller}/{action}/{id}", // URL with parameters
|
||||
defaults: new { controller = "InitialConfig", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
}
|
||||
|
||||
public static void RegisterRoutes(RouteCollection routes)
|
||||
{
|
||||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
||||
|
||||
// Device Route
|
||||
routes.MapRoute(
|
||||
name: "Device", // Route name
|
||||
url: "Device/{action}/{id}", // URL with parameters
|
||||
defaults: new { controller = "Device", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
// Search Route
|
||||
routes.MapRoute(
|
||||
name: "SearchQuery",
|
||||
url: "Search/Query/{SearchQuery}",
|
||||
defaults: new { controller = "Search", action = "Query", SearchQuery = UrlParameter.Optional }
|
||||
);
|
||||
// User Route
|
||||
routes.MapRoute(
|
||||
name: "User", // Route name
|
||||
url: "User/{action}/{id}", // URL with parameters
|
||||
defaults: new { controller = "User", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
|
||||
// Plugin Resources Route
|
||||
routes.MapRoute(
|
||||
name: "Plugin_Resources", // Route name
|
||||
url: "Plugin/{PluginId}/Resources/{*res}", // URL with parameters
|
||||
defaults: new { controller = "PluginWebHandler", action = "Resource" }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
// Plugin Route
|
||||
routes.MapRoute(
|
||||
name: "Plugin", // Route name
|
||||
url: "Plugin/{PluginId}/{PluginAction}", // URL with parameters
|
||||
defaults: new { controller = "PluginWebHandler", action = "Index" }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
|
||||
// Job Route
|
||||
routes.MapRoute(
|
||||
name: "Job", // Route name
|
||||
url: "{controller}/{action}/{id}", // URL with parameters
|
||||
defaults: new { controller = "Job", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace Disco.Web
|
||||
{
|
||||
public class RouteConfig
|
||||
{
|
||||
public static void RegisterInstallRoutes(RouteCollection routes)
|
||||
{
|
||||
// Install Route
|
||||
routes.MapRoute(
|
||||
name: "InitialConfig", // Route name
|
||||
url: "{controller}/{action}/{id}", // URL with parameters
|
||||
defaults: new { controller = "InitialConfig", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
}
|
||||
|
||||
public static void RegisterRoutes(RouteCollection routes)
|
||||
{
|
||||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
||||
|
||||
// Device Route
|
||||
routes.MapRoute(
|
||||
name: "Device", // Route name
|
||||
url: "Device/{action}/{id}", // URL with parameters
|
||||
defaults: new { controller = "Device", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
// Search Route
|
||||
routes.MapRoute(
|
||||
name: "SearchQuery",
|
||||
url: "Search/Query/{SearchQuery}",
|
||||
defaults: new { controller = "Search", action = "Query", SearchQuery = UrlParameter.Optional }
|
||||
);
|
||||
// User Route
|
||||
routes.MapRoute(
|
||||
name: "User", // Route name
|
||||
url: "User/{action}/{id}", // URL with parameters
|
||||
defaults: new { controller = "User", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
|
||||
// Plugin Resources Route
|
||||
routes.MapRoute(
|
||||
name: "Plugin_Resources", // Route name
|
||||
url: "Plugin/{PluginId}/Resources/{*res}", // URL with parameters
|
||||
defaults: new { controller = "PluginWebHandler", action = "Resource" }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
// Plugin Route
|
||||
routes.MapRoute(
|
||||
name: "Plugin", // Route name
|
||||
url: "Plugin/{PluginId}/{PluginAction}", // URL with parameters
|
||||
defaults: new { controller = "PluginWebHandler", action = "Index" }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
|
||||
// Job Route
|
||||
routes.MapRoute(
|
||||
name: "Job", // Route name
|
||||
url: "{controller}/{action}/{id}", // URL with parameters
|
||||
defaults: new { controller = "Job", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
}
|
||||
|
||||
public static void RegisterUpdateRoutes(RouteCollection routes)
|
||||
{
|
||||
// Update Route
|
||||
routes.MapRoute(
|
||||
name: "Update", // Route name
|
||||
url: "{controller}/{action}/{id}", // URL with parameters
|
||||
defaults: new { controller = "Update", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.BI.Interop.Community;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Services.Plugins.CommunityInterop;
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
@@ -20,6 +20,46 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||
}
|
||||
|
||||
public virtual ActionResult UpdateAll()
|
||||
{
|
||||
var status = UpdatePluginTask.UpdateAllPlugins();
|
||||
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||
}
|
||||
|
||||
public virtual ActionResult Update(string PluginId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(PluginId))
|
||||
throw new ArgumentNullException("PluginId");
|
||||
|
||||
var status = UpdatePluginTask.UpdatePlugin(PluginId);
|
||||
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||
}
|
||||
|
||||
public virtual ActionResult UpdateLocal(string PluginId, HttpPostedFileBase Plugin)
|
||||
{
|
||||
if (string.IsNullOrEmpty(PluginId))
|
||||
throw new ArgumentNullException("PluginId");
|
||||
|
||||
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 = UpdatePluginTask.UpdateLocalPlugin(PluginId, tempPluginLocation);
|
||||
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||
}
|
||||
|
||||
public virtual ActionResult Uninstall(string id, bool UninstallData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(id))
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.Models.BI.Interop.Community;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Services.Tasks;
|
||||
using Disco.Web.Areas.Config.Models.Plugins;
|
||||
@@ -16,7 +17,8 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
Models.Plugins.IndexViewModel vm = new Models.Plugins.IndexViewModel()
|
||||
{
|
||||
PluginManifests = Plugins.GetPlugins()
|
||||
PluginManifests = Plugins.GetPlugins(),
|
||||
Catalogue = Plugins.LoadCatalogue(dbContext)
|
||||
};
|
||||
return View(vm);
|
||||
}
|
||||
@@ -72,9 +74,9 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
|
||||
var catalogue = Plugins.LoadCatalogue(dbContext);
|
||||
|
||||
if (catalogue == null || catalogue.ResponseTimestamp < DateTime.Now.AddMinutes(-15))
|
||||
if (catalogue == null || catalogue.ResponseTimestamp < DateTime.Now.AddHours(-1))
|
||||
{
|
||||
// Need to Update Catalogue
|
||||
// Need to Update Catalogue (over 1 hour old)
|
||||
return RedirectToAction(MVC.API.Plugin.UpdateLibraryCatalogue());
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,52 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Services.Plugins.Features.Other;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Plugins
|
||||
{
|
||||
public class IndexViewModel
|
||||
{
|
||||
public List<PluginManifest> PluginManifests { get; set; }
|
||||
|
||||
public List<Tuple<Type, List<PluginManifest>>> PluginManifestsByType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (PluginManifests.Count == 0)
|
||||
return new List<Tuple<Type, List<PluginManifest>>>();
|
||||
|
||||
var categorisedManifests = PluginManifests.SelectMany(pm => pm.Features)
|
||||
.GroupBy(fm => fm.CategoryType)
|
||||
.Select(g => new Tuple<Type, List<PluginManifest>>(g.Key, g.Select(fm => fm.PluginManifest).Distinct().OrderBy(fm => fm.Name).ToList())).ToList();
|
||||
|
||||
// Ensure all plugins are represented
|
||||
var allCategorisedManifests = categorisedManifests.SelectMany(g => g.Item2).ToList();
|
||||
|
||||
var unrepresentedPlugins = PluginManifests.Where(m => !allCategorisedManifests.Contains(m)).ToList();
|
||||
if (unrepresentedPlugins.Count > 0)
|
||||
{
|
||||
Tuple<Type, List<PluginManifest>> otherCategory = null;
|
||||
foreach (var category in categorisedManifests)
|
||||
{
|
||||
if (category.Item1 == typeof(OtherFeature))
|
||||
{
|
||||
otherCategory = category;
|
||||
}
|
||||
}
|
||||
if (otherCategory == null)
|
||||
{
|
||||
otherCategory = new Tuple<Type, List<PluginManifest>>(typeof(OtherFeature), new List<PluginManifest>());
|
||||
categorisedManifests.Add(otherCategory);
|
||||
}
|
||||
foreach (var pluginManifest in unrepresentedPlugins)
|
||||
otherCategory.Item2.Add(pluginManifest);
|
||||
}
|
||||
|
||||
return categorisedManifests;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Models.BI.Interop.Community;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Services.Plugins.Features.Other;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Plugins
|
||||
{
|
||||
public class IndexViewModel
|
||||
{
|
||||
public List<PluginManifest> PluginManifests { get; set; }
|
||||
public PluginLibraryUpdateResponse Catalogue { get; set; }
|
||||
|
||||
private Dictionary<PluginManifest, PluginLibraryItem> _PluginUpdates;
|
||||
public Dictionary<PluginManifest, PluginLibraryItem> PluginUpdates
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_PluginUpdates == null)
|
||||
{
|
||||
if (Catalogue == null || Catalogue.Plugins == null || Catalogue.Plugins.Count == 0 ||
|
||||
PluginManifests == null || PluginManifests.Count == 0)
|
||||
{
|
||||
_PluginUpdates = new Dictionary<PluginManifest, PluginLibraryItem>(); // No Updates
|
||||
}
|
||||
else
|
||||
{
|
||||
_PluginUpdates = PluginManifests.Join((IEnumerable<PluginLibraryItem>)Catalogue.Plugins, manifest => manifest.Id, update => update.Id, (manifest, update) => new Tuple<PluginManifest, PluginLibraryItem>(manifest, update)).Where(i => Version.Parse(i.Item2.LatestVersion) > i.Item1.Version).ToDictionary(i => i.Item1, i => i.Item2);
|
||||
}
|
||||
}
|
||||
return _PluginUpdates;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Tuple<Type, List<PluginManifest>>> PluginManifestsByType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (PluginManifests.Count == 0)
|
||||
return new List<Tuple<Type, List<PluginManifest>>>();
|
||||
|
||||
var categorisedManifests = PluginManifests.SelectMany(pm => pm.Features)
|
||||
.GroupBy(fm => fm.CategoryType)
|
||||
.Select(g => new Tuple<Type, List<PluginManifest>>(g.Key, g.Select(fm => fm.PluginManifest).Distinct().OrderBy(fm => fm.Name).ToList())).ToList();
|
||||
|
||||
// Ensure all plugins are represented
|
||||
var allCategorisedManifests = categorisedManifests.SelectMany(g => g.Item2).ToList();
|
||||
|
||||
var unrepresentedPlugins = PluginManifests.Where(m => !allCategorisedManifests.Contains(m)).ToList();
|
||||
if (unrepresentedPlugins.Count > 0)
|
||||
{
|
||||
Tuple<Type, List<PluginManifest>> otherCategory = null;
|
||||
foreach (var category in categorisedManifests)
|
||||
{
|
||||
if (category.Item1 == typeof(OtherFeature))
|
||||
{
|
||||
otherCategory = category;
|
||||
}
|
||||
}
|
||||
if (otherCategory == null)
|
||||
{
|
||||
otherCategory = new Tuple<Type, List<PluginManifest>>(typeof(OtherFeature), new List<PluginManifest>());
|
||||
categorisedManifests.Add(otherCategory);
|
||||
}
|
||||
foreach (var pluginManifest in unrepresentedPlugins)
|
||||
otherCategory.Item2.Add(pluginManifest);
|
||||
}
|
||||
|
||||
return categorisedManifests;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,260 +1,256 @@
|
||||
@model Disco.Web.Areas.Config.Models.Logging.TaskStatusModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging", MVC.Config.Logging.Index(), "Task Status");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
}
|
||||
<div style="min-height: 300px;">
|
||||
<div id="scheduledTaskStatus" class="form" style="width: 520px;" data-bind="visible: Initialized">
|
||||
<h2 data-bind="text: TaskName">
|
||||
</h2>
|
||||
<table>
|
||||
<tr data-bind="visible: IsRunning">
|
||||
<th class="process" data-bind="text: CurrentProcess">
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
<tr data-bind="visible: IsRunning">
|
||||
<td class="description" data-bind="text: CurrentDescription">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: IsRunning">
|
||||
<td class="progress">
|
||||
<div data-bind="progressValue: Progress">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: FinishedTimestamp">
|
||||
<td class="finishedTimestamp">
|
||||
<h3>
|
||||
Finished: <span data-bind="text: FinishedTimestampFormatted"></span>
|
||||
</h3>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: FinishedTimestamp() && !TaskExceptionMessage()">
|
||||
<td class="finishedMessage" data-bind="css: {finishedRedirect: FinishedUrl}">
|
||||
<span data-bind="text: FinishedMessage"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: TaskExceptionMessage">
|
||||
<td class="exception">
|
||||
Last Error:
|
||||
<div class="code" data-bind="text: TaskExceptionMessage">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: NextScheduledTimestamp">
|
||||
<td class="nextScheduledTimestamp">
|
||||
Next Scheduled: <span data-bind="text: NextScheduledTimestampFormatted"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
ko.bindingHandlers.progressValue = {
|
||||
init: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var $element = $(element);
|
||||
if (!$element.is('.ui-progressbar'))
|
||||
$element.progressbar();
|
||||
},
|
||||
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var v = ko.utils.unwrapObservable(valueAccessor());
|
||||
var vInt = parseInt(v);
|
||||
if (vInt >= 0) {
|
||||
$(element).progressbar('option', 'value', vInt);
|
||||
}
|
||||
}
|
||||
};
|
||||
//* http://webcloud.se/log/JavaScript-and-ISO-8601/
|
||||
Date.prototype.setISO8601 = function (string) {
|
||||
var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
|
||||
"(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" +
|
||||
"(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
|
||||
var d = string.match(new RegExp(regexp));
|
||||
|
||||
var offset = 0;
|
||||
var date = new Date(d[1], 0, 1);
|
||||
|
||||
if (d[3]) { date.setMonth(d[3] - 1); }
|
||||
if (d[5]) { date.setDate(d[5]); }
|
||||
if (d[7]) { date.setHours(d[7]); }
|
||||
if (d[8]) { date.setMinutes(d[8]); }
|
||||
if (d[10]) { date.setSeconds(d[10]); }
|
||||
if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
|
||||
if (d[14]) {
|
||||
offset = (Number(d[16]) * 60) + Number(d[17]);
|
||||
offset *= ((d[15] == '-') ? 1 : -1);
|
||||
}
|
||||
|
||||
offset -= date.getTimezoneOffset();
|
||||
time = (Number(date) + (offset * 60 * 1000));
|
||||
this.setTime(Number(time));
|
||||
return this;
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var sessionId = '@(Model.SessionId)';
|
||||
var sessionStatusUrl = '@(Url.Action(MVC.API.Logging.ScheduledTaskStatus(Model.SessionId)))';
|
||||
|
||||
var view = $('#scheduledTaskStatus');
|
||||
var vm = null;
|
||||
|
||||
var liveConnection = null;
|
||||
|
||||
var statusViewModel = function (sessionId) {
|
||||
var self = this;
|
||||
|
||||
self.Initialized = ko.observable(false);
|
||||
|
||||
self.TimestampParse = function (timestamp) {
|
||||
if (timestamp) {
|
||||
if (timestamp.indexOf("\/Date(") == 0)
|
||||
return new Date(parseInt(timestamp.substr(6)));
|
||||
else
|
||||
return (new Date()).setISO8601(timestamp);
|
||||
}
|
||||
return new Date();
|
||||
}
|
||||
self.TimestampFormat = function (timestamp) {
|
||||
var addZero = function (v) { v = v + ''; if (v.length == 1) v = '0' + v; return v; }
|
||||
return timestamp.getFullYear() + '/' + addZero((1 + timestamp.getMonth())) + '/' + addZero(timestamp.getDate()) + ' ' + addZero(timestamp.getHours()) + ':' + addZero(timestamp.getMinutes()) + ':' + addZero(timestamp.getSeconds());
|
||||
}
|
||||
|
||||
self.SessionId = sessionId;
|
||||
self.TaskName = ko.observable(null);
|
||||
self.StatusVersion = -1;
|
||||
|
||||
self.Progress = ko.observable(0);
|
||||
self.CurrentProcess = ko.observable(null);
|
||||
self.CurrentDescription = ko.observable(null);
|
||||
|
||||
self.IsRunning = ko.observable(null);
|
||||
|
||||
self.TaskExceptionMessage = ko.observable(null);
|
||||
|
||||
self.FinishedTimestamp = ko.observable(null);
|
||||
self.NextScheduledTimestamp = ko.observable(null)
|
||||
|
||||
self.NextScheduledTimestampFormatted = ko.computed(function () {
|
||||
return self.TimestampFormat(self.TimestampParse(self.NextScheduledTimestamp()));
|
||||
});
|
||||
self.FinishedTimestampFormatted = ko.computed(function () {
|
||||
return self.TimestampFormat(self.TimestampParse(self.FinishedTimestamp()));
|
||||
});
|
||||
|
||||
self.FinishedUrl = ko.observable(null);
|
||||
self.FinishedMessage = ko.observable(null);
|
||||
|
||||
self.Finished = function () {
|
||||
if (self.FinishedTimestamp()) {
|
||||
if (self.FinishedUrl() && !self.TaskExceptionMessage()) {
|
||||
if (self.FinishedMessage())
|
||||
window.setTimeout(function () { window.location.href = self.FinishedUrl(); }, 3000);
|
||||
else
|
||||
window.location.href = self.FinishedUrl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.Initialize = function (taskStatus) {
|
||||
self.TaskName(taskStatus.TaskName);
|
||||
self.FinishedUrl(taskStatus.FinishedUrl);
|
||||
|
||||
self.Progress(taskStatus.Progress);
|
||||
self.CurrentProcess(taskStatus.CurrentProcess);
|
||||
self.CurrentDescription(taskStatus.CurrentDescription);
|
||||
|
||||
self.IsRunning(taskStatus.IsRunning);
|
||||
|
||||
self.TaskExceptionMessage(taskStatus.TaskExceptionMessage);
|
||||
|
||||
self.FinishedTimestamp(taskStatus.FinishedTimestamp);
|
||||
self.NextScheduledTimestamp(taskStatus.NextScheduledTimestamp);
|
||||
|
||||
self.FinishedMessage(taskStatus.FinishedMessage);
|
||||
|
||||
self.Initialized(true);
|
||||
|
||||
self.Finished();
|
||||
}
|
||||
self.Update = function (taskStatus) {
|
||||
if (!self.Initialized())
|
||||
return self.Initialize(taskStatus);
|
||||
|
||||
if (taskStatus.StatusVersion < self.StatusVersion)
|
||||
return; // Have Newer Status Update
|
||||
self.StatusVersion = taskStatus.StatusVersion;
|
||||
|
||||
for (var changedPropertyIndex = 0; changedPropertyIndex < taskStatus.ChangedProperties.length; changedPropertyIndex++) {
|
||||
switch (taskStatus.ChangedProperties[changedPropertyIndex]) {
|
||||
case 'Progress':
|
||||
self.Progress(taskStatus.Progress);
|
||||
break;
|
||||
case 'CurrentProcess':
|
||||
self.CurrentProcess(taskStatus.CurrentProcess);
|
||||
break;
|
||||
case 'CurrentDescription':
|
||||
self.CurrentDescription(taskStatus.CurrentDescription);
|
||||
break;
|
||||
case 'IsRunning':
|
||||
self.IsRunning(taskStatus.IsRunning);
|
||||
break;
|
||||
case 'TaskException':
|
||||
self.TaskExceptionMessage(taskStatus.TaskExceptionMessage);
|
||||
break;
|
||||
case 'NextScheduledTimestamp':
|
||||
self.NextScheduledTimestamp(taskStatus.NextScheduledTimestamp);
|
||||
break;
|
||||
case 'FinishedUrl':
|
||||
self.FinishedUrl(taskStatus.FinishedUrl);
|
||||
break;
|
||||
case 'FinishedMessage':
|
||||
self.FinishedMessage(taskStatus.FinishedMessage);
|
||||
break;
|
||||
case 'FinishedTimestamp':
|
||||
self.FinishedTimestamp(taskStatus.FinishedTimestamp);
|
||||
window.setTimeout(self.Finished, 1);
|
||||
break;
|
||||
default:
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vm = new statusViewModel(sessionId);
|
||||
ko.applyBindings(vm, view[0]);
|
||||
|
||||
// Start Live Connection
|
||||
updateWithLive();
|
||||
|
||||
function updateWithAjax(onSuccess) {
|
||||
$.ajax({
|
||||
url: sessionStatusUrl,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
traditional: true,
|
||||
success: update_Received,
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to load Session: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
function updateWithLive() {
|
||||
liveConnection = $.connection('@(Url.Content("~/API/Logging/TaskStatusNotifications"))');
|
||||
liveConnection.received(update_Received);
|
||||
liveConnection.error(function (e) { alert('Live-Status Error: ' + e) });
|
||||
liveConnection.start(function () {
|
||||
liveConnection.send('/addToGroups:' + sessionId);
|
||||
updateWithAjax();
|
||||
});
|
||||
}
|
||||
function update_Received(taskStatus) {
|
||||
vm.Update(taskStatus);
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
@model Disco.Web.Areas.Config.Models.Logging.TaskStatusModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging", MVC.Config.Logging.Index(), "Task Status");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
}
|
||||
<div style="min-height: 300px;">
|
||||
<div id="scheduledTaskStatus" class="form" style="width: 520px;" data-bind="visible: Initialized">
|
||||
<h2 data-bind="text: TaskName"> </h2>
|
||||
<table>
|
||||
<tr data-bind="visible: IsRunning">
|
||||
<th class="process" data-bind="text: CurrentProcess">
|
||||
</th>
|
||||
</tr>
|
||||
<tr data-bind="visible: IsRunning">
|
||||
<td class="description" data-bind="text: CurrentDescription">
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: IsRunning">
|
||||
<td class="progress">
|
||||
<div data-bind="progressValue: Progress">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: FinishedTimestamp">
|
||||
<td class="finishedTimestamp">
|
||||
<h3>Finished: <span data-bind="text: FinishedTimestampFormatted"></span>
|
||||
</h3>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: FinishedTimestamp() && !TaskExceptionMessage()">
|
||||
<td class="finishedMessage" data-bind="css: {finishedRedirect: FinishedUrl}">
|
||||
<span data-bind="text: FinishedMessage"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: TaskExceptionMessage">
|
||||
<td class="exception">Last Error:
|
||||
<div class="code" data-bind="text: TaskExceptionMessage">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: NextScheduledTimestamp">
|
||||
<td class="nextScheduledTimestamp">Next Scheduled: <span data-bind="text: NextScheduledTimestampFormatted"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
ko.bindingHandlers.progressValue = {
|
||||
init: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var $element = $(element);
|
||||
if (!$element.is('.ui-progressbar'))
|
||||
$element.progressbar();
|
||||
},
|
||||
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var v = ko.utils.unwrapObservable(valueAccessor());
|
||||
var vInt = parseInt(v);
|
||||
if (vInt >= 0) {
|
||||
$(element).progressbar('option', 'value', vInt);
|
||||
}
|
||||
}
|
||||
};
|
||||
//* http://webcloud.se/log/JavaScript-and-ISO-8601/
|
||||
Date.prototype.setISO8601 = function (string) {
|
||||
var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
|
||||
"(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" +
|
||||
"(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
|
||||
var d = string.match(new RegExp(regexp));
|
||||
|
||||
var offset = 0;
|
||||
var date = new Date(d[1], 0, 1);
|
||||
|
||||
if (d[3]) { date.setMonth(d[3] - 1); }
|
||||
if (d[5]) { date.setDate(d[5]); }
|
||||
if (d[7]) { date.setHours(d[7]); }
|
||||
if (d[8]) { date.setMinutes(d[8]); }
|
||||
if (d[10]) { date.setSeconds(d[10]); }
|
||||
if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
|
||||
if (d[14]) {
|
||||
offset = (Number(d[16]) * 60) + Number(d[17]);
|
||||
offset *= ((d[15] == '-') ? 1 : -1);
|
||||
}
|
||||
|
||||
offset -= date.getTimezoneOffset();
|
||||
time = (Number(date) + (offset * 60 * 1000));
|
||||
this.setTime(Number(time));
|
||||
return this;
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var sessionId = '@(Model.SessionId)';
|
||||
var sessionStatusUrl = '@(Url.Action(MVC.API.Logging.ScheduledTaskStatus(Model.SessionId)))';
|
||||
|
||||
var view = $('#scheduledTaskStatus');
|
||||
var vm = null;
|
||||
|
||||
var liveConnection = null;
|
||||
|
||||
var statusViewModel = function (sessionId) {
|
||||
var self = this;
|
||||
|
||||
self.Initialized = ko.observable(false);
|
||||
|
||||
self.TimestampParse = function (timestamp) {
|
||||
if (timestamp) {
|
||||
if (timestamp.indexOf("\/Date(") == 0)
|
||||
return new Date(parseInt(timestamp.substr(6)));
|
||||
else
|
||||
return (new Date()).setISO8601(timestamp);
|
||||
}
|
||||
return new Date();
|
||||
}
|
||||
self.TimestampFormat = function (timestamp) {
|
||||
var addZero = function (v) { v = v + ''; if (v.length == 1) v = '0' + v; return v; }
|
||||
return timestamp.getFullYear() + '/' + addZero((1 + timestamp.getMonth())) + '/' + addZero(timestamp.getDate()) + ' ' + addZero(timestamp.getHours()) + ':' + addZero(timestamp.getMinutes()) + ':' + addZero(timestamp.getSeconds());
|
||||
}
|
||||
|
||||
self.SessionId = sessionId;
|
||||
self.TaskName = ko.observable(null);
|
||||
self.StatusVersion = -1;
|
||||
|
||||
self.Progress = ko.observable(0);
|
||||
self.CurrentProcess = ko.observable(null);
|
||||
self.CurrentDescription = ko.observable(null);
|
||||
|
||||
self.IsRunning = ko.observable(null);
|
||||
|
||||
self.TaskExceptionMessage = ko.observable(null);
|
||||
|
||||
self.FinishedTimestamp = ko.observable(null);
|
||||
self.NextScheduledTimestamp = ko.observable(null)
|
||||
|
||||
self.NextScheduledTimestampFormatted = ko.computed(function () {
|
||||
return self.TimestampFormat(self.TimestampParse(self.NextScheduledTimestamp()));
|
||||
});
|
||||
self.FinishedTimestampFormatted = ko.computed(function () {
|
||||
return self.TimestampFormat(self.TimestampParse(self.FinishedTimestamp()));
|
||||
});
|
||||
|
||||
self.FinishedUrl = ko.observable(null);
|
||||
self.FinishedMessage = ko.observable(null);
|
||||
|
||||
self.Finished = function () {
|
||||
if (self.FinishedTimestamp()) {
|
||||
if (self.FinishedUrl() && !self.TaskExceptionMessage()) {
|
||||
if (self.FinishedMessage())
|
||||
window.setTimeout(function () { window.location.href = self.FinishedUrl(); }, 3000);
|
||||
else
|
||||
window.location.href = self.FinishedUrl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.Initialize = function (taskStatus) {
|
||||
self.TaskName(taskStatus.TaskName);
|
||||
self.FinishedUrl(taskStatus.FinishedUrl);
|
||||
|
||||
self.Progress(taskStatus.Progress);
|
||||
self.CurrentProcess(taskStatus.CurrentProcess);
|
||||
self.CurrentDescription(taskStatus.CurrentDescription);
|
||||
|
||||
self.IsRunning(taskStatus.IsRunning);
|
||||
|
||||
self.TaskExceptionMessage(taskStatus.TaskExceptionMessage);
|
||||
|
||||
self.FinishedTimestamp(taskStatus.FinishedTimestamp);
|
||||
self.NextScheduledTimestamp(taskStatus.NextScheduledTimestamp);
|
||||
|
||||
self.FinishedMessage(taskStatus.FinishedMessage);
|
||||
|
||||
self.Initialized(true);
|
||||
|
||||
self.Finished();
|
||||
}
|
||||
self.Update = function (taskStatus) {
|
||||
if (!self.Initialized())
|
||||
return self.Initialize(taskStatus);
|
||||
|
||||
if (taskStatus.StatusVersion < self.StatusVersion)
|
||||
return; // Have Newer Status Update
|
||||
self.StatusVersion = taskStatus.StatusVersion;
|
||||
|
||||
if (taskStatus.ChangedProperties) {
|
||||
for (var changedPropertyIndex = 0; changedPropertyIndex < taskStatus.ChangedProperties.length; changedPropertyIndex++) {
|
||||
switch (taskStatus.ChangedProperties[changedPropertyIndex]) {
|
||||
case 'Progress':
|
||||
self.Progress(taskStatus.Progress);
|
||||
break;
|
||||
case 'CurrentProcess':
|
||||
self.CurrentProcess(taskStatus.CurrentProcess);
|
||||
break;
|
||||
case 'CurrentDescription':
|
||||
self.CurrentDescription(taskStatus.CurrentDescription);
|
||||
break;
|
||||
case 'IsRunning':
|
||||
self.IsRunning(taskStatus.IsRunning);
|
||||
break;
|
||||
case 'TaskException':
|
||||
self.TaskExceptionMessage(taskStatus.TaskExceptionMessage);
|
||||
break;
|
||||
case 'NextScheduledTimestamp':
|
||||
self.NextScheduledTimestamp(taskStatus.NextScheduledTimestamp);
|
||||
break;
|
||||
case 'FinishedUrl':
|
||||
self.FinishedUrl(taskStatus.FinishedUrl);
|
||||
break;
|
||||
case 'FinishedMessage':
|
||||
self.FinishedMessage(taskStatus.FinishedMessage);
|
||||
break;
|
||||
case 'FinishedTimestamp':
|
||||
self.FinishedTimestamp(taskStatus.FinishedTimestamp);
|
||||
window.setTimeout(self.Finished, 1);
|
||||
break;
|
||||
default:
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vm = new statusViewModel(sessionId);
|
||||
ko.applyBindings(vm, view[0]);
|
||||
|
||||
// Start Live Connection
|
||||
updateWithLive();
|
||||
|
||||
function updateWithAjax(onSuccess) {
|
||||
$.ajax({
|
||||
url: sessionStatusUrl,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
traditional: true,
|
||||
success: update_Received,
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to load Session: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
function updateWithLive() {
|
||||
liveConnection = $.connection('@(Url.Content("~/API/Logging/TaskStatusNotifications"))');
|
||||
liveConnection.received(update_Received);
|
||||
liveConnection.error(function (e) { alert('Live-Status Error: ' + e) });
|
||||
liveConnection.start(function () {
|
||||
liveConnection.send('/addToGroups:' + sessionId);
|
||||
updateWithAjax();
|
||||
});
|
||||
}
|
||||
function update_Received(taskStatus) {
|
||||
vm.Update(taskStatus);
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,314 +1,314 @@
|
||||
#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.Logging
|
||||
{
|
||||
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;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Logging/TaskStatus.cshtml")]
|
||||
public class TaskStatus : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Logging.TaskStatusModel>
|
||||
{
|
||||
public TaskStatus()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging", MVC.Config.Logging.Index(), "Task Status");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" style=\"min-height: 300px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"scheduledTaskStatus\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 520px;\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: Initialized\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: TaskName\"");
|
||||
|
||||
WriteLiteral(">\r\n </h2>\r\n <table>\r\n <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: IsRunning\"");
|
||||
|
||||
WriteLiteral(">\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"process\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: CurrentProcess\"");
|
||||
|
||||
WriteLiteral(">\r\n \r\n </th>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: IsRunning\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"description\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: CurrentDescription\"");
|
||||
|
||||
WriteLiteral(">\r\n \r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: IsRunning\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"progress\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" data-bind=\"progressValue: Progress\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: FinishedTimestamp\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"finishedTimestamp\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>\r\n Finished: <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: FinishedTimestampFormatted\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </h3>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: FinishedTimestamp() && !TaskExceptionMessage()\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"finishedMessage\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"css: {finishedRedirect: FinishedUrl}\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: FinishedMessage\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: TaskExceptionMessage\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"exception\"");
|
||||
|
||||
WriteLiteral(">\r\n Last Error:\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: TaskExceptionMessage\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: NextScheduledTimestamp\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"nextScheduledTimestamp\"");
|
||||
|
||||
WriteLiteral(">\r\n Next Scheduled: <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: NextScheduledTimestampFormatted\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r" +
|
||||
"\n</div>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n ko.bindingHandlers.progressValue = {\r\n init: function (element, val" +
|
||||
"ueAccessor, allBindingsAccessor, viewModel) {\r\n var $element = $(elem" +
|
||||
"ent);\r\n if (!$element.is(\'.ui-progressbar\'))\r\n $elemen" +
|
||||
"t.progressbar();\r\n },\r\n update: function (element, valueAccessor, " +
|
||||
"allBindingsAccessor, viewModel) {\r\n var v = ko.utils.unwrapObservable" +
|
||||
"(valueAccessor());\r\n var vInt = parseInt(v);\r\n if (vInt >=" +
|
||||
" 0) {\r\n $(element).progressbar(\'option\', \'value\', vInt);\r\n " +
|
||||
" }\r\n }\r\n };\r\n //* http://webcloud.se/log/JavaScript-and-ISO-860" +
|
||||
"1/\r\n Date.prototype.setISO8601 = function (string) {\r\n var regexp = \"(" +
|
||||
"[0-9]{4})(-([0-9]{2})(-([0-9]{2})\" +\r\n \"(T([0-9]{2}):([0-9]{2})(:([0-9]{2" +
|
||||
"})(\\.([0-9]+))?)?\" +\r\n \"(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?\";\r\n " +
|
||||
" var d = string.match(new RegExp(regexp));\r\n\r\n var offset = 0;\r\n " +
|
||||
" var date = new Date(d[1], 0, 1);\r\n\r\n if (d[3]) { date.setMonth(d[3] - 1)" +
|
||||
"; }\r\n if (d[5]) { date.setDate(d[5]); }\r\n if (d[7]) { date.setHour" +
|
||||
"s(d[7]); }\r\n if (d[8]) { date.setMinutes(d[8]); }\r\n if (d[10]) { d" +
|
||||
"ate.setSeconds(d[10]); }\r\n if (d[12]) { date.setMilliseconds(Number(\"0.\" " +
|
||||
"+ d[12]) * 1000); }\r\n if (d[14]) {\r\n offset = (Number(d[16]) *" +
|
||||
" 60) + Number(d[17]);\r\n offset *= ((d[15] == \'-\') ? 1 : -1);\r\n " +
|
||||
" }\r\n\r\n offset -= date.getTimezoneOffset();\r\n time = (Number(date) " +
|
||||
"+ (offset * 60 * 1000));\r\n this.setTime(Number(time));\r\n return th" +
|
||||
"is;\r\n }\r\n</script>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var sessionId = \'");
|
||||
|
||||
|
||||
#line 99 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
Write(Model.SessionId);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n var sessionStatusUrl = \'");
|
||||
|
||||
|
||||
#line 100 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
Write(Url.Action(MVC.API.Logging.ScheduledTaskStatus(Model.SessionId)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n\r\n var view = $(\'#scheduledTaskStatus\');\r\n var vm = null;\r\n\r\n " +
|
||||
" var liveConnection = null;\r\n\r\n var statusViewModel = function (sess" +
|
||||
"ionId) {\r\n var self = this;\r\n\r\n self.Initialized = ko.obse" +
|
||||
"rvable(false);\r\n\r\n self.TimestampParse = function (timestamp) {\r\n " +
|
||||
" if (timestamp) {\r\n if (timestamp.indexOf(\"\\/Date(" +
|
||||
"\") == 0)\r\n return new Date(parseInt(timestamp.substr(6)))" +
|
||||
";\r\n else\r\n return (new Date()).setISO8" +
|
||||
"601(timestamp);\r\n }\r\n return new Date();\r\n " +
|
||||
" }\r\n self.TimestampFormat = function (timestamp) {\r\n " +
|
||||
" var addZero = function (v) { v = v + \'\'; if (v.length == 1) v = \'0\' + v; retur" +
|
||||
"n v; }\r\n return timestamp.getFullYear() + \'/\' + addZero((1 + time" +
|
||||
"stamp.getMonth())) + \'/\' + addZero(timestamp.getDate()) + \' \' + addZero(timestam" +
|
||||
"p.getHours()) + \':\' + addZero(timestamp.getMinutes()) + \':\' + addZero(timestamp." +
|
||||
"getSeconds());\r\n }\r\n\r\n self.SessionId = sessionId;\r\n " +
|
||||
" self.TaskName = ko.observable(null);\r\n self.StatusVersion = -1;" +
|
||||
"\r\n\r\n self.Progress = ko.observable(0);\r\n self.CurrentProce" +
|
||||
"ss = ko.observable(null);\r\n self.CurrentDescription = ko.observable(n" +
|
||||
"ull);\r\n\r\n self.IsRunning = ko.observable(null);\r\n\r\n self.T" +
|
||||
"askExceptionMessage = ko.observable(null);\r\n\r\n self.FinishedTimestamp" +
|
||||
" = ko.observable(null);\r\n self.NextScheduledTimestamp = ko.observable" +
|
||||
"(null)\r\n\r\n self.NextScheduledTimestampFormatted = ko.computed(functio" +
|
||||
"n () {\r\n return self.TimestampFormat(self.TimestampParse(self.Nex" +
|
||||
"tScheduledTimestamp()));\r\n });\r\n self.FinishedTimestampFor" +
|
||||
"matted = ko.computed(function () {\r\n return self.TimestampFormat(" +
|
||||
"self.TimestampParse(self.FinishedTimestamp()));\r\n });\r\n\r\n " +
|
||||
"self.FinishedUrl = ko.observable(null);\r\n self.FinishedMessage = ko.o" +
|
||||
"bservable(null);\r\n\r\n self.Finished = function () {\r\n i" +
|
||||
"f (self.FinishedTimestamp()) {\r\n if (self.FinishedUrl() && !s" +
|
||||
"elf.TaskExceptionMessage()) {\r\n if (self.FinishedMessage(" +
|
||||
"))\r\n window.setTimeout(function () { window.location." +
|
||||
"href = self.FinishedUrl(); }, 3000);\r\n else\r\n " +
|
||||
" window.location.href = self.FinishedUrl();\r\n " +
|
||||
"}\r\n }\r\n }\r\n\r\n self.Initialize = function (t" +
|
||||
"askStatus) {\r\n self.TaskName(taskStatus.TaskName);\r\n " +
|
||||
" self.FinishedUrl(taskStatus.FinishedUrl);\r\n\r\n self.Progress(ta" +
|
||||
"skStatus.Progress);\r\n self.CurrentProcess(taskStatus.CurrentProce" +
|
||||
"ss);\r\n self.CurrentDescription(taskStatus.CurrentDescription);\r\n\r" +
|
||||
"\n self.IsRunning(taskStatus.IsRunning);\r\n\r\n self.T" +
|
||||
"askExceptionMessage(taskStatus.TaskExceptionMessage);\r\n\r\n self.Fi" +
|
||||
"nishedTimestamp(taskStatus.FinishedTimestamp);\r\n self.NextSchedul" +
|
||||
"edTimestamp(taskStatus.NextScheduledTimestamp);\r\n\r\n self.Finished" +
|
||||
"Message(taskStatus.FinishedMessage);\r\n\r\n self.Initialized(true);\r" +
|
||||
"\n\r\n self.Finished();\r\n }\r\n self.Update = fu" +
|
||||
"nction (taskStatus) {\r\n if (!self.Initialized())\r\n " +
|
||||
" return self.Initialize(taskStatus);\r\n\r\n if (taskStatus.Statu" +
|
||||
"sVersion < self.StatusVersion)\r\n return; // Have Newer Status" +
|
||||
" Update\r\n self.StatusVersion = taskStatus.StatusVersion;\r\n\r\n " +
|
||||
" for (var changedPropertyIndex = 0; changedPropertyIndex < taskStatus." +
|
||||
"ChangedProperties.length; changedPropertyIndex++) {\r\n switch " +
|
||||
"(taskStatus.ChangedProperties[changedPropertyIndex]) {\r\n " +
|
||||
"case \'Progress\':\r\n self.Progress(taskStatus.Progress)" +
|
||||
";\r\n break;\r\n case \'CurrentProc" +
|
||||
"ess\':\r\n self.CurrentProcess(taskStatus.CurrentProcess" +
|
||||
");\r\n break;\r\n case \'CurrentDes" +
|
||||
"cription\':\r\n self.CurrentDescription(taskStatus.Curre" +
|
||||
"ntDescription);\r\n break;\r\n cas" +
|
||||
"e \'IsRunning\':\r\n self.IsRunning(taskStatus.IsRunning)" +
|
||||
";\r\n break;\r\n case \'TaskExcepti" +
|
||||
"on\':\r\n self.TaskExceptionMessage(taskStatus.TaskExcep" +
|
||||
"tionMessage);\r\n break;\r\n case " +
|
||||
"\'NextScheduledTimestamp\':\r\n self.NextScheduledTimesta" +
|
||||
"mp(taskStatus.NextScheduledTimestamp);\r\n break;\r\n " +
|
||||
" case \'FinishedUrl\':\r\n self.Finish" +
|
||||
"edUrl(taskStatus.FinishedUrl);\r\n break;\r\n " +
|
||||
" case \'FinishedMessage\':\r\n self.FinishedMe" +
|
||||
"ssage(taskStatus.FinishedMessage);\r\n break;\r\n " +
|
||||
" case \'FinishedTimestamp\':\r\n self.Fini" +
|
||||
"shedTimestamp(taskStatus.FinishedTimestamp);\r\n window" +
|
||||
".setTimeout(self.Finished, 1);\r\n break;\r\n " +
|
||||
" default:\r\n // Ignore\r\n " +
|
||||
" }\r\n }\r\n }\r\n }\r\n\r\n vm = new statusViewMo" +
|
||||
"del(sessionId);\r\n ko.applyBindings(vm, view[0]);\r\n\r\n // Start Live" +
|
||||
" Connection\r\n updateWithLive();\r\n\r\n function updateWithAjax(onSucc" +
|
||||
"ess) {\r\n $.ajax({\r\n url: sessionStatusUrl,\r\n " +
|
||||
" dataType: \'json\',\r\n type: \'POST\',\r\n traditio" +
|
||||
"nal: true,\r\n success: update_Received,\r\n error: fu" +
|
||||
"nction (jqXHR, textStatus, errorThrown) {\r\n alert(\'Unable to " +
|
||||
"load Session: \' + errorThrown);\r\n }\r\n });\r\n }\r\n" +
|
||||
" function updateWithLive() {\r\n liveConnection = $.connection(\'" +
|
||||
"");
|
||||
|
||||
|
||||
#line 247 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
Write(Url.Content("~/API/Logging/TaskStatusNotifications"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"');
|
||||
liveConnection.received(update_Received);
|
||||
liveConnection.error(function (e) { alert('Live-Status Error: ' + e) });
|
||||
liveConnection.start(function () {
|
||||
liveConnection.send('/addToGroups:' + sessionId);
|
||||
updateWithAjax();
|
||||
});
|
||||
}
|
||||
function update_Received(taskStatus) {
|
||||
vm.Update(taskStatus);
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#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.Logging
|
||||
{
|
||||
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;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Logging/TaskStatus.cshtml")]
|
||||
public class TaskStatus : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Logging.TaskStatusModel>
|
||||
{
|
||||
public TaskStatus()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging", MVC.Config.Logging.Index(), "Task Status");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" style=\"min-height: 300px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"scheduledTaskStatus\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 520px;\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: Initialized\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: TaskName\"");
|
||||
|
||||
WriteLiteral("> </h2>\r\n <table>\r\n <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: IsRunning\"");
|
||||
|
||||
WriteLiteral(">\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"process\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: CurrentProcess\"");
|
||||
|
||||
WriteLiteral("> \r\n </th>\r\n </tr>\r\n <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: IsRunning\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"description\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: CurrentDescription\"");
|
||||
|
||||
WriteLiteral("> \r\n </td>\r\n </tr>\r\n <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: IsRunning\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"progress\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" data-bind=\"progressValue: Progress\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: FinishedTimestamp\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"finishedTimestamp\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>Finished: <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: FinishedTimestampFormatted\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </h3>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: FinishedTimestamp() && !TaskExceptionMessage()\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"finishedMessage\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"css: {finishedRedirect: FinishedUrl}\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: FinishedMessage\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: TaskExceptionMessage\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"exception\"");
|
||||
|
||||
WriteLiteral(">Last Error:\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: TaskExceptionMessage\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: NextScheduledTimestamp\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"nextScheduledTimestamp\"");
|
||||
|
||||
WriteLiteral(">Next Scheduled: <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: NextScheduledTimestampFormatted\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r" +
|
||||
"\n</div>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n ko.bindingHandlers.progressValue = {\r\n init: function (element, val" +
|
||||
"ueAccessor, allBindingsAccessor, viewModel) {\r\n var $element = $(elem" +
|
||||
"ent);\r\n if (!$element.is(\'.ui-progressbar\'))\r\n $elemen" +
|
||||
"t.progressbar();\r\n },\r\n update: function (element, valueAccessor, " +
|
||||
"allBindingsAccessor, viewModel) {\r\n var v = ko.utils.unwrapObservable" +
|
||||
"(valueAccessor());\r\n var vInt = parseInt(v);\r\n if (vInt >=" +
|
||||
" 0) {\r\n $(element).progressbar(\'option\', \'value\', vInt);\r\n " +
|
||||
" }\r\n }\r\n };\r\n //* http://webcloud.se/log/JavaScript-and-ISO-860" +
|
||||
"1/\r\n Date.prototype.setISO8601 = function (string) {\r\n var regexp = \"(" +
|
||||
"[0-9]{4})(-([0-9]{2})(-([0-9]{2})\" +\r\n \"(T([0-9]{2}):([0-9]{2})(:([0-9]{2" +
|
||||
"})(\\.([0-9]+))?)?\" +\r\n \"(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?\";\r\n " +
|
||||
" var d = string.match(new RegExp(regexp));\r\n\r\n var offset = 0;\r\n " +
|
||||
" var date = new Date(d[1], 0, 1);\r\n\r\n if (d[3]) { date.setMonth(d[3] - 1)" +
|
||||
"; }\r\n if (d[5]) { date.setDate(d[5]); }\r\n if (d[7]) { date.setHour" +
|
||||
"s(d[7]); }\r\n if (d[8]) { date.setMinutes(d[8]); }\r\n if (d[10]) { d" +
|
||||
"ate.setSeconds(d[10]); }\r\n if (d[12]) { date.setMilliseconds(Number(\"0.\" " +
|
||||
"+ d[12]) * 1000); }\r\n if (d[14]) {\r\n offset = (Number(d[16]) *" +
|
||||
" 60) + Number(d[17]);\r\n offset *= ((d[15] == \'-\') ? 1 : -1);\r\n " +
|
||||
" }\r\n\r\n offset -= date.getTimezoneOffset();\r\n time = (Number(date) " +
|
||||
"+ (offset * 60 * 1000));\r\n this.setTime(Number(time));\r\n return th" +
|
||||
"is;\r\n }\r\n</script>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var sessionId = \'");
|
||||
|
||||
|
||||
#line 93 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
Write(Model.SessionId);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n var sessionStatusUrl = \'");
|
||||
|
||||
|
||||
#line 94 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
Write(Url.Action(MVC.API.Logging.ScheduledTaskStatus(Model.SessionId)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n\r\n var view = $(\'#scheduledTaskStatus\');\r\n var vm = null;\r\n\r\n " +
|
||||
" var liveConnection = null;\r\n\r\n var statusViewModel = function (sess" +
|
||||
"ionId) {\r\n var self = this;\r\n\r\n self.Initialized = ko.obse" +
|
||||
"rvable(false);\r\n\r\n self.TimestampParse = function (timestamp) {\r\n " +
|
||||
" if (timestamp) {\r\n if (timestamp.indexOf(\"\\/Date(" +
|
||||
"\") == 0)\r\n return new Date(parseInt(timestamp.substr(6)))" +
|
||||
";\r\n else\r\n return (new Date()).setISO8" +
|
||||
"601(timestamp);\r\n }\r\n return new Date();\r\n " +
|
||||
" }\r\n self.TimestampFormat = function (timestamp) {\r\n " +
|
||||
" var addZero = function (v) { v = v + \'\'; if (v.length == 1) v = \'0\' + v; retur" +
|
||||
"n v; }\r\n return timestamp.getFullYear() + \'/\' + addZero((1 + time" +
|
||||
"stamp.getMonth())) + \'/\' + addZero(timestamp.getDate()) + \' \' + addZero(timestam" +
|
||||
"p.getHours()) + \':\' + addZero(timestamp.getMinutes()) + \':\' + addZero(timestamp." +
|
||||
"getSeconds());\r\n }\r\n\r\n self.SessionId = sessionId;\r\n " +
|
||||
" self.TaskName = ko.observable(null);\r\n self.StatusVersion = -1;" +
|
||||
"\r\n\r\n self.Progress = ko.observable(0);\r\n self.CurrentProce" +
|
||||
"ss = ko.observable(null);\r\n self.CurrentDescription = ko.observable(n" +
|
||||
"ull);\r\n\r\n self.IsRunning = ko.observable(null);\r\n\r\n self.T" +
|
||||
"askExceptionMessage = ko.observable(null);\r\n\r\n self.FinishedTimestamp" +
|
||||
" = ko.observable(null);\r\n self.NextScheduledTimestamp = ko.observable" +
|
||||
"(null)\r\n\r\n self.NextScheduledTimestampFormatted = ko.computed(functio" +
|
||||
"n () {\r\n return self.TimestampFormat(self.TimestampParse(self.Nex" +
|
||||
"tScheduledTimestamp()));\r\n });\r\n self.FinishedTimestampFor" +
|
||||
"matted = ko.computed(function () {\r\n return self.TimestampFormat(" +
|
||||
"self.TimestampParse(self.FinishedTimestamp()));\r\n });\r\n\r\n " +
|
||||
"self.FinishedUrl = ko.observable(null);\r\n self.FinishedMessage = ko.o" +
|
||||
"bservable(null);\r\n\r\n self.Finished = function () {\r\n i" +
|
||||
"f (self.FinishedTimestamp()) {\r\n if (self.FinishedUrl() && !s" +
|
||||
"elf.TaskExceptionMessage()) {\r\n if (self.FinishedMessage(" +
|
||||
"))\r\n window.setTimeout(function () { window.location." +
|
||||
"href = self.FinishedUrl(); }, 3000);\r\n else\r\n " +
|
||||
" window.location.href = self.FinishedUrl();\r\n " +
|
||||
"}\r\n }\r\n }\r\n\r\n self.Initialize = function (t" +
|
||||
"askStatus) {\r\n self.TaskName(taskStatus.TaskName);\r\n " +
|
||||
" self.FinishedUrl(taskStatus.FinishedUrl);\r\n\r\n self.Progress(ta" +
|
||||
"skStatus.Progress);\r\n self.CurrentProcess(taskStatus.CurrentProce" +
|
||||
"ss);\r\n self.CurrentDescription(taskStatus.CurrentDescription);\r\n\r" +
|
||||
"\n self.IsRunning(taskStatus.IsRunning);\r\n\r\n self.T" +
|
||||
"askExceptionMessage(taskStatus.TaskExceptionMessage);\r\n\r\n self.Fi" +
|
||||
"nishedTimestamp(taskStatus.FinishedTimestamp);\r\n self.NextSchedul" +
|
||||
"edTimestamp(taskStatus.NextScheduledTimestamp);\r\n\r\n self.Finished" +
|
||||
"Message(taskStatus.FinishedMessage);\r\n\r\n self.Initialized(true);\r" +
|
||||
"\n\r\n self.Finished();\r\n }\r\n self.Update = fu" +
|
||||
"nction (taskStatus) {\r\n if (!self.Initialized())\r\n " +
|
||||
" return self.Initialize(taskStatus);\r\n\r\n if (taskStatus.Statu" +
|
||||
"sVersion < self.StatusVersion)\r\n return; // Have Newer Status" +
|
||||
" Update\r\n self.StatusVersion = taskStatus.StatusVersion;\r\n\r\n " +
|
||||
" if (taskStatus.ChangedProperties) {\r\n for (var cha" +
|
||||
"ngedPropertyIndex = 0; changedPropertyIndex < taskStatus.ChangedProperties.lengt" +
|
||||
"h; changedPropertyIndex++) {\r\n switch (taskStatus.Changed" +
|
||||
"Properties[changedPropertyIndex]) {\r\n case \'Progress\'" +
|
||||
":\r\n self.Progress(taskStatus.Progress);\r\n " +
|
||||
" break;\r\n case \'CurrentProcess" +
|
||||
"\':\r\n self.CurrentProcess(taskStatus.CurrentProces" +
|
||||
"s);\r\n break;\r\n case \'C" +
|
||||
"urrentDescription\':\r\n self.CurrentDescription(tas" +
|
||||
"kStatus.CurrentDescription);\r\n break;\r\n " +
|
||||
" case \'IsRunning\':\r\n self.IsRunn" +
|
||||
"ing(taskStatus.IsRunning);\r\n break;\r\n " +
|
||||
" case \'TaskException\':\r\n self.Task" +
|
||||
"ExceptionMessage(taskStatus.TaskExceptionMessage);\r\n " +
|
||||
" break;\r\n case \'NextScheduledTimestamp\':\r\n " +
|
||||
" self.NextScheduledTimestamp(taskStatus.NextScheduledTime" +
|
||||
"stamp);\r\n break;\r\n cas" +
|
||||
"e \'FinishedUrl\':\r\n self.FinishedUrl(taskStatus.Fi" +
|
||||
"nishedUrl);\r\n break;\r\n " +
|
||||
" case \'FinishedMessage\':\r\n self.FinishedMessage(t" +
|
||||
"askStatus.FinishedMessage);\r\n break;\r\n " +
|
||||
" case \'FinishedTimestamp\':\r\n self" +
|
||||
".FinishedTimestamp(taskStatus.FinishedTimestamp);\r\n " +
|
||||
" window.setTimeout(self.Finished, 1);\r\n break;\r" +
|
||||
"\n default:\r\n // Ignore" +
|
||||
"\r\n }\r\n }\r\n }\r\n " +
|
||||
" }\r\n }\r\n\r\n vm = new statusViewModel(sessionId);\r\n ko.appl" +
|
||||
"yBindings(vm, view[0]);\r\n\r\n // Start Live Connection\r\n updateWithL" +
|
||||
"ive();\r\n\r\n function updateWithAjax(onSuccess) {\r\n $.ajax({\r\n " +
|
||||
" url: sessionStatusUrl,\r\n dataType: \'json\',\r\n " +
|
||||
" type: \'POST\',\r\n traditional: true,\r\n succ" +
|
||||
"ess: update_Received,\r\n error: function (jqXHR, textStatus, error" +
|
||||
"Thrown) {\r\n alert(\'Unable to load Session: \' + errorThrown);\r" +
|
||||
"\n }\r\n });\r\n }\r\n function updateWithLive(" +
|
||||
") {\r\n liveConnection = $.connection(\'");
|
||||
|
||||
|
||||
#line 243 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
Write(Url.Content("~/API/Logging/TaskStatusNotifications"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"');
|
||||
liveConnection.received(update_Received);
|
||||
liveConnection.error(function (e) { alert('Live-Status Error: ' + e) });
|
||||
liveConnection.start(function () {
|
||||
liveConnection.send('/addToGroups:' + sessionId);
|
||||
updateWithAjax();
|
||||
});
|
||||
}
|
||||
function update_Received(taskStatus) {
|
||||
vm.Update(taskStatus);
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
||||
@@ -72,85 +72,102 @@
|
||||
$(function () {
|
||||
// Uninstall
|
||||
var uninstallUrl = '@(Url.Action(MVC.API.Plugin.Uninstall()))/';
|
||||
var uninstallPlugin, uninstallPluginData, $dialogConfirm, uninstallPluginConfirm, uninstallPluginDataConfirm;
|
||||
var uninstallPlugin, uninstallPluginData, $dialogConfirm, uninstallPluginConfirm, uninstallPluginDataConfirm;
|
||||
|
||||
var pluginId, pluginName, pluginUninstallData;
|
||||
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');
|
||||
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();
|
||||
if (!pluginId) {
|
||||
alert('Select a plugin to uninstall');
|
||||
} else {
|
||||
uninstallPluginConfirm.text(pluginName + ' [' + pluginId + ']');
|
||||
if (pluginUninstallData)
|
||||
uninstallPluginDataConfirm.show();
|
||||
else
|
||||
uninstallPluginDataConfirm.hide();
|
||||
|
||||
$dialogConfirm.dialog('open');
|
||||
$dialogConfirm.dialog('open');
|
||||
$(this).dialog("close");
|
||||
}
|
||||
},
|
||||
Cancel: function () {
|
||||
uninstallPluginData.removeAttr('checked');
|
||||
$('#uninstallPluginDataAlert').hide();
|
||||
$(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'
|
||||
$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");
|
||||
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');
|
||||
uninstallPlugin = $('#uninstallPlugin');
|
||||
uninstallPluginData = $('#uninstallPluginData');
|
||||
uninstallPluginConfirm = $('#uninstallPluginConfirm');
|
||||
uninstallPluginDataConfirm = $('#uninstallPluginDataConfirm');
|
||||
|
||||
$('#buttonUninstall').click(function () {
|
||||
$dialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
$('#buttonUninstall').click(function () {
|
||||
$dialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#uninstallPluginData').change(function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#uninstallPluginDataAlert').slideDown();
|
||||
} else {
|
||||
$('#uninstallPluginDataAlert').slideUp();
|
||||
}
|
||||
$('#uninstallPluginData').change(function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#uninstallPluginDataAlert').slideDown();
|
||||
} else {
|
||||
$('#uninstallPluginDataAlert').slideUp();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
if (Model.PluginUpdates.Count > 0)
|
||||
{
|
||||
<div id="updateAvailableContainer">
|
||||
<div>@(Model.PluginUpdates.Count) plugin update@(Model.PluginUpdates.Count == 1 ? " is" : "s are") available</div>
|
||||
@Html.ActionLinkButton("Update Now", MVC.API.Plugin.UpdateAll())
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
$(function () {
|
||||
var layout_PageHeading = $('#layout_PageHeading').height(80);
|
||||
var updateAvailableContainer = $('#updateAvailableContainer');
|
||||
updateAvailableContainer.appendTo(layout_PageHeading);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -365,51 +365,110 @@ WriteLiteral(" <script>\r\n $(function () {\r\n
|
||||
|
||||
#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");
|
||||
WriteLiteral("/\';\r\n var uninstallPlugin, uninstallPluginData, $dialogConfirm, un" +
|
||||
"installPluginConfirm, uninstallPluginDataConfirm;\r\n\r\n var pluginI" +
|
||||
"d, pluginName, pluginUninstallData;\r\n\r\n var $dialog = $(\'#dialogU" +
|
||||
"ninstallPlugins\').dialog({\r\n resizable: false,\r\n " +
|
||||
" modal: true,\r\n width: 350,\r\n autoOp" +
|
||||
"en: false,\r\n buttons: {\r\n \"Uninstall\":" +
|
||||
" function () {\r\n pluginId = uninstallPlugin.val();\r\n " +
|
||||
" pluginName = uninstallPlugin.find(\'option:selected\')." +
|
||||
"text();\r\n pluginUninstallData = uninstallPluginData.i" +
|
||||
"s(\':checked\');\r\n\r\n if (!pluginId) {\r\n " +
|
||||
" alert(\'Select a plugin to uninstall\');\r\n " +
|
||||
" } else {\r\n uninstallPluginConfirm.text(plugin" +
|
||||
"Name + \' [\' + pluginId + \']\');\r\n if (pluginUninst" +
|
||||
"allData)\r\n uninstallPluginDataConfirm.show();" +
|
||||
"\r\n else\r\n unin" +
|
||||
"stallPluginDataConfirm.hide();\r\n\r\n $dialogConfirm" +
|
||||
".dialog(\'open\');\r\n $(this).dialog(\"close\");\r\n " +
|
||||
" }\r\n },\r\n C" +
|
||||
"ancel: 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: fa" +
|
||||
"lse,\r\n modal: true,\r\n width: 350,\r\n " +
|
||||
" autoOpen: false,\r\n buttons: {\r\n " +
|
||||
" \"Confirm Uninstall\": function () {\r\n var url =" +
|
||||
" 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).dialog(\"disable\");\r\n },\r\n " +
|
||||
" Cancel: function () {\r\n uninstallPluginData.re" +
|
||||
"moveAttr(\'checked\');\r\n $(\'#uninstallPluginDataAlert\')" +
|
||||
".hide();\r\n $(this).dialog(\"close\");\r\n " +
|
||||
" }\r\n }\r\n });\r\n\r\n uninsta" +
|
||||
"llPlugin = $(\'#uninstallPlugin\');\r\n uninstallPluginData = $(\'#uni" +
|
||||
"nstallPluginData\');\r\n uninstallPluginConfirm = $(\'#uninstallPlugi" +
|
||||
"nConfirm\');\r\n uninstallPluginDataConfirm = $(\'#uninstallPluginDat" +
|
||||
"aConfirm\');\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 $(\'#" +
|
||||
"uninstallPluginDataAlert\').slideDown();\r\n } else {\r\n " +
|
||||
" $(\'#uninstallPluginDataAlert\').slideUp();\r\n }\r" +
|
||||
"\n });\r\n });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 154 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
if (Model.PluginUpdates.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"updateAvailableContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n <div>");
|
||||
|
||||
|
||||
#line 158 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Model.PluginUpdates.Count);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" plugin update");
|
||||
|
||||
|
||||
#line 158 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Model.PluginUpdates.Count == 1 ? " is" : "s are");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" available</div>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 159 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Update Now", MVC.API.Plugin.UpdateAll()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(@" <script>
|
||||
(function () {
|
||||
$(function () {
|
||||
var layout_PageHeading = $('#layout_PageHeading').height(80);
|
||||
var updateAvailableContainer = $('#updateAvailableContainer');
|
||||
updateAvailableContainer.appendTo(layout_PageHeading);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 170 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -422,13 +481,13 @@ WriteLiteral(" class=\"actionBar\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 158 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
#line 175 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 158 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
#line 175 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
if (Model.PluginManifests.Count > 0)
|
||||
{
|
||||
|
||||
@@ -436,14 +495,14 @@ WriteLiteral(">\r\n");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 160 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
#line 177 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Uninstall Plugins", MVC.Config.Plugins.Index(), "buttonUninstall"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 160 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
#line 177 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
@@ -453,7 +512,7 @@ WriteLiteral(">\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 162 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
#line 179 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Install Plugins", MVC.Config.Plugins.Install()));
|
||||
|
||||
|
||||
|
||||
@@ -28,10 +28,19 @@
|
||||
{
|
||||
var plugin = plugins[itemNextId];
|
||||
itemNextId++;
|
||||
<div class="pageMenuArea pluginItem@(Plugins.PluginInstalled(plugin.Id) ? " pluginInstalled" : string.Empty)">
|
||||
<a class="pluginInstallLink" href="@(Url.Action(MVC.API.Plugin.Install(plugin.Id)))">
|
||||
<h2 class="pluginName">@plugin.Name</h2>
|
||||
</a>
|
||||
var installedPlugin = Plugins.PluginInstalled(plugin.Id) ? Plugins.GetPlugin(plugin.Id) : null;
|
||||
<div class="pageMenuArea pluginItem@(installedPlugin != null ? " pluginInstalled" : string.Empty)">
|
||||
<h2 class="pluginName">@plugin.Name
|
||||
@if (installedPlugin == null){
|
||||
<a class="pluginInstallLink button" href="@(Url.Action(MVC.API.Plugin.Install(plugin.Id)))">Install</a>
|
||||
}else{
|
||||
if (Version.Parse(plugin.LatestVersion) > installedPlugin.Version){
|
||||
<a class="pluginUpdateLink button" href="@(Url.Action(MVC.API.Plugin.Update(plugin.Id)))">Update</a>
|
||||
}else{
|
||||
<a class="pluginInstalledLink button disabled" href="#">Installed</a>
|
||||
}
|
||||
}
|
||||
</h2>
|
||||
<div class="pluginItemBlurb">@(new HtmlString(plugin.Blurb))</div>
|
||||
<div class="pageMenuBlurb">
|
||||
<span class="pluginId">@plugin.Id</span> | <span class="pluginVersion">v@(plugin.LatestVersion)</span> | @plugin.Author | <a href="@plugin.Url" target="_blank">More Information</a>
|
||||
@@ -100,14 +109,26 @@
|
||||
$selectedPlugin = $this.closest('.pluginItem');
|
||||
$selectedPluginUrl = $this.attr('href');
|
||||
|
||||
if ($selectedPlugin.is('.pluginInstalled')) {
|
||||
alert('This plugin is already installed.');
|
||||
} else {
|
||||
$('#dialogInstallPluginName').text($selectedPlugin.find('.pluginName').text());
|
||||
$('#dialogInstallPluginDetails').text($selectedPlugin.find('.pluginId').text() + ' | ' + $selectedPlugin.find('.pluginVersion').text());
|
||||
$('#dialogInstallPluginName').text($selectedPlugin.find('.pluginName').text());
|
||||
$('#dialogInstallPluginDetails').text($selectedPlugin.find('.pluginId').text() + ' | ' + $selectedPlugin.find('.pluginVersion').text());
|
||||
|
||||
$dialogInstall.dialog('option', 'title', 'Install this Plugin?');
|
||||
$dialogInstall.dialog('open');
|
||||
|
||||
return false;
|
||||
});
|
||||
$('#pageMenu').find('a.pluginUpdateLink').click(function () {
|
||||
$this = $(this);
|
||||
|
||||
$selectedPlugin = $this.closest('.pluginItem');
|
||||
$selectedPluginUrl = $this.attr('href');
|
||||
|
||||
$('#dialogInstallPluginName').text($selectedPlugin.find('.pluginName').text());
|
||||
$('#dialogInstallPluginDetails').text($selectedPlugin.find('.pluginId').text() + ' | ' + $selectedPlugin.find('.pluginVersion').text());
|
||||
|
||||
$dialogInstall.dialog('option', 'title', 'Update this Plugin?');
|
||||
$dialogInstall.dialog('open');
|
||||
|
||||
$dialogInstall.dialog('open');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
@@ -147,39 +147,26 @@ WriteLiteral(" <td>\r\n");
|
||||
{
|
||||
var plugin = plugins[itemNextId];
|
||||
itemNextId++;
|
||||
var installedPlugin = Plugins.PluginInstalled(plugin.Id) ? Plugins.GetPlugin(plugin.Id) : null;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1328), Tuple.Create("\"", 1432)
|
||||
, Tuple.Create(Tuple.Create("", 1336), Tuple.Create("pageMenuArea", 1336), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1348), Tuple.Create("pluginItem", 1349), true)
|
||||
|
||||
#line 31 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1359), Tuple.Create<System.Object, System.Int32>(Plugins.PluginInstalled(plugin.Id) ? " pluginInstalled" : string.Empty
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1359), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <a");
|
||||
|
||||
WriteLiteral(" class=\"pluginInstallLink\"");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 1496), Tuple.Create("\"", 1551)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1449), Tuple.Create("\"", 1542)
|
||||
, Tuple.Create(Tuple.Create("", 1457), Tuple.Create("pageMenuArea", 1457), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1469), Tuple.Create("pluginItem", 1470), true)
|
||||
|
||||
#line 32 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1503), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Plugin.Install(plugin.Id))
|
||||
, Tuple.Create(Tuple.Create("", 1480), Tuple.Create<System.Object, System.Int32>(installedPlugin != null ? " pluginInstalled" : string.Empty
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1503), false)
|
||||
, 1480), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <h2");
|
||||
WriteLiteral(">\r\n <h2");
|
||||
|
||||
WriteLiteral(" class=\"pluginName\"");
|
||||
|
||||
@@ -187,20 +174,97 @@ WriteLiteral(">");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
Write(plugin.Name);
|
||||
Write(plugin.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</h2>\r\n </a>\r\n <div" +
|
||||
"");
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
if (installedPlugin == null){
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteLiteral(" class=\"pluginInstallLink button\"");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 1754), Tuple.Create("\"", 1809)
|
||||
|
||||
#line 35 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1761), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Plugin.Install(plugin.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1761), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">Install</a>\r\n");
|
||||
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
}else{
|
||||
if (Version.Parse(plugin.LatestVersion) > installedPlugin.Version){
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteLiteral(" class=\"pluginUpdateLink button\"");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 2047), Tuple.Create("\"", 2101)
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2054), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Plugin.Update(plugin.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2054), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">Update</a> \r\n");
|
||||
|
||||
|
||||
#line 39 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
}else{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteLiteral(" class=\"pluginInstalledLink button disabled\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(">Installed</a> \r\n");
|
||||
|
||||
|
||||
#line 41 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </h2>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pluginItemBlurb\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 35 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 44 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
Write(new HtmlString(plugin.Blurb));
|
||||
|
||||
|
||||
@@ -217,7 +281,7 @@ WriteLiteral(" class=\"pluginId\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 46 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
Write(plugin.Id);
|
||||
|
||||
|
||||
@@ -230,7 +294,7 @@ WriteLiteral(" class=\"pluginVersion\"");
|
||||
WriteLiteral(">v");
|
||||
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 46 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
Write(plugin.LatestVersion);
|
||||
|
||||
|
||||
@@ -239,7 +303,7 @@ WriteLiteral(">v");
|
||||
WriteLiteral("</span> | ");
|
||||
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 46 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
Write(plugin.Author);
|
||||
|
||||
|
||||
@@ -247,14 +311,14 @@ WriteLiteral("</span> | ");
|
||||
#line hidden
|
||||
WriteLiteral(" | <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 1992), Tuple.Create("\"", 2010)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 2716), Tuple.Create("\"", 2734)
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1999), Tuple.Create<System.Object, System.Int32>(plugin.Url
|
||||
#line 46 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2723), Tuple.Create<System.Object, System.Int32>(plugin.Url
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1999), false)
|
||||
, 2723), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
@@ -263,7 +327,7 @@ WriteLiteral(">More Information</a>\r\n </div>\r\
|
||||
" </div>\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 49 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -272,7 +336,7 @@ WriteLiteral(">More Information</a>\r\n </div>\r\
|
||||
WriteLiteral("\r\n </td>\r\n");
|
||||
|
||||
|
||||
#line 43 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 52 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -281,7 +345,7 @@ WriteLiteral("\r\n </td>\r\n");
|
||||
WriteLiteral(" </tr>\r\n </table>\r\n");
|
||||
|
||||
|
||||
#line 46 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 55 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -328,13 +392,13 @@ WriteLiteral(" style=\"padding-bottom: 10px;\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 59 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 68 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 59 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 68 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
using (Html.BeginForm(MVC.API.Plugin.InstallLocal(), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
|
||||
@@ -358,7 +422,7 @@ WriteLiteral(" type=\"file\"");
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
|
||||
#line 63 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 72 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -391,25 +455,32 @@ WriteLiteral("></span>Warning: All plugins run with the same level of network pr
|
||||
" $(this).dialog(\"close\");\r\n }\r\n }\r\n }" +
|
||||
");\r\n $(\'#pageMenu\').find(\'a.pluginInstallLink\').click(function () {\r\n " +
|
||||
" $this = $(this);\r\n\r\n $selectedPlugin = $this.closest(\'.plugin" +
|
||||
"Item\');\r\n $selectedPluginUrl = $this.attr(\'href\');\r\n\r\n if " +
|
||||
"($selectedPlugin.is(\'.pluginInstalled\')) {\r\n alert(\'This plugin i" +
|
||||
"s already installed.\');\r\n } else {\r\n $(\'#dialogInstall" +
|
||||
"PluginName\').text($selectedPlugin.find(\'.pluginName\').text());\r\n " +
|
||||
"Item\');\r\n $selectedPluginUrl = $this.attr(\'href\');\r\n\r\n $(\'" +
|
||||
"#dialogInstallPluginName\').text($selectedPlugin.find(\'.pluginName\').text());\r\n " +
|
||||
" $(\'#dialogInstallPluginDetails\').text($selectedPlugin.find(\'.pluginId\'" +
|
||||
").text() + \' | \' + $selectedPlugin.find(\'.pluginVersion\').text());\r\n\r\n " +
|
||||
" $dialogInstall.dialog(\'option\', \'title\', \'Install this Plugin?\');\r\n " +
|
||||
" $dialogInstall.dialog(\'open\');\r\n\r\n return false;\r\n });\r\n " +
|
||||
" $(\'#pageMenu\').find(\'a.pluginUpdateLink\').click(function () {\r\n $t" +
|
||||
"his = $(this);\r\n\r\n $selectedPlugin = $this.closest(\'.pluginItem\');\r\n " +
|
||||
" $selectedPluginUrl = $this.attr(\'href\');\r\n\r\n $(\'#dialogIns" +
|
||||
"tallPluginName\').text($selectedPlugin.find(\'.pluginName\').text());\r\n " +
|
||||
"$(\'#dialogInstallPluginDetails\').text($selectedPlugin.find(\'.pluginId\').text() +" +
|
||||
" \' | \' + $selectedPlugin.find(\'.pluginVersion\').text());\r\n\r\n $dia" +
|
||||
"logInstall.dialog(\'open\');\r\n }\r\n return false;\r\n })" +
|
||||
";\r\n\r\n // Upload\r\n var $dialogUpload = $(\'#dialogUploadPlugin\').dia" +
|
||||
"log({\r\n resizable: false,\r\n modal: true,\r\n widt" +
|
||||
"h: 350,\r\n autoOpen: false,\r\n buttons: {\r\n \"" +
|
||||
"Upload & Install\": function () {\r\n var pluginFile = $(\'#plugi" +
|
||||
"nFile\');\r\n if (pluginFile.val()) {\r\n p" +
|
||||
"luginFile.closest(\'form\').submit();\r\n $(this).dialog(\'dis" +
|
||||
"able\');\r\n } else {\r\n alert(\'Choose a P" +
|
||||
"lugin Package to Upload\');\r\n }\r\n },\r\n " +
|
||||
" Cancel: function () {\r\n $(this).dialog(\"close\");\r\n " +
|
||||
" }\r\n }\r\n });\r\n $(\'#buttonUpload\').click(func" +
|
||||
"tion () {\r\n $dialogUpload.dialog(\'open\');\r\n return false;\r" +
|
||||
"\n });\r\n });\r\n</script>\r\n<div");
|
||||
" \' | \' + $selectedPlugin.find(\'.pluginVersion\').text());\r\n\r\n $dialogI" +
|
||||
"nstall.dialog(\'option\', \'title\', \'Update this Plugin?\');\r\n $dialogIns" +
|
||||
"tall.dialog(\'open\');\r\n\r\n return false;\r\n });\r\n\r\n // Upl" +
|
||||
"oad\r\n var $dialogUpload = $(\'#dialogUploadPlugin\').dialog({\r\n " +
|
||||
"resizable: false,\r\n modal: true,\r\n width: 350,\r\n " +
|
||||
" autoOpen: false,\r\n buttons: {\r\n \"Upload & Install\": " +
|
||||
"function () {\r\n var pluginFile = $(\'#pluginFile\');\r\n " +
|
||||
" if (pluginFile.val()) {\r\n pluginFile.closest(\'" +
|
||||
"form\').submit();\r\n $(this).dialog(\'disable\');\r\n " +
|
||||
" } else {\r\n alert(\'Choose a Plugin Package to Up" +
|
||||
"load\');\r\n }\r\n },\r\n Cancel: func" +
|
||||
"tion () {\r\n $(this).dialog(\"close\");\r\n }\r\n " +
|
||||
" }\r\n });\r\n $(\'#buttonUpload\').click(function () {\r\n " +
|
||||
" $dialogUpload.dialog(\'open\');\r\n return false;\r\n });\r\n }" +
|
||||
");\r\n</script>\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
@@ -418,7 +489,7 @@ WriteLiteral(">\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 142 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 163 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
Write(Html.ActionLinkButton("Update Catalogue", MVC.API.Plugin.UpdateLibraryCatalogue()));
|
||||
|
||||
|
||||
@@ -429,7 +500,7 @@ WriteLiteral("\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 143 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
#line 164 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
|
||||
Write(Html.ActionLinkButton("Install Plugin Package", MVC.API.Plugin.InstallLocal(), "buttonUpload"));
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*#source /ClientSource/Style/jQueryUI/jquery-ui.css */
|
||||
/*#source /ClientSource/Style/jQueryUI/jquery-ui.css */
|
||||
/*!
|
||||
* jQuery UI CSS Framework 1.8.19
|
||||
*
|
||||
@@ -563,8 +563,8 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
||||
* http://docs.jquery.com/UI/Progressbar#theming
|
||||
*/
|
||||
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
|
||||
/*#source /ClientSource/Style/Site.css */
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
|
||||
/*#source /ClientSource/Style/Site.css */
|
||||
.tableData {
|
||||
border: solid 1px #e8eef4;
|
||||
border-collapse: collapse;
|
||||
@@ -906,6 +906,7 @@ a:active {
|
||||
color: #335a87;
|
||||
}
|
||||
a.button {
|
||||
display: inline-block;
|
||||
padding: 4px 10px;
|
||||
margin: 2px;
|
||||
border: 1px solid #875a33;
|
||||
@@ -914,11 +915,11 @@ a.button {
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
line-height: 2.2em;
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
}
|
||||
a.button[disabled] {
|
||||
a.button[disabled],
|
||||
a.button.disabled {
|
||||
background: #9e9e9e;
|
||||
border: 1px solid #696969;
|
||||
cursor: default;
|
||||
@@ -1357,7 +1358,8 @@ input[type="submit"] {
|
||||
padding: 5px;
|
||||
}
|
||||
input[type="submit"].button {
|
||||
padding: 4px 10px;
|
||||
font-size: 12px;
|
||||
padding: 6px 10px 4px 10px;
|
||||
margin: 2px;
|
||||
border: 1px solid #875a33;
|
||||
background: #db761d;
|
||||
@@ -1365,7 +1367,6 @@ input[type="submit"].button {
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
input[type="submit"].button:hover {
|
||||
border: 1px solid #696969;
|
||||
@@ -1686,4 +1687,4 @@ textarea.block {
|
||||
{
|
||||
font-weight: bold;
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 795 B |
Binary file not shown.
|
After Width: | Height: | Size: 795 B |
@@ -339,6 +339,7 @@ a:active {
|
||||
color: #335a87;
|
||||
}
|
||||
a.button {
|
||||
display: inline-block;
|
||||
padding: 4px 10px;
|
||||
margin: 2px;
|
||||
border: 1px solid #875a33;
|
||||
@@ -347,11 +348,11 @@ a.button {
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
line-height: 2.2em;
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
}
|
||||
a.button[disabled] {
|
||||
a.button[disabled],
|
||||
a.button.disabled {
|
||||
background: #9e9e9e;
|
||||
border: 1px solid #696969;
|
||||
cursor: default;
|
||||
@@ -790,7 +791,8 @@ input[type="submit"] {
|
||||
padding: 5px;
|
||||
}
|
||||
input[type="submit"].button {
|
||||
padding: 4px 10px;
|
||||
font-size: 12px;
|
||||
padding: 6px 10px 4px 10px;
|
||||
margin: 2px;
|
||||
border: 1px solid #875a33;
|
||||
background: #db761d;
|
||||
@@ -798,7 +800,6 @@ input[type="submit"].button {
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
input[type="submit"].button:hover {
|
||||
border: 1px solid #696969;
|
||||
|
||||
+1283
-1283
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
@@ -20,7 +20,7 @@ namespace Disco.Web.Controllers
|
||||
#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>(() =>
|
||||
internal static Lazy<bool> ServerIsCoreSKU = new Lazy<bool>(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
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;
|
||||
using Disco.Services.Plugins;
|
||||
|
||||
namespace Disco.Web.Controllers
|
||||
{
|
||||
[OutputCache(Duration = 0, Location = System.Web.UI.OutputCacheLocation.None)]
|
||||
public partial class UpdateController : Controller
|
||||
{
|
||||
protected override void OnActionExecuting(ActionExecutingContext filterContext)
|
||||
{
|
||||
if (!Request.IsLocal && !InitialConfigController.ServerIsCoreSKU.Value)
|
||||
{
|
||||
filterContext.Result = new HttpStatusCodeResult(System.Net.HttpStatusCode.ServiceUnavailable, "Initial Configuration of Disco is only allowed via a local connection");
|
||||
}
|
||||
base.OnActionExecuting(filterContext);
|
||||
}
|
||||
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
var status = UpdatePluginsAfterDiscoUpdateTask.UpdateDiscoPlugins(true);
|
||||
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,6 +172,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Controllers\InitialConfigController.cs" />
|
||||
<Compile Include="Controllers\PluginWebHandlerController.cs" />
|
||||
<Compile Include="Controllers\UpdateController.cs" />
|
||||
<Compile Include="Extensions\HtmlExtensions.cs" />
|
||||
<Compile Include="App_Start\AppConfig.cs" />
|
||||
<Compile Include="App_Start\BundleConfig.cs" />
|
||||
@@ -1822,7 +1823,7 @@
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
<UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_BuildAction="ReBuild" BuildVersion_UseGlobalSettings="True" BuildVersion_DetectChanges="False" />
|
||||
<UserProperties BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="True" BuildVersion_BuildAction="ReBuild" BuildVersion_StartDate="2001/1/1" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
+53
-23
@@ -24,54 +24,84 @@ namespace Disco.Web
|
||||
base.BeginRequest += new EventHandler(DiscoApplication_BeginRequest);
|
||||
base.Error += new EventHandler(DiscoApplication_Error);
|
||||
}
|
||||
|
||||
|
||||
protected void Application_Start()
|
||||
{
|
||||
var timer = new Stopwatch();
|
||||
long timer_last;
|
||||
timer.Start();
|
||||
|
||||
|
||||
|
||||
Debug.WriteLine("Application Startup Profiling Started");
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
|
||||
if (AppConfig.InitializeDatabase())
|
||||
{
|
||||
// Database Initialized
|
||||
|
||||
Debug.WriteLine("Initialized Database: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
|
||||
AreaRegistration.RegisterAllAreas();
|
||||
// Check for Post-Update
|
||||
Version previousVersion;
|
||||
Version currentVersion = Disco.BI.Interop.Community.UpdateCheck.CurrentDiscoVersion();
|
||||
using (DiscoDataContext dbContext = new DiscoDataContext())
|
||||
{
|
||||
previousVersion = dbContext.DiscoConfiguration.InstalledDatabaseVersion;
|
||||
}
|
||||
if (currentVersion == previousVersion)
|
||||
{
|
||||
// Normal Startup
|
||||
|
||||
Debug.WriteLine("Registered Areas: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
|
||||
WebApiConfig.Register(GlobalConfiguration.Configuration);
|
||||
AreaRegistration.RegisterAllAreas();
|
||||
|
||||
Debug.WriteLine("Registered API: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
|
||||
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
||||
Debug.WriteLine("Registered Areas: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
|
||||
Debug.WriteLine("Registered Global Filters: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
|
||||
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||||
WebApiConfig.Register(GlobalConfiguration.Configuration);
|
||||
|
||||
Debug.WriteLine("Registered Routes: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
Debug.WriteLine("Registered API: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
|
||||
BundleConfig.RegisterBundles();
|
||||
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
||||
|
||||
Debug.WriteLine("Registered Bundles: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
Debug.WriteLine("Registered Global Filters: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
|
||||
AppConfig.InitalizeEnvironment();
|
||||
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||||
|
||||
Debug.WriteLine("Initialized Environment: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
Debug.WriteLine("Registered Routes: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
|
||||
BundleConfig.RegisterBundles();
|
||||
|
||||
Debug.WriteLine("Registered Bundles: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
|
||||
AppConfig.InitalizeEnvironment();
|
||||
|
||||
Debug.WriteLine("Initialized Environment: +{0}ms", timer.ElapsedMilliseconds - timer_last);
|
||||
timer_last = timer.ElapsedMilliseconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Post-Update Startup
|
||||
AreaRegistration.RegisterAllAreas();
|
||||
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
||||
RouteConfig.RegisterUpdateRoutes(RouteTable.Routes);
|
||||
BundleConfig.RegisterBundles();
|
||||
AppConfig.InitializeUpdateEnvironment();
|
||||
|
||||
using (DiscoDataContext dbContext = new DiscoDataContext())
|
||||
{
|
||||
dbContext.DiscoConfiguration.InstalledDatabaseVersion = currentVersion;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Database Not Initialized
|
||||
// Install
|
||||
InitialConfig = true;
|
||||
RouteConfig.RegisterInstallRoutes(RouteTable.Routes);
|
||||
|
||||
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// 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.0212.1702")]
|
||||
[assembly: AssemblyFileVersion("1.2.0212.1702")]
|
||||
[assembly: AssemblyVersion("1.2.0214.1848")]
|
||||
[assembly: AssemblyFileVersion("1.2.0214.1848")]
|
||||
|
||||
+158
-23
@@ -37,6 +37,7 @@ public static class MVC
|
||||
public static Disco.Web.Controllers.JobController Job = new Disco.Web.Controllers.T4MVC_JobController();
|
||||
public static Disco.Web.Controllers.PluginWebHandlerController PluginWebHandler = new Disco.Web.Controllers.T4MVC_PluginWebHandlerController();
|
||||
public static Disco.Web.Controllers.SearchController Search = new Disco.Web.Controllers.T4MVC_SearchController();
|
||||
public static Disco.Web.Controllers.UpdateController Update = new Disco.Web.Controllers.T4MVC_UpdateController();
|
||||
public static Disco.Web.Controllers.UserController User = new Disco.Web.Controllers.T4MVC_UserController();
|
||||
public static T4MVC.HomeController Home = new T4MVC.HomeController();
|
||||
public static T4MVC.SharedController Shared = new T4MVC.SharedController();
|
||||
@@ -1998,6 +1999,84 @@ namespace Disco.Web.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
namespace Disco.Web.Controllers
|
||||
{
|
||||
public partial class UpdateController
|
||||
{
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public UpdateController() { }
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected UpdateController(Dummy d) { }
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToAction(ActionResult result)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
return RedirectToRoute(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public UpdateController Actions { get { return MVC.Update; } }
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public readonly string Area = "";
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public readonly string Name = "Update";
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public const string NameConst = "Update";
|
||||
|
||||
static readonly ActionNamesClass s_actions = new ActionNamesClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionNamesClass ActionNames { get { return s_actions; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionNamesClass
|
||||
{
|
||||
public readonly string Index = "Index";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionNameConstants
|
||||
{
|
||||
public const string Index = "Index";
|
||||
}
|
||||
|
||||
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ViewsClass
|
||||
{
|
||||
static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
|
||||
public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
|
||||
public class _ViewNamesClass
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class T4MVC_UpdateController : Disco.Web.Controllers.UpdateController
|
||||
{
|
||||
public T4MVC_UpdateController() : base(Dummy.Instance) { }
|
||||
|
||||
public override System.Web.Mvc.ActionResult Index()
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace Disco.Web.Controllers
|
||||
{
|
||||
public partial class UserController
|
||||
@@ -6759,6 +6838,18 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public System.Web.Mvc.ActionResult Update()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Update);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public System.Web.Mvc.ActionResult UpdateLocal()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateLocal);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public System.Web.Mvc.ActionResult Uninstall()
|
||||
@@ -6767,16 +6858,16 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public System.Web.Mvc.ActionResult InstallLocal()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.InstallLocal);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public System.Web.Mvc.ActionResult Install()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Install);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public System.Web.Mvc.ActionResult InstallLocal()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.InstallLocal);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public PluginController Actions { get { return MVC.API.Plugin; } }
|
||||
@@ -6794,21 +6885,44 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public class ActionNamesClass
|
||||
{
|
||||
public readonly string UpdateLibraryCatalogue = "UpdateLibraryCatalogue";
|
||||
public readonly string UpdateAll = "UpdateAll";
|
||||
public readonly string Update = "Update";
|
||||
public readonly string UpdateLocal = "UpdateLocal";
|
||||
public readonly string Uninstall = "Uninstall";
|
||||
public readonly string InstallLocal = "InstallLocal";
|
||||
public readonly string Install = "Install";
|
||||
public readonly string InstallLocal = "InstallLocal";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionNameConstants
|
||||
{
|
||||
public const string UpdateLibraryCatalogue = "UpdateLibraryCatalogue";
|
||||
public const string UpdateAll = "UpdateAll";
|
||||
public const string Update = "Update";
|
||||
public const string UpdateLocal = "UpdateLocal";
|
||||
public const string Uninstall = "Uninstall";
|
||||
public const string InstallLocal = "InstallLocal";
|
||||
public const string Install = "Install";
|
||||
public const string InstallLocal = "InstallLocal";
|
||||
}
|
||||
|
||||
|
||||
static readonly ActionParamsClass_Update s_params_Update = new ActionParamsClass_Update();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Update UpdateParams { get { return s_params_Update; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_Update
|
||||
{
|
||||
public readonly string PluginId = "PluginId";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateLocal s_params_UpdateLocal = new ActionParamsClass_UpdateLocal();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_UpdateLocal UpdateLocalParams { get { return s_params_UpdateLocal; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_UpdateLocal
|
||||
{
|
||||
public readonly string PluginId = "PluginId";
|
||||
public readonly string Plugin = "Plugin";
|
||||
}
|
||||
static readonly ActionParamsClass_Uninstall s_params_Uninstall = new ActionParamsClass_Uninstall();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Uninstall UninstallParams { get { return s_params_Uninstall; } }
|
||||
@@ -6818,14 +6932,6 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public readonly string id = "id";
|
||||
public readonly string UninstallData = "UninstallData";
|
||||
}
|
||||
static readonly ActionParamsClass_InstallLocal s_params_InstallLocal = new ActionParamsClass_InstallLocal();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_InstallLocal InstallLocalParams { get { return s_params_InstallLocal; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_InstallLocal
|
||||
{
|
||||
public readonly string Plugin = "Plugin";
|
||||
}
|
||||
static readonly ActionParamsClass_Install s_params_Install = new ActionParamsClass_Install();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Install InstallParams { get { return s_params_Install; } }
|
||||
@@ -6834,6 +6940,14 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public readonly string PluginId = "PluginId";
|
||||
}
|
||||
static readonly ActionParamsClass_InstallLocal s_params_InstallLocal = new ActionParamsClass_InstallLocal();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_InstallLocal InstallLocalParams { get { return s_params_InstallLocal; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_InstallLocal
|
||||
{
|
||||
public readonly string Plugin = "Plugin";
|
||||
}
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
@@ -6859,6 +6973,27 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
public override System.Web.Mvc.ActionResult UpdateAll()
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateAll);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
public override System.Web.Mvc.ActionResult Update(string PluginId)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Update);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "PluginId", PluginId);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
public override System.Web.Mvc.ActionResult UpdateLocal(string PluginId, System.Web.HttpPostedFileBase Plugin)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateLocal);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "PluginId", PluginId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Plugin", Plugin);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
public override System.Web.Mvc.ActionResult Uninstall(string id, bool UninstallData)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Uninstall);
|
||||
@@ -6867,13 +7002,6 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
public override System.Web.Mvc.ActionResult InstallLocal(System.Web.HttpPostedFileBase Plugin)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.InstallLocal);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Plugin", Plugin);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
public override System.Web.Mvc.ActionResult Install(string PluginId)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Install);
|
||||
@@ -6881,6 +7009,13 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
public override System.Web.Mvc.ActionResult InstallLocal(System.Web.HttpPostedFileBase Plugin)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.InstallLocal);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Plugin", Plugin);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user