Compare commits

..

199 Commits

Author SHA1 Message Date
Samuele Locatelli 7dc0aef175 Merge branch 'release/UpdateAboutColorCheck' 2022-07-06 13:30:49 +02:00
Samuele Locatelli e2afe6a586 Update display a + colori x check licenze 2022-07-06 13:30:22 +02:00
Samuele Locatelli e3ed9a7f35 Merge tag 'FixAboutPageError' into develop
Sistemato About page e suo errore x licenze cannate
2022-07-06 10:11:29 +02:00
Samuele Locatelli db003d2bc3 Merge branch 'release/FixAboutPageError' 2022-07-06 10:11:16 +02:00
Samuele Locatelli c203ab6eb3 Fix comportamento pagina About x check licenze 2022-07-06 10:10:50 +02:00
Samuele Locatelli c10633b6f1 Merge branch 'develop' 2022-07-05 10:00:30 +02:00
Samuele Locatelli a9fd0e2f83 Ancora fix sel reparto 2022-07-05 10:00:21 +02:00
Samuele Locatelli 112c73aea1 Merge tag 'FixSelReprtoAndSelEnabled' into develop
Fix: esclusi i gruppi con sel enabled se NON fossero tipo REPARTO
2022-07-05 09:57:19 +02:00
Samuele Locatelli 9e8e885ef9 Merge branch 'release/FixSelReprtoAndSelEnabled' 2022-07-05 09:56:59 +02:00
Samuele Locatelli 1f964ded92 Fix selezione gruppi
- prende SOLO reparto
- escluso gruppi con selEnabled
2022-07-05 09:56:28 +02:00
Samuele Locatelli eeba41cb5c Merge tag 'FixQrCodeJsConsoleLog' into develop
Eliminato console log inutile
2022-07-04 19:14:20 +02:00
Samuele Locatelli c418812ba2 Merge branch 'release/FixQrCodeJsConsoleLog' 2022-07-04 19:14:10 +02:00
Samuele Locatelli 6169d8cfcc Correzione jscript: niente console log 2022-07-04 19:13:28 +02:00
Samuele Locatelli 75596c61bc Merge tag 'FixQrUserDisplay' into develop
Fix comportamento display QrCode user
2022-07-04 19:12:39 +02:00
Samuele Locatelli b51e164c18 Merge branch 'release/FixQrUserDisplay' 2022-07-04 19:12:24 +02:00
Samuele Locatelli c35d625c36 Gestioen QRCode filt
- completata correzione selezione con distinct
- fix join come richeista Gian
2022-07-04 19:11:55 +02:00
Samuele Locatelli c893ce4d44 refresh pagina QR Card utenti 2022-07-04 18:48:58 +02:00
Samuele Locatelli c47fb1787c Aggiunta helper js x qrcode 2022-07-04 18:48:48 +02:00
Samuele Locatelli aca61c24dc Filtro gruppi:
- add componente filtro gruppi
- add meccanismo mesageService
2022-07-04 18:48:37 +02:00
Samuele Locatelli 167c9d89d4 Aggiunto modelli accesso dati x filtro QRCode utenti 2022-07-04 18:48:03 +02:00
Samuele Locatelli 2295f12958 Merge tag 'UpdateDisplayMonOverride' into develop
Update x MONitor: gestione override info x parameti FLog
2022-06-06 16:45:43 +02:00
Samuele Locatelli 9762628abc Merge branch 'release/UpdateDisplayMonOverride' 2022-06-06 16:45:23 +02:00
Samuele Locatelli a7918e1a89 Update con gestione override display da conf JSon 2022-06-06 16:42:49 +02:00
Samuele E. Locatelli 7a8e05462c Da testare: metodi redis da mostrare 2022-06-04 18:09:29 +02:00
Samuele E. Locatelli aaeae6e99e Riorganizzazione classe con CodeMaid 2022-06-04 17:44:37 +02:00
Samuele E. Locatelli 533f3f4f8f Update: spostao da DTO a conf la parte setup IOB + metodi ad avvio class MpDataService 2022-06-04 17:42:03 +02:00
Samuele E. Locatelli 5135987f1b Inizio update x gestione override dati in MON 2022-06-03 19:01:00 +02:00
Samuele Locatelli 458d788a13 Merge tag 'FixDownloadCsvOnDataPager' into develop
Fix gestione download csv da datapager (sparito in refactoring...)
2022-05-23 11:11:51 +02:00
Samuele Locatelli e842228baf Merge branch 'release/FixDownloadCsvOnDataPager' 2022-05-23 11:11:27 +02:00
Samuele Locatelli 25d2ada96e Fix errore eliminazione download csv da datapager 2022-05-23 11:10:04 +02:00
Samuele Locatelli f22933f925 Merge branch 'develop' 2022-05-03 14:49:30 +02:00
Samuele Locatelli 009b5f6452 Update x nuovo installer MON da testare 2022-05-03 14:49:22 +02:00
Samuele Locatelli 94c72b7e11 Merge tag 'FixSetupCssSemaforoAssente' into develop
Correzione mON nuovo: se manca colore semaforo x una macchina si pianta
--> metto nero (tipicamente al setup)
2022-05-02 19:06:09 +02:00
Samuele Locatelli 11a1925660 Merge branch 'release/FixSetupCssSemaforoAssente' 2022-05-02 19:05:10 +02:00
Samuele Locatelli 6ce8386248 Fix x caso colore semaforo assente (es setup iniziale) --> mette NERO 2022-05-02 19:04:26 +02:00
Samuele Locatelli 1739dcf38a Merge tag 'AddCheckLicMapo' into develop
Aggiunto controllo licenze in pagina about
2022-04-26 12:15:35 +02:00
Samuele Locatelli 1a42d581d4 Merge branch 'release/AddCheckLicMapo' 2022-04-26 12:15:22 +02:00
Samuele Locatelli 625433a3af Update visualizzazione licenze x MAPO 2022-04-26 12:14:52 +02:00
Samuele Locatelli 782a01a4b0 UIpdate pagina about x check licenze e server 2022-04-23 09:50:15 +02:00
Samuele Locatelli e65105b305 Merge tag 'FixDeployMaster' into develop
Sistemazione ciclo deploy su Master + fix vers number
2022-04-14 16:53:34 +02:00
Samuele Locatelli 0429ad398a Merge branch 'release/FixDeployMaster' 2022-04-14 16:53:21 +02:00
Samuele Locatelli 268ee1e2e0 Correzione gestione calcolo vers number 2022-04-14 16:52:57 +02:00
Samuele Locatelli d19dc0edb5 Merge tag 'CreatedCoreMON' into develop
Aggiunta progetto CORE MON
2022-04-14 16:29:38 +02:00
Samuele Locatelli bd770dcffb Merge branch 'release/CreatedCoreMON' 2022-04-14 16:29:23 +02:00
Samuele Locatelli d99f2d2144 Update display grafico testi MON 2022-04-14 16:19:42 +02:00
Samuele Locatelli f47cc1f505 Aggiunta dir resources 2022-04-14 14:58:26 +02:00
Samuele Locatelli edad6f24c0 Completato yaml da testare 2022-04-14 14:50:57 +02:00
Samuele Locatelli a296908697 update yaml 2022-04-14 14:46:53 +02:00
Samuele Locatelli 04d0b7e9a2 Proseguo yaml parametrico 2022-04-14 13:13:51 +02:00
Samuele Locatelli 5e6da5faa9 Fix yaml fino a test 2022-04-14 13:05:25 +02:00
Samuele Locatelli 63947b6662 cambio ordine comandi nuget-fix 2022-04-14 12:58:04 +02:00
Samuele Locatelli da39149575 cambio sintassi x nuget proxy fix 2022-04-14 12:56:43 +02:00
Samuele Locatelli 99e6973695 aggiunto nuget v3 2022-04-14 12:52:11 +02:00
Samuele Locatelli 60db6422e8 ancora typo correct 2022-04-14 12:47:35 +02:00
Samuele Locatelli e642d29605 typo 2022-04-14 12:45:24 +02:00
Samuele Locatelli 7a89db055c test cambio modalità nuget restore 2022-04-14 12:44:04 +02:00
Samuele Locatelli 703337fa9a UPdate nuget packages 2022-04-14 12:27:46 +02:00
Samuele Locatelli 54fab44687 correzione step restore sln 2022-04-14 12:18:42 +02:00
Samuele Locatelli 3b2b097626 Update YAML x build mon (e nuild con variabili) 2022-04-14 12:16:13 +02:00
Samuele Locatelli b9a115bb13 Aggiunta profili pubblicazione x MON 2022-04-14 12:15:59 +02:00
Samuele Locatelli 011fbe52d3 Fix display disegno/articolo + fix stile 2022-04-14 09:20:21 +02:00
Samuele Locatelli 84875e5c30 Tolto reload titolo se tanto ricarica pagina ogni 5-10 minuti 2022-04-13 20:12:29 +02:00
Samuele Locatelli 69ce7b5a0b Rimosso delay 2022-04-13 20:09:56 +02:00
Samuele Locatelli 31c142efa4 Completato MON AsIs in BLazor 2022-04-13 20:06:19 +02:00
Samuele Locatelli 116ec93bb6 Correzione display min/sec TCiclo 2022-04-13 17:40:18 +02:00
Samuele Locatelli e5ac829bd8 Completato allineamento a versioen attuale x comportamento blink 2022-04-13 17:26:53 +02:00
Samuele Locatelli 703bae704f Aggiunto reload generale dati ogni 2 sec come attuale 2022-04-13 17:19:52 +02:00
Samuele Locatelli fd63226051 Fix time blink x errore C101 2022-04-13 16:48:47 +02:00
Samuele Locatelli d3e7c224d3 creato componente e spostato li i dati di visualizzazione 2022-04-13 16:00:40 +02:00
Samuele Locatelli dc53a6f439 Ancora update su display 2022-04-13 11:11:01 +02:00
Samuele Locatelli 519c8d2130 Update MON 2022-04-13 10:58:13 +02:00
Samuele Locatelli f28f7ee815 Aggiunto controller al DB di base x MoonPro (no stats) 2022-04-13 08:20:42 +02:00
Samuele Locatelli 1848fef640 Update x predisporre display stato macchina 2022-04-12 17:45:06 +02:00
Samuele Locatelli 48d34590e4 Merge branch 'master' into develop 2022-04-12 17:29:29 +02:00
Samuele Locatelli 25505ad6d5 refresh componenti 2022-04-12 17:29:19 +02:00
Samuele Locatelli 997c870bcc Bozza sito MON in blazor 2022-04-12 17:29:12 +02:00
Samuele Locatelli 8f9ddc738b Merge tag 'UpdateAppName' into develop
Fix calcolo nome app x check licenze LAND
2022-03-29 10:38:32 +02:00
Samuele Locatelli 275b349c99 Merge branch 'release/UpdateAppName' 2022-03-29 10:38:20 +02:00
Samuele Locatelli 2a921eca4f Refresh vari + db DEV 2022-03-29 10:37:55 +02:00
Samuele Locatelli bbf7c78e28 refresh build 2022-03-29 10:37:30 +02:00
Samuele Locatelli 048be7b2c4 Forzata Applicazione = "MAPO" 2022-03-29 10:37:19 +02:00
Samuele Locatelli 3598051cb2 Merge tag 'UpdateReloadAuto' into develop
Modifica _Host x auto reload al rinnovo connessione
2022-02-27 15:55:13 +01:00
Samuele Locatelli dbebd11c14 Merge branch 'release/UpdateReloadAuto' 2022-02-27 15:54:50 +01:00
Samuele Locatelli 8c9027581e Fix comportamento reload pagina x LAND e PROG 2022-02-27 15:54:21 +01:00
Samuele Locatelli 75122f8ee1 Fix comportamento reload pagina x STAT 2022-02-27 15:52:27 +01:00
Samuele Locatelli 04a1f34aba Merge tag 'FixPublishProfiles' into develop
Fix profili di pubblicazione
2022-02-26 18:28:21 +01:00
Samuele Locatelli e458de6f21 Merge branch 'release/FixPublishProfiles' 2022-02-26 18:28:13 +01:00
Samuele Locatelli caadb95c91 ancora update publish profiles 2022-02-26 18:27:54 +01:00
Samuele Locatelli 6cfeea6fac Update profili pubblicazione x IIS01/02/03 2022-02-26 18:27:45 +01:00
Samuele Locatelli 124e6cdf61 Merge tag 'AddDichToUserLog' into develop
Aggiunta catena esecuzioni x mostrare dichiarazioni utente in UserLog
2022-02-26 18:17:04 +01:00
Samuele Locatelli d20767ec7e Merge branch 'release/AddDichToUserLog' 2022-02-26 18:16:48 +01:00
Samuele Locatelli 2e2639b94f COmpletato display x integrazione dichiarazioni operatore 2022-02-26 18:16:21 +01:00
Samuele Locatelli efa11f9452 Merge tag 'FixGraphBaseChartJs' into develop
Completata rimozione Blazorise + grafici nuovi basati su ChartJs
2022-02-26 14:27:42 +01:00
Samuele Locatelli a8fefca15f Merge branch 'release/FixGraphBaseChartJs' 2022-02-26 14:27:24 +01:00
Samuele Locatelli 3e5a36311c completato grafico anche x action: ora si passa a nuova pag 2022-02-26 14:26:56 +01:00
Samuele Locatelli f0fa776829 Fix grafici controlli 2022-02-26 14:18:47 +01:00
Samuele Locatelli a3a8c0ffaf Completato migrazione grafici x scarti 2022-02-26 13:38:45 +01:00
Samuele Locatelli f16d3a3275 udpate line graph 2022-02-26 12:58:27 +01:00
Samuele Locatelli 0e8fa72f36 Fix parametro x validazione input datetime x net6 2022-02-26 12:58:18 +01:00
Samuele Locatelli ac0ef3f62a Bozza visualizzazione linee TRS 2022-02-25 20:58:07 +01:00
Samuele Locatelli 557a9510d6 Fix grafico pareto guasti con componente standard! 2022-02-25 20:19:34 +01:00
Samuele Locatelli 349758a289 Ancora udpate comportamento grafico (aspect ratio) 2022-02-25 19:58:28 +01:00
Samuele Locatelli 5541d0dc83 Ancora update grafici 2022-02-25 18:51:29 +01:00
Samuele Locatelli 0798679629 Demo gestione array colori 2022-02-25 18:25:15 +01:00
Samuele Locatelli 0a26d475f9 Add piechart da raffinare 2022-02-25 12:15:17 +01:00
Samuele Locatelli 8e5a392c8c OK grafico linea non stepped 2022-02-25 11:59:49 +01:00
Samuele Locatelli f0beaaacc8 Fix bar plot vert/horiuz + freq hist test 2022-02-25 11:54:51 +01:00
Samuele Locatelli 0847014108 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-02-24 12:09:36 +01:00
Samuele Locatelli d6c226ae1a Spostamento org classi chartJs + nuova opzione horiz chart 2022-02-24 12:09:33 +01:00
marco.locatelli@steamware.net 6d6bf242dd Upgrade a visualizzazione LAND / licenza programmi 2022-02-23 17:52:42 +01:00
Samuele Locatelli b760d4fa1a Update gestione pagina test con grafici 2022-02-22 17:27:38 +01:00
Samuele Locatelli aa65d48f5f Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-02-22 17:27:23 +01:00
marco.locatelli@steamware.net f1f5287d74 Merge remote-tracking branch 'origin/develop' into develop 2022-02-22 17:19:21 +01:00
marco.locatelli@steamware.net 94d0de796e Fix vista codici QR & Menu 2022-02-22 17:18:14 +01:00
Samuele Locatelli 70901c259b Rename componenti chart di base (da completare) 2022-02-22 16:42:09 +01:00
Samuele Locatelli f22bd910a2 fix pusblish profiles 2022-02-22 16:31:33 +01:00
Samuele Locatelli b85ed12f1c Eliminati (commentati) elementi grafici x fix compilazione 2022-02-22 16:28:20 +01:00
Samuele Locatelli fef6d4ccfc Continuo cleanup da Blazorise's components 2022-02-22 16:24:32 +01:00
Samuele Locatelli e345e61d8a refresh MP.Data 2022-02-22 16:02:35 +01:00
Samuele Locatelli 4d2dc10579 completo refresh progetto MP-PROG 2022-02-22 15:25:23 +01:00
Samuele Locatelli 9c98ee945a refresh MP prog 2022-02-22 15:25:14 +01:00
Samuele Locatelli 01270d6254 fix dotnet5 --> dotnet6 2022-02-22 15:07:51 +01:00
Samuele Locatelli 485cecc1a0 fix text plot 2022-02-21 19:19:53 +01:00
Samuele Locatelli be9cf76253 Merge remote-tracking branch 'origin/develop' into develop 2022-02-21 19:08:54 +01:00
Samuele Locatelli f89dc62a5b OK ripristino grafici di base x STAT 2022-02-21 19:08:50 +01:00
Samuele Locatelli 182d3c82f1 inizio merge gestione Chart senza blazorise 2022-02-21 18:30:44 +01:00
Samuele Locatelli 091d542084 fix client libs x chart 2022-02-21 18:30:21 +01:00
marco.locatelli@steamware.net c92b92b795 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-02-21 17:44:44 +01:00
marco.locatelli@steamware.net 80837628ad Completato Fix - vista QR Code 2022-02-21 17:43:50 +01:00
Samuele Locatelli fa0c622c66 Merge remote-tracking branch 'origin/develop' into develop 2022-02-21 16:38:25 +01:00
Samuele Locatelli 7403002350 eliminato riferimento a blazorize bootstrap&fontawesome 2022-02-21 16:38:20 +01:00
Samuele Locatelli aa0aeb1552 aggiunte lib client locali 2022-02-21 16:38:06 +01:00
Samuele Locatelli 3d183abf41 Update progetti a Core6 2022-02-21 16:30:08 +01:00
marco.locatelli@steamware.net ce5e3c45c7 fix in progress - colonne qrcode e menù 2022-02-21 13:19:34 +01:00
Samuele Locatelli 9974cbb8b4 Merge tag 'UpdateLandDownload' into develop
UPdate gestione display + download LAND
2022-02-01 14:30:23 +01:00
Samuele Locatelli 279ef9d302 Merge branch 'release/UpdateLandDownload' 2022-02-01 14:29:56 +01:00
Samuele Locatelli cc21f4b719 Completato fix x download CTrack da elenco... 2022-02-01 12:49:49 +01:00
Samuele Locatelli 98d32300cf Completato test con chiavi licenza OK 2022-02-01 12:43:19 +01:00
Samuele Locatelli a77e88ca88 Update x gestione licenze nuove x MAPO 2022-02-01 12:31:51 +01:00
Samuele Locatelli 0b9211d26a Merge tag 'AddLicenzaOnSysInfo' into develop
Fix visualizzaizone codice licenza in LAND
2021-12-23 15:10:52 +01:00
Samuele Locatelli a6279ca047 Merge branch 'release/AddLicenzaOnSysInfo' 2021-12-23 15:07:47 +01:00
Samuele Locatelli 2cc8da110d Fix lettura dati da DB x licenza 2021-12-23 15:07:15 +01:00
Samuele Locatelli 985e429d34 Modifica x recuperare e msotrare cod licenza 2021-12-23 14:55:19 +01:00
Samuele Locatelli 1b95fa8d91 Update conf json x prod LAND 2021-12-06 11:01:21 +01:00
Samuele Locatelli a9dadb9d9c cleanup 2021-11-25 11:19:16 +01:00
Samuele Locatelli c358bddd36 Upgrade conf e favicon 2021-11-24 15:01:36 +01:00
Samuele Locatelli eca2aaae30 Merge tag 'FixAppSettingsLand' into develop
fix conf json x staging/prod
2021-11-24 14:55:10 +01:00
Samuele Locatelli a1b035c00a Merge branch 'release/FixAppSettingsLand' 2021-11-24 14:55:01 +01:00
Samuele Locatelli d702234b9c refresh 2021-11-24 14:54:34 +01:00
Samuele Locatelli 9d4b93b4ab update conf x prod/staging IIS01/IIS=2 di LAND 2021-11-24 14:54:31 +01:00
Samuele Locatelli 9cc4a5544c Merge branch 'master' into develop 2021-11-12 15:34:39 +01:00
Samuele Locatelli 23455acd67 Merge branch 'develop' 2021-11-12 15:34:22 +01:00
Samuele Locatelli b7bd3d77ad Merge remote-tracking branch 'origin/develop' 2021-11-12 15:34:12 +01:00
Samuele Locatelli 8e235aa282 refresh versione 2021-11-12 15:33:40 +01:00
Samuele Locatelli a3a0f72b02 Merge tag 'MapoLandAppDownloadLimited' into develop
Fix: scaricamento delle SOLE applicazioni effettivamente con licenza
2021-11-12 15:33:25 +01:00
Samuele Locatelli 362c526459 Merge branch 'release/MapoLandAppDownloadLimited' 2021-11-12 15:32:41 +01:00
Samuele Locatelli 46874d42d0 Update pagina download (solo app con licenza e auth) 2021-11-12 15:32:08 +01:00
Samuele Locatelli 39efd30bae Merge tag 'NumSearchTag' into develop
Aggiunta selezione tag ricerca (num char)
2021-10-15 10:46:34 +02:00
Samuele Locatelli b259a94ca8 Merge branch 'release/NumSearchTag' 2021-10-15 10:46:20 +02:00
Samuele Locatelli 4dbf8a6611 Aggiunta configurazione x numero caratteri minimi ricerca TAGS 2021-10-15 10:45:43 +02:00
Samuele Locatelli 7e06abd521 Merge tag 'FixLandOrdering' into develop
Fix LAND ordering
2021-10-13 10:51:47 +02:00
Samuele Locatelli 6c3f35f64b Merge branch 'release/FixLandOrdering' 2021-10-13 10:51:21 +02:00
Samuele Locatelli e21b7b9eee Update LAND x usare ordinamento corretto in display 2021-10-13 10:50:28 +02:00
Samuele Locatelli 7d6bef1a32 Merge tag 'CsvOutputSTATS03' into develop
Fix download page
2021-09-30 19:03:19 +02:00
Samuele Locatelli c297416f6c Merge branch 'release/CsvOutputSTATS03' 2021-09-30 19:01:39 +02:00
Samuele Locatelli 027a0b4b4c update favicon 2021-09-30 19:00:05 +02:00
Samuele Locatelli db5500b3a7 pulizia gitignore 2021-09-30 18:59:09 +02:00
Samuele Locatelli 8947a03e5a Cambio path x download page 2021-09-30 18:58:13 +02:00
Samuele Locatelli 08188ca2a0 Merge tag 'CsvOutputSTATS02' into develop
Fix (hope) path download files csv
2021-09-30 18:55:26 +02:00
Samuele Locatelli f9f3dd56bd Merge branch 'release/CsvOutputSTATS02' 2021-09-30 18:55:15 +02:00
Samuele Locatelli d81f448b08 update e refresh 2021-09-30 18:54:56 +02:00
Samuele Locatelli 1f48aad618 cambio calcolo path x download files 2021-09-30 18:54:42 +02:00
Samuele Locatelli b802a9b914 cambio logget NLog --> ILogger x statsservice 2021-09-30 18:54:31 +02:00
Samuele Locatelli 407308f26f Cambio paradigma db context (con using non static) 2021-09-30 18:54:17 +02:00
Samuele Locatelli 833e55ec20 Merge tag 'CsvOutputSTATS' into develop
Fix output csv x STATS + fix grafico diff x PROG
2021-09-30 16:13:57 +02:00
Samuele Locatelli f6ecbb94f3 Merge branch 'release/CsvOutputSTATS' 2021-09-30 16:13:37 +02:00
Samuele Locatelli d59ad82c87 Update visualizzazione differenze su PROG 2021-09-30 16:13:28 +02:00
Samuele Locatelli 03a3c78176 Aggiunto metodo x avere tutti i record da DB 2021-09-30 15:59:59 +02:00
Samuele Locatelli 9377d704e6 Aggiunto chiamate x export file csv 2021-09-30 15:59:40 +02:00
Samuele Locatelli a1ccaafcc6 Merge tag 'FixDisplayAndOldRev' into develop
Fix display differenze (sempre) + vecchie revisioni selezionabili +
display vari
2021-09-28 15:40:11 +02:00
Samuele Locatelli ab3c3c2122 Merge branch 'release/FixDisplayAndOldRev' 2021-09-28 15:39:52 +02:00
Samuele Locatelli 4468bdabb9 Modifica x gestione file inattivi (vecchie rev) + fix selezioni 2021-09-28 15:39:27 +02:00
Samuele Locatelli f9929d0b73 Modifica x visualizzare SEMPRE le differenze 2021-09-28 15:39:12 +02:00
Samuele Locatelli 226b26be5e Pulizia variabili inutilizzate 2021-09-23 10:02:02 +02:00
Samuele Locatelli 5190b5d62d Merge tag 'v_6.14_unificata' into develop
Fix vers 6.14
2021-09-22 17:40:35 +02:00
Samuele Locatelli 5805a3685a Merge branch 'release/v_6.14_unificata' 2021-09-22 17:40:23 +02:00
Samuele Locatelli f89faccdf4 Merge tag 'v_6.14_unificata' into develop
Fix vers number 6.14
2021-09-22 16:05:07 +02:00
Samuele Locatelli 7c760e5f18 Merge branch 'release/v_6.14_unificata' 2021-09-22 16:04:51 +02:00
Samuele Locatelli 79fa14549c Fix spacing index + refresh installers 2021-09-22 15:55:06 +02:00
Samuele Locatelli 11a4293138 Merge tag 'v_6.14_unificata' into develop
release unificata MAPO
2021-09-22 12:10:56 +02:00
Samuele Locatelli c1c5f2e16e Merge branch 'release/v_6.14_unificata' 2021-09-22 12:10:45 +02:00
Samuele Locatelli faba3fbe60 Fix deploy script x vers number unificato 2021-09-22 12:06:03 +02:00
Samuele Locatelli c911373036 Fix pubblicazione versioni x MP-CORE Land 2021-09-22 11:00:49 +02:00
Samuele Locatelli e9b283b910 Merge branch 'master' into develop 2021-09-21 19:06:21 +02:00
Samuele Locatelli fc20464958 Merge branch 'develop' 2021-09-21 19:06:16 +02:00
Samuele Locatelli 22e02bdd9e refresh vers numb 2021-09-21 19:06:13 +02:00
Samuele Locatelli f0bbeaff26 Refresh version 2021-09-21 19:05:52 +02:00
Samuele Locatelli 7861609072 Fix MP-PROG DB init 2021-09-21 19:05:00 +02:00
Samuele Locatelli c440c86068 Merge branch 'master' into develop 2021-09-21 18:39:06 +02:00
2284 changed files with 277682 additions and 1851 deletions
+1
View File
@@ -346,3 +346,4 @@ Backup*/
UpgradeLog*.XML
MP.Prog/Shared/MainLayout.razor
MP.Stats/temp/*.csv
+253 -68
View File
@@ -1,24 +1,27 @@
variables:
NUGET_PATH: 'C:\Tools\nuget.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
EXE_RELEASE_FOLDER: 'c:\Projetcs\Compiled\MP-CORE\Release'
DEPLOY_FOLDER: 'c:\Projects\Deploy\MP-CORE\Builds'
VERS_MAIN: '1.1'
# VERS_FULL: '0.0.0.0'
NEXUS_PATH: 'MP-STATS'
APP_NAME: 'MP.Stats'
SOL_NAME: 'MP-STATS'
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
.nuget-fix: &nuget-fix
- |
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
if ($hasSource -eq 0) {
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
} else {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
- |
echo "esecuzione Nuget FIX steps"
dotnet nuget list source
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus Proxy"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source "`"Steamware Nexus Proxy`""
}
echo $hasSource
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source "`"Steamware Nexus`""
}
$hasSource = dotnet nuget list source | Select-String -Pattern "nexus-proxy-v3"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source nexus-proxy-v3
}
dotnet nuget add source https://nexus.steamware.net/repository/nuget-proxy-v3/index.json -n nexus-proxy-v3 -u nugetUser -p viaDante16 --store-password-in-clear-text
echo "Has Source: $hasSource"
# helper creazione hash files x IIS
.hashBuild: &hashBuild
@@ -37,8 +40,6 @@ variables:
.nexusUpload: &nexusUpload
- |
Set-Alias mCurl C:\Windows\system32\curl.exe
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$fileVers = $env:APP_NAME + "\Resources\VersNum.txt"
$VersNumb = Get-Content $fileVers
echo "Curr Version: $VersNumb"
@@ -58,10 +59,8 @@ variables:
}
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
# mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
# Stages previsti
stages:
- build
- test
@@ -73,142 +72,267 @@ LAND:build:
stage: build
tags:
- win
variables:
APP_NAME: MP.Land
SOL_NAME: MP-LAND
before_script:
- *nuget-fix
- dotnet restore MP-LAND.sln
- dotnet restore "$env:SOL_NAME.sln"
script:
- dotnet build MP.Land/MP.Land.csproj
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
PROG:build:
stage: build
tags:
- win
variables:
APP_NAME: MP.Prog
SOL_NAME: MP-PROG
before_script:
- *nuget-fix
- dotnet restore MP-PROG.sln
- dotnet restore "$env:SOL_NAME.sln"
script:
- dotnet build MP.Prog/MP.Prog.csproj
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
STAT:build:
stage: build
tags:
- win
variables:
APP_NAME: MP.Stats
SOL_NAME: MP-STATS
before_script:
- *nuget-fix
- dotnet restore MP-STATS.sln
- dotnet restore "$env:SOL_NAME.sln"
script:
- dotnet build MP.Stats/MP.Stats.csproj
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
MON:build:
stage: build
tags:
- win
variables:
APP_NAME: MP.Mon
SOL_NAME: MP-MON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
LAND:test:
stage: test
tags:
- win
variables:
APP_NAME: MP.Land
SOL_NAME: MP-LAND
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["LAND:build"]
script:
- dotnet test MP.Land/MP.Land.csproj
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
PROG:test:
stage: test
tags:
- win
variables:
APP_NAME: MP.Prog
SOL_NAME: MP-PROG
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["PROG:build"]
script:
- dotnet test MP.Prog/MP.Prog.csproj
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
STAT:test:
stage: test
tags:
- win
variables:
APP_NAME: MP.Stats
SOL_NAME: MP-STATS
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["STAT:build"]
script:
- dotnet test MP.Stats/MP.Stats.csproj
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
MON:test:
stage: test
tags:
- win
variables:
APP_NAME: MP.Mon
SOL_NAME: MP-MON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["MON:build"]
script:
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
LAND:IIS01:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: MP.Land
SOL_NAME: MP-LAND
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["LAND:test"]
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Land/MP.Land.csproj
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
PROG:IIS01:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: MP.Prog
SOL_NAME: MP-PROG
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["PROG:test"]
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Prog/MP.Prog.csproj
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
STAT:IIS01:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: MP.Stats
SOL_NAME: MP-STATS
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["STAT:test"]
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Stats/MP.Stats.csproj
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
MON:IIS01:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: MP.Mon
SOL_NAME: MP-MON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["MON:test"]
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
LAND:IIS02:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: MP.Land
SOL_NAME: MP-LAND
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
needs: ["LAND:build"]
script:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Land/MP.Land.csproj
- dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Land/MP.Land.csproj
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
PROG:IIS02:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: MP.Prog
SOL_NAME: MP-PROG
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
needs: ["PROG:build"]
script:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Prog/MP.Prog.csproj
- dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Prog/MP.Prog.csproj
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
STAT:IIS02:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: MP.Stats
SOL_NAME: MP-STATS
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
needs: ["STAT:build"]
script:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Stats/MP.Stats.csproj
- dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Stats/MP.Stats.csproj
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
MON:IIS02:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: MP.Mon
SOL_NAME: MP-MON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
needs: ["MON:build"]
script:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
LAND:installer:
stage: installer
tags:
- win
variables:
APP_NAME: MP.Land
SOL_NAME: MP-LAND
NEXUS_PATH: MP-LAND
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
needs: ["LAND:build"]
variables:
APP_NAME: MP.Land
NEXUS_PATH: MP-LAND
before_script:
# - *nuget-fix
# - dotnet restore
script:
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release MP.Land/MP.Land.csproj -o:publish
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
@@ -217,18 +341,19 @@ PROG:installer:
stage: installer
tags:
- win
variables:
APP_NAME: MP.Prog
SOL_NAME: MP-PROG
NEXUS_PATH: MP-PROG
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
needs: ["PROG:build"]
variables:
APP_NAME: MP.Prog
NEXUS_PATH: MP-PROG
before_script:
# - *nuget-fix
# - dotnet restore
script:
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release MP.Prog/MP.Prog.csproj -o:publish
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
@@ -237,27 +362,55 @@ STAT:installer:
stage: installer
tags:
- win
variables:
APP_NAME: MP.Stats
SOL_NAME: MP-STATS
NEXUS_PATH: MP-STATS
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
needs: ["STAT:build"]
variables:
APP_NAME: MP.Stats
NEXUS_PATH: MP-STATS
before_script:
# - *nuget-fix
# - dotnet restore
script:
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release MP.Stats/MP.Stats.csproj -o:publish
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
MON:installer:
stage: installer
tags:
- win
variables:
APP_NAME: MP.Mon
SOL_NAME: MP-MON
NEXUS_PATH: MP-MON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
needs: ["MON:build"]
script:
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
LAND:release:
stage: release
tags:
- win
variables:
APP_NAME: MP.Land
SOL_NAME: MP-LAND
NEXUS_PATH: MP-LAND
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
#- feature/Deploy_CI_CD
# - master
@@ -269,13 +422,19 @@ LAND:release:
paths:
- publish/
script:
- dotnet publish -c Release -o ./publish MP.Land/MP.Land.csproj
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
PROG:release:
stage: release
tags:
- win
variables:
APP_NAME: MP.Prog
SOL_NAME: MP-PROG
NEXUS_PATH: MP-PROG
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
#- feature/Deploy_CI_CD
# - master
@@ -287,13 +446,19 @@ PROG:release:
paths:
- publish/
script:
- dotnet publish -c Release -o ./publish MP.Prog/MP.Prog.csproj
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
STAT:release:
stage: release
tags:
- win
variables:
APP_NAME: MP.Stats
SOL_NAME: MP-STATS
NEXUS_PATH: MP-STATS
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
#- feature/Deploy_CI_CD
# - master
@@ -305,8 +470,28 @@ STAT:release:
paths:
- publish/
script:
- dotnet publish -c Release -o ./publish MP.Land/MP.Land.csproj
- dotnet publish -c Release -o ./publish MP.Prog/MP.Prog.csproj
- dotnet publish -c Release -o ./publish MP.Stats/MP.Stats.csproj
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
MON:release:
stage: release
tags:
- win
variables:
APP_NAME: MP.Mon
SOL_NAME: MP-MON
NEXUS_PATH: MP-MON
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
#- feature/Deploy_CI_CD
# - master
- tags
except:
- branches
needs: ["MON:build"]
artifacts:
paths:
- publish/
script:
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
+1 -1
View File
@@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/MP.Stats/bin/Debug/net5.0/MP.Stats.dll",
"program": "${workspaceFolder}/MP.Stats/bin/Debug/net6.0/MP.Stats.dll",
"args": [],
"cwd": "${workspaceFolder}/MP.Stats",
"stopAtEntry": false,
+1 -1
View File
@@ -89,7 +89,7 @@ ExecuteLog "7z x ""$SourceDir\$ZipFile"" "
# step 3 : replica applicazione
Write-Host "START copy step"
ExecuteLog "robocopy '$utilDir\publish\net5.0\' '$DestDir' /MIR /Z /LOG:'$logMirror'"
ExecuteLog "robocopy '$utilDir\publish\net6.0\' '$DestDir' /MIR /Z /LOG:'$logMirror'"
Write-Host "END copy step"
# step 4 : riavvio pool
+9
View File
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
+220
View File
@@ -0,0 +1,220 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Egw.Core
{
public class LiManObj
{
#region Public Enums
public enum StatoRichiesta
{
ND = 0,
Richiesta,
Valutazione,
Approvata,
Rifiutata
}
public enum TipoLicenza
{
ND = 0,
/// <summary>
/// Licenza LEgacy Steamware
/// </summary>
GLS,
/// <summary>
/// Master Key License, che ha una data di scadenza globale ed un token = numero di utenti/token massimi associati
/// </summary>
MasterKey,
/// <summary>
/// UserKey License (licenza che consuma un token utente della licenza master) - es GPW
/// </summary>
UserKey,
/// <summary>
/// Chiave tiupo Checksum basata su licenza masster + checksum MD5 di una serie di dati (child licenses)
/// </summary>
CheckSumKey
}
#endregion Public Enums
#region Public Classes
public class ApplicativoDTO
{
#region Public Properties
public string Chiave { get; set; } = "";
public string CodApp { get; set; } = "";
public string CodInst { get; set; } = "";
public DateTime DataEnigma { get; set; } = DateTime.Today.AddYears(-1);
public string Descrizione { get; set; } = "";
public string Enigma { get; set; } = "";
public int IdxLic { get; set; } = 0;
public bool IsActive
{
get => (Scadenza.Subtract(DateTime.Today).TotalDays > 0);
}
public bool Locked { get; set; } = false;
public int NumLicenze { get; set; } = 0;
public int NumLicenzeAttive { get; set; } = 0;
public string Payload { get; set; } = "";
public DateTime Scadenza { get; set; } = DateTime.Today.AddYears(-1);
public TipoLicenza Tipo { get; set; } = TipoLicenza.ND;
#endregion Public Properties
}
public class AttivazioneDTO
{
#region Public Properties
public string Chiave { get; set; } = "";
public string CodApp { get; set; } = "";
public string CodImpiego { get; set; } = "";
public string CodInst { get; set; } = "";
public string Descrizione { get; set; } = "";
public int IdxLic { get; set; } = 0;
public int IdxSubLic { get; set; } = 0;
public TipoLicenza Tipo { get; set; } = TipoLicenza.UserKey;
public DateTime VetoUnlock { get; set; } = DateTime.Today.AddMonths(2);
#endregion Public Properties
}
public class LicenseCoord
{
#region Public Properties
public string CodApp { get; set; } = "";
public string CodInst { get; set; } = "";
public string Enigma { get; set; } = "";
public string MasterKey { get; set; } = "";
#endregion Public Properties
}
public class SupportRequest
{
#region Public Properties
public string CodApp { get; set; } = "";
public string CodImp { get; set; } = "";
public string CodInst { get; set; } = "";
public string ContactEmail { get; set; } = "";
public string ContactName { get; set; } = "";
public string ContactPhone { get; set; } = "";
public int idxSubLic { get; set; } = 0;
public bool IsValid
{
get => !string.IsNullOrEmpty(MasterKey) && !string.IsNullOrEmpty(ContactName) && !string.IsNullOrEmpty(ContactEmail) && !string.IsNullOrEmpty(CodInst) && !string.IsNullOrEmpty(CodApp);
}
public string MasterKey { get; set; } = "";
public string ReqBody { get; set; } = "";
#endregion Public Properties
}
/// <summary>
/// Oggetto Ticket
/// </summary>
public class TicketDTO
{
#region Public Properties
/// <summary>
/// Codice univoco della sub licenza (opzionale)
/// </summary>
public string CodImpiego { get; set; } = "";
/// <summary>
/// Contatto email del cliente richiedente
/// </summary>
public string ContactEmail { get; set; } = "";
/// <summary>
/// Contatto del cliente richiedente
/// </summary>
public string ContactName { get; set; } = "";
/// <summary>
/// Contatto telefonico del cliente richiedente
/// </summary>
public string ContactPhone { get; set; } = "";
public DateTime DtReq { get; set; } = DateTime.Now;
/// <summary>
/// IDX licenza master
/// </summary>
public int IdxLic { get; set; } = 0;
/// <summary>
/// IDX licenza child (opzionale)
/// </summary>
public int IdxSubLic { get; set; } = 0;
public int IdxTicket { get; set; } = 0;
/// <summary>
/// Motivazione della richiesta
/// </summary>
public string ReqBody { get; set; } = "";
/// <summary>
/// Stato richiesta
/// </summary>
public StatoRichiesta Status { get; set; } = StatoRichiesta.ND;
/// <summary>
/// Risposta alla richiesta
/// </summary>
public string SupplAnsw { get; set; } = "";
/// <summary>
/// Email del responsabile dell'azione (interno - supplier)
/// </summary>
public string SupplEmail { get; set; } = "";
/// <summary>
/// Cod dell'user responsabile dell'azione (interno - supplier)
/// </summary>
public string SupplUserCode { get; set; } = "";
/// <summary>
/// Tipologia di licenza gestita
/// </summary>
public TipoLicenza Tipo { get; set; } = TipoLicenza.UserKey;
#endregion Public Properties
}
public class UserLicenseRequest
{
#region Public Properties
public string MasterKey { get; set; } = "";
public Dictionary<string, string> ParamDict { get; set; } = new Dictionary<string, string>();
#endregion Public Properties
}
#endregion Public Classes
}
}
+186
View File
@@ -0,0 +1,186 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace Egw.Core
{
/// <summary>
/// utils x cifrature e Crypto
/// </summary>
public class SteamCrypto
{
#region Public Methods
/// <summary>
/// decifra un messaggio con una password
/// </summary>
/// <param name="Message"></param>
/// <param name="Passphrase"></param>
/// <returns></returns>
public static string DecryptString(string Message, string Passphrase)
{
string answ = Message;
byte[] Results = null;
UTF8Encoding UTF8 = new UTF8Encoding();
// Step 1. We hash the passphrase using MD5
// We use the MD5 hash generator as the result is a 128 bit byte array
// which is a valid length for the TripleDES encoder we use below
MD5CryptoServiceProvider HashProvider = new MD5CryptoServiceProvider();
byte[] TDESKey = HashProvider.ComputeHash(UTF8.GetBytes(Passphrase));
// Step 2. Create a new TripleDESCryptoServiceProvider object
TripleDESCryptoServiceProvider TDESAlgorithm = new TripleDESCryptoServiceProvider();
// Step 3. Setup the decoder
TDESAlgorithm.Key = TDESKey;
TDESAlgorithm.Mode = CipherMode.ECB;
TDESAlgorithm.Padding = PaddingMode.PKCS7;
// Step 4. Convert the input string to a byte[]
byte[] DataToDecrypt = null;
try
{
DataToDecrypt = Convert.FromBase64String(Message);
}
catch
{ }
if (DataToDecrypt != null)
{
// Step 5. Attempt to decrypt the string
try
{
ICryptoTransform Decryptor = TDESAlgorithm.CreateDecryptor();
Results = Decryptor.TransformFinalBlock(DataToDecrypt, 0, DataToDecrypt.Length);
}
finally
{
// Clear the TripleDes and Hashprovider services of any sensitive information
TDESAlgorithm.Clear();
HashProvider.Clear();
}
// Step 6. Return the decrypted string in UTF8 format
answ = UTF8.GetString(Results);
}
return answ;
}
/// <summary>
/// cifra un messaggio con una password
/// </summary>
/// <param name="Message"></param>
/// <param name="Passphrase"></param>
/// <returns></returns>
public static string EncryptString(string Message, string Passphrase)
{
byte[] Results;
UTF8Encoding UTF8 = new UTF8Encoding();
// Step 1. We hash the passphrase using MD5
// We use the MD5 hash generator as the result is a 128 bit byte array
// which is a valid length for the TripleDES encoder we use below
MD5CryptoServiceProvider HashProvider = new MD5CryptoServiceProvider();
byte[] TDESKey = HashProvider.ComputeHash(UTF8.GetBytes(Passphrase));
// Step 2. Create a new TripleDESCryptoServiceProvider object
TripleDESCryptoServiceProvider TDESAlgorithm = new TripleDESCryptoServiceProvider();
// Step 3. Setup the encoder
TDESAlgorithm.Key = TDESKey;
TDESAlgorithm.Mode = CipherMode.ECB;
TDESAlgorithm.Padding = PaddingMode.PKCS7;
// Step 4. Convert the input string to a byte[]
byte[] DataToEncrypt = UTF8.GetBytes(Message);
// Step 5. Attempt to encrypt the string
try
{
ICryptoTransform Encryptor = TDESAlgorithm.CreateEncryptor();
Results = Encryptor.TransformFinalBlock(DataToEncrypt, 0, DataToEncrypt.Length);
}
finally
{
// Clear the TripleDes and Hashprovider services of any sensitive information
TDESAlgorithm.Clear();
HashProvider.Clear();
}
// Step 6. Return the encrypted string as a base64 encoded string
return Convert.ToBase64String(Results);
}
/// <summary>
/// genera hash di una stringa in MD5 (es x hash gravatar)
/// </summary>
/// <param name="Message"></param>
/// <returns></returns>
public static string getHashStringMD5(string Message)
{
string hash = "";
using (MD5 md5Hash = MD5.Create())
{
hash = GetMd5Hash(md5Hash, Message);
}
return hash;
}
/// <summary>
/// Crea un hash MD5
/// </summary>
/// <param name="md5Hash"></param>
/// <param name="input"></param>
/// <returns></returns>
public static string GetMd5Hash(MD5 md5Hash, string input)
{
// Convert the input string to a byte array and compute the hash.
byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
// Create a new Stringbuilder to collect the bytes
// and create a string.
StringBuilder sBuilder = new StringBuilder();
// Loop through each byte of the hashed data
// and format each one as a hexadecimal string.
for (int i = 0; i < data.Length; i++)
{
sBuilder.Append(data[i].ToString("x2"));
}
// Return the hexadecimal string.
return sBuilder.ToString();
}
/// <summary>
/// Verify a hash against a string.
/// </summary>
/// <param name="md5Hash"></param>
/// <param name="input"></param>
/// <param name="hash"></param>
/// <returns></returns>
public static bool VerifyMd5Hash(MD5 md5Hash, string input, string hash)
{
// Hash the input.
string hashOfInput = GetMd5Hash(md5Hash, input);
// Create a StringComparer an compare the hashes.
StringComparer comparer = StringComparer.OrdinalIgnoreCase;
if (0 == comparer.Compare(hashOfInput, hash))
{
return true;
}
else
{
return false;
}
}
#endregion Public Methods
}
}
+105
View File
@@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Egw.Core
{
/// <summary>
/// Gestione licenze applicativi GLS (Legacy SteamWare)
/// </summary>
public class licenseManGLS
{
#region Public Methods
/// <summary>
/// restituisce data decodificata da authKey + applicazione + cliente...
/// </summary>
/// <param name="cliente">The cliente.</param>
/// <param name="applicativo">The applicativo.</param>
/// <param name="licenze">The licenze.</param>
/// <param name="authKey">The authentication key.</param>
/// <returns></returns>
public static DateTime expiryDateByAuthKey(string cliente, string applicativo, int licenze, string authKey)
{
DateTime answ = DateTime.Today.AddYears(-10);
string plainAuthKey = "";
try
{
string passPhrase = string.Format("{0}|{1}", cliente.PadLeft(50, ':'), applicativo);
plainAuthKey = SteamCrypto.DecryptString(authKey, passPhrase); // uso combinazione cliente+applicativo come passphrase!
string datePart = plainAuthKey.Replace($"{cliente}#{applicativo.PadLeft(20, '-')}-", "").Replace($"%{licenze}%", "");
//string datePart = plainAuthKey.Replace(string.Format("{0}#{1}-", cliente, applicativo.PadLeft(20, '-')), "").Replace(string.Format("%{0}%", licenze), "");
// se non avesse "bonificato" la parte num licenze (es non corrisponde al max) forzo il trim
if (datePart.Contains("%"))
{
datePart = datePart.Substring(0, datePart.IndexOf("%"));
}
answ = Convert.ToDateTime(datePart);
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore decodifica auth key:{0}AuthKey: {1}{0}cliente:{2}{0}applicativo:{3}{0}errore:{4}", Environment.NewLine, authKey, cliente, applicativo, exc), tipoLog.EXCEPTION);
}
return answ;
}
/// <summary>
/// Fornisce chiave MD5 x un cliente/applicativo/expiryDate
/// </summary>
/// <param name="cliente"></param>
/// <param name="applicativo"></param>
/// <param name="licenze"></param>
/// <param name="expiryDate"></param>
/// <returns></returns>
public static string getAuthKey(string cliente, string applicativo, int licenze, DateTime expiryDate)
{
string answ = "";
// algoritmo MD5 formato cliente#applicativo#expDate, via SQLdiventa
// SELECT CONVERT(VARCHAR(32), HashBytes('MD5', 'ETS#GPW#2013/12/31'), 2)
string plainAuthKey = string.Format("{0}#{1}-{2}%{3}%", cliente, applicativo.PadLeft(20, '-'), expiryDate.ToString("yyyy/MM/dd"), licenze);
string passPhrase = string.Format("{0}|{1}", cliente.PadLeft(50, ':'), applicativo);
answ = SteamCrypto.EncryptString(plainAuthKey, passPhrase); // uso combinazione cliente+applicativo come passphrase!
return answ;
}
/// <summary>
/// Fornisce chiave MD5 x una chiave secondaria/di checksum data dai parametri in ingresso
/// MasterKey/string[] chiavi singole child/expiryDate
/// </summary>
/// <param name="MasterKey">Chiave master da cui si parte</param>
/// <param name="Payload">Payload che contiene le chiavi SUB (child) riferite alla master in formato JSon (compresso/no indent)</param>
/// <returns></returns>
public static string getChecksumKey(string MasterKey, string Payload)
{
string answ = "";
answ = SteamCrypto.EncryptString(Payload, MasterKey);
return answ;
}
/// <summary>
/// numero di licenze attive per cliente/applicativo
/// </summary>
/// <param name="cliente"></param>
/// <param name="applicativo"></param>
/// <returns></returns>
public static int getLicenseNum(string cliente, string applicativo)
{
// !!!FARE!!! chiamata a webservice 1/mese
int answ = 1;
// molto hard-coded e discutibile... licenze "perenni"
switch (cliente)
{
default:
answ = 1;
break;
}
return answ;
}
#endregion Public Methods
}
}
+8 -2
View File
@@ -1,12 +1,14 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31229.75
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Land", "MP.Land\MP.Land.csproj", "{D949AB45-9B65-4594-A97E-182BC3831707}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.AppAuth", "MP.AppAuth\MP.AppAuth.csproj", "{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Egw.Core", "Egw.Core\Egw.Core.csproj", "{D3D348EF-1313-43DF-94FB-28CD38B68212}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +23,10 @@ Global
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Release|Any CPU.Build.0 = Release|Any CPU
{D3D348EF-1313-43DF-94FB-28CD38B68212}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3D348EF-1313-43DF-94FB-28CD38B68212}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3D348EF-1313-43DF-94FB-28CD38B68212}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3D348EF-1313-43DF-94FB-28CD38B68212}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+31
View File
@@ -0,0 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32126.317
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Data", "MP.Data\MP.Data.csproj", "{10BA8450-301D-49C7-8E1E-21B7469C225C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Mon", "MP.Mon\MP.Mon.csproj", "{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.Build.0 = Release|Any CPU
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {632D11D1-088B-4795-97E5-048534002558}
EndGlobalSection
EndGlobal
+2 -2
View File
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31229.75
# Visual Studio Version 17
VisualStudioVersion = 17.0.32126.317
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Stats", "MP.Stats\MP.Stats.csproj", "{D9901B50-E61C-400C-B62C-FA060CF72C29}"
EndProject
+33 -5
View File
@@ -3,10 +3,6 @@ using Microsoft.Extensions.Configuration;
using MP.AppAuth.Models;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.AppAuth
{
@@ -58,9 +54,10 @@ namespace MP.AppAuth
#region Public Properties
public virtual DbSet<AnagraficaGruppi> DbSetAnagraficaGruppi { get; set; }
public virtual DbSet<AnagraficaOperatori> DbSetAnagOpr { get; set; }
public virtual DbSet<Gruppi2Operatori> DbSetGruppi2Oper { get; set; }
public virtual DbSet<UpdMan> DbSetUpdMan { get; set; }
public virtual DbSet<Vocabolario> DbSetVocabolario { get; set; }
#endregion Public Properties
@@ -108,6 +105,37 @@ namespace MP.AppAuth
.HasMaxLength(500);
});
modelBuilder.Entity<AnagraficaGruppi>(entity =>
{
entity.HasKey(e => e.CodGruppo);
entity.ToTable("AnagraficaGruppi");
entity.Property(e => e.CodGruppo).HasMaxLength(50);
entity.Property(e => e.DescrGruppo)
.IsRequired()
.HasMaxLength(250)
.HasDefaultValueSql("('')");
entity.Property(e => e.SelEnabled).HasComment("Indica se sia selezionabile a livello di tendina x inserimento BCode");
entity.Property(e => e.TipoGruppo)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('REPARTO')")
.HasComment("tipo gruppo: reparto (es x gestione operatori assegnati), GRUPPO FASE (es macchien che fanno lo stesso tipo di lavoro), ...");
});
modelBuilder.Entity<Gruppi2Operatori>(entity =>
{
entity.HasKey(e => new { e.MatrOpr, e.CodGruppo });
entity.ToTable("Gruppi2Operatori");
entity.Property(e => e.CodGruppo).HasMaxLength(50);
});
//
modelBuilder.Seed();
+70 -2
View File
@@ -31,6 +31,38 @@ namespace MP.AppAuth.Controllers
#region Public Methods
/// <summary>
/// Elenco Record x Gruppi
/// </summary>
/// <returns></returns>
public List<Models.AnagraficaGruppi> AnagGruppiFilt(string codTipo)
{
List<Models.AnagraficaGruppi> dbResult = new List<Models.AnagraficaGruppi>();
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
{
dbResult = localDbCtx
.DbSetAnagraficaGruppi
.Where(x => x.TipoGruppo == codTipo)
.ToList();
}
return dbResult;
}
/// <summary>
/// Elenco Record x Gruppi
/// </summary>
/// <returns></returns>
public List<Models.AnagraficaGruppi> AnagGruppiGetAll()
{
List<Models.AnagraficaGruppi> dbResult = new List<Models.AnagraficaGruppi>();
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
{
dbResult = localDbCtx
.DbSetAnagraficaGruppi
.ToList();
}
return dbResult;
}
public List<Models.AnagraficaOperatori> AnagOpGetAll(string searchVal)
{
List<Models.AnagraficaOperatori> dbResult = new List<Models.AnagraficaOperatori>();
@@ -53,6 +85,41 @@ namespace MP.AppAuth.Controllers
// ritorno
return dbResult;
}
public List<Models.AnagraficaOperatori> AnagOpByGruppoGetFilt(string codGruppo, string searchVal)
{
List<Models.AnagraficaOperatori> dbResult = new List<Models.AnagraficaOperatori>();
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
{
if (!string.IsNullOrEmpty(searchVal))
{
dbResult = localDbCtx
.DbSetGruppi2Oper
.Where(x => x.CodGruppo == codGruppo || string.IsNullOrEmpty(codGruppo))
.Join(
localDbCtx.DbSetAnagOpr.Where(x => x.Cognome.Contains(searchVal) || x.Nome.Contains(searchVal)),
gruppo => gruppo.MatrOpr,
operatore => operatore.MatrOpr,
(gruppo, operatore) => operatore
)
.ToList();
}
else
{
dbResult = localDbCtx
.DbSetGruppi2Oper
.Where(x => x.CodGruppo == codGruppo || string.IsNullOrEmpty(codGruppo))
.Join(
localDbCtx.DbSetAnagOpr,
gruppo => gruppo.MatrOpr,
operatore => operatore.MatrOpr,
(gruppo, operatore) => operatore
)
.ToList();
}
}
// ritorno
return dbResult;
}
public void Dispose()
{
@@ -99,6 +166,7 @@ namespace MP.AppAuth.Controllers
{
dbResult = localDbCtx
.DbSetUpdMan
.OrderBy(x => x.Ordinal)
.ToList();
}
return dbResult;
@@ -114,8 +182,8 @@ namespace MP.AppAuth.Controllers
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
{
dbResult = localDbCtx
.DbSetVocabolario
.ToList();
.DbSetVocabolario
.ToList();
}
return dbResult;
}
+61
View File
@@ -0,0 +1,61 @@
using Microsoft.Extensions.Configuration;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
namespace MP.AppAuth.Controllers
{
public class MPController : IDisposable
{
#region Public Fields
public static AppAuth.Controllers.MPController dbController;
#endregion Public Fields
#region Public Constructors
public MPController(IConfiguration configuration)
{
_configuration = configuration;
Log.Info("Avviata classe MpController");
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Elenco Record x AnagKeyValue
/// </summary>
/// <returns></returns>
public List<Models.AnagKeyValueModel> AnagKeyValuesGetAll()
{
List<Models.AnagKeyValueModel> dbResult = new List<Models.AnagKeyValueModel>();
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
{
dbResult = localDbCtx
.DbSetAnagKeyValues
.ToList();
}
return dbResult;
}
public void Dispose()
{
// Clear database controller
dbController.Dispose();
}
#endregion Public Methods
#region Private Fields
private static IConfiguration _configuration;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
}
}
+5 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
@@ -23,4 +23,8 @@
<PackageReference Include="NLog" Version="4.7.11" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Egw.Core\Egw.Core.csproj" />
</ItemGroup>
</Project>
@@ -1,19 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class AnagKeyValue
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("AnagKeyValue")]
public partial class AnagKeyValueModel
{
#region Public Properties
public string Descrizione { get; set; }
[Key]
public string NomeVar { get; set; }
public double? ValFloat { get; set; }
public int? ValInt { get; set; }
public double? ValFloat { get; set; }
public string ValString { get; set; }
public string Descrizione { get; set; }
#endregion Public Properties
}
+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class AnagraficaGruppi
{
public string CodGruppo { get; set; }
public string TipoGruppo { get; set; }
public string DescrGruppo { get; set; }
public bool SelEnabled { get; set; }
}
}
+13
View File
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class Gruppi2Operatori
{
public int MatrOpr { get; set; }
public string CodGruppo { get; set; }
}
}
+1
View File
@@ -20,6 +20,7 @@ namespace MP.AppAuth.Models
public string LicenseKey { get; set; }
public string LocalRepo { get; set; }
public string ManifestUrl { get; set; }
public int Ordinal { get; set; } = 1;
public string PackName { get; set; }
#endregion Public Properties
+51 -11
View File
@@ -1,23 +1,53 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using MP.AppAuth.Models;
#nullable disable
using NLog;
using System;
namespace MP.AppAuth
{
public partial class MoonProContext : DbContext
{
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private IConfiguration _configuration;
#endregion Private Fields
#region Public Constructors
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
public MoonProContext()
{
}
public MoonProContext(DbContextOptions<MoonProContext> options)
: base(options)
public MoonProContext(IConfiguration configuration)
{
_configuration = configuration;
try
{
// se non ci fosse... crea o migra!
Database.Migrate();
}
catch (Exception exc)
{
Log.Error(exc, "Exception during context initialization 01");
}
}
public MoonProContext(DbContextOptions<MoonProContext> options) : base(options)
{
try
{
// se non ci fosse... crea o migra!
Database.Migrate();
}
catch (Exception exc)
{
Log.Error(exc, "Exception during context initialization 02");
}
}
#endregion Public Constructors
@@ -26,7 +56,6 @@ namespace MP.AppAuth
public virtual DbSet<AnagArticoli> AnagArticolis { get; set; }
public virtual DbSet<AnagClassiTempo> AnagClassiTempos { get; set; }
public virtual DbSet<AnagKeyValue> AnagKeyValues { get; set; }
public virtual DbSet<AnagraficaCausaliScarto> AnagraficaCausaliScartos { get; set; }
public virtual DbSet<AnagraficaFlussi> AnagraficaFlussis { get; set; }
public virtual DbSet<AnagraficaIngressi> AnagraficaIngressis { get; set; }
@@ -34,6 +63,7 @@ namespace MP.AppAuth
public virtual DbSet<AnagraficaOperatori> AnagraficaOperatoris { get; set; }
public virtual DbSet<Config> Configs { get; set; }
public virtual DbSet<DatiMacchine> DatiMacchines { get; set; }
public virtual DbSet<AnagKeyValueModel> DbSetAnagKeyValues { get; set; }
public virtual DbSet<FamigliaTipoIngressi> FamigliaTipoIngressis { get; set; }
public virtual DbSet<FamiglieMacchine> FamiglieMacchines { get; set; }
public virtual DbSet<KeepAlive> KeepAlives { get; set; }
@@ -41,7 +71,7 @@ namespace MP.AppAuth
public virtual DbSet<ListValue> ListValues { get; set; }
public virtual DbSet<Macchine> Macchines { get; set; }
public virtual DbSet<UpdMan> UpdMan { get; set; }
public virtual DbSet<Vocabolario> Vocabolario { get; set; }
public virtual DbSet<Vocabolario> DbSetVocabolario { get; set; }
#endregion Public Properties
@@ -57,7 +87,15 @@ namespace MP.AppAuth
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlServer("Data Source=SQL2016DEV;Initial Catalog=MoonPro;Trusted_Connection=True;");
string connString = _configuration.GetConnectionString("MP.Land");
if (!string.IsNullOrEmpty(connString))
{
optionsBuilder.UseSqlServer(connString);
}
else
{
optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;");
}
}
}
@@ -113,7 +151,7 @@ namespace MP.AppAuth
entity.Property(e => e.Descrizione).HasMaxLength(500);
});
modelBuilder.Entity<AnagKeyValue>(entity =>
modelBuilder.Entity<AnagKeyValueModel>(entity =>
{
entity.HasKey(e => e.NomeVar);
@@ -465,6 +503,8 @@ namespace MP.AppAuth
.HasMaxLength(500);
});
OnModelCreatingPartial(modelBuilder);
}
+19
View File
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data.Conf
{
/// <summary>
/// Struttura conf del file conf TAG x IOB
/// </summary>
public class IobTags
{
/// <summary>
/// Oggetto dizionario di configurazione x IOB
/// </summary>
public Dictionary<string, List<TagData>> IobSetup = new Dictionary<string, List<TagData>>();
}
}
+44
View File
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data.Conf
{
/// <summary>
/// Item da mostrare nei blocchi MON degli impianti come override ai dati MSE
/// </summary>
public class TagData
{
/// <summary>
/// Indice della colonna (ordine) del dato
/// </summary>
public int ColNum { get; set; } = 0;
/// <summary>
/// Indice della riga del dato
/// </summary>
public int RowNum { get; set; } = 0;
/// <summary>
/// Override CSS (es fontSmall)
/// </summary>
public string TagCss { get; set; } = "";
/// <summary>
/// Etichetta da mostrare
/// </summary>
public string TagName { get; set; } = "";
/// <summary>
/// Indicazione della chiave REDIS dove recuperare il tag indicato (già in formato string)
/// </summary>
public string TagLocation { get; set; } = "";
/// <summary>
/// Clone dell'oggetto
/// </summary>
/// <returns></returns>
public TagData Clone()
{
return (TagData)this.MemberwiseClone();
}
}
}
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data
{
public class Constants
{
// dati conf REDIS Cache
public static readonly string BASE_HASH = "MAPO";
// REDIS KEY Dati correnti
public static readonly string CONF_MON_KEY = $"{BASE_HASH}:Conf:MonDispData";
public static readonly string ACT_FLUX_DATA_KEY = $"{BASE_HASH}:Current:FluxData";
}
}
+138
View File
@@ -0,0 +1,138 @@
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
namespace MP.Data.Controllers
{
public class MpMonController : IDisposable
{
#region Private Fields
private static IConfiguration _configuration;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Public Constructors
public MpMonController(IConfiguration configuration)
{
_configuration = configuration;
Log.Info("Avviata classe MpMonController");
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Elenco tabella Articoli da filtro
/// </summary>
/// <param name="numRecord"></param>
/// <param name="searchVal"></param>
/// <returns></returns>
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
{
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetArticoli
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
.OrderBy(x => x.CodArticolo)
.Take(numRecord)
.ToList();
}
return dbResult;
}
public void Dispose()
{
}
/// <summary>
/// Elenco da tabella Macchine
/// </summary>
/// <returns></returns>
public List<DatabaseModels.Macchine> MacchineGetAll()
{
List<DatabaseModels.Macchine> dbResult = new List<DatabaseModels.Macchine>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetMacchine
.OrderBy(x => x.IdxMacchina)
.ToList();
}
return dbResult;
}
/// <summary>
/// Elenco da tabella Macchine
/// </summary>
/// <returns></returns>
public List<DatabaseModels.ConfigModel> ConfigGetAll()
{
List<DatabaseModels.ConfigModel> dbResult = new List<DatabaseModels.ConfigModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetConfig
.OrderBy(x => x.Chiave)
.ToList();
}
return dbResult;
}
/// <summary>
/// Elenco da tabella MappaStatoExpl
/// </summary>
/// <returns></returns>
public List<DatabaseModels.MappaStatoExpl> MseGetAll(int maxAge = 2000)
{
List<DatabaseModels.MappaStatoExpl> dbResult = new List<DatabaseModels.MappaStatoExpl>();
using (var dbCtx = new MoonProContext(_configuration))
{
var maxAgeSec = new SqlParameter("@maxAgeSec", maxAge);
dbResult = dbCtx
.DbSetMSE
.FromSqlRaw("EXEC stp_MSE_getData @maxAgeSec", maxAgeSec)
.ToList();
}
return dbResult;
}
/// <summary>
/// Annulla modifiche su una specifica entity (cancel update)
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public bool RollBackEntity(object item)
{
bool answ = false;
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified)
{
dbCtx.Entry(item).Reload();
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}");
}
}
return answ;
}
#endregion Public Methods
}
}
+121 -124
View File
@@ -1,13 +1,10 @@
using System;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using NLog;
using Microsoft.Extensions.Configuration;
using Microsoft.EntityFrameworkCore;
using Microsoft.Data.SqlClient;
namespace MP.Data.Controllers
{
@@ -16,7 +13,7 @@ namespace MP.Data.Controllers
#region Private Fields
private static IConfiguration _configuration;
private static MoonPro_STATSContext dbCtx;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
@@ -26,7 +23,6 @@ namespace MP.Data.Controllers
public MpStatsController(IConfiguration configuration)
{
_configuration = configuration;
dbCtx = new MoonPro_STATSContext(configuration);
Log.Info("Avviata classe MpStatsController");
}
@@ -41,11 +37,12 @@ namespace MP.Data.Controllers
public List<DatabaseModels.AzioniUL> ActionsGetAll()
{
List<DatabaseModels.AzioniUL> dbResult = new List<DatabaseModels.AzioniUL>();
dbResult = dbCtx
.DbSetAzioniUL
.ToList();
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
dbResult = dbCtx
.DbSetAzioniUL
.ToList();
}
return dbResult;
}
@@ -58,14 +55,15 @@ namespace MP.Data.Controllers
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
{
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
dbResult = dbCtx
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
dbResult = dbCtx
.DbSetArticoli
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
.OrderBy(x => x.CodArticolo)
.Take(numRecord)
.ToList();
}
return dbResult;
}
@@ -78,45 +76,39 @@ namespace MP.Data.Controllers
public List<DatabaseModels.ODL> CommesseGetSearch(int numRecord, string searchVal = "")
{
List<DatabaseModels.ODL> dbResult = new List<DatabaseModels.ODL>();
dbResult = dbCtx
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
dbResult = dbCtx
.DbSetODL
.Where(x => x.KeyRichiesta.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
.OrderBy(x => x.KeyRichiesta)
.Take(numRecord)
.ToList();
}
return dbResult;
}
public void Dispose()
{
// Clear database context
dbCtx.Dispose();
}
/// <summary>
/// Elenco tabella Macchine
/// Elenco da tabella Macchine
/// </summary>
/// <returns></returns>
public List<DatabaseModels.Macchine> MacchineGetAll()
{
List<DatabaseModels.Macchine> dbResult = new List<DatabaseModels.Macchine>();
dbResult = dbCtx
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
dbResult = dbCtx
.DbSetMacchine
.OrderBy(x => x.IdxMacchina)
.ToList();
}
return dbResult;
}
public void ResetController()
{
dbCtx = new MoonPro_STATSContext(_configuration);
Log.Info("Effettuato reset MpStatsController");
}
/// <summary>
/// Annulla modifiche su una specifica entity (cancel update)
/// </summary>
@@ -125,16 +117,19 @@ namespace MP.Data.Controllers
public bool RollBackEntity(object item)
{
bool answ = false;
try
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified)
try
{
dbCtx.Entry(item).Reload();
if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified)
{
dbCtx.Entry(item).Reload();
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}");
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}");
}
return answ;
}
@@ -148,19 +143,20 @@ namespace MP.Data.Controllers
public List<DatabaseModels.ResControlli> StatControlliGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
{
List<DatabaseModels.ResControlli> dbResult = new List<DatabaseModels.ResControlli>();
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
dbResult = dbCtx
.DbSetControlli
.FromSqlRaw("EXEC stp_UI_RC_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
.ToList();
dbResult = dbCtx
.DbSetControlli
.FromSqlRaw("EXEC stp_UI_RC_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
.ToList();
}
return dbResult;
}
@@ -179,21 +175,22 @@ namespace MP.Data.Controllers
public List<DatabaseModels.DdbTurni> StatDdbGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo, int FirstRecord, int NumRecord)
{
List<DatabaseModels.DdbTurni> dbResult = new List<DatabaseModels.DdbTurni>();
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
var firstRecord = new SqlParameter("@FirstRecord", FirstRecord);
var numRecord = new SqlParameter("@NumRecord", NumRecord);
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
var firstRecord = new SqlParameter("@FirstRecord", FirstRecord);
var numRecord = new SqlParameter("@NumRecord", NumRecord);
dbResult = dbCtx
.DbSetDdbTurni
.FromSqlRaw("EXEC stp_UI_DDBTurni_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo,@FirstRecord,@NumRecord", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo, firstRecord, numRecord)
.ToList();
dbResult = dbCtx
.DbSetDdbTurni
.FromSqlRaw("EXEC stp_UI_DDBTurni_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo,@FirstRecord,@NumRecord", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo, firstRecord, numRecord)
.ToList();
}
return dbResult;
}
@@ -209,12 +206,15 @@ namespace MP.Data.Controllers
/// <returns></returns>
public int StatDdbGetCount(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
{
var dbResult = dbCtx
int numResult = 0;
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
numResult = dbCtx
.DbSetDdbTurni
.Where(x => (x.IdxMacchina == IdxMacchina || IdxMacchina == "*") && (x.IdxOdl == IdxODL || IdxODL == -999) && (x.KeyRichiesta == KeyRichiesta || KeyRichiesta == "*") && (x.CodArticolo == CodArticolo || CodArticolo == "*") && (x.InizioPeriodo >= DataStart && x.InizioPeriodo <= DataEnd))
.Count();
return dbResult;
}
return numResult;
}
/// <summary>
@@ -226,19 +226,20 @@ namespace MP.Data.Controllers
public List<DatabaseModels.ODL> StatOdlGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
{
List<DatabaseModels.ODL> dbResult = new List<DatabaseModels.ODL>();
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
dbResult = dbCtx
.DbSetODL
.FromSqlRaw("EXEC stp_UI_Odl_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
.ToList();
dbResult = dbCtx
.DbSetODL
.FromSqlRaw("EXEC stp_UI_Odl_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
.ToList();
}
return dbResult;
}
@@ -253,19 +254,20 @@ namespace MP.Data.Controllers
public List<DatabaseModels.ResScarti> StatScartiGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
{
List<DatabaseModels.ResScarti> dbResult = new List<DatabaseModels.ResScarti>();
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
dbResult = dbCtx
.DbSetScarti
.FromSqlRaw("EXEC stp_UI_RS_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
.ToList();
dbResult = dbCtx
.DbSetScarti
.FromSqlRaw("EXEC stp_UI_RS_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
.ToList();
}
return dbResult;
}
@@ -280,19 +282,20 @@ namespace MP.Data.Controllers
public List<DatabaseModels.TurniOee> StatTurniOeeGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
{
List<DatabaseModels.TurniOee> dbResult = new List<DatabaseModels.TurniOee>();
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
dbResult = dbCtx
.DbSetTurniOee
.FromSqlRaw("EXEC stp_UI_TurniOee_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
.ToList();
dbResult = dbCtx
.DbSetTurniOee
.FromSqlRaw("EXEC stp_UI_TurniOee_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
.ToList();
}
return dbResult;
}
@@ -305,26 +308,20 @@ namespace MP.Data.Controllers
public List<DatabaseModels.UserActionLog> StatUserLogGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
{
List<DatabaseModels.UserActionLog> dbResult = new List<DatabaseModels.UserActionLog>();
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
//dbResult = dbCtx
// .DbSetUserLog
// .Where(x => x.Valore.Contains(searchVal) || x.Cognome.Contains(searchVal) || x.CodArticolo.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
// .OrderByDescending(x => x.DataOraRif)
// .Take(numRecord)
// .ToList();
var dataFrom = new SqlParameter("@dataFrom", DataStart);
var dataTo = new SqlParameter("@dataTo", DataEnd);
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
var idxODL = new SqlParameter("@IdxODL", IdxODL);
var keyRichiesta = new SqlParameter("@KeyRichiesta", KeyRichiesta);
var codArticolo = new SqlParameter("@CodArticolo", CodArticolo);
dbResult = dbCtx
.DbSetUserLog
.FromSqlRaw("EXEC stp_UI_UL_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
.ToList();
dbResult = dbCtx
.DbSetUserLog
.FromSqlRaw("EXEC stp_UI_UL_GetByFilter @dataFrom,@dataTo,@idxMacchina,@IdxODL,@KeyRichiesta,@CodArticolo", dataFrom, dataTo, idxMacchina, idxODL, keyRichiesta, codArticolo)
.ToList();
}
return dbResult;
}
+18
View File
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace MP.Data.DatabaseModels
{
[Table("Config")]
public partial class ConfigModel
{
public string Chiave { get; set; }
public string Valore { get; set; }
/// <summary>
/// Valore di default/riferimento per la variabile
/// </summary>
public string ValoreStd { get; set; }
public string Note { get; set; }
}
}
+36
View File
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
namespace MP.Data.DatabaseModels
{
public partial class MappaStatoExpl
{
public int RowNum { get; set; }
public DateTime? LastUpdate { get; set; }
public string IdxMacchina { get; set; }
public string CodMacchina { get; set; }
public string Nome { get; set; }
public string Url { get; set; }
public int? IdxOdl { get; set; }
public string CodArticolo { get; set; }
public string Disegno { get; set; }
public int? NumPezzi { get; set; }
public decimal? TCAssegnato { get; set; }
public DateTime? DataInizioOdl { get; set; }
public string Semaforo { get; set; }
public int? IdxStato { get; set; }
public string DescrizioneStato { get; set; }
public double? Durata { get; set; }
public int? PezziProd { get; set; }
public int? PezziConf { get; set; }
public decimal? TempoOn { get; set; }
public decimal? TempoAuto { get; set; }
public decimal? TempoRun { get; set; }
public decimal? TCMedio { get; set; }
public decimal? TCLav { get; set; }
public decimal? TCEff { get; set; }
public decimal? TCMedioRt { get; set; }
public decimal? TCLavRT { get; set; }
public decimal? TCEffRT { get; set; }
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>MP.Data</AssemblyName>
<RootNamespace>MP.Data</RootNamespace>
</PropertyGroup>
+7 -7
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>MP.Data</AssemblyName>
<RootNamespace>MP.Data</RootNamespace>
</PropertyGroup>
@@ -12,14 +12,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
<PackageReference Include="NLog" Version="4.7.11" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.4" />
<PackageReference Include="NLog" Version="4.7.15" />
</ItemGroup>
</Project>
+232
View File
@@ -0,0 +1,232 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.Configuration;
using MP.Data.DatabaseModels;
using NLog;
#nullable disable
namespace MP.Data
{
public partial class MoonProContext : DbContext
{
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private IConfiguration _configuration;
#endregion Private Fields
#region Public Constructors
public MoonProContext(IConfiguration configuration)
{
_configuration = configuration;
}
public MoonProContext(DbContextOptions<MoonProContext> options) : base(options)
{
}
#endregion Public Constructors
#region Public Properties
public virtual DbSet<AnagArticoli> DbSetArticoli { get; set; }
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
public virtual DbSet<MappaStatoExpl> DbSetMSE { get; set; }
public virtual DbSet<ConfigModel> DbSetConfig { get; set; }
#endregion Public Properties
#region Private Methods
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
#endregion Private Methods
#region Protected Methods
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
string connString = _configuration.GetConnectionString("Mp.Mon");
optionsBuilder.UseSqlServer(connString);
//optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;");
}
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
modelBuilder.Entity<AnagArticoli>(entity =>
{
entity.HasNoKey();
entity.ToView("v_UI_AnagArticoli");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DescArticolo)
.IsRequired()
.HasMaxLength(250);
entity.Property(e => e.Disegno)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Tipo)
.IsRequired()
.HasMaxLength(50);
});
modelBuilder.Entity<Macchine>(entity =>
{
entity.HasNoKey();
entity.ToView("Macchine");
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.Descrizione).HasMaxLength(50);
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Nome).HasMaxLength(50);
});
modelBuilder.Entity<MappaStatoExpl>(entity =>
{
entity.HasKey(e => e.RowNum);
entity.ToTable("MappaStatoExpl");
entity.Property(e => e.CodArticolo)
.HasMaxLength(50)
.HasDefaultValueSql("('-')");
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.DataInizioOdl)
.HasColumnType("datetime")
.HasColumnName("DataInizioODL");
entity.Property(e => e.DescrizioneStato)
.HasMaxLength(50)
.HasDefaultValueSql("('n.d.')");
entity.Property(e => e.Disegno)
.HasMaxLength(50)
.HasDefaultValueSql("('')");
entity.Property(e => e.Durata)
.HasColumnName("durata")
.HasDefaultValueSql("((0))");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.IdxOdl).HasColumnName("idxODL");
entity.Property(e => e.IdxStato)
.HasColumnName("idxStato")
.HasDefaultValueSql("((0))");
entity.Property(e => e.LastUpdate)
.HasColumnType("datetime")
.HasColumnName("lastUpdate");
entity.Property(e => e.Nome).HasMaxLength(50);
entity.Property(e => e.PezziConf).HasDefaultValueSql("((0))");
entity.Property(e => e.PezziProd).HasDefaultValueSql("((0))");
entity.Property(e => e.Semaforo)
.HasMaxLength(50)
.HasDefaultValueSql("('')");
entity.Property(e => e.TCAssegnato)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCAssegnato")
.HasDefaultValueSql("((1))");
entity.Property(e => e.TCEff)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCEff")
.HasDefaultValueSql("((0))");
entity.Property(e => e.TCEffRT)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCEffRT")
.HasDefaultValueSql("((0))");
entity.Property(e => e.TCLav)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCLav")
.HasDefaultValueSql("((0))");
entity.Property(e => e.TCLavRT)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCLavRT")
.HasDefaultValueSql("((0))");
entity.Property(e => e.TCMedio)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMedio")
.HasDefaultValueSql("((0))");
entity.Property(e => e.TCMedioRt)
.HasColumnType("decimal(18, 8)")
.HasColumnName("TCMedioRT")
.HasDefaultValueSql("((0))");
entity.Property(e => e.TempoAuto)
.HasColumnType("decimal(18, 8)")
.HasDefaultValueSql("((0))");
entity.Property(e => e.TempoOn)
.HasColumnType("decimal(18, 8)")
.HasDefaultValueSql("((0))");
entity.Property(e => e.TempoRun)
.HasColumnType("decimal(18, 8)")
.HasDefaultValueSql("((0))");
entity.Property(e => e.Url)
.HasMaxLength(250)
.HasColumnName("url");
});
modelBuilder.Entity<ConfigModel>(entity =>
{
entity.HasKey(e => e.Chiave);
entity.ToTable("Config");
entity.Property(e => e.Chiave)
.HasMaxLength(50)
.HasColumnName("chiave");
entity.Property(e => e.Note).HasColumnName("note");
entity.Property(e => e.Valore).HasColumnName("valore");
entity.Property(e => e.ValoreStd)
.HasColumnName("valoreStd")
.HasComment("Valore di default/riferimento per la variabile");
});
OnModelCreatingPartial(modelBuilder);
}
#endregion Protected Methods
}
}
+1 -4
View File
@@ -42,10 +42,6 @@ namespace MP.Data
public virtual DbSet<ODL> DbSetODL { get; set; }
public virtual DbSet<ResScarti> DbSetScarti { get; set; }
public virtual DbSet<TurniOee> DbSetTurniOee { get; set; }
#if false
public virtual DbSet<TurniPareto> DbSetTurniPareto { get; set; }
public virtual DbSet<TurniParetoOdl> DbSetTurniParetoOdl { get; set; }
#endif
public virtual DbSet<UserActionLog> DbSetUserLog { get; set; }
#endregion Public Properties
@@ -142,6 +138,7 @@ namespace MP.Data
entity.Property(e => e.Nome).HasMaxLength(50);
});
modelBuilder.Entity<DdbTurni>(entity =>
{
entity.HasNoKey();
+31
View File
@@ -0,0 +1,31 @@
using System;
namespace MP.Data
{
public class chartJsData
{
#region Public Classes
public class chartJsTSerie
{
#region Public Properties
public DateTime x { get; set; }
public double y { get; set; }
#endregion Public Properties
}
public class chartJsXY
{
#region Public Properties
public double x { get; set; }
public double y { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
+13 -1
View File
@@ -234,6 +234,18 @@ namespace MP.FileData.Controllers
return done;
}
public bool FileExport(FileModel currFile)
{
bool done = false;
using (MoonPro_ProgContext localDbCtx = new MoonPro_ProgContext(_configuration))
{
// sovrascrivo il file su disco
File.WriteAllBytes(currFile.Path, currFile.FileContent);
done = true;
}
return done;
}
public FileModel FileGetByKey(int FileId)
{
FileModel thisFile = null;
@@ -450,10 +462,10 @@ namespace MP.FileData.Controllers
// rileggo file...
var newFileInfo = new FileInfo(currFile.Path);
currFile.LastMod = newFileInfo.LastWriteTime;
// aggiorno stato del file a unchanged e data mod ad ora...
currFile.DiskStatus = FileState.Ok;
currFile.LastMod = newFileInfo.LastWriteTime;
localDbCtx.Entry(currFile).State = EntityState.Modified;
// salvo DB
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -77,7 +77,7 @@ namespace MP.FileData
{
if (!optionsBuilder.IsConfigured)
{
string connString = _configuration.GetConnectionString("MP.Land");
string connString = _configuration.GetConnectionString("MP.Prog");
if (!string.IsNullOrEmpty(connString))
{
optionsBuilder.UseSqlServer(connString);
+20
View File
@@ -0,0 +1,20 @@
<div class="row">
<div class="col-6">
Gruppi
</div>
<div class="col-6 text-right">
<select @bind="@groupName" class="form-control form-control-sm">
<option value="">--- Tutti ---</option>
@if (ListGroups != null)
{
@foreach (var item in ListGroups)
{
<option value="@item.CodGruppo">@item.DescrGruppo</option>
}
}
</select>
</div>
</div>
+54
View File
@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.Land;
using MP.Land.Shared;
using MP.AppAuth.Models;
using MP.Land.Data;
namespace MP.Land.Components
{
public partial class CmpGroupFilt
{
[Inject]
protected MessageService AppMService { get; set; }
[Inject]
protected AppAuthService DataService { get; set; }
private List<AnagraficaGruppi> ListGroups;
private string groupName
{
get
{
return AppMService.CodGruppo;
}
set
{
AppMService.CodGruppo = value;
}
}
protected override async Task OnInitializedAsync()
{
await ReloadData();
}
private async Task ReloadData()
{
// carico i gruppi
ListGroups = await DataService.AnagGruppiFilt("REPARTO");
}
}
}
+3 -3
View File
@@ -42,9 +42,9 @@
{
<div class="input-group input-group-sm">
<select @bind="@PageSize" class="form-control form-control-sm">
<option value="2">2</option>
<option value="4">4</option>
<option value="10">10</option>
<option value="3">3</option>
<option value="6">6</option>
<option value="9">9</option>
</select>
</div>
}
+1 -1
View File
@@ -71,7 +71,7 @@ namespace MP.Land.Components
protected int _numPage { get; set; } = 1;
protected int _numRecord { get; set; } = 4;
protected int _numRecord { get; set; } = 6;
protected int percLoading { get; set; } = 0;
+95 -50
View File
@@ -3,72 +3,117 @@
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@inject AppAuthService DataService
@inject LicenseService LicServ
<div class="card">
<div class="card-header">
@if (authOk())
{
<a target="_blank" href="@(fullUrl(CurrItem.AppUrl))" class="text-info" title="Apri">
<h3 class="mb-0">@CurrItem.AppName&nbsp;<i class="fas fa-link"></i></h3>
@if (authOk()) // disegno box cliccabile e programma attivato
{
<div class="card">
<div class="card-header">
<a target="_blank" href="@(fullUrl(CurrItem.AppUrl))" class="btn btn-outline-info btn-block" title="Apri">
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
<h3 class="mb-0">@CurrItem.AppName&nbsp;</h3>
</a>
}
else
{
<del>
<h3 class="mb-0 text-secondary">@CurrItem.AppName</h3>
</del>
}
</div>
<div class="card-body pb-0">
<div class="row">
@if (authOk())
{
<div class="col-3 text-info">
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
</div>
<div class="col-9" style="overflow-y: auto; height: 8em;">
</div>
<div class="card-body">
<div class="row text-dark">
<div class="col-4 text-left">
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
<ul style="mb-0">
@(traduci($"{CurrItem.AppName}-LIST"))
</ul>
<div class="border-bottom"></div>
<div class="badge badge-success"> Licenza Attiva</div>
</div>
}
else
{
<div class="col-3 text-secondary">
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
<div class="col-8 border-left text-left">
@(traduci($"{CurrItem.AppName}-LIST"))
</div>
<div class="col-9 text-secondary" style="overflow-y: auto; height: 8em;">
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
<ul style="mb-0">
@(traduci($"{CurrItem.AppName}-LIST"))
</ul>
</div>
}
</div>
</div>
</div>
<div class="card-footer text-danger py-1">
@if (authOk())
{
<span class="text-success">Programma Attivato</span>
}
else
{
<span class="text-danger">Licenza non attivata!</span>
}
}
else // disegno box non cliccabile e licenza mancante
{
<div class="card">
<div class="card-header">
<button class="btn btn-outline-secondary btn-block" title="Manca Licenza" disabled>
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
<h3 class="mb-0">@CurrItem.AppName</h3>
</button>
</div>
<div class="card-body">
<div class="row text-muted">
<div class="col-4 text-left">
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
<div class="border-bottom"></div>
<div class="badge badge-danger"> Licenza Mancante</div>
</div>
<div class="col-8 border-left text-left">
@(traduci($"{CurrItem.AppName}-LIST"))
</div>
</div>
</div>
</div>
</div>
}
@code {
[Parameter]
public UpdMan CurrItem { get; set; }
protected List<AnagKeyValueModel> AKVList
{
get
{
return LicServ.AKVList;
}
set
{
LicServ.AKVList = value;
}
}
protected override async Task OnInitializedAsync()
{
// check init AKV
if (AKVList == null || AKVList.Count == 0)
{
AKVList = await DataService.AnagKeyValList();
LicServ.InitAkv();
}
}
protected string getAKVString(string nomeVar)
{
string answ = "";
if (AKVList != null)
{
var currRec = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar);
if (currRec != null)
{
answ = currRec.ValString;
}
}
return answ;
}
protected AnagKeyValueModel getAKVRec(string nomeVar)
{
AnagKeyValueModel answ = new AnagKeyValueModel();
if (AKVList != null)
{
answ = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar);
}
return answ;
}
protected bool authOk()
{
bool answ = !string.IsNullOrEmpty(CurrItem.LicenseKey);
return answ;
bool allOk = !string.IsNullOrEmpty(CurrItem.LicenseKey);
if (allOk)
{
allOk = LicServ.checkLicenseActive(CurrItem.LicenseKey);
}
return allOk;
}
protected string fullUrl(string relUrl)
+4 -1
View File
@@ -1,4 +1,7 @@
<div class="row text-center">
@using MP.Land.Data
@inject LicenseService LicServ
<div class="row text-center">
@if (authOk())
{
<div class="col-12 mt-2">
@@ -43,6 +43,10 @@ namespace MP.Land.Components
protected bool authOk()
{
bool answ = !string.IsNullOrEmpty(CurrItem.LicenseKey);
if (answ)
{
answ = LicServ.checkLicenseActive(CurrItem.LicenseKey);
}
return answ;
}
+13 -22
View File
@@ -2,34 +2,25 @@
@inject IJSRuntime JSRuntime
<div class="card">
<div class="card-header py-2 font-weight-bold">
<div class="card text-center my-2">
<div class="card-header list-group-item-info">
<div class="row">
<div class="col-4 col-md-4">
<div class="badge badge-pill badge-dark px-2 py-1">
<div class="px-1">
<span>EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></span>
</div>
</div>
<div class="col-6 text-left">
<b>@Environment</b>
</div>
<div class="col-8 text-right">
<h4 class="py-0 mb-0">@Environment</h4>
<div class="col-6 text-right">
<b>Matr. @CurrItem.MatrOpr</b>
</div>
</div>
</div>
<div class="card-body px-3">
<div class="row">
<div class="col-6 col-md-4">
<div id="qrCodeImg_@(CurrItem.MatrOpr)"></div>
</div>
<div class="col-6 col-md-8">
<h2><b>@CurrItem.Cognome</b> @CurrItem.Nome</h2>
matr: @CurrItem.MatrOpr
</div>
</div>
<div class="card-body text-center">
<div class="img-fluid" id="qrCodeImg_@(CurrItem.MatrOpr)"></div>
</div>
<div class="card-footer text-center">
<b>@CurrItem.Cognome @CurrItem.Nome</b>
</div>
@*<div class="card-footer text-muted py-1">
Card login MAPO-TAB
Card login MAPO-TAB
</div>*@
</div>
@@ -40,7 +31,7 @@
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (!firstRender)
if (firstRender)
{
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{CurrItem.MatrOpr}");
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{CurrItem.MatrOpr}", rawCode);
+61
View File
@@ -47,6 +47,7 @@ namespace MP.Land.Data
#region Public Fields
public static AppAuth.Controllers.AppAuthController dbController;
public static AppAuth.Controllers.MPController MpDbController;
#endregion Public Fields
@@ -68,6 +69,7 @@ namespace MP.Land.Data
else
{
dbController = new AppAuth.Controllers.AppAuthController(configuration);
MpDbController = new AppAuth.Controllers.MPController(configuration);
_logger.LogInformation("DbController OK");
}
}
@@ -127,6 +129,46 @@ namespace MP.Land.Data
#region Public Methods
public async Task<List<AppAuth.Models.AnagraficaGruppi>> AnagGruppiAll()
{
List<AppAuth.Models.AnagraficaGruppi> dbResult = new List<AppAuth.Models.AnagraficaGruppi>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = dbController.AnagGruppiGetAll();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per AnagGruppiAll: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
public async Task<List<AppAuth.Models.AnagraficaGruppi>> AnagGruppiFilt(string codTipo)
{
List<AppAuth.Models.AnagraficaGruppi> dbResult = new List<AppAuth.Models.AnagraficaGruppi>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = dbController.AnagGruppiFilt(codTipo);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per AnagGruppiFilt: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
public async Task<List<AppAuth.Models.AnagraficaOperatori>> AnagOperByGroupList(string codGruppo, string searchVal)
{
List<AppAuth.Models.AnagraficaOperatori> dbResult = new List<AppAuth.Models.AnagraficaOperatori>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
var rawData = dbController
.AnagOpByGruppoGetFilt(codGruppo, searchVal);
dbResult = rawData
.GroupBy(user => user.MatrOpr)
.Select(grp => grp.First())
.ToList();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per AnagOperByGroupList: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
public async Task<List<AppAuth.Models.AnagraficaOperatori>> AnagOperList(string searchVal)
{
List<AppAuth.Models.AnagraficaOperatori> dbResult = new List<AppAuth.Models.AnagraficaOperatori>();
@@ -143,6 +185,7 @@ namespace MP.Land.Data
{
// Clear database controller
dbController.Dispose();
MpDbController.Dispose();
}
public string Traduci(string lemma, string lingua = "IT")
@@ -170,6 +213,24 @@ namespace MP.Land.Data
return await Task.FromResult(dbResult);
}
public async Task<List<AppAuth.Models.AnagKeyValueModel>> AnagKeyValList()
{
List<AppAuth.Models.AnagKeyValueModel> dbResult = new List<AppAuth.Models.AnagKeyValueModel>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = MpDbController.AnagKeyValuesGetAll();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per AnagKeyValList: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
public async Task ResetCache()
{
string cacheKey = ":MP:VOCAB";
await distributedCache.RemoveAsync(cacheKey);
}
#endregion Public Methods
}
}
+498
View File
@@ -0,0 +1,498 @@
using Egw.Core;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using MP.AppAuth.Models;
using Newtonsoft.Json;
using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
namespace MP.Land.Data
{
/// <summary>
/// Servizi e dati condivisi a livello applicazione
/// </summary>
public class LicenseService
{
#region Private Fields
private static IConfiguration? _configuration;
private static ILogger<LicenseService>? _logger;
/// <summary>
/// URL dell'API x chiamate gestione licenze
/// </summary>
private static string apiUrl = "https://liman.egalware.com/ELM.API/";
//private static string apiUrl = "https://localhost:44351/";
/// <summary>
/// Chiave redis x info della licenza
/// </summary>
private static string rkeyAppInfo = "LongCache:AppInfo";
private readonly IDistributedCache distributedCache;
/// <summary>
/// Elenco obj in cache
/// </summary>
private List<string> cachedDataList = new List<string>();
/// <summary>
/// Fattorte conversione cache sliding --> 1 h
/// </summary>
private int cacheFact = 12;
/// <summary>
/// Durata assoluta massima della cache IN SECONDI
/// </summary>
private int chAbsExp = 60 * 5;
/// <summary>
/// Durata della cache IN SECONDI in modalità inattiva (non acceduta) prima di venire rimossa
/// NON estende oltre il tempo massimo di validità della cache (chAbsExp)
/// </summary>
private int chSliExp = 60 * 1;
#endregion Private Fields
#region Protected Fields
/// <summary>
/// Chiave redis x attivazioni della licenza
/// </summary>
protected const string rKeyAttByLic = "LongCache:AttByLic";
#endregion Protected Fields
#region Public Constructors
/// <summary>
/// Init classe
/// </summary>
/// <param name="configuration"></param>
/// <param name="logger"></param>
/// <param name="distributedCache"></param>
public LicenseService(IConfiguration configuration, ILogger<LicenseService> logger, IDistributedCache distributedCache)
{
_logger = logger;
_configuration = configuration;
this.distributedCache = distributedCache;
}
#endregion Public Constructors
#region Public Events
public event Action EA_InfoUpdated = null!;
#endregion Public Events
#region Public Properties
public List<LiManObj.AttivazioneDTO> ActivList { get; set; } = new List<LiManObj.AttivazioneDTO>();
public List<AnagKeyValueModel> AKVList { get; set; } = new List<AnagKeyValueModel>();
public string Applicazione { get; set; } = "";
public bool HasActivData
{
get
{
bool answ = ValidData;
// se ok controllo che ci siano attivazioni
if (answ)
{
// provo classe locale...
answ = ActivList != null && ActivList.Count > 0;
// se non le avessi carico!
if (!answ)
{
var pUpd = Task.Run(async () =>
{
ActivList = await ActivListCache();
});
pUpd.Wait();
}
}
return answ;
}
}
public DateTime infoExpiry { get; set; } = DateTime.Today.AddDays(1);
/// <summary>
/// Codice cliente/installazione
/// </summary>
public string Installazione { get; set; } = "";
/// <summary>
/// Master key licenza principale
/// </summary>
public string MasterKey { get; set; } = "";
/// <summary>
/// Numero licenze da DB
/// </summary>
public int NumLicDb { get; set; } = -1;
/// <summary>
/// Numero licenze da auth remota
/// </summary>
public int NumLicRemote { get; set; } = -1;
public bool ValidData
{
get
{
// controllo valori string base
bool checkData = !string.IsNullOrEmpty(Installazione) && !string.IsNullOrEmpty(Applicazione) && !string.IsNullOrEmpty(MasterKey) && ActivList != null && ActivList.Count > 0;
return checkData;
}
}
#endregion Public Properties
#region Private Methods
/// <summary>
/// Opzioni cache con moltiplicatore durata risp durata base (1/5 minuti)
/// </summary>
/// <param name="multFact"></param>
/// <returns></returns>
private DistributedCacheEntryOptions cacheOpt(int multFact)
{
var numSecAbsExp = chAbsExp * multFact;
var numSecSliExp = chSliExp * multFact;
return new DistributedCacheEntryOptions().SetAbsoluteExpiration(DateTime.Now.AddSeconds(numSecAbsExp)).SetSlidingExpiration(TimeSpan.FromSeconds(numSecSliExp));
}
/// <summary>
/// Elenco attivazioni attuali
/// </summary>
private async Task<List<LiManObj.AttivazioneDTO>?> OnlineActivationList()
{
List<LiManObj.AttivazioneDTO>? answ = new List<LiManObj.AttivazioneDTO>();
// cerco online
RestClient client = new RestClient(apiUrl);
//client.Authenticator = new HttpBasicAuthenticator("username", "password");
string MKeyEnc = HttpUtility.UrlEncode(MasterKey);
var request = new RestRequest($"api/attivazioni/?chiave={MKeyEnc}", Method.Get);
var response = await client.GetAsync(request);
// controllo risposta
if (response.StatusCode == System.Net.HttpStatusCode.OK)
{
// salvo in redis contenuto serializzato
string rawData = $"{response.Content}";
answ = JsonConvert.DeserializeObject<List<LiManObj.AttivazioneDTO>?>(rawData);
}
return await Task.FromResult(answ);
}
/// <summary>
/// Recupera info licenza da remoto
/// </summary>
private async Task<List<LiManObj.ApplicativoDTO>> OnlineAppInfo()
{
List<LiManObj.ApplicativoDTO> answ = new List<LiManObj.ApplicativoDTO>();
// cerco online
RestClient client = new RestClient(apiUrl);
string MKeyEnc = HttpUtility.UrlEncode(MasterKey);
//string mKey = System.Net.WebUtility.UrlEncode(MasterKey);
string reqUrl = $"api/licenza/{Installazione}?CodApp={Applicazione}&Chiave={MKeyEnc}";
var request = new RestRequest(reqUrl, Method.Get);
var response = await client.GetAsync(request);
// controllo risposta
if (response.StatusCode == System.Net.HttpStatusCode.OK)
{
// verifico risposta
string rawData = $"{response.Content}";
answ = JsonConvert.DeserializeObject<List<LiManObj.ApplicativoDTO>?>(rawData);
}
return await Task.FromResult(answ);
}
private void ReportUpdated()
{
if (EA_InfoUpdated != null)
{
EA_InfoUpdated?.Invoke();
}
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// Cerca di recuperare valore INT da elenco AKV
/// </summary>
/// <param name="varReq">Chiave AKV richiesta</param>
/// <returns></returns>
protected int getAVKInt(string varReq)
{
int answ = -9999;
if (AKVList != null && AKVList.Count > 0)
{
var currRec = AKVList.Where(x => x.NomeVar == varReq).FirstOrDefault();
if (currRec != null)
{
answ = currRec.ValInt ?? 0;
}
}
return answ;
}
/// <summary>
/// Cerca di recuperare valore string da elenco AKV
/// </summary>
/// <param name="varReq">Chiave AKV richiesta</param>
/// <returns></returns>
protected string getAVKStr(string varReq)
{
string answ = "";
if (AKVList != null && AKVList.Count > 0)
{
var currRec = AKVList.Where(x => x.NomeVar == varReq).FirstOrDefault();
if (currRec != null)
{
answ = $"{currRec.ValString}";
}
}
return answ;
}
/// <summary>
/// Recupero chiave da redis
/// </summary>
/// <param name="rKey"></param>
/// <returns></returns>
protected async Task<string> getRSV(string rKey)
{
string answ = "";
var redisDataList = await distributedCache.GetAsync(rKey);
if (redisDataList != null)
{
answ = Encoding.UTF8.GetString(redisDataList);
}
return answ;
}
/// <summary>
/// Salvataggio chiave in redis
/// </summary>
/// <param name="rKey"></param>
/// <param name="rVal"></param>
/// <param name="cacheMult"></param>
/// <returns></returns>
protected async Task<bool> setRSV(string rKey, string rVal, int cacheMult)
{
bool fatto = false;
var redisDataList = Encoding.UTF8.GetBytes(rVal);
await distributedCache.SetAsync(rKey, redisDataList, cacheOpt(cacheMult));
fatto = true;
return fatto;
}
/// <summary>
/// Salvataggio chiave in redis
/// </summary>
/// <param name="rKey"></param>
/// <param name="rValInt"></param>
/// <param name="cacheMult"></param>
/// <returns></returns>
protected async Task<bool> setRSV(string rKey, int rValInt, int cacheMult)
{
bool fatto = false;
var redisDataList = Encoding.UTF8.GetBytes($"{rValInt}");
await distributedCache.SetAsync(rKey, redisDataList, cacheOpt(cacheMult));
fatto = true;
return fatto;
}
/// <summary>
/// Registra in cache chiave se non fosse già in elenco
/// </summary>
/// <param name="newKey"></param>
protected void trackCache(string newKey)
{
if (!cachedDataList.Contains(newKey))
{
cachedDataList.Add(newKey);
}
}
#endregion Protected Methods
#region Public Methods
public async Task<List<LiManObj.AttivazioneDTO>> ActivListCache()
{
List<LiManObj.AttivazioneDTO> dbResult = new List<LiManObj.AttivazioneDTO>();
string cacheKey = $"{rKeyAttByLic}:{MasterKey}";
trackCache(cacheKey);
string rawData = await getRSV(cacheKey);
if (!string.IsNullOrEmpty(rawData))
{
var cacheRes = JsonConvert.DeserializeObject<List<LiManObj.AttivazioneDTO>?>(rawData);
if (cacheRes != null)
{
dbResult = cacheRes;
}
}
return await Task.FromResult(dbResult);
}
/// <summary>
/// Verifica attivazione licenza
/// </summary>
/// <param name="authKey"></param>
/// <returns></returns>
public bool checkLicenseActive(string authKey)
{
bool answ = false;
//cerco anche nelle info AKV
if (AKVList != null)
{
var recLic = AKVList.Where(x => x.ValString == authKey).FirstOrDefault();
int numLic = 0;
//cerco in record
if (recLic != null)
{
numLic = (int)recLic.ValInt;
// verifico scadenza licenza!
DateTime scadenza = licenseManGLS.expiryDateByAuthKey(Installazione, recLic.NomeVar, numLic, authKey);
answ = scadenza > DateTime.Today;
}
else
{
_logger.LogInformation($"Record non trovato per {authKey}");
}
}
return answ;
}
/// <summary>
/// Stato server gestione licenze
/// </summary>
public async Task<string> checkLimanServer()
{
string answ = "ND";
// cerco online
RestClient client = new RestClient(apiUrl);
var request = new RestRequest($"api/health", Method.Get);
var response = await client.GetAsync(request);
// controllo risposta
if (response.StatusCode == System.Net.HttpStatusCode.OK)
{
// verifico risposta
answ = response.Content.Replace("\"", "");
}
return await Task.FromResult(answ);
}
/// <summary>
/// Init della classe con variabili di base da Redis/DB
/// </summary>
public bool InitAkv()
{
bool fatto = false;
Applicazione = "MAPO";
Installazione = getAVKStr("Installazione");
MasterKey = getAVKStr(Applicazione);
NumLicDb = getAVKInt(Applicazione);
fatto = !string.IsNullOrEmpty($"{Installazione}{MasterKey}");
return fatto;
}
public async Task<List<LiManObj.ApplicativoDTO>> LicAppCache()
{
List<LiManObj.ApplicativoDTO> dbResult = new List<LiManObj.ApplicativoDTO>();
string cacheKey = $"{rkeyAppInfo}:{MasterKey}";
trackCache(cacheKey);
string rawData = await getRSV(cacheKey);
if (!string.IsNullOrEmpty(rawData))
{
var cacheRes = JsonConvert.DeserializeObject<List<LiManObj.ApplicativoDTO>?>(rawData);
if (cacheRes != null)
{
dbResult = cacheRes;
}
}
return await Task.FromResult(dbResult);
}
/// <summary>
/// Init della classe con variabili di base da Redis/DB
/// </summary>
public async Task<bool> RefreshLicense()
{
bool fatto = false;
// scadenza info a 15 gg...
int numDays = 15;
// dati applicativo
var appData = await OnlineAppInfo();
if (appData != null)
{
if (appData.Count > 0)
{
fatto = await setAppInfo(appData, numDays);
// salvo info licenza...
NumLicRemote = appData[0].NumLicenze;
}
}
// dati attivazioni
var onlineAct = await OnlineActivationList();
if (onlineAct != null)
{
if (onlineAct.Count > 0)
{
infoExpiry = DateTime.Now.AddDays(numDays);
ActivList = onlineAct;
fatto = await setActivList(onlineAct, numDays);
}
}
await Task.Delay(1);
return fatto;
}
public async Task<bool> setActivList(List<LiManObj.AttivazioneDTO> newActList, int numDays)
{
bool fatto = false;
string cacheKey = $"{rKeyAttByLic}:{MasterKey}";
var rawData = JsonConvert.SerializeObject(newActList);
await setRSV(cacheKey, rawData, numDays * cacheFact * 24);
fatto = true;
if (EA_InfoUpdated != null)
{
EA_InfoUpdated?.Invoke();
}
return fatto;
}
public async Task<bool> setAppInfo(List<LiManObj.ApplicativoDTO> newAppInfo, int numDays)
{
bool fatto = false;
string cacheKey = $"{rkeyAppInfo}:{MasterKey}";
var rawData = JsonConvert.SerializeObject(newAppInfo);
await setRSV(cacheKey, rawData, numDays * cacheFact * 24);
fatto = true;
if (EA_InfoUpdated != null)
{
EA_InfoUpdated?.Invoke();
}
return fatto;
}
#endregion Public Methods
}
}
+15
View File
@@ -106,6 +106,21 @@ namespace MP.Land.Data
}
}
protected string _groupName { get; set; } = "";
public string CodGruppo
{
get => _groupName;
set
{
if (_groupName != value)
{
_groupName = value;
ReportFilter();
}
}
}
#endregion Public Properties
#region Private Methods
+1 -1
View File
@@ -44,7 +44,7 @@ namespace MP.Land.Data
public bool OnlyMod { get; set; } = false;
public bool OnlyNoTag { get; set; } = false;
public int PageNum { get; set; } = 1;
public int PageSize { get; set; } = 4;
public int PageSize { get; set; } = 6;
public string SearchVal { get; set; } = "";
public string Tag { get; set; } = "";
+12 -2
View File
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Land</RootNamespace>
<Version>1.1.2109.2118</Version>
<Version>6.15.2207.0613</Version>
</PropertyGroup>
<ItemGroup>
@@ -25,6 +25,15 @@
</ItemGroup>
<ItemGroup>
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS03.pubxml" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\PublishProfiles\FolderProfile.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS01.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS02.pubxml.user" />
<None Include="Properties\PublishProfiles\IISProfile.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS03.pubxml.user" />
<None Include="wwwroot\lib\index.svg" />
<None Include="wwwroot\lib\jquery.min.js" />
<None Include="wwwroot\lib\LICENSE" />
@@ -44,6 +53,7 @@
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
<PackageReference Include="RestSharp" Version="107.1.2" />
</ItemGroup>
<ItemGroup>
+59 -15
View File
@@ -2,9 +2,10 @@
@using MP.Land.Data
@inject MessageService AppMService
@inject LicenseService LicServ
<div class="row mx-2">
<div class="col-12 col-lg-8 offset-lg-2">
<div class="col-12 col-lg-10 offset-lg-1">
<div class="card">
<div class="card-header text-center">
<div class="row">
@@ -28,28 +29,71 @@
<img src="img/LogoMapoFull.png" class="img-fluid" />
</div>
<div class="col-lg-3"></div>
<div class="col-12">
<div class="col-6">
<h4 class="card-title">@Messaggio</h4>
<br />
<p>MoonPro / MAPO sono una suite di applicazioni e dispositivi hw dedicati per l'IOT,l'industry 4.0 e la gestione automatizzata dei processi produttivi.</p>
<hr />
<p>Per maggiori informazioni <a href="http://www.steamware.net/iot" target="_blank">visita il link</a> sul nostro sito.</p>
</div>
<div class="col-6 text-right">
<div runat="server" id="divCheck" class="@mainCss">
<h4>Info installazione</h4>
<hr />
<div class="d-flex justify-content-between @remSrvCss">
<div class="px-2">
<i class="fa fa-server" aria-hidden="true"></i> Remote Server:
</div>
<div class="px-2">
<b>@ServerStatus</b>
</div>
</div>
<div class="d-flex justify-content-between">
<div class="px-2">
<i class="fa fa-certificate" aria-hidden="true"></i> Cliente:
</div>
<div class="px-2">
<b>@Installazione</b>
</div>
</div>
<div class="d-flex justify-content-between">
<div class="px-2">
<i class="fa fa-desktop" aria-hidden="true"></i> App:
</div>
<div class="px-2">
<b>@Applicazione</b>
</div>
</div>
<div class="d-flex justify-content-between @licenseCss">
<div class="px-2">
<i class="fa fa-users" aria-hidden="true"></i> Licenze:
</div>
<div class="px-2">
<b title="# Licenze locali / # Licenze Remote">@Licenze</b>
</div>
</div>
<div class="d-flex justify-content-between @expDateCss">
<div class="px-2">
<i class="far fa-calendar-check" aria-hidden="true"></i> Scadenza:
</div>
<div class="px-2">
<b>@($"{Scadenza:yyyy/MM/dd}")</b>
</div>
</div>
<div class="d-flex justify-content-between @licenseCss">
<div class="px-2">
<i class="fa fa-key" aria-hidden="true"></i> Key
</div>
<div class="px-2">
<span Font-Size="0.6em" class="small">@MastKey</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@code {
protected string Titolo = "";
protected string Messaggio = "";
protected override void OnInitialized()
{
Titolo = "MES | SCADA | IOT";
Messaggio = "Soluzione integrata per la gestione della produzione";
AppMService.ShowSearch = false;
AppMService.PageName = "About";
AppMService.PageIcon = "fas fa-info-circle pr-2";
}
}
+90
View File
@@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.Land;
using MP.Land.Shared;
using MP.Land.Data;
using NLog;
namespace MP.Land.Pages
{
public partial class About
{
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private string Titolo = "";
private string Messaggio = "";
private string ServerStatus = "SrvState";
private string Installazione = "Inst";
private string Applicazione = "App";
private string Licenze = "#";
private DateTime Scadenza = DateTime.Today;
private string MastKey = "########################";
private string mainCss = "alert alert-info";
private string remSrvCss = "bg-warning text-secondary";
private string expDateCss = "bg-warning text-secondary";
private string licenseCss = "bg-warning text-secondary";
protected override async Task OnInitializedAsync()
{
updatePageHead();
await reloadLicenseData();
}
private async Task reloadLicenseData()
{
int cDelay = 5;
// recupero dati
await Task.Delay(cDelay);
try
{
LicServ.InitAkv();
// verifico stati
ServerStatus = await LicServ.checkLimanServer();
Installazione = LicServ.Installazione;
Applicazione = LicServ.Applicazione;
MastKey = LicServ.MasterKey;
await Task.Delay(cDelay);
var fatto = await LicServ.RefreshLicense();
await Task.Delay(cDelay);
Licenze = $"{LicServ.NumLicDb}/{LicServ.NumLicRemote}";
licenseCss = "";
}
catch(Exception exc)
{
licenseCss = "bg-dark text-warning";
Log.Error($"Eccezione in reloadLicenseData:{Environment.NewLine}{exc}");
}
bool okRemoteSrv = ServerStatus == "OK";
bool okScadenza = LicServ.checkLicenseActive(LicServ.MasterKey);
bool okNumLic = (LicServ.NumLicDb <= LicServ.NumLicRemote);
// aggiornamento css secondo status colore da check
mainCss = okNumLic ? "alert alert-success shadowBox" : "alert alert-warning shadowBox";
expDateCss = okScadenza ? "" : "bg-danger text-warning";
remSrvCss = okRemoteSrv ? "" : "bg-danger text-warning";
await Task.Delay(cDelay);
}
private void updatePageHead()
{
Titolo = "MES | SCADA | IOT";
Messaggio = "Soluzione integrata per la gestione della produzione";
AppMService.ShowSearch = false;
AppMService.PageName = "About";
AppMService.PageIcon = "fas fa-info-circle pr-2";
}
}
}
+1 -1
View File
@@ -39,7 +39,7 @@
<div class="row">
@foreach (var item in ListRecords)
{
<div class="col-4 mb-2">
<div class="col-12 col-sm-6 col-xl-4 my-1">
<HomeLink CurrItem="@item"></HomeLink>
</div>
}
+29
View File
@@ -0,0 +1,29 @@
@page "/RefreshData"
@using MP.Land.Components
@using MP.Land.Data
@inject AppAuthService DataService
@inject LicenseService LicServ
@inject NavigationManager NavManager
<div class="card">
<div class="card-body">
<LoadingData></LoadingData>
</div>
</div>
@code {
protected override async Task OnInitializedAsync()
{
await Task.Delay(100);
LicServ.AKVList = new List<AppAuth.Models.AnagKeyValueModel>();
await Task.Delay(100);
await DataService.ResetCache();
await Task.Delay(100);
// redireziono
NavManager.NavigateTo("");
}
}
+25 -3
View File
@@ -3,11 +3,12 @@
@using MP.Land.Data
@using Microsoft.Extensions.Configuration
@inject AppAuthService DataService
@inject MessageService AppMService
@inject IConfiguration Configuration
<div class="row mx-2">
<div class="col-12 col-lg-8 offset-lg-2">
<div class="col-12 col-lg-10 offset-lg-1">
<div class="card">
<div class="card-header text-center">
<div class="row">
@@ -126,6 +127,9 @@
</div>
</div>
</div>
<div class="card-footer py-1">
<span>Chiave licenza: <b>@masterLic</b></span>
</div>
</div>
</div>
</div>
@@ -135,6 +139,26 @@
protected string Titolo = "MAPO System Info";
protected string Messaggio = "HW & SW details";
protected HwSwInfo currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly());
protected string masterLic = "";
protected override async Task OnInitializedAsync()
{
await ReloadData();
}
protected async Task ReloadData()
{
var akvList = await DataService.AnagKeyValList();
var licRecord = akvList
.Where(x => x.NomeVar == "MAPO")
.FirstOrDefault();
if (licRecord != null)
{
masterLic = licRecord.ValString;
}
}
protected string DbNameExample
{
get
@@ -156,6 +180,4 @@
}
}
//string connStr = memLayer.ML.confReadString("DbConfConnectionString");
//currHwSwInfo = currHwSwInfo;
}
+2 -1
View File
@@ -2,6 +2,7 @@
@using MP.Land.Data
@using MP.Land.Components
@inject LicenseService LicServ
<div class="alert alert-secondary">
<div class="row">
@@ -57,7 +58,7 @@
<div class="row">
@foreach (var item in ListRecords)
{
<div class="col-4 mb-2">
<div class="col-12 col-sm-6 col-xl-4 my-1">
<SingleDownload CurrItem="@item"></SingleDownload>
</div>
}
+15 -3
View File
@@ -85,11 +85,23 @@ namespace MP.Land.Pages
percLoading = 0;
TotalMb = 0;
numDone = 0;
numTot = ListRecords.Count;
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
// ciclo su tutti
foreach (var item in ListRecords)
// ciclo su tutti quelli con licenza valida...
List<AppAuth.Models.UpdMan> rawList = ListRecords
.Where(x => !string.IsNullOrEmpty(x.LicenseKey)).ToList();
List<AppAuth.Models.UpdMan> authList = new List<AppAuth.Models.UpdMan>();
// ciclo SOLO tra quelli davvero autorizzati...
foreach (var item in rawList)
{
if (LicServ.checkLicenseActive(item.LicenseKey))
{
authList.Add(item);
}
}
numTot = authList.Count;
foreach (var item in authList)
{
long size = 0;
size = await scaricaSingolo(item);
+3 -1
View File
@@ -5,6 +5,7 @@
<div class="card">
<div class="card-body">
<CmpGroupFilt></CmpGroupFilt>
@if (ListRecords == null)
{
<LoadingData></LoadingData>
@@ -15,10 +16,11 @@
}
else
{
<div class="row">
@foreach (var item in ListRecords)
{
<div class="col-6 my-2 userCard">
<div class="col-12 col-sm-6 col-xl-4 my-1 userCard">
<UserCard CurrItem="@item" BaseUrl="@BaseUrlTab" Environment="@Environment"></UserCard>
</div>
}
+93 -66
View File
@@ -11,12 +11,14 @@ namespace MP.Land.Pages
{
public partial class UserQr : IDisposable
{
#region Private Fields
#region Public Methods
private List<AnagraficaOperatori> ListRecords;
private List<AnagraficaOperatori> SearchRecords;
public void Dispose()
{
AppMService.EA_SearchUpdated -= OnSeachUpdated;
}
#endregion Private Fields
#endregion Public Methods
#region Protected Fields
@@ -25,39 +27,6 @@ namespace MP.Land.Pages
#endregion Protected Fields
#region Private Properties
[Inject]
private IConfiguration Configuration { get; set; }
private int currPage
{
get
{
return AppMService.SelFilter.PageNum;
}
set
{
AppMService.SelFilter.PageNum = value;
}
}
private bool isLoading { get; set; } = false;
private int numRecord
{
get
{
return AppMService.SelFilter.PageSize;
}
set
{
AppMService.SelFilter.PageSize = value;
}
}
#endregion Private Properties
#region Protected Properties
[Inject]
@@ -78,18 +47,6 @@ namespace MP.Land.Pages
#endregion Protected Properties
#region Private Methods
private async void OnSeachUpdated()
{
ListRecords = null;
currPage = 1;
await Task.Delay(1);
await ReloadData();
}
#endregion Private Methods
#region Protected Methods
protected override async Task OnInitializedAsync()
@@ -99,6 +56,7 @@ namespace MP.Land.Pages
AppMService.PageIcon = "fas fa-qrcode pr-2";
await ReloadData();
AppMService.EA_SearchUpdated += OnSeachUpdated;
AppMService.EA_FilterUpdated += OnFilterUpdated;
}
protected async Task PagerReloadNum(int newNum)
@@ -117,19 +75,6 @@ namespace MP.Land.Pages
isLoading = false;
}
protected async Task ReloadData()
{
isLoading = true;
// importante altrimenti NON mostra update UI
await Task.Delay(1);
SearchRecords = await DataService.AnagOperList(AppMService.SearchVal);
ListRecords = SearchRecords.Skip((currPage - 1) * numRecord).Take(numRecord).ToList();
totalCount = SearchRecords.Count();
await Task.Delay(1);
isLoading = false;
StateHasChanged();
}
protected MarkupString traduci(string lemma)
{
MarkupString answ;
@@ -142,13 +87,95 @@ namespace MP.Land.Pages
#endregion Protected Methods
#region Public Methods
#region Private Fields
public void Dispose()
private List<AnagraficaOperatori> ListRecords;
private List<AnagraficaOperatori> SearchRecords;
#endregion Private Fields
#region Private Properties
[Inject]
private IConfiguration Configuration { get; set; }
private int currPage
{
AppMService.EA_SearchUpdated -= OnSeachUpdated;
get
{
return AppMService.SelFilter.PageNum;
}
set
{
AppMService.SelFilter.PageNum = value;
}
}
#endregion Public Methods
private string groupName
{
get
{
return AppMService.CodGruppo;
}
}
private bool isLoading { get; set; } = false;
private int numRecord
{
get
{
return AppMService.SelFilter.PageSize;
}
set
{
AppMService.SelFilter.PageSize = value;
}
}
#endregion Private Properties
#region Private Methods
private async void OnFilterUpdated()
{
ListRecords = null;
currPage = 1;
await Task.Delay(1);
await ReloadData();
}
private async void OnSeachUpdated()
{
ListRecords = null;
currPage = 1;
await Task.Delay(1);
await ReloadData();
}
private async Task ReloadData()
{
isLoading = true;
// importante altrimenti NON mostra update UI
await Task.Delay(1);
// se ho selezionato qualcosa cerco x gruppo
//if (groupName != "")
//{
SearchRecords = await DataService.AnagOperByGroupList(groupName, AppMService.SearchVal);
//}
//else
//{
// //altrimenti TUTTI
// SearchRecords = await DataService.AnagOperList(AppMService.SearchVal);
//}
ListRecords = SearchRecords.Skip((currPage - 1) * numRecord).Take(numRecord).ToList();
totalCount = SearchRecords.Count();
await Task.Delay(1);
isLoading = false;
StateHasChanged();
}
#endregion Private Methods
}
}
+9 -27
View File
@@ -35,6 +35,13 @@
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
@* Riconnessione server app: https://www.syncfusion.com/faq/how-do-i-reconnect-blazor-server-side-automatically *@
<script>
Blazor.defaultReconnectionHandler._reconnectCallback = function (d) {
document.location.reload();
}
</script>
<!-- inside of body section and after the div/app tag -->
<script src="jquery/jquery.min.js"></script>
@@ -43,33 +50,8 @@
<script src="font-awesome/js/all.min.js"></script>
<script src="_framework/blazor.server.js"></script>
<script type="text/javascript" src="~/lib/qrcode.js"></script>
<script type="text/javascript">
function clearContent(elementID) {
console.log(elementID);
document.getElementById(elementID).innerHTML = "";
}
// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0
//var qrcode = new QRCode("qrCodeImg");
function displayQr(elementName, rawData) {
console.log(elementName);
try {
if (elementName != "" && rawData != "") {
qrcode = new QRCode(document.getElementById(elementName),
{
text: rawData,
width: 200,
height: 200
});
//qrcode = new QRCode(document.getElementById(elementName));
//qrcode.clear();
//qrcode.makeCode(rawData);
}
}
catch
{ }
}
</script>
<script type="text/javascript" src="~/lib/qrHelper.js"></script>
</body>
</html>
@@ -10,7 +10,11 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\publish\net5.0\</PublishUrl>
<PublishUrl>bin\publish\net6.0\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net6.0</TargetFramework>
<ProjectGuid>d949ab45-9b65-4594-a97e-182bc3831707</ProjectGuid>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
+21 -21
View File
@@ -4,25 +4,25 @@ This file is used by the publish/package process of your Web project. You can cu
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>
</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://IIS01:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net5.0</TargetFramework>
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
</PropertyGroup>
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>
</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://iis01.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net6.0</TargetFramework>
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
</PropertyGroup>
</Project>
+21 -20
View File
@@ -4,24 +4,25 @@ This file is used by the publish/package process of your Web project. You can cu
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>
</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://IIS02:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>
</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://iis02.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net6.0</TargetFramework>
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
</PropertyGroup>
</Project>
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>
</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://iis03.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net6.0</TargetFramework>
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
</PropertyGroup>
</Project>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA+11nhJeDSkeTlSej+COD3AAAAAACAAAAAAADZgAAwAAAABAAAADHiGtCyOetOyeT2xaFL+NDAAAAAASAAACgAAAAEAAAAAuYw1PbVDVdZhloQ7eVuTsYAAAAfA8iFmY49U48HUeRwWwQNsvZg5FRMf9SFAAAACB+0njgnTZ+1teEqoJcNV16idHL</EncryptedPassword>
<History>True|2022-02-26T17:27:19.1178345Z;False|2022-02-26T18:23:39.1747983+01:00;True|2021-05-26T19:49:56.4831784+02:00;True|2021-05-25T16:56:57.0194126+02:00;True|2021-05-24T18:44:45.5388713+02:00;True|2021-05-24T18:23:50.6056375+02:00;True|2021-05-24T18:01:51.1166144+02:00;True|2021-05-24T17:07:21.6348703+02:00;True|2021-05-24T17:07:10.8304877+02:00;True|2021-05-24T11:12:19.8440009+02:00;True|2021-05-24T11:12:08.1362921+02:00;True|2021-05-22T12:03:42.2864462+02:00;True|2021-05-21T19:54:05.6348108+02:00;False|2021-05-21T19:53:46.2134560+02:00;True|2021-05-21T08:11:55.5022811+02:00;True|2021-05-20T19:40:34.2462833+02:00;True|2021-05-20T19:40:10.3931366+02:00;True|2021-05-20T17:27:02.9543079+02:00;True|2021-05-20T16:59:12.4323448+02:00;True|2021-05-20T16:58:55.5021812+02:00;False|2021-05-20T16:58:03.5161910+02:00;True|2021-05-19T19:28:03.8104716+02:00;True|2021-05-18T19:48:52.9083044+02:00;True|2021-05-18T18:15:50.2374168+02:00;True|2021-05-18T18:06:20.0997789+02:00;True|2021-05-18T14:56:33.7479984+02:00;True|2021-05-17T17:03:39.9822588+02:00;True|2021-05-17T16:33:53.4419457+02:00;True|2021-05-17T16:33:10.5405414+02:00;False|2021-05-17T16:30:04.8648550+02:00;False|2021-05-17T16:29:49.5085445+02:00;</History>
</PropertyGroup>
</Project>
@@ -4,18 +4,18 @@ This file is used by the publish/package process of your Web project. You can cu
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>Package</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<DesktopBuildPackageLocation>bin\publish\MP.Land.zip</DesktopBuildPackageLocation>
<PackageAsSingleFile>true</PackageAsSingleFile>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<TargetFramework>net5.0</TargetFramework>
<SelfContained>false</SelfContained>
</PropertyGroup>
<PropertyGroup>
<WebPublishMethod>Package</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<DesktopBuildPackageLocation>bin\publish\MP.Land.zip</DesktopBuildPackageLocation>
<PackageAsSingleFile>true</PackageAsSingleFile>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<TargetFramework>net6.0</TargetFramework>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>
</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://w2019-iis-dev:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: 1.1.2109.2118</h4>
<h4>Versione: 6.15.2207.0613</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
1.1.2109.2118
6.15.2207.0613
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.1.2109.2118</version>
<version>6.15.2207.0613</version>
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+1 -1
View File
@@ -38,7 +38,7 @@
align-items: center;
}
@media (min-width: 641px) {
@media (min-width: 992px) {
.page {
flex-direction: row;
}
+5
View File
@@ -42,6 +42,11 @@
<span class="fas fa-wrench fa-2x pr-2" aria-hidden="true"></span> System Info
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="RefreshData">
<span class="fas fa-sync-alt fa-2x pr-2" aria-hidden="true"></span> Refresh Data
</NavLink>
</li>
</ul>
</div>
+1 -1
View File
@@ -50,7 +50,7 @@
color: white;
}
@media (min-width: 641px) {
@media (min-width: 992px) {
.navbar-toggler {
display: none;
}
+1
View File
@@ -116,6 +116,7 @@ namespace MP.Land
services.AddServerSideBlazor();
services.AddSingleton<IConfiguration>(Configuration);
services.AddSingleton<LicenseService>();
services.AddScoped<AppAuthService>();
services.AddScoped<MessageService>();
+9 -5
View File
@@ -1,4 +1,4 @@
{
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
@@ -7,11 +7,15 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "Steam PROD",
"BaseUrl": "https://iis02.egalware.com/",
"AllowedHosts": "*",
"BaseUrl": "IIS02",
"Environment": "PROD",
"QrJumpPath": "MP/TAB/jumper?",
"downloadPath": "C:\\Steamware\\installers\\MP",
"appVers": "stable",
"ConnectionStrings": {
"DefaultConnection": "Server=localhost\\SQLEXPRESS;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
"MP.Land": "Server=localhost\\SQLEXPRESS;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;"
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
}
}
+11 -12
View File
@@ -1,13 +1,12 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"BaseUrl": "https://IIS01/",
"Environment": "Steam STAG"
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "Steam DEV",
"BaseUrl": "https://iis01.egalware.com/"
}
+22 -24
View File
@@ -1,27 +1,25 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
//"LogLevel": {
// "Default": "Debug",
// "Microsoft": "Information",
// "Microsoft.AspNetCore.SignalR": "Debug",
// "Microsoft.AspNetCore.Http.Connections": "Debug",
// "System": "Information"
//}
},
"AllowedHosts": "*",
"BaseUrl": "https://localhost:44309/",
"QrJumpPath": "MP/TAB/jumper?",
"Environment": "Steam DEV",
"downloadPath": "C:\\Steamware\\installers\\MP",
"appVers": "stable",
"ConnectionStrings": {
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"BaseUrl": "https://localhost:44309/",
"QrJumpPath": "MP/TAB/jumper?",
"Environment": "Steam DEV",
"downloadPath": "C:\\Steamware\\installers\\MP",
"appVers": "stable",
"ConnectionStrings": {
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
}
//"ConnectionStrings": {
// "DefaultConnection": "Server=SQL2016PROD;Database=Jetco_MoonPro_Prod;Trusted_Connection=True;MultipleActiveResultSets=true",
// "MP.Land": "Server=SQL2016PROD;Database=Jetco_MoonPro_Prod;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
// "Redis": "localhost:6379,defaultDatabase=11,keepAlive=180,asyncTimeout=5000"
//}
}
+8 -7
View File
@@ -1,15 +1,16 @@
param([string]$ProjectDir, [string]$ProjectPath);
$FileVers="Resources\VersNum.txt"
$FileManIn="Resources\manifest-original.xml"
$FileManOut="Resources\manifest.xml"
$FileCLogIn="Resources\ChangeLog-original.html"
$FileCLogOut="Resources\ChangeLog.html"
$MajMin="1.1."
$FileMajMin = "..\MajMin.vers"
$FileVers = "Resources\VersNum.txt"
$FileManIn = "Resources\manifest-original.xml"
$FileManOut = "Resources\manifest.xml"
$FileCLogIn = "Resources\ChangeLog-original.html"
$FileCLogOut = "Resources\ChangeLog.html"
$MajMin = Get-Content $FileMajMin # "6.14."
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$find = "<Version>(.|\n)*?</Version>";
$currRelNum=$MajMin + $currentDate +"." + $currentTime
$currRelNum = $MajMin + $currentDate +"." + $currentTime
$replace = "<Version>" + $MajMin + $currentDate +"." + $currentTime + "</Version>";
$csproj = Get-Content $ProjectPath
$csprojUpdated = $csproj -replace $find, $replace
+50 -4
View File
@@ -63,6 +63,52 @@ a,
.footer {
line-height: 1.8em;
}
.textTrim {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.maxChar {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.max5Char {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 5rem;
}
.max10Char {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 10rem;
}
.max20Char {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 20rem;
}
.max30Char {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 30rem;
}
.max40Char {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 40rem;
}
.max50Char {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 50rem;
}
/*------------------------------------------------------------------
[ Shortcuts / .shortcuts ]
*/
@@ -76,7 +122,7 @@ a,
min-width: 9rem;
min-height: 5rem;
display: inline-block;
padding: 0.66666667rem 0;
padding: 2rem/3 0;
margin: 0 2px 1em;
vertical-align: top;
text-decoration: none;
@@ -89,13 +135,13 @@ a,
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0);
border: 1px solid #ddd;
box-sizing: border-box;
border-radius: 0.5rem;
border-radius: 1rem/2;
}
.shortcuts .shortcut-sm {
min-width: 4.5rem;
min-height: 3rem;
display: inline-block;
padding: 0.25rem 0;
padding: 1rem/4 0;
margin: 0 2px 1em;
vertical-align: top;
text-decoration: none;
@@ -108,7 +154,7 @@ a,
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0);
border: 1px solid #ddd;
box-sizing: border-box;
border-radius: 0.5rem;
border-radius: 1rem/2;
}
.shortcuts .shortcut .shortcut-icon {
width: 100%;
+44
View File
@@ -63,6 +63,50 @@ a, .btn-link {
line-height: 1.8em;
}
.textTrim {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.maxChar {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.max5Char {
.maxChar;
width: 5rem;
}
.max10Char {
.maxChar;
width: 10rem;
}
.max20Char {
.maxChar;
width: 20rem;
}
.max30Char {
.maxChar;
width: 30rem;
}
.max40Char {
.maxChar;
width: 40rem;
}
.max50Char {
.maxChar;
width: 50rem;
}
/*------------------------------------------------------------------
[ Shortcuts / .shortcuts ]
*/
+1 -1
View File
@@ -1 +1 @@
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');@import url('fonts.min.css');h1,h2,h3,h4,h5,h6,b,display-1,display-2,display-3,display-4{font-family:'Lato',sans-serif}html,body,.textCondensed{font-family:'Roboto Condensed',sans-serif}a,.btn-link{color:#0366d6}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac}.content{padding-top:1.1rem}.valid.modified:not([type=checkbox]){outline:1px solid #26b050}.invalid{outline:1px solid #f00}.validation-message{color:#f00}.textStriked{text-decoration:line-through}#blazor-error-ui{background:#ffffe0;bottom:0;box-shadow:0 -1px 2px rgba(0,0,0,.2);display:none;left:0;padding:.6rem 1.25rem .7rem 1.25rem;position:fixed;width:100%;z-index:1000}#blazor-error-ui .dismiss{cursor:pointer;position:absolute;right:.75rem;top:.5rem}.footer{line-height:1.8em}.shortcuts{text-align:center}.shortcuts .shortcut-icon{font-size:2rem}.shortcuts .shortcut{min-width:9rem;min-height:5rem;display:inline-block;padding:.66666667rem 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:.5rem}.shortcuts .shortcut-sm{min-width:4.5rem;min-height:3rem;display:inline-block;padding:.25rem 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:.5rem}.shortcuts .shortcut .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333}.shortcuts .shortcut-sm .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333}.shortcuts .shortcut:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0)}.shortcuts .shortcut-sm:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0)}.shortcuts .shortcut:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.shortcuts .shortcut-sm:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.shortcuts .shortcut:hover .shortcut-icon{color:#c93}.shortcuts .shortcut-sm:hover .shortcut-icon{color:#666}.shortcuts .shortcut-label{display:block;margin-top:.75em;font-weight:400;color:#666}@media(max-width:640px){.shortcuts .shortcut{min-width:8rem;min-height:4rem}body{font-size:.8em}}
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');@import url('fonts.min.css');h1,h2,h3,h4,h5,h6,b,display-1,display-2,display-3,display-4{font-family:'Lato',sans-serif}html,body,.textCondensed{font-family:'Roboto Condensed',sans-serif}a,.btn-link{color:#0366d6}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac}.content{padding-top:1.1rem}.valid.modified:not([type=checkbox]){outline:1px solid #26b050}.invalid{outline:1px solid #f00}.validation-message{color:#f00}.textStriked{text-decoration:line-through}#blazor-error-ui{background:#ffffe0;bottom:0;box-shadow:0 -1px 2px rgba(0,0,0,.2);display:none;left:0;padding:.6rem 1.25rem .7rem 1.25rem;position:fixed;width:100%;z-index:1000}#blazor-error-ui .dismiss{cursor:pointer;position:absolute;right:.75rem;top:.5rem}.footer{line-height:1.8em}.textTrim{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.maxChar{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.max5Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:5rem}.max10Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:10rem}.max20Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:20rem}.max30Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:30rem}.max40Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:40rem}.max50Char{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:50rem}.shortcuts{text-align:center}.shortcuts .shortcut-icon{font-size:2rem}.shortcuts .shortcut{min-width:9rem;min-height:5rem;display:inline-block;padding:2rem/3 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:1rem/2}.shortcuts .shortcut-sm{min-width:4.5rem;min-height:3rem;display:inline-block;padding:1rem/4 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:1rem/2}.shortcuts .shortcut .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333}.shortcuts .shortcut-sm .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333}.shortcuts .shortcut:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0)}.shortcuts .shortcut-sm:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0)}.shortcuts .shortcut:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.shortcuts .shortcut-sm:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.shortcuts .shortcut:hover .shortcut-icon{color:#c93}.shortcuts .shortcut-sm:hover .shortcut-icon{color:#666}.shortcuts .shortcut-label{display:block;margin-top:.75em;font-weight:400;color:#666}@media(max-width:640px){.shortcuts .shortcut{min-width:8rem;min-height:4rem}body{font-size:.8em}}
+21
View File
@@ -0,0 +1,21 @@
function clearContent(elementID) {
//console.log("Remove " + elementID);
document.getElementById(elementID).innerHTML = "";
}
// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0
//var qrcode = new QRCode("qrCodeImg");
function displayQr(elementName, rawData) {
//console.log("Add " + elementName);
try {
if (elementName != "" && rawData != "") {
qrcode = new QRCode(document.getElementById(elementName),
{
text: rawData,
width: 200,
height: 200
});
}
}
catch
{ }
}
+2 -2
View File
@@ -360,8 +360,8 @@ var QRCode;
})() : (function () { // Drawing in Canvas
function _onMakeImage() {
this._elImage.src = this._elCanvas.toDataURL("image/png");
this._elImage.style.display = "block";
this._elCanvas.style.display = "none";
//this._elImage.style.display = "block";
//this._elCanvas.style.display = "none";
this._elImage.className = "img-fluid";
}
+5
View File
@@ -0,0 +1,5 @@
{
"version": 1,
"isRoot": true,
"tools": {}
}
+12
View File
@@ -0,0 +1,12 @@
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
+47
View File
@@ -0,0 +1,47 @@
<div class="row text-light">
<div class="col-5 pe-0 text-left">
<b>Mapo MON @(DateTime.Today.Year)</b> | <span class="small">v.@version</span>
</div>
<div class="col-7 ps-0 text-end">
<span class="small">@($"{DateTime.Now:HH:mm:ss}")</span> | <a class="text-light" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="images/LogoEgw.png" /> Egalware </a>
</div>
</div>
@code {
Version version = typeof(Program).Assembly.GetName().Version;
protected override async Task OnInitializedAsync()
{
StartTimer();
}
public void Dispose()
{
aTimer.Stop();
aTimer.Dispose();
}
private static System.Timers.Timer aTimer;
public void StartTimer()
{
int tOutPeriod = 1000;
//int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
aTimer = new System.Timers.Timer(tOutPeriod);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
aTimer.Start();
}
public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
//await ReloadData();
await Task.Delay(1);
await InvokeAsync(StateHasChanged);
});
pUpd.Wait();
}
}
+49
View File
@@ -0,0 +1,49 @@
<div class="px-2">
<img class="logoImg img-fluid" src="images/LogoMapo.png" width="80" />
<span class="mainHead p-3"><b><span style="color: #DEDEDE;">MP MON</span>itor</b></span>
</div>
<div class="px-2">
<span id="text-white text-right">
@($"{DateTime.Now:dddd dd MMMM yyyy}")
</span>
<img class="logoImg img-fluid" src="images/logoCliente.png" width="32" />
EgalWare
</div>
@code {
//protected override async Task OnInitializedAsync()
//{
// StartTimer();
//}
//public void Dispose()
//{
// aTimer.Stop();
// aTimer.Dispose();
//}
//private static System.Timers.Timer aTimer;
//public void StartTimer()
//{
// int tOutPeriod = 60000;
// //int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
// aTimer = new System.Timers.Timer(tOutPeriod);
// aTimer.Elapsed += ElapsedTimer;
// aTimer.Enabled = true;
// aTimer.Start();
//}
//public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
//{
// var pUpd = Task.Run(async () =>
// {
// //await ReloadData();
// await Task.Delay(1);
// await InvokeAsync(StateHasChanged);
// });
// pUpd.Wait();
//}
}
+134
View File
@@ -0,0 +1,134 @@
<div class="col machBlock">
@if (CurrRecord == null || !dataLoaded)
{
<LoadingDataSmall></LoadingDataSmall>
}
else
{
<div class="@cssStatus(CurrRecord.Semaforo) p-1">
<div class="d-flex mb-1 ui-title justify-content-center align-items-center text-uppercase">
@CurrRecord.Nome
</div>
@if (hasRow(1))
{
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
@foreach (var item in rowValues(1))
{
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
}
</div>
}
else
{
<div class="d-flex justify-content-between pt-0 pb-2 px-1 fontSmall text-uppercase">
<div class="px-1 pe-0">Art</div>
<div class="px-1 ps-0 ui-art">
@if (showArt == "CodArticolo")
{
<span>@CurrRecord.CodArticolo</span>
}
else
{
if (string.IsNullOrEmpty(CurrRecord.Disegno))
{
<span>[@CurrRecord.CodArticolo]</span>
}
else
{
<span>@CurrRecord.Disegno</span>
}
}
</div>
</div>
}
@if (hasRow(2))
{
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
@foreach (var item in rowValues(2))
{
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
}
</div>
}
else
{
<div class="d-flex justify-content-between pt-0 pb-2 px-1 fontSmall">
<div class="px-1 text-uppercase"><b>@CurrRecord.DescrizioneStato</b></div>
<div class="px-1 ps-0">@getMinSec((decimal)CurrRecord.Durata)</div>
</div>
}
@if (hasRow(3))
{
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
@foreach (var item in rowValues(3))
{
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
}
</div>
}
else
{
<div class="d-flex justify-content-between pt-0 pb-2 px-1 fontSmall text-uppercase">
@*<div class="col-6 pe-0">OEE</div>
<div class="col-6 ps-0">xx%</div>*@
<div class="px-1 pe-0">TCiclo</div>
<div class="px-1 ps-0">std: @getMinSec(@CurrRecord.TCAssegnato)</div>
<div class="px-1 ps-0">act: @getMinSec(@CurrRecord.TCLavRT)</div>
</div>
}
@if (hasRow(4))
{
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
@foreach (var item in rowValues(4))
{
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
}
</div>
}
else
{
<div class="d-flex justify-content-between pt-0 pb-0 px-1 fontSmall1 text-uppercase">
<div class="px-1 pe-0">Pezzi<sub>(prod/ord)</sub></div>
<div class="px-1 ps-0">@CurrRecord.PezziProd / @CurrRecord.NumPezzi</div>
</div>
}
@if (hasRow(5))
{
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
@foreach (var item in rowValues(5))
{
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
}
</div>
}
@if (hasRow(6))
{
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
@foreach (var item in rowValues(6))
{
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
}
</div>
}
</div>
<div class="@cssComStatus(CurrRecord.Semaforo, CurrRecord.LastUpdate) p-1">
<div class="row fontSmaller mt-1">
<div class="col-12">
<div class="text-right ui-footer px-2">
<div class="row">
@if (showComErr(CurrRecord.LastUpdate))
{
<div class="col text-warning">
<b>C.101</b>
</div>
}
<div class="col text-end">
@CurrRecord.LastUpdate
</div>
</div>
</div>
</div>
</div>
</div>
}
</div>
+254
View File
@@ -0,0 +1,254 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.Mon;
using MP.Mon.Shared;
using MP.Mon.Components;
using MP.Data.DatabaseModels;
using MP.Data.Conf;
namespace MP.Mon.Components
{
public partial class DetailMSE
{
#region Protected Fields
protected string baseCss = "sem";
protected int kaFactor = 60 / 2;
#endregion Protected Fields
#region Private Fields
private static System.Timers.Timer aTimer = new System.Timers.Timer(60 * 1000);
#endregion Private Fields
#region Public Properties
[Parameter]
public MappaStatoExpl? CurrRecord { get; set; } = null;
[Parameter]
public List<TagData>? currTagConf { get; set; } = null;
[Parameter]
public Dictionary<string, string> currTagVal { get; set; } = new Dictionary<string, string>();
[Parameter]
public bool doAnimate { get; set; } = true;
[Parameter]
public int keepAliveMin { get; set; } = 5;
[Parameter]
public string showArt { get; set; } = "";
#endregion Public Properties
/// <summary>
/// Verifica se ci sia un override per la riga indicata
/// </summary>
/// <param name="numRow"></param>
/// <returns></returns>
protected bool hasRow(int numRow)
{
bool answ = false;
if (currTagConf != null)
{
if (currTagConf.Count > 0)
{
var currVals = rowValues(numRow);
answ = currVals.Count > 0;
}
}
return answ;
}
/// <summary>
/// Restituisce (se presenti) valori di override per la riga indicata
/// </summary>
/// <param name="numRow"></param>
/// <returns></returns>
protected List<TagData> rowValues(int numRow)
{
List<TagData>? rowVals = null;
if (currTagConf != null)
{
if (currTagConf.Count > 0)
{
//cerco solo la riga corrente...
rowVals = currTagConf.Where(x => x.RowNum == numRow).ToList();
}
}
if (rowVals == null)
{
rowVals = new List<TagData>();
}
return rowVals;
}
/// <summary>
/// restituisce il valore data la tagLocation
/// </summary>
/// <param name="tagLocation"></param>
/// <returns></returns>
protected string currVal(string tagLocation)
{
string answ = "";
if (currTagVal.ContainsKey(tagLocation))
{
answ = currTagVal[tagLocation];
}
return answ;
}
#region Protected Properties
protected string codIOB
{
get
{
string answ = "";
if (CurrRecord != null)
{
answ = CurrRecord.IdxMacchina;
}
return answ;
}
}
protected bool dataLoaded { get; set; } = false;
#endregion Protected Properties
#region Public Methods
public void Dispose()
{
aTimer.Stop();
aTimer.Dispose();
}
public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
await Task.Delay(1);
await InvokeAsync(StateHasChanged);
});
pUpd.Wait();
}
public void StartTimer()
{
int tOutPeriod = 1000;
//int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
aTimer = new System.Timers.Timer(tOutPeriod);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
aTimer.Start();
}
#endregion Public Methods
#region Protected Methods
protected override async Task OnInitializedAsync()
{
StartTimer();
Random rnd = new Random();
//await Task.Delay(rnd.Next(500));
dataLoaded = true;
setupConf();
}
#endregion Protected Methods
#region Private Methods
private string cssComStatus(string semaforo, DateTime? lastUpdateN)
{
DateTime lastUpdate = lastUpdateN.HasValue ? (DateTime)lastUpdateN : DateTime.Now.AddHours(-1);
string answ = cssStatus(semaforo);
if (DateTime.Now.Subtract(lastUpdate).TotalSeconds > (keepAliveMin * kaFactor))
{
answ = $"{baseCss}Ro";
// blink se secondo pari...
DateTime adesso = DateTime.Now;
int resto = 0;
Math.DivRem(adesso.Second, 2, out resto);
if (resto == 0)
{
answ += "_b";
}
}
return answ;
}
private string cssStatus(string codSemaforo)
{
// se vuoto --> mostra nero!
if (string.IsNullOrEmpty(codSemaforo))
{
codSemaforo = "sNe";
}
string codColore = codSemaforo.Substring(1, 2);
string answ = $"{baseCss}{codColore}";
if (doAnimate && codColore != "Ve")
{
// blink se secondo pari...
DateTime adesso = DateTime.Now;
int resto = 0;
Math.DivRem(adesso.Second, 2, out resto);
if (resto == 0)
{
answ += "_b";
}
}
return answ;
}
private string getMinSec(decimal? currTimeMin)
{
string answ = "nd";
TimeSpan tSpan = new TimeSpan(0);
try
{
tSpan = TimeSpan.FromMinutes((double)currTimeMin);
answ = $"{tSpan:mm}:{tSpan:ss}";
}
catch
{ }
return answ;
}
private void setupConf()
{
//baseCss = doAnimate ? "semBlink" : "sem";
}
private bool showComErr(DateTime? lastUpdateN)
{
DateTime lastUpdate = lastUpdateN.HasValue ? (DateTime)lastUpdateN : DateTime.Now.AddHours(-1);
bool answ = false;
if (DateTime.Now.Subtract(lastUpdate).TotalSeconds > (keepAliveMin * kaFactor))
{
answ = true;
}
return answ;
}
#endregion Private Methods
}
}
+6
View File
@@ -0,0 +1,6 @@
<div class="row p-5 m-5 bg-light">
<div class="col-12 text-center mt-5 py-5 alert alert-primary">
<h3>loading data</h3>
<i class="fas fa-spinner fa-spin fa-5x"></i>
</div>
</div>
+6
View File
@@ -0,0 +1,6 @@
<div class="row p-2 m-2">
<div class="col-12 text-center mt-2 py-2 alert alert-primary">
<b>loading data</b>
<i class="fas fa-spinner fa-spin"></i>
</div>
</div>
+90
View File
@@ -0,0 +1,90 @@
{
"IobSetup": {
"***": [
{
"ColNum": 1,
"RowNum": 5,
"TagCss": "fontSmall",
"TagName": "Feed Over",
"TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:FEED_OVER"
},
{
"ColNum": 2,
"RowNum": 5,
"TagCss": "fontSmall",
"TagName": "Rapid Over",
"TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:RAPID_OVER"
}
],
"SIMUL_01": [
{
"ColNum": 1,
"RowNum": 6,
"TagCss": "fontSmall",
"TagName": "Power",
"TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_01:POWER_01"
}
],
"SIMUL_02": [
{
"ColNum": 1,
"RowNum": 6,
"TagCss": "fontSmall",
"TagName": "Power",
"TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_02:POWER_01"
}
],
"GIACO_ICOEL_001": [
{
"ColNum": 1,
"RowNum": 1,
"TagName": "Vel",
"TagLocation": "FluxData:TonnOra"
},
{
"ColNum": 2,
"RowNum": 1,
"TagName": "Vel",
"TagLocation": "FluxData:PezziMin"
},
{
"ColNum": 1,
"RowNum": 2,
"TagName": "Batch SX",
"TagLocation": "FluxData:BatchL1"
},
{
"ColNum": 2,
"RowNum": 2,
"TagName": "Batch DX",
"TagLocation": "FluxData:BatchL2"
}
],
"GIACO_ICOEL_002": [
{
"ColNum": 1,
"RowNum": 1,
"TagName": "Vel",
"TagLocation": "FluxData:TonnOra"
},
{
"ColNum": 2,
"RowNum": 1,
"TagName": "Vel",
"TagLocation": "FluxData:PezziMin"
},
{
"ColNum": 1,
"RowNum": 2,
"TagName": "Batch SX",
"TagLocation": "FluxData:BatchL1"
},
{
"ColNum": 2,
"RowNum": 2,
"TagName": "Batch DX",
"TagLocation": "FluxData:BatchL2"
}
]
}
}
+215
View File
@@ -0,0 +1,215 @@
using MP.Data.Conf;
using MP.Data.DatabaseModels;
using Newtonsoft.Json;
using NLog;
using StackExchange.Redis;
using System.Text;
namespace MP.Mon.Data
{
public class MpDataService : IDisposable
{
#region Public Fields
public static MP.Data.Controllers.MpMonController dbController;
#endregion Public Fields
#region Private Fields
private static IConfiguration _configuration;
private static ILogger<MpDataService> _logger;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
/// <summary>
/// Oggetto per connessione a REDIS
/// </summary>
private ConnectionMultiplexer redisConn = null!;
//ISubscriber sub = redis.GetSubscriber();
/// <summary>
/// Oggetto DB redis da impiegare x chiamate R/W
/// </summary>
private IDatabase redisDb = null!;
#endregion Private Fields
#region Public Constructors
public MpDataService(IConfiguration configuration, ILogger<MpDataService> logger)
{
_logger = logger;
_configuration = configuration;
// setup compoenti REDIS
this.redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis"));
this.redisDb = this.redisConn.GetDatabase();
//// setup canali pub/sub
//actLogPipe = new MessagePipe(redisConn, Constants.ACT_LOG_M_QUEUE);
// conf DB
string connStr = _configuration.GetConnectionString("Mp.Mon");
if (string.IsNullOrEmpty(connStr))
{
_logger.LogError("ConnString empty!");
}
else
{
dbController = new MP.Data.Controllers.MpMonController(configuration);
StringBuilder sb = new StringBuilder();
sb.AppendLine($"DbController OK");
//sb.AppendLine($"CST: {dbController.CustomersCount()} | CNT: {dbController.CountersCount()} | BSK: {dbController.BasketsCount()} | NGT: {dbController.NegotiationsCount()} | DOC: {dbController.DocsCount()} | ITM: {dbController.ItemsCount()} | RES: {dbController.ResourcesCount()}");
_logger.LogInformation(sb.ToString());
}
// setup conf IOB da dizionario
tryLoadIobTags();
}
#endregion Public Constructors
#region Public Properties
/// <summary>
/// Dizionario dei tag configurati per IOB
/// </summary>
public Dictionary<string, List<TagData>> currTagConf { get; set; } = new Dictionary<string, List<TagData>>();
#endregion Public Properties
#region Public Methods
public Task<List<ConfigModel>> ConfigGetAll()
{
return Task.FromResult(dbController.ConfigGetAll().ToList());
}
public void Dispose()
{
// Clear database controller
dbController.Dispose();
}
/// <summary>
/// restituisce il valore da REDIS associato al tag richeisto
/// </summary>
/// <param name="redKey">Chiave in cui cercare il valore</param>
/// <returns></returns>
public string getTagConf(string redKey)
{
string outVal = "";
// cerco in REDIS la conf x l'IOB
string rawData = redisDb.StringGet(redKey);
if (!string.IsNullOrEmpty(rawData))
{
outVal = rawData;
}
return outVal;
}
public Task<List<Macchine>> MacchineGetAll()
{
return Task.FromResult(dbController.MacchineGetAll().ToList());
}
public Task<List<MappaStatoExpl>> MseGetAll()
{
var dbResult = dbController.MseGetAll();
if (dbResult == null)
{
dbResult = new List<MappaStatoExpl>();
}
return Task.FromResult(dbResult);
}
#endregion Public Methods
#region Private Methods
/// <summary>
/// Prova a caricare da file la conf degli IOB se presente
/// </summary>
private void tryLoadIobTags()
{
Dictionary<string, List<TagData>> currConf = new Dictionary<string, List<TagData>>();
string strExeFilePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
if (!string.IsNullOrEmpty(strExeFilePath))
{
string? strWorkPath = Path.GetDirectoryName(strExeFilePath);
if (!string.IsNullOrEmpty(strWorkPath))
{
string filePath = $"{strWorkPath}/Conf/iobTagsConf.json";
if (File.Exists(filePath))
{
string rawData = File.ReadAllText(filePath);
if (!string.IsNullOrEmpty(rawData))
{
var fileConfData = JsonConvert.DeserializeObject<IobTags>(rawData);
if (fileConfData != null)
{
// effettuo esplosione conf SE contenesse il valore "***" = tutti gli IOB
if (fileConfData.IobSetup.ContainsKey("***"))
{
// recupero elenco macchine...
var elencoMacc = dbController.MacchineGetAll();
// x ogni macchina creo le righe standard da conf...
var baseConf = fileConfData.IobSetup.Where(x => x.Key == "***").FirstOrDefault();
foreach (var item in elencoMacc)
{
if (!string.IsNullOrEmpty(item.IdxMacchina))
{
// converto i valori x la macchina corrente...
// clono in nuovo oggetto
var specVal = baseConf.Value.Select(i => i.Clone()).ToList();
// sostituisco segnaposto
foreach (var singleVal in specVal)
{
singleVal.TagLocation = singleVal.TagLocation.Replace("***", item.IdxMacchina);
}
// ora aggiungo eventuali valori in override...
if (fileConfData.IobSetup.ContainsKey(item.IdxMacchina))
{
var otConf = fileConfData.IobSetup.Where(x => x.Key == item.IdxMacchina).FirstOrDefault();
//verifico x ogni valore other...
foreach (var otTag in otConf.Value)
{
var ovrTag = specVal.Where(x => x.ColNum == otTag.ColNum && x.RowNum == otTag.RowNum).FirstOrDefault();
// se contiene --> sovrascrivo
if (ovrTag != null)
{
//ovrTag = otTag.Clone();
specVal.Remove(ovrTag);
specVal.Add(otTag.Clone());
}
// se non contiene --> aggiungo
else
{
specVal.Add(otTag);
}
}
}
currConf.Add(item.IdxMacchina, specVal);
}
}
}
// altrimenti copio ed ho finito
else
{
currConf = fileConfData.IobSetup;
}
}
}
}
if (currConf != null)
{
currTagConf = currConf;
}
}
}
}
#endregion Private Methods
}
}
+49
View File
@@ -0,0 +1,49 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>6.15.2206.616</Version>
</PropertyGroup>
<ItemGroup>
<Content Remove="compilerconfig.json" />
</ItemGroup>
<ItemGroup>
<_WebToolingArtifacts Remove="Properties\PublishProfiles\FolderProfile.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS03.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" />
</ItemGroup>
<ItemGroup>
<None Include="compilerconfig.json" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS01.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS02.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS03.pubxml.user" />
<None Include="Properties\PublishProfiles\IISProfile.pubxml.user" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.15" />
<PackageReference Include="StackExchange.Redis" Version="2.5.61" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MP.Data\MP.Data.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="logs\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
</Target>
</Project>
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<!-- optional, add some variables
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="myvar" value="myvalue" />
<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets>
<!--
add your targets here
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
-->
<!--
Write events to a file with the date in the filename.
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
-->
<target xsi:type="File" name="fileTarget" fileName="${basedir}/logs/${shortdate}.log" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}" />
<target xsi:type="ColoredConsole" name="consoleTarget" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=true}| ${message}" />
</targets>
<rules>
<!-- add your logging rules here -->
<!--
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
<logger name="*" minlevel="Debug" writeTo="f" />
-->
<logger name="*" minlevel="Trace" writeTo="consoleTarget" />
<!--<logger name="Microsoft.*" maxlevel="Info" final="true" />-->
<logger name="*" minlevel="Info" writeTo="fileTarget" />
</rules>
</nlog>
+42
View File
@@ -0,0 +1,42 @@
@page
@model MP.Mon.Pages.ErrorModel
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Error</title>
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
</head>
<body>
<div class="main">
<div class="content px-4">
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
</div>
</div>
</body>
</html>
+27
View File
@@ -0,0 +1,27 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;
namespace MP.Mon.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private readonly ILogger<ErrorModel> _logger;
public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}
+47
View File
@@ -0,0 +1,47 @@
@page "/"
<PageTitle>Index</PageTitle>
<div class="row statusMap mx-1 my-1">
@if (ListMSE == null)
{
<div class="col-12">
<LoadingData></LoadingData>
</div>
}
else if (ListMSE.Count == 0)
{
<div class="col-12">
<div class="alert alert-warning">
No data found
</div>
</div>
}
else
{
int currIdx = 0;
foreach (var recordIob in ListMSE)
{
<DetailMSE CurrRecord="@recordIob" currTagConf="@getIobTag(recordIob.IdxMacchina)" currTagVal="@getTagVal(recordIob.IdxMacchina)" doAnimate="@doAnimate" keepAliveMin="@keepAliveMin" showArt="@showArt"></DetailMSE>
currIdx++;
if (currIdx >= maxCol)
{
currIdx = 0;
@((MarkupString)"</div><div class=\"row statusMap mx-1 my-1\">");
}
}
// controllo se devo "chiudere riga...
int currNum = (currIdx % maxCol);
while (currNum < (maxCol))
{
@((MarkupString)"<div class=\"col machBlock\">&nbsp;</div>")
;
currNum++;
}
}
</div>
+215
View File
@@ -0,0 +1,215 @@
using Microsoft.AspNetCore.Components;
using MP.Data.Conf;
using MP.Data.DatabaseModels;
using MP.Mon.Data;
using NLog;
namespace MP.Mon.Pages
{
public partial class Index : IDisposable
{
#region Protected Fields
protected bool doAnimate = true;
protected int fastRefreshSec = 10;
protected int keepAliveMin = 1;
protected List<MappaStatoExpl>? ListMSE = null;
protected int maxCol = 4;
protected string showArt = "";
protected int slowRefreshSec = 300;
#endregion Protected Fields
#region Private Fields
private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private static System.Timers.Timer slowTimer = new System.Timers.Timer(300000);
private List<ConfigModel>? CurrConfig = null;
#endregion Private Fields
#region Protected Properties
protected int fastRefreshMs
{
get => 1000 * fastRefreshSec;
}
[Inject]
protected MpDataService MMDataService { get; set; } = null!;
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
protected int slowRefreshMs
{
get => 1000 * slowRefreshSec;
}
#endregion Protected Properties
#region Public Methods
public void Dispose()
{
fastTimer.Stop();
fastTimer.Dispose();
slowTimer.Stop();
slowTimer.Dispose();
}
public void ElapsedFastTimer(Object source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
await ReloadData();
//await Task.Delay(1);
await InvokeAsync(StateHasChanged);
});
pUpd.Wait();
}
public async void ElapsedSlowTimer(Object source, System.Timers.ElapsedEventArgs e)
{
ListMSE = null;
NavManager.NavigateTo(NavManager.Uri);
}
public void StartTimer()
{
// timer veloce
fastTimer = new System.Timers.Timer(fastRefreshMs);
fastTimer.Elapsed += ElapsedFastTimer;
fastTimer.Enabled = true;
fastTimer.Start();
// timer lento
slowTimer = new System.Timers.Timer(slowRefreshMs);
slowTimer.Elapsed += ElapsedSlowTimer;
slowTimer.Enabled = true;
slowTimer.Start();
}
#endregion Public Methods
#region Protected Methods
/// <summary>
/// Recupera il valore e se trovato aggiorna
/// </summary>
/// <param name="chiave">Valore da cercare</param>
/// <param name="varObj">String in cui salvare il valore se trovato</param>
/// <returns></returns>
protected bool getConfVal(string chiave, ref string varObj)
{
bool answ = false;
if (CurrConfig != null && CurrConfig.Count > 0)
{
// sistemo i parametri opzionali...
ConfigModel? risultato = CurrConfig.FirstOrDefault(x => x.Chiave == chiave);
if (risultato != null)
{
varObj = risultato.Valore;
answ = !string.IsNullOrEmpty(risultato.Valore);
}
}
return answ;
}
/// <summary>
/// Recupera il valore e se trovato aggiorna
/// </summary>
/// <param name="chiave">Valore da cercare</param>
/// <param name="varObj">Int in cui salvare il valore se trovato</param>
/// <returns></returns>
protected bool getConfValInt(string chiave, ref int varObj)
{
bool answ = false;
if (CurrConfig != null && CurrConfig.Count > 0)
{
// sistemo i parametri opzionali...
ConfigModel? risultato = CurrConfig.FirstOrDefault(x => x.Chiave == chiave);
if (risultato != null)
{
answ = int.TryParse(risultato.Valore, out varObj);
}
}
return answ;
}
/// <summary>
/// Recupera da conf eventuale setup tag dell'IOB indicato
/// </summary>
/// <param name="codIob"></param>
/// <returns></returns>
protected List<TagData>? getIobTag(string codIob)
{
List<TagData>? answ = null;
if (MMDataService.currTagConf != null)
{
// cerco x chiave IOB...
if (MMDataService.currTagConf.ContainsKey(codIob))
{
answ = MMDataService.currTagConf[codIob];
}
}
return answ;
}
/// <summary>
/// Recupera da redis (in una chiamata soltanto) tutti i valori richiesti e compone un dizionario x ottimizzare visualizzazione
/// </summary>
/// <param name="codIob"></param>
/// <returns></returns>
protected Dictionary<string, string> getTagVal(string codIob)
{
Dictionary<string, string> answ = new Dictionary<string, string>();
// recupero conf tags...
var currTags = getIobTag(codIob);
if (currTags != null && currTags.Count > 0)
{
// FIXME TODO !!!! FARE !!!! - da verificare
answ = currTags.ToDictionary(x => x.TagLocation, x => MMDataService.getTagConf(x.TagLocation));
}
return answ;
}
protected override async Task OnInitializedAsync()
{
await setupConf();
await ReloadData();
StartTimer();
}
#endregion Protected Methods
#region Private Methods
private async Task ReloadData()
{
ListMSE = await MMDataService.MseGetAll();
}
private async Task setupConf()
{
CurrConfig = await MMDataService.ConfigGetAll();
if (CurrConfig != null && CurrConfig.Count > 0)
{
// sistemo i parametri opzionali...
getConfValInt("keepAliveMin", ref keepAliveMin);
getConfValInt("MON_maxCol", ref maxCol);
int intDoAnim = 0;
getConfValInt("doAnimate", ref intDoAnim);
doAnimate = intDoAnim == 1;
getConfValInt("pageRefreshSec", ref slowRefreshSec);
getConfValInt("MSE_cacheDuration", ref fastRefreshSec);
getConfVal("sART", ref showArt);
Log.Info($"Effettuato setup parametri | keepAlive: {keepAliveMin} | MaxCol: {maxCol} | doAnimate: {doAnimate} | slowRefreshSec: {slowRefreshSec} | fastRefreshSec: {fastRefreshSec}");
}
}
#endregion Private Methods
}
}
+8
View File
@@ -0,0 +1,8 @@
@page "/"
@namespace MP.Mon.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = "_Layout";
}
<component type="typeof(App)" render-mode="ServerPrerendered" />
+44
View File
@@ -0,0 +1,44 @@
@using Microsoft.AspNetCore.Components.Web
@namespace MP.Mon.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="~/" />
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="css/site.css" />
<link rel="stylesheet" href="lib/font-awesome/css/all.css" />
<link href="MP.Mon.styles.css" rel="stylesheet" />
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
</head>
<body>
@RenderBody()
<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
@* Riconnessione server app: https://www.syncfusion.com/faq/how-do-i-reconnect-blazor-server-side-automatically *@
<script>
Blazor.defaultReconnectionHandler._reconnectCallback = function (d) {
document.location.reload();
}
</script>
<script src="_framework/blazor.server.js"></script>
<script src="lib/Chart.js/chart.js"></script>
<script src="lib/luxon/luxon.js"></script>
<script src="lib/chartjs-adapter-luxon/chartjs-adapter-luxon.js"></script>
<script src="lib/chartBoot.js"></script>
</body>
</html>
+50
View File
@@ -0,0 +1,50 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using MP.Mon.Data;
using StackExchange.Redis;
var builder = WebApplication.CreateBuilder(args);
/*--------------------
* Note migrazione startup.cs -_> program.cs:
*
* - https://stackoverflow.com/questions/69722872/asp-net-core-6-how-to-access-configuration-during-startup
* - https://docs.microsoft.com/en-us/aspnet/core/migration/50-to-60?view=aspnetcore-5.0&tabs=visual-studio#where-do-i-put-state-that-was-stored-as-fields-in-my-program-or-startup-class
*
* */
ConfigurationManager configuration = builder.Configuration;
// REDIS setup
string connStringRedis = configuration.GetConnectionString("Redis");
string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
// avvio oggetto shared x redis...
var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
builder.Services.AddSingleton<MpDataService>();
//builder.Services.AddScoped<MessageService>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
app.Run();

Some files were not shown because too many files have changed in this diff Show More