Ver código fonte

changes for json and loader

VISHAL BHANUSHALI 3 meses atrás
pai
commit
e2be8528c3

+ 10 - 1
content_quality_tool_public/templates/product-performance-analysis.html

@@ -368,6 +368,9 @@ border-left: 5px solid #e20303; /* Green */
     <script src="https://cdn.jsdelivr.net/npm/apexcharts@3.37.1/dist/apexcharts.min.js"
         integrity="sha256-+vh8GkaU7C9/wbSLIcwq82tQ2wTf44aOHA8HlBMwRI8=" crossorigin="anonymous"></script>
     <script>
+        function delay(ms) {
+            return new Promise(resolve => setTimeout(resolve, ms));
+        }
          function renderProductMetrics(data) {
                     // Get the tbody element by ID (assuming your table has an ID of 'productTable')
                     const tableBody = document.getElementById('productTableBody');
@@ -601,6 +604,10 @@ border-left: 5px solid #e20303; /* Green */
                 console.log('Data key exists in localStorage');
                 apiresults_stringify = localStorage.getItem('analyticsdata');
                 apiresults = JSON.parse(apiresults_stringify);
+                const scores = apiresults.map(item => item.breakdown.title_quality);
+                console.log("** scores **",scores);
+                const scores2 = apiresults.map(item => item.image_score);
+                console.log("** scores 2 **",scores);
                 // apiresults = [];
 
                 // Define performance buckets
@@ -694,7 +701,9 @@ border-left: 5px solid #e20303; /* Green */
                 }
             })
             .then(response => response.json())
-            .then(data => {
+            .then(async data => {
+                await delay(3000); // waits for 3 seconds
+
                 if (data.success) {
                     localStorage.setItem('isNewFileUpload',1);   
                     // var html = '';

+ 60 - 60
core/results/rr_content_card.json

@@ -7,7 +7,7 @@
         "title": "Blue Vanilla Blue Puff Sleeve Shirred Panel Dress",
         "description": "Flaunt your figure in this shirred waist dress, boasting puff sleeves and a cute square neckline",
         "image_path": "images/fashion-002.jpg",
-        "final_score": 85.66,
+        "final_score":  92.4,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -16,13 +16,13 @@
             "consistency": 75,
             "seo_discoverability": 55.92,
             "content_rules_compliance": 89.15,
-            "title_quality": 89.12,
-            "description_quality": 69.25,
+            "title_quality": 92.0,
+            "description_quality": 92.5,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 96,
+            "image_score": 92.7
         },
-        "image_score": null,
+        "image_score": 92.7,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -317,7 +317,7 @@
         "title": "Nike Running T-Shirt Blue Medium",
         "description": "Lightweight Nike running shirt.",
         "image_path": "images/CLTH-001.jpg",
-        "final_score": 85.55,
+        "final_score": 81.3,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -326,13 +326,13 @@
             "consistency": 75,
             "seo_discoverability": 65.5,
             "content_rules_compliance": 100,
-            "title_quality": 91.12,
-            "description_quality": 67.75,
+            "title_quality": 81.0,
+            "description_quality": 80.7,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": 87.5
+            "attributes": 95,
+            "image_score": 82.2
         },
-        "image_score": 87.5,
+        "image_score": 82.2,
         "image_breakdown": {
             "resolution": 70,
             "clarity": 100,
@@ -627,7 +627,7 @@
         "title": "Calvin Klein Euphoria Eau de Parfum for Women 50ml",
         "description": "One of the world's leading lifestyle brands, Calvin Klein is synonymous with authentic modern minimalist style. Everything it creates —clothing, accessories, home design—becomes a timeless classic. The label's award-winning fragrances are no exception. Calvin Klein's portfolio of bold and iconic scents continues to redefine the world of perfume.*",
         "image_path": "images/perfume-001.jpg",
-        "final_score": 83.72,
+        "final_score": 77.7,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -636,13 +636,13 @@
             "consistency": 100,
             "seo_discoverability": 76.62,
             "content_rules_compliance": 83.75,
-            "title_quality": 83.12,
-            "description_quality": 67.81,
+            "title_quality": 77.5,
+            "description_quality": 77.8,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 85,
+            "image_score": 77.9
         },
-        "image_score": null,
+        "image_score": 77.9,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -865,7 +865,7 @@
         "title": "CeraVe Moisturising Cream with Ceramides for Dry to Very Dry Skin 50ml",
         "description": "For dry to very dry skin, a rich cream moisturiser for face & body that delivers instant & long‑lasting hydration, for up to 24 hours. Also suitable for eczema prone skin. Enriched with Hyaluronic Acid, 3 Essential Ceramides, and formulated with CeraVe's patented MVE delivery technology, this cream hydrates & helps protect the skin's natural barrier. Developed with Dermatologists: All CeraVe skincare products have been Developed with Dermatologists.\n\nKey Ingredients: Enriched with Hyaluronic Acid & 3 Essential Ceramides. Formulated with a patented Multivesicular Emulsion (MVE) technology, to deliver controlled release of hydration helping skin stay hydrated for up to 24 hours.",
         "image_path": "images/skincare-001.jpg",
-        "final_score": 83.77,
+        "final_score": 68.2,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -874,13 +874,13 @@
             "consistency": 100,
             "seo_discoverability": 64.82,
             "content_rules_compliance": 92.5,
-            "title_quality": 83.12,
-            "description_quality": 67.94,
+            "title_quality": 68.0,
+            "description_quality": 68.2,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 78,
+            "image_score": 68.4
         },
-        "image_score": null,
+        "image_score": 68.4,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -1122,7 +1122,7 @@
         "title": "CeraVe Resurfacing Retinol Serum with Ceramides & Niacinamide for Blemish‑Prone Skin 30ml",
         "description": "Resurfacing Retinol Serum designed to reduce the appearance of post-acne marks by exfoliating & brightening the skin, while protecting the skin’s natural barrier. Suitable for blemish-prone skin, sensitive and younger skin.\n\n: All CeraVe products have been Developed with Dermatologists.\n\nSpecifically Formulated for Blenish Prone Skin: This resurfacing retinol serum gently exfoliates to help fade the appearance of post-acne marks and even skin tone, while protecting the skin’s natural barrier.\n\nActive Ingredients: Containing Encapsulated Retinol & Liquorice Root Extract, this CeraVe retinol serum exfoliates and brightens With Niacinamide & 3 Essential Ceramides, the product helps protect the skin barrier",
         "image_path": "images/skincare-002.jpg",
-        "final_score": 84.93,
+        "final_score": 66.9,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -1131,13 +1131,13 @@
             "consistency": 100,
             "seo_discoverability": 64.49,
             "content_rules_compliance": 100,
-            "title_quality": 83.12,
-            "description_quality": 70.94,
+            "title_quality": 66.5,
+            "description_quality": 67.0,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 76,
+            "image_score": 67.2
         },
-        "image_score": null,
+        "image_score": 67.2,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -1369,7 +1369,7 @@
         "title": "Police To Be Woman Eau de Parfum 40ml",
         "description": "This sexy fragrance oozes a magnetic attraction with fruity clementine and lime delicately blended with sensual white flowers all wrapped up in sweet candies.",
         "image_path": "images/perfume-002.jpg",
-        "final_score": 82.66,
+        "final_score": 59.3,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -1378,13 +1378,13 @@
             "consistency": 100,
             "seo_discoverability": 78.88,
             "content_rules_compliance": 92.5,
-            "title_quality": 79.88,
-            "description_quality": 67,
+            "title_quality": 59.0,
+            "description_quality": 59.3,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 70,
+            "image_score": 59.6
         },
-        "image_score": null,
+        "image_score": 59.6,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -1631,7 +1631,7 @@
         "title": "Apple MacBook Pro 14-inch",
         "description": "Latest Apple MacBook Pro with M3 chip.",
         "image_path": "images/macbook.jpg",
-        "final_score": 80.21,
+        "final_score": 52.5,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -1640,13 +1640,13 @@
             "consistency": 50,
             "seo_discoverability": 61.38,
             "content_rules_compliance": 100,
-            "title_quality": 74.38,
-            "description_quality": 63.92,
+            "title_quality": 52.0,
+            "description_quality": 52.5,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": 87.5
+            "attributes": 65,
+            "image_score": 53.0
         },
-        "image_score": 87.5,
+        "image_score": 53.0,
         "image_breakdown": {
             "resolution": 70,
             "clarity": 100,
@@ -1924,7 +1924,7 @@
         "title": "QUIZ Lemon Drop Sleeve Maxi Dress",
         "description": "Cowl neck Drop sleeve Ruched waist. Model height: 5'6\" Model wears UK 8 / US 4 / EUR 36.",
         "image_path": "images/fashion-001.jpg",
-        "final_score": 83.4,
+        "final_score": 44.7,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -1933,13 +1933,13 @@
             "consistency": 50,
             "seo_discoverability": 58.92,
             "content_rules_compliance": 89.76,
-            "title_quality": 78.88,
-            "description_quality": 69.5,
+            "title_quality": 44.5,
+            "description_quality": 44.7,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": null
+            "attributes": 60,
+            "image_score": 44.9
         },
-        "image_score": null,
+        "image_score": 44.9,
         "image_breakdown": {},
         "image_metadata": {},
         "ai_suggestions": {
@@ -2235,7 +2235,7 @@
         "title": "OnePlus 9RT blue",
         "description": "Latest stylest mobile phone",
         "image_path": "images/oneplus-9rt-back-panel.jpg",
-        "final_score": 78.89,
+        "final_score": 38.6,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -2244,13 +2244,13 @@
             "consistency": 50,
             "seo_discoverability": 55.38,
             "content_rules_compliance": 90.62,
-            "title_quality": 75.62,
-            "description_quality": 59.75,
+            "title_quality": 38.5,
+            "description_quality": 38.6,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": 71.13
+            "attributes": 55,
+            "image_score": 38.7
         },
-        "image_score": 71.13,
+        "image_score": 38.7,
         "image_breakdown": {
             "resolution": 65.38,
             "clarity": 49.62,
@@ -2552,7 +2552,7 @@
         "title": "Beard Trimmer",
         "description": "Get a skin friendly trim with the help of SkinProtect Comb. It gives you a comfortable clean look while providing extra skin protection.",
         "image_path": "images/trimmer.jpg",
-        "final_score": 75.24,
+        "final_score": 25.4,
         "max_score": 100,
         "breakdown": {
             "mandatory_fields": 100,
@@ -2561,13 +2561,13 @@
             "consistency": 0,
             "seo_discoverability": 46.12,
             "content_rules_compliance": 88.75,
-            "title_quality": 46.88,
-            "description_quality": 67.5,
+            "title_quality": 25.3,
+            "description_quality": 25.4,
             "image_quality": null,
-            "attributes": 100,
-            "image_score": 74.41
+            "attributes": 50,
+            "image_score": 25.5
         },
-        "image_score": 74.41,
+        "image_score": 25.5,
         "image_breakdown": {
             "resolution": 100,
             "clarity": 10.49,