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);
|
||||
console.log(data);
|
||||
|
||||
if (data.status === 'pull' || data.status === 'untag' || data.status === 'delete') {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the event is delete, remove the container
|
||||
if (data.status === 'destroy') {
|
||||
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 => {
|
||||
console.log('Creating container from protocol');
|
||||
var parser = document.createElement('a');
|
||||
parser.href = opts.url;
|
||||
|
||||
|
@ -43,12 +42,12 @@ ipc.on('application:open-url', opts => {
|
|||
}
|
||||
|
||||
var pathname = parser.pathname.replace('//', '');
|
||||
var slash = pathname.indexOf('/');
|
||||
var base = pathname.slice(0, slash);
|
||||
|
||||
if (base === 'runRepo') {
|
||||
var repo = pathname.substring(slash + 1);
|
||||
ContainerStore.setPending(repo, 'latest');
|
||||
var tokens = pathname.split('/');
|
||||
var type = tokens[0];
|
||||
var method = tokens[1];
|
||||
var repo = tokens.slice(2).join('/');
|
||||
if (type === 'repository' && method === 'run') {
|
||||
ContainerStore.setPending(repo, parser.tag || 'latest');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue