17 Commits

Author SHA1 Message Date
Gary Sharp 76318d8d00 Release v2.0.0918.1700 2014-09-18 19:11:21 +10:00
Gary Sharp f2ac35a7fa Bug Fix #75: Display errors creating device batch
Thanks Patrick Connell
2014-09-15 13:24:28 +10:00
Gary Sharp b1575fa321 Unified SignalR disconnected/error dialogs
Dialogs (with a refresh option) appear whenever the SignalR client
disconnects or encounters an error. Nonsensical error messages replaced.
Page refresh technique changed to allow for urls containing fragment
hashes.
2014-09-11 17:21:39 +10:00
Gary Sharp 4283b62803 Bug Fix: Job searching with username
When searching jobs, the default domain is now assumed if none is
provided when checking for job users.
2014-09-11 16:48:45 +10:00
Gary Sharp 7551b39b8e Generated Job Log to Markdown
Generated job logs are formatted with Markdown. Includes other minor css
changes.
2014-09-09 13:54:14 +10:00
Gary Sharp 3ae99f45bb Update device model type on Enrolment 2014-09-08 14:53:10 +10:00
Gary Sharp c846fa053a Dialog height reduced & remove js minify maps
Provide better support for lower resolution devices (buttons became
hidden in tall dialogs). Remove references to JavaScript minification
source maps which aren't deployed and caused confusion.
2014-09-08 14:51:51 +10:00
Gary Sharp 57c2e062fc Update: Plugin provided assemblies
Update assemblies which are available to all plugins.
2014-09-02 14:45:44 +10:00
Gary Sharp e940c24522 Bug Fix: Document template bulk examples 2014-09-02 14:45:02 +10:00
Gary Sharp 73d6160db6 Fix typo: AvilableDomainControllers
AvilableDomainControllers -> AvailableDomainControllers
Thanks Boris Pekez
2014-08-29 14:46:29 +10:00
Gary Sharp 13c5efe5d6 Added new UI Icons in FontAwesome 4.2.0 2014-08-28 15:32:57 +10:00
Gary Sharp bbe4cccc91 Update #74: Friendly disconnected messages
When the live connection to the server is interrupted some ui elements
are disabled. If the connection fails (due to errors or failed
reconnection) a dialog instructs the user to check their connection and
refresh the browser. Relates to Device, Job and User pages (logs and
attachments).
2014-08-28 14:59:39 +10:00
Gary Sharp 41e061df54 Update: Font Awesome 4.2.0 2014-08-28 13:53:35 +10:00
Gary Sharp 35a07344cc Bug Fix #71: Update managed groups on device enrol 2014-08-28 12:50:53 +10:00
Gary Sharp 4b6604df5b Feature #69 #72: Noticeboard themes and filtering 2014-08-26 16:27:37 +10:00
Gary Sharp 0de162fce3 Update: Update Job Identifiers 2014-08-19 10:53:59 +10:00
Gary Sharp f26474fa4d Device decommissioning 'returned' reason 2014-08-07 13:43:59 +10:00
172 changed files with 5348 additions and 2540 deletions
+6 -1
View File
@@ -28,7 +28,7 @@ namespace Disco.BI
{
// Check again now that lock is enforced
deviceModel = DeviceModelsSet.FirstOrDefault(dm => dm.Manufacturer == Manufacturer && dm.Model == Model);
if (deviceModel == null)
{
// Create the Device Model in a different DataContext so we don't have to commit unrelated changes
@@ -52,6 +52,11 @@ namespace Disco.BI
}
}
}
else
{
if (deviceModel.ModelType != ModelType)
deviceModel.ModelType = ModelType;
}
return new Tuple<DeviceModel,bool>(deviceModel, false);
}
@@ -157,8 +157,8 @@ namespace Disco.BI.Extensions
JobId = j.Id,
TechUserId = UserService.CurrentUser.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("Device Deleted{0}{0}Serial Number: {1}{0}Computer Name: {2}{0}Model: {3}{0}Profile: {4}",
Environment.NewLine, d.SerialNumber, d.DeviceDomainId, d.DeviceModel, d.DeviceProfile)
Comments = string.Format("# Device Deleted\r\n\r\nSerial Number: **{0}**\r\nComputer Name: **{1}**\r\nModel: **{2}**\r\nProfile: **{3}**",
d.SerialNumber, d.DeviceDomainId, d.DeviceModel, d.DeviceProfile)
};
Database.JobLogs.Add(jobLog);
}
@@ -213,6 +213,8 @@ namespace Disco.BI.Extensions
return "Damaged";
case DecommissionReasons.Donated:
return "Donated";
case DecommissionReasons.Returned:
return "Returned";
default:
return "Unknown";
}
@@ -113,7 +113,7 @@ namespace Disco.BI.Extensions
JobId = j.Id,
TechUserId = Technician.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("Waiting on User Action{0}Reason: {1}", Environment.NewLine, Reason)
Comments = string.Format("# Waiting on User Action\r\n{0}", string.IsNullOrWhiteSpace(Reason) ? "<no reason provided>" : Reason)
};
Database.JobLogs.Add(jobLog);
}
@@ -140,7 +140,7 @@ namespace Disco.BI.Extensions
JobId = j.Id,
TechUserId = Technician.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("User Action Resolved{0}Resolution: {1}", Environment.NewLine, Resolution)
Comments = string.Format("# User Action Resolved\r\n{0}", string.IsNullOrWhiteSpace(Resolution) ? "<no comment provided>" : Resolution)
};
Database.JobLogs.Add(jobLog);
}
@@ -210,7 +210,7 @@ namespace Disco.BI.Extensions
JobId = j.Id,
TechUserId = TechUser.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("####Warranty Claim Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n{3}", WarrantyProvider.Manifest.Name, Address.Name, providerRef, FaultDescription)
Comments = string.Format("# Warranty Claim Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n```{3}```", WarrantyProvider.Manifest.Name, Address.Name, providerRef, FaultDescription)
};
Database.JobLogs.Add(jobLog);
@@ -243,7 +243,7 @@ namespace Disco.BI.Extensions
JobId = j.Id,
TechUserId = TechUser.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("####Manual Warranty Claim Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n{3}", ManualProviderName, Address.Name, ManualProviderReference ?? "<None>", FaultDescription)
Comments = string.Format("# Manual Warranty Claim Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n```{3}```", ManualProviderName, Address.Name, ManualProviderReference ?? "<none>", FaultDescription)
};
Database.JobLogs.Add(jobLog);
}
@@ -322,7 +322,7 @@ namespace Disco.BI.Extensions
JobId = j.Id,
TechUserId = techUser.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("Job Type Converted{0}From: {1}{0}To: {2}", Environment.NewLine, Database.JobTypes.Find(JobType.JobTypeIds.HWar), Database.JobTypes.Find(JobType.JobTypeIds.HNWar))
Comments = string.Format("# Job Type Converted\r\nFrom: **{0}**\r\nTo: **{1}**", Database.JobTypes.Find(JobType.JobTypeIds.HWar), Database.JobTypes.Find(JobType.JobTypeIds.HNWar))
};
Database.JobLogs.Add(jobLog);
@@ -432,7 +432,7 @@ namespace Disco.BI.Extensions
JobId = j.Id,
TechUserId = TechUser.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("####Repair Request Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n{3}", RepairProvider.Manifest.Name, Address.Name, providerRef, RepairDescription)
Comments = string.Format("# Repair Request Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n```{3}```", RepairProvider.Manifest.Name, Address.Name, providerRef, RepairDescription)
};
Database.JobLogs.Add(jobLog);
@@ -465,7 +465,7 @@ namespace Disco.BI.Extensions
JobId = j.Id,
TechUserId = TechUser.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("####Manual Repair Request Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n{3}", ManualProviderName, Address.Name, ManualProviderReference ?? "<None>", FaultDescription)
Comments = string.Format("# Manual Repair Request Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n```{3}```", ManualProviderName, Address.Name, ManualProviderReference ?? "<none>", FaultDescription)
};
Database.JobLogs.Add(jobLog);
}
@@ -639,7 +639,7 @@ namespace Disco.BI.Extensions
JobId = j.Id,
TechUserId = Technician.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("Job Forcibly Closed{0}Reason: {1}", Environment.NewLine, Reason)
Comments = string.Format("# Job Forcibly Closed\r\n{0}", string.IsNullOrWhiteSpace(Reason) ? "<no reason provided>" : Reason)
};
Database.JobLogs.Add(jobLog);
+5 -5
View File
@@ -132,18 +132,18 @@ namespace Disco.BI.Extensions
if (addedSubTypes.Count > 0 || removedSubTypes.Count > 0)
{
StringBuilder logBuilder = new StringBuilder();
logBuilder.AppendLine("Updated Job Sub Types");
logBuilder.AppendLine("# Updated Job Sub Types");
if (removedSubTypes.Count > 0)
{
logBuilder.AppendLine("Removed:");
logBuilder.AppendLine().AppendLine("Removed:");
foreach (var t in removedSubTypes)
logBuilder.Append("- ").AppendLine(t.ToString());
logBuilder.Append("- **").Append(t.ToString()).AppendLine("**");
}
if (addedSubTypes.Count > 0)
{
logBuilder.AppendLine("Added:");
logBuilder.AppendLine().AppendLine("Added:");
foreach (var t in addedSubTypes)
logBuilder.Append("- ").AppendLine(t.ToString());
logBuilder.Append("- **").Append(t.ToString()).AppendLine("**");
}
Database.JobLogs.Add(new JobLog()
{
+1 -1
View File
@@ -242,7 +242,7 @@ namespace Disco.BI.Interop.Pdf
TechUserId = CreatorUser.UserId,
Timestamp = DateTime.Now
};
jl.Comments = string.Format("Document Generated{0}{1} [{2}]", Environment.NewLine, dt.Description, dt.Id);
jl.Comments = string.Format("# Document Generated\r\n**{0}** [{1}]", dt.Description, dt.Id);
Database.JobLogs.Add(jl);
}
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0731.1600")]
[assembly: AssemblyFileVersion("2.0.0731.1600")]
[assembly: AssemblyVersion("2.0.0918.1700")]
[assembly: AssemblyFileVersion("2.0.0918.1700")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0731.1600")]
[assembly: AssemblyFileVersion("2.0.0731.1600")]
[assembly: AssemblyVersion("2.0.0918.1700")]
[assembly: AssemblyFileVersion("2.0.0918.1700")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0731.1600")]
[assembly: AssemblyFileVersion("2.0.0731.1600")]
[assembly: AssemblyVersion("2.0.0918.1700")]
[assembly: AssemblyFileVersion("2.0.0918.1700")]
@@ -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
{
get { return Get<LocationModes>(LocationModes.Unrestricted); }
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0731.1600")]
[assembly: AssemblyFileVersion("2.0.0731.1600")]
[assembly: AssemblyVersion("2.0.0918.1700")]
[assembly: AssemblyFileVersion("2.0.0918.1700")]
+5 -1
View File
@@ -34,6 +34,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.6.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
@@ -176,12 +179,13 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2014/6/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2014/6/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
</VisualStudio>
</ProjectExtensions>
<PropertyGroup>
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0731.1600")]
[assembly: AssemblyFileVersion("2.0.0731.1600")]
[assembly: AssemblyVersion("2.0.0918.1700")]
[assembly: AssemblyFileVersion("2.0.0918.1700")]
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Disco.Models.Repository
{
public enum DecommissionReasons
@@ -13,6 +8,7 @@ namespace Disco.Models.Repository
Stolen = 20,
Lost = 30,
Damaged = 40,
Donated = 50
Donated = 50,
Returned = 60
}
}
@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace Disco.Models.Services.Interop.DiscoServices
@@ -21,18 +22,31 @@ namespace Disco.Models.Services.Interop.DiscoServices
public List<StatisticString> InstalledPlugins { get; set; }
public List<StatisticIntPair> Stat_JobIdentifiers { get; set; }
public List<StatisticJob> Stat_Jobs { get; set; }
public class StatisticIntPair
{
[JsonProperty("B")]
public int Begin;
[JsonProperty("E")]
public int End;
}
public class StatisticInt
{
public string K;
public int V;
[JsonProperty("K")]
public string Key;
[JsonProperty("V")]
public int Value;
}
public class StatisticString
{
public string K;
public string V;
[JsonProperty("K")]
public string Key;
[JsonProperty("V")]
public string Value;
}
public class StatisticJob
@@ -40,62 +54,74 @@ namespace Disco.Models.Services.Interop.DiscoServices
/// <summary>
/// Job Identifier
/// </summary>
public int I { get; set; }
[JsonProperty("I")]
public int Identifier { get; set; }
/// <summary>
/// Opened Date
/// </summary>
public DateTime OD { get; set; }
[JsonProperty("OD")]
public DateTime OpenedDate { get; set; }
/// <summary>
/// Closed Date
/// </summary>
public DateTime? CD { get; set; }
[JsonProperty("CD", NullValueHandling = NullValueHandling.Ignore)]
public DateTime? ClosedDate { get; set; }
/// <summary>
/// Job Type
/// </summary>
public string T { get; set; }
[JsonProperty("T")]
public string Type { get; set; }
/// <summary>
/// Job Sub Types (Semicolon Separated)
/// </summary>
public string ST { get; set; }
[JsonProperty("ST")]
public string SubTypes { get; set; }
/// <summary>
/// Deployment-Unique Device Serial Identifier (Device Serial Number anonymized via hashing salted with Deployment Secret)
/// </summary>
public string D { get; set; }
[JsonProperty("D", NullValueHandling = NullValueHandling.Ignore)]
public string DeviceIdentifier { get; set; }
/// <summary>
/// Deployment-Unique Job User Identifier (Job User Id anonymized via hashing salted with Deployment Secret)
/// </summary>
public string U { get; set; }
[JsonProperty("U", NullValueHandling = NullValueHandling.Ignore)]
public string UserIdentifier { get; set; }
/// <summary>
/// Deployment-Unique Job Technician Identifier (Job Technician Id anonymized via hashing salted with Deployment Secret)
/// </summary>
public string TI { get; set; }
[JsonProperty("TI")]
public string TechnicianIdentifier { get; set; }
/// <summary>
/// Device Model
/// </summary>
public string DM { get; set; }
[JsonProperty("DM", NullValueHandling = NullValueHandling.Ignore)]
public string DeviceModel { get; set; }
/// <summary>
/// External Repairer
/// </summary>
public string R { get; set; }
[JsonProperty("R", NullValueHandling = NullValueHandling.Ignore)]
public string Repairer { get; set; }
/// <summary>
/// External Repairer Logged
/// </summary>
public DateTime? RL { get; set; }
[JsonProperty("RL", NullValueHandling = NullValueHandling.Ignore)]
public DateTime? RepairerLogged { get; set; }
/// <summary>
/// External Repairer Completed
/// </summary>
public DateTime? RC { get; set; }
[JsonProperty("RC", NullValueHandling = NullValueHandling.Ignore)]
public DateTime? RepairerCompleted { get; set; }
}
}
}
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net45" />
</packages>
@@ -36,7 +36,7 @@ namespace Disco.Services.Devices.ManagedGroups
(e.EventType == RepositoryMonitorEventType.Added &&
ActiveDirectory.IsValidDomainAccountId(((Device)e.Entity).DeviceDomainId)) ||
(e.EventType == RepositoryMonitorEventType.Modified &&
(e.ModifiedProperties.Contains("DeviceBatchId") || e.ModifiedProperties.Contains("DeviceDomainId"))) ||
(e.ModifiedProperties.Contains("DeviceBatchId") || e.ModifiedProperties.Contains("DeviceDomainId") || e.ModifiedProperties.Contains("LastEnrolDate"))) ||
(e.EventType == RepositoryMonitorEventType.Deleted)
)
));
@@ -37,7 +37,7 @@ namespace Disco.Services.Devices.ManagedGroups
(e.EventType == RepositoryMonitorEventType.Added &&
ActiveDirectory.IsValidDomainAccountId(((Device)e.Entity).DeviceDomainId)) ||
(e.EventType == RepositoryMonitorEventType.Modified &&
(e.ModifiedProperties.Contains("DeviceProfileId") || e.ModifiedProperties.Contains("DeviceDomainId"))) ||
(e.ModifiedProperties.Contains("DeviceProfileId") || e.ModifiedProperties.Contains("DeviceDomainId") || e.ModifiedProperties.Contains("LastEnrolDate"))) ||
(e.EventType == RepositoryMonitorEventType.Deleted)
)
));
+38 -2
View File
@@ -17,6 +17,10 @@ namespace Disco.Services.Extensions
/// User-selectable Colour Themes
/// </summary>
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>
/// Returns a randomly selected Icon using <see cref="System.Random"/>.
@@ -73,6 +77,7 @@ namespace Disco.Services.Extensions
new KeyValuePair<string, string>("android" , "Android"),
new KeyValuePair<string, string>("apple" , "Apple"),
new KeyValuePair<string, string>("archive" , "Archive"),
new KeyValuePair<string, string>("area-chart" , "Area Chart"),
new KeyValuePair<string, string>("arrow-circle-down" , "Arrow Circle Down"),
new KeyValuePair<string, string>("arrow-circle-left" , "Arrow Circle Left"),
new KeyValuePair<string, string>("arrow-circle-right" , "Arrow Circle Right"),
@@ -81,16 +86,20 @@ namespace Disco.Services.Extensions
new KeyValuePair<string, string>("ban" , "Ban"),
new KeyValuePair<string, string>("beer" , "Beer"),
new KeyValuePair<string, string>("bell" , "Bell"),
new KeyValuePair<string, string>("binoculars" , "Binoculars"),
new KeyValuePair<string, string>("bolt" , "Bolt"),
new KeyValuePair<string, string>("bomb" , "Bomb"),
new KeyValuePair<string, string>("book" , "Book"),
new KeyValuePair<string, string>("bookmark" , "Bookmark"),
new KeyValuePair<string, string>("briefcase" , "Briefcase"),
new KeyValuePair<string, string>("bug" , "Bug"),
new KeyValuePair<string, string>("bicycle" , "Bicycle"),
new KeyValuePair<string, string>("building-o" , "Building"),
new KeyValuePair<string, string>("bullhorn" , "Bullhorn"),
new KeyValuePair<string, string>("bullseye" , "Bullseye"),
new KeyValuePair<string, string>("bus" , "Bus"),
new KeyValuePair<string, string>("cab" , "Cab"),
new KeyValuePair<string, string>("calculator" , "Calculator"),
new KeyValuePair<string, string>("calendar" , "Calendar"),
new KeyValuePair<string, string>("calendar-o" , "Calendar"),
new KeyValuePair<string, string>("car" , "Car"),
@@ -111,6 +120,7 @@ namespace Disco.Services.Extensions
new KeyValuePair<string, string>("envelope" , "Envelope"),
new KeyValuePair<string, string>("exclamation" , "Exclamation"),
new KeyValuePair<string, string>("eye" , "Eye"),
new KeyValuePair<string, string>("eyedropper" , "Eyedropper"),
new KeyValuePair<string, string>("fax" , "Fax"),
new KeyValuePair<string, string>("female" , "Female"),
new KeyValuePair<string, string>("fighter-jet" , "Fighter Jet"),
@@ -142,6 +152,7 @@ namespace Disco.Services.Extensions
new KeyValuePair<string, string>("legal" , "Legal"),
new KeyValuePair<string, string>("life-ring" , "Life Ring"),
new KeyValuePair<string, string>("lightbulb-o" , "Lightbulb"),
new KeyValuePair<string, string>("line-chart" , "Line Chart"),
new KeyValuePair<string, string>("linux" , "Linux"),
new KeyValuePair<string, string>("location-arrow" , "Location Arrow"),
new KeyValuePair<string, string>("magnet" , "Magnet"),
@@ -156,13 +167,17 @@ namespace Disco.Services.Extensions
new KeyValuePair<string, string>("money" , "Money"),
new KeyValuePair<string, string>("moon-o" , "Moon"),
new KeyValuePair<string, string>("music" , "Music"),
new KeyValuePair<string, string>("newspaper-o" , "Newspaper"),
new KeyValuePair<string, string>("paint-brush" , "Paint Brush"),
new KeyValuePair<string, string>("paper-plane" , "Paper Plane"),
new KeyValuePair<string, string>("paperclip" , "Paperclip"),
new KeyValuePair<string, string>("paw" , "Paw"),
new KeyValuePair<string, string>("pencil" , "Pencil"),
new KeyValuePair<string, string>("phone" , "Phone"),
new KeyValuePair<string, string>("pie-chart" , "Pie Chart"),
new KeyValuePair<string, string>("picture-o" , "Picture"),
new KeyValuePair<string, string>("plane" , "Plane"),
new KeyValuePair<string, string>("plug" , "Plug"),
new KeyValuePair<string, string>("power-off" , "Power Off"),
new KeyValuePair<string, string>("print" , "Print"),
new KeyValuePair<string, string>("puzzle-piece" , "Puzzle Piece"),
@@ -188,14 +203,15 @@ namespace Disco.Services.Extensions
new KeyValuePair<string, string>("thumbs-o-up" , "Thumbs Up"),
new KeyValuePair<string, string>("thumbs-up" , "Thumbs Up"),
new KeyValuePair<string, string>("thumb-tack" , "Thumb Tack"),
new KeyValuePair<string, string>("trash-o" , "Trash"),
new KeyValuePair<string, string>("trash" , "Trash"),
new KeyValuePair<string, string>("trophy" , "Trophy"),
new KeyValuePair<string, string>("truck" , "Truck"),
new KeyValuePair<string, string>("umbrella" , "Umbrella"),
new KeyValuePair<string, string>("university" , "University"),
new KeyValuePair<string, string>("wheelchair" , "Wheelchair"),
new KeyValuePair<string, string>("windows" , "Windows"),
new KeyValuePair<string, string>("wrench" , "Wrench")
new KeyValuePair<string, string>("wrench" , "Wrench"),
new KeyValuePair<string, string>("wifi" , "WiFi")
}.AsReadOnly();
// Icon Colours
@@ -221,6 +237,26 @@ namespace Disco.Services.Extensions
new KeyValuePair<string, string>("mauve" , "Mauve"),
new KeyValuePair<string, string>("sienna" , "Sienna")
}.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();
}
}
}
@@ -107,18 +107,18 @@ namespace Disco.Services.Interop.ActiveDirectory
IEnumerable<ADDomainController> availableServers;
// Try Site Servers first
availableServers = AvilableDomainControllers(RequireSiteServer: true, RequireWritable: RequireWritable);
availableServers = AvailableDomainControllers(RequireSiteServer: true, RequireWritable: RequireWritable);
if (!availableServers.Any())
{
// No Site Servers available - try all
availableServers = AvilableDomainControllers(RequireSiteServer: false, RequireWritable: RequireWritable);
availableServers = AvailableDomainControllers(RequireSiteServer: false, RequireWritable: RequireWritable);
if (!availableServers.Any())
{
lock (domainMaintainLock)
{
availableServers = AvilableDomainControllers(RequireSiteServer: false, RequireWritable: RequireWritable);
availableServers = AvailableDomainControllers(RequireSiteServer: false, RequireWritable: RequireWritable);
if (!availableServers.Any())
return DiscoverAvailableDomainController(RequireWritable);
@@ -142,7 +142,7 @@ namespace Disco.Services.Interop.ActiveDirectory
return availableServers.ElementAt(dcrrValue);
}
}
private IEnumerable<ADDomainController> AvilableDomainControllers(bool RequireSiteServer, bool RequireWritable)
private IEnumerable<ADDomainController> AvailableDomainControllers(bool RequireSiteServer, bool RequireWritable)
{
IEnumerable<ADDomainController> query = this.DomainControllers.Where(dc => dc.IsAvailable);
if (RequireSiteServer)
@@ -17,6 +17,7 @@ namespace Disco.Services.Interop.DiscoServices
using StatisticInt = UpdateRequestV2.StatisticInt;
using StatisticJob = UpdateRequestV2.StatisticJob;
using StatisticString = UpdateRequestV2.StatisticString;
using StatisticIntPair = UpdateRequestV2.StatisticIntPair;
public static class UpdateQuery
{
@@ -63,7 +64,6 @@ namespace Disco.Services.Interop.DiscoServices
Status.UpdateStatus(10, "Gathering statistics and building update request");
var updateRequest = BuildRequest(Database);
var updateRequestJson = JsonConvert.SerializeObject(updateRequest);
Status.UpdateStatus(40, "Sending statistics and update request");
@@ -87,7 +87,9 @@ namespace Disco.Services.Interop.DiscoServices
{
using (var requestStreamWriter = new StreamWriter(compressedStream, Encoding.UTF8))
{
requestStreamWriter.Write(updateRequestJson);
JsonSerializer serializer = new JsonSerializer();
serializer.Serialize(requestStreamWriter, updateRequest);
requestStreamWriter.Flush();
}
}
@@ -143,65 +145,85 @@ namespace Disco.Services.Interop.DiscoServices
if (whoAmIResponse != null && !string.IsNullOrWhiteSpace(whoAmIResponse.Item1))
m.VicEduDeptWanId = whoAmIResponse.Item1;
m.Stat_JobCounts = Database.Jobs.GroupBy(j => j.JobTypeId).Select(g => new StatisticInt() { K = g.Key, V = g.Count() }).ToList();
m.Stat_OpenJobCounts = Database.Jobs.Where(j => j.ClosedDate == null).GroupBy(j => j.JobTypeId).Select(g => new StatisticInt() { K = g.Key, V = g.Count() }).ToList();
m.Stat_DeviceModelCounts = Database.DeviceModels.Select(dm => new StatisticInt() { K = dm.Manufacturer + ";" + dm.Model, V = dm.Devices.Count(d => d.DecommissionedDate == null) }).ToList();
m.Stat_JobCounts = Database.Jobs.GroupBy(j => j.JobTypeId).Select(g => new StatisticInt() { Key = g.Key, Value = g.Count() }).ToList();
m.Stat_OpenJobCounts = Database.Jobs.Where(j => j.ClosedDate == null).GroupBy(j => j.JobTypeId).Select(g => new StatisticInt() { Key = g.Key, Value = g.Count() }).ToList();
m.Stat_DeviceModelCounts = Database.DeviceModels.Select(dm => new StatisticInt() { Key = dm.Manufacturer + ";" + dm.Model, Value = dm.Devices.Count(d => d.DecommissionedDate == null) }).ToList();
var activeThreshold = DateTime.Now.AddDays(-60);
m.Stat_ActiveDeviceModelCounts = Database.DeviceModels.Select(dm => new StatisticInt() { K = dm.Manufacturer + ";" + dm.Model, V = dm.Devices.Count(d => d.DecommissionedDate == null && (d.LastNetworkLogonDate == null || d.LastNetworkLogonDate > activeThreshold)) }).ToList();
m.Stat_ActiveDeviceModelCounts = Database.DeviceModels.Select(dm => new StatisticInt() { Key = dm.Manufacturer + ";" + dm.Model, Value = dm.Devices.Count(d => d.DecommissionedDate == null && (d.LastNetworkLogonDate == null || d.LastNetworkLogonDate > activeThreshold)) }).ToList();
m.Stat_UserCounts = new List<StatisticInt>() {
new StatisticInt() { K = "All", V = Database.Users.Count() },
new StatisticInt() { K = "Assigned Current", V = Database.Users.Where(u => u.DeviceUserAssignments.Any(dua => !dua.UnassignedDate.HasValue)).Count() },
new StatisticInt() { K = "Assigned Ever", V = Database.Users.Where(u => u.DeviceUserAssignments.Any()).Count() },
new StatisticInt() { K = "Job Technicians", V = Database.Jobs.Select(j => j.OpenedTechUserId).Distinct().ToList().Concat(Database.Jobs.Select(j => j.ClosedTechUserId).Distinct().ToList()).Distinct().Count() },
new StatisticInt() { K = "Job Users", V = Database.Jobs.Where(j => j.UserId != null).Select(j => j.UserId).Distinct().Count() }
new StatisticInt() { Key = "All", Value = Database.Users.Count() },
new StatisticInt() { Key = "Assigned Current", Value = Database.Users.Where(u => u.DeviceUserAssignments.Any(dua => !dua.UnassignedDate.HasValue)).Count() },
new StatisticInt() { Key = "Assigned Ever", Value = Database.Users.Where(u => u.DeviceUserAssignments.Any()).Count() },
new StatisticInt() { Key = "Job Technicians", Value = Database.Jobs.Select(j => j.OpenedTechUserId).Distinct().ToList().Concat(Database.Jobs.Select(j => j.ClosedTechUserId).Distinct().ToList()).Distinct().Count() },
new StatisticInt() { Key = "Job Users", Value = Database.Jobs.Where(j => j.UserId != null).Select(j => j.UserId).Distinct().Count() }
};
IQueryable<Job> jobs;
if (lastUpdate == null)
jobs = Database.Jobs;
else
var jobIds = Database.Jobs.OrderBy(j => j.Id).Select(j => j.Id).ToList();
if (jobIds.Count > 0)
{
var lastUpdateDate = lastUpdate.UpdateResponseDate.Date;
jobs = Database.Jobs.Where(j => j.OpenedDate >= lastUpdateDate || (j.ClosedDate.HasValue && j.ClosedDate.Value >= lastUpdateDate));
m.Stat_JobIdentifiers = new List<StatisticIntPair>();
var jobIdSequenceBegin = jobIds.First();
jobIds.Skip(1).Aggregate(jobIdSequenceBegin, (last, current) =>
{
if (current == last + 1)
return current;
else
{
m.Stat_JobIdentifiers.Add(new StatisticIntPair() { Begin = jobIdSequenceBegin, End = last });
jobIdSequenceBegin = current;
}
return current;
});
m.Stat_JobIdentifiers.Add(new StatisticIntPair() { Begin = jobIdSequenceBegin, End = jobIds.Last() });
IQueryable<Job> jobs;
if (lastUpdate == null)
jobs = Database.Jobs;
else
{
var lastUpdateDate = lastUpdate.UpdateResponseDate.Date;
jobs = Database.Jobs.Where(j => j.OpenedDate >= lastUpdateDate || (j.ClosedDate.HasValue && j.ClosedDate.Value >= lastUpdateDate));
}
var reportedJobs = jobs.Select(j => new
{
Id = j.Id,
OpenedDate = j.OpenedDate,
ClosedDate = j.ClosedDate,
JobType = j.JobTypeId,
JobSubTypes = j.JobSubTypes.Select(jst => jst.Id),
DeviceModelManufacturer = j.Device.DeviceModel.Manufacturer,
DeviceModelModel = j.Device.DeviceModel.Model,
DeviceSerialNumber = j.DeviceSerialNumber,
UserId = j.UserId,
JobTechnicianId = j.OpenedTechUserId,
WarrantyRepairer = j.JobMetaWarranty.ExternalName,
WarrantyRepairerLoggedDate = j.JobMetaWarranty.ExternalLoggedDate,
WarrantyRepairerCompletedDate = j.JobMetaWarranty.ExternalCompletedDate,
Repairer = j.JobMetaNonWarranty.RepairerName,
RepairerLoggedDate = j.JobMetaNonWarranty.RepairerLoggedDate,
RepairerCompletedDate = j.JobMetaNonWarranty.RepairerCompletedDate,
}).ToList();
m.Stat_Jobs = reportedJobs.Select(j => new StatisticJob()
{
Identifier = j.Id,
OpenedDate = j.OpenedDate,
ClosedDate = j.ClosedDate,
Type = j.JobType,
SubTypes = j.JobSubTypes == null ? null : string.Join(";", j.JobSubTypes),
DeviceIdentifier = HashDeploymentData(Database, j.DeviceSerialNumber),
UserIdentifier = HashDeploymentData(Database, j.UserId),
TechnicianIdentifier = HashDeploymentData(Database, j.JobTechnicianId),
DeviceModel = string.Format("{0};{1}", j.DeviceModelManufacturer, j.DeviceModelModel),
Repairer = j.JobType == JobType.JobTypeIds.HWar ? j.WarrantyRepairer : j.Repairer,
RepairerLogged = j.JobType == JobType.JobTypeIds.HWar ? j.WarrantyRepairerLoggedDate : j.RepairerLoggedDate,
RepairerCompleted = j.JobType == JobType.JobTypeIds.HWar ? j.WarrantyRepairerCompletedDate : j.RepairerCompletedDate
}).ToList();
}
var reportedJobs = jobs.Select(j => new
{
Id = j.Id,
OpenedDate = j.OpenedDate,
ClosedDate = j.ClosedDate,
JobType = j.JobTypeId,
JobSubTypes = j.JobSubTypes.Select(jst => jst.Id),
DeviceModelManufacturer = j.Device.DeviceModel.Manufacturer,
DeviceModelModel = j.Device.DeviceModel.Model,
DeviceSerialNumber = j.DeviceSerialNumber,
UserId = j.UserId,
JobTechnicianId = j.OpenedTechUserId,
WarrantyRepairer = j.JobMetaWarranty.ExternalName,
WarrantyRepairerLoggedDate = j.JobMetaWarranty.ExternalLoggedDate,
WarrantyRepairerCompletedDate = j.JobMetaWarranty.ExternalCompletedDate,
Repairer = j.JobMetaNonWarranty.RepairerName,
RepairerLoggedDate = j.JobMetaNonWarranty.RepairerLoggedDate,
RepairerCompletedDate = j.JobMetaNonWarranty.RepairerCompletedDate,
}).ToList();
m.Stat_Jobs = reportedJobs.Select(j => new StatisticJob()
{
I = j.Id,
OD = j.OpenedDate,
CD = j.ClosedDate,
T = j.JobType,
ST = j.JobSubTypes == null ? null : string.Join(";", j.JobSubTypes),
D = HashDeploymentData(Database, j.DeviceSerialNumber),
U = HashDeploymentData(Database, j.UserId),
TI = HashDeploymentData(Database, j.JobTechnicianId),
DM = string.Format("{0};{1}", j.DeviceModelManufacturer, j.DeviceModelModel),
R = j.JobType == JobType.JobTypeIds.HWar ? j.WarrantyRepairer : j.Repairer,
RL = j.JobType == JobType.JobTypeIds.HWar ? j.WarrantyRepairerLoggedDate : j.RepairerLoggedDate,
RC = j.JobType == JobType.JobTypeIds.HWar ? j.WarrantyRepairerCompletedDate : j.RepairerCompletedDate
}).ToList();
m.InstalledPlugins = Disco.Services.Plugins.Plugins.GetPlugins().Select(manifest => new StatisticString() { K = manifest.Id, V = manifest.VersionFormatted }).ToList();
m.InstalledPlugins = Disco.Services.Plugins.Plugins.GetPlugins().Select(manifest => new StatisticString() { Key = manifest.Id, Value = manifest.VersionFormatted }).ToList();
return m;
}
@@ -98,14 +98,14 @@ namespace Disco.Services.Jobs.JobQueues
JobId = jqj.JobId,
TechUserId = jqj.AddedUserId,
Timestamp = jqj.AddedDate,
Comments = string.Format("Added to Job Queue: {1}{0}Priority: {2}{0}Comment: {3}", Environment.NewLine, queue.Name, jqj.Priority.ToString(), string.IsNullOrWhiteSpace(jqj.AddedComment) ? "<none>" : jqj.AddedComment)
Comments = string.Format("# Added to Queue\r\n**{0}**\r\nPriority: **{1}**\r\n{2}", Environment.NewLine, queue.Name, jqj.Priority.ToString(), string.IsNullOrWhiteSpace(jqj.AddedComment) ? "<no comment>" : jqj.AddedComment)
});
Database.JobLogs.Add(new JobLog()
{
JobId = jqj.JobId,
TechUserId = jqj.RemovedUserId,
Timestamp = jqj.RemovedDate.Value,
Comments = string.Format("Removed from Job Queue: {1}{0}Comment: {2}", Environment.NewLine, queue.Name, string.IsNullOrWhiteSpace(jqj.RemovedComment) ? "<none>" : jqj.RemovedComment)
Comments = string.Format("# Removed from Queue\r\n**{0}**\r\n{1}", queue.Name, string.IsNullOrWhiteSpace(jqj.RemovedComment) ? "<no comment>" : jqj.RemovedComment)
});
// Delete JQJ
@@ -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
.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
.Where(j =>
@@ -36,5 +36,10 @@ namespace Disco.Services.Jobs.Noticeboards
return base.OnConnected();
}
public static void SetTheme(string ThemeName)
{
HubContext.Clients.All.setTheme(ThemeName);
}
}
}
+4
View File
@@ -145,8 +145,12 @@ namespace Disco.Services.Plugins
"Disco.Web",
"Disco.Web.Extensions",
"EntityFramework",
"Exceptionless",
"Exceptionless.Models",
"Exceptionless.Mvc",
"itextsharp",
"LumenWorks.Framework.IO",
"MarkdownSharp",
"Microsoft.AspNet.SignalR.Core",
"Microsoft.AspNet.SignalR.SystemWeb",
"Microsoft.Owin",
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0731.1600")]
[assembly: AssemblyFileVersion("2.0.0731.1600")]
[assembly: AssemblyVersion("2.0.0918.1700")]
[assembly: AssemblyFileVersion("2.0.0918.1700")]
+10 -6
View File
@@ -22,6 +22,8 @@ namespace Disco.Services.Searching
IQueryable<Job> query = default(IQueryable<Job>);
string userIdTerm = Term.Contains('\\') ? Term : ActiveDirectory.ParseDomainAccountId(Term);
if (int.TryParse(Term, out termInt))
{
// Term is a Number (int)
@@ -29,7 +31,7 @@ namespace Disco.Services.Searching
j.Id == termInt ||
j.Device.SerialNumber.Contains(Term) ||
j.Device.AssetNumber.Contains(Term) ||
j.User.UserId == Term ||
j.User.UserId == userIdTerm ||
j.User.DisplayName.Contains(Term));
}
else
@@ -37,7 +39,7 @@ namespace Disco.Services.Searching
query = Database.Jobs.Where(j =>
j.Device.SerialNumber.Contains(Term) ||
j.Device.AssetNumber.Contains(Term) ||
j.User.UserId == Term ||
j.User.UserId == userIdTerm ||
j.User.DisplayName.Contains(Term));
}
@@ -65,6 +67,8 @@ namespace Disco.Services.Searching
IQueryable<Job> query = default(IQueryable<Job>);
string userIdTerm = Term.Contains('\\') ? Term : ActiveDirectory.ParseDomainAccountId(Term);
if (int.TryParse(Term, out termInt))
{
// Term is a Number (int)
@@ -75,7 +79,7 @@ namespace Disco.Services.Searching
j.DeviceHeldLocation.Contains(Term) ||
j.Device.SerialNumber.Contains(Term) ||
j.Device.AssetNumber.Contains(Term) ||
j.User.UserId == Term ||
j.User.UserId == userIdTerm ||
j.User.Surname.Contains(Term) ||
j.User.GivenName.Contains(Term) ||
j.User.DisplayName.Contains(Term) ||
@@ -89,7 +93,7 @@ namespace Disco.Services.Searching
j.DeviceHeldLocation.Contains(Term) ||
j.Device.SerialNumber.Contains(Term) ||
j.Device.AssetNumber.Contains(Term) ||
j.User.UserId == Term ||
j.User.UserId == userIdTerm ||
j.User.Surname.Contains(Term) ||
j.User.GivenName.Contains(Term) ||
j.User.DisplayName.Contains(Term));
@@ -103,7 +107,7 @@ namespace Disco.Services.Searching
j.DeviceHeldLocation.Contains(Term) ||
j.Device.SerialNumber.Contains(Term) ||
j.Device.AssetNumber.Contains(Term) ||
j.User.UserId == Term ||
j.User.UserId == userIdTerm ||
j.User.Surname.Contains(Term) ||
j.User.GivenName.Contains(Term) ||
j.User.DisplayName.Contains(Term) ||
@@ -116,7 +120,7 @@ namespace Disco.Services.Searching
j.DeviceHeldLocation.Contains(Term) ||
j.Device.SerialNumber.Contains(Term) ||
j.Device.AssetNumber.Contains(Term) ||
j.User.UserId == Term ||
j.User.UserId == userIdTerm ||
j.User.Surname.Contains(Term) ||
j.User.GivenName.Contains(Term) ||
j.User.DisplayName.Contains(Term));
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0731.1600")]
[assembly: AssemblyFileVersion("2.0.0731.1600")]
[assembly: AssemblyVersion("2.0.0918.1700")]
[assembly: AssemblyFileVersion("2.0.0918.1700")]
@@ -1510,7 +1510,7 @@ namespace Disco.Web.Areas.API.Controllers
JobId = job.Id,
TechUserId = CurrentUser.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("Added Flag: {0}{1}Reason: {2}", flagStatus.Item1, Environment.NewLine, Reason)
Comments = string.Format("# Added Flag\r\n**{0}**\r\n{1}", flagStatus.Item1, string.IsNullOrWhiteSpace(Reason) ? "<no reason provided>" : Reason)
};
Database.JobLogs.Add(jobLog);
@@ -35,6 +35,20 @@ namespace Disco.Web.Areas.API.Controllers
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)]
public virtual ActionResult UpdateLocationMode(LocationModes LocationMode, bool redirect = false)
{
@@ -19,6 +19,7 @@ namespace Disco.Web.Areas.Config.Controllers
{
LongRunningJobDaysThreshold = Database.DiscoConfiguration.JobPreferences.LongRunningJobDaysThreshold,
StaleJobMinutesThreshold = Database.DiscoConfiguration.JobPreferences.StaleJobMinutesThreshold,
DefaultNoticeboardTheme = Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme,
LocationMode = Database.DiscoConfiguration.JobPreferences.LocationMode,
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.Services.Extensions;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
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 StaleJobMinutesThreshold { get; set; }
public string DefaultNoticeboardTheme { get; set; }
public LocationModes LocationMode { 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()
{
var options = new List<KeyValuePair<int, string>>() {
@@ -5,21 +5,19 @@
}
@using (Html.BeginForm())
{
@Html.ValidationSummary(false)
<div class="form" style="width: 450px">
<table>
<tr>
<th>
Name:
</th>
<th>Name:</th>
<td>
@Html.EditorFor(model => model.DeviceBatch.Name)<br />@Html.ValidationMessageFor(model => model.DeviceBatch.Name)
</td>
</tr>
<tr>
<th>
Purchase Date:
</th>
<td>@Html.EditorFor(model => model.DeviceBatch.PurchaseDate)<br />@Html.ValidationMessageFor(model => model.DeviceBatch.PurchaseDate)
<th>Purchase Date:</th>
<td>
@Html.EditorFor(model => model.DeviceBatch.PurchaseDate)<br />@Html.ValidationMessageFor(model => model.DeviceBatch.PurchaseDate)
</td>
</tr>
</table>
@@ -59,6 +59,20 @@ WriteLiteral("\r\n");
#line 6 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
using (Html.BeginForm())
{
#line default
#line hidden
#line 8 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
Write(Html.ValidationSummary(false));
#line default
#line hidden
#line 8 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line default
@@ -69,13 +83,13 @@ WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n N" +
"ame:\r\n </th>\r\n <td>\r\n");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>Name:</th>\r\n " +
" <td>\r\n");
WriteLiteral(" ");
#line 15 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line 14 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.Name));
@@ -84,18 +98,19 @@ WriteLiteral(" ");
WriteLiteral("<br />");
#line 15 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line 14 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.DeviceBatch.Name));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Purchase Date:\r\n </th>\r\n <t" +
"d>");
">Purchase Date:</th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 22 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line 20 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDate));
@@ -104,7 +119,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral("<br />");
#line 22 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line 20 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.DeviceBatch.PurchaseDate));
@@ -141,7 +156,7 @@ WriteLiteral(@">
");
#line 40 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line 38 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
}
@@ -38,7 +38,7 @@
<a target="_blank" href="#" data-bind="attr: { href: manuallyAssignUrl }, visible: $parent.sessionEnded">Manually Assign Page</a>
</div>
<div data-bind="visible: detected">
Document: <a target="_blank" href="#" data-bind="text: documentTemplate, attr: { href: documentTemplateUrl }"></a>
Document: <a target="_blank" href="#" data-bind="text: documentTemplate, attr: { href: documentTemplateUrl }"></a>
<br />
Target: <a target="_blank" href="#" data-bind="text: assignedData, attr: { href: assignedDataUrl }"></a>
</div>
@@ -307,15 +307,35 @@
logHub.client.receiveLog = parseLog
$.connection.hub.qs = { LogModules: '@(Disco.BI.DocumentTemplateBI.DocumentsLog.Current.LiveLogGroupName)' };
$.connection.hub.error(function (error) {
alert('Live-Log Error: ' + error);
});
$.connection.hub.error(onHubFailed);
$.connection.hub.start()
.done(function () { isLive = true; })
.fail(function (error) {
alert('Live-Log Connection Error: ' + error);
});
.fail(onHubFailed);
function onHubFailed(error) {
// Show Dialog Message
if ($('.disconnected-dialog').length == 0) {
$('<div>')
.addClass('dialog disconnected-dialog')
.html('<h3><span class="fa-stack fa-lg"><i class="fa fa-wifi fa-stack-1x"></i><i class="fa fa-ban fa-stack-2x error"></i></span>Disconnected from the Disco ICT Server</h3><div>This page is not receiving live updates. Please ensure you are connected to the server, then refresh this page to enable features.</div>')
.dialog({
resizable: false,
title: 'Disconnected',
width: 400,
modal: true,
buttons: {
'Refresh Now': function () {
$(this).dialog('option', 'buttons', null);
window.location.reload(true);
},
'Close': function () {
$(this).dialog('destroy');
}
}
});
}
}
}
init();
});
@@ -157,7 +157,7 @@ WriteLiteral(">\r\n Document: <a");
WriteLiteral(" target=\"_blank\"");
WriteLiteral(" href=\"#\"");
WriteLiteral(" href=\"#\"");
WriteLiteral(" data-bind=\"text: documentTemplate, attr: { href: documentTemplateUrl }\"");
@@ -471,21 +471,26 @@ WriteLiteral(@"',
#line default
#line hidden
WriteLiteral(@"' };
$.connection.hub.error(function (error) {
alert('Live-Log Error: ' + error);
});
$.connection.hub.start()
.done(function () { isLive = true; })
.fail(function (error) {
alert('Live-Log Connection Error: ' + error);
});
}
init();
});
</script>
");
WriteLiteral("\' };\r\n $.connection.hub.error(onHubFailed);\r\n\r\n $.connectio" +
"n.hub.start()\r\n .done(function () { isLive = true; })\r\n " +
" .fail(onHubFailed);\r\n\r\n function onHubFailed(error) {\r\n " +
" // Show Dialog Message\r\n if ($(\'.disconnected-dialog\').le" +
"ngth == 0) {\r\n $(\'<div>\')\r\n .addClass(" +
"\'dialog disconnected-dialog\')\r\n .html(\'<h3><span class=\"f" +
"a-stack fa-lg\"><i class=\"fa fa-wifi fa-stack-1x\"></i><i class=\"fa fa-ban fa-stac" +
"k-2x error\"></i></span>Disconnected from the Disco ICT Server</h3><div>This page" +
" is not receiving live updates. Please ensure you are connected to the server, t" +
"hen refresh this page to enable features.</div>\')\r\n .dial" +
"og({\r\n resizable: false,\r\n " +
" title: \'Disconnected\',\r\n width: 400,\r\n " +
" modal: true,\r\n buttons: {\r\n " +
" \'Refresh Now\': function () {\r\n " +
" $(this).dialog(\'option\', \'buttons\', null);\r\n " +
" window.location.reload(true);\r\n },\r\n " +
" \'Close\': function () {\r\n " +
" $(this).dialog(\'destroy\');\r\n }\r\n " +
" }\r\n });\r\n }\r\n }" +
"\r\n }\r\n init();\r\n });\r\n</script>\r\n");
}
}
@@ -257,7 +257,7 @@
modal: true,
autoOpen: false,
width: 750,
height: 620,
height: 580,
buttons: {
"Save Changes": saveChanges,
Cancel: cancel
@@ -286,7 +286,7 @@
dialog.dialog("option", "buttons", null);
// Refresh Page
window.location.href = window.location.href;
window.location.reload(true);
}
function saveChanges() {
@@ -682,15 +682,47 @@
<a id="buttonBulkGenerate" href="#" class="button">Bulk Generate</a>
<div id="dialogBulkGenerate" class="hiddenDialog" title="Bulk Generate: @(Model.DocumentTemplate.Id)">
<div class="brief">
<div>
Enter multiple <span class="scopeDescBulkGenerate"></span>&nbsp;separated by <code>&lt;new line&gt;</code>, commas (<code>,</code>) or semicolons (<code>;</code>).
</div>
<div class="examples clearfix">
<h4>Examples:</h4>
<div class="example1 code"></div>
<div class="example2 code"></div>
<div class="example3 code"></div>
</div>
@switch (Model.DocumentTemplate.Scope)
{
case "Device":
<div>
Enter multiple <span class="scopeDescBulkGenerate">Device Serial Numbers</span> separated by <code>&lt;new line&gt;</code>, commas (<code>,</code>) or semicolons (<code>;</code>).
</div>
<div class="examples clearfix">
<h4>Examples:</h4>
<div class="example1 code">01234567<br />
ABCD9876<br />
8VQ6G2R</div>
<div class="example2 code">01234567,ABCD9876,8VQ6G2R</div>
<div class="example3 code">01234567;ABCD9876;8VQ6G2R</div>
</div>
break;
case "Job":
<div>
Enter multiple <span class="scopeDescBulkGenerate">Job Ids</span> separated by <code>&lt;new line&gt;</code>, commas (<code>,</code>) or semicolons (<code>;</code>).
</div>
<div class="examples clearfix">
<h4>Examples:</h4>
<div class="example1 code">86<br />
99<br />
44</div>
<div class="example2 code">86,99,44</div>
<div class="example3 code">86;99;44</div>
</div>
break;
case "User":
<div>
Enter multiple <span class="scopeDescBulkGenerate">User Ids</span> separated by <code>&lt;new line&gt;</code>, commas (<code>,</code>) or semicolons (<code>;</code>).
</div>
<div class="examples clearfix">
<h4>Examples:</h4>
<div class="example1 code">user6<br />
smi0099<br />@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith</div>
<div class="example2 code">user6,smi0099,@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith</div>
<div class="example3 code">user6;smi0099;@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith</div>
</div>
break;
}
</div>
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
{
@@ -724,27 +756,6 @@
$.validator.unobtrusive.reparse('#inputBulkGenerateDataIds');
}
switch ($('#DocumentTemplate_Scope').val()) {
case 'Device':
dialog.find('.scopeDescBulkGenerate').text('Device Serial Numbers');
dialog.find('.example1').html('01234567<br />ABCD9876<br />8VQ6G2R');
dialog.find('.example2').text('01234567,ABCD9876,8VQ6G2R');
dialog.find('.example3').text('01234567;ABCD9876;8VQ6G2R');
break;
case 'Job':
dialog.find('.scopeDescBulkGenerate').text('Job Ids');
dialog.find('.example1').html('86<br />99<br />44');
dialog.find('.example2').text('86,99,44');
dialog.find('.example3').text('86;99;44');
break;
case 'User':
dialog.find('.scopeDescBulkGenerate').text('User Ids');
dialog.find('.example1').html('user6<br />smi0099<br />@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\\rsmith');
dialog.find('.example2').text('user6,smi0099,@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\\rsmith');
dialog.find('.example3').text('user6;smi0099;@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\\rsmith');
break;
}
dialog.dialog('open');
return false;
});
@@ -989,7 +989,7 @@ WriteLiteral(" <script>\r\n
"izable: false,\r\n modal: t" +
"rue,\r\n autoOpen: false,\r\n" +
" width: 750,\r\n " +
" height: 620,\r\n " +
" height: 580,\r\n " +
" buttons: {\r\n " +
" \"Save Changes\": saveChanges,\r\n " +
" Cancel: cancel\r\n " +
@@ -1012,21 +1012,21 @@ WriteLiteral(" <script>\r\n
"el() {\r\n dialog.dialog(\"disable\")" +
";\r\n dialog.dialog(\"option\", \"butt" +
"ons\", null);\r\n\r\n // Refresh Page\r" +
"\n window.location.href = window.l" +
"ocation.href;\r\n }\r\n\r\n " +
" function saveChanges() {\r\n " +
" var form = dialog.find(\'form\');\r\n\r\n " +
" $(\'input.jobType:unchecked\').each(function () {\r\n " +
" $(\'#SubTypes_\' + $(this).val()).fi" +
"nd(\'input\').prop(\'checked\', false);\r\n " +
" });\r\n\r\n form.submit();\r\n\r\n " +
" dialog.dialog(\"disable\");\r\n " +
" dialog.dialog(\"option\", \"buttons\", null" +
");\r\n }\r\n\r\n " +
" $(function () {\r\n " +
" $(\'#Config_DocumentTemplates_JobSubTypes_Update\').click(showDialog);\r\n " +
" });\r\n\r\n " +
" })();\r\n </script>\r\n");
"\n window.location.reload(true);\r\n" +
" }\r\n\r\n " +
" function saveChanges() {\r\n " +
" var form = dialog.find(\'form\');\r\n\r\n " +
" $(\'input.jobType:unchecked\').each(function () {\r\n " +
" $(\'#SubTypes_\' + $(this).val()).find(\'input\').pro" +
"p(\'checked\', false);\r\n });\r\n\r\n " +
" form.submit();\r\n\r\n " +
" dialog.dialog(\"disable\");\r\n " +
" dialog.dialog(\"option\", \"buttons\", null);\r\n " +
" }\r\n\r\n " +
" $(function () {\r\n $(\'#Config_Do" +
"cumentTemplates_JobSubTypes_Update\').click(showDialog);\r\n " +
" });\r\n\r\n })();\r\n " +
" </script>\r\n");
#line 311 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
@@ -1959,53 +1959,177 @@ WriteLiteral(" id=\"dialogBulkGenerate\"");
WriteLiteral(" class=\"hiddenDialog\"");
WriteAttribute("title", Tuple.Create(" title=\"", 38168), Tuple.Create("\"", 38219)
, Tuple.Create(Tuple.Create("", 38176), Tuple.Create("Bulk", 38176), true)
, Tuple.Create(Tuple.Create(" ", 38180), Tuple.Create("Generate:", 38181), true)
WriteAttribute("title", Tuple.Create(" title=\"", 38153), Tuple.Create("\"", 38204)
, Tuple.Create(Tuple.Create("", 38161), Tuple.Create("Bulk", 38161), true)
, Tuple.Create(Tuple.Create(" ", 38165), Tuple.Create("Generate:", 38166), true)
#line 683 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create(" ", 38190), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
, Tuple.Create(Tuple.Create(" ", 38175), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
#line default
#line hidden
, 38191), false)
, 38176), false)
);
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"brief\"");
WriteLiteral(">\r\n <div>\r\n Enter multiple <span");
WriteLiteral(">\r\n");
#line 685 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 685 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
switch (Model.DocumentTemplate.Scope)
{
case "Device":
#line default
#line hidden
WriteLiteral(" <div>\r\n Enter multiple <span");
WriteLiteral(" class=\"scopeDescBulkGenerate\"");
WriteLiteral("></span>&nbsp;separated by <code>&lt;new line&gt;</code>, commas (<code>,</code>)" +
" or semicolons (<code>;</code>).\r\n </div>\r\n <div");
WriteLiteral(">Device Serial Numbers</span> separated by <code>&lt;new line&gt;</code>, commas " +
"(<code>,</code>) or semicolons (<code>;</code>).\r\n </div>\r\n");
WriteLiteral(" <div");
WriteLiteral(" class=\"examples clearfix\"");
WriteLiteral(">\r\n <h4>Examples:</h4>\r\n <div");
WriteLiteral(">\r\n <h4>Examples:</h4>\r\n <div");
WriteLiteral(" class=\"example1 code\"");
WriteLiteral("></div>\r\n <div");
WriteLiteral(">01234567<br />\r\n ABCD9876<br />\r\n " +
" 8VQ6G2R</div>\r\n <div");
WriteLiteral(" class=\"example2 code\"");
WriteLiteral("></div>\r\n <div");
WriteLiteral(">01234567,ABCD9876,8VQ6G2R</div>\r\n <div");
WriteLiteral(" class=\"example3 code\"");
WriteLiteral("></div>\r\n </div>\r\n </div>\r\n");
WriteLiteral(">01234567;ABCD9876;8VQ6G2R</div>\r\n </div>\r\n");
#line 695 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 699 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
break;
case "Job":
#line default
#line hidden
WriteLiteral(" <div>\r\n Enter multiple <span");
WriteLiteral(" class=\"scopeDescBulkGenerate\"");
WriteLiteral(">Job Ids</span> separated by <code>&lt;new line&gt;</code>, commas (<code>,</code" +
">) or semicolons (<code>;</code>).\r\n </div>\r\n");
WriteLiteral(" <div");
WriteLiteral(" class=\"examples clearfix\"");
WriteLiteral(">\r\n <h4>Examples:</h4>\r\n <div");
WriteLiteral(" class=\"example1 code\"");
WriteLiteral(">86<br />\r\n 99<br />\r\n 44</" +
"div>\r\n <div");
WriteLiteral(" class=\"example2 code\"");
WriteLiteral(">86,99,44</div>\r\n <div");
WriteLiteral(" class=\"example3 code\"");
WriteLiteral(">86;99;44</div>\r\n </div>\r\n");
#line 712 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
break;
case "User":
#line default
#line hidden
WriteLiteral(" <div>\r\n Enter multiple <span");
WriteLiteral(" class=\"scopeDescBulkGenerate\"");
WriteLiteral(">User Ids</span> separated by <code>&lt;new line&gt;</code>, commas (<code>,</cod" +
"e>) or semicolons (<code>;</code>).\r\n </div>\r\n");
WriteLiteral(" <div");
WriteLiteral(" class=\"examples clearfix\"");
WriteLiteral(">\r\n <h4>Examples:</h4>\r\n <div");
WriteLiteral(" class=\"example1 code\"");
WriteLiteral(">user6<br />\r\n smi0099<br />");
#line 720 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(ActiveDirectory.Context.PrimaryDomain.NetBiosName);
#line default
#line hidden
WriteLiteral("\\rsmith</div>\r\n <div");
WriteLiteral(" class=\"example2 code\"");
WriteLiteral(">user6,smi0099,");
#line 721 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(ActiveDirectory.Context.PrimaryDomain.NetBiosName);
#line default
#line hidden
WriteLiteral("\\rsmith</div>\r\n <div");
WriteLiteral(" class=\"example3 code\"");
WriteLiteral(">user6;smi0099;");
#line 722 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(ActiveDirectory.Context.PrimaryDomain.NetBiosName);
#line default
#line hidden
WriteLiteral("\\rsmith</div>\r\n </div>\r\n");
#line 724 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
break;
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 727 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 695 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 727 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
{
@@ -2035,7 +2159,7 @@ WriteLiteral(" data-val-required=\"Identifiers are required\"");
WriteLiteral("></textarea>\r\n");
#line 699 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 731 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
@@ -2044,73 +2168,46 @@ WriteLiteral("></textarea>\r\n");
WriteLiteral(" </div>\r\n");
#line 701 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 733 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
WriteLiteral(" <script>\r\n $(function () {\r\n var dialog;\r\n\r\n " +
" $(\'#buttonBulkGenerate\').click(function () {\r\n i" +
"f (!dialog) {\r\n dialog = $(\'#dialogBulkGenerate\').dialog(" +
"{\r\n resizable: false,\r\n mo" +
"dal: true,\r\n autoOpen: false,\r\n " +
" width: 460,\r\n buttons: {\r\n " +
" \"Bulk Generate\": function () {\r\n d" +
"ialog.find(\'form\').submit();\r\n dialog.dialog(" +
"\"disable\");\r\n },\r\n " +
" Close: function () {\r\n $(this).dialog(\"close" +
"\");\r\n }\r\n }\r\n " +
" });\r\n\r\n $.validator.unobtrusive.reparse(\'#" +
"inputBulkGenerateDataIds\');\r\n }\r\n\r\n switch" +
" ($(\'#DocumentTemplate_Scope\').val()) {\r\n case \'Device\':\r" +
"\n dialog.find(\'.scopeDescBulkGenerate\').text(\'Device " +
"Serial Numbers\');\r\n dialog.find(\'.example1\').html(\'01" +
"234567<br />ABCD9876<br />8VQ6G2R\');\r\n dialog.find(\'." +
"example2\').text(\'01234567,ABCD9876,8VQ6G2R\');\r\n dialo" +
"g.find(\'.example3\').text(\'01234567;ABCD9876;8VQ6G2R\');\r\n " +
" break;\r\n case \'Job\':\r\n dia" +
"log.find(\'.scopeDescBulkGenerate\').text(\'Job Ids\');\r\n " +
" dialog.find(\'.example1\').html(\'86<br />99<br />44\');\r\n " +
" dialog.find(\'.example2\').text(\'86,99,44\');\r\n dialo" +
"g.find(\'.example3\').text(\'86;99;44\');\r\n break;\r\n " +
" case \'User\':\r\n dialog.find(\'.scope" +
"DescBulkGenerate\').text(\'User Ids\');\r\n dialog.find(\'." +
"example1\').html(\'user6<br />smi0099<br />");
WriteLiteral(@" <script>
$(function () {
var dialog;
$('#buttonBulkGenerate').click(function () {
if (!dialog) {
dialog = $('#dialogBulkGenerate').dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 460,
buttons: {
""Bulk Generate"": function () {
dialog.find('form').submit();
dialog.dialog(""disable"");
},
Close: function () {
$(this).dialog(""close"");
}
}
});
$.validator.unobtrusive.reparse('#inputBulkGenerateDataIds');
}
dialog.dialog('open');
return false;
});
});
</script>
");
#line 742 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(ActiveDirectory.Context.PrimaryDomain.NetBiosName);
#line default
#line hidden
WriteLiteral("\\\\rsmith\');\r\n dialog.find(\'.example2\').text(\'user6,smi" +
"0099,");
#line 743 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(ActiveDirectory.Context.PrimaryDomain.NetBiosName);
#line default
#line hidden
WriteLiteral("\\\\rsmith\');\r\n dialog.find(\'.example3\').text(\'user6;smi" +
"0099;");
#line 744 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(ActiveDirectory.Context.PrimaryDomain.NetBiosName);
#line default
#line hidden
WriteLiteral("\\\\rsmith\');\r\n break;\r\n }\r\n\r\n " +
" dialog.dialog(\'open\');\r\n return false;\r\n " +
" });\r\n });\r\n </script>\r\n");
#line 753 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 764 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
@@ -2119,7 +2216,7 @@ WriteLiteral("\\\\rsmith\');\r\n break;\r\n
WriteLiteral(" ");
#line 754 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 765 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (Authorization.Has(Claims.Config.DocumentTemplate.Delete))
{
@@ -2127,14 +2224,14 @@ WriteLiteral(" ");
#line default
#line hidden
#line 756 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 767 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete"));
#line default
#line hidden
#line 756 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 767 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
@@ -1,6 +1,6 @@
@{
Authorization.Require(Claims.Config.Enrolment.ShowStatus);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment", MVC.Config.Enrolment.Index(), "Status");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -8,101 +8,68 @@
}
<div id="enrolStatus">
<div id="noSessions" data-bind="visible: noSessions">
<h2>
No enrolment sessions today</h2>
<h2>No enrolment sessions today</h2>
</div>
<div id="sessions" data-bind="visible: !noSessions(), foreach: {data: sessions, afterRender: sessionRendered, afterAdd: sessionAdded}"
style="display: none">
<div class="session" data-bind="style: {backgroundImage: deviceModelImageUrl}, click: select">
<div id="sessions" data-bind="visible: !noSessions(), foreach: { data: sessions, afterRender: sessionRendered, afterAdd: sessionAdded }" style="display: none">
<div class="session" data-bind="style: { backgroundImage: deviceModelImageUrl }, click: select">
<h3>
<span data-bind="text: title"></span><span class="details" data-bind="text: '(' + deviceModelDescription() + ')'">
</span>
<span data-bind="text: title"></span>
<span class="details" data-bind="text: '(' + deviceModelDescription() + ')'"></span>
</h3>
<p class="sessionStart" data-bind="text: startTime">
</p>
<p class="sessionStatus" data-bind="text: progressStatus">
</p>
<div data-bind="visible: !sessionEnded(), progressValue: progressValue" class="sessionProgress">
</div>
<p class="sessionStart" data-bind="text: startTime"></p>
<p class="sessionStatus" data-bind="text: progressStatus"></p>
<div data-bind="visible: !sessionEnded(), progressValue: progressValue" class="sessionProgress"></div>
</div>
</div>
<div id="dialogSession" data-bind="with: currentSession">
<div class="sessionHeader clearfix" data-bind="style: {backgroundImage: deviceModelImageUrl}">
<h2>
<a href="" target="_blank" data-bind="text: title, attr: {href: deviceUrl}"></a>
</h2>
<h3 data-bind="text: deviceModelDescription">
</h3>
<div class="sessionHeader clearfix" data-bind="style: { backgroundImage: deviceModelImageUrl }">
<h2><a href="" target="_blank" data-bind="text: title, attr: { href: deviceUrl }"></a></h2>
<h3 data-bind="text: deviceModelDescription"></h3>
<table data-bind="if: sessionDeviceInfo">
<tr>
<th style="width: 128px">
Computer Name:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[3]">
</td>
<th style="width: 128px">Computer Name:</th>
<td data-bind="text: sessionDeviceInfo().Arguments[3]"></td>
</tr>
<tr>
<th style="width: 128px">
UUID:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[2]">
</td>
<th style="width: 128px">UUID:</th>
<td data-bind="text: sessionDeviceInfo().Arguments[2]"></td>
</tr>
<tr>
<th style="width: 128px">
LAN Mac Address:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[4]">
</td>
<th style="width: 128px">LAN Mac Address:</th>
<td data-bind="text: sessionDeviceInfo().Arguments[4]"></td>
</tr>
<tr>
<th style="width: 128px">
WLAN Mac Address:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[5]">
</td>
<th style="width: 128px">WLAN Mac Address:</th>
<td data-bind="text: sessionDeviceInfo().Arguments[5]"></td>
</tr>
<tr>
<th style="width: 128px">
Manufacturer/Model:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[6] + ' ' + sessionDeviceInfo().Arguments[7]">
</td>
<th style="width: 128px">Manufacturer/Model:</th>
<td data-bind="text: sessionDeviceInfo().Arguments[6] + ' ' + sessionDeviceInfo().Arguments[7]"></td>
</tr>
</table>
</div>
<div class="sessionProgress clearfix">
<p class="sessionStart" data-bind="text: startTime">
</p>
<p class="sessionStatus" data-bind="text: progressStatus">
</p>
<div data-bind="visible: !sessionEnded(), progressValue: progressValue">
</div>
<p class="sessionStart" data-bind="text: startTime"></p>
<p class="sessionStatus" data-bind="text: progressStatus"></p>
<div data-bind="visible: !sessionEnded(), progressValue: progressValue"></div>
</div>
<div class="sessionInfoContainer clearfix">
<div class="sessionInfoMessages">
<table class="logEventsViewport">
<thead>
<tr>
<th class="icon">
&nbsp;
</th>
<th class="message">
Message
</th>
<th class="icon">&nbsp;</th>
<th class="message">Message</th>
</tr>
</thead>
</table>
<div class="logEventsViewportContainer">
<div class="logEventsViewportNoLogs" data-bind="visible: messages().length == 0"
style="display: none">
No logs
</div>
<div class="logEventsViewportNoLogs" data-bind="visible: messages().length == 0" style="display: none">No logs</div>
<table class="logEventsViewport" data-bind="visible: messages().length > 0" style="display: none">
<tbody data-bind="foreach: messages">
<tr>
<td class="icon"><i class="fa" data-bind="css: { 'fa-info-circle': EventTypeSeverity == 0, 'fa-exclamation-triangle': EventTypeSeverity == 1, 'fa-exclamation-circle': EventTypeSeverity == 2 }"></i></td>
<td class="message" data-bind="text: FormattedMessage, attr: {title: EventTypeName}"></td>
<td class="message" data-bind="text: FormattedMessage, attr: { title: EventTypeName }"></td>
</tr>
</tbody>
</table>
@@ -294,7 +261,7 @@
function init() {
hostDialogSessions.dialog({
modal: true,
height: 664,
height: 574,
width: 900,
resizable: false,
autoOpen: false
@@ -360,15 +327,35 @@
logHub.client.receiveLog = parseLog
$.connection.hub.qs = { LogModules: '@(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName)' };
$.connection.hub.error(function (error) {
alert('Live-Log Error: ' + error);
});
$.connection.hub.error(onHubFailed);
$.connection.hub.start()
.done(function () { isLive = true; })
.fail(function (error) {
alert('Live-Log Connection Error: ' + error);
});
.fail(onHubFailed);
function onHubFailed(error) {
// Show Dialog Message
if ($('.disconnected-dialog').length == 0) {
$('<div>')
.addClass('dialog disconnected-dialog')
.html('<h3><span class="fa-stack fa-lg"><i class="fa fa-wifi fa-stack-1x"></i><i class="fa fa-ban fa-stack-2x error"></i></span>Disconnected from the Disco ICT Server</h3><div>This page is not receiving live updates. Please ensure you are connected to the server, then refresh this page to enable features.</div>')
.dialog({
resizable: false,
title: 'Disconnected',
width: 400,
modal: true,
buttons: {
'Refresh Now': function () {
$(this).dialog('option', 'buttons', null);
window.location.reload(true);
},
'Close': function () {
$(this).dialog('destroy');
}
}
});
}
}
}
init();
});
@@ -48,7 +48,7 @@ namespace Disco.Web.Areas.Config.Views.Enrolment
#line 1 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Authorization.Require(Claims.Config.Enrolment.ShowStatus);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment", MVC.Config.Enrolment.Index(), "Status");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -67,51 +67,50 @@ WriteLiteral(" id=\"noSessions\"");
WriteLiteral(" data-bind=\"visible: noSessions\"");
WriteLiteral(">\r\n <h2>\r\n No enrolment sessions today</h2>\r\n </div>\r\n <d" +
"iv");
WriteLiteral(">\r\n <h2>No enrolment sessions today</h2>\r\n </div>\r\n <div");
WriteLiteral(" id=\"sessions\"");
WriteLiteral(" data-bind=\"visible: !noSessions(), foreach: {data: sessions, afterRender: sessio" +
"nRendered, afterAdd: sessionAdded}\"");
WriteLiteral(" data-bind=\"visible: !noSessions(), foreach: { data: sessions, afterRender: sessi" +
"onRendered, afterAdd: sessionAdded }\"");
WriteLiteral("\r\n style=\"display: none\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"session\"");
WriteLiteral(" data-bind=\"style: {backgroundImage: deviceModelImageUrl}, click: select\"");
WriteLiteral(" data-bind=\"style: { backgroundImage: deviceModelImageUrl }, click: select\"");
WriteLiteral(">\r\n <h3>\r\n <span");
WriteLiteral(" data-bind=\"text: title\"");
WriteLiteral("></span><span");
WriteLiteral("></span>\r\n <span");
WriteLiteral(" class=\"details\"");
WriteLiteral(" data-bind=\"text: \'(\' + deviceModelDescription() + \')\'\"");
WriteLiteral(">\r\n </span>\r\n </h3>\r\n <p");
WriteLiteral("></span>\r\n </h3>\r\n <p");
WriteLiteral(" class=\"sessionStart\"");
WriteLiteral(" data-bind=\"text: startTime\"");
WriteLiteral(">\r\n </p>\r\n <p");
WriteLiteral("></p>\r\n <p");
WriteLiteral(" class=\"sessionStatus\"");
WriteLiteral(" data-bind=\"text: progressStatus\"");
WriteLiteral(">\r\n </p>\r\n <div");
WriteLiteral("></p>\r\n <div");
WriteLiteral(" data-bind=\"visible: !sessionEnded(), progressValue: progressValue\"");
WriteLiteral(" class=\"sessionProgress\"");
WriteLiteral(">\r\n </div>\r\n </div>\r\n </div>\r\n <div");
WriteLiteral("></div>\r\n </div>\r\n </div>\r\n <div");
WriteLiteral(" id=\"dialogSession\"");
@@ -121,21 +120,21 @@ WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"sessionHeader clearfix\"");
WriteLiteral(" data-bind=\"style: {backgroundImage: deviceModelImageUrl}\"");
WriteLiteral(" data-bind=\"style: { backgroundImage: deviceModelImageUrl }\"");
WriteLiteral(">\r\n <h2>\r\n <a");
WriteLiteral(">\r\n <h2><a");
WriteLiteral(" href=\"\"");
WriteLiteral(" target=\"_blank\"");
WriteLiteral(" data-bind=\"text: title, attr: {href: deviceUrl}\"");
WriteLiteral(" data-bind=\"text: title, attr: { href: deviceUrl }\"");
WriteLiteral("></a>\r\n </h2>\r\n <h3");
WriteLiteral("></a></h2>\r\n <h3");
WriteLiteral(" data-bind=\"text: deviceModelDescription\"");
WriteLiteral(">\r\n </h3>\r\n <table");
WriteLiteral("></h3>\r\n <table");
WriteLiteral(" data-bind=\"if: sessionDeviceInfo\"");
@@ -143,54 +142,45 @@ WriteLiteral(">\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 128px\"");
WriteLiteral(">\r\n Computer Name:\r\n </th>\r\n " +
" <td");
WriteLiteral(">Computer Name:</th>\r\n <td");
WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[3]\"");
WriteLiteral(">\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th");
WriteLiteral("></td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 128px\"");
WriteLiteral(">\r\n UUID:\r\n </th>\r\n " +
"<td");
WriteLiteral(">UUID:</th>\r\n <td");
WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[2]\"");
WriteLiteral(">\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th");
WriteLiteral("></td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 128px\"");
WriteLiteral(">\r\n LAN Mac Address:\r\n </th>\r\n " +
" <td");
WriteLiteral(">LAN Mac Address:</th>\r\n <td");
WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[4]\"");
WriteLiteral(">\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th");
WriteLiteral("></td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 128px\"");
WriteLiteral(">\r\n WLAN Mac Address:\r\n </th>\r\n " +
" <td");
WriteLiteral(">WLAN Mac Address:</th>\r\n <td");
WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[5]\"");
WriteLiteral(">\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th");
WriteLiteral("></td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 128px\"");
WriteLiteral(">\r\n Manufacturer/Model:\r\n </th>\r\n " +
" <td");
WriteLiteral(">Manufacturer/Model:</th>\r\n <td");
WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[6] + \' \' + sessionDeviceInfo().Ar" +
"guments[7]\"");
WriteLiteral(">\r\n </td>\r\n </tr>\r\n </table>\r\n " +
" </div>\r\n <div");
WriteLiteral("></td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div" +
"");
WriteLiteral(" class=\"sessionProgress clearfix\"");
@@ -200,17 +190,17 @@ WriteLiteral(" class=\"sessionStart\"");
WriteLiteral(" data-bind=\"text: startTime\"");
WriteLiteral(">\r\n </p>\r\n <p");
WriteLiteral("></p>\r\n <p");
WriteLiteral(" class=\"sessionStatus\"");
WriteLiteral(" data-bind=\"text: progressStatus\"");
WriteLiteral(">\r\n </p>\r\n <div");
WriteLiteral("></p>\r\n <div");
WriteLiteral(" data-bind=\"visible: !sessionEnded(), progressValue: progressValue\"");
WriteLiteral(">\r\n </div>\r\n </div>\r\n <div");
WriteLiteral("></div>\r\n </div>\r\n <div");
WriteLiteral(" class=\"sessionInfoContainer clearfix\"");
@@ -227,14 +217,12 @@ WriteLiteral(">\r\n <thead>\r\n <tr>\r
WriteLiteral(" class=\"icon\"");
WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n " +
" <th");
WriteLiteral(">&nbsp;</th>\r\n <th");
WriteLiteral(" class=\"message\"");
WriteLiteral(">\r\n Message\r\n </th>\r\n " +
" </tr>\r\n </thead>\r\n </tab" +
"le>\r\n <div");
WriteLiteral(">Message</th>\r\n </tr>\r\n </thead>\r\n " +
" </table>\r\n <div");
WriteLiteral(" class=\"logEventsViewportContainer\"");
@@ -244,10 +232,9 @@ WriteLiteral(" class=\"logEventsViewportNoLogs\"");
WriteLiteral(" data-bind=\"visible: messages().length == 0\"");
WriteLiteral("\r\n style=\"display: none\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n No logs\r\n </div>\r\n " +
" <table");
WriteLiteral(">No logs</div>\r\n <table");
WriteLiteral(" class=\"logEventsViewport\"");
@@ -275,7 +262,7 @@ WriteLiteral("></i></td>\r\n <td");
WriteLiteral(" class=\"message\"");
WriteLiteral(" data-bind=\"text: FormattedMessage, attr: {title: EventTypeName}\"");
WriteLiteral(" data-bind=\"text: FormattedMessage, attr: { title: EventTypeName }\"");
WriteLiteral("></td>\r\n </tr>\r\n </tbody>\r\n " +
" </table>\r\n </div>\r\n </div>\r\n " +
@@ -323,7 +310,7 @@ WriteLiteral(@">
var deviceBaseUrl = '");
#line 140 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 107 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Url.Action(MVC.Device.Show()));
@@ -332,7 +319,7 @@ WriteLiteral(@">
WriteLiteral("/\'\r\n var deviceModelImageUrl = \'");
#line 141 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 108 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Url.Action(MVC.API.DeviceModel.Image()));
@@ -341,7 +328,7 @@ WriteLiteral("/\'\r\n var deviceModelImageUrl = \'");
WriteLiteral("/\'\r\n var iconWarningUrl = \'url(");
#line 142 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 109 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Links.ClientSource.Style.Images.Status.warning32_png);
@@ -350,7 +337,7 @@ WriteLiteral("/\'\r\n var iconWarningUrl = \'url(");
WriteLiteral(")\';\r\n var iconErrorUrl = \'url(");
#line 143 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 110 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Links.ClientSource.Style.Images.Status.fail32_png);
@@ -447,13 +434,13 @@ WriteLiteral(")\';\r\n\r\n function pageViewModel() {\r\n var
"ult:\r\n session.messages.unshift(log);\r\n " +
" }\r\n }\r\n }\r\n }\r\n function init() {\r" +
"\n hostDialogSessions.dialog({\r\n modal: true,\r\n " +
" height: 664,\r\n width: 900,\r\n resizable: fa" +
" height: 574,\r\n width: 900,\r\n resizable: fa" +
"lse,\r\n autoOpen: false\r\n });\r\n //hostDialog" +
"SessionsProgress.progressbar();\r\n\r\n // Create View Model\r\n " +
" vm = new pageViewModel();\r\n $.ajax({\r\n url: \'");
#line 307 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 274 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Url.Action(MVC.API.DeviceModel.Index()));
@@ -487,7 +474,7 @@ WriteLiteral(@"',
url: '");
#line 332 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 299 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
@@ -526,27 +513,32 @@ WriteLiteral(@"',
$.connection.hub.qs = { LogModules: '");
#line 362 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 329 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName);
#line default
#line hidden
WriteLiteral(@"' };
$.connection.hub.error(function (error) {
alert('Live-Log Error: ' + error);
});
$.connection.hub.start()
.done(function () { isLive = true; })
.fail(function (error) {
alert('Live-Log Connection Error: ' + error);
});
}
init();
});
</script>
");
WriteLiteral("\' };\r\n $.connection.hub.error(onHubFailed);\r\n\r\n $.connectio" +
"n.hub.start()\r\n .done(function () { isLive = true; })\r\n " +
" .fail(onHubFailed);\r\n\r\n function onHubFailed(error) {\r\n " +
" // Show Dialog Message\r\n if ($(\'.disconnected-dialog\').le" +
"ngth == 0) {\r\n $(\'<div>\')\r\n .addClass(" +
"\'dialog disconnected-dialog\')\r\n .html(\'<h3><span class=\"f" +
"a-stack fa-lg\"><i class=\"fa fa-wifi fa-stack-1x\"></i><i class=\"fa fa-ban fa-stac" +
"k-2x error\"></i></span>Disconnected from the Disco ICT Server</h3><div>This page" +
" is not receiving live updates. Please ensure you are connected to the server, t" +
"hen refresh this page to enable features.</div>\')\r\n .dial" +
"og({\r\n resizable: false,\r\n " +
" title: \'Disconnected\',\r\n width: 400,\r\n " +
" modal: true,\r\n buttons: {\r\n " +
" \'Refresh Now\': function () {\r\n " +
" $(this).dialog(\'option\', \'buttons\', null);\r\n " +
" window.location.reload(true);\r\n },\r\n " +
" \'Close\': function () {\r\n " +
" $(this).dialog(\'destroy\');\r\n }\r\n " +
" }\r\n });\r\n }\r\n }" +
"\r\n }\r\n init();\r\n });\r\n</script>\r\n");
}
}
@@ -12,5 +12,6 @@
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
}
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.General);
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Reports);
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.RenderPartial(MVC.Config.JobPreferences.Views.Parts.General);
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Reports);
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
@@ -119,8 +119,8 @@
resizable: false,
modal: true,
autoOpen: false,
width: 750,
height: 650,
width: 780,
height: 540,
buttons: {
"Save": save,
Cancel: cancel
@@ -566,7 +566,7 @@
modal: true,
autoOpen: false,
width: 750,
height: 620,
height: 560,
buttons: {
"Save Changes": saveChanges,
Cancel: cancel
@@ -567,8 +567,8 @@ WriteLiteral(" </div>\r\n
" dialog = $(\'#Config_JobQueues_Icon_Update_Dialog\').dialog({\r\n " +
" resizable: false,\r\n " +
" modal: true,\r\n autoOpen: f" +
"alse,\r\n width: 750,\r\n " +
" height: 650,\r\n " +
"alse,\r\n width: 780,\r\n " +
" height: 540,\r\n " +
" buttons: {\r\n \"Save\": save,\r" +
"\n Cancel: cancel\r\n " +
" }\r\n });\r\n\r\n " +
@@ -1741,7 +1741,7 @@ WriteLiteral(" <script>\r\n (function
" resizable: false,\r\n " +
" modal: true,\r\n autoOpen: " +
"false,\r\n width: 750,\r\n " +
" height: 620,\r\n butto" +
" height: 560,\r\n butto" +
"ns: {\r\n \"Save Changes\": saveChanges,\r" +
"\n Cancel: cancel\r\n " +
" }\r\n });\r\n\r\n " +
@@ -120,13 +120,33 @@
};
$.connection.hub.qs = {LogModules: logModuleLiveGroupName};
$.connection.hub.error(function(error){
alert('Live-Log Error: '+error);
});
$.connection.hub.error(onHubFailed);
$.connection.hub.start().fail(function(error){
alert('Live-Log Connection Error: '+error);
});
$.connection.hub.start().fail(onHubFailed);
function onHubFailed(error) {
// Show Dialog Message
if ($('.disconnected-dialog').length == 0) {
$('<div>')
.addClass('dialog disconnected-dialog')
.html('<h3><span class="fa-stack fa-lg"><i class="fa fa-wifi fa-stack-1x"></i><i class="fa fa-ban fa-stack-2x error"></i></span>Disconnected from the Disco ICT Server</h3><div>This page is not receiving live updates. Please ensure you are connected to the server, then refresh this page to enable features.</div>')
.dialog({
resizable: false,
title: 'Disconnected',
width: 400,
modal: true,
buttons: {
'Refresh Now': function () {
$(this).dialog('option', 'buttons', null);
window.location.reload(true);
},
'Close': function () {
$(this).dialog('destroy');
}
}
});
}
}
}
}
@@ -329,12 +329,29 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
"ge.UseDisplay) logsViewModel.EventLogs.unshift(message);\r\n " +
" if (liveEventReceivedFunction) liveEventReceivedFunction(message);\r\n " +
" };\r\n\r\n $.connection.hub.qs = {LogModules: logModule" +
"LiveGroupName};\r\n $.connection.hub.error(function(error){\r\n " +
" alert(\'Live-Log Error: \'+error);\r\n });\r" +
"\n\r\n $.connection.hub.start().fail(function(error){\r\n " +
" alert(\'Live-Log Connection Error: \'+error);\r\n " +
"});\r\n }\r\n }\r\n\r\n loadInitialData();\r\n " +
" });\r\n </script>\r\n</div>\r\n");
"LiveGroupName};\r\n $.connection.hub.error(onHubFailed);\r\n\r\n " +
" $.connection.hub.start().fail(onHubFailed);\r\n\r\n " +
" function onHubFailed(error) {\r\n // Show Dialog Messag" +
"e\r\n if ($(\'.disconnected-dialog\').length == 0) {\r\n " +
" $(\'<div>\')\r\n .addClass(\'dial" +
"og disconnected-dialog\')\r\n .html(\'<h3><span class" +
"=\"fa-stack fa-lg\"><i class=\"fa fa-wifi fa-stack-1x\"></i><i class=\"fa fa-ban fa-s" +
"tack-2x error\"></i></span>Disconnected from the Disco ICT Server</h3><div>This p" +
"age is not receiving live updates. Please ensure you are connected to the server" +
", then refresh this page to enable features.</div>\')\r\n " +
" .dialog({\r\n resizable: false,\r\n " +
" title: \'Disconnected\',\r\n " +
" width: 400,\r\n modal: true,\r\n " +
" buttons: {\r\n \'" +
"Refresh Now\': function () {\r\n $(this)" +
".dialog(\'option\', \'buttons\', null);\r\n " +
" window.location.reload(true);\r\n },\r\n " +
" \'Close\': function () {\r\n " +
" $(this).dialog(\'destroy\');\r\n " +
" }\r\n }\r\n " +
" });\r\n }\r\n }\r\n }\r\n" +
" }\r\n\r\n loadInitialData();\r\n });\r\n </script>\r\n</d" +
"iv>\r\n");
}
}
@@ -247,14 +247,34 @@
notificationsHub.client.updateTaskStatus = vm.Update;
$.connection.hub.qs = { TaskSessionId: sessionId };
$.connection.hub.error(function (error) {
alert('Live-Status Error: ' + error);
});
$.connection.hub.error(onHubFailed);
$.connection.hub.start()
.fail(function (error) {
alert('Live-Status Connection Error: ' + error);
});
.fail(onHubFailed);
}
function onHubFailed(error) {
// Show Dialog Message
if ($('.disconnected-dialog').length == 0) {
$('<div>')
.addClass('dialog disconnected-dialog')
.html('<h3><span class="fa-stack fa-lg"><i class="fa fa-wifi fa-stack-1x"></i><i class="fa fa-ban fa-stack-2x error"></i></span>Disconnected from the Disco ICT Server</h3><div>This page is not receiving live updates. Please ensure you are connected to the server, then refresh this page to enable features.</div>')
.dialog({
resizable: false,
title: 'Disconnected',
width: 400,
modal: true,
buttons: {
'Refresh Now': function () {
$(this).dialog('option', 'buttons', null);
window.location.reload(true);
},
'Close': function () {
$(this).dialog('destroy');
}
}
});
}
}
});
@@ -281,11 +281,24 @@ WriteLiteral("\';\r\n\r\n var view = $(\'#Logging_Task_Status\');\r\n
"n.scheduledTaskNotifications;\r\n notificationsHub.client.initializeTas" +
"kStatus = vm.Initialize;\r\n notificationsHub.client.updateTaskStatus =" +
" vm.Update;\r\n\r\n $.connection.hub.qs = { TaskSessionId: sessionId };\r\n" +
" $.connection.hub.error(function (error) {\r\n alert(\'Li" +
"ve-Status Error: \' + error);\r\n });\r\n\r\n $.connection.hub.st" +
"art()\r\n .fail(function (error) {\r\n alert(\'Live" +
"-Status Connection Error: \' + error);\r\n });\r\n }\r\n\r\n });" +
"\r\n</script>\r\n");
" $.connection.hub.error(onHubFailed);\r\n\r\n $.connection.hub" +
".start()\r\n .fail(onHubFailed);\r\n }\r\n\r\n function onH" +
"ubFailed(error) {\r\n // Show Dialog Message\r\n if ($(\'.disco" +
"nnected-dialog\').length == 0) {\r\n $(\'<div>\')\r\n " +
" .addClass(\'dialog disconnected-dialog\')\r\n .html(\'<h3><span c" +
"lass=\"fa-stack fa-lg\"><i class=\"fa fa-wifi fa-stack-1x\"></i><i class=\"fa fa-ban " +
"fa-stack-2x error\"></i></span>Disconnected from the Disco ICT Server</h3><div>Th" +
"is page is not receiving live updates. Please ensure you are connected to the se" +
"rver, then refresh this page to enable features.</div>\')\r\n .d" +
"ialog({\r\n resizable: false,\r\n titl" +
"e: \'Disconnected\',\r\n width: 400,\r\n " +
" modal: true,\r\n buttons: {\r\n \'" +
"Refresh Now\': function () {\r\n $(this).dialog(\'opt" +
"ion\', \'buttons\', null);\r\n window.location.reload(" +
"true);\r\n },\r\n \'Close\': fun" +
"ction () {\r\n $(this).dialog(\'destroy\');\r\n " +
" }\r\n }\r\n });\r\n " +
" }\r\n }\r\n\r\n });\r\n</script>\r\n");
}
}
@@ -127,8 +127,8 @@
resizable: false,
modal: true,
autoOpen: false,
width: 750,
height: 650,
width: 780,
height: 540,
buttons: {
"Save": save,
Cancel: cancel
@@ -598,8 +598,8 @@ WriteLiteral(" </div>\r\n
" dialog = $(\'#Config_UserFlags_Icon_Update_Dialog\').dialog({\r\n " +
" resizable: false,\r\n " +
" modal: true,\r\n autoOpen: f" +
"alse,\r\n width: 750,\r\n " +
" height: 650,\r\n " +
"alse,\r\n width: 780,\r\n " +
" height: 540,\r\n " +
" buttons: {\r\n \"Save\": save,\r" +
"\n Cancel: cancel\r\n " +
" }\r\n });\r\n\r\n " +
@@ -1,5 +1,8 @@
using Disco.Services.Jobs.Noticeboards;
using Disco.Models.Repository;
using Disco.Services.Jobs.Noticeboards;
using Disco.Services.Web;
using Disco.Web.Areas.Public.Models.UserHeldDevices;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
@@ -7,9 +10,26 @@ namespace Disco.Web.Areas.Public.Controllers
{
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);
}
@@ -38,7 +58,12 @@ namespace Disco.Web.Areas.Public.Controllers
public virtual ActionResult Noticeboard()
{
return View();
var model = new NoticeboardModel()
{
DefaultTheme = Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme
};
return View(model);
}
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.Web.Areas.Public.Models.UserHeldDevices;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
@@ -7,9 +10,26 @@ namespace Disco.Web.Areas.Public.Controllers
{
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);
}
@@ -38,7 +58,12 @@ namespace Disco.Web.Areas.Public.Controllers
public virtual ActionResult Noticeboard()
{
return View();
var model = new NoticeboardModel()
{
DefaultTheme = Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme
};
return View(model);
}
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;
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -13,7 +14,7 @@
<title>Disco ICT - Held Devices</title>
@Html.BundleRenderDeferred()
</head>
<body class="status-connecting">
<body class="theme-@(Model.DefaultTheme) status-connecting">
<div id="page">
<header id="header">
<div id="heading">Held Devices</div>
@@ -92,6 +93,7 @@
var rotateSpeed = 3000;
var itemFilters;
var fixedTheme = null;
var $inProcessList = $('#inProcess').find('ul');
var $readyForReturnList = $('#readyForReturn').find('ul');
@@ -118,11 +120,15 @@
}
function init() {
monitorMouseMove();
applyQueryString();
// Connect to Hub
hub = $.connection.noticeboardUpdates;
// Map Functions
hub.client.updateHeldDevice = updateHeldDevice;
hub.client.setTheme = setTheme;
$.connection.hub.qs = { Noticeboard: '@(Disco.Services.Jobs.Noticeboards.HeldDevices.Name)' };
$.connection.hub.error(connectionError);
@@ -165,7 +171,6 @@
window.setTimeout(scheduleRotation, rotateSpeed);
});
buildFilters();
}
// Called by SignalR
@@ -237,14 +242,53 @@
}, true);
}
function buildFilters() {
var filters = [];
function setTheme(theme) {
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();
if (queryStringParameters !== null) {
var filters = [];
$.each(queryStringParameters, function (key, value) {
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(); });
if (deviceAddresses.length > 0) {
filters.push(function (heldDeviceItem) {
@@ -257,7 +301,7 @@
});
}
break;
case 'deviceaddressexclude':
case 'deviceaddressexclude': // FILTER: Device Address Exclude
var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); });
if (deviceAddresses.length > 0) {
filters.push(function (heldDeviceItem) {
@@ -270,7 +314,7 @@
});
}
break;
case 'deviceprofileinclude':
case 'deviceprofileinclude': // FILTER: Device Profile Include
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
if (deviceProfiles.length > 0) {
filters.push(function (heldDeviceItem) {
@@ -279,7 +323,7 @@
});
}
break;
case 'deviceprofileexclude':
case 'deviceprofileexclude': // FILTER: Device Profile Exclude
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
if (deviceProfiles.length > 0) {
filters.push(function (heldDeviceItem) {
@@ -290,12 +334,12 @@
break;
}
});
}
if (filters.length > 0)
itemFilters = filters;
else
itemFilters = null;
if (filters.length > 0)
itemFilters = filters;
else
itemFilters = null;
}
}
function connectionError() {
@@ -307,7 +351,7 @@
}
window.setTimeout(function () {
window.location.href = window.location.href;
window.location.reload(true);
}, 10000);
}
@@ -36,7 +36,7 @@ namespace Disco.Web.Areas.Public.Views.HeldDevices
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[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()
{
@@ -44,7 +44,7 @@ namespace Disco.Web.Areas.Public.Views.HeldDevices
public override void Execute()
{
#line 1 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
#line 2 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
Layout = null;
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
@@ -70,7 +70,7 @@ WriteLiteral(" />\r\n <title>Disco ICT - Held Devices</title>\r\n");
WriteLiteral(" ");
#line 14 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
#line 15 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
Write(Html.BundleRenderDeferred());
@@ -78,7 +78,17 @@ Write(Html.BundleRenderDeferred());
#line hidden
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");
@@ -219,26 +229,28 @@ WriteLiteral(">\r\n <li data-bind=\"css: { alert: IsAlert }\">\r\n
" else\r\n $(element).livestamp(\'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 var rotateSpeed = 3000" +
";\r\n var itemFilters;\r\n\r\n var $inProcessList = $(\'#inProces" +
"s\').find(\'ul\');\r\n var $readyForReturnList = $(\'#readyForReturn\').find" +
"(\'ul\');\r\n var $waitingForUserActionList = $(\'#waitingForUserAction\')." +
"find(\'ul\');\r\n\r\n function noticeboardViewModel(inProcess, readyForRetu" +
"rn, waitingForUserAction) {\r\n var self = this;\r\n\r\n " +
" self.initialized = false;\r\n\r\n self.inProcess = ko.observableArra" +
"y(inProcess);\r\n self.readyForReturn = ko.observableArray(readyFor" +
"Return);\r\n self.waitingForUserAction = ko.observableArray(waiting" +
"ForUserAction);\r\n\r\n self.onRemove = function (element, index, dat" +
"a) {\r\n $(element).slideUp(400, function () {\r\n " +
" $(this).remove();\r\n });\r\n }\r\n " +
" self.onAdd = function (element, index, data) {\r\n if (" +
"self.initialized)\r\n $(element).hide().slideDown(400);\r\n " +
" }\r\n }\r\n\r\n function init() {\r\n " +
" // Connect to Hub\r\n hub = $.connection.noticeboardUpdates;\r\n\r\n " +
" // Map Functions\r\n hub.client.updateHeldDevice = up" +
"dateHeldDevice;\r\n\r\n $.connection.hub.qs = { Noticeboard: \'");
";\r\n var itemFilters;\r\n var fixedTheme = null;\r\n\r\n " +
" var $inProcessList = $(\'#inProcess\').find(\'ul\');\r\n var $readyForRe" +
"turnList = $(\'#readyForReturn\').find(\'ul\');\r\n var $waitingForUserActi" +
"onList = $(\'#waitingForUserAction\').find(\'ul\');\r\n\r\n function noticebo" +
"ardViewModel(inProcess, readyForReturn, waitingForUserAction) {\r\n " +
" var self = this;\r\n\r\n self.initialized = false;\r\n\r\n " +
" self.inProcess = ko.observableArray(inProcess);\r\n self.readyFor" +
"Return = ko.observableArray(readyForReturn);\r\n self.waitingForUse" +
"rAction = ko.observableArray(waitingForUserAction);\r\n\r\n self.onRe" +
"move = function (element, index, data) {\r\n $(element).slideUp" +
"(400, function () {\r\n $(this).remove();\r\n " +
" });\r\n }\r\n self.onAdd = function (element, inde" +
"x, data) {\r\n if (self.initialized)\r\n $" +
"(element).hide().slideDown(400);\r\n }\r\n }\r\n\r\n " +
" function init() {\r\n monitorMouseMove();\r\n applyQ" +
"ueryString();\r\n\r\n // Connect to Hub\r\n hub = $.conn" +
"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);
@@ -258,7 +270,7 @@ WriteLiteral(@"' };
$.getJSON('");
#line 138 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
#line 144 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
Write(Url.Action(MVC.Public.HeldDevices.HeldDevices()));
@@ -280,136 +292,153 @@ WriteLiteral("\', null, function (data) {\r\n\r\n var inProce
"orUserAction);\r\n\r\n ko.applyBindings(viewModel);\r\n " +
" viewModel.initialized = true;\r\n\r\n $(\'body\').removeCla" +
"ss(\'status-connecting\');\r\n\r\n window.setTimeout(scheduleRotati" +
"on, rotateSpeed);\r\n });\r\n buildFilters();\r\n " +
" }\r\n\r\n // Called by SignalR\r\n function updateHeldDevic" +
"e(updates) {\r\n if (viewModel) {\r\n\r\n $.each(upd" +
"ates, function (deviceSerialNumber, heldDeviceItem) {\r\n /" +
"/ Remove Existing\r\n removeItem(deviceSerialNumber);\r\n\r\n " +
" // Add Item\r\n addItem(heldDeviceIte" +
"m);\r\n });\r\n }\r\n }\r\n\r\n fu" +
"nction removeItem(deviceSerialNumber) {\r\n removeItemFromArray(vie" +
"wModel.inProcess, deviceSerialNumber);\r\n removeItemFromArray(view" +
"Model.readyForReturn, deviceSerialNumber);\r\n removeItemFromArray(" +
"viewModel.waitingForUserAction, deviceSerialNumber);\r\n }\r\n\r\n " +
" function addItem(heldDeviceItem) {\r\n if (heldDeviceItem !== nu" +
"ll &&\r\n heldDeviceItem !== undefined &&\r\n " +
"includeItem(heldDeviceItem)) {\r\n\r\n var array;\r\n\r\n " +
" if (isWaitingForUserAction(heldDeviceItem))\r\n arr" +
"ay = viewModel.waitingForUserAction;\r\n else if (isReadyForRet" +
"urn(heldDeviceItem))\r\n array = viewModel.readyForReturn;\r" +
"\n else if (isInProcess(heldDeviceItem))\r\n " +
" array = viewModel.inProcess;\r\n\r\n if (array().length === 0" +
") {\r\n array.push(heldDeviceItem);\r\n } " +
"else {\r\n var index = findSortedInsertIndex(array, heldDev" +
"iceItem);\r\n if (index === -1)\r\n " +
" array.push(heldDeviceItem);\r\n else\r\n " +
" array.splice(index, 0, heldDeviceItem);\r\n }\r\n " +
" }\r\n }\r\n\r\n function rotateArrays() {\r\n " +
" rotateArray(viewModel.inProcess, $inProcessList);\r\n rotateArr" +
"ay(viewModel.readyForReturn, $readyForReturnList);\r\n rotateArray(" +
"viewModel.waitingForUserAction, $waitingForUserActionList);\r\n }\r\n\r\n " +
" function scheduleRotation() {\r\n rotateArrays();\r\n\r\n " +
" window.setTimeout(scheduleRotation, rotateSpeed);\r\n }\r\n\r\n" +
" function includeItem(heldDeviceItem) {\r\n if (itemFilt" +
"ers == null || itemFilters.length == 0)\r\n return true;\r\n\r\n " +
" return itemFilters.reduce(function (previousValue, currentValue, in" +
"dex, array) {\r\n if (previousValue === false)\r\n " +
" return false;\r\n return currentValue(heldDeviceItem);" +
"\r\n }, true);\r\n }\r\n\r\n function buildFilters(" +
") {\r\n var filters = [];\r\n var queryStringParameter" +
"s = getQueryStringParameters();\r\n\r\n if (queryStringParameters !==" +
" null) {\r\n $.each(queryStringParameters, function (key, value" +
") {\r\n switch (key.toLowerCase()) {\r\n " +
" case \'deviceaddressinclude\':\r\n var deviceA" +
"ddresses = value.split(\",\").map(function (v) { return v.toLowerCase(); });\r\n " +
" if (deviceAddresses.length > 0) {\r\n " +
" filters.push(function (heldDeviceItem) {\r\n " +
" // false if DeviceAddressShortName is null\r\n " +
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
" return false;\r\n\r\n " +
" // true if DeviceAddressShortName is included\r\n " +
" return $.inArray(heldDeviceItem.DeviceAddressShortName.toLower" +
"Case(), deviceAddresses) >= 0;\r\n });\r\n " +
" }\r\n break;\r\n " +
" case \'deviceaddressexclude\':\r\n va" +
"r deviceAddresses = value.split(\",\").map(function (v) { return v.toLowerCase(); " +
"});\r\n if (deviceAddresses.length > 0) {\r\n " +
" filters.push(function (heldDeviceItem) {\r\n " +
" // true if DeviceAddressShortName is null\r\n " +
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
" return true;\r\n\r\n " +
" // true if DeviceAddressShortName is excluded\r\n " +
" return $.inArray(heldDeviceItem.DeviceAddressShortName." +
"toLowerCase(), deviceAddresses) < 0;\r\n });\r\n " +
" }\r\n break;\r\n " +
" case \'deviceprofileinclude\':\r\n " +
" var deviceProfiles = value.split(\",\").map(function (v) { return parseInt(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.DeviceProfileId, d" +
"eviceProfiles) >= 0;\r\n });\r\n " +
" }\r\n break;\r\n " +
" case \'deviceprofileexclude\':\r\n var devicePr" +
"ofiles = value.split(\",\").map(function (v) { return parseInt(v); });\r\n " +
" if (deviceProfiles.length > 0) {\r\n " +
" filters.push(function (heldDeviceItem) {\r\n " +
" // true if DeviceProfileId is excluded\r\n " +
" return $.inArray(heldDeviceItem.DeviceProfileId, deviceProfiles) <" +
" 0;\r\n });\r\n }\r" +
"\n break;\r\n }\r\n " +
" });\r\n }\r\n\r\n if (filters.length > 0)\r\n " +
" itemFilters = filters;\r\n else\r\n " +
" itemFilters = null;\r\n }\r\n\r\n function connectionError() {\r" +
"\n try {\r\n $(\'body\').addClass(\'status-error\');\r" +
"\n $.connection.hub.stop();\r\n } catch (e) {\r\n " +
" // Ignore\r\n }\r\n\r\n window.setTime" +
"out(function () {\r\n window.location.href = window.location.hr" +
"ef;\r\n }, 10000);\r\n }\r\n\r\n // Helpers\r\n " +
" function rotateArray(koArray, element) {\r\n var items = koAr" +
"ray();\r\n\r\n if (items.length <= 1)\r\n return 0;\r" +
"\n\r\n if (element.height() < (element.parent().height() - 30)) {\r\n\r" +
"\n if (findUnsortedArrayTopIndex(items) !== 0)\r\n " +
" koArray.sort(sortFunction);\r\n\r\n // Don\'t rotate if " +
"small & sorted correctly\r\n return;\r\n }\r\n\r\n " +
" // Move Last Item to Top\r\n var item = koArray.pop();\r" +
"\n koArray.unshift(item);\r\n }\r\n function rem" +
"oveItemFromArray(koArray, deviceSerialNumber) {\r\n var items = koA" +
"rray();\r\n for (var i = 0; i < items.length; i++) {\r\n " +
" if (items[i].DeviceSerialNumber == deviceSerialNumber) {\r\n " +
" koArray.splice(i, 1);\r\n items = koArray();\r\n " +
" i--;\r\n }\r\n }\r\n " +
"}\r\n function findUnsortedArrayTopIndex(items) {\r\n // O" +
"nly one Item\r\n if (items.length <= 1)\r\n return" +
" 0;\r\n\r\n for (var i = 1; i < items.length; 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 retu" +
"rn 0;\r\n }\r\n function findSortedInsertIndex(koArray, heldDe" +
"viceItem) {\r\n var items = koArray();\r\n var startIn" +
"dex = findUnsortedArrayTopIndex(items);\r\n for (var i = startIndex" +
"; i < items.length; i++) {\r\n var s = sortFunction(heldDeviceI" +
"tem, items[i]);\r\n if (s <= 0)\r\n return" +
" i;\r\n }\r\n if (startIndex !== 0) {\r\n " +
" for (var i = 0; i < startIndex; i++) {\r\n var s = sor" +
"tFunction(heldDeviceItem, items[i]);\r\n if (s <= 0)\r\n " +
" return i;\r\n }\r\n ret" +
"urn startIndex;\r\n } else {\r\n return -1;\r\n " +
" }\r\n }\r\n function sortFunction(l, r) {\r\n " +
" return l.DeviceDescription.toLowerCase() == r.DeviceDescription.toLowerC" +
"ase() ? 0 : (l.DeviceDescription.toLowerCase() < r.DeviceDescription.toLowerCase" +
"() ? -1 : 1)\r\n }\r\n function isInProcess(i) {\r\n " +
" return !i.ReadyForReturn && !i.WaitingForUserAction;\r\n }\r\n " +
" function isReadyForReturn(i) {\r\n return i.ReadyForReturn && " +
"!i.WaitingForUserAction;\r\n }\r\n function isWaitingForUserAc" +
"tion(i) {\r\n return i.WaitingForUserAction;\r\n }\r\n " +
" function getQueryStringParameters() {\r\n\r\n if (window.locati" +
"on.search.length === 0)\r\n return null;\r\n\r\n var" +
" params = {};\r\n window.location.search.substr(1).split(\"&\").forEa" +
"ch(function (pair) {\r\n if (pair === \"\") return;\r\n " +
" var parts = pair.split(\"=\");\r\n params[parts[0]] = par" +
"ts[1] && decodeURIComponent(parts[1].replace(/\\+/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>");
"on, rotateSpeed);\r\n });\r\n }\r\n\r\n // Called b" +
"y SignalR\r\n function updateHeldDevice(updates) {\r\n if " +
"(viewModel) {\r\n\r\n $.each(updates, function (deviceSerialNumbe" +
"r, heldDeviceItem) {\r\n // Remove Existing\r\n " +
" removeItem(deviceSerialNumber);\r\n\r\n // Add Item" +
"\r\n addItem(heldDeviceItem);\r\n });\r\n " +
" }\r\n }\r\n\r\n function removeItem(deviceSerialNum" +
"ber) {\r\n removeItemFromArray(viewModel.inProcess, deviceSerialNum" +
"ber);\r\n removeItemFromArray(viewModel.readyForReturn, deviceSeria" +
"lNumber);\r\n removeItemFromArray(viewModel.waitingForUserAction, d" +
"eviceSerialNumber);\r\n }\r\n\r\n function addItem(heldDeviceIte" +
"m) {\r\n if (heldDeviceItem !== null &&\r\n heldDe" +
"viceItem !== undefined &&\r\n includeItem(heldDeviceItem)) {\r\n\r" +
"\n var array;\r\n\r\n if (isWaitingForUserActio" +
"n(heldDeviceItem))\r\n array = viewModel.waitingForUserActi" +
"on;\r\n else if (isReadyForReturn(heldDeviceItem))\r\n " +
" array = viewModel.readyForReturn;\r\n else if (isI" +
"nProcess(heldDeviceItem))\r\n array = viewModel.inProcess;\r" +
"\n\r\n if (array().length === 0) {\r\n arra" +
"y.push(heldDeviceItem);\r\n } else {\r\n v" +
"ar index = findSortedInsertIndex(array, heldDeviceItem);\r\n " +
" if (index === -1)\r\n array.push(heldDeviceItem);\r\n " +
" else\r\n array.splice(index, 0, h" +
"eldDeviceItem);\r\n }\r\n }\r\n }\r\n\r\n " +
" function rotateArrays() {\r\n rotateArray(viewModel.inProce" +
"ss, $inProcessList);\r\n rotateArray(viewModel.readyForReturn, $rea" +
"dyForReturnList);\r\n rotateArray(viewModel.waitingForUserAction, $" +
"waitingForUserActionList);\r\n }\r\n\r\n function scheduleRotati" +
"on() {\r\n rotateArrays();\r\n\r\n window.setTimeout(sch" +
"eduleRotation, rotateSpeed);\r\n }\r\n\r\n function includeItem(" +
"heldDeviceItem) {\r\n if (itemFilters == null || itemFilters.length" +
" == 0)\r\n return true;\r\n\r\n return itemFilters.r" +
"educe(function (previousValue, currentValue, index, array) {\r\n " +
" if (previousValue === false)\r\n return false;\r\n " +
" return currentValue(heldDeviceItem);\r\n }, true);\r\n " +
" }\r\n\r\n function setTheme(theme) {\r\n if (!!fixed" +
"Theme)\r\n return;\r\n\r\n var $body = $(document.bo" +
"dy);\r\n\r\n // Existing classes\r\n var c = $body.attr(" +
"\'class\').split(\' \');\r\n // Remove existing theme\r\n " +
"c = $.grep(c, function (i) { return (i.indexOf(\'theme-\') !== 0) });\r\n\r\n " +
" c.push(\'theme-\' + theme);\r\n\r\n $body.attr(\'class\', c.join(\'" +
" \'));\r\n }\r\n\r\n function monitorMouseMove() {\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\', \'auto\');\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 " +
" return $.inArray(heldDeviceItem.DeviceAddr" +
"essShortName.toLowerCase(), deviceAddresses) >= 0;\r\n " +
" });\r\n }\r\n " +
"break;\r\n case \'deviceaddressexclude\': // FILTER: Devi" +
"ce 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 " +
" // true if DeviceAddressShortName is null\r\n " +
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
" return true;\r\n\r\n // true " +
"if DeviceAddressShortName is excluded\r\n r" +
"eturn $.inArray(heldDeviceItem.DeviceAddressShortName.toLowerCase(), deviceAddre" +
"sses) < 0;\r\n });\r\n " +
" }\r\n break;\r\n case" +
" \'deviceprofileinclude\': // FILTER: Device Profile Include\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 " +
" case \'deviceprofileexclude\': // FILTER: Device Profile Exclude\r\n " +
" var deviceProfiles = value.split(\",\").map(function" +
" (v) { return parseInt(v); });\r\n if (deviceProfil" +
"es.length > 0) {\r\n filters.push(function (hel" +
"dDeviceItem) {\r\n // true if DeviceProfile" +
"Id is excluded\r\n return $.inArray(heldDev" +
"iceItem.DeviceProfileId, deviceProfiles) < 0;\r\n " +
" });\r\n }\r\n break" +
";\r\n }\r\n });\r\n\r\n if " +
"(filters.length > 0)\r\n itemFilters = filters;\r\n " +
" else\r\n itemFilters = null;\r\n }\r\n" +
" }\r\n\r\n function connectionError() {\r\n try {" +
"\r\n $(\'body\').addClass(\'status-error\');\r\n $" +
".connection.hub.stop();\r\n } catch (e) {\r\n // I" +
"gnore\r\n }\r\n\r\n window.setTimeout(function () {\r\n " +
" window.location.reload(true);\r\n }, 10000);\r\n " +
" }\r\n\r\n // Helpers\r\n function rotateArray(koArray, e" +
"lement) {\r\n var items = koArray();\r\n\r\n if (items.l" +
"ength <= 1)\r\n return 0;\r\n\r\n if (element.height" +
"() < (element.parent().height() - 30)) {\r\n\r\n if (findUnsorted" +
"ArrayTopIndex(items) !== 0)\r\n koArray.sort(sortFunction);" +
"\r\n\r\n // Don\'t rotate if small & sorted correctly\r\n " +
" return;\r\n }\r\n\r\n // Move Last Item to Top\r" +
"\n var item = koArray.pop();\r\n koArray.unshift(item" +
");\r\n }\r\n function removeItemFromArray(koArray, deviceSeria" +
"lNumber) {\r\n var items = koArray();\r\n for (var i =" +
" 0; i < items.length; i++) {\r\n if (items[i].DeviceSerialNumbe" +
"r == deviceSerialNumber) {\r\n koArray.splice(i, 1);\r\n " +
" items = koArray();\r\n i--;\r\n " +
" }\r\n }\r\n }\r\n function findUnsortedA" +
"rrayTopIndex(items) {\r\n // Only one Item\r\n if (ite" +
"ms.length <= 1)\r\n return 0;\r\n\r\n for (var i = 1" +
"; i < items.length; 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 fun" +
"ction findSortedInsertIndex(koArray, heldDeviceItem) {\r\n var item" +
"s = koArray();\r\n var startIndex = findUnsortedArrayTopIndex(items" +
");\r\n for (var i = startIndex; i < items.length; i++) {\r\n " +
" var s = sortFunction(heldDeviceItem, items[i]);\r\n " +
"if (s <= 0)\r\n return i;\r\n }\r\n " +
" if (startIndex !== 0) {\r\n for (var i = 0; i < startIndex; " +
"i++) {\r\n var s = sortFunction(heldDeviceItem, items[i]);\r" +
"\n if (s <= 0)\r\n return i;\r\n " +
" }\r\n return startIndex;\r\n } el" +
"se {\r\n return -1;\r\n }\r\n }\r\n " +
" function sortFunction(l, r) {\r\n return l.DeviceDescription.to" +
"LowerCase() == r.DeviceDescription.toLowerCase() ? 0 : (l.DeviceDescription.toLo" +
"werCase() < r.DeviceDescription.toLowerCase() ? -1 : 1)\r\n }\r\n " +
" function isInProcess(i) {\r\n return !i.ReadyForReturn && !i.Wa" +
"itingForUserAction;\r\n }\r\n function isReadyForReturn(i) {\r\n" +
" return i.ReadyForReturn && !i.WaitingForUserAction;\r\n " +
" }\r\n function isWaitingForUserAction(i) {\r\n return i.W" +
"aitingForUserAction;\r\n }\r\n function getQueryStringParamete" +
"rs() {\r\n\r\n if (window.location.search.length === 0)\r\n " +
" return null;\r\n\r\n var params = {};\r\n window" +
".location.search.substr(1).split(\"&\").forEach(function (pair) {\r\n " +
" if (pair === \"\") return;\r\n var parts = pair.split(\"=\");\r" +
"\n params[parts[0]] = parts[1] && decodeURIComponent(parts[1]." +
"replace(/\\+/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>");
}
}
@@ -1,4 +1,5 @@
@{
@model Disco.Web.Areas.Public.Models.UserHeldDevices.NoticeboardModel
@{
Layout = null;
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -13,7 +14,7 @@
<title>Disco ICT - Held Devices for Users</title>
@Html.BundleRenderDeferred()
</head>
<body class="status-connecting">
<body class="theme-@(Model.DefaultTheme) status-connecting">
<div id="page">
<header id="header">
<div id="heading">Held Devices for Users</div>
@@ -92,6 +93,7 @@
var rotateSpeed = 3000;
var itemFilters;
var fixedTheme = null;
var $inProcessList = $('#inProcess').find('ul');
var $readyForReturnList = $('#readyForReturn').find('ul');
@@ -118,11 +120,15 @@
}
function init() {
monitorMouseMove();
applyQueryString();
// Connect to Hub
hub = $.connection.noticeboardUpdates;
// Map Functions
hub.client.updateHeldDeviceForUser = updateHeldDevice;
hub.client.setTheme = setTheme;
$.connection.hub.qs = { Noticeboard: '@(Disco.Services.Jobs.Noticeboards.HeldDevicesForUsers.Name)' };
$.connection.hub.error(connectionError);
@@ -165,7 +171,6 @@
window.setTimeout(scheduleRotation, rotateSpeed);
});
buildFilters();
}
// Called by SignalR
@@ -237,14 +242,53 @@
}, true);
}
function buildFilters() {
var filters = [];
function setTheme(theme) {
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();
if (queryStringParameters !== null) {
var filters = [];
$.each(queryStringParameters, function (key, value) {
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(); });
if (deviceAddresses.length > 0) {
filters.push(function (heldDeviceItem) {
@@ -257,7 +301,7 @@
});
}
break;
case 'deviceaddressexclude':
case 'deviceaddressexclude': // FILTER: Device Address Exclude
var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); });
if (deviceAddresses.length > 0) {
filters.push(function (heldDeviceItem) {
@@ -270,7 +314,7 @@
});
}
break;
case 'deviceprofileinclude':
case 'deviceprofileinclude': // FILTER: Device Profile Include
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
if (deviceProfiles.length > 0) {
filters.push(function (heldDeviceItem) {
@@ -279,7 +323,7 @@
});
}
break;
case 'deviceprofileexclude':
case 'deviceprofileexclude': // FILTER: Device Profile Exclude
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
if (deviceProfiles.length > 0) {
filters.push(function (heldDeviceItem) {
@@ -290,12 +334,12 @@
break;
}
});
}
if (filters.length > 0)
itemFilters = filters;
else
itemFilters = null;
if (filters.length > 0)
itemFilters = filters;
else
itemFilters = null;
}
}
function connectionError() {
@@ -307,7 +351,7 @@
}
window.setTimeout(function () {
window.location.href = window.location.href;
window.location.reload(true);
}, 10000);
}
@@ -403,4 +447,4 @@
});
</script>
</body>
</html>
</html>
@@ -36,7 +36,7 @@ namespace Disco.Web.Areas.Public.Views.UserHeldDevices
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[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()
{
@@ -44,7 +44,7 @@ namespace Disco.Web.Areas.Public.Views.UserHeldDevices
public override void Execute()
{
#line 1 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
#line 2 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
Layout = null;
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
@@ -70,7 +70,7 @@ WriteLiteral(" />\r\n <title>Disco ICT - Held Devices for Users</title>\r\n")
WriteLiteral(" ");
#line 14 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
#line 15 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
Write(Html.BundleRenderDeferred());
@@ -78,7 +78,17 @@ Write(Html.BundleRenderDeferred());
#line hidden
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");
@@ -219,27 +229,29 @@ WriteLiteral(">\r\n <li data-bind=\"css: { alert: IsAlert }\">\r\n
"p(valueUnwrapped);\r\n else\r\n $(element).livesta" +
"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 " +
" var rotateSpeed = 3000;\r\n var itemFilters;\r\n\r\n var $inPro" +
"cessList = $(\'#inProcess\').find(\'ul\');\r\n var $readyForReturnList = $(" +
"\'#readyForReturn\').find(\'ul\');\r\n var $waitingForUserActionList = $(\'#" +
"waitingForUserAction\').find(\'ul\');\r\n\r\n function noticeboardViewModel(" +
"inProcess, readyForReturn, waitingForUserAction) {\r\n var self = t" +
"his;\r\n\r\n self.initialized = false;\r\n\r\n self.inProc" +
"ess = ko.observableArray(inProcess);\r\n self.readyForReturn = ko.o" +
"bservableArray(readyForReturn);\r\n self.waitingForUserAction = ko." +
"observableArray(waitingForUserAction);\r\n\r\n self.onRemove = functi" +
"on (element, index, data) {\r\n $(element).slideUp(400, functio" +
"n () {\r\n $(this).remove();\r\n });\r\n " +
" }\r\n self.onAdd = function (element, index, data) {\r\n " +
" if (self.initialized)\r\n $(element).hid" +
"e().slideDown(400);\r\n }\r\n }\r\n\r\n function in" +
"it() {\r\n // Connect to Hub\r\n hub = $.connection.no" +
"ticeboardUpdates;\r\n\r\n // Map Functions\r\n hub.clien" +
"t.updateHeldDeviceForUser = updateHeldDevice;\r\n\r\n $.connection.hu" +
"b.qs = { Noticeboard: \'");
" var rotateSpeed = 3000;\r\n var itemFilters;\r\n var fixedThe" +
"me = null;\r\n\r\n var $inProcessList = $(\'#inProcess\').find(\'ul\');\r\n " +
" var $readyForReturnList = $(\'#readyForReturn\').find(\'ul\');\r\n " +
"var $waitingForUserActionList = $(\'#waitingForUserAction\').find(\'ul\');\r\n\r\n " +
" function noticeboardViewModel(inProcess, readyForReturn, waitingForUserAct" +
"ion) {\r\n var self = this;\r\n\r\n self.initialized = f" +
"alse;\r\n\r\n self.inProcess = ko.observableArray(inProcess);\r\n " +
" self.readyForReturn = ko.observableArray(readyForReturn);\r\n " +
" self.waitingForUserAction = ko.observableArray(waitingForUserAction);\r\n\r\n " +
" self.onRemove = function (element, index, data) {\r\n " +
" $(element).slideUp(400, function () {\r\n $(this).remo" +
"ve();\r\n });\r\n }\r\n self.onAdd = " +
"function (element, index, data) {\r\n if (self.initialized)\r\n " +
" $(element).hide().slideDown(400);\r\n }\r\n " +
" }\r\n\r\n function init() {\r\n monitorMouseMove();\r" +
"\n applyQueryString();\r\n\r\n // Connect to Hub\r\n " +
" hub = $.connection.noticeboardUpdates;\r\n\r\n // Map Func" +
"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);
@@ -259,7 +271,7 @@ WriteLiteral(@"' };
$.getJSON('");
#line 138 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
#line 144 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
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 " +
" viewModel.initialized = true;\r\n\r\n $(\'body\').removeCla" +
"ss(\'status-connecting\');\r\n\r\n window.setTimeout(scheduleRotati" +
"on, rotateSpeed);\r\n });\r\n buildFilters();\r\n " +
" }\r\n\r\n // Called by SignalR\r\n function updateHeldDevic" +
"e(updates) {\r\n if (viewModel) {\r\n\r\n $.each(upd" +
"ates, function (UserId, heldDeviceItem) {\r\n // Remove Exi" +
"sting\r\n removeItem(UserId);\r\n\r\n //" +
" Add Item\r\n addItem(heldDeviceItem);\r\n " +
" });\r\n }\r\n }\r\n\r\n function removeItem(UserId" +
") {\r\n removeItemFromArray(viewModel.inProcess, UserId);\r\n " +
" removeItemFromArray(viewModel.readyForReturn, UserId);\r\n " +
"removeItemFromArray(viewModel.waitingForUserAction, UserId);\r\n }\r\n\r\n " +
" function addItem(heldDeviceItem) {\r\n if (heldDeviceIte" +
"m !== null &&\r\n heldDeviceItem !== undefined &&\r\n " +
" includeItem(heldDeviceItem)) {\r\n\r\n var array;\r\n\r\n " +
" if (isWaitingForUserAction(heldDeviceItem))\r\n " +
" array = viewModel.waitingForUserAction;\r\n else if (isRea" +
"dyForReturn(heldDeviceItem))\r\n array = viewModel.readyFor" +
"Return;\r\n else if (isInProcess(heldDeviceItem))\r\n " +
" array = viewModel.inProcess;\r\n\r\n if (array().leng" +
"th === 0) {\r\n array.push(heldDeviceItem);\r\n " +
" } else {\r\n var index = findSortedInsertIndex(array," +
" heldDeviceItem);\r\n if (index === -1)\r\n " +
" array.push(heldDeviceItem);\r\n else\r\n " +
" array.splice(index, 0, heldDeviceItem);\r\n }\r" +
"\n }\r\n }\r\n\r\n function rotateArrays() {\r\n " +
" rotateArray(viewModel.inProcess, $inProcessList);\r\n r" +
"otateArray(viewModel.readyForReturn, $readyForReturnList);\r\n rota" +
"teArray(viewModel.waitingForUserAction, $waitingForUserActionList);\r\n " +
" }\r\n\r\n function scheduleRotation() {\r\n rotateArrays();" +
"\r\n\r\n window.setTimeout(scheduleRotation, rotateSpeed);\r\n " +
" }\r\n\r\n function includeItem(heldDeviceItem) {\r\n if (" +
"itemFilters == null || itemFilters.length == 0)\r\n return true" +
";\r\n\r\n return itemFilters.reduce(function (previousValue, currentV" +
"alue, index, array) {\r\n if (previousValue === false)\r\n " +
" return false;\r\n return currentValue(heldDevi" +
"ceItem);\r\n }, true);\r\n }\r\n\r\n function build" +
"Filters() {\r\n var filters = [];\r\n var queryStringP" +
"arameters = getQueryStringParameters();\r\n\r\n if (queryStringParame" +
"ters !== null) {\r\n $.each(queryStringParameters, function (ke" +
"y, value) {\r\n switch (key.toLowerCase()) {\r\n " +
" case \'deviceaddressinclude\':\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 " +
" // false if DeviceAddressShortName is null\r\n " +
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
" return false;\r\n\r\n " +
" // true if DeviceAddressShortName is included\r\n " +
" return $.inArray(heldDeviceItem.DeviceAddressShortName" +
".toLowerCase(), deviceAddresses) >= 0;\r\n });\r" +
"\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 " +
" case \'deviceprofileexclude\':\r\n var " +
"deviceProfiles = value.split(\",\").map(function (v) { return parseInt(v); });\r\n " +
" if (deviceProfiles.length > 0) {\r\n " +
" filters.push(function (heldDeviceItem) {\r\n " +
" // true if DeviceProfileId is excluded\r\n " +
" return $.inArray(heldDeviceItem.DeviceProfileId, devicePro" +
"files) < 0;\r\n });\r\n " +
" }\r\n break;\r\n }\r\n " +
" });\r\n }\r\n\r\n if (filters.length > 0" +
")\r\n itemFilters = filters;\r\n else\r\n " +
" itemFilters = null;\r\n }\r\n\r\n function connectionEr" +
"ror() {\r\n try {\r\n $(\'body\').addClass(\'status-e" +
"rror\');\r\n $.connection.hub.stop();\r\n } catch (" +
"e) {\r\n // Ignore\r\n }\r\n\r\n window" +
".setTimeout(function () {\r\n window.location.href = window.loc" +
"ation.href;\r\n }, 10000);\r\n }\r\n\r\n // Helpers" +
"\r\n function rotateArray(koArray, element) {\r\n var item" +
"s = koArray();\r\n\r\n if (items.length <= 1)\r\n re" +
"turn 0;\r\n\r\n if (element.height() < (element.parent().height() - 3" +
"0)) {\r\n\r\n if (findUnsortedArrayTopIndex(items) !== 0)\r\n " +
" koArray.sort(sortFunction);\r\n\r\n // Don\'t ro" +
"tate if small & sorted correctly\r\n return;\r\n }" +
"\r\n\r\n // Move Last Item to Top\r\n var item = koArray" +
".pop();\r\n koArray.unshift(item);\r\n }\r\n func" +
"tion removeItemFromArray(koArray, UserId) {\r\n var items = koArray" +
"();\r\n for (var i = 0; i < items.length; i++) {\r\n " +
" if (items[i].UserId == UserId) {\r\n koArray.splice(i, 1" +
");\r\n items = koArray();\r\n i--;\r\n " +
" }\r\n }\r\n }\r\n function find" +
"UnsortedArrayTopIndex(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.length; i++) {\r\n var s = sortFunction(it" +
"ems[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 findSortedInsertIndex(koArray, heldDeviceItem) {\r\n " +
" var items = koArray();\r\n var startIndex = findUnsortedArrayTopIn" +
"dex(items);\r\n for (var i = startIndex; i < items.length; i++) {\r\n" +
" var s = sortFunction(heldDeviceItem, items[i]);\r\n " +
" if (s <= 0)\r\n return i;\r\n }\r\n " +
" if (startIndex !== 0) {\r\n for (var i = 0; i < sta" +
"rtIndex; i++) {\r\n var s = sortFunction(heldDeviceItem, it" +
"ems[i]);\r\n if (s <= 0)\r\n retur" +
"n i;\r\n }\r\n return startIndex;\r\n " +
" } else {\r\n return -1;\r\n }\r\n }\r" +
"\n function sortFunction(l, r) {\r\n return l.UserIdFrien" +
"dly.toLowerCase() == r.UserIdFriendly.toLowerCase() ? 0 : (l.UserIdFriendly.toLo" +
"werCase() < r.UserIdFriendly.toLowerCase() ? -1 : 1)\r\n }\r\n " +
" function isInProcess(i) {\r\n return !i.ReadyForReturn && !i.Waiti" +
"ngForUserAction;\r\n }\r\n function isReadyForReturn(i) {\r\n " +
" return i.ReadyForReturn && !i.WaitingForUserAction;\r\n }\r" +
"\n function isWaitingForUserAction(i) {\r\n return i.Wait" +
"ingForUserAction;\r\n }\r\n function getQueryStringParameters(" +
") {\r\n\r\n if (window.location.search.length === 0)\r\n " +
" return null;\r\n\r\n var params = {};\r\n window.lo" +
"cation.search.substr(1).split(\"&\").forEach(function (pair) {\r\n " +
" if (pair === \"\") return;\r\n var parts = pair.split(\"=\");\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>");
"on, rotateSpeed);\r\n });\r\n }\r\n\r\n // Called b" +
"y SignalR\r\n function updateHeldDevice(updates) {\r\n if " +
"(viewModel) {\r\n\r\n $.each(updates, function (UserId, heldDevic" +
"eItem) {\r\n // Remove Existing\r\n re" +
"moveItem(UserId);\r\n\r\n // Add Item\r\n " +
" addItem(heldDeviceItem);\r\n });\r\n }\r\n " +
" }\r\n\r\n function removeItem(UserId) {\r\n removeItemFr" +
"omArray(viewModel.inProcess, UserId);\r\n removeItemFromArray(viewM" +
"odel.readyForReturn, UserId);\r\n removeItemFromArray(viewModel.wai" +
"tingForUserAction, UserId);\r\n }\r\n\r\n function addItem(heldD" +
"eviceItem) {\r\n if (heldDeviceItem !== null &&\r\n " +
" heldDeviceItem !== undefined &&\r\n includeItem(heldDeviceIte" +
"m)) {\r\n\r\n var array;\r\n\r\n if (isWaitingForU" +
"serAction(heldDeviceItem))\r\n array = viewModel.waitingFor" +
"UserAction;\r\n else if (isReadyForReturn(heldDeviceItem))\r\n " +
" array = viewModel.readyForReturn;\r\n else" +
" if (isInProcess(heldDeviceItem))\r\n array = viewModel.inP" +
"rocess;\r\n\r\n if (array().length === 0) {\r\n " +
" array.push(heldDeviceItem);\r\n } else {\r\n " +
" var index = findSortedInsertIndex(array, heldDeviceItem);\r\n " +
" if (index === -1)\r\n array.push(heldDeviceIt" +
"em);\r\n else\r\n array.splice(ind" +
"ex, 0, heldDeviceItem);\r\n }\r\n }\r\n }" +
"\r\n\r\n function rotateArrays() {\r\n rotateArray(viewModel" +
".inProcess, $inProcessList);\r\n rotateArray(viewModel.readyForRetu" +
"rn, $readyForReturnList);\r\n rotateArray(viewModel.waitingForUserA" +
"ction, $waitingForUserActionList);\r\n }\r\n\r\n function schedu" +
"leRotation() {\r\n rotateArrays();\r\n\r\n window.setTim" +
"eout(scheduleRotation, rotateSpeed);\r\n }\r\n\r\n function incl" +
"udeItem(heldDeviceItem) {\r\n if (itemFilters == null || itemFilter" +
"s.length == 0)\r\n return true;\r\n\r\n return itemF" +
"ilters.reduce(function (previousValue, currentValue, index, array) {\r\n " +
" if (previousValue === false)\r\n return false;\r\n " +
" return currentValue(heldDeviceItem);\r\n }, true" +
");\r\n }\r\n\r\n function setTheme(theme) {\r\n if " +
"(!!fixedTheme)\r\n return;\r\n\r\n var $body = $(doc" +
"ument.body);\r\n\r\n // Existing classes\r\n var c = $bo" +
"dy.attr(\'class\').split(\' \');\r\n // Remove existing theme\r\n " +
" c = $.grep(c, function (i) { return (i.indexOf(\'theme-\') !== 0) });\r\n\r\n " +
" c.push(\'theme-\' + theme);\r\n\r\n $body.attr(\'class\', " +
"c.join(\' \'));\r\n }\r\n\r\n function monitorMouseMove() {\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 " +
" // true if DeviceAddressShortName is null\r\n " +
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
" return true;\r\n\r\n " +
"// true if DeviceAddressShortName is excluded\r\n " +
" return $.inArray(heldDeviceItem.DeviceAddressShortName.toLowerCase(), dev" +
"iceAddresses) < 0;\r\n });\r\n " +
" }\r\n break;\r\n " +
" case \'deviceprofileinclude\': // FILTER: Device Profile Include\r\n " +
" var deviceProfiles = value.split(\",\").map(function (v) { ret" +
"urn parseInt(v); });\r\n if (deviceProfiles.length " +
"> 0) {\r\n filters.push(function (heldDeviceIte" +
"m) {\r\n // true if DeviceProfileId is incl" +
"uded\r\n return $.inArray(heldDeviceItem.De" +
"viceProfileId, deviceProfiles) >= 0;\r\n });\r\n " +
" }\r\n break;\r\n " +
" case \'deviceprofileexclude\': // FILTER: Device Profile Exc" +
"lude\r\n var deviceProfiles = value.split(\",\").map(" +
"function (v) { return parseInt(v); });\r\n if (devi" +
"ceProfiles.length > 0) {\r\n filters.push(funct" +
"ion (heldDeviceItem) {\r\n // true if Devic" +
"eProfileId is excluded\r\n return $.inArray" +
"(heldDeviceItem.DeviceProfileId, deviceProfiles) < 0;\r\n " +
" });\r\n }\r\n " +
" break;\r\n }\r\n });\r\n\r\n " +
" if (filters.length > 0)\r\n itemFilters = filters;\r\n " +
" else\r\n itemFilters = null;\r\n " +
" }\r\n }\r\n\r\n function connectionError() {\r\n " +
" try {\r\n $(\'body\').addClass(\'status-error\');\r\n " +
" $.connection.hub.stop();\r\n } catch (e) {\r\n " +
" // Ignore\r\n }\r\n\r\n window.setTimeout(function (" +
") {\r\n window.location.reload(true);\r\n }, 10000" +
");\r\n }\r\n\r\n // Helpers\r\n function rotateArray(ko" +
"Array, element) {\r\n var items = koArray();\r\n\r\n if " +
"(items.length <= 1)\r\n return 0;\r\n\r\n if (elemen" +
"t.height() < (element.parent().height() - 30)) {\r\n\r\n if (find" +
"UnsortedArrayTopIndex(items) !== 0)\r\n koArray.sort(sortFu" +
"nction);\r\n\r\n // Don\'t rotate if small & sorted correctly\r\n " +
" return;\r\n }\r\n\r\n // Move Last Item" +
" to Top\r\n var item = koArray.pop();\r\n koArray.unsh" +
"ift(item);\r\n }\r\n function removeItemFromArray(koArray, Use" +
"rId) {\r\n var items = koArray();\r\n for (var i = 0; " +
"i < items.length; i++) {\r\n if (items[i].UserId == UserId) {\r\n" +
" koArray.splice(i, 1);\r\n items = k" +
"oArray();\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.length; 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 findSortedInsertIndex(" +
"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 var s = sortFunct" +
"ion(heldDeviceItem, items[i]);\r\n if (s <= 0)\r\n " +
" return i;\r\n }\r\n if (startIndex !== 0) {\r\n" +
" for (var i = 0; i < startIndex; i++) {\r\n " +
" var s = sortFunction(heldDeviceItem, items[i]);\r\n if " +
"(s <= 0)\r\n return i;\r\n }\r\n " +
" return startIndex;\r\n } else {\r\n re" +
"turn -1;\r\n }\r\n }\r\n function sortFunction(l," +
" r) {\r\n return l.UserIdFriendly.toLowerCase() == r.UserIdFriendly" +
".toLowerCase() ? 0 : (l.UserIdFriendly.toLowerCase() < r.UserIdFriendly.toLowerC" +
"ase() ? -1 : 1)\r\n }\r\n function isInProcess(i) {\r\n " +
" return !i.ReadyForReturn && !i.WaitingForUserAction;\r\n }\r\n " +
" function isReadyForReturn(i) {\r\n return i.ReadyForReturn " +
"&& !i.WaitingForUserAction;\r\n }\r\n function isWaitingForUse" +
"rAction(i) {\r\n return i.WaitingForUserAction;\r\n }\r\n " +
" function getQueryStringParameters() {\r\n\r\n if (window.loc" +
"ation.search.length === 0)\r\n return null;\r\n\r\n " +
"var params = {};\r\n window.location.search.substr(1).split(\"&\").fo" +
"rEach(function (pair) {\r\n if (pair === \"\") return;\r\n " +
" var parts = pair.split(\"=\");\r\n params[parts[0]] = " +
"parts[1] && decodeURIComponent(parts[1].replace(/\\+/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>\r\n");
}
}
-14
View File
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Core/modernizr-2.7.2.js
/*!
* Modernizr v2.7.2
* www.modernizr.com
@@ -1406,7 +1405,6 @@ window.Modernizr = (function( window, document, undefined ) {
})(this, this.document);
///#source 1 1 /ClientSource/Scripts/Core/jquery-2.1.1.js
/*!
* jQuery JavaScript Library v2.1.1
* http://jquery.com/
@@ -10598,7 +10596,6 @@ return jQuery;
}));
///#source 1 1 /ClientSource/Scripts/Core/jquery.validate.js
/*!
* jQuery Validation Plugin v1.12.0
*
@@ -11893,7 +11890,6 @@ $.format = function deprecated() {
});
}(jQuery));
///#source 1 1 /ClientSource/Scripts/Core/jquery.validate.unobtrusive.js
/* NUGET: BEGIN LICENSE TEXT
*
* Microsoft grants you the right to use these script files for the sole
@@ -12288,7 +12284,6 @@ $.format = function deprecated() {
$jQval.unobtrusive.parse(document);
});
}(jQuery));
///#source 1 1 /ClientSource/Scripts/Core/disco.unobtrusiveValidation.extensions.js
// Adapted from: http://xhalent.wordpress.com/2011/01/24/applying-unobtrusive-validation-to-dynamic-content/
(function ($) {
$.validator.unobtrusive.reparse = function (selector) {
@@ -12324,7 +12319,6 @@ $.format = function deprecated() {
});
}
})($);
///#source 1 1 /ClientSource/Scripts/Core/jquery-ui-1.10.4.js
/*! jQuery UI - v1.10.4 - 2014-01-17
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.slider.js, jquery.ui.sortable.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
@@ -27334,7 +27328,6 @@ $.widget( "ui.tooltip", {
}( jQuery ) );
///#source 1 1 /ClientSource/Scripts/Core/jquery.watermark.js
/*
Watermark plugin for jQuery
Version: 3.1.4
@@ -27934,7 +27927,6 @@ if ( $.watermark.runOnce ) {
})( jQuery, window );
///#source 1 1 /ClientSource/Scripts/Core/jquery.dataTables.js
/**
* @summary DataTables
* @description Paginate, search and sort HTML tables
@@ -40028,7 +40020,6 @@ if ( $.watermark.runOnce ) {
*/
}(jQuery, window, document, undefined));
///#source 1 1 /ClientSource/Scripts/Core/moment.js
//! moment.js
//! version : 2.6.0
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
@@ -42519,7 +42510,6 @@ if ( $.watermark.runOnce ) {
}
}).call(this);
///#source 1 1 /ClientSource/Scripts/Core/moment.en-au.js
// moment.js language configuration
// language : australian english (en-au)
@@ -42583,9 +42573,7 @@ if ( $.watermark.runOnce ) {
});
}));
///#source 1 1 /ClientSource/Scripts/Core/disco.moment.extensions.js
moment.lang('en-au');
///#source 1 1 /ClientSource/Scripts/Core/livestamp.js
// Livestamp.js / v1.1.2 / (c) 2012 Matt Bradley / MIT License
(function (plugin) {
if (typeof define === 'function' && define.amd) {
@@ -42729,7 +42717,6 @@ moment.lang('en-au');
return livestampLocal[method](this, options);
};
}));
///#source 1 1 /ClientSource/Scripts/Core/disco.dataTables.extensions.js
jQuery.fn.dataTableExt.afnSortData['text'] = function (oSettings, iColumn) {
var aData = [];
$('td:eq(' + iColumn + ')', oSettings.oApi._fnGetTrNodes(oSettings)).each(function () {
@@ -42776,7 +42763,6 @@ jQuery.fn.dataTableExt.oSort['disco_datetime-desc'] = function (a, b) {
// Change Default Menu Lengths
jQuery.fn.DataTable.defaults.aLengthMenu = [[10, 20, 50, -1], [10, 20, 50, "All"]];
///#source 1 1 /ClientSource/Scripts/Core/disco.uicore.js
(function ($, window, document, Modernizr) {
// Document Ready
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/Disco-AjaxHelperIcons/disco.ajaxhelpericons.js
$(function () {
$('.ajaxLoading:not(.showInitially)').hide();
})
@@ -1,4 +1 @@
$(function(){$(".ajaxLoading:not(.showInitially)").hide()});
/*
//# sourceMappingURL=Disco-AjaxHelperIcons.min.js.map
*/
$(function(){$(".ajaxLoading:not(.showInitially)").hide()});
@@ -1,8 +0,0 @@
{
"version":3,
"file":"Disco-AjaxHelperIcons.min.js",
"lineCount":1,
"mappings":"AAAAA,CAAC,CAAC,QAAS,CAAA,CAAG,CACVA,CAAC,CAAC,kCAAD,CAAoCC,KAAK,CAAA,CADhC,CAAb,C",
"sources":["/ClientSource/Scripts/Modules/Disco-AjaxHelperIcons/disco.ajaxhelpericons.js"],
"names":["$","hide"]
}
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/Disco-AttachmentUploader/webcam.js
// WebcamJS v1.0
// Webcam library for capturing JPEG/PNG images in JavaScript
// Attempts getUserMedia, falls back to Flash
@@ -398,7 +397,6 @@ var Webcam = {
Webcam.init();
///#source 1 1 /ClientSource/Scripts/Modules/Disco-AttachmentUploader/disco-attachmentuploader.js
/// <reference path="webcam.js" />
; (function (window, document, $, Webcam) {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/Disco-CreateJob/disco.createjob.js
/// <reference path="../../Core/jquery-1.8.1.js" />
/// <reference path="../../Core/jquery-ui-1.8.23.js" />
(function ($, window, document) {
$(function () {
var createJobDialog = null;
@@ -19,16 +15,16 @@
document.DiscoFunctions = {};
}
document.DiscoFunctions.CreateOpenJobDialog = function (url) {
createJobDialog = $('<div>').attr('id', 'createJobDialog').css({ width: '100%', height: '100%', paddingTop: '0' }).appendTo(document.body);
createJobDialog = $('<div>').attr('id', 'createJobDialog').css({ paddingTop: '0' }).appendTo(document.body);
createJobDialog.dialog({
resizable: false,
draggable: false,
modal: true,
autoOpen: true,
autoOpen: false,
title: 'Create Job',
width: 850,
height: $(window).height() - 100,
height: Math.min(670, $(window).height() - 50),
close: function () {
createJobDialog.find('iframe').attr('src', 'about:blank');
createJobDialog.dialog('destroy').remove();
@@ -37,16 +33,27 @@
buttons: {}
});
var iframe = $('<iframe>').attr({ 'src': url }).width('100%').height('100%').css('border', 'none').appendTo(createJobDialog);
var iframe = $('<iframe>')
.attr({ 'src': url })
.css({
'border': 'none',
'height': '100%',
'width': '100%'
})
.appendTo(createJobDialog);
createJobDialog[0].discoDialogMethods = dialogMethods;
window.setTimeout(function () {
createJobDialog.dialog('open');
}, 1);
}
// Create Job Button
$('#buttonCreateJob').click(function () {
var $this = $(this);
var href = $this.attr('href');
document.DiscoFunctions.CreateOpenJobDialog(href);
return false;
@@ -1,4 +1 @@
(function(n,t,i){n(function(){var r=null,u={close:function(){r.dialog("close")},setButtons:function(n){r&&r.dialog("option","buttons",n)}};i.DiscoFunctions||(i.DiscoFunctions={});i.DiscoFunctions.CreateOpenJobDialog=function(f){r=n("<div>").attr("id","createJobDialog").css({width:"100%",height:"100%",paddingTop:"0"}).appendTo(i.body);r.dialog({resizable:!1,draggable:!1,modal:!0,autoOpen:!0,title:"Create Job",width:850,height:n(t).height()-100,close:function(){r.find("iframe").attr("src","about:blank");r.dialog("destroy").remove();r=null},buttons:{}});var e=n("<iframe>").attr({src:f}).width("100%").height("100%").css("border","none").appendTo(r);r[0].discoDialogMethods=u};n("#buttonCreateJob").click(function(){var t=n(this),r=t.attr("href");return i.DiscoFunctions.CreateOpenJobDialog(r),!1})})})($,window,document);
/*
//# sourceMappingURL=Disco-CreateJob.min.js.map
*/
(function(n,t,i){n(function(){var r=null,u={close:function(){r.dialog("close")},setButtons:function(n){r&&r.dialog("option","buttons",n)}};i.DiscoFunctions||(i.DiscoFunctions={});i.DiscoFunctions.CreateOpenJobDialog=function(f){r=n("<div>").attr("id","createJobDialog").css({paddingTop:"0"}).appendTo(i.body);r.dialog({resizable:!1,draggable:!1,modal:!0,autoOpen:!1,title:"Create Job",width:850,height:Math.min(670,n(t).height()-50),close:function(){r.find("iframe").attr("src","about:blank");r.dialog("destroy").remove();r=null},buttons:{}});var e=n("<iframe>").attr({src:f}).css({border:"none",height:"100%",width:"100%"}).appendTo(r);r[0].discoDialogMethods=u;t.setTimeout(function(){r.dialog("open")},1)};n("#buttonCreateJob").click(function(){var t=n(this),r=t.attr("href");return i.DiscoFunctions.CreateOpenJobDialog(r),!1})})})($,window,document);
@@ -1,8 +0,0 @@
{
"version":3,
"file":"Disco-CreateJob.min.js",
"lineCount":1,
"mappings":"CAGC,QAAS,CAACA,CAAC,CAAEC,CAAM,CAAEC,CAAZ,CAAsB,CAC5BF,CAAC,CAAC,QAAS,CAAA,CAAG,CACV,IAAIG,EAAkB,KAClBC,EAAgB,CAChB,KAAK,CAAEC,QAAS,CAAA,CAAG,CACfF,CAAeG,OAAO,CAAC,OAAD,CADP,CAElB,CACD,UAAU,CAAEC,QAAS,CAACC,CAAD,CAAU,CACvBL,C,EACAA,CAAeG,OAAO,CAAC,QAAQ,CAAE,SAAS,CAAEE,CAAtB,CAFC,CAJf,CADM,CAWrBN,CAAQO,e,GACTP,CAAQO,eAAgB,CAAE,CAAA,EAAE,CAEhCP,CAAQO,eAAeC,oBAAqB,CAAEC,QAAS,CAACC,CAAD,CAAM,CACzDT,CAAgB,CAAEH,CAAC,CAAC,OAAD,CAASa,KAAK,CAAC,IAAI,CAAE,iBAAP,CAAyBC,IAAI,CAAC,CAAE,KAAK,CAAE,MAAM,CAAE,MAAM,CAAE,MAAM,CAAE,UAAU,CAAE,GAA7C,CAAD,CAAoDC,SAAS,CAACb,CAAQc,KAAT,CAAe,CAE1Ib,CAAeG,OAAO,CAAC,CACnB,SAAS,CAAE,CAAA,CAAK,CAChB,SAAS,CAAE,CAAA,CAAK,CAChB,KAAK,CAAE,CAAA,CAAI,CACX,QAAQ,CAAE,CAAA,CAAI,CACd,KAAK,CAAE,YAAY,CACnB,KAAK,CAAE,GAAG,CACV,MAAM,CAAEN,CAAC,CAACC,CAAD,CAAQgB,OAAO,CAAA,CAAG,CAAE,GAAG,CAChC,KAAK,CAAEZ,QAAS,CAAA,CAAG,CACfF,CAAee,KAAK,CAAC,QAAD,CAAUL,KAAK,CAAC,KAAK,CAAE,aAAR,CAAsB,CACzDV,CAAeG,OAAO,CAAC,SAAD,CAAWa,OAAO,CAAA,CAAE,CAC1ChB,CAAgB,CAAE,IAHH,CAIlB,CACD,OAAO,CAAE,CAAA,CAbU,CAAD,CAcpB,CAEF,IAAIiB,EAASpB,CAAC,CAAC,UAAD,CAAYa,KAAK,CAAC,CAAE,GAAK,CAAED,CAAT,CAAD,CAAgBS,MAAM,CAAC,MAAD,CAAQJ,OAAO,CAAC,MAAD,CAAQH,IAAI,CAAC,QAAQ,CAAE,MAAX,CAAkBC,SAAS,CAACZ,CAAD,CAAiB,CAE5HA,CAAgB,CAAA,CAAA,CAAEmB,mBAAoB,CAAElB,CArBiB,C,CAyB7DJ,CAAC,CAAC,kBAAD,CAAoBuB,MAAM,CAAC,QAAS,CAAA,CAAG,CACpC,IAAIC,EAAQxB,CAAC,CAAC,IAAD,EACTyB,EAAOD,CAAKX,KAAK,CAAC,MAAD,CADF,CAKnB,OAFAX,CAAQO,eAAeC,oBAAoB,CAACe,CAAD,CAAM,CAE1C,CAAA,CAN6B,CAAb,CAxCjB,CAAb,CAD2B,EAkD9B,CAACzB,CAAC,CAAEC,MAAM,CAAEC,QAAZ,CAAqB",
"sources":["/ClientSource/Scripts/Modules/Disco-CreateJob/disco.createjob.js"],
"names":["$","window","document","createJobDialog","dialogMethods","close","dialog","setButtons","buttons","DiscoFunctions","CreateOpenJobDialog","document.DiscoFunctions.CreateOpenJobDialog","url","attr","css","appendTo","body","height","find","remove","iframe","width","discoDialogMethods","click","$this","href"]
}
@@ -1,7 +1,4 @@
/// <reference path="../../Core/jquery-1.8.1.js" />
/// <reference path="../../Core/jquery-ui-1.8.23.js" />
(function ($, window, document) {
(function ($, window, document) {
$(function () {
var createJobDialog = null;
var dialogMethods = {
@@ -18,16 +15,16 @@
document.DiscoFunctions = {};
}
document.DiscoFunctions.CreateOpenJobDialog = function (url) {
createJobDialog = $('<div>').attr('id', 'createJobDialog').css({ width: '100%', height: '100%', paddingTop: '0' }).appendTo(document.body);
createJobDialog = $('<div>').attr('id', 'createJobDialog').css({ paddingTop: '0' }).appendTo(document.body);
createJobDialog.dialog({
resizable: false,
draggable: false,
modal: true,
autoOpen: true,
autoOpen: false,
title: 'Create Job',
width: 850,
height: $(window).height() - 100,
height: Math.min(670, $(window).height() - 50),
close: function () {
createJobDialog.find('iframe').attr('src', 'about:blank');
createJobDialog.dialog('destroy').remove();
@@ -36,16 +33,27 @@
buttons: {}
});
var iframe = $('<iframe>').attr({ 'src': url }).width('100%').height('100%').css('border', 'none').appendTo(createJobDialog);
var iframe = $('<iframe>')
.attr({ 'src': url })
.css({
'border': 'none',
'height': '100%',
'width': '100%'
})
.appendTo(createJobDialog);
createJobDialog[0].discoDialogMethods = dialogMethods;
window.setTimeout(function () {
createJobDialog.dialog('open');
}, 1);
}
// Create Job Button
$('#buttonCreateJob').click(function () {
var $this = $(this);
var href = $this.attr('href');
document.DiscoFunctions.CreateOpenJobDialog(href);
return false;
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/Disco-DataTableHelpers/disco.datatablehelpers.js
(function (window, document, $) {
var dataTables = [];
@@ -1,4 +1 @@
(function(n,t,i){var r=[];i(function(){function t(){var t=i(this).closest(".dataTables_wrapper");t.length>0&&n.setTimeout(function(){var e=i(n),o=t.height(),r=t.offset(),u=e.scrollTop(),s=e.height(),h=u-r.top,f;h>0?i("html").animate({scrollTop:r.top},125):(f=(u+s-(o+r.top))*-1,f>0&&(o>s?i("html").animate({scrollTop:r.top},125):i("html").animate({scrollTop:u+f},125)))},1)}i("table.jobTable").each(function(){var u=i(this),h=!1,l=u.hasClass("enablePaging"),a=u.hasClass("enableFilter"),v=u.find("tr").length>20,y={bPaginate:l,sPaginationType:"full_numbers",bLengthChange:v,iDisplayLength:20,bFilter:a,bSort:!0,bInfo:!1,bAutoWidth:!1,aoColumnDefs:[{aTargets:["dates"],sSortDataType:"disco_datetime",sType:"disco_datetime"}],aaSorting:[],oLanguage:{sSearch:"Filter:"},fnDrawCallback:function(){h?t.apply(u):h=!0}},p=u.dataTable(y),c,o,f,e,n,s;if(u.hasClass("hideStatusClosed")&&(c=u.children("tbody"),o=c.children('tr[data-status="Closed"]'),o.length>0)){f=i(this).closest(".dataTables_wrapper");e=f;f.parent(".jobTable").length>0&&(e=f.parent());n=e.prev();n.length>0&&(n.is("h1")||n.is("h2")||n.is("h3"))?n.data("dataTable_originalContent",n.html()).text("Active "+n.text()):n=null;s=e.find("div.allClosed_container");s.length>0?(u.hide(),f.find(".dataTables_filter").hide()):i('<a class="dataTables_showStatusClosed button small" href="#">').text("Show Closed Jobs ("+o.length+")").appendTo(e);e.on("click","a.dataTables_showStatusClosed",function(){return u.show(),f.find(".dataTables_filter").show(),u.removeClass("hideStatusClosed"),s.remove(),i(this).remove(),n&&n.html(n.data("dataTable_originalContent")),t.apply(u[0]),!1})}r.push(this)});i("table.deviceTable").each(function(){var n=i(this),t=n.find("tr").length>20,u={bPaginate:t,sPaginationType:"full_numbers",bLengthChange:t,iDisplayLength:20,bFilter:!0,bSort:!0,bInfo:!1,bAutoWidth:!1,aaSorting:[],oLanguage:{sSearch:"Filter:"}};n.dataTable(u);r.push(this)});i("table.userTable").each(function(){var n=i(this),t=n.find("tr").length>20,u={bPaginate:t,sPaginationType:"full_numbers",bLengthChange:t,iDisplayLength:20,bFilter:!0,bSort:!0,bInfo:!1,bAutoWidth:!1,aaSorting:[],oLanguage:{sSearch:"Filter:"}};n.dataTable(u);r.push(this)})})})(window,document,$);
/*
//# sourceMappingURL=Disco-DataTableHelpers.min.js.map
*/
(function(n,t,i){var r=[];i(function(){function t(){var t=i(this).closest(".dataTables_wrapper");t.length>0&&n.setTimeout(function(){var e=i(n),o=t.height(),r=t.offset(),u=e.scrollTop(),s=e.height(),h=u-r.top,f;h>0?i("html").animate({scrollTop:r.top},125):(f=(u+s-(o+r.top))*-1,f>0&&(o>s?i("html").animate({scrollTop:r.top},125):i("html").animate({scrollTop:u+f},125)))},1)}i("table.jobTable").each(function(){var u=i(this),h=!1,l=u.hasClass("enablePaging"),a=u.hasClass("enableFilter"),v=u.find("tr").length>20,y={bPaginate:l,sPaginationType:"full_numbers",bLengthChange:v,iDisplayLength:20,bFilter:a,bSort:!0,bInfo:!1,bAutoWidth:!1,aoColumnDefs:[{aTargets:["dates"],sSortDataType:"disco_datetime",sType:"disco_datetime"}],aaSorting:[],oLanguage:{sSearch:"Filter:"},fnDrawCallback:function(){h?t.apply(u):h=!0}},p=u.dataTable(y),c,o,f,e,n,s;if(u.hasClass("hideStatusClosed")&&(c=u.children("tbody"),o=c.children('tr[data-status="Closed"]'),o.length>0)){f=i(this).closest(".dataTables_wrapper");e=f;f.parent(".jobTable").length>0&&(e=f.parent());n=e.prev();n.length>0&&(n.is("h1")||n.is("h2")||n.is("h3"))?n.data("dataTable_originalContent",n.html()).text("Active "+n.text()):n=null;s=e.find("div.allClosed_container");s.length>0?(u.hide(),f.find(".dataTables_filter").hide()):i('<a class="dataTables_showStatusClosed button small" href="#">').text("Show Closed Jobs ("+o.length+")").appendTo(e);e.on("click","a.dataTables_showStatusClosed",function(){return u.show(),f.find(".dataTables_filter").show(),u.removeClass("hideStatusClosed"),s.remove(),i(this).remove(),n&&n.html(n.data("dataTable_originalContent")),t.apply(u[0]),!1})}r.push(this)});i("table.deviceTable").each(function(){var n=i(this),t=n.find("tr").length>20,u={bPaginate:t,sPaginationType:"full_numbers",bLengthChange:t,iDisplayLength:20,bFilter:!0,bSort:!0,bInfo:!1,bAutoWidth:!1,aaSorting:[],oLanguage:{sSearch:"Filter:"}};n.dataTable(u);r.push(this)});i("table.userTable").each(function(){var n=i(this),t=n.find("tr").length>20,u={bPaginate:t,sPaginationType:"full_numbers",bLengthChange:t,iDisplayLength:20,bFilter:!0,bSort:!0,bInfo:!1,bAutoWidth:!1,aaSorting:[],oLanguage:{sSearch:"Filter:"}};n.dataTable(u);r.push(this)})})})(window,document,$);
@@ -1,8 +0,0 @@
{
"version":3,
"file":"Disco-DataTableHelpers.min.js",
"lineCount":1,
"mappings":"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",
"sources":["/ClientSource/Scripts/Modules/Disco-DataTableHelpers/disco.datatablehelpers.js"],
"names":["window","document","$","dataTables","scrollCheck","wrapper","closest","length","setTimeout","$window","wrapperHeight","height","wrapperOffset","offset","windowScrollTop","scrollTop","windowHeight","wrapperTopNotShown","top","wrapperBottomNotShown","animate","each","$table","tableDrawn","enablePaging","hasClass","enableFilter","dataTableOptionsPagination","find","dataTableOptions","fnDrawCallback","apply","$dataTable","dataTable","$tbody","$closedJobs","wrapperContext","wrapperPrev","allClosedContainer","children","parent","prev","is","data","html","text","hide","appendTo","on","show","removeClass","remove","push"]
}
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/Disco-ExpressionEditor/disco.expressioneditor.js
/// <reference path="../../Core/jquery-1.7.1.js" />
function DiscoExpressionEditor(host, validateUrl, expression) {
this.host = host;
@@ -1,2 +1 @@
function DiscoExpressionEditor(n,t,i){this.host=n,this.hostDocument=null,this.hostContainer=null,this.validateUrl=t,this.expression=i?i:"",this.expressionHtml="",this.expressionException=null,this.hostInited=null,this.expressionValidated=null,this.expressionExceptionChanged=null}DiscoExpressionEditor.prototype={hostInit:function(){var n=this,i=function(){n.hostDocument=n.host.contents(),n.hostContainer=n.hostDocument.find("body"),n.host.focus(function(){n.setException(null),n.renderExpression()}),n.hostContainer.bind("paste",function(){setTimeout(function(){n.setExpression(n.hostContainer.text())},50)}),n.expression&&n.setExpression(n.expression),n.hostInited&&n.hostInited()},t=function(){n.host.unbind("load",t),n.host.load(i),n.host[0].contentWindow.document.designMode="on"};n.host.load(t)},parseExpression:function(n,t){for(var u=n.split("\n"),f,r,i=0;i<u.length;i++)t&&t.PositionRow==i+1?(f=u[i].trim(),r='<p id="line'+i+'" class="line lineError">',f.length>=t.PositionColumn?(r+=f.substr(0,t.PositionColumn-1),r+='<span class="error">'+f.substr(t.PositionColumn-1,1)+"<\/span>",r+=f.substr(t.PositionColumn)):(r+=f,r+='<span class="error">&nbsp;<\/span>'),r+="<\/p>",u[i]=r):u[i]='<p id="line'+i+'" class="line">'+u[i].trim()+"<\/p>";return u.join("")},setExpression:function(n){this.expression=n,this.setException(null),this.renderExpression()},getExpression:function(){var n=null;return $("p",this.hostContainer).each(function(){n==null?n=$(this).text():n+="\n"+$(this).text()}),this.expression=n,n},setException:function(n){this.expressionException!==n&&(this.expressionException=n,this.expressionExceptionChanged&&this.expressionExceptionChanged(n))},renderExpression:function(){this.expressionHtml=this.parseExpression(this.expression,this.expressionException),this.hostContainer.html(this.expressionHtml)},validateExpression:function(){var n=this,t=n.getExpression();$.getJSON(n.validateUrl,{Expression:t},function(t){n.setException(t),n.renderExpression(),n.expressionValidated&&n.expressionValidated(t.ExpressionValid,t)})}},String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};
//@ sourceMappingURL=Disco-ExpressionEditor.min.js.map
function DiscoExpressionEditor(n,t,i){this.host=n;this.hostDocument=null;this.hostContainer=null;this.validateUrl=t;this.expression=i?i:"";this.expressionHtml="";this.expressionException=null;this.hostInited=null;this.expressionValidated=null;this.expressionExceptionChanged=null}DiscoExpressionEditor.prototype={hostInit:function(){var n=this,i=function(){n.hostDocument=n.host.contents();n.hostContainer=n.hostDocument.find("body");n.host.focus(function(){n.setException(null);n.renderExpression()});n.hostContainer.bind("paste",function(){setTimeout(function(){n.setExpression(n.hostContainer.text())},50)});n.expression&&n.setExpression(n.expression);n.hostInited&&n.hostInited()},t=function(){n.host.unbind("load",t);n.host.load(i);n.host[0].contentWindow.document.designMode="on"};n.host.load(t)},parseExpression:function(n,t){for(var f,r,u=n.split("\n"),i=0;i<u.length;i++)t&&t.PositionRow==i+1?(f=u[i].trim(),r='<p id="line'+i+'" class="line lineError">',f.length>=t.PositionColumn?(r+=f.substr(0,t.PositionColumn-1),r+='<span class="error">'+f.substr(t.PositionColumn-1,1)+"<\/span>",r+=f.substr(t.PositionColumn)):(r+=f,r+='<span class="error">&nbsp;<\/span>'),r+="<\/p>",u[i]=r):u[i]='<p id="line'+i+'" class="line">'+u[i].trim()+"<\/p>";return u.join("")},setExpression:function(n){this.expression=n;this.setException(null);this.renderExpression()},getExpression:function(){var n=null;return $("p",this.hostContainer).each(function(){n==null?n=$(this).text():n+="\n"+$(this).text()}),this.expression=n,n},setException:function(n){this.expressionException!==n&&(this.expressionException=n,this.expressionExceptionChanged&&this.expressionExceptionChanged(n))},renderExpression:function(){this.expressionHtml=this.parseExpression(this.expression,this.expressionException);this.hostContainer.html(this.expressionHtml)},validateExpression:function(){var n=this,t=n.getExpression();$.getJSON(n.validateUrl,{Expression:t},function(t){n.setException(t);n.renderExpression();n.expressionValidated&&n.expressionValidated(t.ExpressionValid,t)})}};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};
@@ -1,8 +0,0 @@
{
"version":3,
"file":"Disco-ExpressionEditor.min.js",
"lineCount":1,
"mappings":"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",
"sources":["/ClientSource/Scripts/Modules/Disco-ExpressionEditor/disco.expressioneditor.js"],
"names":["DiscoExpressionEditor","host","validateUrl","expression","hostDocument","hostContainer","expressionHtml","expressionException","hostInited","expressionValidated","expressionExceptionChanged","prototype","hostInit","that","contents","find","focus","setException","renderExpression","bind","setTimeout","setExpression","text","designModeInit","unbind","load","contentWindow","document","designMode","parseExpression","exception","expressionLines","split","lineSrc","line","i","length","PositionRow","trim","PositionColumn","substr","join","getExpression","e","$","each","html","validateExpression","getJSON","response","ExpressionValid","String","String.prototype.trim","replace"]
}
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/Disco-PropertyChangeHelpers/disco.propertychangehelpers.js
if (!document.DiscoFunctions) {
document.DiscoFunctions = {};
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/Disco-jQueryExtensions/disco.jQueryExtensions.js
/// <reference path="../../Core/jquery-1.7.1.js" />
(function ($) {
@@ -1,2 +1 @@
(function(n){var t={init:function(i){return i=n.extend({parentSelector:"tr"},i),this.each(function(){var u=n(this),r,e,o;if(u.data("checkboxBulkSelect_parentSelector",i.parentSelector),r=u.closest(i.parentSelector).find('input[type="checkbox"]'),r.length>0){function s(){return r.prop("checked",!0),f(),!1}function h(){return r.prop("checked",!1),f(),!1}function f(){t.update.apply(u,[r,i.parentSelector,e,o])}e=n("<a>").addClass("selectAll").attr("href","#").text("ALL").click(s),o=n("<a>").addClass("selectNone").attr("href","#").text("NONE").click(h),u.append(n("<span>").text("Select: "),e,n("<span>").text(" | "),o),r.click(f),f()}})},update:function(t,i,r,u){return this.each(function(){$this=n(this),i||(i=$this.data("checkboxBulkSelect_parentSelector")),t||(t=$this.closest(i).find('input[type="checkbox"]')),r||(r=$this.find("a.selectAll").first()),u||(u=$this.find("a.selectNone").first());var f=t.filter(":checked");t.length==f.length?(r.prop("disabled",!0),u.prop("disabled",!1)):f.length==0?(u.prop("disabled",!0),r.prop("disabled",!1)):(r.prop("disabled",!1),u.prop("disabled",!1))})}};n.fn.checkboxBulkSelect=function(i){if(t[i])return t[i].apply(this,Array.prototype.slice(arguments,1));if(typeof i!="object"&&i)n.error("Method "+i+" does not exist on jQuery.checkboxBulkSelect");else return t.init.apply(this,arguments)}})(jQuery);
//# sourceMappingURL=Disco-jQueryExtensions.min.js.map
(function(n){var t={init:function(i){return i=n.extend({parentSelector:"tr"},i),this.each(function(){var u=n(this),r,e,o;if(u.data("checkboxBulkSelect_parentSelector",i.parentSelector),r=u.closest(i.parentSelector).find('input[type="checkbox"]'),r.length>0){function s(){return r.prop("checked",!0),f(),!1}function h(){return r.prop("checked",!1),f(),!1}function f(){t.update.apply(u,[r,i.parentSelector,e,o])}e=n("<a>").addClass("selectAll").attr("href","#").text("ALL").click(s);o=n("<a>").addClass("selectNone").attr("href","#").text("NONE").click(h);u.append(n("<span>").text("Select: "),e,n("<span>").text(" | "),o);r.click(f);f()}})},update:function(t,i,r,u){return this.each(function(){$this=n(this);i||(i=$this.data("checkboxBulkSelect_parentSelector"));t||(t=$this.closest(i).find('input[type="checkbox"]'));r||(r=$this.find("a.selectAll").first());u||(u=$this.find("a.selectNone").first());var f=t.filter(":checked");t.length==f.length?(r.prop("disabled",!0),u.prop("disabled",!1)):f.length==0?(u.prop("disabled",!0),r.prop("disabled",!1)):(r.prop("disabled",!1),u.prop("disabled",!1))})}};n.fn.checkboxBulkSelect=function(i){if(t[i])return t[i].apply(this,Array.prototype.slice(arguments,1));if(typeof i!="object"&&i)n.error("Method "+i+" does not exist on jQuery.checkboxBulkSelect");else return t.init.apply(this,arguments)}})(jQuery);
@@ -1,8 +0,0 @@
{
"version":3,
"file":"Disco-jQueryExtensions.min.js",
"lineCount":1,
"mappings":"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",
"sources":["/ClientSource/Scripts/Modules/Disco-jQueryExtensions/disco.jQueryExtensions.js"],
"names":["$","checkboxBulkSelectMethods","init","options","extend","each","$this","$checkboxes","$selectAll","$selectNone","data","parentSelector","closest","find","length","selectAll","prop","update","selectNone","apply","addClass","attr","text","click","append","first","$selectedCheckboxes","filter","fn","checkboxBulkSelect","$.fn.checkboxBulkSelect","method","Array","prototype","slice","arguments","error","jQuery"]
}
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/Highcharts/highcharts.src.js
// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/Knockout/knockout-3.1.0.js
// Knockout JavaScript library v3.1.0
// (c) Steven Sanderson - http://knockoutjs.com/
// License: MIT (http://www.opensource.org/licenses/mit-license.php)
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/Shadowbox/shadowbox.js
/*
* Shadowbox.js, version 3.0.3
* http://shadowbox-js.com/
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/jQuery-Fancytree/jquery.fancytree-all.js
/*!
* jquery.fancytree.js
* Dynamic tree view control, with support for lazy loading of branches.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,3 @@
///#source 1 1 /ClientSource/Scripts/Modules/jQuery-Isotope/jquery.isotope.js
/**
* Isotope v1.5.25
* An exquisite jQuery plugin for magical layouts

Some files were not shown because too many files have changed in this diff Show More