wuic-framework-lib 1.0.10 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{wuic-framework-lib-chart-list.component-vuzmQW9F.mjs → wuic-framework-lib-chart-list.component-C0OYuZoM.mjs} +8 -8
- package/fesm2022/{wuic-framework-lib-code-editor.component-BjbIkm4g.mjs → wuic-framework-lib-code-editor.component-B8OQ3Z0k.mjs} +258 -258
- package/fesm2022/{wuic-framework-lib-designer.component-BM3elB-a.mjs → wuic-framework-lib-designer.component-DsWgWtFj.mjs} +99 -105
- package/fesm2022/{wuic-framework-lib-first-run-wizard.component-5tcl67dK.mjs → wuic-framework-lib-first-run-wizard.component-wR_LrvPK.mjs} +244 -38
- package/fesm2022/{wuic-framework-lib-framework-docs.component-BGcJ7k1X.mjs → wuic-framework-lib-framework-docs.component-eyzu9tdV.mjs} +31 -15
- package/fesm2022/{wuic-framework-lib-pivot-builder.component-ChNyMAfi.mjs → wuic-framework-lib-pivot-builder.component-BFdZW5Ch.mjs} +215 -88
- package/fesm2022/{wuic-framework-lib-prompt-dialog-fallback-host.component-DFLR_EmK.mjs → wuic-framework-lib-prompt-dialog-fallback-host.component-B583WbYe.mjs} +2 -2
- package/fesm2022/{wuic-framework-lib-report-designer.component-B_SC7VkW.mjs → wuic-framework-lib-report-designer.component-HJUpslLX.mjs} +12 -12
- package/fesm2022/{wuic-framework-lib-report-viewer.component-BTK-p8xF.mjs → wuic-framework-lib-report-viewer.component-El32zpzi.mjs} +81 -11
- package/fesm2022/{wuic-framework-lib-scheduler-list.component-CIoGVf4O.mjs → wuic-framework-lib-scheduler-list.component-E8s_e533.mjs} +16 -16
- package/fesm2022/{wuic-framework-lib-spreadsheet-list-sf.component-DQ5OxO4j.mjs → wuic-framework-lib-spreadsheet-list-sf.component-CDn0qi_C.mjs} +19 -5
- package/fesm2022/{wuic-framework-lib-workflow-designer.component-BHLT4MER.mjs → wuic-framework-lib-workflow-designer.component-hL7oKqYO.mjs} +2 -2
- package/fesm2022/{wuic-framework-lib-wuic-framework-lib-DDokY6wY.mjs → wuic-framework-lib-wuic-framework-lib-ABS_G7lO.mjs} +2149 -1089
- package/fesm2022/wuic-framework-lib.mjs +1 -1
- package/package.json +1 -1
- package/types/wuic-framework-lib.d.ts +308 -24
|
@@ -15,7 +15,9 @@ import * as i11 from 'primeng/progressbar';
|
|
|
15
15
|
import { ProgressBarModule } from 'primeng/progressbar';
|
|
16
16
|
import * as i3$1 from 'primeng/tooltip';
|
|
17
17
|
import { TooltipModule } from 'primeng/tooltip';
|
|
18
|
-
import
|
|
18
|
+
import * as i2$1 from 'primeng/dialog';
|
|
19
|
+
import { DialogModule } from 'primeng/dialog';
|
|
20
|
+
import { G as GlobalHandler, n as AuthSessionService, W as WtoolboxService, U as UserInfoService } from './wuic-framework-lib-wuic-framework-lib-ABS_G7lO.mjs';
|
|
19
21
|
import * as i1 from '@angular/common/http';
|
|
20
22
|
import * as i3 from 'primeng/api';
|
|
21
23
|
|
|
@@ -135,6 +137,148 @@ class WuicFirstRunWizardComponent {
|
|
|
135
137
|
// boot non richieda un secondo round-trip dialog.
|
|
136
138
|
enableCrashReporting: false,
|
|
137
139
|
};
|
|
140
|
+
/**
|
|
141
|
+
* Visibilita' del popup disclaimer GDPR del crash-reporting (apre al check
|
|
142
|
+
* del checkbox nel form). Vedi `crashReportingLabels` per il razionale dei
|
|
143
|
+
* testi hardcoded.
|
|
144
|
+
*/
|
|
145
|
+
crashReportingDisclaimerVisible = false;
|
|
146
|
+
/**
|
|
147
|
+
* Labels HARDCODED per il disclaimer GDPR del crash-reporting.
|
|
148
|
+
*
|
|
149
|
+
* Razionale: il first-run wizard e' l'UNICA pagina che gira PRIMA che il
|
|
150
|
+
* DB metadati esista (`MetaDataSQLConnection` ancora a placeholder
|
|
151
|
+
* `__SET_CONNECTION_STRING__`). La `wuic_translation` table NON e'
|
|
152
|
+
* interrogabile in quello stato — qualunque chiave registrata li' viene
|
|
153
|
+
* mostrata grezza dal `TranslationManagerService` (fallback "ritorna la
|
|
154
|
+
* chiave"). Le altre label del wizard funzionano via `ngx-translate`
|
|
155
|
+
* con i dictionary statici bundlati nell'app, ma non abbiamo (al
|
|
156
|
+
* momento) un dictionary GDPR multilingua bundlato — quindi niente
|
|
157
|
+
* fallback. Soluzione: traduzioni inline in TS, switch sulla lingua
|
|
158
|
+
* scelta dall'admin nel select "Lingua admin iniziale".
|
|
159
|
+
*
|
|
160
|
+
* Contratto: `getter` ricalcola al cambio di `firstRunForm.adminLanguage`
|
|
161
|
+
* (che lega il select del wizard). Default 'en-US' se sconosciuta.
|
|
162
|
+
*/
|
|
163
|
+
get crashReportingLabels() {
|
|
164
|
+
const dict = this.crashReportingDictionary;
|
|
165
|
+
const key = (this.firstRunForm.adminLanguage || 'en-US');
|
|
166
|
+
return dict[key] || dict['en-US'];
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Dictionary inline italian/english/french/spanish/german. Lingue
|
|
170
|
+
* supportate matchano `getSupportedLanguages` del backend. Bump
|
|
171
|
+
* `disclaimerVersion` (lato backend `CrashReportingOptions.CurrentDisclaimerVersion`)
|
|
172
|
+
* se cambi sostanzialmente i testi qui — invalida i consensi precedenti
|
|
173
|
+
* e forza re-prompt al login successivo.
|
|
174
|
+
*/
|
|
175
|
+
crashReportingDictionary = {
|
|
176
|
+
'it-IT': {
|
|
177
|
+
title: 'Segnalazione errori automatica',
|
|
178
|
+
checkbox_accept: 'Acconsento all\'invio anonimo dei rapporti di errore',
|
|
179
|
+
intro_short: 'WUIC può inviare automaticamente i dettagli tecnici degli errori al server privato del produttore.',
|
|
180
|
+
read_full: 'Leggi tutto',
|
|
181
|
+
intro: 'Per migliorare la stabilità del prodotto, WUIC può inviare automaticamente i dettagli tecnici degli errori che si verificano nella tua applicazione al nostro server privato. Nessun contenuto personale o di business viene trasmesso. La funzione è opzionale e disattivabile in qualsiasi momento.',
|
|
182
|
+
what_we_send: 'Cosa viene inviato:',
|
|
183
|
+
what_we_dont_send: 'Tipo eccezione, messaggio, stack trace, URL della richiesta, versione del framework, fingerprint anonimo della macchina (hash), user-agent del browser.',
|
|
184
|
+
where_it_goes: 'Dove va: server privato del fornitore (errors.wuic-framework.com), accessibile solo dal team di sviluppo del framework.',
|
|
185
|
+
retention: 'Conservazione: massimo 90 giorni, poi cancellazione automatica.',
|
|
186
|
+
legal_basis: 'Base giuridica: consenso esplicito (GDPR art. 6.1.a). Puoi revocarlo in qualsiasi momento.',
|
|
187
|
+
how_to_disable: 'Come disattivare: dal menu Impostazioni → Configurazione applicazione, togli il flag "CrashReporting.Enabled".',
|
|
188
|
+
btn_accept: 'Accetto e attivo',
|
|
189
|
+
btn_decline: 'Rifiuto'
|
|
190
|
+
},
|
|
191
|
+
'en-US': {
|
|
192
|
+
title: 'Automatic error reporting',
|
|
193
|
+
checkbox_accept: 'I consent to anonymous error report transmission',
|
|
194
|
+
intro_short: 'WUIC can automatically send technical error details to the vendor\'s private server.',
|
|
195
|
+
read_full: 'Read full text',
|
|
196
|
+
intro: 'To improve product stability, WUIC can automatically send technical details about errors that occur in your application to our private server. No personal or business content is transmitted. This feature is optional and can be disabled at any time.',
|
|
197
|
+
what_we_send: 'What gets sent:',
|
|
198
|
+
what_we_dont_send: 'Exception type, message, stack trace, request URL, framework version, anonymous machine fingerprint (hash), browser user-agent.',
|
|
199
|
+
where_it_goes: 'Where it goes: vendor\'s private server (errors.wuic-framework.com), accessible only by the framework development team.',
|
|
200
|
+
retention: 'Retention: up to 90 days, then automatic deletion.',
|
|
201
|
+
legal_basis: 'Legal basis: explicit consent (GDPR art. 6.1.a). You can revoke it at any time.',
|
|
202
|
+
how_to_disable: 'How to disable: from Settings → Application configuration, untick the "CrashReporting.Enabled" flag.',
|
|
203
|
+
btn_accept: 'Accept and enable',
|
|
204
|
+
btn_decline: 'Decline'
|
|
205
|
+
},
|
|
206
|
+
'fr-FR': {
|
|
207
|
+
title: 'Signalement automatique des erreurs',
|
|
208
|
+
checkbox_accept: 'J\'accepte la transmission anonyme des rapports d\'erreur',
|
|
209
|
+
intro_short: 'WUIC peut envoyer automatiquement les détails techniques des erreurs au serveur privé du fournisseur.',
|
|
210
|
+
read_full: 'Lire le texte complet',
|
|
211
|
+
intro: 'Pour améliorer la stabilité du produit, WUIC peut envoyer automatiquement les détails techniques des erreurs survenant dans votre application à notre serveur privé. Aucun contenu personnel ou métier n\'est transmis. Cette fonction est optionnelle et désactivable à tout moment.',
|
|
212
|
+
what_we_send: 'Ce qui est envoyé :',
|
|
213
|
+
what_we_dont_send: 'Type d\'exception, message, stack trace, URL de la requête, version du framework, empreinte anonyme de la machine (hash), user-agent du navigateur.',
|
|
214
|
+
where_it_goes: 'Destination : serveur privé du fournisseur (errors.wuic-framework.com), accessible uniquement par l\'équipe de développement.',
|
|
215
|
+
retention: 'Rétention : 90 jours maximum, puis suppression automatique.',
|
|
216
|
+
legal_basis: 'Base juridique : consentement explicite (RGPD art. 6.1.a). Révocable à tout moment.',
|
|
217
|
+
how_to_disable: 'Comment désactiver : Paramètres → Configuration de l\'application, décochez "CrashReporting.Enabled".',
|
|
218
|
+
btn_accept: 'Accepter et activer',
|
|
219
|
+
btn_decline: 'Refuser'
|
|
220
|
+
},
|
|
221
|
+
'es-ES': {
|
|
222
|
+
title: 'Notificación automática de errores',
|
|
223
|
+
checkbox_accept: 'Acepto la transmisión anónima de informes de error',
|
|
224
|
+
intro_short: 'WUIC puede enviar automáticamente los detalles técnicos de los errores al servidor privado del fabricante.',
|
|
225
|
+
read_full: 'Leer texto completo',
|
|
226
|
+
intro: 'Para mejorar la estabilidad del producto, WUIC puede enviar automáticamente los detalles técnicos de los errores que ocurren en su aplicación a nuestro servidor privado. No se transmite ningún contenido personal o de negocio. Esta función es opcional y se puede desactivar en cualquier momento.',
|
|
227
|
+
what_we_send: 'Qué se envía:',
|
|
228
|
+
what_we_dont_send: 'Tipo de excepción, mensaje, stack trace, URL de la solicitud, versión del framework, huella anónima de la máquina (hash), user-agent del navegador.',
|
|
229
|
+
where_it_goes: 'A dónde va: servidor privado del fabricante (errors.wuic-framework.com), accesible solo por el equipo de desarrollo.',
|
|
230
|
+
retention: 'Retención: hasta 90 días, después eliminación automática.',
|
|
231
|
+
legal_basis: 'Base jurídica: consentimiento explícito (RGPD art. 6.1.a). Revocable en cualquier momento.',
|
|
232
|
+
how_to_disable: 'Cómo desactivar: Ajustes → Configuración de la aplicación, desmarque "CrashReporting.Enabled".',
|
|
233
|
+
btn_accept: 'Aceptar y activar',
|
|
234
|
+
btn_decline: 'Rechazar'
|
|
235
|
+
},
|
|
236
|
+
'de-DE': {
|
|
237
|
+
title: 'Automatische Fehlermeldung',
|
|
238
|
+
checkbox_accept: 'Ich willige in die anonyme Übertragung von Fehlerberichten ein',
|
|
239
|
+
intro_short: 'WUIC kann technische Fehlerdetails automatisch an den privaten Server des Anbieters senden.',
|
|
240
|
+
read_full: 'Vollständigen Text lesen',
|
|
241
|
+
intro: 'Zur Verbesserung der Produktstabilität kann WUIC technische Details zu Fehlern in Ihrer Anwendung automatisch an unseren privaten Server senden. Keine persönlichen oder geschäftlichen Inhalte werden übertragen. Diese Funktion ist optional und jederzeit deaktivierbar.',
|
|
242
|
+
what_we_send: 'Was gesendet wird:',
|
|
243
|
+
what_we_dont_send: 'Ausnahmetyp, Nachricht, Stack-Trace, Anfrage-URL, Framework-Version, anonymer Maschinen-Fingerabdruck (Hash), Browser-User-Agent.',
|
|
244
|
+
where_it_goes: 'Wohin: privater Server des Anbieters (errors.wuic-framework.com), nur für das Entwicklungsteam zugänglich.',
|
|
245
|
+
retention: 'Aufbewahrung: max. 90 Tage, dann automatische Löschung.',
|
|
246
|
+
legal_basis: 'Rechtsgrundlage: ausdrückliche Einwilligung (DSGVO Art. 6.1.a). Jederzeit widerrufbar.',
|
|
247
|
+
how_to_disable: 'Deaktivieren: Einstellungen → Anwendungskonfiguration, Flag "CrashReporting.Enabled" deaktivieren.',
|
|
248
|
+
btn_accept: 'Akzeptieren und aktivieren',
|
|
249
|
+
btn_decline: 'Ablehnen'
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Click sul checkbox del consenso. Comportamento:
|
|
254
|
+
* - check (off → on) : apre il popup disclaimer; il flag viene davvero
|
|
255
|
+
* attivato SOLO quando l'utente preme "Accetto" nel dialog. Se chiude
|
|
256
|
+
* o annulla, il flag resta off.
|
|
257
|
+
* - uncheck (on → off): no popup, opt-out immediato.
|
|
258
|
+
*/
|
|
259
|
+
onCrashReportingToggle(newValue) {
|
|
260
|
+
if (newValue) {
|
|
261
|
+
// Tenuto false finche' l'utente non conferma nel dialog. Cosi' il
|
|
262
|
+
// checkbox NON appare gia' flaggato mentre l'utente legge il
|
|
263
|
+
// disclaimer — l'attivazione e' un atto esplicito post-lettura.
|
|
264
|
+
this.firstRunForm.enableCrashReporting = false;
|
|
265
|
+
this.crashReportingDisclaimerVisible = true;
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
this.firstRunForm.enableCrashReporting = false;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
openCrashReportingDisclaimer() {
|
|
272
|
+
this.crashReportingDisclaimerVisible = true;
|
|
273
|
+
}
|
|
274
|
+
acceptCrashReporting() {
|
|
275
|
+
this.firstRunForm.enableCrashReporting = true;
|
|
276
|
+
this.crashReportingDisclaimerVisible = false;
|
|
277
|
+
}
|
|
278
|
+
declineCrashReporting() {
|
|
279
|
+
this.firstRunForm.enableCrashReporting = false;
|
|
280
|
+
this.crashReportingDisclaimerVisible = false;
|
|
281
|
+
}
|
|
138
282
|
firstRunDataDbOptions = [];
|
|
139
283
|
firstRunRealPath = '';
|
|
140
284
|
/** Stato progress bar polled da `GET /api/Meta/FirstRunProgress`. */
|
|
@@ -159,6 +303,11 @@ class WuicFirstRunWizardComponent {
|
|
|
159
303
|
this.messageService = messageService;
|
|
160
304
|
this.injector = injector;
|
|
161
305
|
}
|
|
306
|
+
/** Disposer del delegate registrato sul GlobalHandler — vedi ngOnInit. */
|
|
307
|
+
metadataDbExistsDelegateDisposer;
|
|
308
|
+
/** Anti-loop: il prompt e' fire-and-forget; senza guardia, ricliccare
|
|
309
|
+
* "Sì" ad un secondo trigger lancerebbe re-submit ricorsivi. */
|
|
310
|
+
metadataDbExistsPromptInFlight = false;
|
|
162
311
|
ngOnInit() {
|
|
163
312
|
// Bundle traduzioni firstRun PRIMA che il template renda i pipe `| translate`.
|
|
164
313
|
// Necessario perche' in firstRun il DB metadati e' vuoto e il fetch
|
|
@@ -166,6 +315,21 @@ class WuicFirstRunWizardComponent {
|
|
|
166
315
|
// livello, ma queste sono chiavi dedicate al wizard non presenti nel
|
|
167
316
|
// FIRST_RUN_FALLBACK del manager).
|
|
168
317
|
this.registerFirstRunTranslations();
|
|
318
|
+
// Delegate sul GlobalHandler che intercetta il marker
|
|
319
|
+
// `METADATA_DB_EXISTS_CONFIRM_REQUIRED` lanciato dal server da
|
|
320
|
+
// `MetaService.configure_wuic` quando il metadata DB target esiste gia'.
|
|
321
|
+
// Senza questo, l'introduzione del JsonExceptionFilter (skill exception-
|
|
322
|
+
// handling) wrappa il marker in `args.message` e l'errore arriverebbe
|
|
323
|
+
// all'utente come dialog generico `errors.server.unhandled` invece del
|
|
324
|
+
// prompt di conferma drop+recreate.
|
|
325
|
+
this.metadataDbExistsDelegateDisposer = GlobalHandler.registerDelegate((ctx) => {
|
|
326
|
+
if (!ctx.message?.includes('METADATA_DB_EXISTS_CONFIRM_REQUIRED'))
|
|
327
|
+
return false;
|
|
328
|
+
// Async fire-and-forget: ritorno true (sopprime il dialog default),
|
|
329
|
+
// poi prompt + retry submit.
|
|
330
|
+
void this.handleMetadataDbExistsPrompt(ctx);
|
|
331
|
+
return true;
|
|
332
|
+
}, { priority: 100 });
|
|
169
333
|
// Hook post-login per consumare `logs/rag-setup-pending.json`.
|
|
170
334
|
const authSession = this.injector.get(AuthSessionService, null);
|
|
171
335
|
if (authSession) {
|
|
@@ -183,6 +347,60 @@ class WuicFirstRunWizardComponent {
|
|
|
183
347
|
ngOnDestroy() {
|
|
184
348
|
this.stopFirstRunProgressPolling();
|
|
185
349
|
this.authStateSubscription?.unsubscribe();
|
|
350
|
+
this.metadataDbExistsDelegateDisposer?.();
|
|
351
|
+
}
|
|
352
|
+
/** Mostra il prompt di conferma drop+recreate del metadata DB e, se
|
|
353
|
+
* l'utente conferma, ri-lancia l'install con dropExistingMetadataDb=true.
|
|
354
|
+
* Triggered dal delegate sul GlobalHandler quando il server emette il
|
|
355
|
+
* marker `METADATA_DB_EXISTS_CONFIRM_REQUIRED:<dbName>`. */
|
|
356
|
+
async handleMetadataDbExistsPrompt(ctx) {
|
|
357
|
+
if (this.metadataDbExistsPromptInFlight)
|
|
358
|
+
return;
|
|
359
|
+
this.metadataDbExistsPromptInFlight = true;
|
|
360
|
+
try {
|
|
361
|
+
// dbName: prima cerca in args (envelope tipizzato moderno),
|
|
362
|
+
// poi parsea il marker stringa `METADATA_DB_EXISTS_CONFIRM_REQUIRED:<dbName>`,
|
|
363
|
+
// poi fallback al nome dal form.
|
|
364
|
+
let dbName = (ctx.args && (ctx.args.dbName || ctx.args.metadataDbName)) || '';
|
|
365
|
+
if (!dbName) {
|
|
366
|
+
const m = /METADATA_DB_EXISTS_CONFIRM_REQUIRED:([^\s|"\\]+)/.exec(ctx.message || '');
|
|
367
|
+
if (m)
|
|
368
|
+
dbName = m[1];
|
|
369
|
+
}
|
|
370
|
+
if (!dbName)
|
|
371
|
+
dbName = this.firstRunForm.metadataDbName || 'metadataDB';
|
|
372
|
+
const promptResult = await WtoolboxService.promptDialog('Conferma ricreazione metadata DB', [
|
|
373
|
+
{
|
|
374
|
+
name: 'confirmDrop',
|
|
375
|
+
caption: `Il database metadati '${dbName}' esiste già. Vuoi eliminarlo e ricrearlo?`,
|
|
376
|
+
type: 'dictionary_radio',
|
|
377
|
+
value: 'no',
|
|
378
|
+
required: true,
|
|
379
|
+
dictionaryData: [
|
|
380
|
+
{ label: 'No', value: 'no' },
|
|
381
|
+
{ label: 'Sì', value: 'yes' }
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
], '620px', '400px');
|
|
385
|
+
const rawConfirm = promptResult?.confirmDrop;
|
|
386
|
+
let confirmDropValue = rawConfirm;
|
|
387
|
+
if (rawConfirm && typeof rawConfirm === 'object' && 'value' in rawConfirm && typeof rawConfirm.value !== 'function') {
|
|
388
|
+
confirmDropValue = rawConfirm.value;
|
|
389
|
+
}
|
|
390
|
+
else if (rawConfirm && typeof rawConfirm.getValue === 'function') {
|
|
391
|
+
confirmDropValue = rawConfirm.getValue();
|
|
392
|
+
}
|
|
393
|
+
if (confirmDropValue && typeof confirmDropValue === 'object' && 'value' in confirmDropValue) {
|
|
394
|
+
confirmDropValue = confirmDropValue.value;
|
|
395
|
+
}
|
|
396
|
+
const confirmDrop = String(confirmDropValue ?? 'no').toLowerCase() === 'yes';
|
|
397
|
+
if (confirmDrop) {
|
|
398
|
+
await this.submitFirstRunInstallInternal(true);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
finally {
|
|
402
|
+
this.metadataDbExistsPromptInFlight = false;
|
|
403
|
+
}
|
|
186
404
|
}
|
|
187
405
|
// ════════════════════════════════════════════════════════════════════════
|
|
188
406
|
// STATIC HELPERS
|
|
@@ -567,40 +785,12 @@ class WuicFirstRunWizardComponent {
|
|
|
567
785
|
}
|
|
568
786
|
catch (error) {
|
|
569
787
|
this.firstRunError = this.extractErrorMessage(error);
|
|
788
|
+
// Branch METADATA_DB_EXISTS gestito dal delegate registrato in ngOnInit
|
|
789
|
+
// (`metadataDbExistsDelegateDisposer`): mostra prompt + ri-chiama
|
|
790
|
+
// `submitFirstRunInstallInternal(true)`. Qui sotto saltiamo solo il toast
|
|
791
|
+
// generico in quel caso specifico, per evitare duplicati col prompt.
|
|
570
792
|
if (!confirmDropExistingMetadataDb && this.firstRunError.includes('METADATA_DB_EXISTS_CONFIRM_REQUIRED')) {
|
|
571
|
-
|
|
572
|
-
const promptResult = await WtoolboxService.promptDialog('Conferma ricreazione metadata DB', [
|
|
573
|
-
{
|
|
574
|
-
name: 'confirmDrop',
|
|
575
|
-
caption: `Il database metadati '${metadataDbName}' esiste già. Vuoi eliminarlo e ricrearlo?`,
|
|
576
|
-
type: 'dictionary_radio',
|
|
577
|
-
value: 'no',
|
|
578
|
-
required: true,
|
|
579
|
-
dictionaryData: [
|
|
580
|
-
{ label: 'No', value: 'no' },
|
|
581
|
-
{ label: 'Sì', value: 'yes' }
|
|
582
|
-
]
|
|
583
|
-
}
|
|
584
|
-
// width='620px', height='400px' (auto-fit ~350px + 50px richiesti per
|
|
585
|
-
// dare respiro alla caption con nome DB lungo + radio group + footer
|
|
586
|
-
// OK/Cancel senza scroll interno).
|
|
587
|
-
], '620px', '400px');
|
|
588
|
-
const rawConfirm = promptResult?.confirmDrop;
|
|
589
|
-
let confirmDropValue = rawConfirm;
|
|
590
|
-
if (rawConfirm && typeof rawConfirm === 'object' && 'value' in rawConfirm && typeof rawConfirm.value !== 'function') {
|
|
591
|
-
confirmDropValue = rawConfirm.value;
|
|
592
|
-
}
|
|
593
|
-
else if (rawConfirm && typeof rawConfirm.getValue === 'function') {
|
|
594
|
-
confirmDropValue = rawConfirm.getValue();
|
|
595
|
-
}
|
|
596
|
-
if (confirmDropValue && typeof confirmDropValue === 'object' && 'value' in confirmDropValue) {
|
|
597
|
-
confirmDropValue = confirmDropValue.value;
|
|
598
|
-
}
|
|
599
|
-
const confirmDrop = String(confirmDropValue ?? 'no').toLowerCase() === 'yes';
|
|
600
|
-
if (confirmDrop) {
|
|
601
|
-
await this.submitFirstRunInstallInternal(true);
|
|
602
|
-
return;
|
|
603
|
-
}
|
|
793
|
+
return;
|
|
604
794
|
}
|
|
605
795
|
this.messageService.add({ severity: 'error', summary: 'Installazione fallita', detail: this.firstRunError });
|
|
606
796
|
}
|
|
@@ -940,6 +1130,21 @@ class WuicFirstRunWizardComponent {
|
|
|
940
1130
|
if (rootMessage && (!detail || !String(detail).includes(String(rootMessage)))) {
|
|
941
1131
|
parts.push(String(rootMessage));
|
|
942
1132
|
}
|
|
1133
|
+
// ── New typed-exception envelope (skill exception-handling) ────────
|
|
1134
|
+
// Server's JsonExceptionFilter wraps unhandled exceptions in:
|
|
1135
|
+
// { ok:false, errorCode, fallbackMessage, args: { type, message, ... }, traceId }
|
|
1136
|
+
// Senza questi pickup, marker grezzi tipo `METADATA_DB_EXISTS_CONFIRM_REQUIRED:`
|
|
1137
|
+
// (lanciati come `throw new InvalidOperationException(marker)` lato server)
|
|
1138
|
+
// restano sepolti in `args.message` → il flow `if (firstRunError.includes(marker))`
|
|
1139
|
+
// del wizard non trova mai il match e perde il prompt di overwrite.
|
|
1140
|
+
const argsMsg = fromBackend.args?.message;
|
|
1141
|
+
if (argsMsg && !parts.some(p => p.includes(String(argsMsg)))) {
|
|
1142
|
+
parts.push(String(argsMsg));
|
|
1143
|
+
}
|
|
1144
|
+
const fallbackMsg = fromBackend.fallbackMessage;
|
|
1145
|
+
if (fallbackMsg && !parts.some(p => p.includes(String(fallbackMsg)))) {
|
|
1146
|
+
parts.push(String(fallbackMsg));
|
|
1147
|
+
}
|
|
943
1148
|
if (parts.length > 0)
|
|
944
1149
|
return parts.join(' | ');
|
|
945
1150
|
}
|
|
@@ -1093,7 +1298,7 @@ class WuicFirstRunWizardComponent {
|
|
|
1093
1298
|
}
|
|
1094
1299
|
}
|
|
1095
1300
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WuicFirstRunWizardComponent, deps: [{ token: i1.HttpClient }, { token: i2.TranslateService }, { token: i3.MessageService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
1096
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WuicFirstRunWizardComponent, isStandalone: true, selector: "wuic-first-run-wizard-impl", outputs: { complete: "complete" }, ngImport: i0, template: "@if (showFirstRunInstall) {\n<div class=\"first-run-overlay\">\n <div class=\"first-run-card first-run-card-wide\">\n <div class=\"first-run-title\">Configurazione iniziale progetto</div>\n <div class=\"first-run-subtitle\">Seleziona DBMS, connessione dati e nome database metadati.</div>\n\n <!-- BODY scrollabile: header (title/subtitle) e footer (progress + CTA)\n restano sempre visibili, solo questo blocco scrolla quando il form\n e' piu' alto della viewport. -->\n <div class=\"first-run-body\">\n\n <!-- Grid 2 colonne: sx = connessione + scaffold / dx = admin + RAG.\n Su viewport stretti (< 720px) il grid collassa a 1 colonna. -->\n <div class=\"first-run-grid\">\n\n <!-- \u2500\u2500 COLONNA SINISTRA: Database + Setup \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"first-run-col\">\n\n @if (firstRunSetupModeOptions.length > 1) {\n <div class=\"first-run-field\">\n <label for=\"first-run-mode\">Modalit\u00E0 setup</label>\n <p-select [options]=\"firstRunSetupModeOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.setupMode\" (ngModelChange)=\"onFirstRunSetupModeChanged($event)\"\n [disabled]=\"firstRunInstalling\" [style]=\"{ width: '100%' }\" inputId=\"first-run-mode\"></p-select>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-dbms\">DBMS</label>\n <p-select [options]=\"firstRunDbmsOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.dbms\" (ngModelChange)=\"onFirstRunDbmsChanged($event)\"\n [disabled]=\"firstRunInstalling\" [style]=\"{ width: '100%' }\" inputId=\"first-run-dbms\"></p-select>\n </div>\n\n @if (firstRunForm.setupMode === 'tutorial') {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.createTutorialIfMissing\"\n (ngModelChange)=\"firstRunForm.createTutorialIfMissing = !!$event\" [disabled]=\"firstRunInstalling\" />\n Crea tutorial se manca\n </label>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-datasql\">DataSQLConnection</label>\n <input id=\"first-run-datasql\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.dataConnectionString\" (ngModelChange)=\"onFirstRunConnectionChanged($event)\"\n [disabled]=\"firstRunInstalling\"\n placeholder=\"es. data source=localhost\\sqlexpress;User ID=sa;Password=...;initial catalog=WideWorldImporters\" />\n </div>\n\n <div class=\"first-run-field\">\n <p-button label=\"Test connessione e carica DB\" severity=\"secondary\" [outlined]=\"true\"\n [loading]=\"firstRunConnectionTesting\"\n [disabled]=\"firstRunInstalling || firstRunLoading || !firstRunForm.dataConnectionString\"\n (onClick)=\"testFirstRunConnectionAndLoadDatabases()\"></p-button>\n </div>\n\n @if (firstRunForm.setupMode === 'tutorial') {\n <div class=\"first-run-field\">\n <label for=\"first-run-datadb\">Database dati tutorial</label>\n <input id=\"first-run-datadb\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.tutorialDataDbName\"\n (ngModelChange)=\"firstRunForm.tutorialDataDbName = $event; firstRunForm.dataDbName = $event\"\n [disabled]=\"firstRunInstalling || !firstRunConnectionValid\"\n placeholder=\"WideWorldImporters\" />\n </div>\n } @else {\n <div class=\"first-run-field\">\n <label for=\"first-run-datadb\">Database dati</label>\n <p-select [options]=\"firstRunDataDbOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.dataDbName\" (ngModelChange)=\"firstRunForm.dataDbName = $event\"\n [disabled]=\"firstRunInstalling || firstRunDbLoading || !firstRunConnectionValid\" [filter]=\"true\"\n [editable]=\"true\" [style]=\"{ width: '100%' }\" inputId=\"first-run-datadb\"\n placeholder=\"Seleziona o digita database\"></p-select>\n <div style=\"margin-top: 0.5rem;\">\n <p-button label=\"Aggiorna elenco DB\" severity=\"secondary\" [outlined]=\"true\" size=\"small\"\n [loading]=\"firstRunDbLoading\" [disabled]=\"firstRunInstalling || !firstRunConnectionValid\"\n (onClick)=\"testFirstRunConnectionAndLoadDatabases()\"></p-button>\n </div>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-metadb\">@if (firstRunForm.setupMode === 'tutorial') {Nome DB metadati tutorial} @else {Nome DB metadati}</label>\n <input id=\"first-run-metadb\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.setupMode === 'tutorial' ? firstRunForm.tutorialMetadataDbName : firstRunForm.metadataDbName\"\n (ngModelChange)=\"firstRunForm.metadataDbName = $event; firstRunForm.tutorialMetadataDbName = $event\"\n [disabled]=\"firstRunInstalling\"\n placeholder=\"metadataDB\" />\n </div>\n\n @if (firstRunForm.setupMode !== 'tutorial') {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.scaffoldExistingDatabase\"\n (ngModelChange)=\"firstRunForm.scaffoldExistingDatabase = !!$event\"\n [disabled]=\"firstRunInstalling\" />\n Esegui scaffold automatico delle tabelle del DB selezionato\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Popola <code>_metadati__tabelle</code> / <code>_metadati__colonne</code> al termine dell'installazione.\n Operazione potenzialmente lunga su DB con molte tabelle.\n </small>\n </div>\n }\n </div>\n\n <!-- \u2500\u2500 COLONNA DESTRA: Admin + RAG \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"first-run-col\">\n\n <div class=\"first-run-section-title\">Utente admin iniziale</div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-username\">Username admin iniziale</label>\n <input id=\"first-run-admin-username\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.adminUsername\"\n (ngModelChange)=\"firstRunForm.adminUsername = $event\"\n [disabled]=\"firstRunInstalling\" autocomplete=\"off\"\n placeholder=\"admin\" />\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-password\">Password admin iniziale</label>\n <input id=\"first-run-admin-password\" class=\"first-run-input\" type=\"password\"\n [ngModel]=\"firstRunForm.adminPassword\"\n (ngModelChange)=\"firstRunForm.adminPassword = $event\"\n [disabled]=\"firstRunInstalling\" autocomplete=\"new-password\"\n placeholder=\"(min 4 caratteri)\" />\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-language\">Lingua admin iniziale</label>\n <p-select [options]=\"firstRunAdminLanguageOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.adminLanguage\"\n (ngModelChange)=\"firstRunForm.adminLanguage = $event\"\n [disabled]=\"firstRunInstalling\"\n [style]=\"{ width: '100%' }\" inputId=\"first-run-admin-language\"></p-select>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Lingua applicata all'utente admin dopo il primo login. Puoi cambiarla in seguito dal profilo utente.\n </small>\n </div>\n\n <div class=\"first-run-section-title first-run-section-title-rag\">RAG Chatbot (opzionale)</div>\n\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.installRag\"\n (ngModelChange)=\"firstRunForm.installRag = !!$event\"\n [disabled]=\"firstRunInstalling || !firstRunPythonInstalled\" />\n Installa e avvia il server RAG\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.installTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n @if (firstRunPythonInstalled && firstRunPythonSupported) {\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Python {{ firstRunPythonVersion || '3.12' }} rilevato \u2713. Al primo login post-wizard, crea <code>.venv</code>,\n installa torch + transformers + FastAPI, avvia il server su <code>:8765</code>.\n Richiede ~5-10 min + ~200 MB di download (CPU).\n </small>\n } @else if (firstRunPythonInstalled && !firstRunPythonSupported) {\n <div class=\"first-run-python-note\">\n <strong>\u24D8 Python {{ firstRunPythonVersion }} rilevato \u2014 versione non testata</strong>\n <div style=\"margin-top:4px;\">\n WUIC \u00E8 pinnato a <strong>Python 3.12.x</strong> (wheels torch / transformers / LoRA pi\u00F9 stabili).\n Procedere con <code>{{ firstRunPythonVersion }}</code> pu\u00F2 funzionare ma non \u00E8 testato:\n se <code>pip install torch</code> fallisce con \"no matching distribution\", installa\n <a href=\"https://www.python.org/downloads/release/python-3120/\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"first-run-python-warning-link\">Python 3.12</a>\n a fianco e metti la sua cartella prima di quella di {{ firstRunPythonVersion }} nel PATH.\n </div>\n </div>\n } @else {\n <div class=\"first-run-python-warning\">\n <strong>\u26A0 Python 3.12 non rilevato sul sistema</strong>\n <div style=\"margin-top:6px;\">\n Il setup RAG richiede Python 3.12. Lo zip di deploy include l'installer embeddable + uno script\n che fa tutto: estrae Python in <code>C:\\Python312</code>, installa pip, aggiorna PATH, riavvia IIS.\n </div>\n <ol style=\"margin:8px 0 4px 20px; padding:0;\">\n <li>\n Vai nella cartella dove hai estratto il deploy zip (dove c'\u00E8 <code>WuicCore.dll</code>).\n </li>\n <li>\n <strong>Right-click su <code>rag-setup.ps1</code> \u2192 \"Esegui come amministratore\"</strong>,\n oppure da pwsh-admin: <code>pwsh -ExecutionPolicy Bypass -File .\\rag-setup.ps1</code>.\n Lo script si auto-eleva via UAC se non gi\u00E0 elevato.\n </li>\n <li>\n Ricarica questa pagina (Ctrl+F5) \u2014 la checkbox si abilita automaticamente.\n </li>\n </ol>\n <div style=\"margin-top:4px; opacity:0.8;\">\n Lo script gestisce anche l'edge case GPO <code>DisableMSI</code> su Windows Server (usa il bundle\n embeddable zip, non MSI). Per il download manuale di Python da python.org:\n <a href=\"https://www.python.org/downloads/release/python-3120/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"first-run-python-warning-link\">\n python.org/downloads/release/python-3120/\n <i class=\"pi pi-external-link\" style=\"font-size:0.75rem; margin-left:3px;\"></i>\n </a>.\n Dettagli in <code>FIRST_STEPS.md</code> accanto al deploy. Il resto del setup (DB, admin user)\n pu\u00F2 procedere senza Python \u2014 installa il RAG dopo.\n </div>\n </div>\n }\n </div>\n\n @if (firstRunForm.installRag) {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.useCuda\"\n (ngModelChange)=\"firstRunForm.useCuda = !!$event\"\n [disabled]=\"firstRunInstalling\" />\n Usa CUDA (GPU NVIDIA)\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.cudaTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Attiva torch GPU (CUDA 12.1, ~2.5 GB download) invece di CPU (~200 MB).\n Richiede una GPU NVIDIA + driver CUDA installati lato sistema.\n </small>\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-anthropic-key\">\n Anthropic API Key (opzionale)\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.apiKeyTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n <textarea id=\"first-run-anthropic-key\" class=\"first-run-input first-run-textarea\"\n [ngModel]=\"firstRunForm.anthropicApiKey\"\n (ngModelChange)=\"firstRunForm.anthropicApiKey = $event\"\n [disabled]=\"firstRunInstalling\"\n rows=\"2\" autocomplete=\"off\"\n placeholder=\"sk-ant-...\"></textarea>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Senza chiave il server RAG funziona solo in modalit\u00E0 retrieval (ricerca snippet).\n Con chiave abilita la chat LLM via Claude.\n </small>\n </div>\n }\n </div>\n\n <!-- Crash reporting opt-in (skill crash-reporting Commit 8). Default OFF.\n Il consenso GDPR e' inline (testo breve + link). Quando flaggato,\n configure_wuic scrive `CrashReporting.Enabled=true` +\n DisclaimerAcceptedVersion=\"1.0\" in appsettings \u2014 equivalente al\n flusso appsettings-editor (Commit 9). -->\n <div class=\"first-run-section-title first-run-section-title-crash-reporting\">{{ 'crash_reporting.disclaimer.title' | translate }}</div>\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.enableCrashReporting\"\n (ngModelChange)=\"firstRunForm.enableCrashReporting = !!$event\"\n [disabled]=\"firstRunInstalling\" />\n {{ 'crash_reporting.disclaimer.checkbox_accept' | translate }}\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.85; font-size:0.85rem; line-height:1.45;\">\n {{ 'crash_reporting.disclaimer.intro' | translate }}\n </small>\n <small style=\"display:block; margin-top:6px; opacity:0.75; font-size:0.8rem; line-height:1.4;\">\n <strong>{{ 'crash_reporting.disclaimer.what_we_send' | translate }}</strong><br>\n {{ 'crash_reporting.disclaimer.what_we_dont_send' | translate }}<br>\n {{ 'crash_reporting.disclaimer.where_it_goes' | translate }}<br>\n {{ 'crash_reporting.disclaimer.retention' | translate }}<br>\n {{ 'crash_reporting.disclaimer.legal_basis' | translate }}<br>\n {{ 'crash_reporting.disclaimer.how_to_disable' | translate }}\n </small>\n </div>\n </div>\n\n </div><!-- /.first-run-body -->\n\n <!-- FOOTER sticky: error (se presente) + riga progress|CTA sempre visibile. -->\n <div class=\"first-run-footer\">\n @if (firstRunError && !firstRunErrorDismissed) {\n <div class=\"first-run-error\" role=\"alert\">\n <button type=\"button\"\n class=\"first-run-error__close\"\n (click)=\"dismissFirstRunError()\"\n aria-label=\"Chiudi errore\"\n title=\"Chiudi\">\u00D7</button>\n <div class=\"first-run-error__body\">{{ firstRunError }}</div>\n </div>\n }\n\n <div class=\"first-run-footer-row\">\n @if (firstRunInstalling && firstRunProgress.active) {\n <div class=\"first-run-progress\">\n <div class=\"first-run-progress-label\">\n <strong>{{ firstRunProgress.phase }}</strong>\n @if (firstRunProgress.total > 0 && !firstRunProgress.phase.includes('.restore')) {\n <span class=\"first-run-progress-count\">\n \u2014 batch {{ firstRunProgress.current }} / {{ firstRunProgress.total }}\n </span>\n }\n @if (firstRunProgress.elapsedMs > 0) {\n <span class=\"first-run-progress-count\">\n \u00B7 {{ (firstRunProgress.elapsedMs / 1000) | number:'1.0-0' }}s\n </span>\n }\n </div>\n @if (firstRunProgress.phase.includes('.restore') && firstRunProgress.percent < 5) {\n <p-progressBar mode=\"indeterminate\" [style]=\"{'height': '1rem'}\"></p-progressBar>\n } @else {\n <p-progressBar [value]=\"firstRunProgress.percent\" [showValue]=\"true\" [style]=\"{'height': '1rem'}\"></p-progressBar>\n }\n @if (firstRunProgress.message) {\n <div class=\"first-run-progress-message\">{{ firstRunProgress.message }}</div>\n }\n </div>\n } @else {\n <div class=\"first-run-progress-placeholder\"></div>\n }\n\n <div class=\"first-run-actions\">\n <p-button label=\"Conferma e genera metadataDB\" [loading]=\"firstRunInstalling\"\n [disabled]=\"firstRunInstalling || firstRunLoading\" (onClick)=\"submitFirstRunInstall()\"></p-button>\n </div>\n </div>\n </div>\n </div>\n</div>\n}\n", styles: [".first-run-overlay{position:fixed;inset:0;z-index:900;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(135deg,#081221d9,#16294acc)}.first-run-card-wide{width:min(1180px,100%)!important}.first-run-card{width:min(860px,100%);min-height:min(720px,100vh - 48px);max-height:calc(100vh - 48px);display:flex;flex-direction:column;overflow:hidden;border-radius:14px;padding:22px;background:var(--p-surface-0);box-shadow:0 18px 48px #00000059;border:1px solid var(--p-content-border-color)}.first-run-body{flex:1 1 auto;min-height:0;overflow-y:auto;padding-right:4px;margin-right:-4px}.first-run-footer{flex:0 0 auto;margin-top:12px;padding-top:12px;border-top:1px solid var(--p-content-border-color);display:flex;flex-direction:column;gap:10px}.first-run-footer-row{display:flex;align-items:center;gap:16px}.first-run-title{font-size:1.25rem;font-weight:700}.first-run-subtitle{margin-top:6px;margin-bottom:18px;opacity:.8}.first-run-field{margin-bottom:14px}.first-run-field label{display:block;margin-bottom:6px;font-weight:600}.first-run-checkbox-row label{display:inline-flex;align-items:center;gap:.5rem;margin-bottom:0;font-weight:500}.first-run-input{width:100%;height:40px;border-radius:8px;border:1px solid var(--p-content-border-color);padding:8px 12px;font-size:.95rem;background:var(--p-surface-0);color:var(--p-text-color)}.first-run-textarea{height:auto;min-height:56px;resize:vertical;font-family:var(--p-font-family);line-height:1.4}.first-run-grid{display:grid;grid-template-columns:1fr 1fr;column-gap:28px;row-gap:0}@media(max-width:860px){.first-run-grid{grid-template-columns:1fr}}.first-run-col{display:flex;flex-direction:column;min-width:0}.first-run-section-title{margin-top:4px;margin-bottom:12px;padding-bottom:6px;font-size:.95rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;opacity:.8;border-bottom:1px solid var(--p-content-border-color)}.first-run-section-title-rag{margin-top:18px}.first-run-python-warning{margin-top:8px;padding:10px 12px;background:#fef3c7;border:1px solid #fcd34d;border-radius:6px;color:#78350f;font-size:.85rem;line-height:1.4}.first-run-python-warning strong{color:#78350f}.first-run-python-warning code{background:#00000014;padding:1px 4px;border-radius:3px;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.82rem}.first-run-python-warning ol li+li{margin-top:4px}.first-run-python-warning-link{color:#92400e;text-decoration:underline;font-weight:600}.first-run-python-warning-link:hover{color:#78350f}.first-run-python-warning-link:visited{color:#92400e}.first-run-python-note{margin-top:8px;padding:10px 12px;background:#dbeafe;border:1px solid #93c5fd;border-radius:6px;color:#1e3a8a;font-size:.85rem;line-height:1.4}.first-run-python-note strong{color:#1e3a8a}.first-run-python-note code{background:#00000014;padding:1px 4px;border-radius:3px;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.82rem}.first-run-info-icon{margin-left:6px;font-size:.95rem;color:var(--p-primary-color, #3b82f6);cursor:help;vertical-align:middle;opacity:.85}.first-run-info-icon:hover{opacity:1}::ng-deep .p-tooltip.first-run-tooltip{max-width:440px}::ng-deep .p-tooltip.first-run-tooltip .p-tooltip-text{white-space:pre-line;font-size:.85rem;line-height:1.45}.first-run-input:focus{outline:2px solid rgba(59,130,246,.25);border-color:#3b82f6}.first-run-error{position:relative;margin:8px 0 14px;color:#7f1d1d;background:#fee2e2;border:1px solid #fca5a5;border-radius:8px;padding:10px 36px 10px 12px}.first-run-error__body{max-height:200px;overflow-y:auto;word-break:break-word;white-space:pre-wrap;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.85rem;line-height:1.4}.first-run-error__close{position:absolute;top:6px;right:8px;width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0;background:transparent;border:0;border-radius:4px;color:inherit;font-size:1.25rem;line-height:1;cursor:pointer;opacity:.75;transition:background-color .12s ease,opacity .12s ease}.first-run-error__close:hover,.first-run-error__close:focus-visible{opacity:1;background:#7f1d1d1f;outline:none}.first-run-error__close:active{background:#7f1d1d33}.first-run-actions{flex:0 0 auto;display:flex;justify-content:flex-end}.first-run-progress{flex:1 1 auto;min-width:0;padding:8px 12px;background:var(--p-surface-50);border:1px solid var(--p-content-border-color);border-radius:8px;display:flex;flex-direction:column;gap:4px}.first-run-progress-placeholder{flex:1 1 auto;min-width:0}.first-run-progress-label{font-size:.9rem}.first-run-progress-label strong{font-weight:600}.first-run-progress-label .first-run-progress-count{opacity:.7;margin-left:4px}.first-run-progress-message{font-size:.8rem;opacity:.75;font-family:ui-monospace,Cascadia Code,Consolas,monospace}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i4.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i6.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i11.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "pipe", type: i1$2.DecimalPipe, name: "number" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
1301
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WuicFirstRunWizardComponent, isStandalone: true, selector: "wuic-first-run-wizard-impl", outputs: { complete: "complete" }, ngImport: i0, template: "@if (showFirstRunInstall) {\n<div class=\"first-run-overlay\">\n <div class=\"first-run-card first-run-card-wide\">\n <div class=\"first-run-title\">Configurazione iniziale progetto</div>\n <div class=\"first-run-subtitle\">Seleziona DBMS, connessione dati e nome database metadati.</div>\n\n <!-- BODY scrollabile: header (title/subtitle) e footer (progress + CTA)\n restano sempre visibili, solo questo blocco scrolla quando il form\n e' piu' alto della viewport. -->\n <div class=\"first-run-body\">\n\n <!-- Grid 2 colonne: sx = connessione + scaffold / dx = admin + RAG.\n Su viewport stretti (< 720px) il grid collassa a 1 colonna. -->\n <div class=\"first-run-grid\">\n\n <!-- \u2500\u2500 COLONNA SINISTRA: Database + Setup \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"first-run-col\">\n\n @if (firstRunSetupModeOptions.length > 1) {\n <div class=\"first-run-field\">\n <label for=\"first-run-mode\">Modalit\u00E0 setup</label>\n <p-select [options]=\"firstRunSetupModeOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.setupMode\" (ngModelChange)=\"onFirstRunSetupModeChanged($event)\"\n [disabled]=\"firstRunInstalling\" [style]=\"{ width: '100%' }\" inputId=\"first-run-mode\"></p-select>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-dbms\">DBMS</label>\n <p-select [options]=\"firstRunDbmsOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.dbms\" (ngModelChange)=\"onFirstRunDbmsChanged($event)\"\n [disabled]=\"firstRunInstalling\" [style]=\"{ width: '100%' }\" inputId=\"first-run-dbms\"></p-select>\n </div>\n\n @if (firstRunForm.setupMode === 'tutorial') {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.createTutorialIfMissing\"\n (ngModelChange)=\"firstRunForm.createTutorialIfMissing = !!$event\" [disabled]=\"firstRunInstalling\" />\n Crea tutorial se manca\n </label>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-datasql\">DataSQLConnection</label>\n <input id=\"first-run-datasql\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.dataConnectionString\" (ngModelChange)=\"onFirstRunConnectionChanged($event)\"\n [disabled]=\"firstRunInstalling\"\n placeholder=\"es. data source=localhost\\sqlexpress;User ID=sa;Password=...;initial catalog=WideWorldImporters\" />\n </div>\n\n <div class=\"first-run-field\">\n <p-button label=\"Test connessione e carica DB\" severity=\"secondary\" [outlined]=\"true\"\n [loading]=\"firstRunConnectionTesting\"\n [disabled]=\"firstRunInstalling || firstRunLoading || !firstRunForm.dataConnectionString\"\n (onClick)=\"testFirstRunConnectionAndLoadDatabases()\"></p-button>\n </div>\n\n @if (firstRunForm.setupMode === 'tutorial') {\n <div class=\"first-run-field\">\n <label for=\"first-run-datadb\">Database dati tutorial</label>\n <input id=\"first-run-datadb\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.tutorialDataDbName\"\n (ngModelChange)=\"firstRunForm.tutorialDataDbName = $event; firstRunForm.dataDbName = $event\"\n [disabled]=\"firstRunInstalling || !firstRunConnectionValid\"\n placeholder=\"WideWorldImporters\" />\n </div>\n } @else {\n <div class=\"first-run-field\">\n <label for=\"first-run-datadb\">Database dati</label>\n <p-select [options]=\"firstRunDataDbOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.dataDbName\" (ngModelChange)=\"firstRunForm.dataDbName = $event\"\n [disabled]=\"firstRunInstalling || firstRunDbLoading || !firstRunConnectionValid\" [filter]=\"true\"\n [editable]=\"true\" [style]=\"{ width: '100%' }\" inputId=\"first-run-datadb\"\n placeholder=\"Seleziona o digita database\"></p-select>\n <div style=\"margin-top: 0.5rem;\">\n <p-button label=\"Aggiorna elenco DB\" severity=\"secondary\" [outlined]=\"true\" size=\"small\"\n [loading]=\"firstRunDbLoading\" [disabled]=\"firstRunInstalling || !firstRunConnectionValid\"\n (onClick)=\"testFirstRunConnectionAndLoadDatabases()\"></p-button>\n </div>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-metadb\">@if (firstRunForm.setupMode === 'tutorial') {Nome DB metadati tutorial} @else {Nome DB metadati}</label>\n <input id=\"first-run-metadb\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.setupMode === 'tutorial' ? firstRunForm.tutorialMetadataDbName : firstRunForm.metadataDbName\"\n (ngModelChange)=\"firstRunForm.metadataDbName = $event; firstRunForm.tutorialMetadataDbName = $event\"\n [disabled]=\"firstRunInstalling\"\n placeholder=\"metadataDB\" />\n </div>\n\n @if (firstRunForm.setupMode !== 'tutorial') {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.scaffoldExistingDatabase\"\n (ngModelChange)=\"firstRunForm.scaffoldExistingDatabase = !!$event\"\n [disabled]=\"firstRunInstalling\" />\n Esegui scaffold automatico delle tabelle del DB selezionato\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Popola <code>_metadati__tabelle</code> / <code>_metadati__colonne</code> al termine dell'installazione.\n Operazione potenzialmente lunga su DB con molte tabelle.\n </small>\n </div>\n }\n </div>\n\n <!-- \u2500\u2500 COLONNA DESTRA: Admin + RAG \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"first-run-col\">\n\n <div class=\"first-run-section-title\">Utente admin iniziale</div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-username\">Username admin iniziale</label>\n <input id=\"first-run-admin-username\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.adminUsername\"\n (ngModelChange)=\"firstRunForm.adminUsername = $event\"\n [disabled]=\"firstRunInstalling\" autocomplete=\"off\"\n placeholder=\"admin\" />\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-password\">Password admin iniziale</label>\n <input id=\"first-run-admin-password\" class=\"first-run-input\" type=\"password\"\n [ngModel]=\"firstRunForm.adminPassword\"\n (ngModelChange)=\"firstRunForm.adminPassword = $event\"\n [disabled]=\"firstRunInstalling\" autocomplete=\"new-password\"\n placeholder=\"(min 4 caratteri)\" />\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-language\">Lingua admin iniziale</label>\n <p-select [options]=\"firstRunAdminLanguageOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.adminLanguage\"\n (ngModelChange)=\"firstRunForm.adminLanguage = $event\"\n [disabled]=\"firstRunInstalling\"\n [style]=\"{ width: '100%' }\" inputId=\"first-run-admin-language\"></p-select>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Lingua applicata all'utente admin dopo il primo login. Puoi cambiarla in seguito dal profilo utente.\n </small>\n </div>\n\n <div class=\"first-run-section-title first-run-section-title-rag\">RAG Chatbot (opzionale)</div>\n\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.installRag\"\n (ngModelChange)=\"firstRunForm.installRag = !!$event\"\n [disabled]=\"firstRunInstalling || !firstRunPythonInstalled\" />\n Installa e avvia il server RAG\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.installTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n @if (firstRunPythonInstalled && firstRunPythonSupported) {\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Python {{ firstRunPythonVersion || '3.12' }} rilevato \u2713. Al primo login post-wizard, crea <code>.venv</code>,\n installa torch + transformers + FastAPI, avvia il server su <code>:8765</code>.\n Richiede ~5-10 min + ~200 MB di download (CPU).\n </small>\n } @else if (firstRunPythonInstalled && !firstRunPythonSupported) {\n <div class=\"first-run-python-note\">\n <strong>\u24D8 Python {{ firstRunPythonVersion }} rilevato \u2014 versione non testata</strong>\n <div style=\"margin-top:4px;\">\n WUIC \u00E8 pinnato a <strong>Python 3.12.x</strong> (wheels torch / transformers / LoRA pi\u00F9 stabili).\n Procedere con <code>{{ firstRunPythonVersion }}</code> pu\u00F2 funzionare ma non \u00E8 testato:\n se <code>pip install torch</code> fallisce con \"no matching distribution\", installa\n <a href=\"https://www.python.org/downloads/release/python-3120/\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"first-run-python-warning-link\">Python 3.12</a>\n a fianco e metti la sua cartella prima di quella di {{ firstRunPythonVersion }} nel PATH.\n </div>\n </div>\n } @else {\n <div class=\"first-run-python-warning\">\n <strong>\u26A0 Python 3.12 non rilevato sul sistema</strong>\n <div style=\"margin-top:6px;\">\n Il setup RAG richiede Python 3.12. Lo zip di deploy include l'installer embeddable + uno script\n che fa tutto: estrae Python in <code>C:\\Python312</code>, installa pip, aggiorna PATH, riavvia IIS.\n </div>\n <ol style=\"margin:8px 0 4px 20px; padding:0;\">\n <li>\n Vai nella cartella dove hai estratto il deploy zip (dove c'\u00E8 <code>WuicCore.dll</code>).\n </li>\n <li>\n <strong>Right-click su <code>rag-setup.ps1</code> \u2192 \"Esegui come amministratore\"</strong>,\n oppure da pwsh-admin: <code>pwsh -ExecutionPolicy Bypass -File .\\rag-setup.ps1</code>.\n Lo script si auto-eleva via UAC se non gi\u00E0 elevato.\n </li>\n <li>\n Ricarica questa pagina (Ctrl+F5) \u2014 la checkbox si abilita automaticamente.\n </li>\n </ol>\n <div style=\"margin-top:4px; opacity:0.8;\">\n Lo script gestisce anche l'edge case GPO <code>DisableMSI</code> su Windows Server (usa il bundle\n embeddable zip, non MSI). Per il download manuale di Python da python.org:\n <a href=\"https://www.python.org/downloads/release/python-3120/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"first-run-python-warning-link\">\n python.org/downloads/release/python-3120/\n <i class=\"pi pi-external-link\" style=\"font-size:0.75rem; margin-left:3px;\"></i>\n </a>.\n Dettagli in <code>FIRST_STEPS.md</code> accanto al deploy. Il resto del setup (DB, admin user)\n pu\u00F2 procedere senza Python \u2014 installa il RAG dopo.\n </div>\n </div>\n }\n </div>\n\n @if (firstRunForm.installRag) {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.useCuda\"\n (ngModelChange)=\"firstRunForm.useCuda = !!$event\"\n [disabled]=\"firstRunInstalling\" />\n Usa CUDA (GPU NVIDIA)\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.cudaTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Attiva torch GPU (CUDA 12.1, ~2.5 GB download) invece di CPU (~200 MB).\n Richiede una GPU NVIDIA + driver CUDA installati lato sistema.\n </small>\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-anthropic-key\">\n Anthropic API Key (opzionale)\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.apiKeyTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n <textarea id=\"first-run-anthropic-key\" class=\"first-run-input first-run-textarea\"\n [ngModel]=\"firstRunForm.anthropicApiKey\"\n (ngModelChange)=\"firstRunForm.anthropicApiKey = $event\"\n [disabled]=\"firstRunInstalling\"\n rows=\"2\" autocomplete=\"off\"\n placeholder=\"sk-ant-...\"></textarea>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Senza chiave il server RAG funziona solo in modalit\u00E0 retrieval (ricerca snippet).\n Con chiave abilita la chat LLM via Claude.\n </small>\n </div>\n }\n </div>\n\n <!-- Crash reporting opt-in (skill crash-reporting Commit 8). Default OFF.\n Il consenso GDPR usa labels HARDCODED in `crashReportingLabels`\n dentro il componente (NON `wuic_translation`) perche' il\n first-run gira PRIMA che il DB metadati esista \u2014 niente DB,\n niente translation table. Vedi commento esteso nel componente.\n Al check del consenso si apre il popup col disclaimer\n dettagliato; l'utente conferma li' per attivare il flag. -->\n <div class=\"first-run-section-title first-run-section-title-crash-reporting\">{{ crashReportingLabels.title }}</div>\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.enableCrashReporting\"\n (ngModelChange)=\"onCrashReportingToggle($event)\"\n [disabled]=\"firstRunInstalling\" />\n {{ crashReportingLabels.checkbox_accept }}\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.85; font-size:0.85rem; line-height:1.45;\">\n {{ crashReportingLabels.intro_short }}\n <a href=\"javascript:void(0)\" (click)=\"openCrashReportingDisclaimer()\"\n style=\"margin-left:6px;\">{{ crashReportingLabels.read_full }}</a>\n </small>\n </div>\n </div>\n\n <!-- Disclaimer GDPR popup (apre al check + da link \"leggi tutto\"). -->\n <p-dialog [(visible)]=\"crashReportingDisclaimerVisible\"\n [modal]=\"true\"\n [closable]=\"true\"\n [closeOnEscape]=\"true\"\n [header]=\"crashReportingLabels.title\"\n [style]=\"{ width: '600px', maxWidth: '90vw' }\"\n [contentStyle]=\"{ 'max-height': '70vh', 'overflow-y': 'auto' }\"\n [appendTo]=\"'body'\">\n <div style=\"line-height:1.55;\">\n <p>{{ crashReportingLabels.intro }}</p>\n <p><strong>{{ crashReportingLabels.what_we_send }}</strong></p>\n <ul style=\"margin:0 0 8px 18px; padding:0;\">\n <li>{{ crashReportingLabels.what_we_dont_send }}</li>\n <li>{{ crashReportingLabels.where_it_goes }}</li>\n <li>{{ crashReportingLabels.retention }}</li>\n <li>{{ crashReportingLabels.legal_basis }}</li>\n <li>{{ crashReportingLabels.how_to_disable }}</li>\n </ul>\n </div>\n <ng-template pTemplate=\"footer\">\n <p-button [label]=\"crashReportingLabels.btn_decline\"\n severity=\"secondary\"\n (onClick)=\"declineCrashReporting()\"></p-button>\n <p-button [label]=\"crashReportingLabels.btn_accept\"\n (onClick)=\"acceptCrashReporting()\"></p-button>\n </ng-template>\n </p-dialog>\n\n </div><!-- /.first-run-body -->\n\n <!-- FOOTER sticky: error (se presente) + riga progress|CTA sempre visibile. -->\n <div class=\"first-run-footer\">\n @if (firstRunError && !firstRunErrorDismissed) {\n <div class=\"first-run-error\" role=\"alert\">\n <button type=\"button\"\n class=\"first-run-error__close\"\n (click)=\"dismissFirstRunError()\"\n aria-label=\"Chiudi errore\"\n title=\"Chiudi\">\u00D7</button>\n <div class=\"first-run-error__body\">{{ firstRunError }}</div>\n </div>\n }\n\n <div class=\"first-run-footer-row\">\n @if (firstRunInstalling && firstRunProgress.active) {\n <div class=\"first-run-progress\">\n <div class=\"first-run-progress-label\">\n <strong>{{ firstRunProgress.phase }}</strong>\n @if (firstRunProgress.total > 0 && !firstRunProgress.phase.includes('.restore')) {\n <span class=\"first-run-progress-count\">\n \u2014 batch {{ firstRunProgress.current }} / {{ firstRunProgress.total }}\n </span>\n }\n @if (firstRunProgress.elapsedMs > 0) {\n <span class=\"first-run-progress-count\">\n \u00B7 {{ (firstRunProgress.elapsedMs / 1000) | number:'1.0-0' }}s\n </span>\n }\n </div>\n @if (firstRunProgress.phase.includes('.restore') && firstRunProgress.percent < 5) {\n <p-progressBar mode=\"indeterminate\" [style]=\"{'height': '1rem'}\"></p-progressBar>\n } @else {\n <p-progressBar [value]=\"firstRunProgress.percent\" [showValue]=\"true\" [style]=\"{'height': '1rem'}\"></p-progressBar>\n }\n @if (firstRunProgress.message) {\n <div class=\"first-run-progress-message\">{{ firstRunProgress.message }}</div>\n }\n </div>\n } @else {\n <div class=\"first-run-progress-placeholder\"></div>\n }\n\n <div class=\"first-run-actions\">\n <p-button label=\"Conferma e genera metadataDB\" [loading]=\"firstRunInstalling\"\n [disabled]=\"firstRunInstalling || firstRunLoading\" (onClick)=\"submitFirstRunInstall()\"></p-button>\n </div>\n </div>\n </div>\n </div>\n</div>\n}\n", styles: [".first-run-overlay{position:fixed;inset:0;z-index:900;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(135deg,#081221d9,#16294acc)}.first-run-card-wide{width:min(1180px,100%)!important}.first-run-card{width:min(860px,100%);min-height:min(720px,100vh - 48px);max-height:calc(100vh - 48px);display:flex;flex-direction:column;overflow:hidden;border-radius:14px;padding:22px;background:var(--p-surface-0);box-shadow:0 18px 48px #00000059;border:1px solid var(--p-content-border-color)}.first-run-body{flex:1 1 auto;min-height:0;overflow-y:auto;padding-right:4px;margin-right:-4px}.first-run-footer{flex:0 0 auto;margin-top:12px;padding-top:12px;border-top:1px solid var(--p-content-border-color);display:flex;flex-direction:column;gap:10px}.first-run-footer-row{display:flex;align-items:center;gap:16px}.first-run-title{font-size:1.25rem;font-weight:700}.first-run-subtitle{margin-top:6px;margin-bottom:18px;opacity:.8}.first-run-field{margin-bottom:14px}.first-run-field label{display:block;margin-bottom:6px;font-weight:600}.first-run-checkbox-row label{display:inline-flex;align-items:center;gap:.5rem;margin-bottom:0;font-weight:500}.first-run-input{width:100%;height:40px;border-radius:8px;border:1px solid var(--p-content-border-color);padding:8px 12px;font-size:.95rem;background:var(--p-surface-0);color:var(--p-text-color)}.first-run-textarea{height:auto;min-height:56px;resize:vertical;font-family:var(--p-font-family);line-height:1.4}.first-run-grid{display:grid;grid-template-columns:1fr 1fr;column-gap:28px;row-gap:0}@media(max-width:860px){.first-run-grid{grid-template-columns:1fr}}.first-run-col{display:flex;flex-direction:column;min-width:0}.first-run-section-title{margin-top:4px;margin-bottom:12px;padding-bottom:6px;font-size:.95rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;opacity:.8;border-bottom:1px solid var(--p-content-border-color)}.first-run-section-title-rag{margin-top:18px}.first-run-python-warning{margin-top:8px;padding:10px 12px;background:#fef3c7;border:1px solid #fcd34d;border-radius:6px;color:#78350f;font-size:.85rem;line-height:1.4}.first-run-python-warning strong{color:#78350f}.first-run-python-warning code{background:#00000014;padding:1px 4px;border-radius:3px;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.82rem}.first-run-python-warning ol li+li{margin-top:4px}.first-run-python-warning-link{color:#92400e;text-decoration:underline;font-weight:600}.first-run-python-warning-link:hover{color:#78350f}.first-run-python-warning-link:visited{color:#92400e}.first-run-python-note{margin-top:8px;padding:10px 12px;background:#dbeafe;border:1px solid #93c5fd;border-radius:6px;color:#1e3a8a;font-size:.85rem;line-height:1.4}.first-run-python-note strong{color:#1e3a8a}.first-run-python-note code{background:#00000014;padding:1px 4px;border-radius:3px;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.82rem}.first-run-info-icon{margin-left:6px;font-size:.95rem;color:var(--p-primary-color, #3b82f6);cursor:help;vertical-align:middle;opacity:.85}.first-run-info-icon:hover{opacity:1}::ng-deep .p-tooltip.first-run-tooltip{max-width:440px}::ng-deep .p-tooltip.first-run-tooltip .p-tooltip-text{white-space:pre-line;font-size:.85rem;line-height:1.45}.first-run-input:focus{outline:2px solid rgba(59,130,246,.25);border-color:#3b82f6}.first-run-error{position:relative;margin:8px 0 14px;color:#7f1d1d;background:#fee2e2;border:1px solid #fca5a5;border-radius:8px;padding:10px 36px 10px 12px}.first-run-error__body{max-height:200px;overflow-y:auto;word-break:break-word;white-space:pre-wrap;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.85rem;line-height:1.4}.first-run-error__close{position:absolute;top:6px;right:8px;width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0;background:transparent;border:0;border-radius:4px;color:inherit;font-size:1.25rem;line-height:1;cursor:pointer;opacity:.75;transition:background-color .12s ease,opacity .12s ease}.first-run-error__close:hover,.first-run-error__close:focus-visible{opacity:1;background:#7f1d1d1f;outline:none}.first-run-error__close:active{background:#7f1d1d33}.first-run-actions{flex:0 0 auto;display:flex;justify-content:flex-end}.first-run-progress{flex:1 1 auto;min-width:0;padding:8px 12px;background:var(--p-surface-50);border:1px solid var(--p-content-border-color);border-radius:8px;display:flex;flex-direction:column;gap:4px}.first-run-progress-placeholder{flex:1 1 auto;min-width:0}.first-run-progress-label{font-size:.9rem}.first-run-progress-label strong{font-weight:600}.first-run-progress-label .first-run-progress-count{opacity:.7;margin-left:4px}.first-run-progress-message{font-size:.8rem;opacity:.75;font-family:ui-monospace,Cascadia Code,Consolas,monospace}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i4.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i6.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i11.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i2$1.Dialog, selector: "p-dialog", inputs: ["hostName", "header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "maskMotionOptions", "motionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "pipe", type: i1$2.DecimalPipe, name: "number" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
1097
1302
|
}
|
|
1098
1303
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WuicFirstRunWizardComponent, decorators: [{
|
|
1099
1304
|
type: Component,
|
|
@@ -1104,11 +1309,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1104
1309
|
ButtonModule,
|
|
1105
1310
|
SelectModule,
|
|
1106
1311
|
ProgressBarModule,
|
|
1107
|
-
TooltipModule
|
|
1108
|
-
], changeDetection: ChangeDetectionStrategy.Default, template: "@if (showFirstRunInstall) {\n<div class=\"first-run-overlay\">\n <div class=\"first-run-card first-run-card-wide\">\n <div class=\"first-run-title\">Configurazione iniziale progetto</div>\n <div class=\"first-run-subtitle\">Seleziona DBMS, connessione dati e nome database metadati.</div>\n\n <!-- BODY scrollabile: header (title/subtitle) e footer (progress + CTA)\n restano sempre visibili, solo questo blocco scrolla quando il form\n e' piu' alto della viewport. -->\n <div class=\"first-run-body\">\n\n <!-- Grid 2 colonne: sx = connessione + scaffold / dx = admin + RAG.\n Su viewport stretti (< 720px) il grid collassa a 1 colonna. -->\n <div class=\"first-run-grid\">\n\n <!-- \u2500\u2500 COLONNA SINISTRA: Database + Setup \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"first-run-col\">\n\n @if (firstRunSetupModeOptions.length > 1) {\n <div class=\"first-run-field\">\n <label for=\"first-run-mode\">Modalit\u00E0 setup</label>\n <p-select [options]=\"firstRunSetupModeOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.setupMode\" (ngModelChange)=\"onFirstRunSetupModeChanged($event)\"\n [disabled]=\"firstRunInstalling\" [style]=\"{ width: '100%' }\" inputId=\"first-run-mode\"></p-select>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-dbms\">DBMS</label>\n <p-select [options]=\"firstRunDbmsOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.dbms\" (ngModelChange)=\"onFirstRunDbmsChanged($event)\"\n [disabled]=\"firstRunInstalling\" [style]=\"{ width: '100%' }\" inputId=\"first-run-dbms\"></p-select>\n </div>\n\n @if (firstRunForm.setupMode === 'tutorial') {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.createTutorialIfMissing\"\n (ngModelChange)=\"firstRunForm.createTutorialIfMissing = !!$event\" [disabled]=\"firstRunInstalling\" />\n Crea tutorial se manca\n </label>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-datasql\">DataSQLConnection</label>\n <input id=\"first-run-datasql\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.dataConnectionString\" (ngModelChange)=\"onFirstRunConnectionChanged($event)\"\n [disabled]=\"firstRunInstalling\"\n placeholder=\"es. data source=localhost\\sqlexpress;User ID=sa;Password=...;initial catalog=WideWorldImporters\" />\n </div>\n\n <div class=\"first-run-field\">\n <p-button label=\"Test connessione e carica DB\" severity=\"secondary\" [outlined]=\"true\"\n [loading]=\"firstRunConnectionTesting\"\n [disabled]=\"firstRunInstalling || firstRunLoading || !firstRunForm.dataConnectionString\"\n (onClick)=\"testFirstRunConnectionAndLoadDatabases()\"></p-button>\n </div>\n\n @if (firstRunForm.setupMode === 'tutorial') {\n <div class=\"first-run-field\">\n <label for=\"first-run-datadb\">Database dati tutorial</label>\n <input id=\"first-run-datadb\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.tutorialDataDbName\"\n (ngModelChange)=\"firstRunForm.tutorialDataDbName = $event; firstRunForm.dataDbName = $event\"\n [disabled]=\"firstRunInstalling || !firstRunConnectionValid\"\n placeholder=\"WideWorldImporters\" />\n </div>\n } @else {\n <div class=\"first-run-field\">\n <label for=\"first-run-datadb\">Database dati</label>\n <p-select [options]=\"firstRunDataDbOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.dataDbName\" (ngModelChange)=\"firstRunForm.dataDbName = $event\"\n [disabled]=\"firstRunInstalling || firstRunDbLoading || !firstRunConnectionValid\" [filter]=\"true\"\n [editable]=\"true\" [style]=\"{ width: '100%' }\" inputId=\"first-run-datadb\"\n placeholder=\"Seleziona o digita database\"></p-select>\n <div style=\"margin-top: 0.5rem;\">\n <p-button label=\"Aggiorna elenco DB\" severity=\"secondary\" [outlined]=\"true\" size=\"small\"\n [loading]=\"firstRunDbLoading\" [disabled]=\"firstRunInstalling || !firstRunConnectionValid\"\n (onClick)=\"testFirstRunConnectionAndLoadDatabases()\"></p-button>\n </div>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-metadb\">@if (firstRunForm.setupMode === 'tutorial') {Nome DB metadati tutorial} @else {Nome DB metadati}</label>\n <input id=\"first-run-metadb\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.setupMode === 'tutorial' ? firstRunForm.tutorialMetadataDbName : firstRunForm.metadataDbName\"\n (ngModelChange)=\"firstRunForm.metadataDbName = $event; firstRunForm.tutorialMetadataDbName = $event\"\n [disabled]=\"firstRunInstalling\"\n placeholder=\"metadataDB\" />\n </div>\n\n @if (firstRunForm.setupMode !== 'tutorial') {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.scaffoldExistingDatabase\"\n (ngModelChange)=\"firstRunForm.scaffoldExistingDatabase = !!$event\"\n [disabled]=\"firstRunInstalling\" />\n Esegui scaffold automatico delle tabelle del DB selezionato\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Popola <code>_metadati__tabelle</code> / <code>_metadati__colonne</code> al termine dell'installazione.\n Operazione potenzialmente lunga su DB con molte tabelle.\n </small>\n </div>\n }\n </div>\n\n <!-- \u2500\u2500 COLONNA DESTRA: Admin + RAG \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"first-run-col\">\n\n <div class=\"first-run-section-title\">Utente admin iniziale</div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-username\">Username admin iniziale</label>\n <input id=\"first-run-admin-username\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.adminUsername\"\n (ngModelChange)=\"firstRunForm.adminUsername = $event\"\n [disabled]=\"firstRunInstalling\" autocomplete=\"off\"\n placeholder=\"admin\" />\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-password\">Password admin iniziale</label>\n <input id=\"first-run-admin-password\" class=\"first-run-input\" type=\"password\"\n [ngModel]=\"firstRunForm.adminPassword\"\n (ngModelChange)=\"firstRunForm.adminPassword = $event\"\n [disabled]=\"firstRunInstalling\" autocomplete=\"new-password\"\n placeholder=\"(min 4 caratteri)\" />\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-language\">Lingua admin iniziale</label>\n <p-select [options]=\"firstRunAdminLanguageOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.adminLanguage\"\n (ngModelChange)=\"firstRunForm.adminLanguage = $event\"\n [disabled]=\"firstRunInstalling\"\n [style]=\"{ width: '100%' }\" inputId=\"first-run-admin-language\"></p-select>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Lingua applicata all'utente admin dopo il primo login. Puoi cambiarla in seguito dal profilo utente.\n </small>\n </div>\n\n <div class=\"first-run-section-title first-run-section-title-rag\">RAG Chatbot (opzionale)</div>\n\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.installRag\"\n (ngModelChange)=\"firstRunForm.installRag = !!$event\"\n [disabled]=\"firstRunInstalling || !firstRunPythonInstalled\" />\n Installa e avvia il server RAG\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.installTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n @if (firstRunPythonInstalled && firstRunPythonSupported) {\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Python {{ firstRunPythonVersion || '3.12' }} rilevato \u2713. Al primo login post-wizard, crea <code>.venv</code>,\n installa torch + transformers + FastAPI, avvia il server su <code>:8765</code>.\n Richiede ~5-10 min + ~200 MB di download (CPU).\n </small>\n } @else if (firstRunPythonInstalled && !firstRunPythonSupported) {\n <div class=\"first-run-python-note\">\n <strong>\u24D8 Python {{ firstRunPythonVersion }} rilevato \u2014 versione non testata</strong>\n <div style=\"margin-top:4px;\">\n WUIC \u00E8 pinnato a <strong>Python 3.12.x</strong> (wheels torch / transformers / LoRA pi\u00F9 stabili).\n Procedere con <code>{{ firstRunPythonVersion }}</code> pu\u00F2 funzionare ma non \u00E8 testato:\n se <code>pip install torch</code> fallisce con \"no matching distribution\", installa\n <a href=\"https://www.python.org/downloads/release/python-3120/\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"first-run-python-warning-link\">Python 3.12</a>\n a fianco e metti la sua cartella prima di quella di {{ firstRunPythonVersion }} nel PATH.\n </div>\n </div>\n } @else {\n <div class=\"first-run-python-warning\">\n <strong>\u26A0 Python 3.12 non rilevato sul sistema</strong>\n <div style=\"margin-top:6px;\">\n Il setup RAG richiede Python 3.12. Lo zip di deploy include l'installer embeddable + uno script\n che fa tutto: estrae Python in <code>C:\\Python312</code>, installa pip, aggiorna PATH, riavvia IIS.\n </div>\n <ol style=\"margin:8px 0 4px 20px; padding:0;\">\n <li>\n Vai nella cartella dove hai estratto il deploy zip (dove c'\u00E8 <code>WuicCore.dll</code>).\n </li>\n <li>\n <strong>Right-click su <code>rag-setup.ps1</code> \u2192 \"Esegui come amministratore\"</strong>,\n oppure da pwsh-admin: <code>pwsh -ExecutionPolicy Bypass -File .\\rag-setup.ps1</code>.\n Lo script si auto-eleva via UAC se non gi\u00E0 elevato.\n </li>\n <li>\n Ricarica questa pagina (Ctrl+F5) \u2014 la checkbox si abilita automaticamente.\n </li>\n </ol>\n <div style=\"margin-top:4px; opacity:0.8;\">\n Lo script gestisce anche l'edge case GPO <code>DisableMSI</code> su Windows Server (usa il bundle\n embeddable zip, non MSI). Per il download manuale di Python da python.org:\n <a href=\"https://www.python.org/downloads/release/python-3120/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"first-run-python-warning-link\">\n python.org/downloads/release/python-3120/\n <i class=\"pi pi-external-link\" style=\"font-size:0.75rem; margin-left:3px;\"></i>\n </a>.\n Dettagli in <code>FIRST_STEPS.md</code> accanto al deploy. Il resto del setup (DB, admin user)\n pu\u00F2 procedere senza Python \u2014 installa il RAG dopo.\n </div>\n </div>\n }\n </div>\n\n @if (firstRunForm.installRag) {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.useCuda\"\n (ngModelChange)=\"firstRunForm.useCuda = !!$event\"\n [disabled]=\"firstRunInstalling\" />\n Usa CUDA (GPU NVIDIA)\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.cudaTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Attiva torch GPU (CUDA 12.1, ~2.5 GB download) invece di CPU (~200 MB).\n Richiede una GPU NVIDIA + driver CUDA installati lato sistema.\n </small>\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-anthropic-key\">\n Anthropic API Key (opzionale)\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.apiKeyTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n <textarea id=\"first-run-anthropic-key\" class=\"first-run-input first-run-textarea\"\n [ngModel]=\"firstRunForm.anthropicApiKey\"\n (ngModelChange)=\"firstRunForm.anthropicApiKey = $event\"\n [disabled]=\"firstRunInstalling\"\n rows=\"2\" autocomplete=\"off\"\n placeholder=\"sk-ant-...\"></textarea>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Senza chiave il server RAG funziona solo in modalit\u00E0 retrieval (ricerca snippet).\n Con chiave abilita la chat LLM via Claude.\n </small>\n </div>\n }\n </div>\n\n <!-- Crash reporting opt-in (skill crash-reporting Commit 8). Default OFF.\n Il consenso GDPR e' inline (testo breve + link). Quando flaggato,\n configure_wuic scrive `CrashReporting.Enabled=true` +\n DisclaimerAcceptedVersion=\"1.0\" in appsettings \u2014 equivalente al\n flusso appsettings-editor (Commit 9). -->\n <div class=\"first-run-section-title first-run-section-title-crash-reporting\">{{ 'crash_reporting.disclaimer.title' | translate }}</div>\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.enableCrashReporting\"\n (ngModelChange)=\"firstRunForm.enableCrashReporting = !!$event\"\n [disabled]=\"firstRunInstalling\" />\n {{ 'crash_reporting.disclaimer.checkbox_accept' | translate }}\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.85; font-size:0.85rem; line-height:1.45;\">\n {{ 'crash_reporting.disclaimer.intro' | translate }}\n </small>\n <small style=\"display:block; margin-top:6px; opacity:0.75; font-size:0.8rem; line-height:1.4;\">\n <strong>{{ 'crash_reporting.disclaimer.what_we_send' | translate }}</strong><br>\n {{ 'crash_reporting.disclaimer.what_we_dont_send' | translate }}<br>\n {{ 'crash_reporting.disclaimer.where_it_goes' | translate }}<br>\n {{ 'crash_reporting.disclaimer.retention' | translate }}<br>\n {{ 'crash_reporting.disclaimer.legal_basis' | translate }}<br>\n {{ 'crash_reporting.disclaimer.how_to_disable' | translate }}\n </small>\n </div>\n </div>\n\n </div><!-- /.first-run-body -->\n\n <!-- FOOTER sticky: error (se presente) + riga progress|CTA sempre visibile. -->\n <div class=\"first-run-footer\">\n @if (firstRunError && !firstRunErrorDismissed) {\n <div class=\"first-run-error\" role=\"alert\">\n <button type=\"button\"\n class=\"first-run-error__close\"\n (click)=\"dismissFirstRunError()\"\n aria-label=\"Chiudi errore\"\n title=\"Chiudi\">\u00D7</button>\n <div class=\"first-run-error__body\">{{ firstRunError }}</div>\n </div>\n }\n\n <div class=\"first-run-footer-row\">\n @if (firstRunInstalling && firstRunProgress.active) {\n <div class=\"first-run-progress\">\n <div class=\"first-run-progress-label\">\n <strong>{{ firstRunProgress.phase }}</strong>\n @if (firstRunProgress.total > 0 && !firstRunProgress.phase.includes('.restore')) {\n <span class=\"first-run-progress-count\">\n \u2014 batch {{ firstRunProgress.current }} / {{ firstRunProgress.total }}\n </span>\n }\n @if (firstRunProgress.elapsedMs > 0) {\n <span class=\"first-run-progress-count\">\n \u00B7 {{ (firstRunProgress.elapsedMs / 1000) | number:'1.0-0' }}s\n </span>\n }\n </div>\n @if (firstRunProgress.phase.includes('.restore') && firstRunProgress.percent < 5) {\n <p-progressBar mode=\"indeterminate\" [style]=\"{'height': '1rem'}\"></p-progressBar>\n } @else {\n <p-progressBar [value]=\"firstRunProgress.percent\" [showValue]=\"true\" [style]=\"{'height': '1rem'}\"></p-progressBar>\n }\n @if (firstRunProgress.message) {\n <div class=\"first-run-progress-message\">{{ firstRunProgress.message }}</div>\n }\n </div>\n } @else {\n <div class=\"first-run-progress-placeholder\"></div>\n }\n\n <div class=\"first-run-actions\">\n <p-button label=\"Conferma e genera metadataDB\" [loading]=\"firstRunInstalling\"\n [disabled]=\"firstRunInstalling || firstRunLoading\" (onClick)=\"submitFirstRunInstall()\"></p-button>\n </div>\n </div>\n </div>\n </div>\n</div>\n}\n", styles: [".first-run-overlay{position:fixed;inset:0;z-index:900;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(135deg,#081221d9,#16294acc)}.first-run-card-wide{width:min(1180px,100%)!important}.first-run-card{width:min(860px,100%);min-height:min(720px,100vh - 48px);max-height:calc(100vh - 48px);display:flex;flex-direction:column;overflow:hidden;border-radius:14px;padding:22px;background:var(--p-surface-0);box-shadow:0 18px 48px #00000059;border:1px solid var(--p-content-border-color)}.first-run-body{flex:1 1 auto;min-height:0;overflow-y:auto;padding-right:4px;margin-right:-4px}.first-run-footer{flex:0 0 auto;margin-top:12px;padding-top:12px;border-top:1px solid var(--p-content-border-color);display:flex;flex-direction:column;gap:10px}.first-run-footer-row{display:flex;align-items:center;gap:16px}.first-run-title{font-size:1.25rem;font-weight:700}.first-run-subtitle{margin-top:6px;margin-bottom:18px;opacity:.8}.first-run-field{margin-bottom:14px}.first-run-field label{display:block;margin-bottom:6px;font-weight:600}.first-run-checkbox-row label{display:inline-flex;align-items:center;gap:.5rem;margin-bottom:0;font-weight:500}.first-run-input{width:100%;height:40px;border-radius:8px;border:1px solid var(--p-content-border-color);padding:8px 12px;font-size:.95rem;background:var(--p-surface-0);color:var(--p-text-color)}.first-run-textarea{height:auto;min-height:56px;resize:vertical;font-family:var(--p-font-family);line-height:1.4}.first-run-grid{display:grid;grid-template-columns:1fr 1fr;column-gap:28px;row-gap:0}@media(max-width:860px){.first-run-grid{grid-template-columns:1fr}}.first-run-col{display:flex;flex-direction:column;min-width:0}.first-run-section-title{margin-top:4px;margin-bottom:12px;padding-bottom:6px;font-size:.95rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;opacity:.8;border-bottom:1px solid var(--p-content-border-color)}.first-run-section-title-rag{margin-top:18px}.first-run-python-warning{margin-top:8px;padding:10px 12px;background:#fef3c7;border:1px solid #fcd34d;border-radius:6px;color:#78350f;font-size:.85rem;line-height:1.4}.first-run-python-warning strong{color:#78350f}.first-run-python-warning code{background:#00000014;padding:1px 4px;border-radius:3px;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.82rem}.first-run-python-warning ol li+li{margin-top:4px}.first-run-python-warning-link{color:#92400e;text-decoration:underline;font-weight:600}.first-run-python-warning-link:hover{color:#78350f}.first-run-python-warning-link:visited{color:#92400e}.first-run-python-note{margin-top:8px;padding:10px 12px;background:#dbeafe;border:1px solid #93c5fd;border-radius:6px;color:#1e3a8a;font-size:.85rem;line-height:1.4}.first-run-python-note strong{color:#1e3a8a}.first-run-python-note code{background:#00000014;padding:1px 4px;border-radius:3px;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.82rem}.first-run-info-icon{margin-left:6px;font-size:.95rem;color:var(--p-primary-color, #3b82f6);cursor:help;vertical-align:middle;opacity:.85}.first-run-info-icon:hover{opacity:1}::ng-deep .p-tooltip.first-run-tooltip{max-width:440px}::ng-deep .p-tooltip.first-run-tooltip .p-tooltip-text{white-space:pre-line;font-size:.85rem;line-height:1.45}.first-run-input:focus{outline:2px solid rgba(59,130,246,.25);border-color:#3b82f6}.first-run-error{position:relative;margin:8px 0 14px;color:#7f1d1d;background:#fee2e2;border:1px solid #fca5a5;border-radius:8px;padding:10px 36px 10px 12px}.first-run-error__body{max-height:200px;overflow-y:auto;word-break:break-word;white-space:pre-wrap;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.85rem;line-height:1.4}.first-run-error__close{position:absolute;top:6px;right:8px;width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0;background:transparent;border:0;border-radius:4px;color:inherit;font-size:1.25rem;line-height:1;cursor:pointer;opacity:.75;transition:background-color .12s ease,opacity .12s ease}.first-run-error__close:hover,.first-run-error__close:focus-visible{opacity:1;background:#7f1d1d1f;outline:none}.first-run-error__close:active{background:#7f1d1d33}.first-run-actions{flex:0 0 auto;display:flex;justify-content:flex-end}.first-run-progress{flex:1 1 auto;min-width:0;padding:8px 12px;background:var(--p-surface-50);border:1px solid var(--p-content-border-color);border-radius:8px;display:flex;flex-direction:column;gap:4px}.first-run-progress-placeholder{flex:1 1 auto;min-width:0}.first-run-progress-label{font-size:.9rem}.first-run-progress-label strong{font-weight:600}.first-run-progress-label .first-run-progress-count{opacity:.7;margin-left:4px}.first-run-progress-message{font-size:.8rem;opacity:.75;font-family:ui-monospace,Cascadia Code,Consolas,monospace}\n"] }]
|
|
1312
|
+
TooltipModule,
|
|
1313
|
+
DialogModule
|
|
1314
|
+
], changeDetection: ChangeDetectionStrategy.Default, template: "@if (showFirstRunInstall) {\n<div class=\"first-run-overlay\">\n <div class=\"first-run-card first-run-card-wide\">\n <div class=\"first-run-title\">Configurazione iniziale progetto</div>\n <div class=\"first-run-subtitle\">Seleziona DBMS, connessione dati e nome database metadati.</div>\n\n <!-- BODY scrollabile: header (title/subtitle) e footer (progress + CTA)\n restano sempre visibili, solo questo blocco scrolla quando il form\n e' piu' alto della viewport. -->\n <div class=\"first-run-body\">\n\n <!-- Grid 2 colonne: sx = connessione + scaffold / dx = admin + RAG.\n Su viewport stretti (< 720px) il grid collassa a 1 colonna. -->\n <div class=\"first-run-grid\">\n\n <!-- \u2500\u2500 COLONNA SINISTRA: Database + Setup \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"first-run-col\">\n\n @if (firstRunSetupModeOptions.length > 1) {\n <div class=\"first-run-field\">\n <label for=\"first-run-mode\">Modalit\u00E0 setup</label>\n <p-select [options]=\"firstRunSetupModeOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.setupMode\" (ngModelChange)=\"onFirstRunSetupModeChanged($event)\"\n [disabled]=\"firstRunInstalling\" [style]=\"{ width: '100%' }\" inputId=\"first-run-mode\"></p-select>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-dbms\">DBMS</label>\n <p-select [options]=\"firstRunDbmsOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.dbms\" (ngModelChange)=\"onFirstRunDbmsChanged($event)\"\n [disabled]=\"firstRunInstalling\" [style]=\"{ width: '100%' }\" inputId=\"first-run-dbms\"></p-select>\n </div>\n\n @if (firstRunForm.setupMode === 'tutorial') {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.createTutorialIfMissing\"\n (ngModelChange)=\"firstRunForm.createTutorialIfMissing = !!$event\" [disabled]=\"firstRunInstalling\" />\n Crea tutorial se manca\n </label>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-datasql\">DataSQLConnection</label>\n <input id=\"first-run-datasql\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.dataConnectionString\" (ngModelChange)=\"onFirstRunConnectionChanged($event)\"\n [disabled]=\"firstRunInstalling\"\n placeholder=\"es. data source=localhost\\sqlexpress;User ID=sa;Password=...;initial catalog=WideWorldImporters\" />\n </div>\n\n <div class=\"first-run-field\">\n <p-button label=\"Test connessione e carica DB\" severity=\"secondary\" [outlined]=\"true\"\n [loading]=\"firstRunConnectionTesting\"\n [disabled]=\"firstRunInstalling || firstRunLoading || !firstRunForm.dataConnectionString\"\n (onClick)=\"testFirstRunConnectionAndLoadDatabases()\"></p-button>\n </div>\n\n @if (firstRunForm.setupMode === 'tutorial') {\n <div class=\"first-run-field\">\n <label for=\"first-run-datadb\">Database dati tutorial</label>\n <input id=\"first-run-datadb\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.tutorialDataDbName\"\n (ngModelChange)=\"firstRunForm.tutorialDataDbName = $event; firstRunForm.dataDbName = $event\"\n [disabled]=\"firstRunInstalling || !firstRunConnectionValid\"\n placeholder=\"WideWorldImporters\" />\n </div>\n } @else {\n <div class=\"first-run-field\">\n <label for=\"first-run-datadb\">Database dati</label>\n <p-select [options]=\"firstRunDataDbOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.dataDbName\" (ngModelChange)=\"firstRunForm.dataDbName = $event\"\n [disabled]=\"firstRunInstalling || firstRunDbLoading || !firstRunConnectionValid\" [filter]=\"true\"\n [editable]=\"true\" [style]=\"{ width: '100%' }\" inputId=\"first-run-datadb\"\n placeholder=\"Seleziona o digita database\"></p-select>\n <div style=\"margin-top: 0.5rem;\">\n <p-button label=\"Aggiorna elenco DB\" severity=\"secondary\" [outlined]=\"true\" size=\"small\"\n [loading]=\"firstRunDbLoading\" [disabled]=\"firstRunInstalling || !firstRunConnectionValid\"\n (onClick)=\"testFirstRunConnectionAndLoadDatabases()\"></p-button>\n </div>\n </div>\n }\n\n <div class=\"first-run-field\">\n <label for=\"first-run-metadb\">@if (firstRunForm.setupMode === 'tutorial') {Nome DB metadati tutorial} @else {Nome DB metadati}</label>\n <input id=\"first-run-metadb\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.setupMode === 'tutorial' ? firstRunForm.tutorialMetadataDbName : firstRunForm.metadataDbName\"\n (ngModelChange)=\"firstRunForm.metadataDbName = $event; firstRunForm.tutorialMetadataDbName = $event\"\n [disabled]=\"firstRunInstalling\"\n placeholder=\"metadataDB\" />\n </div>\n\n @if (firstRunForm.setupMode !== 'tutorial') {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.scaffoldExistingDatabase\"\n (ngModelChange)=\"firstRunForm.scaffoldExistingDatabase = !!$event\"\n [disabled]=\"firstRunInstalling\" />\n Esegui scaffold automatico delle tabelle del DB selezionato\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Popola <code>_metadati__tabelle</code> / <code>_metadati__colonne</code> al termine dell'installazione.\n Operazione potenzialmente lunga su DB con molte tabelle.\n </small>\n </div>\n }\n </div>\n\n <!-- \u2500\u2500 COLONNA DESTRA: Admin + RAG \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"first-run-col\">\n\n <div class=\"first-run-section-title\">Utente admin iniziale</div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-username\">Username admin iniziale</label>\n <input id=\"first-run-admin-username\" class=\"first-run-input\" type=\"text\"\n [ngModel]=\"firstRunForm.adminUsername\"\n (ngModelChange)=\"firstRunForm.adminUsername = $event\"\n [disabled]=\"firstRunInstalling\" autocomplete=\"off\"\n placeholder=\"admin\" />\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-password\">Password admin iniziale</label>\n <input id=\"first-run-admin-password\" class=\"first-run-input\" type=\"password\"\n [ngModel]=\"firstRunForm.adminPassword\"\n (ngModelChange)=\"firstRunForm.adminPassword = $event\"\n [disabled]=\"firstRunInstalling\" autocomplete=\"new-password\"\n placeholder=\"(min 4 caratteri)\" />\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-admin-language\">Lingua admin iniziale</label>\n <p-select [options]=\"firstRunAdminLanguageOptions\" optionLabel=\"label\" optionValue=\"value\"\n [ngModel]=\"firstRunForm.adminLanguage\"\n (ngModelChange)=\"firstRunForm.adminLanguage = $event\"\n [disabled]=\"firstRunInstalling\"\n [style]=\"{ width: '100%' }\" inputId=\"first-run-admin-language\"></p-select>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Lingua applicata all'utente admin dopo il primo login. Puoi cambiarla in seguito dal profilo utente.\n </small>\n </div>\n\n <div class=\"first-run-section-title first-run-section-title-rag\">RAG Chatbot (opzionale)</div>\n\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.installRag\"\n (ngModelChange)=\"firstRunForm.installRag = !!$event\"\n [disabled]=\"firstRunInstalling || !firstRunPythonInstalled\" />\n Installa e avvia il server RAG\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.installTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n @if (firstRunPythonInstalled && firstRunPythonSupported) {\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Python {{ firstRunPythonVersion || '3.12' }} rilevato \u2713. Al primo login post-wizard, crea <code>.venv</code>,\n installa torch + transformers + FastAPI, avvia il server su <code>:8765</code>.\n Richiede ~5-10 min + ~200 MB di download (CPU).\n </small>\n } @else if (firstRunPythonInstalled && !firstRunPythonSupported) {\n <div class=\"first-run-python-note\">\n <strong>\u24D8 Python {{ firstRunPythonVersion }} rilevato \u2014 versione non testata</strong>\n <div style=\"margin-top:4px;\">\n WUIC \u00E8 pinnato a <strong>Python 3.12.x</strong> (wheels torch / transformers / LoRA pi\u00F9 stabili).\n Procedere con <code>{{ firstRunPythonVersion }}</code> pu\u00F2 funzionare ma non \u00E8 testato:\n se <code>pip install torch</code> fallisce con \"no matching distribution\", installa\n <a href=\"https://www.python.org/downloads/release/python-3120/\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"first-run-python-warning-link\">Python 3.12</a>\n a fianco e metti la sua cartella prima di quella di {{ firstRunPythonVersion }} nel PATH.\n </div>\n </div>\n } @else {\n <div class=\"first-run-python-warning\">\n <strong>\u26A0 Python 3.12 non rilevato sul sistema</strong>\n <div style=\"margin-top:6px;\">\n Il setup RAG richiede Python 3.12. Lo zip di deploy include l'installer embeddable + uno script\n che fa tutto: estrae Python in <code>C:\\Python312</code>, installa pip, aggiorna PATH, riavvia IIS.\n </div>\n <ol style=\"margin:8px 0 4px 20px; padding:0;\">\n <li>\n Vai nella cartella dove hai estratto il deploy zip (dove c'\u00E8 <code>WuicCore.dll</code>).\n </li>\n <li>\n <strong>Right-click su <code>rag-setup.ps1</code> \u2192 \"Esegui come amministratore\"</strong>,\n oppure da pwsh-admin: <code>pwsh -ExecutionPolicy Bypass -File .\\rag-setup.ps1</code>.\n Lo script si auto-eleva via UAC se non gi\u00E0 elevato.\n </li>\n <li>\n Ricarica questa pagina (Ctrl+F5) \u2014 la checkbox si abilita automaticamente.\n </li>\n </ol>\n <div style=\"margin-top:4px; opacity:0.8;\">\n Lo script gestisce anche l'edge case GPO <code>DisableMSI</code> su Windows Server (usa il bundle\n embeddable zip, non MSI). Per il download manuale di Python da python.org:\n <a href=\"https://www.python.org/downloads/release/python-3120/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"first-run-python-warning-link\">\n python.org/downloads/release/python-3120/\n <i class=\"pi pi-external-link\" style=\"font-size:0.75rem; margin-left:3px;\"></i>\n </a>.\n Dettagli in <code>FIRST_STEPS.md</code> accanto al deploy. Il resto del setup (DB, admin user)\n pu\u00F2 procedere senza Python \u2014 installa il RAG dopo.\n </div>\n </div>\n }\n </div>\n\n @if (firstRunForm.installRag) {\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.useCuda\"\n (ngModelChange)=\"firstRunForm.useCuda = !!$event\"\n [disabled]=\"firstRunInstalling\" />\n Usa CUDA (GPU NVIDIA)\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.cudaTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Attiva torch GPU (CUDA 12.1, ~2.5 GB download) invece di CPU (~200 MB).\n Richiede una GPU NVIDIA + driver CUDA installati lato sistema.\n </small>\n </div>\n\n <div class=\"first-run-field\">\n <label for=\"first-run-anthropic-key\">\n Anthropic API Key (opzionale)\n <i class=\"pi pi-info-circle first-run-info-icon\"\n [pTooltip]=\"'firstrun.rag.apiKeyTooltip' | translate\"\n tooltipPosition=\"right\"\n [tooltipStyleClass]=\"'first-run-tooltip'\"\n [escape]=\"false\"></i>\n </label>\n <textarea id=\"first-run-anthropic-key\" class=\"first-run-input first-run-textarea\"\n [ngModel]=\"firstRunForm.anthropicApiKey\"\n (ngModelChange)=\"firstRunForm.anthropicApiKey = $event\"\n [disabled]=\"firstRunInstalling\"\n rows=\"2\" autocomplete=\"off\"\n placeholder=\"sk-ant-...\"></textarea>\n <small style=\"display:block; margin-top:4px; opacity:0.75; font-size:0.8rem; line-height:1.35;\">\n Senza chiave il server RAG funziona solo in modalit\u00E0 retrieval (ricerca snippet).\n Con chiave abilita la chat LLM via Claude.\n </small>\n </div>\n }\n </div>\n\n <!-- Crash reporting opt-in (skill crash-reporting Commit 8). Default OFF.\n Il consenso GDPR usa labels HARDCODED in `crashReportingLabels`\n dentro il componente (NON `wuic_translation`) perche' il\n first-run gira PRIMA che il DB metadati esista \u2014 niente DB,\n niente translation table. Vedi commento esteso nel componente.\n Al check del consenso si apre il popup col disclaimer\n dettagliato; l'utente conferma li' per attivare il flag. -->\n <div class=\"first-run-section-title first-run-section-title-crash-reporting\">{{ crashReportingLabels.title }}</div>\n <div class=\"first-run-field first-run-checkbox-row\">\n <label>\n <input type=\"checkbox\" [ngModel]=\"firstRunForm.enableCrashReporting\"\n (ngModelChange)=\"onCrashReportingToggle($event)\"\n [disabled]=\"firstRunInstalling\" />\n {{ crashReportingLabels.checkbox_accept }}\n </label>\n <small style=\"display:block; margin-top:4px; opacity:0.85; font-size:0.85rem; line-height:1.45;\">\n {{ crashReportingLabels.intro_short }}\n <a href=\"javascript:void(0)\" (click)=\"openCrashReportingDisclaimer()\"\n style=\"margin-left:6px;\">{{ crashReportingLabels.read_full }}</a>\n </small>\n </div>\n </div>\n\n <!-- Disclaimer GDPR popup (apre al check + da link \"leggi tutto\"). -->\n <p-dialog [(visible)]=\"crashReportingDisclaimerVisible\"\n [modal]=\"true\"\n [closable]=\"true\"\n [closeOnEscape]=\"true\"\n [header]=\"crashReportingLabels.title\"\n [style]=\"{ width: '600px', maxWidth: '90vw' }\"\n [contentStyle]=\"{ 'max-height': '70vh', 'overflow-y': 'auto' }\"\n [appendTo]=\"'body'\">\n <div style=\"line-height:1.55;\">\n <p>{{ crashReportingLabels.intro }}</p>\n <p><strong>{{ crashReportingLabels.what_we_send }}</strong></p>\n <ul style=\"margin:0 0 8px 18px; padding:0;\">\n <li>{{ crashReportingLabels.what_we_dont_send }}</li>\n <li>{{ crashReportingLabels.where_it_goes }}</li>\n <li>{{ crashReportingLabels.retention }}</li>\n <li>{{ crashReportingLabels.legal_basis }}</li>\n <li>{{ crashReportingLabels.how_to_disable }}</li>\n </ul>\n </div>\n <ng-template pTemplate=\"footer\">\n <p-button [label]=\"crashReportingLabels.btn_decline\"\n severity=\"secondary\"\n (onClick)=\"declineCrashReporting()\"></p-button>\n <p-button [label]=\"crashReportingLabels.btn_accept\"\n (onClick)=\"acceptCrashReporting()\"></p-button>\n </ng-template>\n </p-dialog>\n\n </div><!-- /.first-run-body -->\n\n <!-- FOOTER sticky: error (se presente) + riga progress|CTA sempre visibile. -->\n <div class=\"first-run-footer\">\n @if (firstRunError && !firstRunErrorDismissed) {\n <div class=\"first-run-error\" role=\"alert\">\n <button type=\"button\"\n class=\"first-run-error__close\"\n (click)=\"dismissFirstRunError()\"\n aria-label=\"Chiudi errore\"\n title=\"Chiudi\">\u00D7</button>\n <div class=\"first-run-error__body\">{{ firstRunError }}</div>\n </div>\n }\n\n <div class=\"first-run-footer-row\">\n @if (firstRunInstalling && firstRunProgress.active) {\n <div class=\"first-run-progress\">\n <div class=\"first-run-progress-label\">\n <strong>{{ firstRunProgress.phase }}</strong>\n @if (firstRunProgress.total > 0 && !firstRunProgress.phase.includes('.restore')) {\n <span class=\"first-run-progress-count\">\n \u2014 batch {{ firstRunProgress.current }} / {{ firstRunProgress.total }}\n </span>\n }\n @if (firstRunProgress.elapsedMs > 0) {\n <span class=\"first-run-progress-count\">\n \u00B7 {{ (firstRunProgress.elapsedMs / 1000) | number:'1.0-0' }}s\n </span>\n }\n </div>\n @if (firstRunProgress.phase.includes('.restore') && firstRunProgress.percent < 5) {\n <p-progressBar mode=\"indeterminate\" [style]=\"{'height': '1rem'}\"></p-progressBar>\n } @else {\n <p-progressBar [value]=\"firstRunProgress.percent\" [showValue]=\"true\" [style]=\"{'height': '1rem'}\"></p-progressBar>\n }\n @if (firstRunProgress.message) {\n <div class=\"first-run-progress-message\">{{ firstRunProgress.message }}</div>\n }\n </div>\n } @else {\n <div class=\"first-run-progress-placeholder\"></div>\n }\n\n <div class=\"first-run-actions\">\n <p-button label=\"Conferma e genera metadataDB\" [loading]=\"firstRunInstalling\"\n [disabled]=\"firstRunInstalling || firstRunLoading\" (onClick)=\"submitFirstRunInstall()\"></p-button>\n </div>\n </div>\n </div>\n </div>\n</div>\n}\n", styles: [".first-run-overlay{position:fixed;inset:0;z-index:900;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(135deg,#081221d9,#16294acc)}.first-run-card-wide{width:min(1180px,100%)!important}.first-run-card{width:min(860px,100%);min-height:min(720px,100vh - 48px);max-height:calc(100vh - 48px);display:flex;flex-direction:column;overflow:hidden;border-radius:14px;padding:22px;background:var(--p-surface-0);box-shadow:0 18px 48px #00000059;border:1px solid var(--p-content-border-color)}.first-run-body{flex:1 1 auto;min-height:0;overflow-y:auto;padding-right:4px;margin-right:-4px}.first-run-footer{flex:0 0 auto;margin-top:12px;padding-top:12px;border-top:1px solid var(--p-content-border-color);display:flex;flex-direction:column;gap:10px}.first-run-footer-row{display:flex;align-items:center;gap:16px}.first-run-title{font-size:1.25rem;font-weight:700}.first-run-subtitle{margin-top:6px;margin-bottom:18px;opacity:.8}.first-run-field{margin-bottom:14px}.first-run-field label{display:block;margin-bottom:6px;font-weight:600}.first-run-checkbox-row label{display:inline-flex;align-items:center;gap:.5rem;margin-bottom:0;font-weight:500}.first-run-input{width:100%;height:40px;border-radius:8px;border:1px solid var(--p-content-border-color);padding:8px 12px;font-size:.95rem;background:var(--p-surface-0);color:var(--p-text-color)}.first-run-textarea{height:auto;min-height:56px;resize:vertical;font-family:var(--p-font-family);line-height:1.4}.first-run-grid{display:grid;grid-template-columns:1fr 1fr;column-gap:28px;row-gap:0}@media(max-width:860px){.first-run-grid{grid-template-columns:1fr}}.first-run-col{display:flex;flex-direction:column;min-width:0}.first-run-section-title{margin-top:4px;margin-bottom:12px;padding-bottom:6px;font-size:.95rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;opacity:.8;border-bottom:1px solid var(--p-content-border-color)}.first-run-section-title-rag{margin-top:18px}.first-run-python-warning{margin-top:8px;padding:10px 12px;background:#fef3c7;border:1px solid #fcd34d;border-radius:6px;color:#78350f;font-size:.85rem;line-height:1.4}.first-run-python-warning strong{color:#78350f}.first-run-python-warning code{background:#00000014;padding:1px 4px;border-radius:3px;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.82rem}.first-run-python-warning ol li+li{margin-top:4px}.first-run-python-warning-link{color:#92400e;text-decoration:underline;font-weight:600}.first-run-python-warning-link:hover{color:#78350f}.first-run-python-warning-link:visited{color:#92400e}.first-run-python-note{margin-top:8px;padding:10px 12px;background:#dbeafe;border:1px solid #93c5fd;border-radius:6px;color:#1e3a8a;font-size:.85rem;line-height:1.4}.first-run-python-note strong{color:#1e3a8a}.first-run-python-note code{background:#00000014;padding:1px 4px;border-radius:3px;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.82rem}.first-run-info-icon{margin-left:6px;font-size:.95rem;color:var(--p-primary-color, #3b82f6);cursor:help;vertical-align:middle;opacity:.85}.first-run-info-icon:hover{opacity:1}::ng-deep .p-tooltip.first-run-tooltip{max-width:440px}::ng-deep .p-tooltip.first-run-tooltip .p-tooltip-text{white-space:pre-line;font-size:.85rem;line-height:1.45}.first-run-input:focus{outline:2px solid rgba(59,130,246,.25);border-color:#3b82f6}.first-run-error{position:relative;margin:8px 0 14px;color:#7f1d1d;background:#fee2e2;border:1px solid #fca5a5;border-radius:8px;padding:10px 36px 10px 12px}.first-run-error__body{max-height:200px;overflow-y:auto;word-break:break-word;white-space:pre-wrap;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:.85rem;line-height:1.4}.first-run-error__close{position:absolute;top:6px;right:8px;width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0;background:transparent;border:0;border-radius:4px;color:inherit;font-size:1.25rem;line-height:1;cursor:pointer;opacity:.75;transition:background-color .12s ease,opacity .12s ease}.first-run-error__close:hover,.first-run-error__close:focus-visible{opacity:1;background:#7f1d1d1f;outline:none}.first-run-error__close:active{background:#7f1d1d33}.first-run-actions{flex:0 0 auto;display:flex;justify-content:flex-end}.first-run-progress{flex:1 1 auto;min-width:0;padding:8px 12px;background:var(--p-surface-50);border:1px solid var(--p-content-border-color);border-radius:8px;display:flex;flex-direction:column;gap:4px}.first-run-progress-placeholder{flex:1 1 auto;min-width:0}.first-run-progress-label{font-size:.9rem}.first-run-progress-label strong{font-weight:600}.first-run-progress-label .first-run-progress-count{opacity:.7;margin-left:4px}.first-run-progress-message{font-size:.8rem;opacity:.75;font-family:ui-monospace,Cascadia Code,Consolas,monospace}\n"] }]
|
|
1109
1315
|
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.TranslateService }, { type: i3.MessageService }, { type: i0.Injector }], propDecorators: { complete: [{
|
|
1110
1316
|
type: Output
|
|
1111
1317
|
}] } });
|
|
1112
1318
|
|
|
1113
1319
|
export { WuicFirstRunWizardComponent };
|
|
1114
|
-
//# sourceMappingURL=wuic-framework-lib-first-run-wizard.component-
|
|
1320
|
+
//# sourceMappingURL=wuic-framework-lib-first-run-wizard.component-wR_LrvPK.mjs.map
|