From f73d12e095cb40d2bffbb6f4311a3448de9240ee Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 18 Nov 2016 09:07:11 +0000 Subject: [PATCH] Small changes including #666 --- .gitattributes | 3 -- .../userManagementController.js | 24 ++++++++------ PlexRequests.UI/Program.cs | 13 ++++++-- PlexRequests.UI/Start/StartupOptions.cs | 10 ++++++ .../Views/Shared/Partial/_Navbar.cshtml | 3 +- PlexRequests.UI/Views/UserLogin/Index.cshtml | 31 +------------------ .../Views/UserManagement/Index.cshtml | 1 + 7 files changed, 38 insertions(+), 47 deletions(-) diff --git a/.gitattributes b/.gitattributes index 210f21789..4bf8b8c28 100644 --- a/.gitattributes +++ b/.gitattributes @@ -66,6 +66,3 @@ PlexRequests.UI/Content/* linguist-vendored PlexRequests.UI/Content/* linguist-vendored base.scss linguist-vendored=false -requests-1.7.js linguist-vendored=false -search-1.7.js linguist-vendored=false -site-1.7.js linguist-vendored=false diff --git a/PlexRequests.UI/Content/app/userManagement/userManagementController.js b/PlexRequests.UI/Content/app/userManagement/userManagementController.js index cb4189529..3cad457f0 100644 --- a/PlexRequests.UI/Content/app/userManagement/userManagementController.js +++ b/PlexRequests.UI/Content/app/userManagement/userManagementController.js @@ -136,15 +136,15 @@ $scope.deleteUser = function () { var u = $scope.selectedUser; userManagementService.deleteUser(u.id) - .then(function sucess(data) { - if (data.data.result) { - removeUser(u.id, true); - closeSidebar(); - return successCallback("Deleted User", "success"); - } - }, function errorCallback(response) { - successCallback(response, "danger"); - }); + .then(function sucess(data) { + if (data.data.result) { + removeUser(u.id, true); + closeSidebar(); + return successCallback("Deleted User", "success"); + } + }, function errorCallback(response) { + successCallback(response, "danger"); + }); } $scope.formatDate = function (utcDate) { @@ -159,6 +159,10 @@ return; } + $scope.closeSidebarClick = function() { + return closeSidebar(); + } + function removeUser(id, current) { $scope.users = $scope.users.filter(function (user) { return user.id !== id; @@ -182,4 +186,4 @@ angular.module('PlexRequests').controller('userManagementController', ["$scope", "userManagementService", "moment", controller]); -}()); \ No newline at end of file +} ()); \ No newline at end of file diff --git a/PlexRequests.UI/Program.cs b/PlexRequests.UI/Program.cs index d71a3976c..2153aca13 100644 --- a/PlexRequests.UI/Program.cs +++ b/PlexRequests.UI/Program.cs @@ -59,11 +59,15 @@ namespace PlexRequests.UI var baseUrl = result.MapResult( o => o.BaseUrl, e => string.Empty); - + var port = result.MapResult( x => x.Port, e => -1); + var listenerPrefix = result.MapResult( + x => x.ListenerPrefix, + e => string.Empty); + var updated = result.MapResult(x => x.Updated, e => UpdateValue.None); CheckUpdate(updated); @@ -81,7 +85,12 @@ namespace PlexRequests.UI if (port == -1 || port == 3579) port = GetStartupPort(); - var options = new StartOptions(Debugger.IsAttached ? $"http://localhost:{port}" : $"http://+:{port}") + if (string.IsNullOrEmpty(listenerPrefix)) + { + listenerPrefix = "+"; + } + + var options = new StartOptions(Debugger.IsAttached ? $"http://localhost:{port}" : $"http://{listenerPrefix}:{port}") { ServerFactory = "Microsoft.Owin.Host.HttpListener" }; diff --git a/PlexRequests.UI/Start/StartupOptions.cs b/PlexRequests.UI/Start/StartupOptions.cs index 0f3dd7d97..f7d479186 100644 --- a/PlexRequests.UI/Start/StartupOptions.cs +++ b/PlexRequests.UI/Start/StartupOptions.cs @@ -59,5 +59,15 @@ namespace PlexRequests.UI.Start [Option('u', "updated", Required = false, HelpText = "This should only be used by the internal application")] public UpdateValue Updated { get; set; } + + /// + /// Gets or sets a value indicating whether this is updated. + /// + /// + /// true if updated; otherwise, false. + /// + [Option('l', "listenerprefix", Required = false, HelpText = "To change the prefix for the listener")] + public string ListenerPrefix { get; set; } + } } \ No newline at end of file diff --git a/PlexRequests.UI/Views/Shared/Partial/_Navbar.cshtml b/PlexRequests.UI/Views/Shared/Partial/_Navbar.cshtml index 1f2f1b232..008884542 100644 --- a/PlexRequests.UI/Views/Shared/Partial/_Navbar.cshtml +++ b/PlexRequests.UI/Views/Shared/Partial/_Navbar.cshtml @@ -73,8 +73,7 @@ diff --git a/PlexRequests.UI/Views/UserLogin/Index.cshtml b/PlexRequests.UI/Views/UserLogin/Index.cshtml index 1dd021d7d..ce03d5e45 100644 --- a/PlexRequests.UI/Views/UserLogin/Index.cshtml +++ b/PlexRequests.UI/Views/UserLogin/Index.cshtml @@ -53,38 +53,9 @@ { - generateNotify('@nullableError',"warning"); + generateNotify('@nullableError', "warning"); } - - @*$('#loginBtn').click(function (e) { - e.preventDefault(); - var $form = $("#loginForm"); - var formData = $form.serialize(); - var dtOffset = new Date().getTimezoneOffset(); - formData += ('&DateTimeOffset=' + dtOffset); - - $.ajax({ - type: $form.prop("method"), - url: $form.prop("action"), - data: formData, - dataType: "json", - success: function (response) { - console.log(response); - if (response.result === true) { - location.replace(response.message); - - } else { - generateNotify(response.message, "warning"); - } - }, - error: function (e) { - console.log(e); - generateNotify("@UI.Javascript_SomethingWentWrong", "danger"); - } - }); - });*@ - }); \ No newline at end of file diff --git a/PlexRequests.UI/Views/UserManagement/Index.cshtml b/PlexRequests.UI/Views/UserManagement/Index.cshtml index d0cd11dc1..eb01aa8c9 100644 --- a/PlexRequests.UI/Views/UserManagement/Index.cshtml +++ b/PlexRequests.UI/Views/UserManagement/Index.cshtml @@ -50,6 +50,7 @@ +