@@ -23,51 +23,51 @@ export let detailed = false;
23
23
export let inProgressCallback: (inProgress : boolean , state ? : string ) => void = () => {};
24
24
export let errorCallback: (erroMessage : string ) => void = () => {};
25
25
26
- async function startContainer(containerInfo : ContainerInfoUI ) {
26
+ async function startContainer() {
27
27
inProgressCallback (true , ' STARTING' );
28
28
try {
29
- await window .startContainer (containerInfo .engineId , containerInfo .id );
29
+ await window .startContainer (container .engineId , container .id );
30
30
} catch (error ) {
31
31
errorCallback (error );
32
32
} finally {
33
33
inProgressCallback (false , ' RUNNING' );
34
34
}
35
35
}
36
36
37
- async function restartContainer(containerInfo : ContainerInfoUI ) {
37
+ async function restartContainer() {
38
38
inProgressCallback (true , ' RESTARTING' );
39
39
try {
40
- await window .restartContainer (containerInfo .engineId , containerInfo .id );
40
+ await window .restartContainer (container .engineId , container .id );
41
41
} catch (error ) {
42
42
errorCallback (error );
43
43
} finally {
44
44
inProgressCallback (false );
45
45
}
46
46
}
47
47
48
- async function stopContainer(containerInfo : ContainerInfoUI ) {
48
+ async function stopContainer() {
49
49
inProgressCallback (true , ' STOPPING' );
50
50
try {
51
- await window .stopContainer (containerInfo .engineId , containerInfo .id );
51
+ await window .stopContainer (container .engineId , container .id );
52
52
} catch (error ) {
53
53
errorCallback (error );
54
54
} finally {
55
55
inProgressCallback (false , ' STOPPED' );
56
56
}
57
57
}
58
58
59
- function openBrowser(containerInfo : ContainerInfoUI ): void {
60
- window .openExternal (containerInfo .openingUrl );
59
+ function openBrowser(): void {
60
+ window .openExternal (container .openingUrl );
61
61
}
62
62
63
- function openLogs(containerInfo : ContainerInfoUI ): void {
63
+ function openLogs(): void {
64
64
router .goto (` /containers/${container .id }/logs ` );
65
65
}
66
66
67
- async function deleteContainer(containerInfo : ContainerInfoUI ): Promise <void > {
67
+ async function deleteContainer(): Promise <void > {
68
68
inProgressCallback (true , ' DELETING' );
69
69
try {
70
- await window .deleteContainer (containerInfo .engineId , containerInfo .id );
70
+ await window .deleteContainer (container .engineId , container .id );
71
71
router .goto (' /containers/' );
72
72
} catch (error ) {
73
73
errorCallback (error );
@@ -76,7 +76,7 @@ async function deleteContainer(containerInfo: ContainerInfoUI): Promise<void> {
76
76
}
77
77
}
78
78
79
- function openTerminalContainer(containerInfo : ContainerInfoUI ): void {
79
+ function openTerminalContainer(): void {
80
80
router .goto (` /containers/${container .id }/terminal ` );
81
81
}
82
82
@@ -100,7 +100,7 @@ if (dropdownMenu) {
100
100
101
101
<ListItemButtonIcon
102
102
title =" Start Container"
103
- onClick =" {() => startContainer (container )}"
103
+ onClick =" {() => startContainer ()}"
104
104
hidden =" {container .state === ' RUNNING' || container .state === ' STOPPING' }"
105
105
detailed =" {detailed }"
106
106
inProgress =" {container .actionInProgress && container .state === ' STARTING' }"
@@ -109,15 +109,15 @@ if (dropdownMenu) {
109
109
110
110
<ListItemButtonIcon
111
111
title =" Stop Container"
112
- onClick =" {() => stopContainer (container )}"
112
+ onClick =" {() => stopContainer ()}"
113
113
hidden =" {! (container .state === ' RUNNING' || container .state === ' STOPPING' )}"
114
114
detailed =" {detailed }"
115
115
inProgress =" {container .actionInProgress && container .state === ' STOPPING' }"
116
116
icon =" {faStop }" />
117
117
118
118
<ListItemButtonIcon
119
119
title =" Delete Container"
120
- onClick =" {() => deleteContainer (container )}"
120
+ onClick =" {() => deleteContainer ()}"
121
121
icon =" {faTrash }"
122
122
detailed =" {detailed }"
123
123
inProgress =" {container .actionInProgress && container .state === ' DELETING' }" />
@@ -127,7 +127,7 @@ if (dropdownMenu) {
127
127
{#if ! detailed }
128
128
<ListItemButtonIcon
129
129
title =" Open Logs"
130
- onClick =" {() => openLogs (container )}"
130
+ onClick =" {() => openLogs ()}"
131
131
menu =" {dropdownMenu }"
132
132
detailed =" {false }"
133
133
icon =" {faAlignLeft }" />
@@ -150,7 +150,7 @@ if (dropdownMenu) {
150
150
icon =" {faRocket }" />
151
151
<ListItemButtonIcon
152
152
title =" Open Browser"
153
- onClick =" {() => openBrowser (container )}"
153
+ onClick =" {() => openBrowser ()}"
154
154
menu =" {dropdownMenu }"
155
155
enabled =" {container .state === ' RUNNING' && container .hasPublicPort }"
156
156
hidden =" {dropdownMenu && container .state !== ' RUNNING' }"
@@ -159,15 +159,15 @@ if (dropdownMenu) {
159
159
{#if ! detailed }
160
160
<ListItemButtonIcon
161
161
title =" Open Terminal"
162
- onClick =" {() => openTerminalContainer (container )}"
162
+ onClick =" {() => openTerminalContainer ()}"
163
163
menu =" {dropdownMenu }"
164
164
hidden =" {! (container .state === ' RUNNING' )}"
165
165
detailed =" {false }"
166
166
icon =" {faTerminal }" />
167
167
{/if }
168
168
<ListItemButtonIcon
169
169
title =" Restart Container"
170
- onClick =" {() => restartContainer (container )}"
170
+ onClick =" {() => restartContainer ()}"
171
171
menu =" {dropdownMenu }"
172
172
detailed =" {detailed }"
173
173
icon =" {faArrowsRotate }" />
0 commit comments