Skip to content

Commit

Permalink
fix(IpfsServer): browsing to the parent
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed May 29, 2019
1 parent b0e9276 commit 7afa69d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions IpfsServer/Pages/ipfs.cshtml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
@page "{*Path}"
@model IpfsModel
@{
ViewData["Title"] = Model.Path;
}

<h4>Index of <span class="hex">@Model.Path</span></h4>

<table class="table">
<tbody>
@if (@Model.PathParts.Count() > 1)
{
<tr>
<td>
<span class="glyphicon glyphicon-level-up" aria-hidden="true"></span>
<a href="/ipfs/@Model.Parent"><i>(parent)</i></a>
</td>
</tr>
<tr>
<td>
<span class="glyphicon glyphicon-level-up" aria-hidden="true"></span>
<a href="/ipfs/@Model.Parent/"><i>(parent)</i></a>
</td>
</tr>
}
@foreach (var f in @Model.Directories)
{
<tr>
<td>
<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
<a href="/ipfs/@Model.Path/@f.Name">@f.Name</a>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion src/CoreApi/GenericApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public GenericApi(IpfsEngine ipfs)
var container = await ipfs.Object.GetAsync(id, cancel).ConfigureAwait(false);
var link = container.Links.FirstOrDefault(l => l.Name == child);
if (link == null)
throw new ArgumentException($"Cannot resolve '{name}'.");
throw new ArgumentException($"Cannot resolve '{child}' in '{name}'.");
id = link.Id;
}

Expand Down

0 comments on commit 7afa69d

Please sign in to comment.