Update UI to match consistent layout patterns between pages
- Refactor Add Stream page to match Teams page layout with glass panels - Rename "Add Stream" to "Streams" in navigation and page title - Add existing streams display with loading states and empty state - Implement unified design system with modern glass morphism styling - Add Header and Footer components with OBS status monitoring - Update global CSS with comprehensive component styling - Consolidate client components into main page files - Add real-time OBS connection status with 30-second polling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
1d4b1eefba
commit
c28baa9e44
19 changed files with 2388 additions and 567 deletions
81
scripts/createSatSummer2025Tables.ts
Normal file
81
scripts/createSatSummer2025Tables.ts
Normal file
|
@ -0,0 +1,81 @@
|
|||
import sqlite3 from 'sqlite3';
|
||||
import { open } from 'sqlite';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { getTableName, BASE_TABLE_NAMES } from '../lib/constants';
|
||||
|
||||
const FILE_DIRECTORY = path.resolve(process.env.FILE_DIRECTORY || './files');
|
||||
|
||||
const ensureDirectoryExists = (dirPath: string) => {
|
||||
if (!fs.existsSync(dirPath)) {
|
||||
fs.mkdirSync(dirPath, { recursive: true });
|
||||
console.log(`Created directory: ${dirPath}`);
|
||||
}
|
||||
};
|
||||
|
||||
const createSatSummer2025Tables = async () => {
|
||||
try {
|
||||
// Ensure the files directory exists
|
||||
ensureDirectoryExists(FILE_DIRECTORY);
|
||||
|
||||
const dbPath = path.join(FILE_DIRECTORY, 'sources.db');
|
||||
|
||||
// Open database connection
|
||||
const db = await open({
|
||||
filename: dbPath,
|
||||
driver: sqlite3.Database,
|
||||
});
|
||||
|
||||
console.log('Database connection established.');
|
||||
|
||||
// Generate table names for sat_summer_2025
|
||||
const streamsTableName = getTableName(BASE_TABLE_NAMES.STREAMS, {
|
||||
year: 2025,
|
||||
season: 'summer',
|
||||
suffix: 'sat'
|
||||
});
|
||||
|
||||
const teamsTableName = getTableName(BASE_TABLE_NAMES.TEAMS, {
|
||||
year: 2025,
|
||||
season: 'summer',
|
||||
suffix: 'sat'
|
||||
});
|
||||
|
||||
console.log(`Creating tables: ${streamsTableName} and ${teamsTableName}`);
|
||||
|
||||
// Create streams table
|
||||
await db.exec(`
|
||||
CREATE TABLE IF NOT EXISTS ${streamsTableName} (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name TEXT NOT NULL,
|
||||
obs_source_name TEXT NOT NULL,
|
||||
url TEXT NOT NULL,
|
||||
team_id INTEGER NOT NULL
|
||||
)
|
||||
`);
|
||||
|
||||
console.log(`✅ Created table: ${streamsTableName}`);
|
||||
|
||||
// Create teams table
|
||||
await db.exec(`
|
||||
CREATE TABLE IF NOT EXISTS ${teamsTableName} (
|
||||
team_id INTEGER PRIMARY KEY,
|
||||
team_name TEXT NOT NULL
|
||||
)
|
||||
`);
|
||||
|
||||
console.log(`✅ Created table: ${teamsTableName}`);
|
||||
|
||||
// Close database connection
|
||||
await db.close();
|
||||
console.log('Database connection closed.');
|
||||
console.log('✅ Successfully created sat_summer_2025 tables!');
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error creating tables:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
// Run the script
|
||||
createSatSummer2025Tables();
|
59
scripts/verifyTables.ts
Normal file
59
scripts/verifyTables.ts
Normal file
|
@ -0,0 +1,59 @@
|
|||
import sqlite3 from 'sqlite3';
|
||||
import { open } from 'sqlite';
|
||||
import path from 'path';
|
||||
|
||||
const FILE_DIRECTORY = path.resolve(process.env.FILE_DIRECTORY || './files');
|
||||
|
||||
const verifyTables = async () => {
|
||||
try {
|
||||
const dbPath = path.join(FILE_DIRECTORY, 'sources.db');
|
||||
|
||||
const db = await open({
|
||||
filename: dbPath,
|
||||
driver: sqlite3.Database,
|
||||
});
|
||||
|
||||
console.log('Checking all tables in the database...\n');
|
||||
|
||||
// Get all table names
|
||||
const tables = await db.all(`
|
||||
SELECT name FROM sqlite_master
|
||||
WHERE type='table'
|
||||
ORDER BY name
|
||||
`);
|
||||
|
||||
console.log('Tables found:');
|
||||
for (const table of tables) {
|
||||
console.log(`- ${table.name}`);
|
||||
}
|
||||
|
||||
// Check sat_summer_2025 tables specifically
|
||||
const satSummerTables = tables.filter(t =>
|
||||
t.name.includes('2025_summer_sat')
|
||||
);
|
||||
|
||||
if (satSummerTables.length > 0) {
|
||||
console.log('\n✅ sat_summer_2025 tables found:');
|
||||
for (const table of satSummerTables) {
|
||||
console.log(` - ${table.name}`);
|
||||
|
||||
// Get column info
|
||||
const columns = await db.all(`PRAGMA table_info(${table.name})`);
|
||||
console.log(' Columns:');
|
||||
for (const col of columns) {
|
||||
console.log(` - ${col.name} (${col.type})`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('\n❌ No sat_summer_2025 tables found!');
|
||||
}
|
||||
|
||||
await db.close();
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error verifying tables:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
verifyTables();
|
Loading…
Add table
Add a link
Reference in a new issue