Fix Jumpstart Dashboard, API, and Fetchers to support real-time generation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
DIRECTUS_PUBLIC_URL=https://net1.jumpstartscaling.com/
|
||||
DIRECTUS_ADMIN_TOKEN=
|
||||
DIRECTUS_PUBLIC_URL=https://spark.jumpstartscaling.com
|
||||
DIRECTUS_ADMIN_TOKEN=uRveQcRxowz289YW-6fukxNNMQH7a86p
|
||||
DIRECTUS_ADMIN_EMAIL=somescreenname@gmail.com
|
||||
DIRECTUS_ADMIN_PASSWORD=KuJ85Qt96FtfKE5O8u6QgFzuojUfMgDh
|
||||
|
||||
@@ -56,6 +56,7 @@ async function main() {
|
||||
{ collection: 'article_templates', schema: { name: 'article_templates' }, meta: { note: 'Article structure definitions' } },
|
||||
{ collection: 'generation_jobs', schema: { name: 'generation_jobs' }, meta: { note: 'Queued generation tasks' } },
|
||||
{ collection: 'generated_articles', schema: { name: 'generated_articles' }, meta: { note: 'Final HTML output' } },
|
||||
{ collection: 'work_log', schema: { name: 'work_log' }, meta: { note: 'System event logs' } },
|
||||
];
|
||||
|
||||
for (const col of collections) {
|
||||
@@ -129,6 +130,14 @@ async function main() {
|
||||
await createFieldSafe('generated_articles', 'generation_hash', 'string');
|
||||
await createFieldSafe('generated_articles', 'site_id', 'integer');
|
||||
|
||||
// Work Log
|
||||
await createFieldSafe('work_log', 'site', 'string'); // ID or relation
|
||||
await createFieldSafe('work_log', 'action', 'string');
|
||||
await createFieldSafe('work_log', 'entity_type', 'string');
|
||||
await createFieldSafe('work_log', 'entity_id', 'string');
|
||||
await createFieldSafe('work_log', 'details', 'text');
|
||||
await createFieldSafe('work_log', 'status', 'string');
|
||||
|
||||
// --- 3. Import Data ---
|
||||
console.log('--- Importing Data (Full Sync) ---');
|
||||
|
||||
|
||||
27
backend/scripts/list_jobs.ts
Normal file
27
backend/scripts/list_jobs.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
import { createDirectus, rest, staticToken, readItems } from '@directus/sdk';
|
||||
import * as dotenv from 'dotenv';
|
||||
import * as path from 'path';
|
||||
|
||||
// Load credentials
|
||||
const envPath = path.resolve(__dirname, '../credentials.env');
|
||||
dotenv.config({ path: envPath });
|
||||
|
||||
const client = createDirectus(process.env.DIRECTUS_PUBLIC_URL || '')
|
||||
.with(staticToken(process.env.DIRECTUS_ADMIN_TOKEN || ''))
|
||||
.with(rest());
|
||||
|
||||
async function listJobs() {
|
||||
try {
|
||||
console.log("Fetching jobs from", process.env.DIRECTUS_PUBLIC_URL);
|
||||
const jobs = await client.request(readItems('generation_jobs', {
|
||||
sort: ['-date_created'],
|
||||
limit: 5
|
||||
}));
|
||||
console.log("Found jobs:", JSON.stringify(jobs, null, 2));
|
||||
} catch (error) {
|
||||
console.error("Error fetching jobs:", error);
|
||||
}
|
||||
}
|
||||
|
||||
listJobs();
|
||||
Reference in New Issue
Block a user