-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
867 lines (747 loc) · 36.4 KB
/
index.html
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
<!--
Copyright 2019 The Cloud-Barista Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
----
Copyright for OpenLayers (https://openlayers.org/)
BSD 2-Clause License
Copyright 2005-present, OpenLayers Contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>CB-MapUI: Map Dashboard for Cloud-Barista</title>
<!-- Polyfill for older environments like Internet Explorer and Android 4.x -->
<script
src="https://polyfill.io/v3/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
<!-- Bootstrap CSS and JS (with Popper.js for popovers and tooltips) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"
integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"
integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js"
integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+"
crossorigin="anonymous"></script>
<!-- json-formatter-js -->
<script src="https://cdn.jsdelivr.net/npm/json-formatter-js@2.3.4/dist/json-formatter.umd.min.js"></script>
<!-- datatables -->
<link rel="stylesheet" href="https://cdn.datatables.net/2.0.8/css/dataTables.dataTables.css" />
<script src="https://cdn.datatables.net/2.0.8/js/dataTables.js"></script>
<style>
.map {
width: 100%;
height: 100%;
/* height:800px; */
}
body {
/* transform: scale(0.8);
transform-origin: 0 0;
width: 125%; */
margin-right: auto;
margin-left: auto;
overflow: auto;
}
.scrollable-column {
height: 100%;
overflow-y: auto;
}
table {
border-collapse: separate;
border-spacing: 0 2px;
}
table td {
width: 160px;
}
.form-group {
min-width: 200px;
}
.input-group-text {
min-width: 93px;
height: 38.5px;
}
.form-control {
height: 38.5px;
}
.card {
font-size: 1.1rem;
}
/* dropdown button style */
.dropdown-menu {
width: 98%;
font-size: 1.2rem;
}
.dropdown-menu a {
border-bottom: 1px solid #b4b4b4;
padding: 20px;
}
.dropdown-menu a:hover {
background-color: #98ed90;
}
</style>
</head>
<body>
<div class="container-fluid">
<!-- <h3 class="my-1">CB-Tumblebug Map Dashboard</h3> -->
<div class="row">
<!-- Left Column for Cards -->
<div class="col-md-3 scrollable-column">
<!-- Configuration Card -->
<div class="card mb-2">
<div class="card-header">Dashboard Configuration</div>
<div class="card-body d-flex flex-column">
<form id="configuration-form" class="form-row">
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">IP</span>
</div>
<input type="text" class="form-control" id="hostname" name="hostname" value="localhost"
onchange="endpointChanged();">
</div>
</div>
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Port</span>
</div>
<input type="text" class="form-control" id="port" name="port" value="1323">
</div>
</div>
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Username</span>
</div>
<input type="text" class="form-control" id="username" name="username" value="default">
</div>
</div>
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Password</span>
</div>
<input type="password" class="form-control" id="password" name="password" value="default">
</div>
</div>
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="refreshIntervalLabel">Refresh(s)</span>
</div>
<select id="refreshInterval" name="refreshInterval" class="form-control" aria-label="Display Interval"
aria-describedby="refreshIntervalLabel">
<option value="1">1</option>
<option value="2">2</option>
<option value="5" selected="selected">5</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</div>
</div>
<!-- X-Request-Id list -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="xRequestIdLabel">Req Log</span>
</div>
<select id="xRequestIdSelect" name="xRequestId" class="form-control" aria-label="X-Request-Id"
aria-describedby="xRequestIdLabel" onchange="handleRequestIdSelection();">
<option value="">Select ID</option>
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<div class="form-group col dropdown">
<button class="btn btn-secondary dropdown-toggle w-100" type="button" id="mapControlDropdown"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Map Control
</button>
<div class="dropdown-menu" aria-labelledby="mapControlDropdown">
<a class="dropdown-item" href="javascript:void(0)" onclick="getConnection();">Show all Clouds</a>
<a class="dropdown-item" href="javascript:void(0)" onclick="hideMCI();">Hide/Show MCI</a>
<a class="dropdown-item" href="javascript:void(0)" onclick="clearMap();">Clear Map</a>
<a class="dropdown-item" href="javascript:void(0)"
onclick="window.open('redoc-swagger.html', '_blank');">API Dashboard</a>
<a class="dropdown-item" href="javascript:void(0)" onclick="toggleView();">Toggle Map/API</a>
</div>
</div>
<!-- Create toggleView Field -->
<div class="form-group col">
<button type="button" onClick="toggleView();" class="btn btn-info w-100">Toggle Map/API</button>
<!-- <button type="button" onclick="window.open('redoc-swagger.html', '_blank')" class="btn btn-info w-100">Redoc & Swagger</button> -->
</div>
</form>
</div>
</div>
<!-- MCI Provisioning Card -->
<div class="card mb-2">
<div class="card-header">MC-Infra Provisioning</div>
<div class="card-body d-flex flex-column">
<form id="mci-configuration-form" class="form-row">
<!-- Recommendation Policy Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Policy</span>
</div>
<select id="recommendPolicy" name="recommendPolicy" class="form-control">
<option value="location" selected="selected">Location-based</option>
<option value="price">Cost-based</option>
<option value="performance">Performance-based</option>
</select>
</div>
</div>
<!-- Provider Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="providerLabel">Provider</span>
</div>
<select id="provider" name="provider" class="form-control" aria-label="provider ID"
aria-describedby="providerLabel">
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<!-- CPU Range Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">vCPU</span>
</div>
<input type="number" class="form-control m-0" id='minVCPU' value="1" min="1" max="999447" step="1">
<span class="mx-1">.</span>
<input type="number" class="form-control m-0" id='maxVCPU' value="" min="1" max="999448" step="1">
</div>
</div>
<!-- Memory Range Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Mem(Gi)</span>
</div>
<input type="number" class="form-control m-0" id='minRAM' value="0.5" min="0.5" max="99912288"
step="0.5">
<span class="mx-1">.</span>
<input type="number" class="form-control m-0" id='maxRAM' value="" min="0.5" max="99912289"
step="0.5">
</div>
</div>
<!-- Spec Name Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">SpecID</span>
</div>
<input type="text" class="form-control" id="specName" name="specName" value=""
placeholder="Ex: 2xlarge">
</div>
</div>
<!-- OS Image Type Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Image(OS)</span>
</div>
<select id="osImage" name="osImage" class="form-control">
<option value="Ubuntu18.04">Ubuntu 18.04</option>
<option value="Ubuntu20.04">Ubuntu 20.04</option>
<option value="Ubuntu22.04" selected="selected">Ubuntu 22.04</option>
<option value="Debian10">Debian 10</option>
<option value="WindowsServer2012R2">Windows 2012 R2</option>
</select>
</div>
</div>
<!-- Disk Size Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Disk(GB)</span>
</div>
<input type="text" class="form-control" id="diskSize" name="diskSize" placeholder="Ex: 250">
</div>
</div>
<!-- Accelerator Configuration Field -->
<div class="form-group col">
<div id="headingAccelerator">
<button class="btn btn-info w-100" type="button" data-toggle="collapse"
data-target="#collapseAccelerator" aria-expanded="false" aria-controls="collapseAccelerator">
Accelerator Config
</div>
<div id="collapseAccelerator" class="collapse" aria-labelledby="headingAccelerator"
data-parent="#mci-configuration-form">
<div class="px-0 py-0">
<!-- Accelerator Type Field -->
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Type</span>
</div>
<select id="acceleratorType" name="acceleratorType" class="form-control">
<option value="" selected="selected">----</option>
<option value="gpu">GPU</option>
</select>
</div>
</div>
<!-- Accelerator Model Field -->
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Model</span>
</div>
<input type="text" class="form-control" id="acceleratorModel" name="acceleratorModel" value=""
placeholder="Ex: A100">
</div>
</div>
<!-- Accelerator Count Range Field -->
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Count</span>
</div>
<input type="number" class="form-control" id='minAcceleratorCount' min="1" max="999998"
step="1">
<span class="mx-1">.</span>
<input type="number" class="form-control" id='maxAcceleratorCount' min="1" max="999999"
step="1">
</div>
</div>
<!-- Accelerator Memory Range Field -->
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Mem(GB)</span>
</div>
<input type="number" class="form-control" id='minAMEM' min="1" max="999998" step="1">
<span class="mx-1">.</span>
<input type="number" class="form-control" id='maxAMEM' min="1" max="999999" step="1">
</div>
</div>
</div>
</div>
</div>
<!-- Clear Selection Field -->
<div class="form-group col">
<button type="button" onClick="clearCircle('clearText');" class="btn btn-secondary w-100">Clear
Configuration</button>
</div>
<!-- Create MCI Field -->
<div class="form-group col">
<button type="button" id="createMciButton" onClick="createMci();" class="btn btn-primary w-100">Create
MCI</button>
</div>
</form>
</div>
</div>
<!-- MCI Control Card -->
<div class="card mb-2">
<div class="card-header">MC-Infra Control</div>
<div class="card-body d-flex flex-column">
<form id="mci-control-form" class="form-row">
<!-- Namespace ID Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="namespaceLabel">NS ID</span>
</div>
<select id="namespace" name="namespace" class="form-control" aria-label="Namespace ID"
aria-describedby="namespaceLabel">
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<!-- MCI ID Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="mciidLabel">MCI ID</span>
</div>
<select id="mciid" name="mciid" class="form-control" aria-label="MCI ID"
aria-describedby="mciidLabel">
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<!-- SubGroup ID Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="subgroupidLabel">Group ID</span>
</div>
<select id="subgroupid" name="subgroupid" class="form-control" aria-label="SubGroup ID"
aria-describedby="subgroupidLabel">
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<!-- VM ID Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="vmidLabel">VM ID</span>
</div>
<select id="vmid" name="vmid" class="form-control" aria-label="VM ID" aria-describedby="vmidLabel">
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<!-- VM Public IP Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="pubipLabel">Pub IP</span>
</div>
<select id="pubip" name="pubip" class="form-control" aria-label="Pub IP"
aria-describedby="pubipLabel">
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<!-- VM Private IP Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="priipLabel">Pri IP</span>
</div>
<select id="priip" name="priip" class="form-control" aria-label="Pri IP"
aria-describedby="priipLabel">
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<!-- Control Actions Dropdown -->
<div class="form-group col dropdown">
<button class="btn btn-primary dropdown-toggle w-100" type="button" id="controlActionsDropdown"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Actions
</button>
<div class="dropdown-menu" aria-labelledby="controlActionsDropdown">
<a class="dropdown-item" href="javascript:void(0)" onClick="controlMCI('suspend');">Suspend</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="controlMCI('resume');">Resume</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="controlMCI('reboot');">Reboot</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="controlMCI('refine');">Refine</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="controlMCI('continue');">Continue</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="controlMCI('withdraw');">Withdraw</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="controlMCI('terminate');">Terminate</a>
</div>
</div>
<!-- NLB Control Dropdown -->
<div class="form-group col dropdown">
<button class="btn btn-primary dropdown-toggle w-100" type="button" id="nlbControlDropdown"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
NLB Control
</button>
<div class="dropdown-menu" aria-labelledby="nlbControlDropdown">
<a class="dropdown-item" href="javascript:void(0)" onClick="AddMcNLB();">Add Global-NLB</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="AddNLB();">Add Regional-NLB</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="DelNLB();">Del Regional-NLB</a>
</div>
</div>
<!-- Status Field -->
<div class="form-group col">
<input type="button" value="Status" onClick="statusMCI();" class="btn btn-info w-100">
</div>
<!-- Delete Field -->
<div class="form-group col">
<input type="button" value="Delete" onClick="deleteMCI();" class="btn btn-secondary w-100">
</div>
</form>
</div>
</div>
<!-- Resource view Card -->
<div class="card mb-2">
<div class="card-header">Resource View</div>
<div class="card-body d-flex flex-column">
<form id="resource-view-form" class="form-row">
<!-- vNet ID Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="vNetLabel">VNet</span>
</div>
<select id="vNet" name="vNet" class="form-control" aria-label="vNet ID" aria-describedby="vNetLabel">
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<!-- securityGroup Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="securityGroupLabel">Security</span>
</div>
<select id="securityGroup" name="securityGroup" class="form-control" aria-label="securityGroup ID"
aria-describedby="securityGroupLabel">
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<!-- sshKey Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="sshKeyLabel">SSHKey</span>
</div>
<select id="sshKey" name="sshKey" class="form-control" aria-label="sshKey ID"
aria-describedby="sshKeyLabel">
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<!-- image Field -->
<!-- <div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="imageLabel">Image</span>
</div>
<select id="image" name="image" class="form-control" aria-label="image ID"
aria-describedby="imageLabel">
</select>
</div>
</div> -->
<!-- spec Field -->
<!-- <div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="specLabel">Spec</span>
</div>
<select id="spec" name="spec" class="form-control" aria-label="spec ID" aria-describedby="specLabel">
</select>
</div>
</div> -->
<!-- connection Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="connectionLabel">Connect</span>
</div>
<select id="connection" name="connection" class="form-control" aria-label="connection ID"
aria-describedby="connectionLabel">
<!-- Options will be filled dynamically -->
</select>
</div>
</div>
<!-- Release Resources Field -->
<div class="form-group col">
<button type="button" id="delResources" onClick="releaseResources();" class="btn btn-warning w-100">Release Resources</button>
</div>
<!-- Resource Control Field -->
<div class="form-group col dropdown">
<button class="btn btn-primary dropdown-toggle w-100" type="button" id="resourceControlDropdown"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Resource Control
</button>
<div class="dropdown-menu" aria-labelledby="resourceControlDropdown">
<a class="dropdown-item" href="javascript:void(0)" onClick="releaseResources();">Release Resources</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="resourceOverview();">Overview
Resources</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="registerCspResource();">Register Existing
Resources</a>
</div>
</div>
</form>
</div>
</div>
<!-- MCI Application Card -->
<div class="card mb-2">
<div class="card-header">MC-Infra Application</div>
<div class="card-body d-flex flex-column">
<form id="mci-application-form" class="form-row">
<!-- Select Application Field -->
<div class="form-group col">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="selectAppLabel">App</span>
</div>
<select id="selectApp" name="selectApp" class="form-control" aria-label="Select Application"
aria-describedby="selectAppLabel">
<option value="Xonotic" selected="selected">FPSGame(Xonotic)</option>
<option value="Nvidia">NvidiaDriver</option>
<option value="Ollama">LLM(Ollama)</option>
<option value="OllamaPull">LLM(Ollama PullModel)</option>
<option value="OpenWebUI">LLMChat(Open WebUI)</option>
<option value="vLLM">LLM(vLLM+SelfHostAPI)</option>
<option value="Westward">MMORPG(Westward)</option>
<option value="Nginx">WebServer(Nginx)</option>
<option value="WeaveScope">Monitor(WeaveScope)</option>
<option value="Jitsi">VideoConf(Jitsi)</option>
<option value="ELK">LogAnalisys(ELK)</option>
<option value="Stress">LoadTest(Stress)</option>
</select>
</div>
</div>
<!-- Application Control Buttons -->
<div class="form-group col dropdown">
<button class="btn btn-primary dropdown-toggle w-100" type="button" id="appControlDropdown"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
App Control
</button>
<div class="dropdown-menu" aria-labelledby="appControlDropdown">
<a class="dropdown-item" href="javascript:void(0)" onClick="startApp();">Start/Install</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="stopApp();">Stop</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="statusApp();">Status</a>
</div>
</div>
<!-- MCI Access Field -->
<div class="form-group col dropdown">
<button class="btn btn-info dropdown-toggle w-100" type="button" id="accessDropdown"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Get Access
</button>
<div class="dropdown-menu" aria-labelledby="accessDropdown">
<a class="dropdown-item" href="javascript:void(0)" onClick="getAccessInfo();">Get Access Info</a>
<a class="dropdown-item save-file" href="javascript:void(0)">Save SSH Key</a>
<a class="dropdown-item" href="javascript:void(0)" onClick="executeRemoteCmd();">Remote Command</a>
</div>
</div>
<!-- Remote Command Field -->
<div class="form-group col">
<button type="button" id="remoteCmd" onClick="executeRemoteCmd();" class="btn btn-warning w-100">Remote
Command</button>
</div>
<!-- File Transfer Field -->
<div class="form-group col">
<button type="button" id="filetransfer" onClick="transferFileToMci();"
class="btn btn-warning w-100">Remote File Transfer</button>
</div>
</form>
</div>
</div>
<!-- Message Area -->
<div class="card mb-2">
<div class="card-header">Message Area</div>
<div class="card-body d-flex flex-column">
<div class="row">
<div class="col-md-12">
<textarea id="message" rows="3" name="message" readonly class="form-control"></textarea>
</div>
<!-- <div class="col-md-3">
<div class="form-check mb-2">
<label class="form-check-label" for="tableOn">Display table</label>
<input type="checkbox" class="form-check-input" id="tableOn" name="tableOn"
onClick="displayTableOn();" value="on">
</div>
</div> -->
<div class="col-md-12">
<div id="jsonoutput" class="form-control" readonly
style="height: auto; background-color: black; word-wrap: break-word; overflow-wrap: break-word; overflow-x: auto;">
</div>
</div>
</div>
</div>
</div>
<!-- Detail Table
<div class="card mb-2">
<div class="card-header">Detail Table</div>
<div class="card-body d-flex flex-column">
<table id="detailTable" border="1" style="text-align:center; width:1111px" class="table table-bordered">
... (Table headers and data rows) ...
</table>
</div>
</div>-->
</div>
<!-- Right Column for Map or API-->
<div class="col-md-9">
<div id="map" class="map" style="display:block;">
<div id="popup"></div>
<!-- Spinner for request status -->
<div id="spinner-container"
style="display: none; position: absolute; bottom: 10px; left: 20px; z-index: 1000; align-items: center;">
<div class="spinner-border text-primary spinner-border-sm " role="status">
<span class="sr-only">Loading...</span>
</div>
<div id="spinner-text"
style="margin-left: 10px; background-color: #00ba06; color: white; padding: 5px 10px; border-radius: 4px;">
...
</div>
</div>
</div>
<!-- Admin dashboards -->
<div id="console" style="display:none; width:100%; height:100%; position:absolute; top:0; left:0;">
<iframe id="iframe" src="http://localhost:1324/swagger.html"
style="visibility:visible; width:50%; height:100%; position:relative;"></iframe>
<iframe id="iframe2" src="http://localhost:1024/spider/adminweb"
style="visibility:visible; width:50%; height:100%; position:relative;"></iframe>
</div>
</div>
</div>
<script type="module" src="./index.js"></script>
<script type="text/javascript">
function toggleView() {
var map = document.getElementById('map');
var console = document.getElementById('console');
if (console.style.display === "none") {
map.style.display = "none";
console.style.display = "flex";
} else {
map.style.display = "block";
console.style.display = "none";
}
}
</script>
<script type="text/javascript">
window.addEventListener('resize', setColumnHeight);
function setColumnHeight() {
var windowHeight = window.innerHeight;
document.querySelector('.scrollable-column').style.height = windowHeight * 1.0 + 'px';
}
setColumnHeight();
</script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', (event) => {
// event linster for copy to clipboard
document.querySelectorAll('.input-group-text').forEach(label => {
label.addEventListener('click', () => {
// get seleted option
const select = label.parentElement.nextElementSibling;
if (select && select.options[select.selectedIndex]) {
var toCopy = select.options[select.selectedIndex].text;
var labelText = label.textContent || label.innerText;
navigator.clipboard.writeText(toCopy)
.then(() => {
console.log('Text copied to clipboard: ' + toCopy);
document.getElementById('message').value = '[' + labelText + ' to Clipboard]\n' + toCopy;
})
.catch(err => {
console.error('Error in copying text: ', err);
document.getElementById('message').value = '[Error in copying to Clipboard]\nLabel: ' + labelText + '\nError: ' + err;
});
}
});
});
});
</script>
</body>
</html>