Skip to content

Commit

Permalink
remove index size from footer
Browse files Browse the repository at this point in the history
  • Loading branch information
kreeben committed Nov 10, 2019
1 parent a4545a3 commit 368a82f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
11 changes: 3 additions & 8 deletions src/Sir.HttpServer/Controllers/UIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ namespace Sir.HttpServer.Controllers
{
public abstract class UIController : Controller
{
private readonly IConfigurationProvider _config;
private readonly ISessionFactory _sessionFactory;
private IConfigurationProvider config;

protected IConfigurationProvider Config { get { return _config; } }
protected IConfigurationProvider Config { get; }

public UIController(IConfigurationProvider config, ISessionFactory sessionFactory)
{
_config = config;
Config = config;
_sessionFactory = sessionFactory;
}

Expand All @@ -24,11 +23,7 @@ protected UIController(IConfigurationProvider config)

public override void OnActionExecuted(ActionExecutedContext context)
{
ViewBag.DefaultCollection = _config.Get("default_collection");

ViewData["doc_count"] = context.HttpContext.Request.Query.ContainsKey("collection") ?
_sessionFactory.GetDocCount(context.HttpContext.Request.Query["collection"].ToString()) :
_sessionFactory.GetDocCount(ViewBag.DefaultCollection);
ViewBag.DefaultCollection = Config.Get("default_collection");

ViewBag.Collection = context.HttpContext.Request.Query.ContainsKey("collection") ?
context.HttpContext.Request.Query["collection"].ToString() :
Expand Down
8 changes: 0 additions & 8 deletions src/Sir.HttpServer/Views/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@
<footer>
<div>
<p>Non-tracking search (powered by <a href="https://github.com/kreeben/resin" title="Resin v0.3">Resin</a>).</p>
@if (ViewData["doc_count"] != null)
{
<p>Index size ~ @ViewData["doc_count"] documents</p>
}
@if (ViewData["last_processed_url"] != null)
{
<p>Last crawled: <a href="@ViewData["last_processed_url"]">@ViewData["last_processed_title"]</a></p>
}
<p>
<a href="/submit/page?collection=@ViewBag.Collection">Submit URL</a>
@if (!string.IsNullOrWhiteSpace(ViewBag.Collection as string) && ViewBag.Collection != ViewBag.DefaultCollection)
Expand Down

0 comments on commit 368a82f

Please sign in to comment.