Skip to content

Commit a1b3db9

Browse files
committed
A patch for missing drive for node, prevent the FE from breaking
1 parent e7477d5 commit a1b3db9

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

frontend/src/app/components/node/node-details-form/node-details-form.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,8 @@ class NodeInfoViewModel extends BaseViewModel {
155155
}
156156
];
157157

158-
const mountName = ko.pureComputed(
159-
() => node().drives[0].mount
160-
);
161-
162-
const blockDevice = ko.pureComputed(
163-
() => node().drives[0].drive_id
158+
const drive = ko.pureComputed(
159+
() => (node() && node().drives && node().drives[0]) || {}
164160
);
165161

166162
const diskRead = ko.pureComputed(
@@ -186,11 +182,11 @@ class NodeInfoViewModel extends BaseViewModel {
186182
this.driveInfo = [
187183
{
188184
label: 'Mount',
189-
value: mountName
185+
value: ko.pureComputed(() => drive().mount)
190186
},
191187
{
192188
label: 'Block Device',
193-
value: blockDevice
189+
value: ko.pureComputed(() => drive().drive_id)
194190
},
195191
{
196192
label: 'Read Latency',

0 commit comments

Comments
 (0)