-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-e-dip.html
732 lines (622 loc) · 42.3 KB
/
index-e-dip.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>e-Dip Monitor</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles/tailwind.min.css">
<link rel="stylesheet" href="styles/configuation.css">
<link rel="stylesheet" href="node_modules/xterm/css/xterm.css">
<script src="node_modules/xterm/lib/xterm.js"></script>
<script src="scripts/global-handler.js"></script>
<script src="scripts/terminal-handler.js"></script>
<script src="scripts/surveillance-handler.js"></script>
<script src="scripts/serveur-local-handler.js"></script>
<script src="scripts/log.js"></script>
</head>
<body class="flex flex-col h-screen text-sm">
<!-- BARRE DE NAVIGATION -->
<div class="flex border-2 items-center bg-blue-700">
<!-- Menu Ajouter-->
<div class="flex flex-col mr-4">
<!-- Titre -->
<input
type="button" value="Ajouter"
onclick="show('add')"
class="bg-blue-700 text-white p-2 ease-in-out duration-100 hover:bg-blue-400 cursor-pointer focus:outline-none"
>
<!-- Options -->
<div
name="add" id="add" hidden
class="bg-blue-500 absolute mt-10 text-white cursor-pointer"
>
<!-- Serveur local -->
<div onclick="show('ajoutServeurLocal'),getServeursLocaux()" class="p-1 pl-2 pr-2 hover:bg-blue-400">Serveur local</div>
<!-- Ligne séparatrice -->
<div class="border-b-2 border-white"></div>
<!-- Surveillance serveur -->
<div onclick="show('surveillanceServeurDistant'),getSurveillances()" class="p-1 pl-2 pr-2 hover:bg-blue-400">Surveillance serveur</div>
</div>
</div>
<!-- Menu Config -->
<div class="flex flex-col mr-4">
<!-- Titre -->
<input type="button" value="Configurer" onclick="show('config')"
class="bg-blue-700 text-white p-2 ease-in-out duration-100 hover:bg-blue-400 cursor-pointer focus:outline-none">
<!-- Options -->
<div name="config" id="config" hidden class="bg-blue-500 absolute mt-10 text-white cursor-pointer">
<!-- Serveur local -->
<div onclick="show('configurationServeurLocaux'),getServeursLocaux(),afficheNomServeur()" class="p-1 pl-2 pr-2 hover:bg-blue-400">Serveur local</div>
<!-- Ligne séparatrice -->
<div class="border-b-2 border-white"></div>
<!-- Surveillance serveur -->
<div onclick="show('configurationSurveillance'),getSurveillances(),afficheNomSurveillance()" class="p-1 pl-2 pr-2 hover:bg-blue-400">Surveillance serveur</div>
</div>
</div>
<!-- Menu Surveillance -->
<div class="flex flex-col">
<!-- Titre -->
<input type="button" value="Surveiller" onclick="getSurveillances(),show('watch')"
class="bg-blue-700 text-white p-2 ease-in-out duration-100 hover:bg-blue-400 cursor-pointer focus:outline-none">
</div>
<div class="flex-grow items-center"></div>
<!--Help/setting-->
<div>
<p class="flex items-center bg-blue-700 p-2 ease-in-out duration-100 hover:bg-blue-400 cursor-pointer focus:outline-none">
<label for="help"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet"
viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 0 0-2-2a2 2 0 0 0-2 2H8a4 4 0 0 1 4-4a4 4 0 0 1 4 4a3.2 3.2 0 0 1-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10c0-5.53-4.5-10-10-10z" fill="#A5B4FC"/></svg></label>
<input type="button" id="help" value="Aide" class="bg-transparent text-white">
</p>
</div>
<div>
<p class="flex items-center bg-blue-700 p-2 ease-in-out duration-100 hover:bg-blue-400 cursor-pointer focus:outline-none">
<label for="setting"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false"
width="1.5em" height="1.5em"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet" viewBox="0 0 36 36">
<path class="clr-i-outline clr-i-outline-path-1"
d="M18.1 11c-3.9 0-7 3.1-7 7s3.1 7 7 7s7-3.1 7-7s-3.1-7-7-7zm0 12c-2.8 0-5-2.2-5-5s2.2-5 5-5s5 2.2 5 5s-2.2 5-5 5z"
fill="white" />
<path class="clr-i-outline clr-i-outline-path-2"
d="M32.8 14.7l-2.8-.9l-.6-1.5l1.4-2.6c.3-.6.2-1.4-.3-1.9l-2.4-2.4c-.5-.5-1.3-.6-1.9-.3l-2.6 1.4l-1.5-.6l-.9-2.8C21 2.5 20.4 2 19.7 2h-3.4c-.7 0-1.3.5-1.4 1.2L14 6c-.6.1-1.1.3-1.6.6L9.8 5.2c-.6-.3-1.4-.2-1.9.3L5.5 7.9c-.5.5-.6 1.3-.3 1.9l1.3 2.5c-.2.5-.4 1.1-.6 1.6l-2.8.9c-.6.2-1.1.8-1.1 1.5v3.4c0 .7.5 1.3 1.2 1.5l2.8.9l.6 1.5l-1.4 2.6c-.3.6-.2 1.4.3 1.9l2.4 2.4c.5.5 1.3.6 1.9.3l2.6-1.4l1.5.6l.9 2.9c.2.6.8 1.1 1.5 1.1h3.4c.7 0 1.3-.5 1.5-1.1l.9-2.9l1.5-.6l2.6 1.4c.6.3 1.4.2 1.9-.3l2.4-2.4c.5-.5.6-1.3.3-1.9l-1.4-2.6l.6-1.5l2.9-.9c.6-.2 1.1-.8 1.1-1.5v-3.4c0-.7-.5-1.4-1.2-1.6zm-.8 4.7l-3.6 1.1l-.1.5l-.9 2.1l-.3.5l1.8 3.3l-2 2l-3.3-1.8l-.5.3c-.7.4-1.4.7-2.1.9l-.5.1l-1.1 3.6h-2.8l-1.1-3.6l-.5-.1l-2.1-.9l-.5-.3l-3.3 1.8l-2-2l1.8-3.3l-.3-.5c-.4-.7-.7-1.4-.9-2.1l-.1-.5L4 19.4v-2.8l3.4-1l.2-.5c.2-.8.5-1.5.9-2.2l.3-.5l-1.7-3.3l2-2l3.2 1.8l.5-.3c.7-.4 1.4-.7 2.2-.9l.5-.2L16.6 4h2.8l1.1 3.5l.5.2c.7.2 1.4.5 2.1.9l.5.3l3.3-1.8l2 2l-1.8 3.3l.3.5c.4.7.7 1.4.9 2.1l.1.5l3.6 1.1v2.8z"
fill="white" />
</svg></label>
<input type="button" id="setting" value="Paramètres" class="bg-transparent text-white">
</p>
</div>
</div>
<!--Barre Rédémarrer/Arrêter-->
<div class="flex items-center p-2">
<p id="infos" class="flex">
</p>
<p class="flex-grow"></p>
<!-- Rédemarrer -->
<p class="flex items-center mr-4">
<label for="reboot" class="mr-1 cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path d="M12 4c2.1 0 4.1.8 5.6 2.3c3.1 3.1 3.1 8.2 0 11.3c-1.8 1.9-4.3 2.6-6.7 2.3l.5-2c1.7.2 3.5-.4 4.8-1.7c2.3-2.3 2.3-6.1 0-8.5C15.1 6.6 13.5 6 12 6v4.6l-5-5l5-5V4M6.3 17.6C3.7 15 3.3 11 5.1 7.9l1.5 1.5c-1.1 2.2-.7 5 1.2 6.8c.5.5 1.1.9 1.8 1.2l-.6 2c-1-.4-1.9-1-2.7-1.8z" fill="#0c0"/></svg></label>
<input type="button" value="Redémarrer" id="reboot" class="bg-white focus:outline-none cursor-pointer" onclick="restartProcess()">
</p>
<!--Arrêter-->
<p class="flex items-center ">
<label for="stop" class="mr-1 cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1em" height="1em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><g fill="none"><path d="M16 4C9.373 4 4 9.373 4 16s5.373 12 12 12s12-5.373 12-12S22.627 4 16 4zM2 16C2 8.268 8.268 2 16 2s14 6.268 14 14s-6.268 14-14 14S2 23.732 2 16zm8-4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-8z" fill="red"/></g></svg></label>
<input type="button" id="stop" value="Arrêter" class="bg-white focus:outline-none cursor-pointer" onclick="killProcess()">
</p>
</div>
<!--En tête du terminal-->
<div class="flex items-start">
<div class="flex items-start" id="nom">
</div>
<div class="flex flex-col">
<p>
<input type="button" value="+" class="bg-gray-500 text-lg pl-2 pr-2 border-l-2 border-white focus:outline-none cursor-pointer"
onclick="show('button'), affichePlus()">
</p>
<div class="bg-blue-500 z-50 absolute mt-8" id="button" hidden></div>
</div>
</div>
<!-- Terminal -->
<div class="flex-grow" id="terminal">
</div>
<!-- pied de page -->
<div class="flex items-center bg-gray-500" id="piedDePage">
<p>
<label for="fichierDuBas">Fichier : </label>
<div placeholder="C://..." id="fichierDuBas" class="ml-2 text-sm"></div>
</p>
<p class="flex-grow"></p>
</div>
<!-- Pop ups - Ajout serveur local -->
<div id="ajoutServeurLocal" class="absolute" hidden>
<div class="flex w-screen h-screen text-sm absolute">
<!-- Fond transparent -->
<div class="absolute w-screen h-screen bg-gray-300 opacity-50" onclick="show('ajoutServeurLocal')"></div>
<!-- Centrer horizontalement -->
<div class="flex-grow"></div>
<!-- Contenu -->
<div class="flex flex-col">
<!-- Centrer verticalement -->
<div class="flex-grow"></div>
<div class="flex flex-col items-center border-2 shadow-2xl rounded-2xl p-8 bg-white z-50">
<h2 style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: x-large;" class="mb-6">
Enregistrement serveur local</h2>
<div class="flex flex-col">
<!-- Nom du serveur -->
<div>
<p class="flex flex-col mb-2">
<label for="nom-serveur-local" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Nom du serveur
</label>
<input type="text" id="nom-serveur-local" name="serveur"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
</div>
<!-- Adresse et port -->
<div class="flex items center mb-2">
<p class="flex flex-col mr-4 flex-grow">
<label for="address-serveur-local" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Adresse
</label>
<input type="text" id="address-serveur-local" name="address"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
<p class="flex flex-col w-24">
<label for="port-serveur-local" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Port
</label>
<input type="number" id="port-serveur-local" name="port"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
</div>
<!-- Fichier -->
<div class="mb-2">
<p class="flex flex-col">
<label for="fichier-serveur-local" style="font-family:Arial, Helvetica, sans-serif;" class="ml-2">
Fichier
</label>
<input type="text" id="fichier-serveur-local" name="fichier"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
</div>
<!-- Oui or Non -->
<div class="flex items-center">
<input type="checkbox" id="lancerAuDemarrage-serveur-local" class="mr-1"><label for="lancerAuDemarrage">Lancer au
démarrage</label>
</div>
<!-- Enregister ou annuler -->
<div class="flex flex items-center justify-end mt-4">
<p>
<input type="button" value="Annuler"
class="mr-2 bg-white cursor-pointer" style="color:red;"
onclick="show('ajoutServeurLocal')">
</p>
<p class="flex items-center hover:bg-blue-600 bg-gray-600 rounded shadow p-1"
onclick="show('ajoutServeurLocal'),enregistrerServeurLocal()"
>
<label for="save"><svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false"
width="1em" height="1em"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">
<path fill="none" d="M9 14h6v5H9zm2-9h2v2h-2z" />
<path fill="none"
d="M7 14c0-1.103.897-2 2-2h6c1.103 0 2 .897 2 2v5h2.001L19 8.414L15.586 5H15v4H7V5H5v14h2v-5z" />
<path
d="M5 21h14c1.103 0 2-.897 2-2V8a.997.997 0 0 0-.293-.707l-4-4A.996.996 0 0 0 16 3H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2zm10-2H9v-5h6v5zM13 7h-2V5h2v2zM5 5h2v4h8V5h.586L19 8.414L19.001 19H17v-5c0-1.103-.897-2-2-2H9c-1.103 0-2 .897-2 2v5H5V5z"
fill="white" />
</svg></label>
<input type="button" value="Enregistrer" id="save"
class=" bg-transparent text-white p-1 cursor-pointer">
</p>
</div>
</div>
</div>
<div class="flex-grow"></div>
</div>
<div class="flex-grow"></div>
</div>
</div>
<!-- Pop-ups - Ajout Surveillannce serveur distant -->
<div id="surveillanceServeurDistant" class="absolute" hidden>
<div class="flex flex-col w-screen h-screen text-sm absolute">
<!-- Fond transparent -->
<div class="absolute w-screen h-screen bg-gray-300 opacity-50" onclick="show('surveillanceServeurDistant'),pop_upSurveillanceInitial()"></div>
<!-- Centrer horizontalement -->
<div class="flex-grow"></div>
<div class="flex flex">
<!-- Centrer verticalement -->
<div class="flex-grow"></div>
<div class="flex flex-col items-center border-2 shadow-2xl rounded-2xl p-8 pt-4 pb-4 bg-white w-1/2 z-50">
<!-- Titre de la section -->
<h2 style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: x-large;" class="mb-6">
Ajout surveillance serveur distant
</h2>
<!-- Contenu -->
<div class="flex flex-col w-full">
<!-- Nom du serveur -->
<div>
<p class="flex flex-col mb-2">
<label for="serveur1" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Nom du serveur
</label>
<input type="text" id="serveur1" name="serveur1"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
</div>
<!-- Adresse et port -->
<div class="flex items center mb-2">
<p class="flex flex-col mr-4 flex-grow">
<label for="address1" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Adresse
</label>
<input type="text" id="address1" name="address1"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
<p class="flex flex-col w-24">
<label for="port1" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Port
</label>
<input type="number" id="port1" name="port1"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
</div>
<!-- Féquence de vérification -->
<div>
<div class="flex flex-col mb-2">
<p style="font-family:Arial, Helvetica, sans-serif;" class="ml-2">
Fréquence de vérification
</p>
<div class="flex flex-row items-center">
<!-- minutes -->
<p class="flex flex-row-reverse mr-3 items-center"
style="font-family:Arial, Helvetica, sans-serif;">
<label for="min">min</label>
<input type="number" id="min" name="min"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2 w-32"
autocomplete="off">
</p>
<!-- secondes -->
<p class="flex flex-row-reverse items-center"
style="font-family:Arial, Helvetica, sans-serif;">
<label for="sec">sec</label>
<input type="number" id="sec" name="sec" value="30"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2 w-16"
autocomplete="off">
</p>
<div class="flex-grow"></div>
</div>
</div>
</div>
<!-- actions -->
<div class="border-2 border-gray-400 rounded-lg p-2">
<div class="text-center text-gray-500">
Les actions définissent les opérations à effectuer lorsqu'un serveur ne répond pas correctement
</div>
<div id="actions" class="flex flex-col h-24 overflow-auto overflow-y-scroll p-2 mt-2 mb-2"></div>
<input type="button" value="+ Ajouter une action"
class="mr-2 bg-gray-200 cursor-pointer rounded focus:outline-none w-full p-1"
onclick="ajouterAction('action','actions')"
>
</div>
<!-- Enregister ou annuler -->
<div class="flex flex items-center justify-end mt-4">
<p>
<input type="button" value="Annuler"
class="mr-2 bg-white cursor-pointer" style="color:red;"
onclick="show('surveillanceServeurDistant'),pop_upSurveillanceInitial()">
</p>
<p class="flex items-center hover:bg-blue-600 bg-gray-600 rounded shadow p-1"
onclick="enregistrerSurveillance();show('surveillanceServeurDistant'),pop_upSurveillanceInitial()"
>
<label for="save"><svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false"
width="1em" height="1em"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">
<path fill="none" d="M9 14h6v5H9zm2-9h2v2h-2z" />
<path fill="none"
d="M7 14c0-1.103.897-2 2-2h6c1.103 0 2 .897 2 2v5h2.001L19 8.414L15.586 5H15v4H7V5H5v14h2v-5z" />
<path
d="M5 21h14c1.103 0 2-.897 2-2V8a.997.997 0 0 0-.293-.707l-4-4A.996.996 0 0 0 16 3H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2zm10-2H9v-5h6v5zM13 7h-2V5h2v2zM5 5h2v4h8V5h.586L19 8.414L19.001 19H17v-5c0-1.103-.897-2-2-2H9c-1.103 0-2 .897-2 2v5H5V5z"
fill="white" />
</svg></label>
<input type="button" value="Enregistrer" id="save"
class="bg-transparent text-white p-1 cursor-pointer">
</p>
</div>
</div>
</div>
<div class="flex-grow"></div>
</div>
<div class="flex-grow"></div>
</div>
</div>
<!-- Pop-ups - Configuration serveurs locaux -->
<div id="configurationServeurLocaux" class="absolute" hidden>
<div class="flex w-screen h-screen text-sm absolute">
<!-- Fond transparent -->
<div class="absolute w-screen h-screen bg-gray-300 opacity-50" onclick="show('configurationServeurLocaux')"></div>
<!-- Centrer horizontalement -->
<div class="flex-grow"></div>
<div class="flex flex-col">
<!-- Centrer verticalement -->
<div class="flex-grow"></div>
<div class="flex flex-col items-center border-2 shadow-2xl rounded-2xl p-8 bg-white z-50">
<h2 style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: x-large;" class="mb-6">
Configuration des serveurs locaux</h2>
<div class="flex flex-col">
<!-- Retour -->
<p class="flex items-center justify-start mt-4">
<input type="button" value="Retour"
class="mb-2 pr-1 pl-1 bg-white cursor-pointer focus:outline-none border rounded shadow" style="color:blue"
onclick="show('configurationServeurLocaux')">
</p>
<!-- Menu Nom serveur-->
<div class="bg-blue-700 text-white text-left">
<select onchange="updateConfigLocalView()" name="listeNomServeurEnregistrer" id="listeNomServeurEnregistrer" class="bg-blue-700 text-white ease-in-out duration-100 w-full focus:outline-none">
</select>
</div>
<!-- Nom du serveur -->
<div>
<p class="flex flex-col mb-2">
<label for="serveurLocal" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Nom du serveur
</label>
<input type="text" id="serveurLocal" name="serveurLocal"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
</div>
<!-- Adresse et port -->
<div class="flex items center mb-2">
<p class="flex flex-col mr-4 flex-grow">
<label for="addressLocal" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Adresse
</label>
<input type="text" id="addressLocal" name="addressLocal"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
<p class="flex flex-col w-24">
<label for="portLocal" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Port
</label>
<input type="number" id="portLocal" name="portLocal"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
</div>
<!-- Fichier -->
<div class="mb-2">
<p class="flex flex-col">
<label for="fichierLocal" style="font-family:Arial, Helvetica, sans-serif;" class="ml-2">
Fichier
</label>
<input type="text" id="fichierLocal" name="fichierLocal"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
</div>
<!-- Oui or Non -->
<div class="flex items-center">
<input type="checkbox" id="lancerAuDemarrageLocal" class="mr-1"><label for="lancerAuDemarrageLocal">Lancer au
démarrage</label>
</div>
<!-- Enregister ou supprimer -->
<div class="flex flex items-center justify-end mt-4">
<p>
<input type="button" value="Supprimer"
class="mr-2 bg-white cursor-pointer" style="color:red;"
onclick="supprimerServeurLocal()">
</p>
<p class="flex items-center bg-blue-600 rounded shadow p-1"
onclick="modifierServeurLocal()"
>
<label for="save"><svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false"
width="1em" height="1em"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">
<path fill="none" d="M9 14h6v5H9zm2-9h2v2h-2z" />
<path fill="none"
d="M7 14c0-1.103.897-2 2-2h6c1.103 0 2 .897 2 2v5h2.001L19 8.414L15.586 5H15v4H7V5H5v14h2v-5z" />
<path
d="M5 21h14c1.103 0 2-.897 2-2V8a.997.997 0 0 0-.293-.707l-4-4A.996.996 0 0 0 16 3H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2zm10-2H9v-5h6v5zM13 7h-2V5h2v2zM5 5h2v4h8V5h.586L19 8.414L19.001 19H17v-5c0-1.103-.897-2-2-2H9c-1.103 0-2 .897-2 2v5H5V5z"
fill="white" />
</svg></label>
<input type="button" value="Enregistrer" id="save"
class=" bg-blue-600 text-white p-1 cursor-pointer">
</p>
</div>
</div>
</div>
<div class="flex-grow"></div>
</div>
<div class="flex-grow"></div>
</div>
</div>
<!-- Pop-ups - Configuration surveillances des serveurs -->
<div id="configurationSurveillance" class="absolute" hidden>
<div class="flex flex-col w-screen h-screen text-sm absolute">
<!-- Fond transparent -->
<div class="absolute w-screen h-screen bg-gray-300 opacity-50" onclick="show('configurationSurveillance')"></div>
<!-- Centrer horizontalement -->
<div class="flex-grow"></div>
<div class="flex flex">
<!-- Centrer verticalement -->
<div class="flex-grow"></div>
<div class="flex flex-col items-center border-2 shadow-2xl rounded-2xl p-8 pt-4 pb-4 bg-white w-1/2 z-50">
<!-- Titre de la section -->
<h2 style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: x-large;" class="mb-6">
Configuration surveillance serveur distant
</h2>
<!-- Contenu -->
<div class="flex flex-col w-full">
<!-- Retour -->
<p class="flex items-center justify-start mt-4">
<input type="button" value="Retour" class="mb-2 pr-1 pl-1 bg-white cursor-pointer focus:outline-none border rounded shadow" style="color:blue"
onclick="show('configurationSurveillance')">
</p>
<!-- Menu Nom serveur-->
<p class="bg-blue-700 text-white text-left mb-2">
<select onchange="updateConfigSurveillerView()" name="listeNomServeurSurveiller" id="listeNomServeurSurveiller"
class="bg-blue-700 text-white ease-in-out duration-100 w-full focus:outline-none">
</select>
</p>
<!-- Nom du serveur -->
<div>
<p class="flex flex-col mb-2">
<label for="serveurSurveiller" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Nom du serveur
</label>
<input type="text" id="serveurSurveiller" name="serveurSurveiller"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
</div>
<!-- Adresse et port -->
<div class="flex items center mb-2">
<p class="flex flex-col mr-4 flex-grow">
<label for="addressSurveiller" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Adresse
</label>
<input type="text" id="addressSurveiller" name="addressSurveiller"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
<p class="flex flex-col w-24">
<label for="portSurveiller" style="font-family:Arial, Helvetica, sans-serif" class="ml-2">
Port
</label>
<input type="number" id="portSurveiller" name="portSurveiller"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2"
autocomplete="off">
</p>
</div>
<!-- Féquence de vérification -->
<div>
<div class="flex flex-col mb-2">
<p style="font-family:Arial, Helvetica, sans-serif;" class="ml-2">
Fréquence de vérification
</p>
<div class="flex flex-row items-center">
<!-- minutes -->
<p class="flex flex-row-reverse mr-3 items-center"
style="font-family:Arial, Helvetica, sans-serif;">
<label for="minSurveiller">min</label>
<input type="number" id="minSurveiller" name="minSurveiller"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2 w-32"
autocomplete="off">
</p>
<!-- secondes -->
<p class="flex flex-row-reverse items-center"
style="font-family:Arial, Helvetica, sans-serif;">
<label for="secSurveiller">sec</label>
<input type="number" id="secSurveiller" name="secSurveiller" value="30"
class="border-2 focus:border-blue-500 border-gray-500 p-1 rounded-2xl shadow focus:outline-none pr-2 pl-2 w-16"
autocomplete="off">
</p>
<div class="flex-grow"></div>
</div>
</div>
</div>
<!-- Les actions -->
<div class="border-2 border-gray-400 rounded-lg p-2">
<div class="text-center text-gray-500">
Les actions définissent les opérations à effectuer lorsqu'un serveur ne répond pas correctement
</div>
<div id="actionsSurveiller" class="flex flex-col h-24 overflow-auto overflow-y-scroll p-2 mt-2 mb-2"> </div>
<input
type="button" value="+ Ajouter une action"
class="mr-2 bg-gray-200 cursor-pointer rounded focus:outline-none w-full p-1"
onclick="ajouterAction('actionSurveiller','actionsSurveiller')"
>
</div>
<!-- Enregister ou supprimer -->
<div class="flex items-center justify-end mt-4">
<p>
<input type="button" value="Supprimer"
class="mr-2 bg-white cursor-pointer" style="color:red;"
onclick="supprimerSurveillance()">
</p>
<p class="flex items-center hover:bg-blue-600 bg-gray-600 rounded shadow p-1">
<label for="save"><svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false"
width="1em" height="1em"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">
<path fill="none" d="M9 14h6v5H9zm2-9h2v2h-2z" />
<path fill="none"
d="M7 14c0-1.103.897-2 2-2h6c1.103 0 2 .897 2 2v5h2.001L19 8.414L15.586 5H15v4H7V5H5v14h2v-5z" />
<path
d="M5 21h14c1.103 0 2-.897 2-2V8a.997.997 0 0 0-.293-.707l-4-4A.996.996 0 0 0 16 3H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2zm10-2H9v-5h6v5zM13 7h-2V5h2v2zM5 5h2v4h8V5h.586L19 8.414L19.001 19H17v-5c0-1.103-.897-2-2-2H9c-1.103 0-2 .897-2 2v5H5V5z"
fill="white" />
</svg></label>
<input type="button" value="Enregistrer" id="save"
class="bg-transparent text-white p-1 cursor-pointer" onclick="modifierSurveillance()">
</p>
</div>
</div>
</div>
<div class="flex-grow"></div>
</div>
<div class="flex-grow"></div>
</div>
</div>
<!-- Pop-ups - Surveillance -->
<div id="watch" class="absolute" hidden>
<div class="flex w-screen h-screen text-sm absolute">
<!-- Fond transparent -->
<div class="absolute w-screen h-screen bg-gray-300 opacity-50 " onclick="show('watch')"></div>
<!-- Centrer horizontalement -->
<div class="flex-grow"></div>
<div class="flex flex-col">
<!-- Centrer verticalement -->
<div class="flex-grow"></div>
<div class="flex flex-col items-center border-2 shadow-2xl rounded-2xl p-8 bg-white z-50">
<h2 style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: x-large;" class="mb-6">
Serveurs sous surveillance</h2>
<div class="flex flex-col h-full w-full">
<!-- Serveur surveiller -->
<div id="afficheListeServeur">
</div>
<!-- quitter -->
<div class="flex mt-4 items-center">
<p class="flex-grow"></p>
<p class="flex bg-blue-600 rounded shadow p-1" onclick="show('watch')">
<input type="button" value="quitter" id="quitter"
class="bg-transparent text-white p-1 cursor-pointer">
</p>
</div>
</div>
</div>
<div class="flex-grow"></div>
</div>
<div class="flex-grow"></div>
</div>
<!-- POST SCRIPTS -->
<script>
let ajoutSurveillanceInit = document.getElementById('surveillanceServeurDistant').innerHTML
getSurveillances()
getServeursLocaux()
lancerServeur("Lancement au démarrage de ")
function testFile(id) {
return document.getElementById(id).files[0].path;
}
for (serveur of listeSurveillances){
afficherSurveillance(serveur)
log = new Log()
.type(1)
.evenement(Log.EVENTS.DEMARRAGE)
.URI(`${serveur.adresse} : ${serveur.port}`)
.serveur(`${serveur.nomServeur}`)
.donnees("Lancement au démarrage de " + serveur.nomServeur)
.save();
}
</script>
</body>
</html>