Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie.Rees authored and Jamie.Rees committed Dec 16, 2016
1 parent a4b0e9e commit 3339808
Show file tree
Hide file tree
Showing 11 changed files with 382 additions and 0 deletions.
1 change: 1 addition & 0 deletions PlexRequests.Core/IStatusChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ namespace PlexRequests.Core
public interface IStatusChecker
{
Task<StatusModel> GetStatus();
Task<Issue> ReportBug(string title, string body);
}
}
11 changes: 11 additions & 0 deletions PlexRequests.Core/StatusChecker/StatusChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,16 @@ private StatusModel GetAppveyorRelease(Branches branch)

return model;
}

public async Task<Issue> ReportBug(string title, string body)
{
var issue = new NewIssue(title)
{
Body = body
};
var result = await Git.Issue.Create(Owner, RepoName, issue);

return result;
}
}
}
76 changes: 76 additions & 0 deletions PlexRequests.Helpers/OperatingSystemHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: OperatingSystemHelper.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Helpers
{
public static class OperatingSystemHelper
{
public static string GetOs()
{
var os = System.Environment.OSVersion;
var osVersion = os.Version;
if (osVersion.Major.Equals(10))
{
return "Windows 10/Windows Server 2016";
}
if (osVersion.Major.Equals(6))
{
if (osVersion.Minor.Equals(3))
{
return "Windows 8.1/Windows Server 2012 R2";
}
if (osVersion.Minor.Equals(2))
{
return "Windows 8/Windows Server 2012";
}
if (osVersion.Minor.Equals(1))
{
return "Windows 7/Windows Server 2008 R2";
}
if (osVersion.Minor.Equals(0))
{
return "Windows Vista/Windows Server 2008";
}
}
if (osVersion.Major.Equals(5))
{
if (osVersion.Minor.Equals(2))
{
return "Windows XP 64-Bit Edition/Windows Server 2003";
}
if (osVersion.Minor.Equals(1))
{
return "Windows XP";
}
if (osVersion.Minor.Equals(0))
{
return "Windows 2000";
}
}
return os.VersionString;
}
}
}
1 change: 1 addition & 0 deletions PlexRequests.Helpers/PlexRequests.Helpers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<Compile Include="LoggingHelper.cs" />
<Compile Include="MemoryCacheProvider.cs" />
<Compile Include="ObjectCopier.cs" />
<Compile Include="OperatingSystemHelper.cs" />
<Compile Include="PasswordHasher.cs" />
<Compile Include="EnumExtensions.cs" />
<Compile Include="Permissions\Features.cs" />
Expand Down
6 changes: 6 additions & 0 deletions PlexRequests.UI/Content/helpers/bootbox.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions PlexRequests.UI/Helpers/BaseUrlHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#endregion
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
using Nancy;
using Nancy.ViewEngines.Razor;

Expand Down Expand Up @@ -233,6 +234,16 @@ public static IHtmlString LoadUserManagementAssets(this HtmlHelpers helper)
return helper.Raw(sb.ToString());
}

public static IHtmlString LoadAsset(this HtmlHelpers helper, string contentPath, bool javascript)
{
var assetLocation = GetBaseUrl();
var content = GetContentUrl(assetLocation);
if (javascript)
{
return helper.Raw($"<script src=\"{content}{contentPath}?v={Assembly}\" type=\"text/javascript\"></script>");
}
return helper.Raw($"<link rel=\"stylesheet\" type=\"text/css\" href=\"{content}{contentPath}?v={Assembly}\" />");
}

public static IHtmlString LoadTableAssets(this HtmlHelpers helper)
{
Expand Down
37 changes: 37 additions & 0 deletions PlexRequests.UI/Models/AboutAdminViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: AboutAdminViewModel.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.UI.Models
{
public class AboutAdminViewModel
{
public string Os { get; set; } // Windows/Mono
public string SystemVersion { get; set; } // Windows 10/ mono 4.2.5
public string ApplicationVersion { get; set; } // File Version
public string Branch { get; set; }
public string LogLevel { get; set; }
}
}
Loading

0 comments on commit 3339808

Please sign in to comment.