mirror of https://github.com/docker/docs.git
New click-to-pull protocol
Signed-off-by: Jeffrey Morgan <jmorganca@gmail.com>
This commit is contained in:
parent
53cf2b696b
commit
b06999e36a
|
@ -202,6 +202,10 @@ var ContainerStore = assign(Object.create(EventEmitter.prototype), {
|
||||||
var data = JSON.parse(json);
|
var data = JSON.parse(json);
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
|
if (data.status === 'pull' || data.status === 'untag' || data.status === 'delete') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If the event is delete, remove the container
|
// If the event is delete, remove the container
|
||||||
if (data.status === 'destroy') {
|
if (data.status === 'destroy') {
|
||||||
var container = _.findWhere(_.values(_containers), {Id: data.id});
|
var container = _.findWhere(_.values(_containers), {Id: data.id});
|
||||||
|
|
13
src/Main.js
13
src/Main.js
|
@ -34,7 +34,6 @@ ipc.on('application:quitting', opts => {
|
||||||
});
|
});
|
||||||
|
|
||||||
ipc.on('application:open-url', opts => {
|
ipc.on('application:open-url', opts => {
|
||||||
console.log('Creating container from protocol');
|
|
||||||
var parser = document.createElement('a');
|
var parser = document.createElement('a');
|
||||||
parser.href = opts.url;
|
parser.href = opts.url;
|
||||||
|
|
||||||
|
@ -43,12 +42,12 @@ ipc.on('application:open-url', opts => {
|
||||||
}
|
}
|
||||||
|
|
||||||
var pathname = parser.pathname.replace('//', '');
|
var pathname = parser.pathname.replace('//', '');
|
||||||
var slash = pathname.indexOf('/');
|
var tokens = pathname.split('/');
|
||||||
var base = pathname.slice(0, slash);
|
var type = tokens[0];
|
||||||
|
var method = tokens[1];
|
||||||
if (base === 'runRepo') {
|
var repo = tokens.slice(2).join('/');
|
||||||
var repo = pathname.substring(slash + 1);
|
if (type === 'repository' && method === 'run') {
|
||||||
ContainerStore.setPending(repo, 'latest');
|
ContainerStore.setPending(repo, parser.tag || 'latest');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue