blob: c586b9050e14697ca89fabfe636c2d18a4ecf6f5 [file] [log] [blame]
<ol class="breadcrumb">
<li>
<a class="badge badge-type" href="#">Master</a>
</li>
<li>
<a class="badge badge-type" href="#/agents/{{agent_id}}" title="{{agent_id}}">
Agent</a>
</li>
<li class="active">
Browse
</li>
</ol>
<ol class="breadcrumb">
<!-- We want to ensure that if the user highlights the path breadcrumb,
and copies it, they will receive a /path/without/spaces that they
can then paste into a terminal, or elsewhere. In order to do this,
we have to ensure there is no whitespace within the <a> tag contents.
Also, we have to inject a hidden '/' character because the slashes
in the breadcrumb are not copied.
-->
<li ng-repeat="dir in path.split('/')"><a
href="#/agents/{{agent_id}}/browse?path={{
encodeURIComponent(path.split('/').slice(0, $index + 1).join('/'))
}}">{{dir}}</a><span class="hidden-text">/</span></li>
</ol>
<div class="alert alert-error hidden" id="alert">
<button class="close" data-dismiss="alert">×</button>
<strong>{{alert_message}}</strong>
</div>
<div class="row" id="listing">
<div class="col-md-9">
<div class="well">
<div data-ng-show="listing.length == 0">
No files in this directory.
</div>
<table class="table table-condensed" data-ng-show="listing.length > 0">
<thead>
<tr>
<th>mode</th>
<th class="text-right">nlink</th>
<th>uid</th>
<th>gid</th>
<th class="text-right">size</th>
<th class="text-right">mtime</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="file in listing | orderBy:['-mode', 'path']">
<td>{{file.mode}}</td>
<td class="text-right">{{file.nlink}}</td>
<td>{{file.uid}}</td>
<td>{{file.gid}}</td>
<td class="text-right">{{file.size | dataSize}}</td>
<td class="text-right">{{file.mtime * 1000 | unixDate}}</td>
<td>
<span data-ng-show="file.mode[0] == 'd'">
<i class="glyphicon glyphicon-folder-close"></i>
<a href="#/agents/{{agent_id}}/browse?path={{encodeURIComponent(file.path)}}">
{{basename(file.path)}}
</a>
</span>
<span data-ng-show="file.mode[0] != 'd'">
<i class="glyphicon glyphicon-file" style="visibility: hidden;"></i>
<a href="" ng-click="pail($event, encodeURIComponent(file.path))">
{{basename(file.path)}}
</a>
</span>
</td>
<td>
<a data-ng-show="file.mode[0] != 'd'"
href="//{{agent_host}}/files/download?path={{encodeURIComponent(file.path)}}">
<button class="btn btn-xs btn-default" type="button">
Download
</button>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>