-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathadmin_settings.html
More file actions
3447 lines (3096 loc) · 213 KB
/
admin_settings.html
File metadata and controls
3447 lines (3096 loc) · 213 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{% extends "base.html" %}
{% block title %}
Admin Settings - {{ app_settings.app_title }}
{% endblock %}
{% block head %}
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/simplemde/dist/simplemde.min.css">
LOCAL VERSION BELOW
-->
<link rel="stylesheet" href="/static/css/simplemde.min.css">
<style>
/* Style for the color swatch in the table */
.color-swatch-container {
display: flex;
align-items: center;
}
.color-input-swatch {
display: inline-block;
width: 25px;
height: 25px;
border: 1px solid #ccc;
border-radius: 4px;
cursor: pointer;
vertical-align: middle;
margin-right: 8px;
}
/* Hide the actual color input visually but keep it functional */
.classification-color-input {
opacity: 0;
width: 0;
height: 0;
padding: 0;
border: none;
position: absolute;
}
/* Ensure table cells have consistent vertical alignment */
#classification-categories-tbody td {
vertical-align: middle;
}
/* Ensure external links table cells have consistent vertical alignment */
#external-links-tbody td {
vertical-align: middle;
}
/* Floating Save Button */
.floating-save-btn {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 1050;
padding: 12px 20px;
font-size: 16px;
font-weight: 600;
border-radius: 50px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
transition: all 0.3s ease;
min-width: 160px;
}
.floating-save-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.floating-save-btn:active {
transform: translateY(0);
}
/* Ensure the button is visible above other content */
.floating-save-btn {
backdrop-filter: blur(10px);
}
/* Responsive adjustments */
@media (max-width: 768px) {
.floating-save-btn {
bottom: 15px;
right: 15px;
padding: 10px 16px;
font-size: 14px;
min-width: 140px;
}
}
</style>
{% endblock %}
{% block content %}
<div id="index-warning-user" class="alert alert-warning" style="display:none;">
<strong>⚠️ User-index schema mismatch:</strong>
Missing fields: <span id="missing-fields-user"></span>
<button id="fix-user-index-btn" class="btn btn-sm btn-primary ms-2">Add missing user-fields</button>
</div>
<div id="index-warning-group" class="alert alert-warning" style="display:none;">
<strong>⚠️ Group-index schema mismatch:</strong>
Missing fields: <span id="missing-fields-group"></span>
<button id="fix-group-index-btn" class="btn btn-sm btn-primary ms-2">Add missing group-fields</button>
</div>
<div id="index-warning-public" class="alert alert-warning" style="display:none;">
<strong>⚠️ Public-index schema mismatch:</strong>
Missing fields: <span id="missing-fields-public"></span>
<button id="fix-public-index-btn" class="btn btn-sm btn-primary ms-2">Add missing public-fields</button>
</div>
<!-- Flash messages display section -->
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<div class="container">
<h2>Admin Settings</h2>
<form method="post" enctype="multipart/form-data" id="admin-settings-form" style="padding-bottom:80px;">
<p class="text-muted">Use this form to configure the administrative settings for your application.</p>
<p class="text-muted">
Version: {{ config['VERSION'] }}
{% if update_available %}
<span class="ms-2 badge bg-warning text-dark align-middle">
New version available, v{{ latest_version }}.
<a href="{{ download_url }}" target="_blank" rel="noopener noreferrer" class="link-primary text-decoration-underline">Download here</a>.
</span>
{% endif %}
</p>
<div class="d-flex align-items-center mb-3">
<button type="button" class="btn btn-outline-secondary mt-3" id="launch-walkthrough-btn">
<i class="bi bi-signpost-split"></i> Start Setup Walkthrough
</button>
</div>
<!-- Settings Walkthrough Inline Container -->
<div id="settings-walkthrough-container" class="card mb-4 shadow-sm" style="display: none;">
<div class="card-header bg-primary text-white d-flex justify-content-between align-items-center">
<h5 class="mb-0">Setup Walkthrough</h5>
<button type="button" class="btn-close btn-close-white" id="close-walkthrough-btn" aria-label="Close"></button>
</div>
<div class="card-body">
<!-- Progress bar -->
<div class="progress mb-4" style="height: 8px;">
<div id="walkthrough-progress" class="progress-bar bg-primary" role="progressbar" style="width: 8%;" aria-valuenow="1" aria-valuemin="0" aria-valuemax="12"></div>
</div>
<!-- Step content area -->
<div id="walkthrough-step-content">
<!-- Step 1: App Title and Logo -->
<div id="walkthrough-step-1" class="walkthrough-step">
<h4>1. Configure Application Basics</h4>
<p class="text-muted">Let's set up your Simple Chat instance. Let's start with some basic configuration options.</p>
<div class="alert alert-info">
<strong>Optional:</strong> Configure your application title and logo.
</div>
<ul class="list-group mb-4">
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Application Title</span>
<span class="badge bg-secondary">Optional</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Custom Logos (Light & Dark Mode)</span>
<span class="badge bg-secondary">Optional</span>
</li>
</ul>
<p>Use the <strong>General</strong> tab to configure these settings.</p>
</div>
<!-- Step 2: Configure GPT Settings -->
<div id="walkthrough-step-2" class="walkthrough-step" style="display: none;">
<h4>2. Configure GPT API Settings</h4>
<p class="text-muted">Configure the Azure OpenAI GPT API settings.</p>
<div class="alert alert-danger">
<strong>Required:</strong> GPT API configuration is required for Simple Chat to function.
</div>
<ul class="list-group mb-4">
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>GPT Endpoint</span>
<span class="badge bg-danger">Required</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Authentication</span>
<span class="badge bg-danger">Required</span>
</li>
</ul>
<div class="alert alert-info">
<strong>API Management Option:</strong> You can configure a direct connection to Azure OpenAI or use Azure API Management (APIM).
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="APIM provides an additional layer for security, monitoring, and rate limiting. Use APIM when you need centralized API governance or want to isolate direct access to your Azure OpenAI resources."></i>
</div>
<p>Configure GPT API settings in the <strong>GPT</strong> tab.</p>
</div>
<!-- Step 3: Select GPT Models -->
<div id="walkthrough-step-3" class="walkthrough-step" style="display: none;">
<h4>3. Select GPT Models</h4>
<p class="text-muted">Now that you've configured the GPT API settings, fetch and select the GPT models to use.</p>
<div class="alert alert-danger">
<strong>Required:</strong> Select at least one GPT model for users to use.
</div>
<p class="mb-4">
<ol>
<li id="fetch-models-step">Click the <strong>"Fetch GPT Models"</strong> button to retrieve available models</li>
<li>Select one or more models from the list</li>
</ol>
</p>
<div class="alert alert-info" id="apim-model-note" style="display: none;">
<strong>APIM Configuration:</strong> When using APIM, enter model names directly in the "Azure APIM Deployment" field (e.g., "gpt-4o, gpt-35-turbo"). Fetching models is not available with APIM.
</div>
<div class="alert alert-info">
<strong>Note:</strong> Ensure the Service Principal has been assigned the Cognitive Service OpenAI User role on the Azure OpenAI endpoint.
</div>
</div>
<!-- Step 4: Workspaces -->
<div id="walkthrough-step-4" class="walkthrough-step" style="display: none;">
<h4>4. Configure Workspaces</h4>
<p class="text-muted">Enable workspace features for your users.</p>
<div class="alert alert-info">
<strong>Optional:</strong> Enable personal and group workspaces for document management.
</div>
<ul class="list-group mb-4">
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Personal Workspaces</span>
<span class="badge bg-secondary">Optional</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Group Workspaces</span>
<span class="badge bg-secondary">Optional</span>
</li>
</ul>
<p class="alert alert-warning">
<strong>Important:</strong> If you enable either workspace feature, you will need to configure additional services in the next steps.
</p>
</div>
<!-- Step 5: Embedding Settings -->
<div id="walkthrough-step-5" class="walkthrough-step" style="display: none;">
<h4>5. Configure Embedding API Settings</h4>
<p class="text-muted">Configure the embedding service for document processing.</p>
<div id="embedding-requirement-alert" class="alert alert-danger">
<strong>Required:</strong> Embedding API configuration is required if workspaces are enabled.
</div>
<ul class="list-group mb-4">
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Embedding Endpoint</span>
<span id="embedding-required-badge" class="badge bg-danger">Required</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Authentication</span>
<span id="embedding-auth-badge" class="badge bg-danger">Required</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Fetch Models</span>
<span id="fetch-models-badge" class="badge bg-danger">Required</span>
</li>
</ul>
<div class="alert alert-info">
<strong>API Management Option:</strong> You can configure a direct connection to Azure OpenAI or use Azure API Management (APIM).
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="APIM provides an additional layer for security, monitoring, and rate limiting. APIM requires manual model configuration as the fetch functionality is not available."></i>
</div>
<div class="alert alert-info">
<strong>Note:</strong> Ensure the Service Principal has been assigned the Cognitive Service OpenAI User role on the Azure OpenAI endpoint.
</div>
</div>
<!-- Step 6: AI Search Settings -->
<div id="walkthrough-step-6" class="walkthrough-step" style="display: none;">
<h4>6. Configure Azure AI Search</h4>
<p class="text-muted">Configure Azure AI Search for document indexing.</p>
<div id="ai-search-requirement-alert" class="alert alert-danger">
<strong>Required:</strong> Azure AI Search is required if workspaces are enabled.
</div>
<ul class="list-group mb-4">
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>AI Search Endpoint</span>
<span id="search-endpoint-badge" class="badge bg-danger">Required</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Authentication</span>
<span id="search-auth-badge" class="badge bg-danger">Required</span>
</li>
</ul>
<div class="alert alert-info">
<strong>API Management Option:</strong> You can configure a direct connection to Azure AI Search or use Azure API Management (APIM).
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="APIM provides an additional layer for security, monitoring, and rate limiting. Use APIM when you need centralized API governance or want to isolate direct access to your Azure resources."></i>
</div>
</div>
<!-- Step 7: Document Intelligence -->
<div id="walkthrough-step-7" class="walkthrough-step" style="display: none;">
<h4>7. Configure Document Intelligence</h4>
<p class="text-muted">Configure Azure Document Intelligence for processing documents.</p>
<div id="doc-intelligence-requirement-alert" class="alert alert-danger">
<strong>Required:</strong> Document Intelligence is required if workspaces are enabled.
</div>
<ul class="list-group mb-4">
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Document Intelligence Endpoint</span>
<span id="doc-endpoint-badge" class="badge bg-danger">Required</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Authentication</span>
<span id="doc-auth-badge" class="badge bg-danger">Required</span>
</li>
</ul>
<div class="alert alert-info">
<strong>API Management Option:</strong> You can configure a direct connection to Document Intelligence or use Azure API Management (APIM).
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="APIM provides an additional layer for security, monitoring, and rate limiting. Use APIM when you need centralized API governance or want to isolate direct access to your Azure resources."></i>
</div>
</div>
<!-- Step 8: Video File Support -->
<div id="walkthrough-step-8" class="walkthrough-step" style="display: none;">
<h4>8. Enable Video File Support</h4>
<p class="text-muted">Configure support for video file processing.</p>
<div id="video-support-requirement-alert" class="alert alert-danger">
<strong>Required:</strong> Video support configuration is required if workspaces are enabled.
</div>
<p class="mb-3">Use the <strong>Video Support</strong> settings in the Workspaces tab to enable and configure video file processing.</p>
<ul class="list-group mb-4">
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Video Indexer Endpoint</span>
<span id="video-endpoint-badge" class="badge bg-danger">Required</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Video Indexer API Key</span>
<span class="badge bg-secondary">Optional</span>
</li>
</ul>
</div>
<!-- Step 9: Audio File Support -->
<div id="walkthrough-step-9" class="walkthrough-step" style="display: none;">
<h4>9. Enable Audio File Support</h4>
<p class="text-muted">Configure support for audio file processing.</p>
<div id="audio-support-requirement-alert" class="alert alert-danger">
<strong>Required:</strong> Audio support configuration is required if workspaces are enabled.
</div>
<p class="mb-3">Use the <strong>Audio Support</strong> settings in the Workspaces tab to enable and configure audio file processing.</p>
<ul class="list-group mb-4">
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Speech Service Endpoint</span>
<span id="audio-endpoint-badge" class="badge bg-danger">Required</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Speech Service Key</span>
<span id="audio-key-badge" class="badge bg-danger">Required</span>
</li>
</ul>
</div>
<!-- Step 10: Content Safety -->
<div id="walkthrough-step-10" class="walkthrough-step" style="display: none;">
<h4>10. Content Safety Settings</h4>
<p class="text-muted">Configure content safety features.</p>
<div class="alert alert-info">
<strong>Optional:</strong> Enable content safety features to filter inappropriate content.
</div>
</div>
<!-- Step 11: User Feedback and Archiving -->
<div id="walkthrough-step-11" class="walkthrough-step" style="display: none;">
<h4>11. User Feedback and Conversation Archiving</h4>
<p class="text-muted">Configure user feedback and conversation archiving features.</p>
<div class="alert alert-info">
<strong>Optional:</strong> Enable user feedback and conversation archiving.
</div>
<ul class="list-group mb-4">
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>User Feedback</span>
<span class="badge bg-secondary">Optional</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Conversation Archiving</span>
<span class="badge bg-secondary">Optional</span>
</li>
</ul>
</div>
<!-- Step 12: Enhanced Citations and Image Generation -->
<div id="walkthrough-step-12" class="walkthrough-step" style="display: none;">
<h4>12. Enhanced Citations and Image Generation</h4>
<p class="text-muted">Configure additional features.</p>
<div class="alert alert-info">
<strong>Optional:</strong> Enable enhanced citations and image generation features.
</div>
<ul class="list-group mb-4">
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Enhanced Citations</span>
<span class="badge bg-secondary">Optional</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>Image Generation</span>
<span class="badge bg-secondary">Optional</span>
</li>
</ul>
<div class="alert alert-success">
<strong>Congratulations!</strong> You've completed the initial setup walkthrough. You can now continue to configure your Simple Chat instance in detail.
</div>
</div>
</div>
<!-- Navigation buttons -->
<div class="mt-3 d-flex justify-content-between">
<button type="button" class="btn btn-secondary" id="walkthrough-prev-btn">Previous</button>
<div>
<button type="button" class="btn btn-primary" id="walkthrough-next-btn">Next</button>
<button type="button" class="btn btn-success" id="walkthrough-finish-btn" style="display: none;">Finish Setup and Save</button>
</div>
</div>
</div>
</div>
<!-- Hide tabs when left navigation is enabled -->
{% set nav_layout = user_settings.get('settings', {}).get('navLayout') %}
{% if not (nav_layout == 'sidebar' or (not nav_layout and app_settings.enable_left_nav_default)) %}
<ul class="nav nav-tabs" id="adminSettingsTab" role="tablist">
<!-- Core Settings -->
<li class="nav-item" role="presentation">
<button class="nav-link active" id="general-tab" data-bs-toggle="tab" data-bs-target="#general"
type="button" role="tab" aria-controls="general" aria-selected="true">
General
</button>
</li>
<!-- AI Models Group -->
<li class="nav-item" role="presentation">
<button class="nav-link" id="ai-models-tab" data-bs-toggle="tab" data-bs-target="#ai-models"
type="button" role="tab" aria-controls="ai-models" aria-selected="false">
AI Models
</button>
</li>
<!-- Content Processing Group -->
<li class="nav-item" role="presentation">
<button class="nav-link" id="search-extract-tab" data-bs-toggle="tab" data-bs-target="#search-extract"
type="button" role="tab" aria-controls="search-extract" aria-selected="false">
Search and Extract
</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="workspaces-tab" data-bs-toggle="tab" data-bs-target="#workspaces" type="button"
role="tab" aria-controls="workspaces" aria-selected="false">
Workspaces
</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="citation-tab" data-bs-toggle="tab" data-bs-target="#citation"
type="button" role="tab" aria-controls="citation" aria-selected="false">
Citations
</button>
</li>
<!-- Security -->
<li class="nav-item" role="presentation">
<button class="nav-link" id="safety-tab" data-bs-toggle="tab" data-bs-target="#safety"
type="button" role="tab" aria-controls="safety" aria-selected="false">
Safety
</button>
</li>
<!-- User Features -->
<li class="nav-item" role="presentation">
<button class="nav-link" id="agents-tab" data-bs-toggle="tab" data-bs-target="#agents" type="button" role="tab" aria-controls="agents" aria-selected="false">
Agents
</button>
</li>
<!-- System Administration -->
<li class="nav-item" role="presentation">
<button class="nav-link" id="scale-tab" data-bs-toggle="tab" data-bs-target="#scale"
type="button" role="tab" aria-controls="scale" aria-selected="false">
Scale
</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="logging-tab" data-bs-toggle="tab" data-bs-target="#logging" type="button" role="tab" aria-controls="logging" aria-selected="false">
Logging
</button>
</li>
</ul>
{% endif %}
<div class="tab-content mt-3" id="adminSettingsTabContent">
<!-- Agents Tab Content (Consolidated: Agents + Actions) -->
<div class="tab-pane fade" id="agents" role="tabpanel" aria-labelledby="agents-tab">
<p class="text-muted">
Configure AI agents and actions for enhanced functionality. Agents provide AI-driven task automation while Actions extend functionality with custom tools and integrations.
</p>
<div class="alert alert-warning mb-3" role="alert">
<strong>Note:</strong> All changes to global agents and actions require a restart of the web app to take effect.
</div>
<!-- Agents Configuration Section -->
<div class="card p-3 mb-4" id="agents-configuration">
<h5 class="card-title">
<i class="bi bi-robot me-2"></i>Agents Configuration
</h5>
<p class="text-muted small">
Configure AI agents powered by Semantic Kernel for task automation and orchestration.
</p>
<div class="mb-3">
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-enable-agents-agents" name="enable_semantic_kernel" {% if settings.enable_semantic_kernel %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-enable-agents-agents">Enable Agents</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Enable the agents system powered by Semantic Kernel for AI-driven task automation and orchestration."></i>
</div>
<div id="per-user-sk-restart-msg" class="text-muted small mb-2" style="display:none;">Requires a restart to take effect.</div>
</div>
{% if not settings.enable_semantic_kernel %}
<div class="alert alert-info">
<strong>Agents UI is not available while agents are disabled.</strong>
</div>
{% else %}
<div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-per-user-sk" name="per_user_semantic_kernel" {% if settings.per_user_semantic_kernel %}checked{% endif %} {% if not settings.enable_semantic_kernel %}disabled{% endif %}>
<label class="form-check-label ms-2" for="toggle-per-user-sk">Workspace Mode (workspace-specific agents/plugins and disables global configuration)</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="If enabled, each user gets their own agent/plugin set. If disabled, all users share the same global set."></i>
</div>
{% if settings.per_user_semantic_kernel %}
<!-- Agent Feature Flags -->
<div class="card p-3 mb-3" id="agent-toggles-card">
<h6 class="mb-2">Workspace Feature Toggles</h6>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-allow-user-agents" name="allow_user_agents" {% if settings.allow_user_agents %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-allow-user-agents">Allow User Agents</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Allow users to create and manage their own workspace-level agents for personal use and customization."></i>
</div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-allow-group-agents" name="allow_group_agents" {% if settings.allow_group_agents %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-allow-group-agents">Allow Group Agents</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Allow users to create and manage group-level agents that can be shared within workgroups and teams."></i>
</div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-allow-user-custom-agent-endpoints" name="allow_user_custom_agent_endpoints" {% if settings.allow_user_custom_agent_endpoints %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-allow-user-custom-agent-endpoints">Allow User Custom Agent Endpoints</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Allow users to configure custom API endpoints for their personal agents to connect to external services and models."></i>
</div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-allow-group-custom-agent-endpoints" name="allow_group_custom_agent_endpoints" {% if settings.allow_group_custom_agent_endpoints %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-allow-group-custom-agent-endpoints">Allow Group Custom Agent Endpoints</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Allow users to configure custom API endpoints for group-level agents to connect to shared external services and models."></i>
</div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-merge-global-sk" name="merge_global_semantic_kernel_with_workspace" {% if settings.merge_global_semantic_kernel_with_workspace %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-merge-global-sk">Merge Global Agents/Plugins into Workspace</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="If enabled, workspace agents/plugins will include global ones as well."></i>
</div>
</div>
<!-- End Agent Feature Flags -->
{% endif %}
<!-- Orchestration Settings Card -->
<div class="d-flex justify-content-between align-items-center mb-3">
<h4>Agent Orchestration Settings</h4>
</div>
<div class="card p-3 mb-3">
<p class="text-muted mb-1">Configure how the chat system orchestrates agents (single or multi-agent group chat).</p>
<div class="mb-3">
<label for="orchestration_type" class="form-label">Orchestration Type</label>
<select class="form-select" id="orchestration_type" name="orchestration_type"></select>
</div>
<div class="mb-3" id="max_rounds_per_agent_group" style="display:none;">
<label for="max_rounds_per_agent" class="form-label">Max Rounds Per Agent (Group Chat)</label>
<input type="number" class="form-control" id="max_rounds_per_agent" name="max_rounds_per_agent" min="1" value="1">
</div>
<button type="button" class="btn btn-primary" id="save-orchestration-settings-btn">Save Orchestration Settings</button>
</div>
<div class="d-flex justify-content-between align-items-center mb-3">
<h4>Global Agents</h4>
<button type="button" class="btn btn-primary" id="add-agent-btn">Add Agent</button>
</div>
<div class="mb-3 d-flex align-items-center">
{% if settings.orchestration_type == "default_agent" %}
<label for="default-agent-select" class="form-label me-2 mb-0">Selected Agent:</label>
{% else %}
<label for="default-agent-select" class="form-label me-2 mb-0">Orchestrator Agent:</label>
{% endif %}
<select id="default-agent-select" class="form-select w-auto" style="min-width:200px;"></select>
<span id="default-agent-select-msg" class="ms-2 text-muted small"></span>
</div>
<table class="table table-bordered" id="agents-table">
<thead>
<tr>
<th>Name</th>
<th>Display Name</th>
<th>Description</th>
{% if settings.orchestration_type == "default_agent" %}
<th>Selected Agent</th>
{% else %}
<th>Orchestrator Agent</th>
{% endif %}
<th>Actions</th>
</tr>
</thead>
<tbody id="agents-table-body"></tbody>
</table>
</div>
{% endif %}
</div>
<!-- Actions Configuration Section -->
<div class="card p-3 mb-4" id="actions-configuration">
<h5 class="card-title">
<i class="bi bi-plugin me-2"></i>Actions Configuration
</h5>
<p class="text-muted small">
Configure custom actions and tools to extend functionality with integrations and specialized capabilities.
</p>
{% if not settings.enable_semantic_kernel %}
<div class="alert alert-info">
<strong>Actions are not available while agents are disabled.</strong> Enable agents above to configure actions.
</div>
{% else %}
<div>
<div class="d-flex justify-content-between align-items-center mb-3">
<h6>Global Actions</h6>
<button type="button" class="btn btn-primary btn-sm" id="add-plugin-btn">Add Action</button>
</div>
{% if settings.per_user_semantic_kernel %}
<!-- Action Feature Flags -->
<div class="card p-3 mb-3" id="plugin-feature-toggles">
<h6 class="mb-2">Workspace Action Feature Toggles</h6>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-allow-user-plugins" name="allow_user_plugins" {% if settings.allow_user_plugins %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-allow-user-plugins">Allow User Actions</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Allow users to create and manage their own workspace-level actions/plugins for personal use."></i>
</div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-allow-group-plugins" name="allow_group_plugins" {% if settings.allow_group_plugins %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-allow-group-plugins">Allow Group Actions</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Allow users to create and manage group-level actions/plugins that can be shared within workgroups."></i>
</div>
</div>
{% endif %}
<!-- Core Plugin Toggles -->
<div class="card p-3 mb-3" id="core-plugin-toggles">
<h6 class="mb-2">Core Action Toggles</h6>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-time-plugin" name="enable_time_plugin" {% if settings.enable_time_plugin %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-time-plugin">Enable Time Action</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Enables agents to get current date, time, and perform time-related calculations and conversions."></i>
</div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-http-plugin" name="enable_http_plugin" {% if settings.enable_http_plugin %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-http-plugin">Enable HTTP Action</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Enables agents to make HTTP requests to websites for data retrieval and integration."></i>
</div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-wait-plugin" name="enable_wait_plugin" {% if settings.enable_wait_plugin %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-wait-plugin">Enable Wait Action</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Enables agents to pause execution for specified time periods, useful for delays and timing control in workflows."></i>
</div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-math-plugin" name="enable_math_plugin" {% if settings.enable_math_plugin %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-math-plugin">Enable Math Action</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Enables agents to perform mathematical calculations, solve equations, and handle complex mathematical operations."></i>
</div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-text-plugin" name="enable_text_plugin" {% if settings.enable_text_plugin %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-text-plugin">Enable Text Action</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Enables agents to perform text processing operations like formatting, validation, and manipulation of strings and text content."></i>
</div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-default-embedding-model-plugin" name="enable_default_embedding_model_plugin" {% if settings.enable_default_embedding_model_plugin %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-default-embedding-model-plugin">Enable Default Embedding Model Action</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Enables agents to access and use the default embedding model for text similarity and vector operations."></i>
</div>
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" role="switch" id="toggle-fact-memory-plugin" name="enable_fact_memory_plugin" {% if settings.enable_fact_memory_plugin %}checked{% endif %}>
<label class="form-check-label ms-2" for="toggle-fact-memory-plugin">Enable Fact Memory Action</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Enables agents to store and retrieve facts and information across conversations for improved memory and context retention."></i>
</div>
</div>
<table class="table table-bordered" id="plugins-table">
<thead>
<tr>
<th>Display Name</th>
<th>Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="admin-plugins-table-body"></tbody>
</table>
</div>
{% endif %}
</div>
</div>
<!-- Logging Tab Content -->
<div class="tab-pane fade" id="logging" role="tabpanel" aria-labelledby="logging-tab">
<p class="text-muted">
Configure logging settings for monitoring, debugging, and auditing purposes. These settings control various types of logging throughout the application including application insights, debug messages, and file processing events.
</p>
<div class="card p-3 mb-3" id="application-insights-section">
<h5>
<i class="bi bi-graph-up me-2"></i>Application Insights Logging
</h5>
<p class="text-muted">Enable global logging to Application Insights for all agents and orchestration events.</p>
<div class="form-check form-switch mb-3">
<input class="form-check-input" type="checkbox" role="switch" id="enable_appinsights_global_logging" name="enable_appinsights_global_logging" {% if settings.enable_appinsights_global_logging %}checked{% endif %}>
<label class="form-check-label ms-2" for="enable_appinsights_global_logging">
Enable Application Insights Global Logging
</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Toggle to enable or disable global logging to Application Insights for all agents and orchestration events."></i>
</div>
<div class="alert alert-warning mt-3" role="alert">
<strong>Note:</strong> Changing this setting requires an application restart to take effect.
</div>
</div>
<div class="card p-3 mb-3" id="opentelemetry-section">
<h5>
<i class="bi bi-sliders me-2"></i>OpenTelemetry Configuration
</h5>
<p class="text-muted">Fine-tune telemetry collection, sampling, and instrumentation for Azure Monitor Application Insights.</p>
<!-- Service Name -->
<div class="mb-3">
<label for="otel_service_name" class="form-label fw-bold">Service Name</label>
<input type="text" class="form-control" id="otel_service_name" name="otel_service_name" value="{{ settings.otel_service_name }}" placeholder="simplechat">
<small class="form-text text-muted">Logical service name for telemetry data. Used to distinguish between multiple deployments (e.g., "simplechat-production").</small>
</div>
<!-- Traces Sampler -->
<div class="mb-3">
<label for="otel_traces_sampler" class="form-label fw-bold">Traces Sampler</label>
<select class="form-select" id="otel_traces_sampler" name="otel_traces_sampler">
<option value="always_on" {% if settings.otel_traces_sampler == 'always_on' %}selected{% endif %}>Always On (100% sampling)</option>
<option value="always_off" {% if settings.otel_traces_sampler == 'always_off' %}selected{% endif %}>Always Off (0% sampling)</option>
<option value="traceidratio" {% if settings.otel_traces_sampler == 'traceidratio' %}selected{% endif %}>Trace ID Ratio (percentage-based)</option>
<option value="parentbased_always_on" {% if settings.otel_traces_sampler == 'parentbased_always_on' %}selected{% endif %}>Parent-based Always On (default)</option>
<option value="parentbased_always_off" {% if settings.otel_traces_sampler == 'parentbased_always_off' %}selected{% endif %}>Parent-based Always Off</option>
<option value="parentbased_traceidratio" {% if settings.otel_traces_sampler == 'parentbased_traceidratio' %}selected{% endif %}>Parent-based Trace ID Ratio</option>
</select>
<small class="form-text text-muted">Controls what percentage of traces are collected. Use ratio-based samplers to reduce costs in high-traffic environments.</small>
</div>
<!-- Traces Sampler Argument -->
<div class="mb-3">
<label for="otel_traces_sampler_arg" class="form-label fw-bold">Traces Sampler Argument (Ratio)</label>
<input type="text" class="form-control" id="otel_traces_sampler_arg" name="otel_traces_sampler_arg" value="{{ settings.otel_traces_sampler_arg }}" placeholder="1.0">
<small class="form-text text-muted">Sampling ratio (0.0 to 1.0). For example, 0.1 = 10% sampling, 1.0 = 100% sampling. Used with ratio-based samplers.</small>
</div>
<!-- Flask Excluded URLs -->
<div class="mb-3">
<label for="otel_flask_excluded_urls" class="form-label fw-bold">Flask Excluded URLs</label>
<input type="text" class="form-control" id="otel_flask_excluded_urls" name="otel_flask_excluded_urls" value="{{ settings.otel_flask_excluded_urls }}" placeholder="healthcheck,/health,/external/health">
<small class="form-text text-muted">Comma-separated regex patterns for URLs to exclude from instrumentation. Reduces noise and costs by excluding health checks and internal endpoints.</small>
</div>
<!-- Disabled Instrumentations -->
<div class="mb-3">
<label for="otel_disabled_instrumentations" class="form-label fw-bold">Disabled Instrumentations</label>
<input type="text" class="form-control" id="otel_disabled_instrumentations" name="otel_disabled_instrumentations" value="{{ settings.otel_disabled_instrumentations }}" placeholder="Leave empty to enable all">
<small class="form-text text-muted">Comma-separated list of instrumentations to disable (e.g., "flask,requests"). Leave empty to enable all instrumentations.</small>
</div>
<!-- Logs Exporter -->
<div class="mb-3">
<label for="otel_logs_exporter" class="form-label fw-bold">Logs Exporter</label>
<select class="form-select" id="otel_logs_exporter" name="otel_logs_exporter">
<option value="console" {% if settings.otel_logs_exporter == 'console' %}selected{% endif %}>Console</option>
<option value="otlp" {% if settings.otel_logs_exporter == 'otlp' %}selected{% endif %}>OTLP (Azure Monitor)</option>
<option value="console,otlp" {% if settings.otel_logs_exporter == 'console,otlp' %}selected{% endif %}>Console and OTLP (default)</option>
<option value="none" {% if settings.otel_logs_exporter == 'none' %}selected{% endif %}>None</option>
</select>
<small class="form-text text-muted">Where to export OpenTelemetry logs. Choose "OTLP" for production or "Console" for development.</small>
</div>
<!-- Metrics Exporter -->
<div class="mb-3">
<label for="otel_metrics_exporter" class="form-label fw-bold">Metrics Exporter</label>
<select class="form-select" id="otel_metrics_exporter" name="otel_metrics_exporter">
<option value="console" {% if settings.otel_metrics_exporter == 'console' %}selected{% endif %}>Console</option>
<option value="otlp" {% if settings.otel_metrics_exporter == 'otlp' %}selected{% endif %}>OTLP (Azure Monitor, default)</option>
<option value="console,otlp" {% if settings.otel_metrics_exporter == 'console,otlp' %}selected{% endif %}>Console and OTLP</option>
<option value="none" {% if settings.otel_metrics_exporter == 'none' %}selected{% endif %}>None</option>
</select>
<small class="form-text text-muted">Where to export OpenTelemetry metrics. Choose "None" if using external metrics platforms like Prometheus.</small>
</div>
<!-- Enable Live Metrics -->
<div class="form-check form-switch mb-3">
<input class="form-check-input" type="checkbox" role="switch" id="otel_enable_live_metrics" name="otel_enable_live_metrics" {% if settings.otel_enable_live_metrics %}checked{% endif %}>
<label class="form-check-label ms-2" for="otel_enable_live_metrics">
Enable Live Metrics
</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Enables Azure Monitor Live Metrics stream for real-time monitoring. Maintains a persistent connection."></i>
</div>
<div class="alert alert-warning mt-3" role="alert">
<strong>Note:</strong> Changing OpenTelemetry settings requires an application restart to take effect. See <a href="https://github.com/microsoft/simplechat/blob/main/docs/features/OPENTELEMETRY_CONFIGURATION.md" target="_blank">documentation</a> for detailed use cases and recommendations.
</div>
</div>
<div class="card p-3 mb-3" id="debug-logging-section">
<h5>
<i class="bi bi-bug me-2"></i>Debug Logging
</h5>
<p class="text-muted">Control debug print statements across the application for development and troubleshooting.</p>
<div class="form-check form-switch mb-3">
<input class="form-check-input" type="checkbox" role="switch" id="enable_debug_logging" name="enable_debug_logging" {% if settings.enable_debug_logging %}checked{% endif %} onchange="toggleTimeControls('debug')">
<label class="form-check-label ms-2" for="enable_debug_logging">
Enable Debug Logging
</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Toggle to enable or disable debug print statements across the application for troubleshooting and development."></i>
</div>
<!-- Time-based turnoff controls for Debug Logging -->
<div id="debug-time-controls" class="mt-3" style="{% if not settings.enable_debug_logging %}display: none;{% endif %}">
<div class="form-check form-switch mb-3">
<input class="form-check-input" type="checkbox" role="switch" id="enable_debug_logging_timer" name="enable_debug_logging_timer" {% if settings.debug_logging_timer_enabled %}checked{% endif %} onchange="toggleTimerInputs('debug')">
<label class="form-check-label ms-2" for="enable_debug_logging_timer">
Enable Time-based Auto Turnoff
</label>
<i class="bi bi-clock ms-2" data-bs-toggle="tooltip" title="Automatically disable debug logging after a specified time period to manage cost and risk."></i>
</div>
<div id="debug-timer-inputs" class="row g-3" style="{% if not settings.debug_logging_timer_enabled %}display: none;{% endif %}">
<div class="col-md-4">
<label for="debug_timer_value" class="form-label">Duration</label>
<input type="number" class="form-control" id="debug_timer_value" name="debug_timer_value" min="1" max="120" value="{{ settings.debug_timer_value or 1 }}">
</div>
<div class="col-md-4">
<label for="debug_timer_unit" class="form-label">Time Unit</label>
<select class="form-select" id="debug_timer_unit" name="debug_timer_unit">
<option value="minutes" {% if settings.debug_timer_unit == 'minutes' %}selected{% endif %}>Minutes (1-120)</option>
<option value="hours" {% if settings.debug_timer_unit == 'hours' %}selected{% endif %}>Hours (1-24)</option>
<option value="days" {% if settings.debug_timer_unit == 'days' %}selected{% endif %}>Days (1-7)</option>
<option value="weeks" {% if settings.debug_timer_unit == 'weeks' %}selected{% endif %}>Weeks (1-52)</option>
</select>
</div>
<div class="col-md-4">
<label class="form-label">Will turn off at:</label>
<div id="debug-turnoff-time" class="form-control-plaintext text-info fw-bold">
{% if settings.debug_logging_turnoff_time %}
{% if settings.debug_logging_turnoff_time is string %}
{{ settings.debug_logging_turnoff_time }}
{% else %}
{{ settings.debug_logging_turnoff_time.strftime('%Y-%m-%d %H:%M:%S') }}
{% endif %}
{% else %}
Will be calculated when saved
{% endif %}
</div>
</div>
</div>
</div>
<div class="alert alert-info mt-2" role="alert">
<strong>Info:</strong> This controls all DEBUG print statements throughout the application. Useful for development and troubleshooting. Tokens and keys will be collected during this process.
</div>
</div>
<div class="card p-3 mb-3" id="file-processing-logs-section">
<h5>
<i class="bi bi-file-earmark-text me-2"></i>File Process Logging
</h5>
<p class="text-muted">Enable logging of file processing events for debugging and auditing purposes. Logs are stored in the file_processing container in Cosmos DB.</p>
<div class="form-check form-switch mb-3">
<input class="form-check-input" type="checkbox" role="switch" id="enable_file_processing_logs" name="enable_file_processing_logs" {% if settings.enable_file_processing_logs %}checked{% endif %} onchange="toggleTimeControls('file')">
<label class="form-check-label ms-2" for="enable_file_processing_logs">
Enable File Processing Logs
</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Toggle to enable or disable logging of file processing events for debugging and auditing purposes."></i>
</div>
<!-- Time-based turnoff controls for File Processing Logs -->
<div id="file-time-controls" class="mt-3" style="{% if not settings.enable_file_processing_logs %}display: none;{% endif %}">
<div class="form-check form-switch mb-3">
<input class="form-check-input" type="checkbox" role="switch" id="enable_file_processing_logs_timer" name="enable_file_processing_logs_timer" {% if settings.file_processing_logs_timer_enabled %}checked{% endif %} onchange="toggleTimerInputs('file')">
<label class="form-check-label ms-2" for="enable_file_processing_logs_timer">
Enable Time-based Auto Turnoff
</label>
<i class="bi bi-clock ms-2" data-bs-toggle="tooltip" title="Automatically disable file processing logs after a specified time period to manage cost and risk."></i>
</div>
<div id="file-timer-inputs" class="row g-3" style="{% if not settings.file_processing_logs_timer_enabled %}display: none;{% endif %}">
<div class="col-md-4">
<label for="file_timer_value" class="form-label">Duration</label>
<input type="number" class="form-control" id="file_timer_value" name="file_timer_value" min="1" max="120" value="{{ settings.file_timer_value or 1 }}">
</div>
<div class="col-md-4">
<label for="file_timer_unit" class="form-label">Time Unit</label>
<select class="form-select" id="file_timer_unit" name="file_timer_unit">
<option value="minutes" {% if settings.file_timer_unit == 'minutes' %}selected{% endif %}>Minutes (1-120)</option>
<option value="hours" {% if settings.file_timer_unit == 'hours' %}selected{% endif %}>Hours (1-24)</option>
<option value="days" {% if settings.file_timer_unit == 'days' %}selected{% endif %}>Days (1-7)</option>
<option value="weeks" {% if settings.file_timer_unit == 'weeks' %}selected{% endif %}>Weeks (1-52)</option>
</select>
</div>
<div class="col-md-4">
<label class="form-label">Will turn off at:</label>
<div id="file-turnoff-time" class="form-control-plaintext text-info fw-bold">
{% if settings.file_processing_logs_turnoff_time %}
{% if settings.file_processing_logs_turnoff_time is string %}
{{ settings.file_processing_logs_turnoff_time }}
{% else %}
{{ settings.file_processing_logs_turnoff_time.strftime('%Y-%m-%d %H:%M:%S') }}
{% endif %}
{% else %}
Will be calculated when saved
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade show active" id="general" role="tabpanel" aria-labelledby="general-tab">
<p class="text-muted">
Configure general application settings, including the application's title, logo, and landing page text.
</p>
<div class="card p-3 mb-3" id="branding-section">
<h5>
<i class="bi bi-palette me-2"></i>Branding
</h5>
<p class="text-muted small">
Configure your application's title, logo, and branding elements.
</p>
<div class="mb-3">
<label for="app_title" class="form-label">Application Title</label>
<input type="text" class="form-control" id="app_title" name="app_title" value="{{ settings.app_title }}">
</div>
<h6 class="mt-3">Logo Settings</h6>
<div class="form-group form-check form-switch mb-3">
<input type="checkbox" class="form-check-input" id="show_logo" name="show_logo"
{% if settings.show_logo %}checked{% endif %}>
<label class="form-check-label ms-2" for="show_logo">Show Logo</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Display the application logo in the header and navigation areas of the interface."></i>
</div>
<div class="form-group form-check form-switch mb-3">
<input type="checkbox" class="form-check-input" id="hide_app_title" name="hide_app_title"
{% if settings.hide_app_title %}checked{% endif %}>
<label class="form-check-label ms-2" for="hide_app_title">Hide Application Title</label>
<i class="bi bi-info-circle ms-2" data-bs-toggle="tooltip" title="Hide the application title from the header and navigation, showing only the logo if enabled."></i>
</div>
<div class="form-group mb-3">
<label for="logo_file">Upload Custom Logo (Light Mode)</label>
<input type="file" class="form-control" name="logo_file" id="logo_file" accept=".png,.jpg,.jpeg">
<small class="form-text text-muted">This logo will be displayed in light mode.</small>
</div>
<div class="form-group mb-3">
<label for="logo_dark_file">Upload Custom Logo (Dark Mode)</label>
<input type="file" class="form-control" name="logo_dark_file" id="logo_dark_file" accept=".png,.jpg,.jpeg">
<small class="form-text text-muted">This logo will be displayed in dark mode. If not provided, the light mode logo will be used in both themes.</small>
</div>
<div class="form-group mb-3">
<label for="favicon_file">Upload Custom Favicon</label>