Update script.js
Browse files330 unmodified lines33133233333433533633733833934 unmodified lines374375376377378379380381382383384385133 unmodified lines519520521522523524525526527528529530362 unmodified lines8938948958968978988999009019024 unmodified lines907908909910911912913914330 unmodified linesloading.className ="md:col-span-3 bg-white p-5 rounded-2xl border border-teal-100 text-sm text-teal-800";loading.setAttribute("role", "status");loading.textContent = currentLang === "ar"? "⏳ يرسل التطبيق بيانات المؤشرات إلى Qwen لتحليلها. قد يستغرق الرد بعض الوقت...": "⏳ Sending KPI data to Qwen for analysis. This may take a little while...";container.appendChild(loading);34 unmodified linesoutputContent.replaceChildren();appendTextElement(outputContent,"p","font-bold text-teal-100 mb-3",currentLang === "ar"? "اقترح Qwen المؤشرات التالية بناءً على البيانات الحالية. راجعي كل اقتراح قبل إضافته.": "Qwen suggested these KPIs from the current data. Review each suggestion before adding it.");const grid = document.createElement("div");133 unmodified linesoutputContent.replaceChildren();appendTextElement(outputContent,"p","text-teal-100",currentLang === "ar"? "⏳ يرسل التطبيق المؤشرات الحالية إلى Qwen لتوليد اقتراحات جديدة...": "⏳ Sending the current KPIs to Qwen to generate new suggestions...");if (!currentKpiData || currentKpiData.length === 0) {362 unmodified lines// Allows the analytics section to be refreshed manually if needed.function toggleAiInsights() {aiInsightsCacheKey = "";updateAiInsights(true);}function renderAll() {updateSummaryCards();renderDashboardProgress();4 unmodified lineslucide.createIcons();}// Automatically request AI insights after KPI data is loaded.updateAiInsights();}// Expose functions used by inline onclick handlers in index.html.330 unmodified lines33133233333433533633733834 unmodified lines373374375376377378379380381382133 unmodified lines516517518519520521522523524525362 unmodified lines8888898908918928938948958968978988999009019029039049059069079089099104 unmodified lines915916917918919920921922330 unmodified linesloading.className ="md:col-span-3 bg-white p-5 rounded-2xl border border-teal-100 text-sm text-teal-800";loading.setAttribute("role", "status");loading.textContent ="⏳ " + translations[currentLang].insights_loading;container.appendChild(loading);34 unmodified linesoutputContent.replaceChildren();appendTextElement(outputContent,"p","font-bold text-teal-100 mb-3",translations[currentLang].kpi_suggestions_intro);const grid = document.createElement("div");133 unmodified linesoutputContent.replaceChildren();appendTextElement(outputContent,"p","text-teal-100","⏳ " + translations[currentLang].kpi_generating);if (!currentKpiData || currentKpiData.length === 0) {362 unmodified lines// Allows the analytics section to be refreshed manually if needed.function toggleAiInsights() {updateAiInsights(true);}function showAiInsightsPlaceholder() {const container = document.getElementById("ai-insights-container");if (!container) return;container.replaceChildren();const message = document.createElement("p");message.className ="md:col-span-3 bg-white p-5 rounded-2xl border border-gray-100 text-sm text-gray-500";message.textContent = translations[currentLang].insights_idle;container.appendChild(message);}function renderAll() {updateSummaryCards();renderDashboardProgress();4 unmodified lineslucide.createIcons();}// Do not request AI insights automatically.showAiInsightsPlaceholder();}// Expose functions used by inline onclick handlers in index.html.
script.js+26-18