Initial fleet skill
This commit is contained in:
30
scripts/autorun.sh
Normal file
30
scripts/autorun.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
SKILL_DIR="$(dirname "$(dirname "$0")")"
|
||||
UI_DIR="$SKILL_DIR/ui"
|
||||
|
||||
echo "=== Fleet Dashboard Setup ==="
|
||||
|
||||
# Check for Node.js
|
||||
if ! command -v node &>/dev/null; then
|
||||
echo "Installing Node.js..."
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
||||
apt-get install -y nodejs
|
||||
fi
|
||||
|
||||
echo "Node.js version: $(node --version)"
|
||||
echo "npm version: $(npm --version)"
|
||||
|
||||
# Install UI dependencies
|
||||
cd "$UI_DIR"
|
||||
if [ ! -d "node_modules" ]; then
|
||||
echo "Installing UI dependencies..."
|
||||
npm install
|
||||
fi
|
||||
|
||||
# Build UI
|
||||
echo "Building UI..."
|
||||
npm run build
|
||||
|
||||
echo "Fleet Dashboard setup complete"
|
||||
22
scripts/run.sh
Normal file
22
scripts/run.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
FLEET_UI_PORT="${FLEET_UI_PORT:-3000}"
|
||||
SKILL_DIR="$(dirname "$(dirname "$0")")"
|
||||
UI_DIR="$SKILL_DIR/ui"
|
||||
|
||||
export FLEET_UI_PORT
|
||||
export FLEET_API_URL="${FLEET_API_URL:-http://localhost:3001}"
|
||||
|
||||
echo "Starting Fleet Dashboard on port $FLEET_UI_PORT..."
|
||||
echo "Fleet API: $FLEET_API_URL"
|
||||
|
||||
cd "$UI_DIR"
|
||||
|
||||
if [ "${NODE_ENV:-production}" = "development" ]; then
|
||||
echo "Running in development mode..."
|
||||
exec npm run dev -- --port "$FLEET_UI_PORT" --host
|
||||
else
|
||||
echo "Running in production mode..."
|
||||
exec npm run preview -- --port "$FLEET_UI_PORT" --host
|
||||
fi
|
||||
Reference in New Issue
Block a user