Small changes including #666

pull/733/head
Jamie.Rees 8 years ago
parent 39888a4b94
commit f73d12e095

3
.gitattributes vendored

@ -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

@ -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]);
}());
} ());

@ -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"
};

@ -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; }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="StartupOptions"/> is updated.
/// </summary>
/// <value>
/// <c>true</c> if updated; otherwise, <c>false</c>.
/// </value>
[Option('l', "listenerprefix", Required = false, HelpText = "To change the prefix for the listener")]
public string ListenerPrefix { get; set; }
}
}

@ -73,8 +73,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-user"></i> @UI.Layout_Welcome @Context.Request.Session[SessionKeys.UsernameKey] <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="@url/login?redirect=@Context.Request.Path"><i class="fa fa-user"></i> @UI.Layout_Admin</a></li>
<li class="divider"></li>
<li><a href="@url/changepassword"><i class="fa fa-key"></i> @UI.Layout_ChangePassword</a></li>
<li><a href="@url/userlogin/logout"><i class="fa fa-sign-out"></i> @UI.Layout_Logout</a></li>
</ul>
</li>

@ -53,38 +53,9 @@
{
<text>
generateNotify('@nullableError',"warning");
generateNotify('@nullableError', "warning");
</text>
}
@*$('#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");
}
});
});*@
});
</script>

@ -50,6 +50,7 @@
<button ng-click="updateUser()" class="btn btn-primary-outline">Update</button>
<button ng-click="deleteUser()" class="btn btn-danger-outline">Delete</button>
<button ng-click="closeSidebarClick()" style="float: right; margin-right: 10px;" class="btn btn-danger-outline">Close</button>
</div>
</div>

Loading…
Cancel
Save