Saatavuuskyselyt: IP-organisaatio, siirrä API-tabiin + sähköpostien formatointi + tikettiviestivärit
- Lisää IP-organisaatio/ISP-kenttä saatavuuskyselyihin (ip-api.com haku) - Siirrä saatavuuskyselyt-taulukko Asiakkaat-tabista API-asetussivulle - Korjaa rivinvaihdot ja välilyönnit Zammad-sähköpostivastauksissa (white-space:pre-wrap) - Korjaa quoted thread: plain-text viestit muunnetaan HTML:ksi oikein - Tikettiviestiketjun värit selkeämmiksi (sininen=saapuva, vihreä=lähtevä) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -281,8 +281,6 @@ function switchToTab(target, subTab) {
|
||||
loadCustomers();
|
||||
if (subTab === 'archive') {
|
||||
switchCustomerSubTab('customers-archive');
|
||||
} else if (subTab === 'availability') {
|
||||
switchCustomerSubTab('customers-availability');
|
||||
} else {
|
||||
switchCustomerSubTab('customers-list');
|
||||
}
|
||||
@@ -2570,6 +2568,9 @@ async function loadSettings() {
|
||||
document.getElementById('settings-telegram-chat').value = config.telegram_chat_id || '';
|
||||
} catch (e) { console.error(e); }
|
||||
|
||||
// Lataa saatavuuskyselyt
|
||||
loadAvailabilityQueries();
|
||||
|
||||
// Näytä API-sivun kortit integraatioiden perusteella
|
||||
try {
|
||||
const integs = await apiCall('integrations');
|
||||
@@ -3497,7 +3498,6 @@ function switchCustomerSubTab(target) {
|
||||
const content = document.getElementById('subtab-' + target);
|
||||
if (content) content.classList.add('active');
|
||||
if (target === 'customers-archive') { loadArchive(); window.location.hash = 'customers/archive'; }
|
||||
else if (target === 'customers-availability') { loadAvailabilityQueries(); window.location.hash = 'customers/availability'; }
|
||||
else { window.location.hash = 'customers'; }
|
||||
}
|
||||
|
||||
@@ -3520,7 +3520,7 @@ async function loadAvailabilityQueries(page = 0) {
|
||||
countEl.textContent = `Yhteensä ${data.total} kyselyä`;
|
||||
|
||||
if (data.queries.length === 0) {
|
||||
tbody.innerHTML = '<tr><td colspan="8" style="text-align:center;color:#888;padding:2rem;">Ei vielä kyselyjä</td></tr>';
|
||||
tbody.innerHTML = '<tr><td colspan="9" style="text-align:center;color:#888;padding:2rem;">Ei vielä kyselyjä</td></tr>';
|
||||
} else {
|
||||
tbody.innerHTML = data.queries.map(q => {
|
||||
const date = q.created_at ? q.created_at.replace('T', ' ').substring(0, 16) : '';
|
||||
@@ -3542,6 +3542,7 @@ async function loadAvailabilityQueries(page = 0) {
|
||||
<td>${esc(q.kaupunki)}</td>
|
||||
<td>${badge}</td>
|
||||
<td style="font-size:0.8rem;">${ipInfo}</td>
|
||||
<td style="font-size:0.8rem;">${esc(q.org || '')}</td>
|
||||
<td style="font-size:0.8rem;color:#888;">${esc(source)}</td>
|
||||
<td style="font-size:0.8rem;color:#888;">${esc(q.company_nimi || q.company_id || '')}</td>
|
||||
</tr>`;
|
||||
|
||||
Reference in New Issue
Block a user