DBA-UL commited on
Commit
e8fc606
·
1 Parent(s): e594b55

Déploiement initial propre

Browse files
Files changed (5) hide show
  1. README.md +6 -4
  2. donnees_appareils (1).csv +101 -0
  3. index.html +125 -18
  4. main.js +234 -0
  5. style.css +159 -18
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
  title: Surveillance
3
- emoji: 🏆
4
- colorFrom: yellow
5
- colorTo: gray
6
  sdk: static
7
  pinned: false
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
1
  ---
2
  title: Surveillance
3
+ emoji: 📊
4
+ colorFrom: blue
5
+ colorTo: purple
6
  sdk: static
7
  pinned: false
8
  ---
9
 
10
+ # Surveillance des Appareils ⚡️
11
+
12
+ Un tableau de bord moderne et interactif.
donnees_appareils (1).csv ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Date,Heure,Tension_Appareil_1,Intensite_Appareil_1,Tension_Appareil_2,Intensite_Appareil_2,Tension_Appareil_3,Intensite_Appareil_3
2
+ 2026-04-23,08:00:06,238.24237053874856,4.1233654655592495,118.52414710768348,0.3107675008031418,11.948495986560236,1.8686544255275641
3
+ 2026-04-24,03:21:21,225.88771895257642,2.89154614194826,114.98642580523182,1.5896629867445042,8.422488389274054,1.7812429673478027
4
+ 2026-04-25,02:07:23,228.91427928313502,1.1564696199900566,119.18684861732709,1.9927431597759553,7.009532960477481,0.6435801611147194
5
+ 2026-04-26,21:24:02,233.4433073978193,2.1785065674133484,115.02932487527073,3.59140245278919,7.762688441754072,1.8103400501226654
6
+ 2026-04-27,03:02:22,230.8113846202428,3.069036510823898,118.3913748309249,0.6473702954738019,11.673205891323205,0.557127388564572
7
+ 2026-04-28,20:22:56,239.79351162525614,5.451729532231843,116.53731912627042,0.11295816765267963,11.406567152333107,1.2913833365822365
8
+ 2026-04-29,15:47:59,231.43677886816118,7.213751475214312,119.12186049408092,4.85992715866982,10.776619358274846,0.9574063786607157
9
+ 2026-04-30,12:34:45,238.46004898040866,7.714951746287941,115.88075987020088,4.772783518664961,7.844209952044718,0.6399166004402641
10
+ 2026-05-01,23:54:36,227.47378180997757,6.827221693126766,113.32010568496891,4.369929156991701,6.950538436208043,1.13118552037927
11
+ 2026-05-02,14:38:13,235.87693326927416,5.911744332309307,110.7556803621727,3.080042773178867,6.541995101894974,0.5273837839410488
12
+ 2026-05-03,15:51:32,222.17546845465733,9.589450344634514,110.68671853124006,1.6084153109744137,11.892455708591756,0.9012947722120924
13
+ 2026-05-04,23:02:56,228.7317449008221,6.620485534988387,118.84894953171863,0.2908633413049994,8.015502183117466,0.4992071875088722
14
+ 2026-05-05,06:12:01,223.7445900387769,9.45665698458101,118.97952846182545,4.654579882335255,6.34685115680359,1.2981131539789594
15
+ 2026-05-06,05:28:11,231.7662317471984,3.75762620154392,117.98560251915379,1.054183566001765,10.29309707795231,0.3106630715117218
16
+ 2026-05-07,19:00:27,221.58219236803262,6.130345162241472,113.99854026485218,1.0351493137554466,6.051699974855556,1.1953721063278229
17
+ 2026-05-08,20:03:55,224.8345501477698,9.697958060370139,117.5947040922393,3.2115117753039355,5.476028770949307,1.4709866768834334
18
+ 2026-05-09,03:35:15,226.3995334797387,5.893417967250199,113.94541732839231,1.9030938174289114,5.955069202594792,1.6091769677956496
19
+ 2026-05-10,23:29:11,232.27093441466243,7.342658202322273,114.17319195618623,3.7538336086144826,11.003044304963549,0.6316743569538399
20
+ 2026-05-11,20:57:31,231.07492218015696,2.3612022719146237,112.91634577741372,1.3537020988983945,8.576521320083351,0.33723999810814304
21
+ 2026-05-12,20:35:13,226.32054125690803,3.6857083040290632,117.67750107191597,2.79321584850176,7.831759231736586,0.21260718226817035
22
+ 2026-05-13,15:46:20,236.04265618643274,8.837673285792848,116.37340899890664,1.6307963990206469,11.7997817913445,0.22248437665300308
23
+ 2026-05-14,19:30:51,236.4182909570723,1.862707773994227,116.3881046007144,0.8429617071377753,6.404698772338069,1.1816466670242833
24
+ 2026-05-15,20:44:41,230.95404801350213,4.274534982955481,110.66173264585477,2.4597653719160544,8.207170859590825,0.17625461667146847
25
+ 2026-05-16,13:15:17,225.75225035386788,1.7647734906090355,113.92203379386211,0.5404013332391924,11.32849916156517,0.49337165460508275
26
+ 2026-05-17,20:51:32,227.11232314299767,3.871190022602514,116.30874784009424,1.911609338858654,5.618383036374968,0.25644240721836226
27
+ 2026-05-18,15:04:31,232.1268851677169,5.8689888071121725,118.6318952646886,4.41503509158094,6.899640531784286,0.2843764010348313
28
+ 2026-05-19,22:15:56,220.25578983679003,2.468501252610391,113.11057198668868,2.5769839990427004,6.9419590539469915,1.6122385024646098
29
+ 2026-05-20,13:46:50,236.8769732091084,7.726232895176497,118.24850399756437,0.8910199906399667,7.863244747688963,1.2530989429292045
30
+ 2026-05-21,10:53:43,234.59124102513545,4.531135578492671,110.01796460538388,3.3812364512066404,6.620088628666576,0.07266610055016923
31
+ 2026-05-22,19:19:44,223.99700056079135,2.0834679455427048,118.6963185488041,1.0975465241953795,9.484224714693951,1.6061522648799818
32
+ 2026-05-23,06:08:35,227.6472426790773,0.49683869483522547,113.47499691760169,1.8635749006699895,5.466135184676979,1.808101077147677
33
+ 2026-05-24,07:17:28,235.998798065555,6.658946145688082,115.19378352164084,1.6456725694603989,10.80942119011831,1.6166181879599342
34
+ 2026-05-25,21:44:35,225.80794031130222,3.3685879876710128,114.29282623212099,2.2259370481121,9.880633834442627,0.508987766429182
35
+ 2026-05-26,14:22:40,223.69370783185238,8.203210939265203,113.84338658002453,3.873669411529133,6.683555645178963,0.4419628297692145
36
+ 2026-05-27,15:44:10,233.8981769279626,2.4010933758757376,116.38235791393231,3.327765001147545,6.939875126213533,1.8477325432138672
37
+ 2026-05-28,16:07:44,224.24552445085365,1.1231074661884994,117.42263037933392,1.6785498675999684,7.9832198871007405,1.8137560870288125
38
+ 2026-05-29,20:44:50,237.32159170900457,7.811981951993395,112.2453333009088,3.7670787069985177,5.0294126640636865,0.5027103919778946
39
+ 2026-05-30,02:37:08,232.38547410058027,3.7488315531245977,111.38564669039468,2.274232251838185,11.391578596210469,0.9341551835494757
40
+ 2026-05-31,05:22:59,234.14609922298678,7.571529597660097,119.65572184320948,1.6870059456779314,6.885234118880218,1.3820626728813434
41
+ 2026-06-01,15:42:10,220.54131863107136,1.3949369544136048,117.89215890614733,4.485917518671939,7.219098196675208,1.6237499524839931
42
+ 2026-06-02,07:07:20,230.57783568436946,1.1768615678086853,118.92904699342026,1.9155489416032763,7.798798791743378,0.9509260315038278
43
+ 2026-06-03,06:12:59,223.7434635369335,2.576037237616107,112.47487337003147,4.9581969006127755,11.379943023082577,1.616469441392636
44
+ 2026-06-04,06:36:11,228.95366340836117,2.5819390972633385,118.00326576280091,4.351874162364097,5.319431307314149,0.12589471287235984
45
+ 2026-06-05,21:31:53,227.04450615694878,5.566333849176037,119.22733988980616,0.05793427011049999,5.499458926116852,0.3009098241557261
46
+ 2026-06-06,10:52:12,235.06335101731887,8.408014974195892,118.37515936253146,2.349232635752817,5.311833356941374,0.3939167291510762
47
+ 2026-06-07,10:47:58,223.4542449870012,4.705294837782151,117.96009591669926,3.8816610757010794,6.857819186254769,1.1769056760718
48
+ 2026-06-08,20:21:20,226.4014967271528,7.894144712688916,110.77214593965675,1.3690262618071625,9.926688489161961,1.9255063951972837
49
+ 2026-06-09,20:39:05,220.65678158282347,8.765989188284856,115.92295088044327,2.0683914948441364,6.192587236514911,0.6068766305277287
50
+ 2026-06-10,15:12:30,239.8502148543052,1.691801213305957,115.93850275250556,4.638072986079115,8.202904659460945,0.4906741861449728
51
+ 2026-06-11,19:12:41,228.52162209420865,1.2231297636279774,113.61630013772943,4.953894282321095,10.470200902755067,1.8879054161951863
52
+ 2026-06-12,15:52:04,221.4164310074177,2.0037560524664135,118.54073196829803,2.222048151898998,10.267594909665615,0.1733421799265714
53
+ 2026-06-13,17:24:32,230.9182553427414,6.394257319282148,115.92465487108062,3.321281835162497,8.208297321260671,0.9536151584258928
54
+ 2026-06-14,06:37:11,238.58106675339036,9.720520042752705,110.53801688181954,4.2411163045582425,7.997827746209701,0.2907237530400539
55
+ 2026-06-15,21:58:03,223.38768877566005,7.069319137528664,113.59015236422486,0.052860618259429004,10.789228567353216,0.39293956477955083
56
+ 2026-06-16,01:16:46,229.1172010726916,4.235075587544706,113.32472577418729,3.756333274597506,8.284537128761633,0.6457622784292476
57
+ 2026-06-17,05:35:01,227.24781470575465,1.134093867102742,111.27711049473876,1.8953309711519692,11.86507024373213,0.4266978984766081
58
+ 2026-06-18,02:18:16,235.16004210692068,8.084775082107646,110.13595558616784,2.0737568555649872,11.247347926736987,1.9054884257608562
59
+ 2026-06-19,17:58:26,234.244487964199,5.848561760661991,116.23614073541117,2.995158309627882,5.768627496293773,0.9646998655739172
60
+ 2026-06-20,18:45:43,236.60965652020008,1.5761950957861521,116.03902550217312,1.2613402741785205,11.113641864376032,0.9164191381900223
61
+ 2026-06-21,00:43:59,227.69292871227756,2.7704547410125113,115.54450109843582,3.8944570273181243,7.8144593008985295,1.3084338866833642
62
+ 2026-06-22,12:21:21,234.98340465927174,7.933406507099771,118.45389814480605,1.978864269958872,5.727184723345244,1.4725480928682244
63
+ 2026-06-23,19:28:03,234.90549417558378,5.519047802060941,111.9126924777277,3.5350751065160737,8.79431785617885,0.6468399754313876
64
+ 2026-06-24,06:08:22,226.56757034879706,4.264588301889388,115.5539427118466,4.523496454550999,7.429513188698197,1.2671300485272325
65
+ 2026-06-25,08:54:33,231.97399402891935,9.293001501286842,116.81067031341526,0.1771645259747952,10.804560930233011,1.3324507313946305
66
+ 2026-06-26,09:33:38,226.7434709358123,5.708351468715321,113.35755412084207,2.5452610496322268,7.407866098199118,1.0482890134968468
67
+ 2026-06-27,11:47:03,234.17385731281047,9.206238180095758,111.9619536171827,3.9366710004401964,6.6175238337035465,0.8452733278583174
68
+ 2026-06-28,12:25:34,222.83665569854108,4.457422504435594,116.10015728456601,4.9333897173778025,10.730904326166815,0.789040258942227
69
+ 2026-06-29,20:08:30,220.19257127137547,0.4806506941314226,119.88421252387501,0.15229164663993977,11.464150155668328,0.3326017179956251
70
+ 2026-06-30,08:21:09,226.65484047635192,4.198478521103905,110.91778977820394,3.303030455513387,10.918733895916603,0.7170160686762137
71
+ 2026-07-01,09:17:32,227.64709321821078,9.898689196680655,116.8050691082243,2.4004287268926645,10.859202691851223,1.2786525749949567
72
+ 2026-07-02,18:48:32,228.2325853926209,3.20540306057854,113.4323237170425,2.9760938055081323,6.278327026088014,1.8987375899051728
73
+ 2026-07-03,16:01:54,229.93391615079923,8.214707121127333,113.11263787653833,4.7378448797474615,6.629864047446728,1.9561797522148192
74
+ 2026-07-04,10:29:36,228.62332989284357,4.953872013035524,114.75671434435974,3.647875987152767,9.255132821784759,1.8196806088641204
75
+ 2026-07-05,05:57:23,236.99926958978222,3.7600995520645255,113.52956283770585,4.848236114792964,6.769696794194659,0.5852933140814878
76
+ 2026-07-06,03:01:29,223.76925708314542,6.311996678785665,111.07767655155331,2.7474695248637317,8.270053810583297,0.7925244001568492
77
+ 2026-07-07,01:25:55,239.88535480641227,7.960645343872257,110.85029513299725,2.547123942335186,9.60842989257145,0.7834496536925303
78
+ 2026-07-08,14:07:45,226.04844719974005,0.23469188578515993,118.37480017084773,1.5078171880071887,8.119288196286785,0.9964871052599019
79
+ 2026-07-09,14:51:00,223.7462563152084,6.822134987740639,114.34141334578688,3.4013690156406198,5.748531520829619,1.785502555683167
80
+ 2026-07-10,19:38:47,227.0294707146225,9.178468135309984,111.5729568649347,3.259959177248934,8.982949156519139,1.5962128616944453
81
+ 2026-07-11,22:46:13,232.71651366826853,7.544309478354474,114.90445235292466,2.6205642509904403,11.367459637083527,1.6809064053447311
82
+ 2026-07-12,03:38:15,221.74314420140539,5.296869776253701,110.53456031269026,4.562204947456871,10.783332902677639,0.3183299241629698
83
+ 2026-07-13,01:16:10,233.78754624482582,2.6424679924534495,116.79852816757663,3.96586550401205,11.466964536479718,0.3725115403618145
84
+ 2026-07-14,19:11:42,239.61098002624064,1.5279720719194498,117.15696977416157,2.243978023449767,11.724547745080294,0.6220942887031555
85
+ 2026-07-15,10:09:33,235.8779723216568,7.806158136622621,119.59792335496843,3.807527341244607,6.7724876905475355,1.912160896050434
86
+ 2026-07-16,08:03:15,233.16513643853145,8.930720236174915,116.9305495954676,2.8516016726601294,9.057641720732708,0.5278369752121385
87
+ 2026-07-17,19:15:03,227.9541960109868,3.462230160827131,119.64802822081464,1.9697045087276601,5.549847992309002,0.3645423786098518
88
+ 2026-07-18,12:25:46,229.51701641455168,2.9911778152331765,117.66514705670238,1.4929905784107418,10.693041549249799,0.45990595790718763
89
+ 2026-07-19,13:45:40,237.81120138587966,9.801186368489864,113.37904768493323,1.5651632178310901,9.82675627781733,0.2602615992456164
90
+ 2026-07-20,09:07:11,231.80838090172134,5.094084359595668,110.40277574061471,1.044598581898568,11.405598851743042,1.7010408540727517
91
+ 2026-07-21,05:40:34,237.30810077972455,1.6267392648185848,112.74563712796215,2.6341761850568366,9.006984203884917,1.959983468481367
92
+ 2026-07-22,02:19:13,231.2054533094133,4.929321700377632,112.66354284122478,3.430591205625706,8.38748185112204,0.5680828830756329
93
+ 2026-07-23,04:39:25,236.82746436132703,1.3201196115108131,118.93250043593162,0.5311042020827986,9.717020206402431,0.4951988510880453
94
+ 2026-07-24,16:08:58,221.746527805341,3.2170623913742933,114.53917685000975,2.8838817777606547,9.733855488849597,1.152246163353368
95
+ 2026-07-25,03:22:41,223.42256848826545,7.5267174188610415,119.6152576245938,0.45940865991810886,9.372796058379944,1.7004299453457528
96
+ 2026-07-26,22:57:16,228.01046138603533,6.512620176772765,113.3226603632091,0.1346330665565244,9.07707638612257,0.46272598319561625
97
+ 2026-07-27,17:39:08,236.9400774464923,6.917038961968372,118.56662500328173,2.070923477002363,11.465033422614002,0.6877101758135057
98
+ 2026-07-28,22:28:21,224.19239586115768,2.49908116184951,118.98190141336447,4.419313355463803,7.029930659371971,0.617280076896534
99
+ 2026-07-29,00:25:41,227.69805167803472,7.627477919778126,112.92890178785012,2.943239635363772,6.421274877480931,0.5535769950483078
100
+ 2026-07-30,00:26:06,225.59087781574536,2.6801341422217773,115.52877698586742,2.5431597862465547,7.628112378025362,0.915998453231309
101
+ 2026-07-31,22:16:08,238.47982059031668,2.0136788731911888,117.80186853737816,3.829190200742163,6.8888585647226,0.9074734344771114
index.html CHANGED
@@ -1,19 +1,126 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Tableau de Bord - Appareils</title>
7
+ <!-- Fonts -->
8
+ <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap" rel="stylesheet">
9
+ <!-- Chart.js -->
10
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-annotation"></script>
12
+ <!-- PapaParse for CSV reading -->
13
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.4.1/papaparse.min.js"></script>
14
+ <link rel="stylesheet" href="style.css">
15
+ </head>
16
+ <body>
17
+ <div class="background-orbs">
18
+ <div class="orb orb-1"></div>
19
+ <div class="orb orb-2"></div>
20
+ <div class="orb orb-3"></div>
21
+ </div>
22
+
23
+ <div class="container">
24
+ <header class="glass-panel">
25
+ <h1>Monitoring des Appareils</h1>
26
+ <p>Analyse de la tension et de l'intensité en temps réel</p>
27
+ </header>
28
+
29
+ <main class="dashboard">
30
+ <aside class="controls glass-panel">
31
+ <h2>Paramètres</h2>
32
+
33
+ <div class="control-group">
34
+ <label>Période (Dates)</label>
35
+ <div class="date-inputs">
36
+ <div class="input-wrapper">
37
+ <span class="label-mini">Début</span>
38
+ <input type="date" id="start-date">
39
+ </div>
40
+ <div class="input-wrapper">
41
+ <span class="label-mini">Fin</span>
42
+ <input type="date" id="end-date">
43
+ </div>
44
+ </div>
45
+ </div>
46
+
47
+ <div class="control-group">
48
+ <label>Appareil</label>
49
+ <div class="radio-inputs">
50
+ <label class="radio-label">
51
+ <input type="radio" name="appareil" value="all" checked>
52
+ <span class="custom-radio"></span>
53
+ Tous
54
+ </label>
55
+ <label class="radio-label">
56
+ <input type="radio" name="appareil" value="1">
57
+ <span class="custom-radio"></span>
58
+ Appareil 1
59
+ </label>
60
+ <label class="radio-label">
61
+ <input type="radio" name="appareil" value="2">
62
+ <span class="custom-radio"></span>
63
+ Appareil 2
64
+ </label>
65
+ <label class="radio-label">
66
+ <input type="radio" name="appareil" value="3">
67
+ <span class="custom-radio"></span>
68
+ Appareil 3
69
+ </label>
70
+ </div>
71
+ </div>
72
+
73
+ <div class="control-group">
74
+ <label>Seuil d'Alerte</label>
75
+ <div class="threshold-inputs">
76
+ <div class="input-wrapper">
77
+ <span class="label-mini">Tension (V)</span>
78
+ <input type="number" id="threshold-voltage" placeholder="ex: 235">
79
+ </div>
80
+ <div class="input-wrapper">
81
+ <span class="label-mini">Intensité (A)</span>
82
+ <input type="number" id="threshold-current" placeholder="ex: 8">
83
+ </div>
84
+ </div>
85
+ </div>
86
+
87
+ <div class="control-group" id="upload-group" style="display: none;">
88
+ <label id="upload-label" class="alert-text">Fichier CSV introuvable. Veuillez le charger :</label>
89
+ <div class="input-wrapper">
90
+ <input type="file" id="csv-upload" accept=".csv" class="file-input">
91
+ </div>
92
+ </div>
93
+
94
+ <button id="apply-btn" class="glow-on-hover">Appliquer les filtres</button>
95
+ </aside>
96
+
97
+ <section class="main-content">
98
+ <div class="summary-cards">
99
+ <div class="summary-card glass-panel">
100
+ <h3>Somme des Tensions</h3>
101
+ <p id="sum-voltage" class="sum-value">0.00 V</p>
102
+ </div>
103
+ <div class="summary-card glass-panel">
104
+ <h3>Somme des Intensités</h3>
105
+ <p id="sum-current" class="sum-value">0.00 A</p>
106
+ </div>
107
+ </div>
108
+
109
+ <div class="charts-area">
110
+ <div class="chart-container glass-panel">
111
+ <h2>Évolution des Tensions</h2>
112
+ <canvas id="voltageChart"></canvas>
113
+ </div>
114
+
115
+ <div class="chart-container glass-panel">
116
+ <h2>Évolution des Intensités</h2>
117
+ <canvas id="currentChart"></canvas>
118
+ </div>
119
+ </div>
120
+ </section>
121
+ </main>
122
+ </div>
123
+
124
+ <script src="main.js"></script>
125
+ </body>
126
  </html>
main.js ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // main.js
2
+
3
+ Chart.defaults.color = '#a0aabf';
4
+ Chart.defaults.font.family = "'Outfit', sans-serif";
5
+
6
+ let rawData = [];
7
+ let voltageChart = null;
8
+ let currentChart = null;
9
+
10
+ const colors = {
11
+ app1: 'rgba(0, 240, 255, 1)', // Neon Blue
12
+ app2: 'rgba(189, 0, 255, 1)', // Purple
13
+ app3: 'rgba(0, 255, 102, 1)', // Neon Green
14
+ alert: 'rgba(255, 0, 85, 0.8)' // Red for alert
15
+ };
16
+
17
+ document.addEventListener('DOMContentLoaded', () => {
18
+ loadCSVData();
19
+ document.getElementById('apply-btn').addEventListener('click', updateDashboard);
20
+ document.getElementById('csv-upload').addEventListener('change', handleFileUpload);
21
+ });
22
+
23
+ function loadCSVData() {
24
+ Papa.parse('donnees_appareils (1).csv', {
25
+ download: true,
26
+ header: true,
27
+ dynamicTyping: true,
28
+ skipEmptyLines: true,
29
+ complete: function(results) {
30
+ console.log("CSV Parsed:", results.data);
31
+ rawData = results.data;
32
+
33
+ // Vérifier si le CSV est valide (s'il contient bien la colonne 'Date')
34
+ // PapaParse peut parfois lire une page d'erreur 404 comme un CSV
35
+ if (rawData.length === 0 || !rawData[0] || !rawData[0].hasOwnProperty('Date')) {
36
+ console.warn("Le fichier CSV est introuvable ou invalide. Affichage de l'upload manuel.");
37
+ document.getElementById('upload-group').style.display = 'block';
38
+ return;
39
+ }
40
+
41
+ if (rawData.length > 0) {
42
+ // Initialiser les dates min et max
43
+ const dates = rawData.map(d => d.Date).filter(d => d);
44
+ if (dates.length > 0) {
45
+ const minDate = dates[0];
46
+ const maxDate = dates[dates.length - 1];
47
+
48
+ document.getElementById('start-date').value = minDate;
49
+ document.getElementById('end-date').value = maxDate;
50
+ document.getElementById('start-date').min = minDate;
51
+ document.getElementById('start-date').max = maxDate;
52
+ document.getElementById('end-date').min = minDate;
53
+ document.getElementById('end-date').max = maxDate;
54
+ }
55
+ }
56
+
57
+ initializeCharts();
58
+ updateDashboard();
59
+ },
60
+ error: function(err) {
61
+ console.error("Erreur CSV:", err);
62
+ document.getElementById('upload-group').style.display = 'block';
63
+ console.log("Affichage du champ de chargement manuel activé.");
64
+ }
65
+ });
66
+ }
67
+
68
+ function handleFileUpload(event) {
69
+ const file = event.target.files[0];
70
+ if (!file) return;
71
+
72
+ Papa.parse(file, {
73
+ header: true,
74
+ dynamicTyping: true,
75
+ skipEmptyLines: true,
76
+ complete: function(results) {
77
+ console.log("Uploaded CSV Parsed:", results.data);
78
+ rawData = results.data;
79
+
80
+ if (rawData.length > 0) {
81
+ const dates = rawData.map(d => d.Date).filter(d => d);
82
+ if (dates.length > 0) {
83
+ const minDate = dates[0];
84
+ const maxDate = dates[dates.length - 1];
85
+
86
+ document.getElementById('start-date').value = minDate;
87
+ document.getElementById('end-date').value = maxDate;
88
+ document.getElementById('start-date').min = minDate;
89
+ document.getElementById('start-date').max = maxDate;
90
+ document.getElementById('end-date').min = minDate;
91
+ document.getElementById('end-date').max = maxDate;
92
+ }
93
+ }
94
+
95
+ if (!voltageChart || !currentChart) {
96
+ initializeCharts();
97
+ }
98
+ updateDashboard();
99
+
100
+ document.getElementById('upload-label').innerText = "Fichier chargé avec succès !";
101
+ document.getElementById('upload-label').style.color = "#00ff66";
102
+ },
103
+ error: function(err) {
104
+ console.error("Erreur lors du parse du fichier uploadé:", err);
105
+ alert("Erreur lors de la lecture du fichier uploadé.");
106
+ }
107
+ });
108
+ }
109
+
110
+ function initializeCharts() {
111
+ const ctxVoltage = document.getElementById('voltageChart').getContext('2d');
112
+ const ctxCurrent = document.getElementById('currentChart').getContext('2d');
113
+
114
+ const commonOptions = {
115
+ responsive: true,
116
+ maintainAspectRatio: false,
117
+ plugins: {
118
+ legend: { position: 'top', labels: { color: '#fff', usePointStyle: true, boxWidth: 8 } },
119
+ tooltip: { mode: 'index', intersect: false, backgroundColor: 'rgba(20, 25, 40, 0.9)', titleColor: '#fff', bodyColor: '#a0aabf', borderColor: 'rgba(255,255,255,0.1)', borderWidth: 1 },
120
+ annotation: { annotations: {} }
121
+ },
122
+ scales: {
123
+ x: { grid: { color: 'rgba(255, 255, 255, 0.05)' }, title: { display: true, text: 'Date / Heure' } },
124
+ y: { grid: { color: 'rgba(255, 255, 255, 0.05)' } }
125
+ },
126
+ elements: { line: { tension: 0.4, borderWidth: 2 }, point: { radius: 0, hitRadius: 10, hoverRadius: 6 } },
127
+ interaction: { mode: 'nearest', axis: 'x', intersect: false }
128
+ };
129
+
130
+ voltageChart = new Chart(ctxVoltage, {
131
+ type: 'line', data: { labels: [], datasets: [] },
132
+ options: { ...commonOptions, scales: { ...commonOptions.scales, y: { ...commonOptions.scales.y, title: { display: true, text: 'Tension (V)' } } } }
133
+ });
134
+
135
+ currentChart = new Chart(ctxCurrent, {
136
+ type: 'line', data: { labels: [], datasets: [] },
137
+ options: { ...commonOptions, scales: { ...commonOptions.scales, y: { ...commonOptions.scales.y, title: { display: true, text: 'Intensité (A)' } } } }
138
+ });
139
+ }
140
+
141
+ function updateDashboard() {
142
+ if (!rawData || rawData.length === 0) return;
143
+
144
+ const startDateStr = document.getElementById('start-date').value;
145
+ const endDateStr = document.getElementById('end-date').value;
146
+ const selectedAppareil = document.querySelector('input[name="appareil"]:checked').value;
147
+ const threshVol = parseFloat(document.getElementById('threshold-voltage').value);
148
+ const threshCur = parseFloat(document.getElementById('threshold-current').value);
149
+
150
+ // Filtrer par date
151
+ let filteredData = rawData;
152
+ if (startDateStr && endDateStr) {
153
+ filteredData = rawData.filter(d => {
154
+ if (!d.Date) return false;
155
+ // On peut comparer directement les strings YYYY-MM-DD
156
+ return d.Date >= startDateStr && d.Date <= endDateStr;
157
+ });
158
+ }
159
+
160
+ const labels = filteredData.map(d => `${d.Date} ${d.Heure}`);
161
+
162
+ // Calcul des sommes et préparation des datasets
163
+ let sumVoltage = 0;
164
+ let sumCurrent = 0;
165
+
166
+ let voltDatasets = [];
167
+ let currDatasets = [];
168
+
169
+ // Fonction d'aide pour ajouter un dataset et cumuler les sommes
170
+ const processAppareil = (appNum, color) => {
171
+ const keyVol = `Tension_Appareil_${appNum}`;
172
+ const keyCur = `Intensite_Appareil_${appNum}`;
173
+
174
+ const volData = filteredData.map(d => {
175
+ const val = parseFloat(d[keyVol]) || 0;
176
+ sumVoltage += val;
177
+ return val;
178
+ });
179
+
180
+ const curData = filteredData.map(d => {
181
+ const val = parseFloat(d[keyCur]) || 0;
182
+ sumCurrent += val;
183
+ return val;
184
+ });
185
+
186
+ voltDatasets.push(createDataset(`Tension App ${appNum}`, volData, color));
187
+ currDatasets.push(createDataset(`Intensité App ${appNum}`, curData, color));
188
+ };
189
+
190
+ if (selectedAppareil === '1' || selectedAppareil === 'all') processAppareil(1, colors.app1);
191
+ if (selectedAppareil === '2' || selectedAppareil === 'all') processAppareil(2, colors.app2);
192
+ if (selectedAppareil === '3' || selectedAppareil === 'all') processAppareil(3, colors.app3);
193
+
194
+ // Mise à jour de l'UI des sommes
195
+ document.getElementById('sum-voltage').innerText = sumVoltage.toLocaleString('fr-FR', {minimumFractionDigits: 2, maximumFractionDigits: 2}) + ' V';
196
+ document.getElementById('sum-current').innerText = sumCurrent.toLocaleString('fr-FR', {minimumFractionDigits: 2, maximumFractionDigits: 2}) + ' A';
197
+
198
+ // Mise à jour des graphiques
199
+ voltageChart.data.labels = labels;
200
+ voltageChart.data.datasets = voltDatasets;
201
+ setAlertAnnotation(voltageChart, threshVol);
202
+ voltageChart.update();
203
+
204
+ currentChart.data.labels = labels;
205
+ currentChart.data.datasets = currDatasets;
206
+ setAlertAnnotation(currentChart, threshCur);
207
+ currentChart.update();
208
+ }
209
+
210
+ function createDataset(label, data, color) {
211
+ return {
212
+ label: label,
213
+ data: data,
214
+ borderColor: color,
215
+ backgroundColor: color.replace('1)', '0.1)'),
216
+ fill: true,
217
+ pointBackgroundColor: color,
218
+ pointBorderColor: '#fff',
219
+ };
220
+ }
221
+
222
+ function setAlertAnnotation(chartInstance, thresholdValue) {
223
+ if (!isNaN(thresholdValue) && thresholdValue > 0) {
224
+ chartInstance.options.plugins.annotation.annotations = {
225
+ line1: {
226
+ type: 'line', yMin: thresholdValue, yMax: thresholdValue,
227
+ borderColor: colors.alert, borderWidth: 2, borderDash: [5, 5],
228
+ label: { display: true, content: 'SEUIL ALERTE', position: 'end', backgroundColor: colors.alert, color: '#fff', font: { size: 10, weight: 'bold' } }
229
+ }
230
+ };
231
+ } else {
232
+ chartInstance.options.plugins.annotation.annotations = {};
233
+ }
234
+ }
style.css CHANGED
@@ -1,28 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
 
 
 
 
 
 
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
 
28
  }
 
1
+ /* Previous root variables */
2
+ :root {
3
+ --bg-color: #0b0f19;
4
+ --panel-bg: rgba(20, 25, 40, 0.6);
5
+ --panel-border: rgba(255, 255, 255, 0.1);
6
+ --text-primary: #ffffff;
7
+ --text-secondary: #a0aabf;
8
+ --accent-blue: #00f0ff;
9
+ --accent-purple: #bd00ff;
10
+ --accent-green: #00ff66;
11
+ --accent-red: #ff0055;
12
+ --font-main: 'Outfit', sans-serif;
13
+ }
14
+
15
+ * { box-sizing: border-box; margin: 0; padding: 0; }
16
+
17
  body {
18
+ background-color: var(--bg-color);
19
+ color: var(--text-primary);
20
+ font-family: var(--font-main);
21
+ min-height: 100vh;
22
+ overflow-x: hidden;
23
+ position: relative;
24
+ }
25
+
26
+ .background-orbs {
27
+ position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; overflow: hidden;
28
+ }
29
+
30
+ .orb {
31
+ position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.5; animation: float 20s infinite ease-in-out;
32
+ }
33
+
34
+ .orb-1 { width: 400px; height: 400px; background: var(--accent-purple); top: -100px; left: -100px; }
35
+ .orb-2 { width: 300px; height: 300px; background: var(--accent-blue); bottom: -50px; right: -50px; animation-delay: -5s; }
36
+ .orb-3 { width: 250px; height: 250px; background: var(--accent-green); top: 40%; left: 50%; animation-delay: -10s; opacity: 0.3; }
37
+
38
+ @keyframes float {
39
+ 0%, 100% { transform: translate(0, 0) scale(1); }
40
+ 33% { transform: translate(30px, -50px) scale(1.1); }
41
+ 66% { transform: translate(-20px, 20px) scale(0.9); }
42
+ }
43
+
44
+ .container { max-width: 1400px; margin: 0 auto; padding: 2rem; }
45
+
46
+ .glass-panel {
47
+ background: var(--panel-bg);
48
+ backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
49
+ border: 1px solid var(--panel-border); border-radius: 20px;
50
+ padding: 1.5rem; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
51
+ }
52
+
53
+ header { text-align: center; margin-bottom: 2rem; }
54
+ header h1 {
55
+ font-size: 2.5rem; font-weight: 800;
56
+ background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
57
+ -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0.5rem;
58
+ }
59
+ header p { color: var(--text-secondary); font-size: 1.1rem; }
60
+
61
+ .dashboard { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; }
62
+
63
+ .controls { display: flex; flex-direction: column; gap: 2rem; height: fit-content; }
64
+ .controls h2 { font-size: 1.5rem; font-weight: 600; border-bottom: 1px solid var(--panel-border); padding-bottom: 1rem; }
65
+ .control-group { display: flex; flex-direction: column; gap: 0.8rem; }
66
+ .control-group label { font-weight: 600; color: var(--accent-blue); font-size: 1.1rem; }
67
+
68
+ .date-inputs { display: flex; flex-direction: column; gap: 1rem; }
69
+ .input-wrapper { display: flex; flex-direction: column; gap: 0.3rem; }
70
+ .label-mini { font-size: 0.85rem; color: var(--text-secondary); }
71
+
72
+ input[type="number"], input[type="date"] {
73
+ width: 100%; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--panel-border);
74
+ color: white; padding: 0.8rem; border-radius: 10px; font-family: var(--font-main);
75
+ font-size: 1rem; outline: none; transition: all 0.3s ease;
76
+ }
77
+
78
+ /* Chrome/Webkit specific for date icon */
79
+ ::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }
80
+
81
+ input:focus { border-color: var(--accent-blue); box-shadow: 0 0 10px rgba(0, 240, 255, 0.2); }
82
+
83
+ /* Radio buttons stylisés */
84
+ .radio-inputs { display: flex; flex-direction: column; gap: 0.8rem; }
85
+ .radio-label {
86
+ display: flex; align-items: center; gap: 0.8rem; cursor: pointer; color: var(--text-primary);
87
+ font-size: 1rem; transition: color 0.3s;
88
+ }
89
+ .radio-label:hover { color: var(--accent-blue); }
90
+ .radio-label input[type="radio"] { display: none; }
91
+ .custom-radio {
92
+ width: 20px; height: 20px; border: 2px solid var(--text-secondary); border-radius: 50%;
93
+ display: inline-block; position: relative; transition: all 0.3s ease;
94
+ }
95
+ .radio-label input[type="radio"]:checked + .custom-radio {
96
+ border-color: var(--accent-blue); box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
97
+ }
98
+ .radio-label input[type="radio"]:checked + .custom-radio::after {
99
+ content: ''; width: 10px; height: 10px; background: var(--accent-blue);
100
+ border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
101
  }
102
 
103
+ .threshold-inputs { display: flex; flex-direction: column; gap: 1rem; }
104
+
105
+ .glow-on-hover {
106
+ padding: 1rem; border: none; outline: none; color: #fff;
107
+ background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
108
+ cursor: pointer; position: relative; z-index: 0; border-radius: 10px;
109
+ font-size: 1.1rem; font-weight: 600; font-family: var(--font-main); transition: transform 0.2s ease;
110
+ }
111
+ .glow-on-hover:hover { transform: translateY(-2px); }
112
+ .glow-on-hover:before {
113
+ content: ''; background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
114
+ position: absolute; top: -2px; left:-2px; background-size: 400%; z-index: -1; filter: blur(5px);
115
+ width: calc(100% + 4px); height: calc(100% + 4px); animation: glowing 20s linear infinite;
116
+ opacity: 0; transition: opacity .3s ease-in-out; border-radius: 10px;
117
+ }
118
+ .glow-on-hover:hover:before { opacity: 1; }
119
+ .glow-on-hover:after {
120
+ z-index: -1; content: ''; position: absolute; width: 100%; height: 100%;
121
+ background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
122
+ left: 0; top: 0; border-radius: 10px;
123
+ }
124
+ @keyframes glowing { 0% { background-position: 0 0; } 50% { background-position: 400% 0; } 100% { background-position: 0 0; } }
125
+
126
+ .main-content { display: flex; flex-direction: column; gap: 2rem; }
127
+
128
+ .summary-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
129
+ .summary-card { text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; }
130
+ .summary-card h3 { color: var(--text-secondary); font-size: 1.2rem; margin-bottom: 1rem; font-weight: 400; }
131
+ .sum-value { font-size: 2.5rem; font-weight: 800; color: var(--text-primary); text-shadow: 0 0 20px rgba(0, 240, 255, 0.4); }
132
+ #sum-voltage { background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
133
+ #sum-current { background: linear-gradient(90deg, var(--accent-green), var(--accent-blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
134
+
135
+
136
+ .charts-area { display: flex; flex-direction: column; gap: 2rem; }
137
+ .chart-container { height: 400px; display: flex; flex-direction: column; }
138
+ .chart-container h2 { font-size: 1.3rem; margin-bottom: 1rem; color: var(--text-primary); }
139
+ canvas { flex-grow: 1; width: 100% !important; height: 100% !important; }
140
+
141
+ .alert-text {
142
+ color: var(--accent-red);
143
+ font-size: 0.9rem;
144
+ font-weight: 600;
145
+ line-height: 1.4;
146
  }
147
 
148
+ .file-input {
149
+ width: 100%;
150
+ background: rgba(0, 0, 0, 0.3);
151
+ border: 1px solid var(--accent-red);
152
+ color: white;
153
+ padding: 0.8rem;
154
+ border-radius: 10px;
155
+ font-family: var(--font-main);
156
+ font-size: 0.9rem;
157
+ outline: none;
158
+ transition: all 0.3s ease;
159
  }
160
 
161
+ .file-input:focus {
162
+ border-color: var(--accent-blue);
163
+ box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
 
 
 
164
  }
165
 
166
+ @media (max-width: 900px) {
167
+ .dashboard { grid-template-columns: 1fr; }
168
+ .summary-cards { grid-template-columns: 1fr; }
169
  }