Add a private bit to the upload to graph observatory script and the dataset JSON format.
If a dataset is private, it will only show up if it is requested via URL, otherwise it will not appear in the dropdown. Change: 127090337
This commit is contained in:
parent
6e27603622
commit
cd2162b3ea
@ -110,6 +110,12 @@
|
|||||||
"name": "AlexNet",
|
"name": "AlexNet",
|
||||||
"path": "alexnet.pbtxt"
|
"path": "alexnet.pbtxt"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "alexprivate",
|
||||||
|
"name": "AlexNet Private",
|
||||||
|
"path": "alexnet.pbtxt",
|
||||||
|
"private": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "TestError404",
|
"name": "TestError404",
|
||||||
"path": "nofile"
|
"path": "nofile"
|
||||||
|
@ -123,6 +123,8 @@ Polymer({
|
|||||||
}
|
}
|
||||||
|
|
||||||
d3.json(DEMO_DATASETS, function (error, datasets) {
|
d3.json(DEMO_DATASETS, function (error, datasets) {
|
||||||
|
let publicDatasets = [];
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
console.log('Error loading demo datasets:');
|
console.log('Error loading demo datasets:');
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@ -135,6 +137,8 @@ Polymer({
|
|||||||
_.each(datasets, function(dataset, index) {
|
_.each(datasets, function(dataset, index) {
|
||||||
if (queryParams['graphid'] && dataset.id == queryParams['graphid']) {
|
if (queryParams['graphid'] && dataset.id == queryParams['graphid']) {
|
||||||
selectedDataset = index;
|
selectedDataset = index;
|
||||||
|
} else if (dataset['private']) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dataset.path = this._normalizePath(dataset.path);
|
dataset.path = this._normalizePath(dataset.path);
|
||||||
@ -143,8 +147,9 @@ Polymer({
|
|||||||
metadata.path = this._normalizePath(metadata.path);
|
metadata.path = this._normalizePath(metadata.path);
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
publicDatasets.push(dataset);
|
||||||
}, this);
|
}, this);
|
||||||
this.set('datasets', datasets);
|
this.set('datasets', publicDatasets);
|
||||||
if (selectedDataset != 0) {
|
if (selectedDataset != 0) {
|
||||||
this.set('selectedDataset', selectedDataset);
|
this.set('selectedDataset', selectedDataset);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user