Updated task notification UI. Last message will stay on screen for an extra 3 seconds if there are no new messages.

pull/4/head
kay.one 14 years ago
parent 53a7b92a64
commit 0d139f9c21

@ -41,7 +41,7 @@ namespace NzbDrone.Core.Model.Notification
/// <value>The percent complete.</value> /// <value>The percent complete.</value>
public int PercentComplete public int PercentComplete
{ {
get { return Convert.ToInt32(Convert.ToDouble(ProgressValue)/Convert.ToDouble(ProgressMax)*100); } get { return Convert.ToInt32(Convert.ToDouble(ProgressValue) / Convert.ToDouble(ProgressMax) * 100); }
} }
/// <summary> /// <summary>
@ -56,11 +56,30 @@ namespace NzbDrone.Core.Model.Notification
/// <value>The progress value.</value> /// <value>The progress value.</value>
public int ProgressValue { get; set; } public int ProgressValue { get; set; }
private ProgressNotificationStatus _status;
/// <summary> /// <summary>
/// Gets or sets the status. /// Gets or sets the status.
/// </summary> /// </summary>
/// <value>The status.</value> /// <value>The status.</value>
public ProgressNotificationStatus Status { get; set; } public ProgressNotificationStatus Status
{
get { return _status; }
set
{
if (value != ProgressNotificationStatus.InProgress)
{
CompletedTime = DateTime.Now;
}
_status = value;
}
}
/// <summary>
/// Gets the completed time.
/// </summary>
public DateTime CompletedTime { get; private set; }
#region IDisposable Members #region IDisposable Members

@ -52,8 +52,8 @@ namespace NzbDrone.Core.Providers.Jobs
updatedSeries.Title); updatedSeries.Title);
_episodeProvider.RefreshEpisodeInfo(updatedSeries.SeriesId); _episodeProvider.RefreshEpisodeInfo(updatedSeries.SeriesId);
notification.CurrentStatus = String.Format("Scanning series folder {0}", notification.CurrentStatus = String.Format("Scanning disk for {0} files",
updatedSeries.Path); updatedSeries.Title);
_mediaFileProvider.Scan(_seriesProvider.GetSeries(updatedSeries.SeriesId)); _mediaFileProvider.Scan(_seriesProvider.GetSeries(updatedSeries.SeriesId));
} }

@ -44,6 +44,7 @@ namespace NzbDrone.Core.Providers.Jobs
_seriesProvider.UpdateSeriesInfo(series.SeriesId); _seriesProvider.UpdateSeriesInfo(series.SeriesId);
notification.CurrentStatus = "Updating episode info for " + series.Title; notification.CurrentStatus = "Updating episode info for " + series.Title;
_episodeProvider.RefreshEpisodeInfo(series.SeriesId); _episodeProvider.RefreshEpisodeInfo(series.SeriesId);
notification.CurrentStatus = "Update completed for " + series.Title;
} }
} }
} }

@ -24,9 +24,17 @@ namespace NzbDrone.Core.Providers
{ {
get get
{ {
return
new List<ProgressNotification>( var activeNotification = _progressNotification.Values.Where(p => p.Status == ProgressNotificationStatus.InProgress).ToList();
_progressNotification.Values.Where(p => p.Status == ProgressNotificationStatus.InProgress));
if (activeNotification.Count == 0)
{
//Get notifications that were recently done
activeNotification = _progressNotification.Values.Where(p => p.CompletedTime >= DateTime.Now.AddSeconds(-3)).OrderByDescending(c => c.CompletedTime).ToList();
}
return activeNotification.ToList();
} }
} }

@ -1,9 +1,8 @@
#msgBox #msgBox
{ {
display: none; display: none;
height: 40px; height: 30px;
background-color: #272525; background-color: #272525;
background-image: url(images/spin.gif) no-repeat left middle;
opacity: .9; opacity: .9;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)";
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85); filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85);
@ -12,13 +11,10 @@
position: fixed; position: fixed;
z-index: 99; z-index: 99;
bottom: 0; bottom: 0;
right: 0;
font-size: 20px; font-size: 20px;
color: White; color: White;
width: 100% text-align: center;
margin-right: auto;
width: 85%;
margin-left: auto;
min-width: 800px;
} }
#msgCloseButton #msgCloseButton
{ {

@ -4,7 +4,7 @@ $(function () {
refreshNotifications(); refreshNotifications();
var timer = window.setInterval(function () { var timer = window.setInterval(function () {
speed = 1000; speed = 500;
refreshNotifications(); refreshNotifications();
}, 2000); }, 2000);

@ -1,53 +1,48 @@
@using Helpers; @using Helpers;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head runat="server"> <head runat="server">
<link rel="SHORTCUT ICON" href="../../favicon.ico"/> <link rel="SHORTCUT ICON" href="../../favicon.ico" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>NZBDrone</title> <title>NZBDrone</title>
@{Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css") @{Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css")
.Add("telerik.sitefinity.css") .Add("telerik.sitefinity.css")
.Add("notibar.css")) .Add("notibar.css"))
.Render();} .Render();}
<link href="../../Content/style.css" rel="stylesheet" type="text/css" />
<link href="../../Content/style.css" rel="stylesheet" type="text/css" /> <link href="../../Content/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="../../Content/jquery-ui.css" rel="stylesheet" type="text/css" /> <link href="../../Content/jquery-ui.custom.css" rel="stylesheet" type="text/css" />
<link href="../../Content/jquery-ui.custom.css" rel="stylesheet" type="text/css" /> @RenderSection("HeaderContent", required: false)
</head>
@RenderSection("HeaderContent", required: false) <body>
</head> <div id="centered">
<body> <div id="menu">
<div id="centered"> <ul>
<div id="menu"> @MvcHtmlString.Create(Html.CurrentActionLink("Series", "Index", "Series"))
<ul> @MvcHtmlString.Create(Html.CurrentActionLink("Upcoming", "Index", "Upcoming"))
@MvcHtmlString.Create(Html.CurrentActionLink("Series", "Index", "Series")) @MvcHtmlString.Create(Html.CurrentActionLink("History", "Index", "History"))
@MvcHtmlString.Create(Html.CurrentActionLink("Upcoming", "Index", "Upcoming")) @MvcHtmlString.Create(Html.CurrentActionLink("Settings", "Index", "Settings"))
@MvcHtmlString.Create(Html.CurrentActionLink("History", "Index", "History")) @MvcHtmlString.Create(Html.CurrentActionLink("Logs", "Index", "Log"))
@MvcHtmlString.Create(Html.CurrentActionLink("Settings", "Index", "Settings")) </ul>
@MvcHtmlString.Create(Html.CurrentActionLink("Logs", "Index", "Log"))
</ul>
</div>
<div id="logo">
@RenderSection("TitleContent", required: false)
</div>
<div id="page">
@RenderSection("ActionMenu", required: false)
@RenderSection("MainContent", required: false)
@RenderBody()
</div>
<div id="footer">
@{Html.RenderAction("Footer", "Shared");}
</div>
<div id="msgBox">
<span id="msgText">Scanning Series Folder...</span>
</div>
</div> </div>
</body> <div id="logo">
@RenderSection("TitleContent", required: false)
@RenderSection("Scripts", required: false) </div>
<div id="page">
@{Html.Telerik().ScriptRegistrar().Scripts( @RenderSection("ActionMenu", required: false)
@RenderSection("MainContent", required: false)
@RenderBody()
</div>
<div id="footer">
@{Html.RenderAction("Footer", "Shared");}
</div>
</div>
<div id="msgBox">
<span id="msgText">Scanning Series Folder...</span>
</div>
</body>
@RenderSection("Scripts", required: false)
@{Html.Telerik().ScriptRegistrar().Scripts(
c => c.Add("jquery-ui-1.8.8.min.js") c => c.Add("jquery-ui-1.8.8.min.js")
.Add("jquery.form.js") .Add("jquery.form.js")
.Add("jquery.jgrowl.js") .Add("jquery.jgrowl.js")

Loading…
Cancel
Save