UI styling improvements: dashboard headers and navigation
- Restore blue PageHeader on Dashboard (/app-components) - Update homepage (/) with subtle header design without blue bar - Add uniform PageHeader styling to application edit page - Fix Rapporten link on homepage to point to /reports overview - Improve header descriptions spacing for better readability
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
BACKUP_DIR="${BACKUP_DIR:-./backups}"
|
||||
DATE=$(date +%Y%m%d_%H%M%S)
|
||||
CONTAINER_NAME="${CONTAINER_NAME:-zuyderland-cmdb-gui-backend-1}"
|
||||
CONTAINER_NAME="${CONTAINER_NAME:-cmdb-insight-backend-1}"
|
||||
|
||||
# Create backup directory if it doesn't exist
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
@@ -4,7 +4,7 @@ set -e
|
||||
# Configuration - Azure Container Registry
|
||||
ACR_NAME="${ACR_NAME:-zuyderlandcmdbacr}" # Pas aan naar jouw ACR naam
|
||||
REGISTRY="${REGISTRY:-${ACR_NAME}.azurecr.io}"
|
||||
REPO_NAME="${REPO_NAME:-zuyderland-cmdb-gui}"
|
||||
REPO_NAME="${REPO_NAME:-cmdb-insight}"
|
||||
VERSION="${1:-latest}"
|
||||
|
||||
# Colors for output
|
||||
|
||||
89
scripts/reset-and-rebuild.sh
Executable file
89
scripts/reset-and-rebuild.sh
Executable file
@@ -0,0 +1,89 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script to completely reset the database cache and rebuild from scratch
|
||||
# This clears all cached data and triggers a full sync from Jira
|
||||
|
||||
set -e
|
||||
|
||||
echo "🔄 Complete Database Reset and Rebuild"
|
||||
echo "======================================"
|
||||
echo ""
|
||||
|
||||
# Check if backend is running
|
||||
BACKEND_URL="${BACKEND_URL:-http://localhost:3001}"
|
||||
API_URL="${API_URL:-$BACKEND_URL/api}"
|
||||
|
||||
echo "📡 Checking backend connection..."
|
||||
if ! curl -s -f "$BACKEND_URL/health" > /dev/null 2>&1; then
|
||||
echo "⚠️ Backend is not accessible at $BACKEND_URL"
|
||||
echo " Make sure the backend is running and accessible"
|
||||
echo ""
|
||||
read -p "Continue anyway? (yes/no): " confirm
|
||||
if [ "$confirm" != "yes" ]; then
|
||||
echo "❌ Aborted."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "✅ Backend is accessible"
|
||||
echo ""
|
||||
|
||||
# Check if we need authentication
|
||||
echo "🔐 Checking authentication..."
|
||||
AUTH_HEADER=""
|
||||
if [ -n "$API_TOKEN" ]; then
|
||||
AUTH_HEADER="-H \"Authorization: Bearer $API_TOKEN\""
|
||||
echo "✅ Using API token from environment"
|
||||
elif [ -f ".env" ]; then
|
||||
# Try to get token from .env or session
|
||||
echo "ℹ️ Note: You may need to authenticate via the UI first"
|
||||
echo " Or set API_TOKEN environment variable"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Step 1: Clear all cache
|
||||
echo "🗑️ Step 1: Clearing all cached data..."
|
||||
CLEAR_RESPONSE=$(curl -s -X DELETE "$API_URL/cache/clear" \
|
||||
-H "Content-Type: application/json" \
|
||||
$AUTH_HEADER 2>&1)
|
||||
|
||||
if echo "$CLEAR_RESPONSE" | grep -q "cleared\|status"; then
|
||||
echo "✅ Cache cleared successfully"
|
||||
else
|
||||
echo "⚠️ Clear response: $CLEAR_RESPONSE"
|
||||
echo " This might indicate an authentication issue"
|
||||
echo ""
|
||||
read -p "Continue with sync anyway? (yes/no): " confirm
|
||||
if [ "$confirm" != "yes" ]; then
|
||||
echo "❌ Aborted."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Step 2: Trigger full sync
|
||||
echo "🔄 Step 2: Triggering full sync from Jira..."
|
||||
SYNC_RESPONSE=$(curl -s -X POST "$API_URL/cache/sync" \
|
||||
-H "Content-Type: application/json" \
|
||||
$AUTH_HEADER 2>&1)
|
||||
|
||||
if echo "$SYNC_RESPONSE" | grep -q "started\|status"; then
|
||||
echo "✅ Full sync started in background"
|
||||
echo ""
|
||||
echo "📊 The sync is running in the background. You can monitor progress:"
|
||||
echo " - Check cache status: curl $API_URL/cache/status"
|
||||
echo " - View backend logs: docker-compose logs -f backend"
|
||||
echo " - Or check the UI: $BACKEND_URL (Settings → Cache Management)"
|
||||
else
|
||||
echo "⚠️ Sync response: $SYNC_RESPONSE"
|
||||
echo " This might indicate an authentication issue or missing Jira credentials"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
echo "✨ Reset and rebuild process initiated!"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo "1. Monitor sync progress via the UI or API"
|
||||
echo "2. Wait for sync to complete (this may take several minutes)"
|
||||
echo "3. Verify data in the UI or via: curl $API_URL/cache/status"
|
||||
echo ""
|
||||
88
scripts/reset-postgres.sh
Executable file
88
scripts/reset-postgres.sh
Executable file
@@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script om PostgreSQL database volledig te resetten
|
||||
# Dit simuleert een green field deployment
|
||||
# Gebruikt docker-compose.dev.yml voor development setup
|
||||
|
||||
set -e
|
||||
|
||||
COMPOSE_FILE="docker-compose.dev.yml"
|
||||
|
||||
echo "🔄 PostgreSQL Database Reset Script"
|
||||
echo "===================================="
|
||||
echo ""
|
||||
|
||||
# Check if docker-compose file exists
|
||||
if [ ! -f "$COMPOSE_FILE" ]; then
|
||||
echo "⚠️ $COMPOSE_FILE not found, trying docker-compose.yml..."
|
||||
COMPOSE_FILE="docker-compose.yml"
|
||||
fi
|
||||
|
||||
# Check if docker-compose is running
|
||||
if docker-compose -f "$COMPOSE_FILE" ps 2>/dev/null | grep -q "postgres.*Up"; then
|
||||
echo "📦 PostgreSQL container is running"
|
||||
echo ""
|
||||
|
||||
# Stop containers
|
||||
echo "⏹️ Stopping containers..."
|
||||
docker-compose -f "$COMPOSE_FILE" down
|
||||
echo "✅ Containers stopped"
|
||||
echo ""
|
||||
else
|
||||
echo "ℹ️ Containers are not running"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Remove PostgreSQL volume (this deletes all data!)
|
||||
echo "🗑️ Removing PostgreSQL volume (this deletes ALL data)..."
|
||||
read -p "Are you sure you want to delete all PostgreSQL data? (yes/no): " confirm
|
||||
|
||||
if [ "$confirm" != "yes" ]; then
|
||||
echo "❌ Aborted. No data was deleted."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Try to find volume name
|
||||
VOLUME_NAME=$(docker volume ls | grep postgres_data | awk '{print $2}' | head -1)
|
||||
if [ -n "$VOLUME_NAME" ]; then
|
||||
docker volume rm "$VOLUME_NAME" 2>/dev/null || echo "⚠️ Volume not found (might already be deleted)"
|
||||
echo "✅ Volume removed"
|
||||
else
|
||||
echo "⚠️ No postgres_data volume found"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Start containers again
|
||||
echo "🚀 Starting containers with fresh database..."
|
||||
docker-compose -f "$COMPOSE_FILE" up -d postgres
|
||||
|
||||
# Wait for PostgreSQL to be ready
|
||||
echo "⏳ Waiting for PostgreSQL to be ready..."
|
||||
timeout=30
|
||||
counter=0
|
||||
until docker-compose -f "$COMPOSE_FILE" exec -T postgres pg_isready -U cmdb > /dev/null 2>&1; do
|
||||
sleep 1
|
||||
counter=$((counter + 1))
|
||||
if [ $counter -ge $timeout ]; then
|
||||
echo "❌ Timeout waiting for PostgreSQL"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo "✅ PostgreSQL is ready"
|
||||
echo ""
|
||||
|
||||
# Create databases (if needed)
|
||||
echo "📊 Creating databases..."
|
||||
docker-compose -f "$COMPOSE_FILE" exec -T postgres psql -U cmdb -c "CREATE DATABASE cmdb_cache;" 2>/dev/null || echo "ℹ️ Database cmdb_cache already exists or will be created automatically"
|
||||
docker-compose -f "$COMPOSE_FILE" exec -T postgres psql -U cmdb -c "CREATE DATABASE cmdb_classifications;" 2>/dev/null || echo "ℹ️ Database cmdb_classifications already exists or will be created automatically"
|
||||
echo "✅ Databases ready"
|
||||
echo ""
|
||||
|
||||
echo "✨ PostgreSQL database has been reset!"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo "1. Start the backend locally: cd backend && npm run dev"
|
||||
echo "2. The normalized schema will be created automatically on first start"
|
||||
echo "3. Run schema discovery: npm run generate-schema (in backend/)"
|
||||
echo "4. Start syncing data from Jira"
|
||||
echo ""
|
||||
Reference in New Issue
Block a user