31
31
</b-col >
32
32
</b-row >
33
33
</page-section >
34
+ <page-section v-show =" show" >
35
+ <b-button v-b-toggle.collapse-dhcp-ntp variant =" link" class =" mt-3" >
36
+ <icon-chevron />
37
+ {{ $t('pageDateTime.viewDhcpNtp') }}
38
+ </b-button >
39
+
40
+ <b-collapse id =" collapse-dhcp-ntp" >
41
+ <b-row
42
+ v-for =" (group, rowIndex) in chunkedDhcpNtp"
43
+ :key =" rowIndex"
44
+ class =" mt-3 ml-3"
45
+ >
46
+ <b-col
47
+ v-for =" (item, colIndex) in group"
48
+ :key =" colIndex"
49
+ sm =" 6"
50
+ lg =" 4"
51
+ xl =" 3"
52
+ >
53
+ <b-form-group
54
+ :label =" `Server ${rowIndex * 3 + colIndex + 1}`"
55
+ :label-for =" `${colIndex + 1}`"
56
+ >
57
+ <b-form-input
58
+ :id =" `${colIndex + 1}`"
59
+ class =" custom-form-group"
60
+ :disabled =" true"
61
+ :placeholder =" item"
62
+ />
63
+ </b-form-group >
64
+ </b-col >
65
+ </b-row >
66
+ </b-collapse >
67
+ </page-section >
34
68
<page-section :section-title =" $t('pageDateTime.configureSettings')" >
35
69
<b-row >
36
70
<b-col md =" 8" xl =" 6" >
237
271
<script >
238
272
import Alert from ' @/components/Global/Alert' ;
239
273
import IconCalendar from ' @carbon/icons-vue/es/calendar/20' ;
274
+ import IconChevron from ' @carbon/icons-vue/es/chevron--up/20' ;
240
275
import PageTitle from ' @/components/Global/PageTitle' ;
241
276
import PageSection from ' @/components/Global/PageSection' ;
242
277
@@ -253,7 +288,7 @@ const isoTimeRegex = /^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;
253
288
254
289
export default {
255
290
name: ' DateTime' ,
256
- components: { Alert, IconCalendar, PageTitle, PageSection },
291
+ components: { Alert, IconCalendar, IconChevron, PageTitle, PageSection },
257
292
mixins: [
258
293
BVToastMixin,
259
294
LoadingBarMixin,
@@ -276,6 +311,8 @@ export default {
276
311
ntp: { firstAddress: ' ' , secondAddress: ' ' , thirdAddress: ' ' },
277
312
},
278
313
loading,
314
+ show: false ,
315
+ dhcpNtp: [],
279
316
};
280
317
},
281
318
validations () {
@@ -313,7 +350,11 @@ export default {
313
350
};
314
351
},
315
352
computed: {
316
- ... mapState (' dateTime' , [' ntpServers' , ' isNtpProtocolEnabled' ]),
353
+ ... mapState (' dateTime' , [
354
+ ' ntpServers' ,
355
+ ' isNtpProtocolEnabled' ,
356
+ ' networkSuppliedServers' ,
357
+ ]),
317
358
bmcTime () {
318
359
return this .$store .getters [' global/bmcTime' ];
319
360
},
@@ -343,6 +384,20 @@ export default {
343
384
serverStatus () {
344
385
return this .$store .getters [' global/serverStatus' ];
345
386
},
387
+ networkSuppliedServers () {
388
+ this .$store .getters [' dateTime/networkSuppliedServers' ].map ((server ) =>
389
+ this .dhcpNtp .push (server)
390
+ );
391
+ return this .dhcpNtp ;
392
+ },
393
+ chunkedDhcpNtp () {
394
+ const chunkSize = 3 ;
395
+ const result = [];
396
+ for (let i = 0 ; i < this .dhcpNtp .length ; i += chunkSize) {
397
+ result .push (this .dhcpNtp .slice (i, i + chunkSize));
398
+ }
399
+ return result;
400
+ },
346
401
},
347
402
watch: {
348
403
ntpServers () {
@@ -367,6 +422,7 @@ export default {
367
422
this .$store .dispatch (' dateTime/getNtpData' ),
368
423
this .$store .dispatch (' userManagement/getAccountSettings' ),
369
424
]).finally (() => {
425
+ this .showCollapse ();
370
426
this .setInitialNtpValues ();
371
427
this .endLoader ();
372
428
});
@@ -486,6 +542,32 @@ export default {
486
542
);
487
543
return new Date (utcDate);
488
544
},
545
+ showCollapse () {
546
+ this .dhcpNtp .push (' 1.2.3.4' );
547
+ this .dhcpNtp .push (' 1.2.3.5' );
548
+ this .dhcpNtp .push (' 1.2.3.6' );
549
+ this .dhcpNtp .push (' 1.2.3.7' );
550
+ this .dhcpNtp .push (' 1.2.3.8' );
551
+ this .dhcpNtp .push (' 1.2.3.9' );
552
+ if (this .networkSuppliedServers .length == 0 ) {
553
+ this .show = false ;
554
+ } else {
555
+ this .show = true ;
556
+ }
557
+ },
489
558
},
490
559
};
491
560
</script >
561
+ <style lang="scss" scoped>
562
+ .btn.collapsed {
563
+ svg {
564
+ transform : rotate (180deg );
565
+ }
566
+ }
567
+ .custom-form-group ::placeholder {
568
+ color : black !important ;
569
+ }
570
+ li {
571
+ list-style-type : none ;
572
+ }
573
+ </style >
0 commit comments