a1c00l commited on
Commit
56cac31
Β·
verified Β·
1 Parent(s): 240512e

Update templates/result.html

Browse files
Files changed (1) hide show
  1. templates/result.html +119 -5
templates/result.html CHANGED
@@ -295,6 +295,58 @@
295
  .download-section {
296
  margin: 15px 0;
297
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  </style>
299
  </head>
300
  <body>
@@ -446,7 +498,7 @@
446
  {% set tag_value = prop.value|replace('[', '')|replace(']', '')|replace('"', '') %}
447
  <span class="tag">{{ tag_value }}</span>
448
  </div>
449
- {% elif prop.name not in ['aibom:quality-score', 'aibom:quality-breakdown', 'aibom:max-scores'] %}
450
  <div><strong>{{ prop.name }}:</strong> {{ prop.value }}</div>
451
  {% endif %}
452
  {% endfor %}
@@ -530,12 +582,34 @@
530
 
531
  <div id="field-checklist" class="tab-content">
532
  <h3>Field Checklist</h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
533
  <ul>
534
  {% for field, status in completeness_score.field_checklist.items() %}
535
  {% if status == "βœ”" %}
536
- <li class="present">{{ status }} {{ field }}</li>
 
 
 
 
537
  {% else %}
538
  <li class="missing">{{ status }} {{ field }}
 
 
 
 
539
  {% if field == "component.description" %}
540
  <span class="importance-indicator high-importance">β˜…β˜…β˜…</span>
541
  <span class="tooltip">(?)
@@ -576,6 +650,23 @@
576
  <div id="score-view" class="tab-content">
577
  <h3>AI SBOM Completeness Score</h3>
578
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
579
  <!-- Total Score with Progress Bar -->
580
  <div class="total-score-container">
581
  <div class="total-score">{{ completeness_score.total_score }}/100</div>
@@ -597,7 +688,7 @@
597
  {% endif %}
598
 
599
  <div class="progress-bar {{ score_class }}" style="width: {{ score_percent }}%">
600
- {{ score_label }}
601
  </div>
602
  </div>
603
  </div>
@@ -674,17 +765,25 @@
674
  {% set missing_critical = [] %}
675
  {% for field, status in completeness_score.field_checklist.items() %}
676
  {% if status != "βœ”" %}
677
- {% if field == "component.description" or field == "component.purl" or field == "modelCard.modelParameters" %}
678
  {% set _ = missing_critical.append(field) %}
679
  <li>
680
  <strong>{{ field }}</strong>
681
- <span class="importance-indicator high-importance">β˜…β˜…β˜…</span>
682
  {% if field == "component.description" %}
683
  - Add a detailed description of the model (at least 20 characters)
684
  {% elif field == "component.purl" %}
685
  - Add a valid PURL in the format pkg:huggingface/[owner]/[name]@[version]
686
  {% elif field == "modelCard.modelParameters" %}
687
  - Add model parameters section with architecture, size, and training details
 
 
 
 
 
 
 
 
688
  {% endif %}
689
  </li>
690
  {% endif %}
@@ -762,6 +861,21 @@
762
  </li>
763
  {% endif %}
764
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
  {% if not has_recommendations %}
766
  <li>Your AI SBOM is already well-documented. Great job!</li>
767
  {% endif %}
 
295
  .download-section {
296
  margin: 15px 0;
297
  }
298
+
299
+ /* New styles for completeness profile */
300
+ .completeness-profile {
301
+ background-color: #e8f5e9;
302
+ border-radius: 5px;
303
+ padding: 15px;
304
+ margin: 15px 0;
305
+ border-left: 4px solid #4caf50;
306
+ }
307
+ .profile-badge {
308
+ display: inline-block;
309
+ padding: 3px 10px;
310
+ border-radius: 15px;
311
+ color: white;
312
+ font-weight: bold;
313
+ margin-right: 10px;
314
+ }
315
+ .profile-basic {
316
+ background-color: #ff9800;
317
+ }
318
+ .profile-standard {
319
+ background-color: #2196f3;
320
+ }
321
+ .profile-advanced {
322
+ background-color: #4caf50;
323
+ }
324
+ .field-tier {
325
+ display: inline-block;
326
+ width: 12px;
327
+ height: 12px;
328
+ border-radius: 50%;
329
+ margin-right: 5px;
330
+ }
331
+ .tier-critical {
332
+ background-color: #d32f2f;
333
+ }
334
+ .tier-important {
335
+ background-color: #ff9800;
336
+ }
337
+ .tier-supplementary {
338
+ background-color: #2196f3;
339
+ }
340
+ .tier-legend {
341
+ display: flex;
342
+ margin: 10px 0;
343
+ font-size: 0.9em;
344
+ }
345
+ .tier-legend-item {
346
+ display: flex;
347
+ align-items: center;
348
+ margin-right: 20px;
349
+ }
350
  </style>
351
  </head>
352
  <body>
 
498
  {% set tag_value = prop.value|replace('[', '')|replace(']', '')|replace('"', '') %}
499
  <span class="tag">{{ tag_value }}</span>
500
  </div>
501
+ {% elif prop.name not in ['aibom:quality-score', 'aibom:quality-breakdown', 'aibom:max-scores', 'aibom:completeness-profile', 'aibom:completeness-description', 'aibom:ai-enhanced', 'aibom:ai-model', 'aibom:original-score', 'aibom:score-improvement'] %}
502
  <div><strong>{{ prop.name }}:</strong> {{ prop.value }}</div>
503
  {% endif %}
504
  {% endfor %}
 
582
 
583
  <div id="field-checklist" class="tab-content">
584
  <h3>Field Checklist</h3>
585
+
586
+ <!-- Field Tier Legend -->
587
+ <div class="tier-legend">
588
+ <div class="tier-legend-item">
589
+ <span class="field-tier tier-critical"></span> Critical Fields
590
+ </div>
591
+ <div class="tier-legend-item">
592
+ <span class="field-tier tier-important"></span> Important Fields
593
+ </div>
594
+ <div class="tier-legend-item">
595
+ <span class="field-tier tier-supplementary"></span> Supplementary Fields
596
+ </div>
597
+ </div>
598
+
599
  <ul>
600
  {% for field, status in completeness_score.field_checklist.items() %}
601
  {% if status == "βœ”" %}
602
+ <li class="present">{{ status }} {{ field }}
603
+ {% if completeness_score.field_tiers and field in completeness_score.field_tiers %}
604
+ <span class="field-tier tier-{{ completeness_score.field_tiers[field] }}"></span>
605
+ {% endif %}
606
+ </li>
607
  {% else %}
608
  <li class="missing">{{ status }} {{ field }}
609
+ {% if completeness_score.field_tiers and field in completeness_score.field_tiers %}
610
+ <span class="field-tier tier-{{ completeness_score.field_tiers[field] }}"></span>
611
+ {% endif %}
612
+
613
  {% if field == "component.description" %}
614
  <span class="importance-indicator high-importance">β˜…β˜…β˜…</span>
615
  <span class="tooltip">(?)
 
650
  <div id="score-view" class="tab-content">
651
  <h3>AI SBOM Completeness Score</h3>
652
 
653
+ <!-- Completeness Profile Section (New) -->
654
+ {% if completeness_score.completeness_profile %}
655
+ <div class="completeness-profile">
656
+ <h4>Completeness Profile:
657
+ <span class="profile-badge profile-{{ completeness_score.completeness_profile.name|lower }}">
658
+ {{ completeness_score.completeness_profile.name }}
659
+ </span>
660
+ </h4>
661
+ <p>{{ completeness_score.completeness_profile.description }}</p>
662
+
663
+ {% if completeness_score.completeness_profile.next_level %}
664
+ <p><strong>Next level:</strong> {{ completeness_score.completeness_profile.next_level.name }}
665
+ ({{ completeness_score.completeness_profile.next_level.missing_fields_count }} fields to add)</p>
666
+ {% endif %}
667
+ </div>
668
+ {% endif %}
669
+
670
  <!-- Total Score with Progress Bar -->
671
  <div class="total-score-container">
672
  <div class="total-score">{{ completeness_score.total_score }}/100</div>
 
688
  {% endif %}
689
 
690
  <div class="progress-bar {{ score_class }}" style="width: {{ score_percent }}%">
691
+ {{ score_percent|int }}% <span class="score-label label-{{ score_class|replace('progress-', '') }}">{{ score_label }}</span>
692
  </div>
693
  </div>
694
  </div>
 
765
  {% set missing_critical = [] %}
766
  {% for field, status in completeness_score.field_checklist.items() %}
767
  {% if status != "βœ”" %}
768
+ {% if completeness_score.field_tiers and field in completeness_score.field_tiers and completeness_score.field_tiers[field] == 'critical' %}
769
  {% set _ = missing_critical.append(field) %}
770
  <li>
771
  <strong>{{ field }}</strong>
772
+ <span class="field-tier tier-critical"></span>
773
  {% if field == "component.description" %}
774
  - Add a detailed description of the model (at least 20 characters)
775
  {% elif field == "component.purl" %}
776
  - Add a valid PURL in the format pkg:huggingface/[owner]/[name]@[version]
777
  {% elif field == "modelCard.modelParameters" %}
778
  - Add model parameters section with architecture, size, and training details
779
+ {% elif field == "buildTime" %}
780
+ - Add build time information (when the model was built)
781
+ {% elif field == "releaseTime" %}
782
+ - Add release time information (when the model was released)
783
+ {% elif field == "primaryPurpose" %}
784
+ - Add primary purpose information (what the model is designed for)
785
+ {% else %}
786
+ - This field is required for comprehensive documentation
787
  {% endif %}
788
  </li>
789
  {% endif %}
 
861
  </li>
862
  {% endif %}
863
 
864
+ {% if completeness_score.completeness_profile and completeness_score.completeness_profile.next_level %}
865
+ {% set has_recommendations = true %}
866
+ <li>
867
+ <strong>Upgrade to {{ completeness_score.completeness_profile.next_level.name }} Profile</strong>:
868
+ <ul>
869
+ {% for field in completeness_score.completeness_profile.next_level.missing_fields[:5] %}
870
+ <li>Add {{ field }}</li>
871
+ {% endfor %}
872
+ {% if completeness_score.completeness_profile.next_level.missing_fields|length > 5 %}
873
+ <li>... and {{ completeness_score.completeness_profile.next_level.missing_fields|length - 5 }} more fields</li>
874
+ {% endif %}
875
+ </ul>
876
+ </li>
877
+ {% endif %}
878
+
879
  {% if not has_recommendations %}
880
  <li>Your AI SBOM is already well-documented. Great job!</li>
881
  {% endif %}