Feature #69 #72: Noticeboard themes and filtering

This commit is contained in:
Gary Sharp
2014-08-26 16:27:37 +10:00
parent 0de162fce3
commit 4b6604df5b
30 changed files with 2491 additions and 383 deletions
@@ -41,6 +41,22 @@ namespace Disco.Data.Configuration.Modules
} }
} }
/// <summary>
/// Theme used in noticeboards by default.
/// <see cref="Disco.Services.Extensions.UIHelpers.NoticeboardThemes"/>
/// </summary>
public string DefaultNoticeboardTheme
{
get { return Get("default"); }
set
{
if (string.IsNullOrWhiteSpace(value))
throw new ArgumentNullException("DefaultNoticeboardTheme");
Set(value);
}
}
public LocationModes LocationMode public LocationModes LocationMode
{ {
get { return Get<LocationModes>(LocationModes.Unrestricted); } get { return Get<LocationModes>(LocationModes.Unrestricted); }
+24
View File
@@ -17,6 +17,10 @@ namespace Disco.Services.Extensions
/// User-selectable Colour Themes /// User-selectable Colour Themes
/// </summary> /// </summary>
public static ReadOnlyCollection<KeyValuePair<string, string>> ThemeColours { get; private set; } public static ReadOnlyCollection<KeyValuePair<string, string>> ThemeColours { get; private set; }
/// <summary>
/// Noticeboard Colour Themes
/// </summary>
public static ReadOnlyCollection<KeyValuePair<string, string>> NoticeboardThemes { get; private set; }
/// <summary> /// <summary>
/// Returns a randomly selected Icon using <see cref="System.Random"/>. /// Returns a randomly selected Icon using <see cref="System.Random"/>.
@@ -221,6 +225,26 @@ namespace Disco.Services.Extensions
new KeyValuePair<string, string>("mauve" , "Mauve"), new KeyValuePair<string, string>("mauve" , "Mauve"),
new KeyValuePair<string, string>("sienna" , "Sienna") new KeyValuePair<string, string>("sienna" , "Sienna")
}.AsReadOnly(); }.AsReadOnly();
// Noticeboard Themes
NoticeboardThemes = new List<KeyValuePair<string, string>>(){
new KeyValuePair<string, string>("default" , "Default Blue"),
new KeyValuePair<string, string>("default-soft" , "Default Blue Soft"),
new KeyValuePair<string, string>("green" , "Green"),
new KeyValuePair<string, string>("green-soft" , "Green Soft"),
new KeyValuePair<string, string>("violet" , "Violet"),
new KeyValuePair<string, string>("violet-soft" , "Violet Soft"),
new KeyValuePair<string, string>("magenta" , "Magenta"),
new KeyValuePair<string, string>("magenta-soft" , "Magenta Soft"),
new KeyValuePair<string, string>("crimson" , "Crimson"),
new KeyValuePair<string, string>("crimson-soft" , "Crimson Soft"),
new KeyValuePair<string, string>("amber" , "Amber"),
new KeyValuePair<string, string>("amber-soft" , "Amber Soft"),
new KeyValuePair<string, string>("brown" , "Brown"),
new KeyValuePair<string, string>("brown-soft" , "Brown Soft"),
new KeyValuePair<string, string>("steel" , "Steel"),
new KeyValuePair<string, string>("steel-soft" , "Steel Soft")
}.AsReadOnly();
} }
} }
} }
@@ -209,7 +209,7 @@ namespace Disco.Services.Jobs.Noticeboards
} }
} }
private static IEnumerable<IHeldDeviceItem> GetHeldDevices(IQueryable<Job> query) public static IEnumerable<IHeldDeviceItem> GetHeldDevices(IQueryable<Job> query)
{ {
var jobs = query var jobs = query
.Where(j => .Where(j =>
@@ -38,7 +38,7 @@ namespace Disco.Services.Jobs.Noticeboards
} }
} }
private static IEnumerable<IHeldDeviceItem> GetHeldDevicesForUsers(IQueryable<Job> query) public static IEnumerable<IHeldDeviceItem> GetHeldDevicesForUsers(IQueryable<Job> query)
{ {
var jobs = query var jobs = query
.Where(j => .Where(j =>
@@ -36,5 +36,10 @@ namespace Disco.Services.Jobs.Noticeboards
return base.OnConnected(); return base.OnConnected();
} }
public static void SetTheme(string ThemeName)
{
HubContext.Clients.All.setTheme(ThemeName);
}
} }
} }
@@ -35,6 +35,20 @@ namespace Disco.Web.Areas.API.Controllers
return Json("OK", JsonRequestBehavior.AllowGet); return Json("OK", JsonRequestBehavior.AllowGet);
} }
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
public virtual ActionResult UpdateDefaultNoticeboardTheme(string DefaultNoticeboardTheme, bool redirect = false)
{
Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme = DefaultNoticeboardTheme;
Database.SaveChanges();
Disco.Services.Jobs.Noticeboards.NoticeboardUpdatesHub.SetTheme(DefaultNoticeboardTheme);
if (redirect)
return RedirectToAction(MVC.Config.JobPreferences.Index());
else
return Json("OK", JsonRequestBehavior.AllowGet);
}
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)] [DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
public virtual ActionResult UpdateLocationMode(LocationModes LocationMode, bool redirect = false) public virtual ActionResult UpdateLocationMode(LocationModes LocationMode, bool redirect = false)
{ {
@@ -19,6 +19,7 @@ namespace Disco.Web.Areas.Config.Controllers
{ {
LongRunningJobDaysThreshold = Database.DiscoConfiguration.JobPreferences.LongRunningJobDaysThreshold, LongRunningJobDaysThreshold = Database.DiscoConfiguration.JobPreferences.LongRunningJobDaysThreshold,
StaleJobMinutesThreshold = Database.DiscoConfiguration.JobPreferences.StaleJobMinutesThreshold, StaleJobMinutesThreshold = Database.DiscoConfiguration.JobPreferences.StaleJobMinutesThreshold,
DefaultNoticeboardTheme = Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme,
LocationMode = Database.DiscoConfiguration.JobPreferences.LocationMode, LocationMode = Database.DiscoConfiguration.JobPreferences.LocationMode,
LocationList = Database.DiscoConfiguration.JobPreferences.LocationList LocationList = Database.DiscoConfiguration.JobPreferences.LocationList
}; };
@@ -1,11 +1,11 @@
using Disco.Models.BI.Job; using Disco.Data.Repository;
using Disco.Models.BI.Job;
using Disco.Models.UI.Config.JobPreferences; using Disco.Models.UI.Config.JobPreferences;
using Disco.Services.Extensions;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Disco.Web.Areas.Config.Models.JobPreferences namespace Disco.Web.Areas.Config.Models.JobPreferences
{ {
@@ -13,9 +13,31 @@ namespace Disco.Web.Areas.Config.Models.JobPreferences
{ {
public int LongRunningJobDaysThreshold { get; set; } public int LongRunningJobDaysThreshold { get; set; }
public int StaleJobMinutesThreshold { get; set; } public int StaleJobMinutesThreshold { get; set; }
public string DefaultNoticeboardTheme { get; set; }
public LocationModes LocationMode { get; set; } public LocationModes LocationMode { get; set; }
public List<string> LocationList { get; set; } public List<string> LocationList { get; set; }
public List<KeyValuePair<string, string>> DefaultNoticeboardThemeOptions()
{
return UIHelpers.NoticeboardThemes.ToList();
}
public Lazy<List<Disco.Models.Repository.DeviceProfile>> DeviceProfiles = new Lazy<List<Disco.Models.Repository.DeviceProfile>>(() =>
{
using (var database = new DiscoDataContext())
{
return database.DeviceProfiles.OrderBy(a => a.Description).ToList();
}
});
public Lazy<List<Disco.Models.BI.Config.OrganisationAddress>> OrganisationAddresses = new Lazy<List<Disco.Models.BI.Config.OrganisationAddress>>(() =>
{
using (var database = new DiscoDataContext())
{
return database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList();
}
});
public List<KeyValuePair<int, string>> LongRunningJobDaysThresholdOptions() public List<KeyValuePair<int, string>> LongRunningJobDaysThresholdOptions()
{ {
var options = new List<KeyValuePair<int, string>>() { var options = new List<KeyValuePair<int, string>>() {
@@ -12,5 +12,6 @@
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons"); Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
} }
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.General); Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.General);
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Reports);
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Locations); Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Locations);
} }
@@ -59,6 +59,7 @@ namespace Disco.Web.Areas.Config.Views.JobPreferences
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons"); Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
} }
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.General); Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.General);
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Reports);
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Locations); Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Locations);
@@ -0,0 +1,249 @@
@model Disco.Web.Areas.Config.Models.JobPreferences.IndexModel
@{
Authorization.Require(Claims.Config.JobPreferences.Show);
var canConfig = Authorization.Has(Claims.Config.JobPreferences.Configure);
}
<div id="Config_ReportPrefs" class="form" style="width: 530px;">
<h2>Report Preferences</h2>
<table>
<tr>
<th style="width: 200px">Noticeboard Default Theme:
</th>
<td>@if (canConfig)
{
@Html.DropDownListFor(model => model.DefaultNoticeboardTheme, Model.DefaultNoticeboardThemeOptions().Select(o => new SelectListItem() { Value = o.Key, Text = o.Value }))
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$element = $('#DefaultNoticeboardTheme');
document.DiscoFunctions.PropertyChangeHelper(
$element,
null,
'@(Url.Action(MVC.API.JobPreferences.UpdateDefaultNoticeboardTheme()))',
'DefaultNoticeboardTheme');
$element.change(function () {
$('#Config_ReportPrefs_Preview').attr('class', 'theme-' + $(this).val());
});
});
</script>
}
else
{
@Model.DefaultNoticeboardThemeOptions().First(o => o.Key == Model.DefaultNoticeboardTheme).Value
}
<div id="Config_ReportPrefs_Preview" class="theme-@(Model.DefaultNoticeboardTheme)">
<div class="heading">Noticeboard Heading</div>
<div class="column-heading">Column One</div>
<div class="column-heading">Column Two</div>
<div class="column-heading">Column Three</div>
<div class="column"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></div>
<div class="column"><span></span><span class="alert"></span><span></span><span></span></div>
<div class="column"><span></span><span></span><span class="alert"></span><span></span><span class="alert"></span><span></span><span></span><span></span><span></span><span></span></div>
</div>
</td>
</tr>
<tr>
<th>&nbsp;</th>
<td>
<button id="Config_ReportPrefs_Builder_Button" class="button small">Link Builder</button>
<div class="info-box">
<p class="fa-p">
<i class="fa fa-info-circle"></i>Report Links can be created which override the default theme and filter the data shown.
</p>
</div>
<div id="Config_ReportPrefs_Builder" title="Report Link Builder" class="dialog">
<form>
<div class="report">
<h3>Report</h3>
<ul class="none">
<li>
<input type="radio" id="Config_ReportPrefs_Builder_NTHDU" name="Report" class="themeable" data-url="@(Url.ActionAbsolute(MVC.Public.UserHeldDevices.Noticeboard()))" checked="checked" /><label for="Config_ReportPrefs_Builder_NTHDU">Technician Held Devices for Users (Noticeboard)</label>
</li>
<li>
<input type="radio" id="Config_ReportPrefs_Builder_THDU" name="Report" data-url="@(Url.ActionAbsolute(MVC.Public.UserHeldDevices.Index()))" /><label for="Config_ReportPrefs_Builder_THDU">Technician Held Devices for Users (Report)</label>
</li>
<li>
<input type="radio" id="Config_ReportPrefs_Builder_NTHD" name="Report" class="themeable" data-url="@(Url.ActionAbsolute(MVC.Public.HeldDevices.Noticeboard()))" /><label for="Config_ReportPrefs_Builder_NTHD">Technician Held Devices (Noticeboard)</label>
</li>
<li>
<input type="radio" id="Config_ReportPrefs_Builder_THD" name="Report" data-url="@(Url.ActionAbsolute(MVC.Public.HeldDevices.Index()))" /><label for="Config_ReportPrefs_Builder_THD">Technician Held Devices (Report)</label>
</li>
</ul>
</div>
<div class="theme">
<h3>Noticeboard Theme</h3>
@Html.DropDownList("Config_ReportPrefs_Builder_Theme", new SelectListItem[] { new SelectListItem() { Value = "", Text = "<Default>", Selected = true } }.Concat(Model.DefaultNoticeboardThemeOptions().Select(o => new SelectListItem() { Value = o.Key, Text = o.Value })))
</div>
<div class="filter">
<h3>Filter</h3>
<select id="Config_ReportPrefs_Builder_Filter">
<option value="">&lt;None&gt;</option>
<option value="DeviceProfile">Device Profile</option>
<option value="DeviceAddress">Device Profile Address</option>
</select>
<div class="options">
<div class="method">
<input type="radio" id="Config_ReportPrefs_Builder_I" name="FilterAction" value="Include" checked="checked" /><label for="Config_ReportPrefs_Builder_I">Include</label>
<input type="radio" id="Config_ReportPrefs_Builder_E" name="FilterAction" value="Exclude" /><label for="Config_ReportPrefs_Builder_E">Exclude</label>
</div>
<div class="filter-option filter-DeviceProfile">
<ul class="none">
@foreach (var deviceProfile in Model.DeviceProfiles.Value)
{
<li>
<input id="Config_ReportPrefs_Builder_DP_@(deviceProfile.Id)" type="checkbox" value="@deviceProfile.Id" /><label for="Config_ReportPrefs_Builder_DP_@(deviceProfile.Id)">@deviceProfile.Description</label></li>
}
</ul>
</div>
<div class="filter-option filter-DeviceAddress">
<ul class="none">
@foreach (var address in Model.OrganisationAddresses.Value)
{
<li>
<input id="Config_ReportPrefs_Builder_OA_@(address.Id)" type="checkbox" value="@address.ShortName" /><label for="Config_ReportPrefs_Builder_OA_@(address.Id)">@address.Name (@address.ShortName)</label></li>
}
</ul>
</div>
</div>
</div>
</form>
<div class="output">
<textarea readonly></textarea>
<a href="#" target="_blank"><i class="fa fa-external-link" title="Open Link"></i></a>
<i class="fa fa-clipboard" title="Copy Link to Clipboard"></i>
</div>
</div>
<script>
$(function () {
var dialog, url;
function updateUrl() {
var theme = null;
var filter = null;
var filterMethod = null;
var filterValue = null;
var report = dialog.find('.report input:checked');
if (report.length > 0) {
url = report.attr('data-url');
if (report.hasClass('themeable')) {
theme = dialog.find('.theme > select').val();
}
filter = dialog.find('.filter > select').val();
if (!!filter) {
filterMethod = dialog.find('.filter .method input:checked').val();
filterValue = dialog
.find('.filter .filter-' + filter)
.find('input:checked')
.map(function (index, element) { return $(element).val(); })
.toArray().join(',');
}
if (!!theme || !!filter) {
url += '?';
if (!!theme)
url += 'theme=' + theme;
if (!!theme && !!filter)
url += '&';
if (!!filter)
url += filter + filterMethod + '=' + filterValue;
}
}
$('#Config_ReportPrefs_Builder_Buttonpane').find('textarea').val(url);
$('#Config_ReportPrefs_Builder_Buttonpane').find('.fa-external-link').closest('a').attr('href', url);
}
$('#Config_ReportPrefs_Builder_Button').click(function () {
if (!dialog) {
dialog = $('#Config_ReportPrefs_Builder').dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 550,
maxHeight: 520,
buttons: {
Close: function () {
dialog.dialog('close');
}
}
});
dialog.find('.report').on('change', 'input', function () {
var $this = $(this);
var $theme = dialog.find('.theme');
if ($this.hasClass('themeable'))
$theme.slideDown();
else
$theme.slideUp();
updateUrl();
});
dialog.find('#Config_ReportPrefs_Builder_Theme').change(updateUrl);
dialog.find('#Config_ReportPrefs_Builder_Filter').change(function () {
var $this = $(this);
var $filter = dialog.find('.options');
if (!$this.val())
$filter.slideUp();
else {
$filter.find('.filter-option').hide();
$filter.show();
$filter.find('.filter-' + $this.val()).slideDown();
}
updateUrl();
});
dialog.find('.filter .options').on('click', 'input', updateUrl);
var $buttonpane = dialog.closest('.ui-dialog').children('.ui-dialog-buttonpane');
$buttonpane.attr('id', 'Config_ReportPrefs_Builder_Buttonpane').append(dialog.children('.output'));
$buttonpane.find('textarea').focus(function () {
$(this).select();
});
var $clipboard = $buttonpane.find('.fa-clipboard');
if (!!window.clipboardData) {
$clipboard.click(function () {
window.clipboardData.setData('Text', url);
alert('Link copied to Clipboard');
return false;
});
} else {
$clipboard.hide();
}
}
dialog.dialog('open');
updateUrl();
return false;
});
});
</script>
</td>
</tr>
</table>
</div>
@@ -0,0 +1,728 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// 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.JobPreferences.Parts
{
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;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/JobPreferences/Parts/Reports.cshtml")]
public partial class Reports : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.JobPreferences.IndexModel>
{
public Reports()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Authorization.Require(Claims.Config.JobPreferences.Show);
var canConfig = Authorization.Has(Claims.Config.JobPreferences.Configure);
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"Config_ReportPrefs\"");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 530px;\"");
WriteLiteral(">\r\n <h2>Report Preferences</h2>\r\n <table>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px\"");
WriteLiteral(">Noticeboard Default Theme:\r\n </th>\r\n <td>");
#line 13 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 15 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(Html.DropDownListFor(model => model.DefaultNoticeboardTheme, Model.DefaultNoticeboardThemeOptions().Select(o => new SelectListItem() { Value = o.Key, Text = o.Value })));
#line default
#line hidden
#line 15 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
#line default
#line hidden
#line 16 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 16 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
#line default
#line hidden
#line 17 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 17 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
$element = $('#DefaultNoticeboardTheme');
document.DiscoFunctions.PropertyChangeHelper(
$element,
null,
'");
#line 25 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(Url.Action(MVC.API.JobPreferences.UpdateDefaultNoticeboardTheme()));
#line default
#line hidden
WriteLiteral(@"',
'DefaultNoticeboardTheme');
$element.change(function () {
$('#Config_ReportPrefs_Preview').attr('class', 'theme-' + $(this).val());
});
});
</script>
");
#line 33 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
}
else
{
#line default
#line hidden
#line 36 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(Model.DefaultNoticeboardThemeOptions().First(o => o.Key == Model.DefaultNoticeboardTheme).Value);
#line default
#line hidden
#line 36 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
}
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"Config_ReportPrefs_Preview\"");
WriteAttribute("class", Tuple.Create(" class=\"", 1694), Tuple.Create("\"", 1740)
, Tuple.Create(Tuple.Create("", 1702), Tuple.Create("theme-", 1702), true)
#line 38 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
, Tuple.Create(Tuple.Create("", 1708), Tuple.Create<System.Object, System.Int32>(Model.DefaultNoticeboardTheme
#line default
#line hidden
, 1708), false)
);
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"heading\"");
WriteLiteral(">Noticeboard Heading</div>\r\n <div");
WriteLiteral(" class=\"column-heading\"");
WriteLiteral(">Column One</div>\r\n <div");
WriteLiteral(" class=\"column-heading\"");
WriteLiteral(">Column Two</div>\r\n <div");
WriteLiteral(" class=\"column-heading\"");
WriteLiteral(">Column Three</div>\r\n <div");
WriteLiteral(" class=\"column\"");
WriteLiteral("><span></span><span></span><span></span><span></span><span></span><span></span><s" +
"pan></span><span></span></div>\r\n <div");
WriteLiteral(" class=\"column\"");
WriteLiteral("><span></span><span");
WriteLiteral(" class=\"alert\"");
WriteLiteral("></span><span></span><span></span></div>\r\n <div");
WriteLiteral(" class=\"column\"");
WriteLiteral("><span></span><span></span><span");
WriteLiteral(" class=\"alert\"");
WriteLiteral("></span><span></span><span");
WriteLiteral(" class=\"alert\"");
WriteLiteral("></span><span></span><span></span><span></span><span></span><span></span></div>\r\n" +
" </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th>&nbsp;</th>\r\n <td>\r\n <button");
WriteLiteral(" id=\"Config_ReportPrefs_Builder_Button\"");
WriteLiteral(" class=\"button small\"");
WriteLiteral(">Link Builder</button>\r\n <div");
WriteLiteral(" class=\"info-box\"");
WriteLiteral(">\r\n <p");
WriteLiteral(" class=\"fa-p\"");
WriteLiteral(">\r\n <i");
WriteLiteral(" class=\"fa fa-info-circle\"");
WriteLiteral("></i>Report Links can be created which override the default theme and filter the " +
"data shown.\r\n </p>\r\n </div>\r\n <" +
"div");
WriteLiteral(" id=\"Config_ReportPrefs_Builder\"");
WriteLiteral(" title=\"Report Link Builder\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(">\r\n <form>\r\n <div");
WriteLiteral(" class=\"report\"");
WriteLiteral(">\r\n <h3>Report</h3>\r\n <ul");
WriteLiteral(" class=\"none\"");
WriteLiteral(">\r\n <li>\r\n <inp" +
"ut");
WriteLiteral(" type=\"radio\"");
WriteLiteral(" id=\"Config_ReportPrefs_Builder_NTHDU\"");
WriteLiteral(" name=\"Report\"");
WriteLiteral(" class=\"themeable\"");
WriteLiteral(" data-url=\"");
#line 64 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(Url.ActionAbsolute(MVC.Public.UserHeldDevices.Noticeboard()));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" checked=\"checked\"");
WriteLiteral(" /><label");
WriteLiteral(" for=\"Config_ReportPrefs_Builder_NTHDU\"");
WriteLiteral(">Technician Held Devices for Users (Noticeboard)</label>\r\n " +
" </li>\r\n <li>\r\n " +
" <input");
WriteLiteral(" type=\"radio\"");
WriteLiteral(" id=\"Config_ReportPrefs_Builder_THDU\"");
WriteLiteral(" name=\"Report\"");
WriteLiteral(" data-url=\"");
#line 67 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(Url.ActionAbsolute(MVC.Public.UserHeldDevices.Index()));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" /><label");
WriteLiteral(" for=\"Config_ReportPrefs_Builder_THDU\"");
WriteLiteral(">Technician Held Devices for Users (Report)</label>\r\n " +
" </li>\r\n <li>\r\n " +
" <input");
WriteLiteral(" type=\"radio\"");
WriteLiteral(" id=\"Config_ReportPrefs_Builder_NTHD\"");
WriteLiteral(" name=\"Report\"");
WriteLiteral(" class=\"themeable\"");
WriteLiteral(" data-url=\"");
#line 70 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(Url.ActionAbsolute(MVC.Public.HeldDevices.Noticeboard()));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" /><label");
WriteLiteral(" for=\"Config_ReportPrefs_Builder_NTHD\"");
WriteLiteral(">Technician Held Devices (Noticeboard)</label>\r\n <" +
"/li>\r\n <li>\r\n " +
"<input");
WriteLiteral(" type=\"radio\"");
WriteLiteral(" id=\"Config_ReportPrefs_Builder_THD\"");
WriteLiteral(" name=\"Report\"");
WriteLiteral(" data-url=\"");
#line 73 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(Url.ActionAbsolute(MVC.Public.HeldDevices.Index()));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" /><label");
WriteLiteral(" for=\"Config_ReportPrefs_Builder_THD\"");
WriteLiteral(">Technician Held Devices (Report)</label>\r\n </li>\r" +
"\n </ul>\r\n </div>\r\n " +
" <div");
WriteLiteral(" class=\"theme\"");
WriteLiteral(">\r\n <h3>Noticeboard Theme</h3>\r\n");
WriteLiteral(" ");
#line 79 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(Html.DropDownList("Config_ReportPrefs_Builder_Theme", new SelectListItem[] { new SelectListItem() { Value = "", Text = "<Default>", Selected = true } }.Concat(Model.DefaultNoticeboardThemeOptions().Select(o => new SelectListItem() { Value = o.Key, Text = o.Value }))));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n <div");
WriteLiteral(" class=\"filter\"");
WriteLiteral(">\r\n <h3>Filter</h3>\r\n <sele" +
"ct");
WriteLiteral(" id=\"Config_ReportPrefs_Builder_Filter\"");
WriteLiteral(">\r\n <option");
WriteLiteral(" value=\"\"");
WriteLiteral(">&lt;None&gt;</option>\r\n <option");
WriteLiteral(" value=\"DeviceProfile\"");
WriteLiteral(">Device Profile</option>\r\n <option");
WriteLiteral(" value=\"DeviceAddress\"");
WriteLiteral(">Device Profile Address</option>\r\n </select>\r\n " +
" <div");
WriteLiteral(" class=\"options\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"method\"");
WriteLiteral(">\r\n <input");
WriteLiteral(" type=\"radio\"");
WriteLiteral(" id=\"Config_ReportPrefs_Builder_I\"");
WriteLiteral(" name=\"FilterAction\"");
WriteLiteral(" value=\"Include\"");
WriteLiteral(" checked=\"checked\"");
WriteLiteral(" /><label");
WriteLiteral(" for=\"Config_ReportPrefs_Builder_I\"");
WriteLiteral(">Include</label>\r\n <input");
WriteLiteral(" type=\"radio\"");
WriteLiteral(" id=\"Config_ReportPrefs_Builder_E\"");
WriteLiteral(" name=\"FilterAction\"");
WriteLiteral(" value=\"Exclude\"");
WriteLiteral(" /><label");
WriteLiteral(" for=\"Config_ReportPrefs_Builder_E\"");
WriteLiteral(">Exclude</label>\r\n </div>\r\n " +
" <div");
WriteLiteral(" class=\"filter-option filter-DeviceProfile\"");
WriteLiteral(">\r\n <ul");
WriteLiteral(" class=\"none\"");
WriteLiteral(">\r\n");
#line 95 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
#line default
#line hidden
#line 95 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
foreach (var deviceProfile in Model.DeviceProfiles.Value)
{
#line default
#line hidden
WriteLiteral(" <li>\r\n " +
" <input");
WriteAttribute("id", Tuple.Create(" id=\"", 6584), Tuple.Create("\"", 6638)
, Tuple.Create(Tuple.Create("", 6589), Tuple.Create("Config_ReportPrefs_Builder_DP_", 6589), true)
#line 98 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
, Tuple.Create(Tuple.Create("", 6619), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
#line default
#line hidden
, 6619), false)
);
WriteLiteral(" type=\"checkbox\"");
WriteAttribute("value", Tuple.Create(" value=\"", 6655), Tuple.Create("\"", 6680)
#line 98 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
, Tuple.Create(Tuple.Create("", 6663), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
#line default
#line hidden
, 6663), false)
);
WriteLiteral(" /><label");
WriteAttribute("for", Tuple.Create(" for=\"", 6690), Tuple.Create("\"", 6745)
, Tuple.Create(Tuple.Create("", 6696), Tuple.Create("Config_ReportPrefs_Builder_DP_", 6696), true)
#line 98 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
, Tuple.Create(Tuple.Create("", 6726), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
#line default
#line hidden
, 6726), false)
);
WriteLiteral(">");
#line 98 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(deviceProfile.Description);
#line default
#line hidden
WriteLiteral("</label></li>\r\n");
#line 99 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n </div>" +
"\r\n <div");
WriteLiteral(" class=\"filter-option filter-DeviceAddress\"");
WriteLiteral(">\r\n <ul");
WriteLiteral(" class=\"none\"");
WriteLiteral(">\r\n");
#line 104 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
#line default
#line hidden
#line 104 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
foreach (var address in Model.OrganisationAddresses.Value)
{
#line default
#line hidden
WriteLiteral(" <li>\r\n " +
" <input");
WriteAttribute("id", Tuple.Create(" id=\"", 7299), Tuple.Create("\"", 7347)
, Tuple.Create(Tuple.Create("", 7304), Tuple.Create("Config_ReportPrefs_Builder_OA_", 7304), true)
#line 107 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
, Tuple.Create(Tuple.Create("", 7334), Tuple.Create<System.Object, System.Int32>(address.Id
#line default
#line hidden
, 7334), false)
);
WriteLiteral(" type=\"checkbox\"");
WriteAttribute("value", Tuple.Create(" value=\"", 7364), Tuple.Create("\"", 7390)
#line 107 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
, Tuple.Create(Tuple.Create("", 7372), Tuple.Create<System.Object, System.Int32>(address.ShortName
#line default
#line hidden
, 7372), false)
);
WriteLiteral(" /><label");
WriteAttribute("for", Tuple.Create(" for=\"", 7400), Tuple.Create("\"", 7449)
, Tuple.Create(Tuple.Create("", 7406), Tuple.Create("Config_ReportPrefs_Builder_OA_", 7406), true)
#line 107 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
, Tuple.Create(Tuple.Create("", 7436), Tuple.Create<System.Object, System.Int32>(address.Id
#line default
#line hidden
, 7436), false)
);
WriteLiteral(">");
#line 107 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(address.Name);
#line default
#line hidden
WriteLiteral(" (");
#line 107 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
Write(address.ShortName);
#line default
#line hidden
WriteLiteral(")</label></li>\r\n");
#line 108 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n </div>" +
"\r\n </div>\r\n </div>\r\n " +
" </form>\r\n <div");
WriteLiteral(" class=\"output\"");
WriteLiteral(">\r\n <textarea readonly></textarea>\r\n " +
" <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" target=\"_blank\"");
WriteLiteral("><i");
WriteLiteral(" class=\"fa fa-external-link\"");
WriteLiteral(" title=\"Open Link\"");
WriteLiteral("></i></a>\r\n <i");
WriteLiteral(" class=\"fa fa-clipboard\"");
WriteLiteral(" title=\"Copy Link to Clipboard\"");
WriteLiteral("></i>\r\n </div>\r\n </div>\r\n <scrip" +
"t>\r\n $(function () {\r\n var dialog, url" +
";\r\n\r\n function updateUrl() {\r\n " +
" var theme = null;\r\n var filter = null;\r\n " +
" var filterMethod = null;\r\n var filter" +
"Value = null;\r\n\r\n var report = dialog.find(\'.report i" +
"nput:checked\');\r\n if (report.length > 0) {\r\n " +
" url = report.attr(\'data-url\');\r\n\r\n " +
" if (report.hasClass(\'themeable\')) {\r\n " +
" theme = dialog.find(\'.theme > select\').val();\r\n " +
" }\r\n\r\n filter = dialog.find(\'.filter > select\').v" +
"al();\r\n\r\n if (!!filter) {\r\n " +
" filterMethod = dialog.find(\'.filter .method input:checked\').val();" +
"\r\n\r\n filterValue = dialog\r\n " +
" .find(\'.filter .filter-\' + filter)\r\n " +
" .find(\'input:checked\')\r\n " +
" .map(function (index, element) { return $(element).val(); })\r\n " +
" .toArray().join(\',\');\r\n }" +
"\r\n\r\n if (!!theme || !!filter) {\r\n " +
" url += \'?\';\r\n\r\n if (!!the" +
"me)\r\n url += \'theme=\' + theme;\r\n\r\n " +
" if (!!theme && !!filter)\r\n " +
" url += \'&\';\r\n\r\n if (!!filter)\r" +
"\n url += filter + filterMethod + \'=\' + fi" +
"lterValue;\r\n }\r\n }\r\n\r\n" +
" $(\'#Config_ReportPrefs_Builder_Buttonpane\').find(\'te" +
"xtarea\').val(url);\r\n $(\'#Config_ReportPrefs_Builder_B" +
"uttonpane\').find(\'.fa-external-link\').closest(\'a\').attr(\'href\', url);\r\n " +
" }\r\n\r\n $(\'#Config_ReportPrefs_Builder_Butto" +
"n\').click(function () {\r\n\r\n if (!dialog) {\r\n " +
" dialog = $(\'#Config_ReportPrefs_Builder\').dialog({\r\n " +
" resizable: false,\r\n " +
" modal: true,\r\n autoOpen: false,\r\n " +
" width: 550,\r\n m" +
"axHeight: 520,\r\n buttons: {\r\n " +
" Close: function () {\r\n " +
" dialog.dialog(\'close\');\r\n }\r\n " +
" }\r\n });\r\n\r\n " +
" dialog.find(\'.report\').on(\'change\', \'input\', functio" +
"n () {\r\n var $this = $(this);\r\n " +
" var $theme = dialog.find(\'.theme\');\r\n\r\n " +
" if ($this.hasClass(\'themeable\'))\r\n " +
" $theme.slideDown();\r\n else\r\n " +
" $theme.slideUp();\r\n\r\n " +
" updateUrl();\r\n });\r\n\r\n " +
" dialog.find(\'#Config_ReportPrefs_Builder_Theme\').change(updateUr" +
"l);\r\n\r\n dialog.find(\'#Config_ReportPrefs_Builder_" +
"Filter\').change(function () {\r\n var $this = $" +
"(this);\r\n var $filter = dialog.find(\'.options" +
"\');\r\n\r\n if (!$this.val())\r\n " +
" $filter.slideUp();\r\n el" +
"se {\r\n $filter.find(\'.filter-option\').hid" +
"e();\r\n $filter.show();\r\n " +
" $filter.find(\'.filter-\' + $this.val()).slideDown();\r\n " +
" }\r\n\r\n updateU" +
"rl();\r\n });\r\n\r\n di" +
"alog.find(\'.filter .options\').on(\'click\', \'input\', updateUrl);\r\n\r\n " +
" var $buttonpane = dialog.closest(\'.ui-dialog\').children(\'.ui-d" +
"ialog-buttonpane\');\r\n $buttonpane.attr(\'id\', \'Con" +
"fig_ReportPrefs_Builder_Buttonpane\').append(dialog.children(\'.output\'));\r\n\r\n " +
" $buttonpane.find(\'textarea\').focus(function () {\r\n " +
" $(this).select();\r\n " +
" });\r\n\r\n\r\n var $clipboard = $buttonpane.find(" +
"\'.fa-clipboard\');\r\n \r\n " +
" if (!!window.clipboardData) {\r\n $clipboa" +
"rd.click(function () {\r\n window.clipboard" +
"Data.setData(\'Text\', url);\r\n alert(\'Link " +
"copied to Clipboard\');\r\n return false;\r\n " +
" });\r\n } else {" +
"\r\n $clipboard.hide();\r\n " +
" }\r\n\r\n }\r\n\r\n dial" +
"og.dialog(\'open\');\r\n\r\n updateUrl();\r\n\r\n " +
" return false;\r\n });\r\n\r\n " +
"});\r\n </script>\r\n </td>\r\n </tr>\r\n </table>\r\n" +
"</div>\r\n");
}
}
}
#pragma warning restore 1591
@@ -1,5 +1,8 @@
using Disco.Services.Jobs.Noticeboards; using Disco.Models.Repository;
using Disco.Services.Jobs.Noticeboards;
using Disco.Services.Web; using Disco.Services.Web;
using Disco.Web.Areas.Public.Models.UserHeldDevices;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.Mvc; using System.Web.Mvc;
@@ -7,9 +10,26 @@ namespace Disco.Web.Areas.Public.Controllers
{ {
public partial class HeldDevicesController : DatabaseController public partial class HeldDevicesController : DatabaseController
{ {
public virtual ActionResult Index() public virtual ActionResult Index(List<int?> DeviceProfileInclude, List<int?> DeviceProfileExclude, List<string> DeviceAddressInclude, List<string> DeviceAddressExclude)
{ {
var m = Disco.Services.Jobs.Noticeboards.HeldDevices.GetHeldDevices(Database); IQueryable<Job> query = Database.Jobs;
if (DeviceProfileInclude != null)
query = query.Where(j => DeviceProfileInclude.Contains(j.Device.DeviceProfileId));
if (DeviceProfileExclude != null)
query = query.Where(j => !DeviceProfileExclude.Contains(j.Device.DeviceProfileId));
if (DeviceAddressInclude != null && DeviceAddressInclude.Count > 0)
{
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressInclude.Contains(a.ShortName)).Select(a => a.Id).ToList();
query = query.Where(j => addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
}
if (DeviceAddressExclude != null && DeviceAddressExclude.Count > 0)
{
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressExclude.Contains(a.ShortName)).Select(a => (int?)a.Id).ToList();
query = query.Where(j => j.Device.DeviceProfile.DefaultOrganisationAddress == null || !addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
}
var m = Disco.Services.Jobs.Noticeboards.HeldDevices.GetHeldDevices(query);
return View(m); return View(m);
} }
@@ -38,7 +58,12 @@ namespace Disco.Web.Areas.Public.Controllers
public virtual ActionResult Noticeboard() public virtual ActionResult Noticeboard()
{ {
return View(); var model = new NoticeboardModel()
{
DefaultTheme = Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme
};
return View(model);
} }
public virtual ActionResult HeldDevice(string id) public virtual ActionResult HeldDevice(string id)
@@ -1,5 +1,8 @@
using Disco.Services.Jobs.Noticeboards; using Disco.Models.Repository;
using Disco.Services.Jobs.Noticeboards;
using Disco.Services.Web; using Disco.Services.Web;
using Disco.Web.Areas.Public.Models.UserHeldDevices;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.Mvc; using System.Web.Mvc;
@@ -7,9 +10,26 @@ namespace Disco.Web.Areas.Public.Controllers
{ {
public partial class UserHeldDevicesController : DatabaseController public partial class UserHeldDevicesController : DatabaseController
{ {
public virtual ActionResult Index() public virtual ActionResult Index(List<int?> DeviceProfileInclude, List<int?> DeviceProfileExclude, List<string> DeviceAddressInclude, List<string> DeviceAddressExclude)
{ {
var m = Disco.Services.Jobs.Noticeboards.HeldDevicesForUsers.GetHeldDevicesForUsers(Database); IQueryable<Job> query = Database.Jobs;
if (DeviceProfileInclude != null)
query = query.Where(j => DeviceProfileInclude.Contains(j.Device.DeviceProfileId));
if (DeviceProfileExclude != null)
query = query.Where(j => !DeviceProfileExclude.Contains(j.Device.DeviceProfileId));
if (DeviceAddressInclude != null && DeviceAddressInclude.Count > 0)
{
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressInclude.Contains(a.ShortName)).Select(a => a.Id).ToList();
query = query.Where(j => addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
}
if (DeviceAddressExclude != null && DeviceAddressExclude.Count > 0)
{
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressExclude.Contains(a.ShortName)).Select(a => (int?)a.Id).ToList();
query = query.Where(j => j.Device.DeviceProfile.DefaultOrganisationAddress == null || !addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
}
var m = Disco.Services.Jobs.Noticeboards.HeldDevicesForUsers.GetHeldDevicesForUsers(query);
return View(m); return View(m);
} }
@@ -38,7 +58,12 @@ namespace Disco.Web.Areas.Public.Controllers
public virtual ActionResult Noticeboard() public virtual ActionResult Noticeboard()
{ {
return View(); var model = new NoticeboardModel()
{
DefaultTheme = Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme
};
return View(model);
} }
public virtual ActionResult UserHeldDevice(string id) public virtual ActionResult UserHeldDevice(string id)
@@ -0,0 +1,8 @@

namespace Disco.Web.Areas.Public.Models.UserHeldDevices
{
public class NoticeboardModel
{
public string DefaultTheme { get; set; }
}
}
@@ -1,4 +1,5 @@
@{ @model Disco.Web.Areas.Public.Models.UserHeldDevices.NoticeboardModel
@{
Layout = null; Layout = null;
Html.BundleDeferred("~/ClientScripts/Modules/Knockout"); Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR"); Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -13,7 +14,7 @@
<title>Disco ICT - Held Devices</title> <title>Disco ICT - Held Devices</title>
@Html.BundleRenderDeferred() @Html.BundleRenderDeferred()
</head> </head>
<body class="status-connecting"> <body class="theme-@(Model.DefaultTheme) status-connecting">
<div id="page"> <div id="page">
<header id="header"> <header id="header">
<div id="heading">Held Devices</div> <div id="heading">Held Devices</div>
@@ -92,6 +93,7 @@
var rotateSpeed = 3000; var rotateSpeed = 3000;
var itemFilters; var itemFilters;
var fixedTheme = null;
var $inProcessList = $('#inProcess').find('ul'); var $inProcessList = $('#inProcess').find('ul');
var $readyForReturnList = $('#readyForReturn').find('ul'); var $readyForReturnList = $('#readyForReturn').find('ul');
@@ -118,11 +120,15 @@
} }
function init() { function init() {
monitorMouseMove();
applyQueryString();
// Connect to Hub // Connect to Hub
hub = $.connection.noticeboardUpdates; hub = $.connection.noticeboardUpdates;
// Map Functions // Map Functions
hub.client.updateHeldDevice = updateHeldDevice; hub.client.updateHeldDevice = updateHeldDevice;
hub.client.setTheme = setTheme;
$.connection.hub.qs = { Noticeboard: '@(Disco.Services.Jobs.Noticeboards.HeldDevices.Name)' }; $.connection.hub.qs = { Noticeboard: '@(Disco.Services.Jobs.Noticeboards.HeldDevices.Name)' };
$.connection.hub.error(connectionError); $.connection.hub.error(connectionError);
@@ -165,7 +171,6 @@
window.setTimeout(scheduleRotation, rotateSpeed); window.setTimeout(scheduleRotation, rotateSpeed);
}); });
buildFilters();
} }
// Called by SignalR // Called by SignalR
@@ -237,14 +242,53 @@
}, true); }, true);
} }
function buildFilters() { function setTheme(theme) {
var filters = []; if (!!fixedTheme)
return;
var $body = $(document.body);
// Existing classes
var c = $body.attr('class').split(' ');
// Remove existing theme
c = $.grep(c, function (i) { return (i.indexOf('theme-') !== 0) });
c.push('theme-' + theme);
$body.attr('class', c.join(' '));
}
function monitorMouseMove() {
var token = null,
$body = $(document.body);
$body.mousemove(function () {
if (!!token)
window.clearTimeout(token);
else if ($body.css('cursor') == 'none')
$body.css('cursor', 'auto');
token = window.setTimeout(function () {
$body.css('cursor', 'none');
token = null;
}, 3500);
});
}
function applyQueryString() {
var queryStringParameters = getQueryStringParameters(); var queryStringParameters = getQueryStringParameters();
if (queryStringParameters !== null) { if (queryStringParameters !== null) {
var filters = [];
$.each(queryStringParameters, function (key, value) { $.each(queryStringParameters, function (key, value) {
switch (key.toLowerCase()) { switch (key.toLowerCase()) {
case 'deviceaddressinclude': case 'theme': // THEME
setTheme(value);
fixedTheme = value;
break;
case 'deviceaddressinclude': // FILTER: Device Address Include
var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); }); var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); });
if (deviceAddresses.length > 0) { if (deviceAddresses.length > 0) {
filters.push(function (heldDeviceItem) { filters.push(function (heldDeviceItem) {
@@ -257,7 +301,7 @@
}); });
} }
break; break;
case 'deviceaddressexclude': case 'deviceaddressexclude': // FILTER: Device Address Exclude
var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); }); var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); });
if (deviceAddresses.length > 0) { if (deviceAddresses.length > 0) {
filters.push(function (heldDeviceItem) { filters.push(function (heldDeviceItem) {
@@ -270,7 +314,7 @@
}); });
} }
break; break;
case 'deviceprofileinclude': case 'deviceprofileinclude': // FILTER: Device Profile Include
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); }); var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
if (deviceProfiles.length > 0) { if (deviceProfiles.length > 0) {
filters.push(function (heldDeviceItem) { filters.push(function (heldDeviceItem) {
@@ -279,7 +323,7 @@
}); });
} }
break; break;
case 'deviceprofileexclude': case 'deviceprofileexclude': // FILTER: Device Profile Exclude
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); }); var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
if (deviceProfiles.length > 0) { if (deviceProfiles.length > 0) {
filters.push(function (heldDeviceItem) { filters.push(function (heldDeviceItem) {
@@ -290,13 +334,13 @@
break; break;
} }
}); });
}
if (filters.length > 0) if (filters.length > 0)
itemFilters = filters; itemFilters = filters;
else else
itemFilters = null; itemFilters = null;
} }
}
function connectionError() { function connectionError() {
try { try {
@@ -36,7 +36,7 @@ namespace Disco.Web.Areas.Public.Views.HeldDevices
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Public/Views/HeldDevices/Noticeboard.cshtml")] [System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Public/Views/HeldDevices/Noticeboard.cshtml")]
public partial class Noticeboard : Disco.Services.Web.WebViewPage<dynamic> public partial class Noticeboard : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Public.Models.UserHeldDevices.NoticeboardModel>
{ {
public Noticeboard() public Noticeboard()
{ {
@@ -44,7 +44,7 @@ namespace Disco.Web.Areas.Public.Views.HeldDevices
public override void Execute() public override void Execute()
{ {
#line 1 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml" #line 2 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
Layout = null; Layout = null;
Html.BundleDeferred("~/ClientScripts/Modules/Knockout"); Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
@@ -70,7 +70,7 @@ WriteLiteral(" />\r\n <title>Disco ICT - Held Devices</title>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 14 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml" #line 15 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
Write(Html.BundleRenderDeferred()); Write(Html.BundleRenderDeferred());
@@ -78,7 +78,17 @@ Write(Html.BundleRenderDeferred());
#line hidden #line hidden
WriteLiteral("\r\n</head>\r\n<body"); WriteLiteral("\r\n</head>\r\n<body");
WriteLiteral(" class=\"status-connecting\""); WriteAttribute("class", Tuple.Create(" class=\"", 562), Tuple.Create("\"", 615)
, Tuple.Create(Tuple.Create("", 570), Tuple.Create("theme-", 570), true)
#line 17 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
, Tuple.Create(Tuple.Create("", 576), Tuple.Create<System.Object, System.Int32>(Model.DefaultTheme
#line default
#line hidden
, 576), false)
, Tuple.Create(Tuple.Create(" ", 597), Tuple.Create("status-connecting", 598), true)
);
WriteLiteral(">\r\n <div"); WriteLiteral(">\r\n <div");
@@ -219,26 +229,28 @@ WriteLiteral(">\r\n <li data-bind=\"css: { alert: IsAlert }\">\r\n
" else\r\n $(element).livestamp(\'destroy\');\r\n " + " else\r\n $(element).livestamp(\'destroy\');\r\n " +
" }\r\n };\r\n </script>\r\n <script>\r\n $(function () {\r\n " + " }\r\n };\r\n </script>\r\n <script>\r\n $(function () {\r\n " +
" var hub;\r\n var viewModel;\r\n\r\n var rotateSpeed = 3000" + " var hub;\r\n var viewModel;\r\n\r\n var rotateSpeed = 3000" +
";\r\n var itemFilters;\r\n\r\n var $inProcessList = $(\'#inProces" + ";\r\n var itemFilters;\r\n var fixedTheme = null;\r\n\r\n " +
"s\').find(\'ul\');\r\n var $readyForReturnList = $(\'#readyForReturn\').find" + " var $inProcessList = $(\'#inProcess\').find(\'ul\');\r\n var $readyForRe" +
"(\'ul\');\r\n var $waitingForUserActionList = $(\'#waitingForUserAction\')." + "turnList = $(\'#readyForReturn\').find(\'ul\');\r\n var $waitingForUserActi" +
"find(\'ul\');\r\n\r\n function noticeboardViewModel(inProcess, readyForRetu" + "onList = $(\'#waitingForUserAction\').find(\'ul\');\r\n\r\n function noticebo" +
"rn, waitingForUserAction) {\r\n var self = this;\r\n\r\n " + "ardViewModel(inProcess, readyForReturn, waitingForUserAction) {\r\n " +
" self.initialized = false;\r\n\r\n self.inProcess = ko.observableArra" + " var self = this;\r\n\r\n self.initialized = false;\r\n\r\n " +
"y(inProcess);\r\n self.readyForReturn = ko.observableArray(readyFor" + " self.inProcess = ko.observableArray(inProcess);\r\n self.readyFor" +
"Return);\r\n self.waitingForUserAction = ko.observableArray(waiting" + "Return = ko.observableArray(readyForReturn);\r\n self.waitingForUse" +
"ForUserAction);\r\n\r\n self.onRemove = function (element, index, dat" + "rAction = ko.observableArray(waitingForUserAction);\r\n\r\n self.onRe" +
"a) {\r\n $(element).slideUp(400, function () {\r\n " + "move = function (element, index, data) {\r\n $(element).slideUp" +
" $(this).remove();\r\n });\r\n }\r\n " + "(400, function () {\r\n $(this).remove();\r\n " +
" self.onAdd = function (element, index, data) {\r\n if (" + " });\r\n }\r\n self.onAdd = function (element, inde" +
"self.initialized)\r\n $(element).hide().slideDown(400);\r\n " + "x, data) {\r\n if (self.initialized)\r\n $" +
" }\r\n }\r\n\r\n function init() {\r\n " + "(element).hide().slideDown(400);\r\n }\r\n }\r\n\r\n " +
" // Connect to Hub\r\n hub = $.connection.noticeboardUpdates;\r\n\r\n " + " function init() {\r\n monitorMouseMove();\r\n applyQ" +
" // Map Functions\r\n hub.client.updateHeldDevice = up" + "ueryString();\r\n\r\n // Connect to Hub\r\n hub = $.conn" +
"dateHeldDevice;\r\n\r\n $.connection.hub.qs = { Noticeboard: \'"); "ection.noticeboardUpdates;\r\n\r\n // Map Functions\r\n " +
"hub.client.updateHeldDevice = updateHeldDevice;\r\n hub.client.setT" +
"heme = setTheme;\r\n\r\n $.connection.hub.qs = { Noticeboard: \'");
#line 127 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml" #line 133 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
Write(Disco.Services.Jobs.Noticeboards.HeldDevices.Name); Write(Disco.Services.Jobs.Noticeboards.HeldDevices.Name);
@@ -258,7 +270,7 @@ WriteLiteral(@"' };
$.getJSON('"); $.getJSON('");
#line 138 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml" #line 144 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
Write(Url.Action(MVC.Public.HeldDevices.HeldDevices())); Write(Url.Action(MVC.Public.HeldDevices.HeldDevices()));
@@ -280,136 +292,154 @@ WriteLiteral("\', null, function (data) {\r\n\r\n var inProce
"orUserAction);\r\n\r\n ko.applyBindings(viewModel);\r\n " + "orUserAction);\r\n\r\n ko.applyBindings(viewModel);\r\n " +
" viewModel.initialized = true;\r\n\r\n $(\'body\').removeCla" + " viewModel.initialized = true;\r\n\r\n $(\'body\').removeCla" +
"ss(\'status-connecting\');\r\n\r\n window.setTimeout(scheduleRotati" + "ss(\'status-connecting\');\r\n\r\n window.setTimeout(scheduleRotati" +
"on, rotateSpeed);\r\n });\r\n buildFilters();\r\n " + "on, rotateSpeed);\r\n });\r\n }\r\n\r\n // Called b" +
" }\r\n\r\n // Called by SignalR\r\n function updateHeldDevic" + "y SignalR\r\n function updateHeldDevice(updates) {\r\n if " +
"e(updates) {\r\n if (viewModel) {\r\n\r\n $.each(upd" + "(viewModel) {\r\n\r\n $.each(updates, function (deviceSerialNumbe" +
"ates, function (deviceSerialNumber, heldDeviceItem) {\r\n /" + "r, heldDeviceItem) {\r\n // Remove Existing\r\n " +
"/ Remove Existing\r\n removeItem(deviceSerialNumber);\r\n\r\n " + " removeItem(deviceSerialNumber);\r\n\r\n // Add Item" +
" // Add Item\r\n addItem(heldDeviceIte" + "\r\n addItem(heldDeviceItem);\r\n });\r\n " +
"m);\r\n });\r\n }\r\n }\r\n\r\n fu" + " }\r\n }\r\n\r\n function removeItem(deviceSerialNum" +
"nction removeItem(deviceSerialNumber) {\r\n removeItemFromArray(vie" + "ber) {\r\n removeItemFromArray(viewModel.inProcess, deviceSerialNum" +
"wModel.inProcess, deviceSerialNumber);\r\n removeItemFromArray(view" + "ber);\r\n removeItemFromArray(viewModel.readyForReturn, deviceSeria" +
"Model.readyForReturn, deviceSerialNumber);\r\n removeItemFromArray(" + "lNumber);\r\n removeItemFromArray(viewModel.waitingForUserAction, d" +
"viewModel.waitingForUserAction, deviceSerialNumber);\r\n }\r\n\r\n " + "eviceSerialNumber);\r\n }\r\n\r\n function addItem(heldDeviceIte" +
" function addItem(heldDeviceItem) {\r\n if (heldDeviceItem !== nu" + "m) {\r\n if (heldDeviceItem !== null &&\r\n heldDe" +
"ll &&\r\n heldDeviceItem !== undefined &&\r\n " + "viceItem !== undefined &&\r\n includeItem(heldDeviceItem)) {\r\n\r" +
"includeItem(heldDeviceItem)) {\r\n\r\n var array;\r\n\r\n " + "\n var array;\r\n\r\n if (isWaitingForUserActio" +
" if (isWaitingForUserAction(heldDeviceItem))\r\n arr" + "n(heldDeviceItem))\r\n array = viewModel.waitingForUserActi" +
"ay = viewModel.waitingForUserAction;\r\n else if (isReadyForRet" + "on;\r\n else if (isReadyForReturn(heldDeviceItem))\r\n " +
"urn(heldDeviceItem))\r\n array = viewModel.readyForReturn;\r" + " array = viewModel.readyForReturn;\r\n else if (isI" +
"\n else if (isInProcess(heldDeviceItem))\r\n " + "nProcess(heldDeviceItem))\r\n array = viewModel.inProcess;\r" +
" array = viewModel.inProcess;\r\n\r\n if (array().length === 0" + "\n\r\n if (array().length === 0) {\r\n arra" +
") {\r\n array.push(heldDeviceItem);\r\n } " + "y.push(heldDeviceItem);\r\n } else {\r\n v" +
"else {\r\n var index = findSortedInsertIndex(array, heldDev" + "ar index = findSortedInsertIndex(array, heldDeviceItem);\r\n " +
"iceItem);\r\n if (index === -1)\r\n " + " if (index === -1)\r\n array.push(heldDeviceItem);\r\n " +
" array.push(heldDeviceItem);\r\n else\r\n " + " else\r\n array.splice(index, 0, h" +
" array.splice(index, 0, heldDeviceItem);\r\n }\r\n " + "eldDeviceItem);\r\n }\r\n }\r\n }\r\n\r\n " +
" }\r\n }\r\n\r\n function rotateArrays() {\r\n " + " function rotateArrays() {\r\n rotateArray(viewModel.inProce" +
" rotateArray(viewModel.inProcess, $inProcessList);\r\n rotateArr" + "ss, $inProcessList);\r\n rotateArray(viewModel.readyForReturn, $rea" +
"ay(viewModel.readyForReturn, $readyForReturnList);\r\n rotateArray(" + "dyForReturnList);\r\n rotateArray(viewModel.waitingForUserAction, $" +
"viewModel.waitingForUserAction, $waitingForUserActionList);\r\n }\r\n\r\n " + "waitingForUserActionList);\r\n }\r\n\r\n function scheduleRotati" +
" function scheduleRotation() {\r\n rotateArrays();\r\n\r\n " + "on() {\r\n rotateArrays();\r\n\r\n window.setTimeout(sch" +
" window.setTimeout(scheduleRotation, rotateSpeed);\r\n }\r\n\r\n" + "eduleRotation, rotateSpeed);\r\n }\r\n\r\n function includeItem(" +
" function includeItem(heldDeviceItem) {\r\n if (itemFilt" + "heldDeviceItem) {\r\n if (itemFilters == null || itemFilters.length" +
"ers == null || itemFilters.length == 0)\r\n return true;\r\n\r\n " + " == 0)\r\n return true;\r\n\r\n return itemFilters.r" +
" return itemFilters.reduce(function (previousValue, currentValue, in" + "educe(function (previousValue, currentValue, index, array) {\r\n " +
"dex, array) {\r\n if (previousValue === false)\r\n " + " if (previousValue === false)\r\n return false;\r\n " +
" return false;\r\n return currentValue(heldDeviceItem);" + " return currentValue(heldDeviceItem);\r\n }, true);\r\n " +
"\r\n }, true);\r\n }\r\n\r\n function buildFilters(" + " }\r\n\r\n function setTheme(theme) {\r\n if (!!fixed" +
") {\r\n var filters = [];\r\n var queryStringParameter" + "Theme)\r\n return;\r\n\r\n var $body = $(document.bo" +
"s = getQueryStringParameters();\r\n\r\n if (queryStringParameters !==" + "dy);\r\n\r\n // Existing classes\r\n var c = $body.attr(" +
" null) {\r\n $.each(queryStringParameters, function (key, value" + "\'class\').split(\' \');\r\n // Remove existing theme\r\n " +
") {\r\n switch (key.toLowerCase()) {\r\n " + "c = $.grep(c, function (i) { return (i.indexOf(\'theme-\') !== 0) });\r\n\r\n " +
" case \'deviceaddressinclude\':\r\n var deviceA" + " c.push(\'theme-\' + theme);\r\n\r\n $body.attr(\'class\', c.join(\'" +
"ddresses = value.split(\",\").map(function (v) { return v.toLowerCase(); });\r\n " + " \'));\r\n }\r\n\r\n function monitorMouseMove() {\r\n " +
" if (deviceAddresses.length > 0) {\r\n " + " var token = null,\r\n $body = $(document.body);\r\n\r\n " +
" filters.push(function (heldDeviceItem) {\r\n " + " $body.mousemove(function () {\r\n if (!!token)\r\n " +
" // false if DeviceAddressShortName is null\r\n " + " window.clearTimeout(token);\r\n else if ($body." +
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " + "css(\'cursor\') == \'none\')\r\n $body.css(\'cursor\', \'auto\');\r\n" +
" return false;\r\n\r\n " + "\r\n token = window.setTimeout(function () {\r\n " +
" $body.css(\'cursor\', \'none\');\r\n token = null;\r\n " +
" }, 3500);\r\n });\r\n\r\n }\r\n\r\n f" +
"unction applyQueryString() {\r\n var queryStringParameters = getQue" +
"ryStringParameters();\r\n\r\n if (queryStringParameters !== null) {\r\n" +
" var filters = [];\r\n\r\n $.each(queryStringP" +
"arameters, function (key, value) {\r\n switch (key.toLowerC" +
"ase()) {\r\n case \'theme\': // THEME\r\n " +
" setTheme(value);\r\n fixedTheme = val" +
"ue;\r\n break;\r\n case \'d" +
"eviceaddressinclude\': // FILTER: Device Address Include\r\n " +
" var deviceAddresses = value.split(\",\").map(function (v) { return v.toLo" +
"werCase(); });\r\n if (deviceAddresses.length > 0) " +
"{\r\n filters.push(function (heldDeviceItem) {\r" +
"\n // false if DeviceAddressShortName is n" +
"ull\r\n if (!heldDeviceItem.DeviceAddressSh" +
"ortName)\r\n return false;\r\n\r\n " +
" // true if DeviceAddressShortName is included\r\n " + " // true if DeviceAddressShortName is included\r\n " +
" return $.inArray(heldDeviceItem.DeviceAddressShortName.toLower" + " return $.inArray(heldDeviceItem.DeviceAddr" +
"Case(), deviceAddresses) >= 0;\r\n });\r\n " + "essShortName.toLowerCase(), deviceAddresses) >= 0;\r\n " +
" }\r\n break;\r\n " + " });\r\n }\r\n " +
" case \'deviceaddressexclude\':\r\n va" + "break;\r\n case \'deviceaddressexclude\': // FILTER: Devi" +
"r deviceAddresses = value.split(\",\").map(function (v) { return v.toLowerCase(); " + "ce Address Exclude\r\n var deviceAddresses = value." +
"});\r\n if (deviceAddresses.length > 0) {\r\n " + "split(\",\").map(function (v) { return v.toLowerCase(); });\r\n " +
" if (deviceAddresses.length > 0) {\r\n " +
" filters.push(function (heldDeviceItem) {\r\n " + " filters.push(function (heldDeviceItem) {\r\n " +
" // true if DeviceAddressShortName is null\r\n " + " // true if DeviceAddressShortName is null\r\n " +
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " + " if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
" return true;\r\n\r\n " + " return true;\r\n\r\n // true " +
" // true if DeviceAddressShortName is excluded\r\n " + "if DeviceAddressShortName is excluded\r\n r" +
" return $.inArray(heldDeviceItem.DeviceAddressShortName." + "eturn $.inArray(heldDeviceItem.DeviceAddressShortName.toLowerCase(), deviceAddre" +
"toLowerCase(), deviceAddresses) < 0;\r\n });\r\n " + "sses) < 0;\r\n });\r\n " +
" }\r\n break;\r\n " + " }\r\n break;\r\n case" +
" case \'deviceprofileinclude\':\r\n " + " \'deviceprofileinclude\': // FILTER: Device Profile Include\r\n " +
" var deviceProfiles = value.split(\",\").map(function (v) { return parseInt(v);" + " var deviceProfiles = value.split(\",\").map(function (v) { return pars" +
" });\r\n if (deviceProfiles.length > 0) {\r\n " + "eInt(v); });\r\n if (deviceProfiles.length > 0) {\r\n" +
" filters.push(function (heldDeviceItem) {\r\n " + " filters.push(function (heldDeviceItem) {\r\n " +
" // true if DeviceProfileId is included\r\n " + " // true if DeviceProfileId is included\r\n " +
" return $.inArray(heldDeviceItem.DeviceProfileId, d" + " return $.inArray(heldDeviceItem.DeviceProf" +
"eviceProfiles) >= 0;\r\n });\r\n " + "ileId, deviceProfiles) >= 0;\r\n });\r\n " +
" }\r\n break;\r\n " + " }\r\n break;\r\n " +
" case \'deviceprofileexclude\':\r\n var devicePr" + " case \'deviceprofileexclude\': // FILTER: Device Profile Exclude\r\n " +
"ofiles = value.split(\",\").map(function (v) { return parseInt(v); });\r\n " + " var deviceProfiles = value.split(\",\").map(function" +
" if (deviceProfiles.length > 0) {\r\n " + " (v) { return parseInt(v); });\r\n if (deviceProfil" +
" filters.push(function (heldDeviceItem) {\r\n " + "es.length > 0) {\r\n filters.push(function (hel" +
" // true if DeviceProfileId is excluded\r\n " + "dDeviceItem) {\r\n // true if DeviceProfile" +
" return $.inArray(heldDeviceItem.DeviceProfileId, deviceProfiles) <" + "Id is excluded\r\n return $.inArray(heldDev" +
" 0;\r\n });\r\n }\r" + "iceItem.DeviceProfileId, deviceProfiles) < 0;\r\n " +
"\n break;\r\n }\r\n " + " });\r\n }\r\n break" +
" });\r\n }\r\n\r\n if (filters.length > 0)\r\n " + ";\r\n }\r\n });\r\n\r\n if " +
" itemFilters = filters;\r\n else\r\n " + "(filters.length > 0)\r\n itemFilters = filters;\r\n " +
" itemFilters = null;\r\n }\r\n\r\n function connectionError() {\r" + " else\r\n itemFilters = null;\r\n }\r\n" +
"\n try {\r\n $(\'body\').addClass(\'status-error\');\r" + " }\r\n\r\n function connectionError() {\r\n try {" +
"\n $.connection.hub.stop();\r\n } catch (e) {\r\n " + "\r\n $(\'body\').addClass(\'status-error\');\r\n $" +
" // Ignore\r\n }\r\n\r\n window.setTime" + ".connection.hub.stop();\r\n } catch (e) {\r\n // I" +
"out(function () {\r\n window.location.href = window.location.hr" + "gnore\r\n }\r\n\r\n window.setTimeout(function () {\r\n " +
"ef;\r\n }, 10000);\r\n }\r\n\r\n // Helpers\r\n " + " window.location.href = window.location.href;\r\n }" +
" function rotateArray(koArray, element) {\r\n var items = koAr" + ", 10000);\r\n }\r\n\r\n // Helpers\r\n function rotateA" +
"ray();\r\n\r\n if (items.length <= 1)\r\n return 0;\r" + "rray(koArray, element) {\r\n var items = koArray();\r\n\r\n " +
"\n\r\n if (element.height() < (element.parent().height() - 30)) {\r\n\r" + " if (items.length <= 1)\r\n return 0;\r\n\r\n if " +
"\n if (findUnsortedArrayTopIndex(items) !== 0)\r\n " + "(element.height() < (element.parent().height() - 30)) {\r\n\r\n i" +
" koArray.sort(sortFunction);\r\n\r\n // Don\'t rotate if " + "f (findUnsortedArrayTopIndex(items) !== 0)\r\n koArray.sort" +
"small & sorted correctly\r\n return;\r\n }\r\n\r\n " + "(sortFunction);\r\n\r\n // Don\'t rotate if small & sorted correct" +
" // Move Last Item to Top\r\n var item = koArray.pop();\r" + "ly\r\n return;\r\n }\r\n\r\n // Move La" +
"\n koArray.unshift(item);\r\n }\r\n function rem" + "st Item to Top\r\n var item = koArray.pop();\r\n koArr" +
"oveItemFromArray(koArray, deviceSerialNumber) {\r\n var items = koA" + "ay.unshift(item);\r\n }\r\n function removeItemFromArray(koArr" +
"rray();\r\n for (var i = 0; i < items.length; i++) {\r\n " + "ay, deviceSerialNumber) {\r\n var items = koArray();\r\n " +
" if (items[i].DeviceSerialNumber == deviceSerialNumber) {\r\n " + " for (var i = 0; i < items.length; i++) {\r\n if (items[i].De" +
" koArray.splice(i, 1);\r\n items = koArray();\r\n " + "viceSerialNumber == deviceSerialNumber) {\r\n koArray.splic" +
" i--;\r\n }\r\n }\r\n " + "e(i, 1);\r\n items = koArray();\r\n i-" +
"}\r\n function findUnsortedArrayTopIndex(items) {\r\n // O" + "-;\r\n }\r\n }\r\n }\r\n functio" +
"nly one Item\r\n if (items.length <= 1)\r\n return" + "n findUnsortedArrayTopIndex(items) {\r\n // Only one Item\r\n " +
" 0;\r\n\r\n for (var i = 1; i < items.length; i++) {\r\n " + " if (items.length <= 1)\r\n return 0;\r\n\r\n " +
" var s = sortFunction(items[i - 1], items[i]);\r\n if (s > " + " for (var i = 1; i < items.length; i++) {\r\n var s = sortFunct" +
"0)\r\n return i;\r\n }\r\n\r\n retu" + "ion(items[i - 1], items[i]);\r\n if (s > 0)\r\n " +
"rn 0;\r\n }\r\n function findSortedInsertIndex(koArray, heldDe" + " return i;\r\n }\r\n\r\n return 0;\r\n }\r\n" +
"viceItem) {\r\n var items = koArray();\r\n var startIn" + " function findSortedInsertIndex(koArray, heldDeviceItem) {\r\n " +
"dex = findUnsortedArrayTopIndex(items);\r\n for (var i = startIndex" + " var items = koArray();\r\n var startIndex = findUnsortedArra" +
"; i < items.length; i++) {\r\n var s = sortFunction(heldDeviceI" + "yTopIndex(items);\r\n for (var i = startIndex; i < items.length; i+" +
"tem, items[i]);\r\n if (s <= 0)\r\n return" + "+) {\r\n var s = sortFunction(heldDeviceItem, items[i]);\r\n " +
" i;\r\n }\r\n if (startIndex !== 0) {\r\n " + " if (s <= 0)\r\n return i;\r\n }" +
" for (var i = 0; i < startIndex; i++) {\r\n var s = sor" + "\r\n if (startIndex !== 0) {\r\n for (var i = 0; i" +
"tFunction(heldDeviceItem, items[i]);\r\n if (s <= 0)\r\n " + " < startIndex; i++) {\r\n var s = sortFunction(heldDeviceIt" +
" return i;\r\n }\r\n ret" + "em, items[i]);\r\n if (s <= 0)\r\n " +
"urn startIndex;\r\n } else {\r\n return -1;\r\n " + " return i;\r\n }\r\n return startIndex;\r\n " +
" }\r\n }\r\n function sortFunction(l, r) {\r\n " + " } else {\r\n return -1;\r\n }\r\n " +
" return l.DeviceDescription.toLowerCase() == r.DeviceDescription.toLowerC" + " }\r\n function sortFunction(l, r) {\r\n return l.Devic" +
"ase() ? 0 : (l.DeviceDescription.toLowerCase() < r.DeviceDescription.toLowerCase" + "eDescription.toLowerCase() == r.DeviceDescription.toLowerCase() ? 0 : (l.DeviceD" +
"() ? -1 : 1)\r\n }\r\n function isInProcess(i) {\r\n " + "escription.toLowerCase() < r.DeviceDescription.toLowerCase() ? -1 : 1)\r\n " +
" return !i.ReadyForReturn && !i.WaitingForUserAction;\r\n }\r\n " + " }\r\n function isInProcess(i) {\r\n return !i.ReadyFor" +
" function isReadyForReturn(i) {\r\n return i.ReadyForReturn && " + "Return && !i.WaitingForUserAction;\r\n }\r\n function isReadyF" +
"!i.WaitingForUserAction;\r\n }\r\n function isWaitingForUserAc" + "orReturn(i) {\r\n return i.ReadyForReturn && !i.WaitingForUserActio" +
"tion(i) {\r\n return i.WaitingForUserAction;\r\n }\r\n " + "n;\r\n }\r\n function isWaitingForUserAction(i) {\r\n " +
" function getQueryStringParameters() {\r\n\r\n if (window.locati" + " return i.WaitingForUserAction;\r\n }\r\n function getQuer" +
"on.search.length === 0)\r\n return null;\r\n\r\n var" + "yStringParameters() {\r\n\r\n if (window.location.search.length === 0" +
" params = {};\r\n window.location.search.substr(1).split(\"&\").forEa" + ")\r\n return null;\r\n\r\n var params = {};\r\n " +
"ch(function (pair) {\r\n if (pair === \"\") return;\r\n " + " window.location.search.substr(1).split(\"&\").forEach(function (pair) {\r\n" +
" var parts = pair.split(\"=\");\r\n params[parts[0]] = par" + " if (pair === \"\") return;\r\n var parts = pa" +
"ts[1] && decodeURIComponent(parts[1].replace(/\\+/g, \" \"));\r\n });\r" + "ir.split(\"=\");\r\n params[parts[0]] = parts[1] && decodeURIComp" +
"\n return params;\r\n }\r\n\r\n init();\r\n }" + "onent(parts[1].replace(/\\+/g, \" \"));\r\n });\r\n retur" +
");\r\n </script>\r\n</body>\r\n</html>"); "n params;\r\n }\r\n\r\n init();\r\n });\r\n </script>\r\n</b" +
"ody>\r\n</html>");
} }
} }
@@ -1,4 +1,5 @@
@{ @model Disco.Web.Areas.Public.Models.UserHeldDevices.NoticeboardModel
@{
Layout = null; Layout = null;
Html.BundleDeferred("~/ClientScripts/Modules/Knockout"); Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR"); Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -13,7 +14,7 @@
<title>Disco ICT - Held Devices for Users</title> <title>Disco ICT - Held Devices for Users</title>
@Html.BundleRenderDeferred() @Html.BundleRenderDeferred()
</head> </head>
<body class="status-connecting"> <body class="theme-@(Model.DefaultTheme) status-connecting">
<div id="page"> <div id="page">
<header id="header"> <header id="header">
<div id="heading">Held Devices for Users</div> <div id="heading">Held Devices for Users</div>
@@ -92,6 +93,7 @@
var rotateSpeed = 3000; var rotateSpeed = 3000;
var itemFilters; var itemFilters;
var fixedTheme = null;
var $inProcessList = $('#inProcess').find('ul'); var $inProcessList = $('#inProcess').find('ul');
var $readyForReturnList = $('#readyForReturn').find('ul'); var $readyForReturnList = $('#readyForReturn').find('ul');
@@ -118,11 +120,15 @@
} }
function init() { function init() {
monitorMouseMove();
applyQueryString();
// Connect to Hub // Connect to Hub
hub = $.connection.noticeboardUpdates; hub = $.connection.noticeboardUpdates;
// Map Functions // Map Functions
hub.client.updateHeldDeviceForUser = updateHeldDevice; hub.client.updateHeldDeviceForUser = updateHeldDevice;
hub.client.setTheme = setTheme;
$.connection.hub.qs = { Noticeboard: '@(Disco.Services.Jobs.Noticeboards.HeldDevicesForUsers.Name)' }; $.connection.hub.qs = { Noticeboard: '@(Disco.Services.Jobs.Noticeboards.HeldDevicesForUsers.Name)' };
$.connection.hub.error(connectionError); $.connection.hub.error(connectionError);
@@ -165,7 +171,6 @@
window.setTimeout(scheduleRotation, rotateSpeed); window.setTimeout(scheduleRotation, rotateSpeed);
}); });
buildFilters();
} }
// Called by SignalR // Called by SignalR
@@ -237,14 +242,53 @@
}, true); }, true);
} }
function buildFilters() { function setTheme(theme) {
var filters = []; if (!!fixedTheme)
return;
var $body = $(document.body);
// Existing classes
var c = $body.attr('class').split(' ');
// Remove existing theme
c = $.grep(c, function (i) { return (i.indexOf('theme-') !== 0) });
c.push('theme-' + theme);
$body.attr('class', c.join(' '));
}
function monitorMouseMove() {
var token = null,
$body = $(document.body);
$body.mousemove(function () {
if (!!token)
window.clearTimeout(token);
else if ($body.css('cursor') == 'none')
$body.css('cursor', 'auto');
token = window.setTimeout(function () {
$body.css('cursor', 'none');
token = null;
}, 3500);
});
}
function applyQueryString() {
var queryStringParameters = getQueryStringParameters(); var queryStringParameters = getQueryStringParameters();
if (queryStringParameters !== null) { if (queryStringParameters !== null) {
var filters = [];
$.each(queryStringParameters, function (key, value) { $.each(queryStringParameters, function (key, value) {
switch (key.toLowerCase()) { switch (key.toLowerCase()) {
case 'deviceaddressinclude': case 'theme': // THEME
setTheme(value);
fixedTheme = value;
break;
case 'deviceaddressinclude': // FILTER: Device Address Include
var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); }); var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); });
if (deviceAddresses.length > 0) { if (deviceAddresses.length > 0) {
filters.push(function (heldDeviceItem) { filters.push(function (heldDeviceItem) {
@@ -257,7 +301,7 @@
}); });
} }
break; break;
case 'deviceaddressexclude': case 'deviceaddressexclude': // FILTER: Device Address Exclude
var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); }); var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); });
if (deviceAddresses.length > 0) { if (deviceAddresses.length > 0) {
filters.push(function (heldDeviceItem) { filters.push(function (heldDeviceItem) {
@@ -270,7 +314,7 @@
}); });
} }
break; break;
case 'deviceprofileinclude': case 'deviceprofileinclude': // FILTER: Device Profile Include
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); }); var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
if (deviceProfiles.length > 0) { if (deviceProfiles.length > 0) {
filters.push(function (heldDeviceItem) { filters.push(function (heldDeviceItem) {
@@ -279,7 +323,7 @@
}); });
} }
break; break;
case 'deviceprofileexclude': case 'deviceprofileexclude': // FILTER: Device Profile Exclude
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); }); var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
if (deviceProfiles.length > 0) { if (deviceProfiles.length > 0) {
filters.push(function (heldDeviceItem) { filters.push(function (heldDeviceItem) {
@@ -290,13 +334,13 @@
break; break;
} }
}); });
}
if (filters.length > 0) if (filters.length > 0)
itemFilters = filters; itemFilters = filters;
else else
itemFilters = null; itemFilters = null;
} }
}
function connectionError() { function connectionError() {
try { try {
@@ -36,7 +36,7 @@ namespace Disco.Web.Areas.Public.Views.UserHeldDevices
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Public/Views/UserHeldDevices/Noticeboard.cshtml")] [System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Public/Views/UserHeldDevices/Noticeboard.cshtml")]
public partial class Noticeboard : Disco.Services.Web.WebViewPage<dynamic> public partial class Noticeboard : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Public.Models.UserHeldDevices.NoticeboardModel>
{ {
public Noticeboard() public Noticeboard()
{ {
@@ -44,7 +44,7 @@ namespace Disco.Web.Areas.Public.Views.UserHeldDevices
public override void Execute() public override void Execute()
{ {
#line 1 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml" #line 2 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
Layout = null; Layout = null;
Html.BundleDeferred("~/ClientScripts/Modules/Knockout"); Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
@@ -70,7 +70,7 @@ WriteLiteral(" />\r\n <title>Disco ICT - Held Devices for Users</title>\r\n")
WriteLiteral(" "); WriteLiteral(" ");
#line 14 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml" #line 15 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
Write(Html.BundleRenderDeferred()); Write(Html.BundleRenderDeferred());
@@ -78,7 +78,17 @@ Write(Html.BundleRenderDeferred());
#line hidden #line hidden
WriteLiteral("\r\n</head>\r\n<body"); WriteLiteral("\r\n</head>\r\n<body");
WriteLiteral(" class=\"status-connecting\""); WriteAttribute("class", Tuple.Create(" class=\"", 572), Tuple.Create("\"", 625)
, Tuple.Create(Tuple.Create("", 580), Tuple.Create("theme-", 580), true)
#line 17 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
, Tuple.Create(Tuple.Create("", 586), Tuple.Create<System.Object, System.Int32>(Model.DefaultTheme
#line default
#line hidden
, 586), false)
, Tuple.Create(Tuple.Create(" ", 607), Tuple.Create("status-connecting", 608), true)
);
WriteLiteral(">\r\n <div"); WriteLiteral(">\r\n <div");
@@ -219,27 +229,29 @@ WriteLiteral(">\r\n <li data-bind=\"css: { alert: IsAlert }\">\r\n
"p(valueUnwrapped);\r\n else\r\n $(element).livesta" + "p(valueUnwrapped);\r\n else\r\n $(element).livesta" +
"mp(\'destroy\');\r\n }\r\n };\r\n </script>\r\n <script>\r\n " + "mp(\'destroy\');\r\n }\r\n };\r\n </script>\r\n <script>\r\n " +
"$(function () {\r\n var hub;\r\n var viewModel;\r\n\r\n " + "$(function () {\r\n var hub;\r\n var viewModel;\r\n\r\n " +
" var rotateSpeed = 3000;\r\n var itemFilters;\r\n\r\n var $inPro" + " var rotateSpeed = 3000;\r\n var itemFilters;\r\n var fixedThe" +
"cessList = $(\'#inProcess\').find(\'ul\');\r\n var $readyForReturnList = $(" + "me = null;\r\n\r\n var $inProcessList = $(\'#inProcess\').find(\'ul\');\r\n " +
"\'#readyForReturn\').find(\'ul\');\r\n var $waitingForUserActionList = $(\'#" + " var $readyForReturnList = $(\'#readyForReturn\').find(\'ul\');\r\n " +
"waitingForUserAction\').find(\'ul\');\r\n\r\n function noticeboardViewModel(" + "var $waitingForUserActionList = $(\'#waitingForUserAction\').find(\'ul\');\r\n\r\n " +
"inProcess, readyForReturn, waitingForUserAction) {\r\n var self = t" + " function noticeboardViewModel(inProcess, readyForReturn, waitingForUserAct" +
"his;\r\n\r\n self.initialized = false;\r\n\r\n self.inProc" + "ion) {\r\n var self = this;\r\n\r\n self.initialized = f" +
"ess = ko.observableArray(inProcess);\r\n self.readyForReturn = ko.o" + "alse;\r\n\r\n self.inProcess = ko.observableArray(inProcess);\r\n " +
"bservableArray(readyForReturn);\r\n self.waitingForUserAction = ko." + " self.readyForReturn = ko.observableArray(readyForReturn);\r\n " +
"observableArray(waitingForUserAction);\r\n\r\n self.onRemove = functi" + " self.waitingForUserAction = ko.observableArray(waitingForUserAction);\r\n\r\n " +
"on (element, index, data) {\r\n $(element).slideUp(400, functio" + " self.onRemove = function (element, index, data) {\r\n " +
"n () {\r\n $(this).remove();\r\n });\r\n " + " $(element).slideUp(400, function () {\r\n $(this).remo" +
" }\r\n self.onAdd = function (element, index, data) {\r\n " + "ve();\r\n });\r\n }\r\n self.onAdd = " +
" if (self.initialized)\r\n $(element).hid" + "function (element, index, data) {\r\n if (self.initialized)\r\n " +
"e().slideDown(400);\r\n }\r\n }\r\n\r\n function in" + " $(element).hide().slideDown(400);\r\n }\r\n " +
"it() {\r\n // Connect to Hub\r\n hub = $.connection.no" + " }\r\n\r\n function init() {\r\n monitorMouseMove();\r" +
"ticeboardUpdates;\r\n\r\n // Map Functions\r\n hub.clien" + "\n applyQueryString();\r\n\r\n // Connect to Hub\r\n " +
"t.updateHeldDeviceForUser = updateHeldDevice;\r\n\r\n $.connection.hu" + " hub = $.connection.noticeboardUpdates;\r\n\r\n // Map Func" +
"b.qs = { Noticeboard: \'"); "tions\r\n hub.client.updateHeldDeviceForUser = updateHeldDevice;\r\n " +
" hub.client.setTheme = setTheme;\r\n\r\n $.connection.h" +
"ub.qs = { Noticeboard: \'");
#line 127 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml" #line 133 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
Write(Disco.Services.Jobs.Noticeboards.HeldDevicesForUsers.Name); Write(Disco.Services.Jobs.Noticeboards.HeldDevicesForUsers.Name);
@@ -259,7 +271,7 @@ WriteLiteral(@"' };
$.getJSON('"); $.getJSON('");
#line 138 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml" #line 144 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
Write(Url.Action(MVC.Public.UserHeldDevices.UserHeldDevices())); Write(Url.Action(MVC.Public.UserHeldDevices.UserHeldDevices()));
@@ -281,134 +293,152 @@ WriteLiteral("\', null, function (data) {\r\n\r\n var inProce
"orUserAction);\r\n\r\n ko.applyBindings(viewModel);\r\n " + "orUserAction);\r\n\r\n ko.applyBindings(viewModel);\r\n " +
" viewModel.initialized = true;\r\n\r\n $(\'body\').removeCla" + " viewModel.initialized = true;\r\n\r\n $(\'body\').removeCla" +
"ss(\'status-connecting\');\r\n\r\n window.setTimeout(scheduleRotati" + "ss(\'status-connecting\');\r\n\r\n window.setTimeout(scheduleRotati" +
"on, rotateSpeed);\r\n });\r\n buildFilters();\r\n " + "on, rotateSpeed);\r\n });\r\n }\r\n\r\n // Called b" +
" }\r\n\r\n // Called by SignalR\r\n function updateHeldDevic" + "y SignalR\r\n function updateHeldDevice(updates) {\r\n if " +
"e(updates) {\r\n if (viewModel) {\r\n\r\n $.each(upd" + "(viewModel) {\r\n\r\n $.each(updates, function (UserId, heldDevic" +
"ates, function (UserId, heldDeviceItem) {\r\n // Remove Exi" + "eItem) {\r\n // Remove Existing\r\n re" +
"sting\r\n removeItem(UserId);\r\n\r\n //" + "moveItem(UserId);\r\n\r\n // Add Item\r\n " +
" Add Item\r\n addItem(heldDeviceItem);\r\n " + " addItem(heldDeviceItem);\r\n });\r\n }\r\n " +
" });\r\n }\r\n }\r\n\r\n function removeItem(UserId" + " }\r\n\r\n function removeItem(UserId) {\r\n removeItemFr" +
") {\r\n removeItemFromArray(viewModel.inProcess, UserId);\r\n " + "omArray(viewModel.inProcess, UserId);\r\n removeItemFromArray(viewM" +
" removeItemFromArray(viewModel.readyForReturn, UserId);\r\n " + "odel.readyForReturn, UserId);\r\n removeItemFromArray(viewModel.wai" +
"removeItemFromArray(viewModel.waitingForUserAction, UserId);\r\n }\r\n\r\n " + "tingForUserAction, UserId);\r\n }\r\n\r\n function addItem(heldD" +
" function addItem(heldDeviceItem) {\r\n if (heldDeviceIte" + "eviceItem) {\r\n if (heldDeviceItem !== null &&\r\n " +
"m !== null &&\r\n heldDeviceItem !== undefined &&\r\n " + " heldDeviceItem !== undefined &&\r\n includeItem(heldDeviceIte" +
" includeItem(heldDeviceItem)) {\r\n\r\n var array;\r\n\r\n " + "m)) {\r\n\r\n var array;\r\n\r\n if (isWaitingForU" +
" if (isWaitingForUserAction(heldDeviceItem))\r\n " + "serAction(heldDeviceItem))\r\n array = viewModel.waitingFor" +
" array = viewModel.waitingForUserAction;\r\n else if (isRea" + "UserAction;\r\n else if (isReadyForReturn(heldDeviceItem))\r\n " +
"dyForReturn(heldDeviceItem))\r\n array = viewModel.readyFor" + " array = viewModel.readyForReturn;\r\n else" +
"Return;\r\n else if (isInProcess(heldDeviceItem))\r\n " + " if (isInProcess(heldDeviceItem))\r\n array = viewModel.inP" +
" array = viewModel.inProcess;\r\n\r\n if (array().leng" + "rocess;\r\n\r\n if (array().length === 0) {\r\n " +
"th === 0) {\r\n array.push(heldDeviceItem);\r\n " + " array.push(heldDeviceItem);\r\n } else {\r\n " +
" } else {\r\n var index = findSortedInsertIndex(array," + " var index = findSortedInsertIndex(array, heldDeviceItem);\r\n " +
" heldDeviceItem);\r\n if (index === -1)\r\n " + " if (index === -1)\r\n array.push(heldDeviceIt" +
" array.push(heldDeviceItem);\r\n else\r\n " + "em);\r\n else\r\n array.splice(ind" +
" array.splice(index, 0, heldDeviceItem);\r\n }\r" + "ex, 0, heldDeviceItem);\r\n }\r\n }\r\n }" +
"\n }\r\n }\r\n\r\n function rotateArrays() {\r\n " + "\r\n\r\n function rotateArrays() {\r\n rotateArray(viewModel" +
" rotateArray(viewModel.inProcess, $inProcessList);\r\n r" + ".inProcess, $inProcessList);\r\n rotateArray(viewModel.readyForRetu" +
"otateArray(viewModel.readyForReturn, $readyForReturnList);\r\n rota" + "rn, $readyForReturnList);\r\n rotateArray(viewModel.waitingForUserA" +
"teArray(viewModel.waitingForUserAction, $waitingForUserActionList);\r\n " + "ction, $waitingForUserActionList);\r\n }\r\n\r\n function schedu" +
" }\r\n\r\n function scheduleRotation() {\r\n rotateArrays();" + "leRotation() {\r\n rotateArrays();\r\n\r\n window.setTim" +
"\r\n\r\n window.setTimeout(scheduleRotation, rotateSpeed);\r\n " + "eout(scheduleRotation, rotateSpeed);\r\n }\r\n\r\n function incl" +
" }\r\n\r\n function includeItem(heldDeviceItem) {\r\n if (" + "udeItem(heldDeviceItem) {\r\n if (itemFilters == null || itemFilter" +
"itemFilters == null || itemFilters.length == 0)\r\n return true" + "s.length == 0)\r\n return true;\r\n\r\n return itemF" +
";\r\n\r\n return itemFilters.reduce(function (previousValue, currentV" + "ilters.reduce(function (previousValue, currentValue, index, array) {\r\n " +
"alue, index, array) {\r\n if (previousValue === false)\r\n " + " if (previousValue === false)\r\n return false;\r\n " +
" return false;\r\n return currentValue(heldDevi" + " return currentValue(heldDeviceItem);\r\n }, true" +
"ceItem);\r\n }, true);\r\n }\r\n\r\n function build" + ");\r\n }\r\n\r\n function setTheme(theme) {\r\n if " +
"Filters() {\r\n var filters = [];\r\n var queryStringP" + "(!!fixedTheme)\r\n return;\r\n\r\n var $body = $(doc" +
"arameters = getQueryStringParameters();\r\n\r\n if (queryStringParame" + "ument.body);\r\n\r\n // Existing classes\r\n var c = $bo" +
"ters !== null) {\r\n $.each(queryStringParameters, function (ke" + "dy.attr(\'class\').split(\' \');\r\n // Remove existing theme\r\n " +
"y, value) {\r\n switch (key.toLowerCase()) {\r\n " + " c = $.grep(c, function (i) { return (i.indexOf(\'theme-\') !== 0) });\r\n\r\n " +
" case \'deviceaddressinclude\':\r\n var" + " c.push(\'theme-\' + theme);\r\n\r\n $body.attr(\'class\', " +
" deviceAddresses = value.split(\",\").map(function (v) { return v.toLowerCase(); }" + "c.join(\' \'));\r\n }\r\n\r\n function monitorMouseMove() {\r\n " +
");\r\n if (deviceAddresses.length > 0) {\r\n " + " var token = null,\r\n $body = $(document.body);\r\n\r\n " +
" $body.mousemove(function () {\r\n if (!!token)\r\n" +
" window.clearTimeout(token);\r\n else if" +
" ($body.css(\'cursor\') == \'none\')\r\n $body.css(\'cursor\', \'a" +
"uto\');\r\n\r\n token = window.setTimeout(function () {\r\n " +
" $body.css(\'cursor\', \'none\');\r\n token = nul" +
"l;\r\n }, 3500);\r\n });\r\n\r\n }\r\n\r\n " +
" function applyQueryString() {\r\n var queryStringParameters " +
"= getQueryStringParameters();\r\n\r\n if (queryStringParameters !== n" +
"ull) {\r\n var filters = [];\r\n\r\n $.each(quer" +
"yStringParameters, function (key, value) {\r\n switch (key." +
"toLowerCase()) {\r\n case \'theme\': // THEME\r\n " +
" setTheme(value);\r\n fixedThe" +
"me = value;\r\n break;\r\n " +
" case \'deviceaddressinclude\': // FILTER: Device Address Include\r\n " +
" var deviceAddresses = value.split(\",\").map(function (v) { retur" +
"n v.toLowerCase(); });\r\n if (deviceAddresses.leng" +
"th > 0) {\r\n filters.push(function (heldDevice" +
"Item) {\r\n // false if DeviceAddressShortN" +
"ame is null\r\n if (!heldDeviceItem.DeviceA" +
"ddressShortName)\r\n return false;\r\n\r\n " +
" // true if DeviceAddressShortName is incl" +
"uded\r\n return $.inArray(heldDeviceItem.De" +
"viceAddressShortName.toLowerCase(), deviceAddresses) >= 0;\r\n " +
" });\r\n }\r\n " +
" break;\r\n case \'deviceaddressexclude\': // FILT" +
"ER: Device Address Exclude\r\n var deviceAddresses " +
"= value.split(\",\").map(function (v) { return v.toLowerCase(); });\r\n " +
" if (deviceAddresses.length > 0) {\r\n " +
" filters.push(function (heldDeviceItem) {\r\n " + " filters.push(function (heldDeviceItem) {\r\n " +
" // false if DeviceAddressShortName is null\r\n " + " // true if DeviceAddressShortName is null\r\n " +
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " + " if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
" return false;\r\n\r\n " + " return true;\r\n\r\n " +
" // true if DeviceAddressShortName is included\r\n " + "// true if DeviceAddressShortName is excluded\r\n " +
" return $.inArray(heldDeviceItem.DeviceAddressShortName" + " return $.inArray(heldDeviceItem.DeviceAddressShortName.toLowerCase(), dev" +
".toLowerCase(), deviceAddresses) >= 0;\r\n });\r" + "iceAddresses) < 0;\r\n });\r\n " +
"\n }\r\n break;\r\n " +
" case \'deviceaddressexclude\':\r\n " +
" var deviceAddresses = value.split(\",\").map(function (v) { return v.toLower" +
"Case(); });\r\n if (deviceAddresses.length > 0) {\r\n" +
" filters.push(function (heldDeviceItem) {\r\n " +
" // true if DeviceAddressShortName is null\r" +
"\n if (!heldDeviceItem.DeviceAddressShortN" +
"ame)\r\n return true;\r\n\r\n " +
" // true if DeviceAddressShortName is excluded\r\n " +
" return $.inArray(heldDeviceItem.DeviceAddressSh" +
"ortName.toLowerCase(), deviceAddresses) < 0;\r\n " +
" });\r\n }\r\n break;" +
"\r\n case \'deviceprofileinclude\':\r\n " +
" var deviceProfiles = value.split(\",\").map(function (v) { return pars" +
"eInt(v); });\r\n if (deviceProfiles.length > 0) {\r\n" +
" filters.push(function (heldDeviceItem) {\r\n " +
" // true if DeviceProfileId is included\r\n " +
" return $.inArray(heldDeviceItem.DeviceProf" +
"ileId, deviceProfiles) >= 0;\r\n });\r\n " +
" }\r\n break;\r\n " + " }\r\n break;\r\n " +
" case \'deviceprofileexclude\':\r\n var " + " case \'deviceprofileinclude\': // FILTER: Device Profile Include\r\n " +
"deviceProfiles = value.split(\",\").map(function (v) { return parseInt(v); });\r\n " + " var deviceProfiles = value.split(\",\").map(function (v) { ret" +
" if (deviceProfiles.length > 0) {\r\n " + "urn parseInt(v); });\r\n if (deviceProfiles.length " +
" filters.push(function (heldDeviceItem) {\r\n " + "> 0) {\r\n filters.push(function (heldDeviceIte" +
" // true if DeviceProfileId is excluded\r\n " + "m) {\r\n // true if DeviceProfileId is incl" +
" return $.inArray(heldDeviceItem.DeviceProfileId, devicePro" + "uded\r\n return $.inArray(heldDeviceItem.De" +
"files) < 0;\r\n });\r\n " + "viceProfileId, deviceProfiles) >= 0;\r\n });\r\n " +
" }\r\n break;\r\n }\r\n " + " }\r\n break;\r\n " +
" });\r\n }\r\n\r\n if (filters.length > 0" + " case \'deviceprofileexclude\': // FILTER: Device Profile Exc" +
")\r\n itemFilters = filters;\r\n else\r\n " + "lude\r\n var deviceProfiles = value.split(\",\").map(" +
" itemFilters = null;\r\n }\r\n\r\n function connectionEr" + "function (v) { return parseInt(v); });\r\n if (devi" +
"ror() {\r\n try {\r\n $(\'body\').addClass(\'status-e" + "ceProfiles.length > 0) {\r\n filters.push(funct" +
"rror\');\r\n $.connection.hub.stop();\r\n } catch (" + "ion (heldDeviceItem) {\r\n // true if Devic" +
"e) {\r\n // Ignore\r\n }\r\n\r\n window" + "eProfileId is excluded\r\n return $.inArray" +
".setTimeout(function () {\r\n window.location.href = window.loc" + "(heldDeviceItem.DeviceProfileId, deviceProfiles) < 0;\r\n " +
"ation.href;\r\n }, 10000);\r\n }\r\n\r\n // Helpers" + " });\r\n }\r\n " +
"\r\n function rotateArray(koArray, element) {\r\n var item" + " break;\r\n }\r\n });\r\n\r\n " +
"s = koArray();\r\n\r\n if (items.length <= 1)\r\n re" + " if (filters.length > 0)\r\n itemFilters = filters;\r\n " +
"turn 0;\r\n\r\n if (element.height() < (element.parent().height() - 3" + " else\r\n itemFilters = null;\r\n " +
"0)) {\r\n\r\n if (findUnsortedArrayTopIndex(items) !== 0)\r\n " + " }\r\n }\r\n\r\n function connectionError() {\r\n " +
" koArray.sort(sortFunction);\r\n\r\n // Don\'t ro" + " try {\r\n $(\'body\').addClass(\'status-error\');\r\n " +
"tate if small & sorted correctly\r\n return;\r\n }" + " $.connection.hub.stop();\r\n } catch (e) {\r\n " +
"\r\n\r\n // Move Last Item to Top\r\n var item = koArray" + " // Ignore\r\n }\r\n\r\n window.setTimeout(function (" +
".pop();\r\n koArray.unshift(item);\r\n }\r\n func" + ") {\r\n window.location.href = window.location.href;\r\n " +
"tion removeItemFromArray(koArray, UserId) {\r\n var items = koArray" + " }, 10000);\r\n }\r\n\r\n // Helpers\r\n function" +
"();\r\n for (var i = 0; i < items.length; i++) {\r\n " + " rotateArray(koArray, element) {\r\n var items = koArray();\r\n\r\n " +
" if (items[i].UserId == UserId) {\r\n koArray.splice(i, 1" + " if (items.length <= 1)\r\n return 0;\r\n\r\n " +
");\r\n items = koArray();\r\n i--;\r\n " + " if (element.height() < (element.parent().height() - 30)) {\r\n\r\n " +
" }\r\n }\r\n }\r\n function find" + " if (findUnsortedArrayTopIndex(items) !== 0)\r\n koAr" +
"UnsortedArrayTopIndex(items) {\r\n // Only one Item\r\n " + "ray.sort(sortFunction);\r\n\r\n // Don\'t rotate if small & sorted" +
" if (items.length <= 1)\r\n return 0;\r\n\r\n for (" + " correctly\r\n return;\r\n }\r\n\r\n //" +
"var i = 1; i < items.length; i++) {\r\n var s = sortFunction(it" + " Move Last Item to Top\r\n var item = koArray.pop();\r\n " +
"ems[i - 1], items[i]);\r\n if (s > 0)\r\n " + " koArray.unshift(item);\r\n }\r\n function removeItemFromArr" +
"return i;\r\n }\r\n\r\n return 0;\r\n }\r\n " + "ay(koArray, UserId) {\r\n var items = koArray();\r\n f" +
" function findSortedInsertIndex(koArray, heldDeviceItem) {\r\n " + "or (var i = 0; i < items.length; i++) {\r\n if (items[i].UserId" +
" var items = koArray();\r\n var startIndex = findUnsortedArrayTopIn" + " == UserId) {\r\n koArray.splice(i, 1);\r\n " +
"dex(items);\r\n for (var i = startIndex; i < items.length; i++) {\r\n" + " items = koArray();\r\n i--;\r\n }\r\n " +
" }\r\n }\r\n function findUnsortedArrayTopIndex(" +
"items) {\r\n // Only one Item\r\n if (items.length <= " +
"1)\r\n return 0;\r\n\r\n for (var i = 1; i < items.l" +
"ength; i++) {\r\n var s = sortFunction(items[i - 1], items[i]);" +
"\r\n if (s > 0)\r\n return i;\r\n " +
" }\r\n\r\n return 0;\r\n }\r\n function findSor" +
"tedInsertIndex(koArray, heldDeviceItem) {\r\n var items = koArray()" +
";\r\n var startIndex = findUnsortedArrayTopIndex(items);\r\n " +
" for (var i = startIndex; i < items.length; i++) {\r\n va" +
"r s = sortFunction(heldDeviceItem, items[i]);\r\n if (s <= 0)\r\n" +
" return i;\r\n }\r\n if (startI" +
"ndex !== 0) {\r\n for (var i = 0; i < startIndex; i++) {\r\n " +
" var s = sortFunction(heldDeviceItem, items[i]);\r\n " + " var s = sortFunction(heldDeviceItem, items[i]);\r\n " +
" if (s <= 0)\r\n return i;\r\n }\r\n " + " if (s <= 0)\r\n return i;\r\n " +
" if (startIndex !== 0) {\r\n for (var i = 0; i < sta" + " }\r\n return startIndex;\r\n } else {\r\n " +
"rtIndex; i++) {\r\n var s = sortFunction(heldDeviceItem, it" + " return -1;\r\n }\r\n }\r\n function " +
"ems[i]);\r\n if (s <= 0)\r\n retur" + "sortFunction(l, r) {\r\n return l.UserIdFriendly.toLowerCase() == r" +
"n i;\r\n }\r\n return startIndex;\r\n " + ".UserIdFriendly.toLowerCase() ? 0 : (l.UserIdFriendly.toLowerCase() < r.UserIdFr" +
" } else {\r\n return -1;\r\n }\r\n }\r" + "iendly.toLowerCase() ? -1 : 1)\r\n }\r\n function isInProcess(" +
"\n function sortFunction(l, r) {\r\n return l.UserIdFrien" + "i) {\r\n return !i.ReadyForReturn && !i.WaitingForUserAction;\r\n " +
"dly.toLowerCase() == r.UserIdFriendly.toLowerCase() ? 0 : (l.UserIdFriendly.toLo" + " }\r\n function isReadyForReturn(i) {\r\n return i." +
"werCase() < r.UserIdFriendly.toLowerCase() ? -1 : 1)\r\n }\r\n " + "ReadyForReturn && !i.WaitingForUserAction;\r\n }\r\n function " +
" function isInProcess(i) {\r\n return !i.ReadyForReturn && !i.Waiti" + "isWaitingForUserAction(i) {\r\n return i.WaitingForUserAction;\r\n " +
"ngForUserAction;\r\n }\r\n function isReadyForReturn(i) {\r\n " + " }\r\n function getQueryStringParameters() {\r\n\r\n " +
" return i.ReadyForReturn && !i.WaitingForUserAction;\r\n }\r" + " if (window.location.search.length === 0)\r\n return null;\r\n\r\n " +
"\n function isWaitingForUserAction(i) {\r\n return i.Wait" + " var params = {};\r\n window.location.search.substr(1" +
"ingForUserAction;\r\n }\r\n function getQueryStringParameters(" + ").split(\"&\").forEach(function (pair) {\r\n if (pair === \"\") ret" +
") {\r\n\r\n if (window.location.search.length === 0)\r\n " + "urn;\r\n var parts = pair.split(\"=\");\r\n para" +
" return null;\r\n\r\n var params = {};\r\n window.lo" + "ms[parts[0]] = parts[1] && decodeURIComponent(parts[1].replace(/\\+/g, \" \"));\r\n " +
"cation.search.substr(1).split(\"&\").forEach(function (pair) {\r\n " + " });\r\n return params;\r\n }\r\n\r\n " +
" if (pair === \"\") return;\r\n var parts = pair.split(\"=\");\r\n " + "init();\r\n });\r\n </script>\r\n</body>\r\n</html>\r\n");
" params[parts[0]] = parts[1] && decodeURIComponent(parts[1].rep" +
"lace(/\\+/g, \" \"));\r\n });\r\n return params;\r\n " +
" }\r\n\r\n init();\r\n });\r\n </script>\r\n</body>\r\n</html>");
} }
} }
+205
View File
@@ -1075,6 +1075,211 @@ div.logEventsViewport table.logEventsViewport > tbody > tr > td.eventType {
#Config_AuthRoles_Subjects_Update_Dialog #Config_AuthRoles_Subjects_Update_Dialog_List li .remove:hover { #Config_AuthRoles_Subjects_Update_Dialog #Config_AuthRoles_Subjects_Update_Dialog_List li .remove:hover {
opacity: 1; opacity: 1;
} }
#Config_ReportPrefs {
margin-top: 10px;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview {
float: right;
width: 150px;
height: 80px;
border: 1px solid #444;
font-size: 4px;
color: #ffffff;
overflow: hidden;
text-transform: uppercase;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview .heading {
height: 6px;
padding-left: 3px;
overflow: hidden;
background-color: #333333;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview .column-heading {
float: left;
width: calc(33% - 4px);
padding-left: 2px;
margin: 1px 0 0 2px;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview .column {
height: 100%;
float: left;
width: calc(33% - 2px);
margin-left: 2px;
overflow: hidden;
background: rgba(255, 255, 255, 0.2);
}
#Config_ReportPrefs #Config_ReportPrefs_Preview .column span {
display: block;
height: 4px;
margin: 1px;
background-color: #ffffff;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-default {
background: linear-gradient(to bottom, #165180, #1e6dab) left top repeat-x #1e6dab;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-default .column span.alert {
background-color: #e51400;
color: #ffffff;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-default-soft {
background: linear-gradient(to bottom, #165180, #1e6dab) left top repeat-x #1e6dab;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-default-soft .column span.alert {
background-color: #f0e277;
color: #000000;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-green {
background: linear-gradient(to bottom, #477c11, #60a917) left top repeat-x #60a917;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-green .column span.alert {
background-color: #e51400;
color: #ffffff;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-green-soft {
background: linear-gradient(to bottom, #477c11, #60a917) left top repeat-x #60a917;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-green-soft .column span.alert {
background-color: #e5cc11;
color: #000000;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-violet {
background: linear-gradient(to bottom, #8800cc, #aa00ff) left top repeat-x #aa00ff;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-violet .column span.alert {
background-color: #e51400;
color: #ffffff;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-violet-soft {
background: linear-gradient(to bottom, #8800cc, #aa00ff) left top repeat-x #aa00ff;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-violet-soft .column span.alert {
background-color: #f0e277;
color: #000000;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-magenta {
background: linear-gradient(to bottom, #a50058, #d80073) left top repeat-x #d80073;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-magenta .column span.alert {
background-color: #1681b4;
color: #ffffff;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-magenta-soft {
background: linear-gradient(to bottom, #a50058, #d80073) left top repeat-x #d80073;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-magenta-soft .column span.alert {
background-color: #85cdf0;
color: #000000;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-crimson {
background: linear-gradient(to bottom, #6f0019, #a20025) left top repeat-x #a20025;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-crimson .column span.alert {
background-color: #b0cc22;
color: #000000;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-crimson-soft {
background: linear-gradient(to bottom, #6f0019, #a20025) left top repeat-x #a20025;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-crimson-soft .column span.alert {
background-color: #cee077;
color: #000000;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-amber {
background: linear-gradient(to bottom, #bf8208, #f0a30a) left top repeat-x #f0a30a;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-amber .column span.alert {
background-color: #0050ef;
color: #ffffff;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-amber-soft {
background: linear-gradient(to bottom, #bf8208, #f0a30a) left top repeat-x #f0a30a;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-amber-soft .column span.alert {
background-color: #bbd0fb;
color: #000000;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-brown {
background: linear-gradient(to bottom, #5c401f, #825a2c) left top repeat-x #825a2c;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-brown .column span.alert {
background-color: #e3c800;
color: #000000;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-brown-soft {
background: linear-gradient(to bottom, #5c401f, #825a2c) left top repeat-x #825a2c;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-brown-soft .column span.alert {
background-color: #f0e277;
color: #000000;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-steel {
background: linear-gradient(to bottom, #4e5d6c, #647689) left top repeat-x #647689;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-steel .column span.alert {
background-color: #e51400;
color: #ffffff;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-steel-soft {
background: linear-gradient(to bottom, #4e5d6c, #647689) left top repeat-x #647689;
}
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-steel-soft .column span.alert {
background-color: #f0e277;
color: #000000;
}
#Config_ReportPrefs_Builder .report {
margin-bottom: 10px;
}
#Config_ReportPrefs_Builder .report ul {
margin-left: 10px;
}
#Config_ReportPrefs_Builder .theme {
margin-bottom: 10px;
}
#Config_ReportPrefs_Builder .theme > select {
margin-left: 10px;
}
#Config_ReportPrefs_Builder .filter > select {
margin-left: 10px;
}
#Config_ReportPrefs_Builder .filter div.options {
display: none;
background-color: #ffffff;
border: 1px dashed #cccccc;
margin-top: 4px;
margin-left: 15px;
padding: 2px 6px;
}
#Config_ReportPrefs_Builder .filter div.options .method {
margin-top: 4px;
margin-bottom: 8px;
}
#Config_ReportPrefs_Builder .filter div.options .method label {
margin-right: 14px;
}
#Config_ReportPrefs_Builder_Buttonpane {
padding-right: .3em;
}
#Config_ReportPrefs_Builder_Buttonpane textarea {
float: left;
font-family: Consolas, "Courier New", monospace;
color: #333333;
width: calc(100% - 1.2em - 10px);
border: 1px solid #cccccc;
white-space: pre;
min-height: 0;
}
#Config_ReportPrefs_Builder_Buttonpane i {
float: right;
cursor: pointer;
margin: .3em .2em 0 0;
color: #335a87;
}
#Config_ReportPrefs_Builder_Buttonpane i:hover {
color: #5e8cc2;
}
#Config_ReportPrefs_Builder_Buttonpane .ui-dialog-buttonset {
display: none;
}
#Config_Location { #Config_Location {
margin-top: 10px; margin-top: 10px;
} }
+189 -1
View File
@@ -1097,7 +1097,6 @@ div.logEventsViewport {
#pluginLibrary { #pluginLibrary {
#pluginLibraryGroups { #pluginLibraryGroups {
width: 900px; width: 900px;
margin: 0 auto; margin: 0 auto;
@@ -1263,6 +1262,195 @@ div.logEventsViewport {
} }
} }
#Config_ReportPrefs {
margin-top: 10px;
#Config_ReportPrefs_Preview {
float: right;
width: 150px;
height: 80px;
border: 1px solid #444;
font-size: 4px;
color: @white;
overflow: hidden;
text-transform: uppercase;
.heading {
height: 6px;
padding-left: 3px;
overflow: hidden;
background-color: @HeaderBackgroundColour;
}
.column-heading {
float: left;
width: calc(~"33% - 4px");
padding-left: 2px;
margin: 1px 0 0 2px;
}
.column {
height: 100%;
float: left;
width: calc(~"33% - 2px");
margin-left: 2px;
overflow: hidden;
background: fade(@white, 20%);
span {
display: block;
height: 4px;
margin: 1px;
background-color: @white;
}
}
.theme-builder(@main-colour, @alert-colour: difference(@main-colour, @white), @alert-text-colour: contrast(@alert-colour)) {
background: linear-gradient(to bottom, darken(@main-colour, 10%), @main-colour) left top repeat-x @main-colour;
.column span.alert {
background-color: @alert-colour;
color: @alert-text-colour;
}
}
&.theme-default {
.theme-builder(@ButtonColour, @ThemeRed);
}
&.theme-default-soft {
.theme-builder(@ButtonColour, hardlight(@ThemeYellow, #bbb));
}
&.theme-green {
.theme-builder(@ThemeGreen, @ThemeRed);
}
&.theme-green-soft {
.theme-builder(@ThemeGreen, screen(@ThemeYellow, #111));
}
&.theme-violet {
.theme-builder(@ThemeViolet, @ThemeRed);
}
&.theme-violet-soft {
.theme-builder(@ThemeViolet, hardlight(@ThemeYellow, #bbb));
}
&.theme-magenta {
.theme-builder(@ThemeMagenta, darken(@ThemeCyan, 10%), @white);
}
&.theme-magenta-soft {
.theme-builder(@ThemeMagenta, screen(@ThemeCyan, #777));
}
&.theme-crimson {
.theme-builder(@ThemeCrimson, screen(@ThemeLime, #222));
}
&.theme-crimson-soft {
.theme-builder(@ThemeCrimson, screen(@ThemeLime, #777));
}
&.theme-amber {
.theme-builder(@ThemeAmber, @ThemeCobalt);
}
&.theme-amber-soft {
.theme-builder(@ThemeAmber, hardlight(@ThemeCobalt, #ddd));
}
&.theme-brown {
.theme-builder(@ThemeBrown, @ThemeYellow);
}
&.theme-brown-soft {
.theme-builder(@ThemeBrown, hardlight(@ThemeYellow, #bbb));
}
&.theme-steel {
.theme-builder(@ThemeSteel, @ThemeRed);
}
&.theme-steel-soft {
.theme-builder(@ThemeSteel, hardlight(@ThemeYellow, #bbb));
}
}
}
#Config_ReportPrefs_Builder {
.report {
margin-bottom: 10px;
ul {
margin-left: 10px;
}
}
.theme {
margin-bottom: 10px;
& > select {
margin-left: 10px;
}
}
.filter {
& > select {
margin-left: 10px;
}
div.options {
display: none;
background-color: @white;
border: 1px dashed @SubtleBorderColour;
margin-top: 4px;
margin-left: 15px;
padding: 2px 6px;
.method {
margin-top: 4px;
margin-bottom: 8px;
label {
margin-right: 14px;
}
}
}
}
}
#Config_ReportPrefs_Builder_Buttonpane {
padding-right: .3em;
textarea {
float: left;
font-family: @FontFamilyMono;
color: @FontBodyColour;
width: calc(~"100% - 1.2em - 10px");
border: 1px solid @SubtleBorderColour;
white-space: pre;
min-height: 0;
}
i {
float: right;
cursor: pointer;
margin: .3em .2em 0 0;
color: @HyperLinkColour;
&:hover {
color: @HyperLinkHoverColour;
}
}
.ui-dialog-buttonset {
display: none;
}
}
#Config_Location { #Config_Location {
margin-top: 10px; margin-top: 10px;
File diff suppressed because one or more lines are too long
@@ -1929,11 +1929,9 @@ body {
overflow: hidden; overflow: hidden;
} }
body { body {
background: linear-gradient(to bottom, #165180, #1e6dab) left top repeat-x #1e6dab;
font-size: 16px; font-size: 16px;
font-family: "Segoe UI", Arial, Verdana, Tahoma, sans-serif; font-family: "Segoe UI", Arial, Verdana, Tahoma, sans-serif;
color: #ffffff; cursor: none;
cursor: auto;
} }
h1, h1,
h2, h2,
@@ -1950,6 +1948,7 @@ div#page {
header, header,
#header { #header {
position: relative; position: relative;
color: #ffffff;
background-color: #333333; background-color: #333333;
margin: 0; margin: 0;
padding: 0; padding: 0;
@@ -2006,9 +2005,9 @@ header #credits i,
margin-bottom: 10px; margin-bottom: 10px;
font-size: 1.4em; font-size: 1.4em;
height: 30px; height: 30px;
color: #ffffff;
} }
#mainSection .list div.content { #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
height: calc(100% - 30px); height: calc(100% - 30px);
overflow: hidden; overflow: hidden;
} }
@@ -2020,7 +2019,6 @@ header #credits i,
text-align: center; text-align: center;
text-transform: lowercase; text-transform: lowercase;
margin-top: 40px; margin-top: 40px;
color: rgba(255, 255, 255, 0.8);
} }
#mainSection .list div.content ul { #mainSection .list div.content ul {
padding: 0; padding: 0;
@@ -2030,16 +2028,15 @@ header #credits i,
#mainSection .list div.content ul li { #mainSection .list div.content ul li {
position: relative; position: relative;
margin: 4px 2px; margin: 4px 2px;
background-color: #fff;
border: 1px solid #2689d6;
padding: 6px 8px; padding: 6px 8px;
color: #000000;
clear: both; clear: both;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
-ms-text-overflow: ellipsis; -ms-text-overflow: ellipsis;
-o-text-overflow: ellipsis; -o-text-overflow: ellipsis;
text-overflow: ellipsis; text-overflow: ellipsis;
background-color: #ffffff;
color: #000000;
} }
#mainSection .list div.content ul li .small { #mainSection .list div.content ul li .small {
display: inline-block; display: inline-block;
@@ -2047,10 +2044,6 @@ header #credits i,
font-size: 0.8em; font-size: 0.8em;
margin-top: 0.1em; margin-top: 0.1em;
} }
#mainSection .list div.content ul li.alert {
background-color: #e51400;
color: #ffffff;
}
#mainSection .list div.content ul li:after { #mainSection .list div.content ul li:after {
clear: both; clear: both;
content: "."; content: ".";
@@ -2074,7 +2067,6 @@ footer,
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 50px; height: 50px;
background: linear-gradient(to bottom, rgba(30, 109, 171, 0), #1e6dab 90%) left top repeat-x;
display: block; display: block;
} }
body.status-connecting #statusConnecting { body.status-connecting #statusConnecting {
@@ -2103,3 +2095,292 @@ body.status-error #statusError span {
body.status-error #mainSection { body.status-error #mainSection {
opacity: 0.3; opacity: 0.3;
} }
/* Themes */
body.theme-default {
background: linear-gradient(to bottom, #165180, #1e6dab) left top repeat-x #1e6dab;
}
body.theme-default #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-default #mainSection .list ul li {
border: 1px solid #3080b8;
}
body.theme-default #mainSection .list ul li.alert {
background-color: #e51400;
border: 1px solid #ee6255;
color: #ffffff;
}
body.theme-default footer,
body.theme-default #footer {
background: linear-gradient(to bottom, rgba(30, 109, 171, 0), #1e6dab 90%) left top repeat-x;
}
body.theme-default-soft {
background: linear-gradient(to bottom, #165180, #1e6dab) left top repeat-x #1e6dab;
}
body.theme-default-soft #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-default-soft #mainSection .list ul li {
border: 1px solid #3080b8;
}
body.theme-default-soft #mainSection .list ul li.alert {
background-color: #f0e277;
border: 1px solid #f5eba4;
color: #000000;
}
body.theme-default-soft footer,
body.theme-default-soft #footer {
background: linear-gradient(to bottom, rgba(30, 109, 171, 0), #1e6dab 90%) left top repeat-x;
}
body.theme-green {
background: linear-gradient(to bottom, #477c11, #60a917) left top repeat-x #60a917;
}
body.theme-green #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-green #mainSection .list ul li {
border: 1px solid #74b627;
}
body.theme-green #mainSection .list ul li.alert {
background-color: #e51400;
border: 1px solid #ee6255;
color: #ffffff;
}
body.theme-green footer,
body.theme-green #footer {
background: linear-gradient(to bottom, rgba(96, 169, 23, 0), #60a917 90%) left top repeat-x;
}
body.theme-green-soft {
background: linear-gradient(to bottom, #477c11, #60a917) left top repeat-x #60a917;
}
body.theme-green-soft #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-green-soft #mainSection .list ul li {
border: 1px solid #74b627;
}
body.theme-green-soft #mainSection .list ul li.alert {
background-color: #e5cc11;
border: 1px solid #eedd60;
color: #000000;
}
body.theme-green-soft footer,
body.theme-green-soft #footer {
background: linear-gradient(to bottom, rgba(96, 169, 23, 0), #60a917 90%) left top repeat-x;
}
body.theme-violet {
background: linear-gradient(to bottom, #8800cc, #aa00ff) left top repeat-x #aa00ff;
}
body.theme-violet #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-violet #mainSection .list ul li {
border: 1px solid #b700ff;
}
body.theme-violet #mainSection .list ul li.alert {
background-color: #e51400;
border: 1px solid #ee6255;
color: #ffffff;
}
body.theme-violet footer,
body.theme-violet #footer {
background: linear-gradient(to bottom, rgba(170, 0, 255, 0), #aa00ff 90%) left top repeat-x;
}
body.theme-violet-soft {
background: linear-gradient(to bottom, #8800cc, #aa00ff) left top repeat-x #aa00ff;
}
body.theme-violet-soft #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-violet-soft #mainSection .list ul li {
border: 1px solid #b700ff;
}
body.theme-violet-soft #mainSection .list ul li.alert {
background-color: #f0e277;
border: 1px solid #f5eba4;
color: #000000;
}
body.theme-violet-soft footer,
body.theme-violet-soft #footer {
background: linear-gradient(to bottom, rgba(170, 0, 255, 0), #aa00ff 90%) left top repeat-x;
}
body.theme-magenta {
background: linear-gradient(to bottom, #a50058, #d80073) left top repeat-x #d80073;
}
body.theme-magenta #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-magenta #mainSection .list ul li {
border: 1px solid #de0086;
}
body.theme-magenta #mainSection .list ul li.alert {
background-color: #1681b4;
border: 1px solid #63abcd;
color: #ffffff;
}
body.theme-magenta footer,
body.theme-magenta #footer {
background: linear-gradient(to bottom, rgba(216, 0, 115, 0), #d80073 90%) left top repeat-x;
}
body.theme-magenta-soft {
background: linear-gradient(to bottom, #a50058, #d80073) left top repeat-x #d80073;
}
body.theme-magenta-soft #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-magenta-soft #mainSection .list ul li {
border: 1px solid #de0086;
}
body.theme-magenta-soft #mainSection .list ul li.alert {
background-color: #85cdf0;
border: 1px solid #aedef5;
color: #000000;
}
body.theme-magenta-soft footer,
body.theme-magenta-soft #footer {
background: linear-gradient(to bottom, rgba(216, 0, 115, 0), #d80073 90%) left top repeat-x;
}
body.theme-crimson {
background: linear-gradient(to bottom, #6f0019, #a20025) left top repeat-x #a20025;
}
body.theme-crimson #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-crimson #mainSection .list ul li {
border: 1px solid #b00039;
}
body.theme-crimson #mainSection .list ul li.alert {
background-color: #b0cc22;
border: 1px solid #cadd6c;
color: #000000;
}
body.theme-crimson footer,
body.theme-crimson #footer {
background: linear-gradient(to bottom, rgba(162, 0, 37, 0), #a20025 90%) left top repeat-x;
}
body.theme-crimson-soft {
background: linear-gradient(to bottom, #6f0019, #a20025) left top repeat-x #a20025;
}
body.theme-crimson-soft #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-crimson-soft #mainSection .list ul li {
border: 1px solid #b00039;
}
body.theme-crimson-soft #mainSection .list ul li.alert {
background-color: #cee077;
border: 1px solid #dfeaa4;
color: #000000;
}
body.theme-crimson-soft footer,
body.theme-crimson-soft #footer {
background: linear-gradient(to bottom, rgba(162, 0, 37, 0), #a20025 90%) left top repeat-x;
}
body.theme-amber {
background: linear-gradient(to bottom, #bf8208, #f0a30a) left top repeat-x #f0a30a;
}
body.theme-amber #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-amber #mainSection .list ul li {
border: 1px solid #f2b113;
}
body.theme-amber #mainSection .list ul li.alert {
background-color: #0050ef;
border: 1px solid #558af4;
color: #ffffff;
}
body.theme-amber footer,
body.theme-amber #footer {
background: linear-gradient(to bottom, rgba(240, 163, 10, 0), #f0a30a 90%) left top repeat-x;
}
body.theme-amber-soft {
background: linear-gradient(to bottom, #bf8208, #f0a30a) left top repeat-x #f0a30a;
}
body.theme-amber-soft #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-amber-soft #mainSection .list ul li {
border: 1px solid #f2b113;
}
body.theme-amber-soft #mainSection .list ul li.alert {
background-color: #bbd0fb;
border: 1px solid #d2e0fc;
color: #000000;
}
body.theme-amber-soft footer,
body.theme-amber-soft #footer {
background: linear-gradient(to bottom, rgba(240, 163, 10, 0), #f0a30a 90%) left top repeat-x;
}
body.theme-brown {
background: linear-gradient(to bottom, #5c401f, #825a2c) left top repeat-x #825a2c;
}
body.theme-brown #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-brown #mainSection .list ul li {
border: 1px solid #936e41;
}
body.theme-brown #mainSection .list ul li.alert {
background-color: #e3c800;
border: 1px solid #ecda55;
color: #000000;
}
body.theme-brown footer,
body.theme-brown #footer {
background: linear-gradient(to bottom, rgba(130, 90, 44, 0), #825a2c 90%) left top repeat-x;
}
body.theme-brown-soft {
background: linear-gradient(to bottom, #5c401f, #825a2c) left top repeat-x #825a2c;
}
body.theme-brown-soft #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-brown-soft #mainSection .list ul li {
border: 1px solid #936e41;
}
body.theme-brown-soft #mainSection .list ul li.alert {
background-color: #f0e277;
border: 1px solid #f5eba4;
color: #000000;
}
body.theme-brown-soft footer,
body.theme-brown-soft #footer {
background: linear-gradient(to bottom, rgba(130, 90, 44, 0), #825a2c 90%) left top repeat-x;
}
body.theme-steel {
background: linear-gradient(to bottom, #4e5d6c, #647689) left top repeat-x #647689;
}
body.theme-steel #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-steel #mainSection .list ul li {
border: 1px solid #78889a;
}
body.theme-steel #mainSection .list ul li.alert {
background-color: #e51400;
border: 1px solid #ee6255;
color: #ffffff;
}
body.theme-steel footer,
body.theme-steel #footer {
background: linear-gradient(to bottom, rgba(100, 118, 137, 0), #647689 90%) left top repeat-x;
}
body.theme-steel-soft {
background: linear-gradient(to bottom, #4e5d6c, #647689) left top repeat-x #647689;
}
body.theme-steel-soft #mainSection .list div.content {
background: rgba(255, 255, 255, 0.2);
}
body.theme-steel-soft #mainSection .list ul li {
border: 1px solid #78889a;
}
body.theme-steel-soft #mainSection .list ul li.alert {
background-color: #f0e277;
border: 1px solid #f5eba4;
color: #000000;
}
body.theme-steel-soft footer,
body.theme-steel-soft #footer {
background: linear-gradient(to bottom, rgba(100, 118, 137, 0), #647689 90%) left top repeat-x;
}
@@ -11,11 +11,9 @@ html, body {
} }
body { body {
background: linear-gradient(to bottom, darken(@ButtonColour, 10%), @ButtonColour) left top repeat-x @ButtonColour;
font-size: 16px; font-size: 16px;
font-family: @FontFamilyBody; font-family: @FontFamilyBody;
color: @white; cursor: none;
cursor: auto;
} }
h1, h2, h3, h4 { h1, h2, h3, h4 {
@@ -31,6 +29,7 @@ div#page {
header, #header { header, #header {
position: relative; position: relative;
color: @white;
background-color: @HeaderBackgroundColour; background-color: @HeaderBackgroundColour;
margin: 0; margin: 0;
padding: 0; padding: 0;
@@ -88,10 +87,10 @@ header, #header {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 1.4em; font-size: 1.4em;
height: 30px; height: 30px;
color: @white;
} }
div.content { div.content {
background: rgba(255, 255, 255, 0.2);
height: calc(~"100% - 30px"); height: calc(~"100% - 30px");
overflow: hidden; overflow: hidden;
@@ -103,7 +102,6 @@ header, #header {
text-align: center; text-align: center;
text-transform: lowercase; text-transform: lowercase;
margin-top: 40px; margin-top: 40px;
color: rgba(255, 255, 255, 0.8);
} }
ul { ul {
@@ -114,16 +112,15 @@ header, #header {
li { li {
position: relative; position: relative;
margin: 4px 2px; margin: 4px 2px;
background-color: #fff;
border: 1px solid lighten(@ButtonColour, 10%);
padding: 6px 8px; padding: 6px 8px;
color: @black;
clear: both; clear: both;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
-ms-text-overflow: ellipsis; -ms-text-overflow: ellipsis;
-o-text-overflow: ellipsis; -o-text-overflow: ellipsis;
text-overflow: ellipsis; text-overflow: ellipsis;
background-color: @white;
color: @black;
.small { .small {
display: inline-block; display: inline-block;
@@ -132,11 +129,6 @@ header, #header {
margin-top: 0.1em; margin-top: 0.1em;
} }
&.alert {
background-color: @StatusError;
color: @white;
}
&:after { &:after {
clear: both; clear: both;
content: "."; content: ".";
@@ -168,7 +160,6 @@ footer, #footer {
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 50px; height: 50px;
background: linear-gradient(to bottom, fadeout(@ButtonColour, 100%), @ButtonColour 90%) left top repeat-x;
display: block; display: block;
} }
@@ -207,3 +198,95 @@ body.status-error {
opacity: 0.3; opacity: 0.3;
} }
} }
/* Themes */
.theme-builder(@main-colour, @alert-colour: difference(@main-colour, @white), @alert-text-colour: contrast(@alert-colour)) {
background: linear-gradient(to bottom, darken(@main-colour, 10%), @main-colour) left top repeat-x @main-colour;
#mainSection {
.list {
div.content {
background: fade(@white, 20%);
}
ul li {
border: 1px solid softlight(@main-colour, #aaa);
&.alert {
background-color: @alert-colour;
border: 1px solid hardlight(@alert-colour, #aaa);
color: @alert-text-colour;
}
}
}
}
footer, #footer {
background: linear-gradient(to bottom, fadeout(@main-colour, 100%), @main-colour 90%) left top repeat-x;
}
}
body.theme-default {
.theme-builder(@ButtonColour, @ThemeRed);
}
body.theme-default-soft {
.theme-builder(@ButtonColour, hardlight(@ThemeYellow, #bbb));
}
body.theme-green {
.theme-builder(@ThemeGreen, @ThemeRed);
}
body.theme-green-soft {
.theme-builder(@ThemeGreen, screen(@ThemeYellow, #111));
}
body.theme-violet {
.theme-builder(@ThemeViolet, @ThemeRed);
}
body.theme-violet-soft {
.theme-builder(@ThemeViolet, hardlight(@ThemeYellow, #bbb));
}
body.theme-magenta {
.theme-builder(@ThemeMagenta, darken(@ThemeCyan, 10%), @white);
}
body.theme-magenta-soft {
.theme-builder(@ThemeMagenta, screen(@ThemeCyan, #777));
}
body.theme-crimson {
.theme-builder(@ThemeCrimson, screen(@ThemeLime, #222));
}
body.theme-crimson-soft {
.theme-builder(@ThemeCrimson, screen(@ThemeLime, #777));
}
body.theme-amber {
.theme-builder(@ThemeAmber, @ThemeCobalt);
}
body.theme-amber-soft {
.theme-builder(@ThemeAmber, hardlight(@ThemeCobalt, #ddd));
}
body.theme-brown {
.theme-builder(@ThemeBrown, @ThemeYellow);
}
body.theme-brown-soft {
.theme-builder(@ThemeBrown, hardlight(@ThemeYellow, #bbb));
}
body.theme-steel {
.theme-builder(@ThemeSteel, @ThemeRed);
}
body.theme-steel-soft {
.theme-builder(@ThemeSteel, hardlight(@ThemeYellow, #bbb));
}
File diff suppressed because one or more lines are too long
+10
View File
@@ -273,6 +273,11 @@
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<DependentUpon>Locations.cshtml</DependentUpon> <DependentUpon>Locations.cshtml</DependentUpon>
</Compile> </Compile>
<Compile Include="Areas\Config\Views\JobPreferences\Parts\Reports.generated.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reports.cshtml</DependentUpon>
</Compile>
<Compile Include="Areas\Config\Views\JobQueue\Create.generated.cs"> <Compile Include="Areas\Config\Views\JobQueue\Create.generated.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
@@ -324,6 +329,7 @@
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<Compile Include="Areas\Public\Controllers\HeldDevicesController.cs" /> <Compile Include="Areas\Public\Controllers\HeldDevicesController.cs" />
<Compile Include="Areas\Public\Models\UserHeldDevices\NoticeboardModel.cs" />
<Compile Include="Areas\Public\Views\HeldDevices\Index.generated.cs"> <Compile Include="Areas\Public\Views\HeldDevices\Index.generated.cs">
<DependentUpon>Index.cshtml</DependentUpon> <DependentUpon>Index.cshtml</DependentUpon>
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
@@ -1188,6 +1194,10 @@
<Generator>RazorGenerator</Generator> <Generator>RazorGenerator</Generator>
<LastGenOutput>Locations.generated.cs</LastGenOutput> <LastGenOutput>Locations.generated.cs</LastGenOutput>
</None> </None>
<None Include="Areas\Config\Views\JobPreferences\Parts\Reports.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>Reports.generated.cs</LastGenOutput>
</None>
<None Include="Areas\Config\Views\JobQueue\Show.cshtml"> <None Include="Areas\Config\Views\JobQueue\Show.cshtml">
<Generator>RazorGenerator</Generator> <Generator>RazorGenerator</Generator>
<LastGenOutput>Show.generated.cs</LastGenOutput> <LastGenOutput>Show.generated.cs</LastGenOutput>
@@ -71,6 +71,12 @@ namespace Disco.Web.Areas.API.Controllers
} }
[NonAction] [NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult UpdateDefaultNoticeboardTheme()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDefaultNoticeboardTheme);
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult UpdateLocationMode() public virtual System.Web.Mvc.ActionResult UpdateLocationMode()
{ {
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateLocationMode); return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateLocationMode);
@@ -105,6 +111,7 @@ namespace Disco.Web.Areas.API.Controllers
{ {
public readonly string UpdateLongRunningJobDaysThreshold = "UpdateLongRunningJobDaysThreshold"; public readonly string UpdateLongRunningJobDaysThreshold = "UpdateLongRunningJobDaysThreshold";
public readonly string UpdateStaleJobMinutesThreshold = "UpdateStaleJobMinutesThreshold"; public readonly string UpdateStaleJobMinutesThreshold = "UpdateStaleJobMinutesThreshold";
public readonly string UpdateDefaultNoticeboardTheme = "UpdateDefaultNoticeboardTheme";
public readonly string UpdateLocationMode = "UpdateLocationMode"; public readonly string UpdateLocationMode = "UpdateLocationMode";
public readonly string UpdateLocationList = "UpdateLocationList"; public readonly string UpdateLocationList = "UpdateLocationList";
public readonly string ImportLocationList = "ImportLocationList"; public readonly string ImportLocationList = "ImportLocationList";
@@ -115,6 +122,7 @@ namespace Disco.Web.Areas.API.Controllers
{ {
public const string UpdateLongRunningJobDaysThreshold = "UpdateLongRunningJobDaysThreshold"; public const string UpdateLongRunningJobDaysThreshold = "UpdateLongRunningJobDaysThreshold";
public const string UpdateStaleJobMinutesThreshold = "UpdateStaleJobMinutesThreshold"; public const string UpdateStaleJobMinutesThreshold = "UpdateStaleJobMinutesThreshold";
public const string UpdateDefaultNoticeboardTheme = "UpdateDefaultNoticeboardTheme";
public const string UpdateLocationMode = "UpdateLocationMode"; public const string UpdateLocationMode = "UpdateLocationMode";
public const string UpdateLocationList = "UpdateLocationList"; public const string UpdateLocationList = "UpdateLocationList";
public const string ImportLocationList = "ImportLocationList"; public const string ImportLocationList = "ImportLocationList";
@@ -139,6 +147,15 @@ namespace Disco.Web.Areas.API.Controllers
public readonly string StaleJobMinutesThreshold = "StaleJobMinutesThreshold"; public readonly string StaleJobMinutesThreshold = "StaleJobMinutesThreshold";
public readonly string redirect = "redirect"; public readonly string redirect = "redirect";
} }
static readonly ActionParamsClass_UpdateDefaultNoticeboardTheme s_params_UpdateDefaultNoticeboardTheme = new ActionParamsClass_UpdateDefaultNoticeboardTheme();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_UpdateDefaultNoticeboardTheme UpdateDefaultNoticeboardThemeParams { get { return s_params_UpdateDefaultNoticeboardTheme; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_UpdateDefaultNoticeboardTheme
{
public readonly string DefaultNoticeboardTheme = "DefaultNoticeboardTheme";
public readonly string redirect = "redirect";
}
static readonly ActionParamsClass_UpdateLocationMode s_params_UpdateLocationMode = new ActionParamsClass_UpdateLocationMode(); static readonly ActionParamsClass_UpdateLocationMode s_params_UpdateLocationMode = new ActionParamsClass_UpdateLocationMode();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_UpdateLocationMode UpdateLocationModeParams { get { return s_params_UpdateLocationMode; } } public ActionParamsClass_UpdateLocationMode UpdateLocationModeParams { get { return s_params_UpdateLocationMode; } }
@@ -213,6 +230,19 @@ namespace Disco.Web.Areas.API.Controllers
return callInfo; return callInfo;
} }
[NonAction]
partial void UpdateDefaultNoticeboardThemeOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string DefaultNoticeboardTheme, bool redirect);
[NonAction]
public override System.Web.Mvc.ActionResult UpdateDefaultNoticeboardTheme(string DefaultNoticeboardTheme, bool redirect)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDefaultNoticeboardTheme);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DefaultNoticeboardTheme", DefaultNoticeboardTheme);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
UpdateDefaultNoticeboardThemeOverride(callInfo, DefaultNoticeboardTheme, redirect);
return callInfo;
}
[NonAction] [NonAction]
partial void UpdateLocationModeOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Disco.Models.BI.Job.LocationModes LocationMode, bool redirect); partial void UpdateLocationModeOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Disco.Models.BI.Job.LocationModes LocationMode, bool redirect);
@@ -107,9 +107,11 @@ namespace Disco.Web.Areas.Config.Controllers
{ {
public readonly string General = "General"; public readonly string General = "General";
public readonly string Locations = "Locations"; public readonly string Locations = "Locations";
public readonly string Reports = "Reports";
} }
public readonly string General = "~/Areas/Config/Views/JobPreferences/Parts/General.cshtml"; public readonly string General = "~/Areas/Config/Views/JobPreferences/Parts/General.cshtml";
public readonly string Locations = "~/Areas/Config/Views/JobPreferences/Parts/Locations.cshtml"; public readonly string Locations = "~/Areas/Config/Views/JobPreferences/Parts/Locations.cshtml";
public readonly string Reports = "~/Areas/Config/Views/JobPreferences/Parts/Reports.cshtml";
} }
} }
} }
@@ -57,6 +57,12 @@ namespace Disco.Web.Areas.Public.Controllers
return RedirectToActionPermanent(taskResult.Result); return RedirectToActionPermanent(taskResult.Result);
} }
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult Index()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
}
[NonAction] [NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult HeldDevice() public virtual System.Web.Mvc.ActionResult HeldDevice()
@@ -101,6 +107,17 @@ namespace Disco.Web.Areas.Public.Controllers
} }
static readonly ActionParamsClass_Index s_params_Index = new ActionParamsClass_Index();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_Index IndexParams { get { return s_params_Index; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_Index
{
public readonly string DeviceProfileInclude = "DeviceProfileInclude";
public readonly string DeviceProfileExclude = "DeviceProfileExclude";
public readonly string DeviceAddressInclude = "DeviceAddressInclude";
public readonly string DeviceAddressExclude = "DeviceAddressExclude";
}
static readonly ActionParamsClass_HeldDevice s_params_HeldDevice = new ActionParamsClass_HeldDevice(); static readonly ActionParamsClass_HeldDevice s_params_HeldDevice = new ActionParamsClass_HeldDevice();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_HeldDevice HeldDeviceParams { get { return s_params_HeldDevice; } } public ActionParamsClass_HeldDevice HeldDeviceParams { get { return s_params_HeldDevice; } }
@@ -133,13 +150,17 @@ namespace Disco.Web.Areas.Public.Controllers
public T4MVC_HeldDevicesController() : base(Dummy.Instance) { } public T4MVC_HeldDevicesController() : base(Dummy.Instance) { }
[NonAction] [NonAction]
partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo); partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude);
[NonAction] [NonAction]
public override System.Web.Mvc.ActionResult Index() public override System.Web.Mvc.ActionResult Index(System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude)
{ {
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index); var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
IndexOverride(callInfo); ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileInclude", DeviceProfileInclude);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileExclude", DeviceProfileExclude);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressInclude", DeviceAddressInclude);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressExclude", DeviceAddressExclude);
IndexOverride(callInfo, DeviceProfileInclude, DeviceProfileExclude, DeviceAddressInclude, DeviceAddressExclude);
return callInfo; return callInfo;
} }
@@ -57,6 +57,12 @@ namespace Disco.Web.Areas.Public.Controllers
return RedirectToActionPermanent(taskResult.Result); return RedirectToActionPermanent(taskResult.Result);
} }
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult Index()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
}
[NonAction] [NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult UserHeldDevice() public virtual System.Web.Mvc.ActionResult UserHeldDevice()
@@ -101,6 +107,17 @@ namespace Disco.Web.Areas.Public.Controllers
} }
static readonly ActionParamsClass_Index s_params_Index = new ActionParamsClass_Index();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_Index IndexParams { get { return s_params_Index; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_Index
{
public readonly string DeviceProfileInclude = "DeviceProfileInclude";
public readonly string DeviceProfileExclude = "DeviceProfileExclude";
public readonly string DeviceAddressInclude = "DeviceAddressInclude";
public readonly string DeviceAddressExclude = "DeviceAddressExclude";
}
static readonly ActionParamsClass_UserHeldDevice s_params_UserHeldDevice = new ActionParamsClass_UserHeldDevice(); static readonly ActionParamsClass_UserHeldDevice s_params_UserHeldDevice = new ActionParamsClass_UserHeldDevice();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_UserHeldDevice UserHeldDeviceParams { get { return s_params_UserHeldDevice; } } public ActionParamsClass_UserHeldDevice UserHeldDeviceParams { get { return s_params_UserHeldDevice; } }
@@ -133,13 +150,17 @@ namespace Disco.Web.Areas.Public.Controllers
public T4MVC_UserHeldDevicesController() : base(Dummy.Instance) { } public T4MVC_UserHeldDevicesController() : base(Dummy.Instance) { }
[NonAction] [NonAction]
partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo); partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude);
[NonAction] [NonAction]
public override System.Web.Mvc.ActionResult Index() public override System.Web.Mvc.ActionResult Index(System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude)
{ {
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index); var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
IndexOverride(callInfo); ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileInclude", DeviceProfileInclude);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileExclude", DeviceProfileExclude);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressInclude", DeviceAddressInclude);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressExclude", DeviceAddressExclude);
IndexOverride(callInfo, DeviceProfileInclude, DeviceProfileExclude, DeviceAddressInclude, DeviceAddressExclude);
return callInfo; return callInfo;
} }