static planning

This commit is contained in:
Bastien COIGNOUX
2025-07-14 17:43:39 +02:00
parent 56cca2b498
commit 62c6bb5fa5
5 changed files with 19 additions and 35 deletions

View File

@ -36,3 +36,11 @@ npm run build
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
Pour créer la BDD en local :
npm run init-db
Pour lancer l'application
npm run dev

Binary file not shown.

View File

@ -1,35 +0,0 @@
// scripts/init-db.ts
import Database from 'better-sqlite3';
import { mkdirSync, existsSync } from 'fs';
if (!existsSync('data')) {
mkdirSync('data');
}
const db = new Database('data.db');
db.exec(`
DROP TABLE IF EXISTS tasks;
DROP TABLE IF EXISTS links;
CREATE TABLE tasks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
text TEXT NOT NULL,
start TEXT NOT NULL,
end TEXT NOT NULL,
duration INTEGER,
progress INTEGER,
type TEXT,
parent INTEGER,
lazy BOOLEAN DEFAULT 0 -- ✅ Ajout ici
);
CREATE TABLE links (
id INTEGER PRIMARY KEY AUTOINCREMENT,
source INTEGER,
target INTEGER,
type TEXT
);
`);
console.log('✅ Base de données initialisée avec succès.');

View File

@ -4,4 +4,14 @@ import { resolve } from 'path';
// 📁 chemin absolu vers la BDD SQLite
const db = new Database(resolve('data.db'));
db.exec(`
CREATE TABLE IF NOT EXISTS resource_planning (
id INTEGER PRIMARY KEY AUTOINCREMENT,
ressource TEXT NOT NULL,
profil TEXT NOT NULL,
date TEXT NOT NULL,
disponibilite REAL NOT NULL
);
`);
export default db;

View File

@ -25,6 +25,7 @@
<a href="/" class:selected={current === "/"} title="Accueil">🏠</a>
<a href="/gantt" class:selected={current === "/gantt"} title="Gantt">📅</a>
<a href="/import" class:selected={current === "/import"} title="Importer">📂</a>
<a href="/planning" class="block px-4 py-2 hover:bg-gray-100">📅</a>
<a href="/config" class:selected={current === "/config"} title="Config">⚙️</a>
</nav>
<button class="reset-btn" on:click={resetData} title="Réinitialiser les données">