got it
This commit is contained in:
parent
a737338278
commit
9b53de6cd6
|
@ -344,26 +344,40 @@ app.controller('websiteCtrl', [
|
|||
window.alert(JSON.stringify(result));
|
||||
});
|
||||
};
|
||||
|
||||
// TODO: finish thissssssss
|
||||
vm.breadcrumbs = ['Root'];
|
||||
vm.breadcrumbsPath = ['/'];
|
||||
vm.Sites.contents = function (r) {
|
||||
vm.siteResults = r;
|
||||
vm.directoryPath = r.newPath;
|
||||
vm.showListFiles = true;
|
||||
vm.siteDirectories = [];
|
||||
vm.siteFiles = [];
|
||||
var pkg = Auth.oauth3.pkg('www@daplie.com');
|
||||
vm.getSiteContents = function (site) {
|
||||
vm.getSiteContents = function (site, newPath) {
|
||||
newPath = site;
|
||||
site = vm.siteResults;
|
||||
function updatePath (path) {
|
||||
if (typeof path !== 'object') {
|
||||
vm.breadcrumbs.push(path);
|
||||
vm.breadcrumbsPath.push(path);
|
||||
}
|
||||
}
|
||||
updatePath(newPath);
|
||||
return pkg.contents({
|
||||
hostname: site.domain,
|
||||
domain: site.domain,
|
||||
tld: site.tld,
|
||||
sld: site.sld,
|
||||
//, sub: r.sub,
|
||||
path: site.newPath
|
||||
path: vm.breadcrumbsPath.join('/')
|
||||
}).then(function (result) {
|
||||
vm.folderStructure = result;
|
||||
result.data.forEach(function(file) {
|
||||
if (file.directory) {
|
||||
vm.siteDirectories.push(file.name);
|
||||
} else if (file.file) {
|
||||
vm.siteFiles.push(file.name);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -371,9 +385,17 @@ app.controller('websiteCtrl', [
|
|||
vm.getSiteContents(r);
|
||||
};
|
||||
|
||||
vm.doSomething = function (path) {
|
||||
vm.newPath = data;
|
||||
vm.getSiteContents(path);
|
||||
vm.getDirectories = function (path) {
|
||||
vm.siteDirectories = [];
|
||||
vm.siteFiles = [];
|
||||
var site = vm.siteResults;
|
||||
vm.directoryPath = path;
|
||||
vm.getSiteContents(path, site);
|
||||
};
|
||||
|
||||
vm.doSomething = function (x) {
|
||||
console.log('path requested', x);
|
||||
console.log('current path', vm.breadcrumbsPath);
|
||||
};
|
||||
|
||||
vm.Shares = {};
|
||||
|
|
|
@ -173,9 +173,9 @@
|
|||
</form>
|
||||
<form class="form-inline text-center">
|
||||
<h4 class="text-left">List Files:</h4>
|
||||
<div class="form-group">
|
||||
<!-- <div class="form-group">
|
||||
<input type="text" class="form-control" ng-model="r.newPath" placeholder="Ex: Directory Name" />
|
||||
</div>
|
||||
</div> -->
|
||||
<button class="btn btn-info trigger-search" ng-click="vm.Sites.contents(r)">List Files</button>
|
||||
<div class="white-well" ng-show="vm.showListFiles">
|
||||
<button type="button" class="close" ng-click="vm.showListFiles = false" ng-show="vm.showListFiles"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<div class="text-left">
|
||||
<div class="row">
|
||||
<ul class="breadcrumb">
|
||||
<li ng-repeat="breadcrumb in vm.breadcrumbs">
|
||||
<a>{{ breadcrumb }}</a>
|
||||
<li ng-repeat="breadcrumb in vm.breadcrumbs track by $index">
|
||||
<a ng-click="vm.doSomething(breadcrumb)" data="{{ breadcrumb }}">{{ breadcrumb }}</a>
|
||||
<!-- <li class="active">Data</li> -->
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -11,36 +11,12 @@
|
|||
<ul class="tree ls-none">
|
||||
<li class="directories-go-here" ng-repeat="directory in vm.siteDirectories track by $index">
|
||||
<input type="checkbox" id="{{ r.challenge }}{{ $index }}" />
|
||||
<label class="tree_label" for="{{ r.challenge }}{{ $index }}" ng-click="vm.doSomething(directory)" data="{{ directory }}">{{ directory }}</label>
|
||||
<label class="tree_label" for="{{ r.challenge }}{{ $index }}" ng-click="vm.getDirectories(directory)" data="{{ directory }}">{{ directory }}</label>
|
||||
</li>
|
||||
<hr>
|
||||
<li>
|
||||
<input type="checkbox" id="{{ r.challenge }}" />
|
||||
<label class="tree_label" for="{{ r.challenge }}">Level 0</label>
|
||||
<ul class="ls-none">
|
||||
<li>
|
||||
<input type="checkbox" id="{{ r.challenge }}1" />
|
||||
<label for="{{ r.challenge }}1" class="tree_label">Level 1</label>
|
||||
<ul class="ls-none">
|
||||
<li><span class="tree_label">Level 2</span></li>
|
||||
<li><span class="tree_label">Level 2</span></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<input type="checkbox" id="{{ r.challenge }}2" />
|
||||
<label for="{{ r.challenge }}2" class="tree_label">Looong level 1 <br/>label text <br/>with line-breaks</label>
|
||||
<ul class="ls-none">
|
||||
<li><span class="tree_label">Level 2</span></li>
|
||||
<li>
|
||||
<input type="checkbox" id="{{ r.challenge }}3" />
|
||||
<label for="{{ r.challenge }}3" class="tree_label"><span class="tree_custom">Specified tree item view</span></label>
|
||||
<ul class="ls-none">
|
||||
<li><span class="tree_label">Level 3</span></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="tree ls-none">
|
||||
<li ng-repeat="file in vm.siteFiles track by $index">
|
||||
<span class="tree_label">{{ file }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue