Fix Dockerfile command view for FROM with as clause

This commit is contained in:
Joseph Schorr 2017-06-23 16:04:05 -04:00
parent 09e9b5cb53
commit e0a1e05c52
2 changed files with 9 additions and 3 deletions

View file

@ -31,11 +31,16 @@
} }
.dockerfile-command .command-title { .dockerfile-command .command-title {
font-family: Consolas, "Lucida Console", Monaco, monospace; font-family: Consolas, "Lucida Console", Monaco, monospace !important;
padding-left: 90px; padding-left: 90px;
display: inline-block; display: inline-block;
} }
.dockerfile-command .command-title a {
color: #5bc0de;
font-size: 15px;
}
.dockerfile-command .label { .dockerfile-command .label {
color: white; color: white;

View file

@ -44,13 +44,14 @@ export class DockerfileCommandComponent {
var kindHandlers = { var kindHandlers = {
'FROM': (command) => { 'FROM': (command) => {
var pieces = command.split('/'); var parts = command.split(' ');
var pieces = parts[0].split('/');
var registry = pieces.length < 3 ? '' : pieces[0]; var registry = pieces.length < 3 ? '' : pieces[0];
if (!this.registryHandlers[registry]) { if (!this.registryHandlers[registry]) {
return command; return command;
} }
return '<i class="fa fa-hdd-o"></i> <a href="' + this.registryHandlers[registry](pieces) + '" target="_blank">' + command + '</a>'; return '<a href="' + this.registryHandlers[registry](pieces) + '" target="_blank">' + parts[0] + '</a> ' + (parts.splice(1).join(' '));
} }
}; };