diff --git a/Core/Resgrid.Config/DataConfig.cs b/Core/Resgrid.Config/DataConfig.cs index b78b8a37..d4fe4cbb 100644 --- a/Core/Resgrid.Config/DataConfig.cs +++ b/Core/Resgrid.Config/DataConfig.cs @@ -2,7 +2,7 @@ { public class DataConfig { - public static string ConnectionString = "Data Source=(local);Initial Catalog=Resgrid;Integrated Security=True;MultipleActiveResultSets=True;"; + public static string ConnectionString = "Server=rgdevserver;Database=Resgrid;User Id=resgrid_app;Password=resgrid123;MultipleActiveResultSets=True;"; public const string UsersIdentityRoleId = "38b461d7-e848-46ef-8c06-ece5b618d9d1"; public const string AdminsIdentityRoleId = "1f6a03a8-62f4-4179-80fc-2eb96266cf04"; diff --git a/Core/Resgrid.Config/ResgridConfig.json b/Core/Resgrid.Config/ResgridConfig.json index d0d5df8b..959d70bb 100644 --- a/Core/Resgrid.Config/ResgridConfig.json +++ b/Core/Resgrid.Config/ResgridConfig.json @@ -1,7 +1,7 @@ { "InfoConfig.ConfigVersion": "1", - "DataConfig.ConnectionString": "Data Source=(local);Initial Catalog=Resgrid;Integrated Security=True;MultipleActiveResultSets=True;", + "DataConfig.ConnectionString": "Server=rgdevserver;Database=Resgrid;User Id=resgrid_app;Password=resgrid123;MultipleActiveResultSets=True;", "SystemBehaviorConfig.ResgridBaseUrl": "http://resgrid.local", "SystemBehaviorConfig.ResgridApiBaseUrl": "http://resgridapi.local", @@ -43,7 +43,7 @@ "OutboundEmailServerConfig.PostmarkWelcomeTemplateId": "", "OutboundEmailServerConfig.PostmarkNewDepLinkTemplateId": "", - "WorkerConfig.WorkerDbConnectionString": "Data Source=(local);Initial Catalog=ResgridWorkers;Integrated Security=True;MultipleActiveResultSets=True;", + "WorkerConfig.WorkerDbConnectionString": "Server=rgdevserver;Database=ResgridWorkers;User Id=resgrid_app;Password=resgrid123;MultipleActiveResultSets=True;", "WorkerConfig.PayloadKey": "XsBYpdbdHkhuGsU3tvTMawyV6d3M2F8EQ8wQ2jVLBREECQmwngACk2hm4Ykb7eW7Qsm6za8RdJBY5Z3xvN6erYry47nJ5XmL", "ServiceBusConfig.RabbitHostname": "localhost", diff --git a/Web/Resgrid.Services/Controllers/Version3/BigBoardController.cs b/Web/Resgrid.Services/Controllers/Version3/BigBoardController.cs index 99c9a125..42a80bae 100644 --- a/Web/Resgrid.Services/Controllers/Version3/BigBoardController.cs +++ b/Web/Resgrid.Services/Controllers/Version3/BigBoardController.cs @@ -385,6 +385,7 @@ public BigBoardMapModel GetMap() foreach (var station in stations) { MapMakerInfo info = new MapMakerInfo(); + info.Id = $"s{station.DepartmentGroupId}"; info.ImagePath = "Station"; info.Title = station.Name; info.InfoWindowContent = station.Name; @@ -417,6 +418,7 @@ public BigBoardMapModel GetMap() { MapMakerInfo info = new MapMakerInfo(); info.ImagePath = "Call"; + info.Id = $"c{call.CallId}"; info.Title = call.Name; info.InfoWindowContent = call.NatureOfCall; @@ -451,6 +453,7 @@ public BigBoardMapModel GetMap() { MapMakerInfo info = new MapMakerInfo(); info.ImagePath = "Engine_Responding"; + info.Id = $"u{unit.UnitId}"; info.Title = unit.Unit.Name; info.InfoWindowContent = ""; info.Latitude = double.Parse(unit.Latitude.Value.ToString()); @@ -492,6 +495,7 @@ public BigBoardMapModel GetMap() info.ImagePath = "Person_RespondingCall"; } + //info.Id = $"p{person.}"; info.Title = person.Name; info.InfoWindowContent = ""; info.Latitude = double.Parse(person.Latitude.Value.ToString()); diff --git a/Web/Resgrid.Services/Controllers/Version3/CallPrioritiesController.cs b/Web/Resgrid.Services/Controllers/Version3/CallPrioritiesController.cs index 46433817..30f489ec 100644 --- a/Web/Resgrid.Services/Controllers/Version3/CallPrioritiesController.cs +++ b/Web/Resgrid.Services/Controllers/Version3/CallPrioritiesController.cs @@ -74,6 +74,39 @@ public List GetAllCallPriorites() return result; } + /// + /// Returns all the call priorities (including deleted ones) for a selected department + /// + /// Array of CallPriorityResult objects for each call priority in the department + [System.Web.Http.AcceptVerbs("GET")] + public List GetAllCallPrioritesForDepartment(int departmentId) + { + var result = new List(); + + if (departmentId != DepartmentId && !IsSystem) + Unauthorized(); + + var priorities = _callsService.GetCallPrioritesForDepartment(departmentId); + + foreach (var p in priorities) + { + var priority = new CallPriorityResult(); + + priority.Id = p.DepartmentCallPriorityId; + priority.DepartmentId = p.DepartmentId; + priority.Name = StringHelpers.SanitizeHtmlInString(p.Name); + priority.Color = p.Color; + priority.Sort = p.Sort; + priority.IsDeleted = p.IsDeleted; + priority.IsDefault = p.IsDefault; + priority.Tone = p.Tone; + + result.Add(priority); + } + + return result; + } + /// /// Return the audio file for push notifications for a specific call priority /// diff --git a/Web/Resgrid.Services/Controllers/Version3/CallsController.cs b/Web/Resgrid.Services/Controllers/Version3/CallsController.cs index ffcc0363..f77555a6 100644 --- a/Web/Resgrid.Services/Controllers/Version3/CallsController.cs +++ b/Web/Resgrid.Services/Controllers/Version3/CallsController.cs @@ -141,6 +141,157 @@ public List GetActiveCalls() return result; } + /// + /// Returns all the active calls for the department (extended object result, more verbose then GetActiveCalls) + /// + /// Array of DepartmentCallResult objects for each active call in the department + [System.Web.Http.AcceptVerbs("GET")] + public List GetActiveCallsForDepartment(int departmentId) + { + var result = new List(); + + if (departmentId != DepartmentId && !IsSystem) + Unauthorized(); + + var calls = _callsService.GetActiveCallsByDepartment(departmentId).OrderByDescending(x => x.LoggedOn); + var department = _departmentsService.GetDepartmentById(departmentId, false); + + foreach (var c in calls) + { + var call = new DepartmentCallResult(); + + call.Name = StringHelpers.SanitizeHtmlInString(c.Name); + + if (!String.IsNullOrWhiteSpace(c.NatureOfCall)) + call.NatureOfCall = StringHelpers.SanitizeHtmlInString(c.NatureOfCall); + + if (!String.IsNullOrWhiteSpace(c.Notes)) + call.Notes = StringHelpers.SanitizeHtmlInString(c.Notes); + + //if (c.CallNotes != null) + // call.Nts = c.CallNotes.Count(); + //else + // call.Nts = 0; + + //if (c.Attachments != null) + //{ + // call.Aud = c.Attachments.Count(x => x.CallAttachmentType == (int)CallAttachmentTypes.DispatchAudio); + // call.Img = c.Attachments.Count(x => x.CallAttachmentType == (int)CallAttachmentTypes.Image); + // call.Fls = c.Attachments.Count(x => x.CallAttachmentType == (int)CallAttachmentTypes.File); + //} + //else + //{ + // call.Aud = 0; + // call.Img = 0; + // call.Fls = 0; + //} + + //if (String.IsNullOrWhiteSpace(c.Address) && !String.IsNullOrWhiteSpace(c.GeoLocationData)) + //{ + // var geo = c.GeoLocationData.Split(char.Parse(",")); + + // if (geo.Length == 2) + // call.Add = _geoLocationProvider.GetAddressFromLatLong(double.Parse(geo[0]), double.Parse(geo[1])); + //} + //else + // call.Address = c.Address; + + call.LoggedOn = c.LoggedOn.TimeConverter(department); + call.LoggedOnUtc = c.LoggedOn; + call.CallId = c.CallId; + call.Number = c.Number; + call.DepartmentId = c.DepartmentId; + call.ReportingUserId = c.ReportingUserId; + call.Priority = c.Priority; + call.IsCritical = c.IsCritical; + call.Type = c.Type; + call.IncidentNumber = c.IncidentNumber; + call.MapPage = c.MapPage; + call.CompletedNotes = c.CompletedNotes; + call.Address = c.Address; + call.GeoLocationData = c.GeoLocationData; + call.ClosedByUserId = c.ClosedByUserId; + call.ClosedOn = c.ClosedOn; + call.State = c.State; + call.IsDeleted = c.IsDeleted; + call.CallSource = c.CallSource; + call.DispatchCount = c.DispatchCount; + call.LastDispatchedOn = c.LastDispatchedOn; + call.SourceIdentifier = c.SourceIdentifier; + call.ContactName = c.ContactName; + call.ContactNumber = c.ContactNumber; + call.Public = c.Public; + call.ExternalIdentifier = c.ExternalIdentifier; + call.ReferenceNumber = c.ReferenceNumber; + + if (c.Dispatches != null) + { + foreach (var dispatch in c.Dispatches) + { + var dispatchResult = new DepartmentCallDispatchResult(); + dispatchResult.CallDispatchId = dispatch.CallDispatchId; + dispatchResult.CallId = dispatch.CallId; + dispatchResult.UserId = dispatch.UserId; + dispatchResult.GroupId = dispatch.GroupId; + dispatchResult.DispatchCount = dispatch.DispatchCount; + dispatchResult.LastDispatchedOn = dispatch.LastDispatchedOn; + dispatchResult.ActionLogId = dispatch.ActionLogId; + + call.Dispatches.Add(dispatchResult); + } + } + + if (c.GroupDispatches != null) + { + foreach (var dispatch in c.GroupDispatches) + { + var dispatchResult = new DepartmentCallDispatchGroupResult(); + dispatchResult.CallDispatchGroupId = dispatch.CallDispatchGroupId; + dispatchResult.CallId = dispatch.CallId; + dispatchResult.DepartmentGroupId = dispatch.DepartmentGroupId; + dispatchResult.DispatchCount = dispatch.DispatchCount; + dispatchResult.LastDispatchedOn = dispatch.LastDispatchedOn; + + call.GroupDispatches.Add(dispatchResult); + } + } + + if (c.UnitDispatches != null) + { + foreach (var dispatch in c.UnitDispatches) + { + var dispatchResult = new DepartmentCallDispatchUnitResult(); + dispatchResult.CallDispatchUnitId = dispatch.CallDispatchUnitId; + dispatchResult.CallId = dispatch.CallId; + dispatchResult.UnitId = dispatch.UnitId; + dispatchResult.DispatchCount = dispatch.DispatchCount; + dispatchResult.LastDispatchedOn = dispatch.LastDispatchedOn; + + call.UnitDispatches.Add(dispatchResult); + } + } + + if (c.RoleDispatches != null) + { + foreach (var dispatch in c.RoleDispatches) + { + var dispatchResult = new DepartmentCallDispatchRoleResult(); + dispatchResult.CallDispatchRoleId = dispatch.CallDispatchRoleId; + dispatchResult.CallId = dispatch.CallId; + dispatchResult.RoleId = dispatch.RoleId; + dispatchResult.DispatchCount = dispatch.DispatchCount; + dispatchResult.LastDispatchedOn = dispatch.LastDispatchedOn; + + call.RoleDispatches.Add(dispatchResult); + } + } + + result.Add(call); + } + + return result; + } + /// /// Returns a specific call from the Resgrid System /// diff --git a/Web/Resgrid.Services/Controllers/Version3/Models/BigBoard/MapMakerInfo.cs b/Web/Resgrid.Services/Controllers/Version3/Models/BigBoard/MapMakerInfo.cs index 864af915..6f868381 100644 --- a/Web/Resgrid.Services/Controllers/Version3/Models/BigBoard/MapMakerInfo.cs +++ b/Web/Resgrid.Services/Controllers/Version3/Models/BigBoard/MapMakerInfo.cs @@ -7,6 +7,7 @@ namespace Resgrid.Web.Services.Controllers.Version3.Models.BigBoard { public class MapMakerInfo { + public string Id { get; set; } public double Longitude { get; set; } public double Latitude { get; set; } public string Title { get; set; } @@ -15,4 +16,4 @@ public class MapMakerInfo public string InfoWindowContent { get; set; } public string Color { get; set; } } -} \ No newline at end of file +} diff --git a/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchGroupResult.cs b/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchGroupResult.cs new file mode 100644 index 00000000..6db5005d --- /dev/null +++ b/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchGroupResult.cs @@ -0,0 +1,13 @@ +using System; + +namespace Resgrid.Web.Services.Controllers.Version3.Models.Calls +{ + public class DepartmentCallDispatchGroupResult + { + public int CallDispatchGroupId { get; set; } + public int CallId { get; set; } + public int DepartmentGroupId { get; set; } + public int DispatchCount { get; set; } + public DateTime? LastDispatchedOn { get; set; } + } +} diff --git a/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchResult.cs b/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchResult.cs new file mode 100644 index 00000000..acd14762 --- /dev/null +++ b/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchResult.cs @@ -0,0 +1,15 @@ +using System; + +namespace Resgrid.Web.Services.Controllers.Version3.Models.Calls +{ + public class DepartmentCallDispatchResult + { + public int CallDispatchId { get; set; } + public int CallId { get; set; } + public string UserId { get; set; } + public int? GroupId { get; set; } + public int DispatchCount { get; set; } + public DateTime? LastDispatchedOn { get; set; } + public int? ActionLogId { get; set; } + } +} diff --git a/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchRoleResult.cs b/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchRoleResult.cs new file mode 100644 index 00000000..7ba675fa --- /dev/null +++ b/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchRoleResult.cs @@ -0,0 +1,13 @@ +using System; + +namespace Resgrid.Web.Services.Controllers.Version3.Models.Calls +{ + public class DepartmentCallDispatchRoleResult + { + public int CallDispatchRoleId { get; set; } + public int CallId { get; set; } + public int RoleId { get; set; } + public int DispatchCount { get; set; } + public DateTime? LastDispatchedOn { get; set; } + } +} diff --git a/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchUnitResult.cs b/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchUnitResult.cs new file mode 100644 index 00000000..acd3f705 --- /dev/null +++ b/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallDispatchUnitResult.cs @@ -0,0 +1,13 @@ +using System; + +namespace Resgrid.Web.Services.Controllers.Version3.Models.Calls +{ + public class DepartmentCallDispatchUnitResult + { + public int CallDispatchUnitId { get; set; } + public int CallId { get; set; } + public int UnitId { get; set; } + public int DispatchCount { get; set; } + public DateTime? LastDispatchedOn { get; set; } + } +} diff --git a/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallResult.cs b/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallResult.cs new file mode 100644 index 00000000..3065ae6c --- /dev/null +++ b/Web/Resgrid.Services/Controllers/Version3/Models/Calls/DepartmentCallResult.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; + +namespace Resgrid.Web.Services.Controllers.Version3.Models.Calls +{ + public class DepartmentCallResult + { + public int CallId { get; set; } + public string Number { get; set; } + public int DepartmentId { get; set; } + public string ReportingUserId { get; set; } + public int Priority { get; set; } + public bool IsCritical { get; set; } + public string Type { get; set; } + public string IncidentNumber { get; set; } + public string Name { get; set; } + public string NatureOfCall { get; set; } + public string MapPage { get; set; } + public string Notes { get; set; } + public string CompletedNotes { get; set; } + public string Address { get; set; } + public string GeoLocationData { get; set; } + public DateTime LoggedOn { get; set; } + public DateTime LoggedOnUtc { get; set; } + public string ClosedByUserId { get; set; } + public DateTime? ClosedOn { get; set; } + public int State { get; set; } + public bool IsDeleted { get; set; } + public int CallSource { get; set; } + public int DispatchCount { get; set; } + public DateTime? LastDispatchedOn { get; set; } + public string SourceIdentifier { get; set; } + public ICollection Dispatches { get; set; } + //public ICollection Attachments { get; set; } + //public ICollection CallNotes { get; set; } + public string W3W { get; set; } + public ICollection GroupDispatches { get; set; } + public ICollection UnitDispatches { get; set; } + public ICollection RoleDispatches { get; set; } + public string ContactName { get; set; } + public string ContactNumber { get; set; } + public bool Public { get; set; } + public string ExternalIdentifier { get; set; } + public string ReferenceNumber { get; set; } + public List GroupCodesToDispatch { get; set; } + public bool AllCall { get; set; } + + public DepartmentCallResult() + { + Dispatches = new List(); + GroupDispatches = new List(); + UnitDispatches = new List(); + RoleDispatches = new List(); + } + } +} diff --git a/Web/Resgrid.Services/Controllers/Version3/Models/UnitApp/UnitAppPayloadResult.cs b/Web/Resgrid.Services/Controllers/Version3/Models/UnitApp/UnitAppPayloadResult.cs index b4c07509..df6b1cfd 100644 --- a/Web/Resgrid.Services/Controllers/Version3/Models/UnitApp/UnitAppPayloadResult.cs +++ b/Web/Resgrid.Services/Controllers/Version3/Models/UnitApp/UnitAppPayloadResult.cs @@ -27,5 +27,6 @@ public class UnitAppPayloadResult public List UnitRoles { get; set; } public List Priorities { get; set; } public List Departments { get; set; } + public List CallTypes { get; set; } } } diff --git a/Web/Resgrid.Services/Controllers/Version3/NotesController.cs b/Web/Resgrid.Services/Controllers/Version3/NotesController.cs index 12825878..c86aceff 100644 --- a/Web/Resgrid.Services/Controllers/Version3/NotesController.cs +++ b/Web/Resgrid.Services/Controllers/Version3/NotesController.cs @@ -60,6 +60,44 @@ public List GetAllNotes() return results; } + /// + /// Get's all the notes in a department + /// + /// List of NotesResult objects. + [AcceptVerbs("GET")] + public List GetAllUnexpiredNotesByCategory(string category) + { + var results = new List(); + var department = _departmentsService.GetDepartmentById(DepartmentId, false); + + var notes = _notesService.GetNotesForDepartmentFiltered(DepartmentId, department.IsUserAnAdmin(UserId)); + + foreach (var n in notes) + { + if ((n.StartsOn.HasValue || n.StartsOn.Value >= DateTime.UtcNow) && (n.ExpiresOn.HasValue || n.ExpiresOn.Value <= DateTime.UtcNow)) + { + if (!String.IsNullOrWhiteSpace(category) || n.Category.Trim().Equals(category, StringComparison.InvariantCultureIgnoreCase)) + { + var noteResult = new NotesResult(); + noteResult.Nid = n.NoteId; + noteResult.Uid = n.UserId; + noteResult.Ttl = n.Title; + noteResult.Bdy = StringHelpers.StripHtmlTagsCharArray(n.Body).Truncate(100); + noteResult.Adn = n.AddedOn.TimeConverter(department); + noteResult.Cat = n.Category; + noteResult.Clr = n.Color; + + if (n.ExpiresOn.HasValue) + noteResult.Exp = n.ExpiresOn.Value; + + results.Add(noteResult); + } + } + } + + return results; + } + /// /// Gets a specific note by it's Id. /// diff --git a/Web/Resgrid.Services/Controllers/Version3/UnitAppController.cs b/Web/Resgrid.Services/Controllers/Version3/UnitAppController.cs index 89f30c55..a8192e27 100644 --- a/Web/Resgrid.Services/Controllers/Version3/UnitAppController.cs +++ b/Web/Resgrid.Services/Controllers/Version3/UnitAppController.cs @@ -89,6 +89,7 @@ public UnitAppPayloadResult GetUnitAppCoreData() results.UnitRoles = new List(); results.Priorities = new List(); results.Departments = new List(); + results.CallTypes = new List(); var users = _departmentsService.GetAllUsersForDepartment(DepartmentId); var groups = _departmentGroupsService.GetAllDepartmentGroupsForDepartment(DepartmentId); @@ -99,6 +100,7 @@ public UnitAppPayloadResult GetUnitAppCoreData() var units = _unitsService.GetUnitsForDepartment(DepartmentId); var unitTypes = _unitsService.GetUnitTypesForDepartment(DepartmentId); var callPriorites = _callsService.GetCallPrioritesForDepartment(DepartmentId); + var callTypes = _callsService.GetCallTypesForDepartment(DepartmentId); foreach (var user in users) @@ -390,6 +392,18 @@ public UnitAppPayloadResult GetUnitAppCoreData() results.Departments.Add(depRest); } + if (callTypes != null && callTypes.Any()) + { + foreach (var callType in callTypes) + { + var type = new CallTypeResult(); + type.Id = callType.CallTypeId; + type.Name = callType.Type; + + results.CallTypes.Add(type); + } + } + return results; } diff --git a/Web/Resgrid.Services/Hubs/EventingHub.cs b/Web/Resgrid.Services/Hubs/EventingHub.cs index a8a2cc3e..84e6923e 100644 --- a/Web/Resgrid.Services/Hubs/EventingHub.cs +++ b/Web/Resgrid.Services/Hubs/EventingHub.cs @@ -73,5 +73,13 @@ public void CallsUpdated(int departmentId, int id) if (group != null) group.callsUpdated(id); } + + public void DepartmentUpdated(int departmentId) + { + var group = Clients.Group(departmentId.ToString()); + + if (group != null) + group.departmentUpdated(); + } } } diff --git a/Web/Resgrid.Services/Properties/PublishProfiles/FolderProfile.pubxml.user b/Web/Resgrid.Services/Properties/PublishProfiles/FolderProfile.pubxml.user index 11ca5dcb..e044a713 100644 --- a/Web/Resgrid.Services/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/Web/Resgrid.Services/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -6,12 +6,15 @@ by editing this MSBuild file. In order to learn more about this please visit htt - <_PublishTargetUrl>G:\Resgrid\ResgridCore\Web\Resgrid.Services\bin\Release\Publish + <_PublishTargetUrl>G:\Resgrid\_RGApi 03/30/2018 19:04:59 + + 02/26/2020 16:12:11 + 07/22/2015 20:17:46 @@ -108,6 +111,9 @@ by editing this MSBuild file. In order to learn more about this please visit htt 03/30/2018 19:04:59 + + 02/26/2020 16:12:11 + 09/30/2019 07:23:02 @@ -430,7 +436,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt 08/28/2017 09:14:34 - 06/18/2017 13:57:10 + 11/09/2019 00:56:44 07/08/2017 21:53:26 @@ -463,160 +469,166 @@ by editing this MSBuild file. In order to learn more about this please visit htt 06/18/2018 15:49:02 - 09/30/2019 06:57:32 + 02/26/2020 16:12:06 - 09/30/2019 06:57:32 + 02/26/2020 16:12:06 - 09/30/2019 06:57:32 + 02/26/2020 16:12:06 - 09/11/2019 17:09:13 + 11/23/2019 00:11:56 - 09/30/2019 06:57:32 + 02/26/2020 16:12:06 - 09/30/2019 06:57:33 + 02/26/2020 16:12:06 - 09/11/2019 17:09:24 + 11/23/2019 00:11:59 - 09/30/2019 06:57:33 + 02/26/2020 16:12:06 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/11/2019 17:09:49 + 11/23/2019 00:12:00 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/11/2019 17:10:02 + 11/23/2019 00:12:00 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/11/2019 17:10:16 + 11/23/2019 00:12:00 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/11/2019 17:10:38 + 11/23/2019 00:12:00 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/11/2019 17:10:45 + 11/23/2019 00:12:00 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/11/2019 17:10:55 + 11/23/2019 10:42:32 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/11/2019 17:11:10 + 11/23/2019 00:12:00 + + + 02/26/2020 16:12:07 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/11/2019 17:11:22 + 11/23/2019 00:12:00 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/11/2019 17:11:31 + 11/23/2019 00:12:00 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/11/2019 17:11:43 + 11/23/2019 00:12:00 - 09/30/2019 06:57:33 + 02/26/2020 16:12:07 - 09/30/2019 06:57:35 + 02/26/2020 16:12:07 - 09/11/2019 17:11:54 + 11/23/2019 10:42:55 - 09/30/2019 06:57:35 + 02/26/2020 16:12:07 - 09/30/2019 06:57:34 + 02/26/2020 16:12:07 - 09/11/2019 17:12:03 + 11/23/2019 00:12:00 - 09/30/2019 06:57:34 + 02/26/2020 16:12:07 - 09/30/2019 06:57:35 + 02/26/2020 16:12:09 - 09/11/2019 17:12:13 + 01/20/2020 09:28:18 - 09/30/2019 06:57:35 + 02/26/2020 16:12:09 - 09/30/2019 06:57:34 + 02/26/2020 16:12:08 - 09/11/2019 17:09:35 + 11/23/2019 00:12:00 - 09/30/2019 06:57:34 + 02/26/2020 16:12:08 - 09/30/2019 06:57:37 + 02/26/2020 16:12:11 - 09/30/2019 06:57:37 + 02/26/2020 16:12:11 + + + 02/26/2020 16:12:11 - 02/22/2019 14:03:05 + 02/26/2020 13:58:10 08/26/2015 16:33:34 @@ -658,13 +670,16 @@ by editing this MSBuild file. In order to learn more about this please visit htt 08/01/2017 12:20:24 - 11/29/2016 08:40:10 + 11/08/2019 03:49:28 + + + 11/08/2019 03:49:28 11/05/2016 04:55:30 - 09/28/2019 08:54:20 + 02/03/2020 08:03:41 06/27/2017 11:17:34 @@ -774,6 +789,9 @@ by editing this MSBuild file. In order to learn more about this please visit htt 07/22/2015 20:17:46 + + 07/22/2015 20:17:46 + 03/30/2018 19:04:59 @@ -787,7 +805,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt 07/22/2015 20:17:46 - 09/11/2019 17:13:11 + 11/23/2019 00:12:01 09/30/2019 07:22:58 diff --git a/Web/Resgrid.Services/Resgrid.Web.Services.csproj b/Web/Resgrid.Services/Resgrid.Web.Services.csproj index 71e8c17b..e8f655c1 100644 --- a/Web/Resgrid.Services/Resgrid.Web.Services.csproj +++ b/Web/Resgrid.Services/Resgrid.Web.Services.csproj @@ -442,6 +442,11 @@ + + + + + diff --git a/docs/source/installation/index.rst b/docs/source/installation/index.rst index 8158706f..62a7a5a9 100644 --- a/docs/source/installation/index.rst +++ b/docs/source/installation/index.rst @@ -11,13 +11,14 @@ In this section we will go over all the steps needed to get Resgrid running on y Prerequisites & Dependencies **************************** -`Resgrid `_ requires Microsoft .Net Framework 4.6.2 and .Net Core 1.1. and running on a Windows environment, Windows Server is recommended but not required. +`Resgrid `_ requires Microsoft .Net Framework 4.7.2 and .Net Core 1.1. and running on a Windows environment, Windows Server is recommended but not required. .. note:: Please ensure your Windows system is up to date with all Windows and Microsoft updates before installing the Resgrid System. The following server dependencies need to be installed, configured and functional: -* `.Net Framework `_ .NET Framework 4.6.2 (Developer Pack) +* `.Net Framework `_ .NET Framework 4.7.2 (Developer Pack) +* `.Net Core `_ .NET Core 1.1 (Runtime for your architecture x86 or x64) * `RabbitMQ Server `_, version 3.6.0 or newer * `Microsoft SQL Server `_, version 12.0 (SQL 2014) or newer * `Microsoft IIS `_ version installed on Windows 8 or newer or Windows Server 2012 or newer @@ -77,6 +78,9 @@ Installing Microsoft IIS (Webserver) will differ based on what version of Window * - World Wide Web Services - Application Development Features - ISAPI Filters + * - World Wide Web Services + - Application Development Features + - WebSockets Protocol * - World Wide Web Services - Common HTTP Features - Default Document @@ -176,7 +180,13 @@ During the installation of SQL Server you will need to set the collation for the :width: 800 :alt: SQL Server SQL_Latin1_General_CP1_CI_AS Collation -.. note:: If your using a Named SQL server instance, i.e. any SQL instance that's not the default instance and your are supplying the named instance name in the ResgridConfig.json file you will need to use double back slash's in between the server and SQL instance name. For example if you have a named SQL instance SQL2014 on the locally installed SQL server you need to specify the DataSource as "(local)\\SQL2014" with 2 backslashes "\\" in between the server and instance names. +For Resgrid you will need to use the Mixed Mode Authentication setting, this allows SQL server to use it's own internal account in addition to Windows or Domain accounts. Specify any password you wish in the "Enter password" and "Confirm password" boxes (they need to match) this will be your admin or system admin sql password. Also Add Current User to the SQL Server administrators list on this view. + +.. image:: https://raw.githubusercontent.com/resgrid/core/master/misc/images/SQLServerAuth.png + :width: 800 + :alt: SQL Server SQL_Latin1_General_CP1_CI_AS Collation + +.. note:: If your using a Named SQL server instance, i.e. any SQL instance that's not the default instance and your are supplying the named instance name in the ResgridConfig.json file you will need to use double back slash's in between the server and SQL instance name. For example if you have a named SQL instance SQL2014 on the locally installed SQL server you need to specify the DataSource as "(local)\\\\SQL2014" with 2 backslashes "\\" in between the server and instance names. Database Creation ======================= @@ -191,7 +201,43 @@ Once you have Microsoft SQL and Microsoft SQL Management Studio installed; open :width: 800 :alt: Database Creation 2 -Install\\Update Resgrid Schema +You will also need to create a 'ResgridWorkers' database as well with the same options as the Resgrid database. + +.. image:: https://raw.githubusercontent.com/resgrid/core/master/misc/images/SQLDatabaseWorkers.png + :width: 800 + :alt: Database Workers Creation + +Once the databases are created you will need to create a new SQL user for Resgrid to connect to the 2 databases on this SQL Server. You will be using the "SQL Server authentication" mode for this user. + + | Login Name: resgrid_app + | Password: resgrid123 + +.. image:: https://raw.githubusercontent.com/resgrid/core/master/misc/images/SQLServerRGUser.png + :width: 800 + :alt: Database User Setup + +Uncheck "Enforce password expiration" and "User must change password at next login" options on this view. Once you have that setup, click the "User Mapping" page in the upper left hand corner of this window. + +.. image:: https://raw.githubusercontent.com/resgrid/core/master/misc/images/SQLServerRGUser2.png + :width: 800 + :alt: Database User Setup 2 + +Check the checkbox next to "Resgrid" database and then select the "db_owner" database role for this user. Do the same for the "ResgridWorkers" database as well. + +.. warning:: Once your system is setup and you've verified it working we highly creating a new SQL user with a custom Login name and password to secure your installation. Your SQL Server should also not be directly connected to the internet or have any SQL ports directly accessible over the Internet. Review Microsoft's guidance for securing your SQL Server `Securing SQL Server `_ + +SQL Server Network Configuration +======================= + +Resgrid uses TCP/IP based connections to connect to the SQL Server database. By default most installations of SQL Server have TCP/IP disabled by default. To enable, you need to start up the "SQL Server Configuration Manager" application and enable the TCP/IP protocol for the SQL Server Network Configuration. + +.. image:: https://raw.githubusercontent.com/resgrid/core/master/misc/images/SQLServerNetworkConfig.png + :width: 600 + :alt: SQL Configuration Manager + +Note, you will need to restart the system, or at a minimum the SQL Server instance (MSSQLSERVER), for the above change to take effect. If the TCP/IP protocol is already enabled for your install SQL Server instance you can continue without making any changes. + +Install or Update Resgrid Schema ======================= Open up the Windows Command Prompt (cmd) and type: @@ -237,6 +283,10 @@ Run the 'Internet Information Services (IIS) Manager' and expand the top server * - SSL certificate - *Select Any* +.. image:: https://raw.githubusercontent.com/resgrid/core/master/misc/images/IISSetup.png + :width: 600 + :alt: IIS Site Setup + .. list-table:: Resgrid API Website Options :header-rows: 1 @@ -249,10 +299,32 @@ Run the 'Internet Information Services (IIS) Manager' and expand the top server * - Host name: - resgridapi.local +.. image:: https://raw.githubusercontent.com/resgrid/core/master/misc/images/IISSetupAPI.png + :width: 800 + :alt: IIS API Site Setup + +Your IIS Server should look like this for the Websites and Application Pools views: + +.. image:: https://raw.githubusercontent.com/resgrid/core/master/misc/images/IISOverview.png + :width: 800 + :alt: IIS Overview + +.. image:: https://raw.githubusercontent.com/resgrid/core/master/misc/images/IISApps.png + :width: 800 + :alt: IIS Application Pools + .. important:: If you don't have a valid SSL certificate you can create a self-signed certificate by using `these instructions `_. You cannot use a self-signed certificate for the resgridapi IIS website as self-signed certificated will be rejected by the applications. We *HIGHLY* recommend you get valid SSL Certificates from a trusted vender and have both the resgrid and resgridapi protected by those. .. note:: If you are using a Self Signed or Development SSL certificate you will get a Certificate Warning using any modern web browser. If your url is pointing to localhost,127.0.0.1,resgrid.local or resgridapi.local it is safe to proceed to the website and bypass that certificate error. We do not recommend doing that on public websites. +DotNetCore Hosting Module +======================= + +Once your IIS Server is setup and you've created the web applications you will need to install the .Net Core 1.1 Server Hosting bundle, this allows the Resgrid web application to run under IIS. + +You can download the Hosting Bundle from the `Microsoft Download Center `_ + + Initial Web Login **************************** diff --git a/misc/images/IISApps.png b/misc/images/IISApps.png new file mode 100644 index 00000000..554e3a20 Binary files /dev/null and b/misc/images/IISApps.png differ diff --git a/misc/images/IISOverview.png b/misc/images/IISOverview.png new file mode 100644 index 00000000..4f99f4e6 Binary files /dev/null and b/misc/images/IISOverview.png differ diff --git a/misc/images/IISSetup.png b/misc/images/IISSetup.png new file mode 100644 index 00000000..bea3bcd8 Binary files /dev/null and b/misc/images/IISSetup.png differ diff --git a/misc/images/IISSetupAPI.png b/misc/images/IISSetupAPI.png new file mode 100644 index 00000000..bc37d774 Binary files /dev/null and b/misc/images/IISSetupAPI.png differ diff --git a/misc/images/SQLDatabaseWorkers.png b/misc/images/SQLDatabaseWorkers.png new file mode 100644 index 00000000..e6a3d1dc Binary files /dev/null and b/misc/images/SQLDatabaseWorkers.png differ diff --git a/misc/images/SQLServerAuth.png b/misc/images/SQLServerAuth.png new file mode 100644 index 00000000..db8a3af9 Binary files /dev/null and b/misc/images/SQLServerAuth.png differ diff --git a/misc/images/SQLServerNetworkConfig.png b/misc/images/SQLServerNetworkConfig.png new file mode 100644 index 00000000..520477c5 Binary files /dev/null and b/misc/images/SQLServerNetworkConfig.png differ diff --git a/misc/images/SQLServerRGUser.png b/misc/images/SQLServerRGUser.png new file mode 100644 index 00000000..2789c808 Binary files /dev/null and b/misc/images/SQLServerRGUser.png differ diff --git a/misc/images/SQLServerRGUser2.png b/misc/images/SQLServerRGUser2.png new file mode 100644 index 00000000..1c84b1ae Binary files /dev/null and b/misc/images/SQLServerRGUser2.png differ