Add AI application assistant: Indeed import + Ollama document generation
- Browser extension (Chromium MV3) injecting a "send to tracker" button next to the Indeed job description; scrapes job info and posts it to a new /api/indeed-import endpoint (CORS-enabled), configurable tracker URL via popup. - New "Entwurf" status. Imports create a draft and trigger background AI generation of tailored Anschreiben + Lebenslauf (PDF attachments) via the Ollama Cloud API, grounded strictly in user-provided base documents. - Vorlagen page to manage base documents; attachments UI, generation status polling, regenerate and download routes on the application page. - Schema: ort/stellenbeschreibung/quelle_url/generierung_* columns, plus basis_dokumente and anhaenge tables (with migrations). - Config via .env (OLLAMA_API_KEY/OLLAMA_MODEL/OLLAMA_HOST); dependency-free .env loader. Dockerfile copies lib/, .dockerignore added. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
const DEFAULT_TRACKER_URL = 'http://localhost:3000';
|
||||
|
||||
const input = document.getElementById('trackerUrl');
|
||||
const statusEl = document.getElementById('status');
|
||||
|
||||
function normalize(url) {
|
||||
return (url || '').trim().replace(/\/+$/, '');
|
||||
}
|
||||
|
||||
function setStatus(text, cls) {
|
||||
statusEl.textContent = text;
|
||||
statusEl.className = cls || '';
|
||||
}
|
||||
|
||||
// Load stored value
|
||||
chrome.storage.sync.get({ trackerUrl: DEFAULT_TRACKER_URL }, (items) => {
|
||||
input.value = items.trackerUrl || DEFAULT_TRACKER_URL;
|
||||
});
|
||||
|
||||
document.getElementById('saveBtn').addEventListener('click', () => {
|
||||
const url = normalize(input.value) || DEFAULT_TRACKER_URL;
|
||||
chrome.storage.sync.set({ trackerUrl: url }, () => {
|
||||
input.value = url;
|
||||
setStatus('Gespeichert.', 'ok');
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById('testBtn').addEventListener('click', async () => {
|
||||
const url = normalize(input.value) || DEFAULT_TRACKER_URL;
|
||||
setStatus('Teste Verbindung…', '');
|
||||
try {
|
||||
const res = await fetch(url + '/api/settings', { method: 'GET' });
|
||||
if (res.ok) {
|
||||
setStatus('Verbindung erfolgreich ✓', 'ok');
|
||||
} else {
|
||||
setStatus('Erreichbar, aber unerwartete Antwort (' + res.status + ').', 'err');
|
||||
}
|
||||
} catch (err) {
|
||||
setStatus('Nicht erreichbar: ' + err.message, 'err');
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user