mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
Done most on #59
This commit is contained in:
parent
0585ff73ec
commit
c7ac8a7d99
32 changed files with 345 additions and 2283 deletions
118
PlexRequests.UI/Views/Admin/Logs.cshtml
Normal file
118
PlexRequests.UI/Views/Admin/Logs.cshtml
Normal file
|
@ -0,0 +1,118 @@
|
|||
@Html.Partial("_Sidebar")
|
||||
|
||||
<div class="col-sm-8 col-sm-push-1">
|
||||
<fieldset>
|
||||
<legend>Logs</legend>
|
||||
|
||||
<form method="post" id="mainForm" action="/admin/loglevel">
|
||||
<div class="form-group">
|
||||
<label for="logLevel" class="control-label">Log Level</label>
|
||||
<div id="logLevel">
|
||||
<select class="form-control" id="selected">
|
||||
<option id="Trace" value="0">Trace</option>
|
||||
<option id="Debug" value="1">Debug</option>
|
||||
<option id="Info" value="2">Info</option>
|
||||
<option id="Warn" value="3">Warn</option>
|
||||
<option id="Error" value="4">Error</option>
|
||||
<option id="Fatal" value="5">Fatal</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="save" type="submit" class="btn btn-primary-outline ">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<table class="table table-striped table-hover table-responsive">
|
||||
<tr>
|
||||
<th>Message</th>
|
||||
<th>Logger</th>
|
||||
<th>Exception</th>
|
||||
<th>Callsite</th>
|
||||
<th>Log Level</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
@foreach (var m in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@m.Message
|
||||
</td>
|
||||
<td>
|
||||
@m.Logger
|
||||
</td>
|
||||
<td>
|
||||
@m.Exception
|
||||
</td>
|
||||
<td>
|
||||
@m.Callsite
|
||||
</td>
|
||||
<td>
|
||||
@m.Level
|
||||
</td>
|
||||
<td>
|
||||
@m.Date
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/loglevel",
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
$("#select > option").each(function (level) {
|
||||
if (response[0] == level.value) {
|
||||
$('#' + level.target.id).prop("selected", "selected");
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
|
||||
$('#save').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var logLevel = $("#logLevel option:selected").val();
|
||||
|
||||
var $form = $("#mainForm");
|
||||
var data = "level=" + logLevel;
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop("method"),
|
||||
data: data,
|
||||
url: $form.prop("action"),
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.result === true) {
|
||||
generateNotify(response.message, "success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
|
@ -70,7 +70,14 @@
|
|||
{
|
||||
<a class="list-group-item" href="/admin/pushbulletnotification">Pushbullet Notifications</a>
|
||||
}
|
||||
|
||||
@if (Context.Request.Path == "/admin/logs")
|
||||
{
|
||||
<a class="list-group-item active" href="/admin/logs">Logs</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="list-group-item" href="/admin/logs">Logs</a>
|
||||
}
|
||||
@if (Context.Request.Path == "/admin/status")
|
||||
{
|
||||
<a class="list-group-item active" href="/admin/status">Status</a>
|
||||
|
|
|
@ -57,26 +57,26 @@
|
|||
{
|
||||
<li><a href="/requests">Requests</a></li>
|
||||
}
|
||||
@if (Context.CurrentUser.IsAuthenticated())
|
||||
{
|
||||
if (Context.Request.Path == "/admin")
|
||||
{
|
||||
<li class="active"><a href="/admin">Admin</a></li>
|
||||
}
|
||||
else
|
||||
{
|
||||
<li><a href="/admin">Admin</a></li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
|
||||
|
||||
|
||||
@if (!Context.CurrentUser.IsAuthenticated())
|
||||
{
|
||||
<li><a href="/login">Admin</a></li>
|
||||
}
|
||||
else
|
||||
{
|
||||
<li><a href="/logout">Admin Logout</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Admin <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="/admin">Settings</a></li>
|
||||
<li><a href="#">User Management</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
}
|
||||
@if (Context.Request.Session[SessionKeys.UsernameKey] != null)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue