-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask-5.js
More file actions
79 lines (71 loc) · 1.57 KB
/
task-5.js
File metadata and controls
79 lines (71 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
const host = new Container({
position: {
x: 50,
y: 250,
},
width: 500,
height: 300,
label: "Host"
});
const images = new Container({
position: {
x: 340,
y: 340,
},
width: 200,
height: 200,
label: "Images",
style: {
backgroundColor: 'white'
}
});
const containers = new Container({
position: {
x: 110,
y: 340,
},
width: 200,
height: 200,
label: "Containers",
style: {
backgroundColor: 'white'
}
});
const ubuntuImage = new DockerImage({
position: {x: 450, y: 360},
imageSrc: "./img/ubuntu-logo.png",
scale: 60,
name: 'ubuntu'
});
ubuntuImage.setStatus('downloaded')
const ubuntuContainerRunning = new DockerContainer({
position: {x: 220, y: 380},
imageSrc: "./img/ubuntu-logo.png",
scale: 60,
name: 'ubuntu'
});
ubuntuContainerRunning.setStatus('running')
const helloWorldImage = new DockerImage({
position: {x: 370, y: 360},
imageSrc: "./img/hello-world-logo.png",
scale: 3,
name: 'hello-world'
});
helloWorldImage.setStatus('downloaded')
const helloWorldContainerExited = new DockerContainer({
position: {x: 130, y: 380},
imageSrc: "./img/hello-world-logo.png",
scale: 3,
name: 'hello-world'
});
helloWorldContainerExited.setStatus('exited')
function taskInputHandle() {
if (input.command === 'images') {
term.write(dockerImages());
setConsoleToNewLine();
}
if (input.command === 'ps') {
term.write(dockerContainers());
setConsoleToNewLine();
}
}