feat: add API endpoint for version retrieval and update HTML to display dynamic version
This commit is contained in:
parent
4477537cec
commit
8199b283c0
68
.github/workflows/providers/gitea-release.yml
vendored
68
.github/workflows/providers/gitea-release.yml
vendored
@ -37,44 +37,51 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install xxd
|
sudo apt-get install xxd
|
||||||
|
|
||||||
|
- name: Check for SPIFFS changes
|
||||||
|
id: check_spiffs
|
||||||
|
run: |
|
||||||
|
git fetch --unshallow || true
|
||||||
|
CHANGED_FILES=$(git diff --name-only HEAD^..HEAD)
|
||||||
|
if echo "$CHANGED_FILES" | grep -q "^data/\|^html/"; then
|
||||||
|
echo "SPIFFS_CHANGED=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "SPIFFS_CHANGED=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build Firmware
|
- name: Build Firmware
|
||||||
run: |
|
run: |
|
||||||
pio run -e esp32dev -t buildfs # Build SPIFFS
|
# Get version from platformio.ini
|
||||||
pio run -e esp32dev # Build firmware
|
VERSION=$(grep '^version = ' platformio.ini | cut -d'"' -f2)
|
||||||
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman.bin
|
|
||||||
cp .pio/build/esp32dev/spiffs.bin .pio/build/esp32dev/filaman_spiffs.bin
|
# Always build firmware
|
||||||
|
pio run -e esp32dev
|
||||||
|
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_${VERSION}.bin
|
||||||
|
|
||||||
|
# Only build SPIFFS if changed
|
||||||
|
if [[ "${{ steps.check_spiffs.outputs.SPIFFS_CHANGED }}" == "true" ]]; then
|
||||||
|
echo "Building SPIFFS due to changes..."
|
||||||
|
cp .pio/build/esp32dev/spiffs.bin .pio/build/esp32dev/webpage_${VERSION}.bin
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Prepare binaries
|
- name: Prepare binaries
|
||||||
run: |
|
run: |
|
||||||
# Ensure we're in the project root
|
|
||||||
cd $GITHUB_WORKSPACE
|
|
||||||
|
|
||||||
# Create SPIFFS directory if it doesn't exist
|
|
||||||
mkdir -p .pio/build/esp32dev/spiffs
|
|
||||||
|
|
||||||
# Copy firmware to SPIFFS directory
|
|
||||||
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/spiffs/firmware.bin
|
|
||||||
|
|
||||||
# Build new SPIFFS image with firmware included
|
|
||||||
pio run -t buildfs
|
|
||||||
|
|
||||||
cd .pio/build/esp32dev
|
cd .pio/build/esp32dev
|
||||||
|
VERSION=$(grep '^version = ' ../../platformio.ini | cut -d'"' -f2)
|
||||||
|
|
||||||
# Create release files
|
# Create full binary only if SPIFFS changed
|
||||||
cp spiffs.bin filaman_spiffs.bin
|
if [[ "${{ steps.check_spiffs.outputs.SPIFFS_CHANGED }}" == "true" ]]; then
|
||||||
|
|
||||||
# Create full binary
|
|
||||||
echo "Creating full binary..."
|
echo "Creating full binary..."
|
||||||
esptool.py --chip esp32 merge_bin \
|
esptool.py --chip esp32 merge_bin \
|
||||||
--fill-flash-size 4MB \
|
--fill-flash-size 4MB \
|
||||||
--flash_mode dio \
|
--flash_mode dio \
|
||||||
--flash_freq 40m \
|
--flash_freq 40m \
|
||||||
--flash_size 4MB \
|
--flash_size 4MB \
|
||||||
-o filaman_full.bin \
|
-o filaman_full_${VERSION}.bin \
|
||||||
0x0000 bootloader.bin \
|
0x0000 bootloader.bin \
|
||||||
0x8000 partitions.bin \
|
0x8000 partitions.bin \
|
||||||
0x10000 firmware.bin \
|
0x10000 firmware.bin \
|
||||||
0x390000 spiffs.bin
|
0x390000 spiffs.bin
|
||||||
|
fi
|
||||||
|
|
||||||
# Verify file sizes
|
# Verify file sizes
|
||||||
echo "File sizes:"
|
echo "File sizes:"
|
||||||
@ -87,6 +94,7 @@ jobs:
|
|||||||
TAG="${{ inputs.gitea_ref_name }}"
|
TAG="${{ inputs.gitea_ref_name }}"
|
||||||
API_URL="${{ inputs.gitea_server_url }}/api/v1"
|
API_URL="${{ inputs.gitea_server_url }}/api/v1"
|
||||||
REPO="${{ inputs.gitea_repository }}"
|
REPO="${{ inputs.gitea_repository }}"
|
||||||
|
VERSION=$(grep '^version = ' platformio.ini | cut -d'"' -f2)
|
||||||
|
|
||||||
# Create release
|
# Create release
|
||||||
RESPONSE=$(curl -k -s \
|
RESPONSE=$(curl -k -s \
|
||||||
@ -104,12 +112,20 @@ jobs:
|
|||||||
|
|
||||||
if [ -n "$RELEASE_ID" ]; then
|
if [ -n "$RELEASE_ID" ]; then
|
||||||
echo "Release created with ID: $RELEASE_ID"
|
echo "Release created with ID: $RELEASE_ID"
|
||||||
|
|
||||||
# Upload binaries
|
|
||||||
cd .pio/build/esp32dev
|
cd .pio/build/esp32dev
|
||||||
|
|
||||||
# Check if files exist before uploading
|
# Always upload firmware
|
||||||
for file in filaman_spiffs.bin filaman_full.bin; do
|
if [ -f "filaman_${VERSION}.bin" ]; then
|
||||||
|
curl -k -s \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary "@filaman_${VERSION}.bin" \
|
||||||
|
"${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=filaman_${VERSION}.bin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Upload SPIFFS and full binary only if they exist
|
||||||
|
for file in webpage_${VERSION}.bin filaman_full_${VERSION}.bin; do
|
||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
echo "Uploading $file..."
|
echo "Uploading $file..."
|
||||||
curl -k -s \
|
curl -k -s \
|
||||||
@ -118,8 +134,6 @@ jobs:
|
|||||||
-H "Content-Type: application/octet-stream" \
|
-H "Content-Type: application/octet-stream" \
|
||||||
--data-binary "@$file" \
|
--data-binary "@$file" \
|
||||||
"${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=$file"
|
"${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=$file"
|
||||||
else
|
|
||||||
echo "Warning: $file not found"
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
71
.github/workflows/providers/github-release.yml
vendored
71
.github/workflows/providers/github-release.yml
vendored
@ -26,44 +26,51 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install xxd
|
sudo apt-get install xxd
|
||||||
|
|
||||||
|
- name: Check for SPIFFS changes
|
||||||
|
id: check_spiffs
|
||||||
|
run: |
|
||||||
|
git fetch --unshallow || true
|
||||||
|
CHANGED_FILES=$(git diff --name-only HEAD^..HEAD)
|
||||||
|
if echo "$CHANGED_FILES" | grep -q "^data/\|^html/"; then
|
||||||
|
echo "SPIFFS_CHANGED=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "SPIFFS_CHANGED=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build Firmware
|
- name: Build Firmware
|
||||||
run: |
|
run: |
|
||||||
pio run -e esp32dev -t buildfs # Build SPIFFS
|
# Get version from platformio.ini
|
||||||
pio run -e esp32dev # Build firmware
|
VERSION=$(grep '^version = ' platformio.ini | cut -d'"' -f2)
|
||||||
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman.bin
|
|
||||||
cp .pio/build/esp32dev/spiffs.bin .pio/build/esp32dev/filaman_spiffs.bin
|
# Always build firmware
|
||||||
|
pio run -e esp32dev
|
||||||
|
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/filaman_${VERSION}.bin
|
||||||
|
|
||||||
|
# Only build SPIFFS if changed
|
||||||
|
if [[ "${{ steps.check_spiffs.outputs.SPIFFS_CHANGED }}" == "true" ]]; then
|
||||||
|
echo "Building SPIFFS due to changes..."
|
||||||
|
cp .pio/build/esp32dev/spiffs.bin .pio/build/esp32dev/webpage_${VERSION}.bin
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Prepare binaries
|
- name: Prepare binaries
|
||||||
run: |
|
run: |
|
||||||
# Ensure we're in the project root
|
|
||||||
cd $GITHUB_WORKSPACE
|
|
||||||
|
|
||||||
# Create SPIFFS directory if it doesn't exist
|
|
||||||
mkdir -p .pio/build/esp32dev/spiffs
|
|
||||||
|
|
||||||
# Copy firmware to SPIFFS directory
|
|
||||||
cp .pio/build/esp32dev/firmware.bin .pio/build/esp32dev/spiffs/firmware.bin
|
|
||||||
|
|
||||||
# Build new SPIFFS image with firmware included
|
|
||||||
pio run -t buildfs
|
|
||||||
|
|
||||||
cd .pio/build/esp32dev
|
cd .pio/build/esp32dev
|
||||||
|
VERSION=$(grep '^version = ' ../../platformio.ini | cut -d'"' -f2)
|
||||||
|
|
||||||
# Create release files
|
# Create full binary only if SPIFFS changed
|
||||||
cp spiffs.bin filaman_spiffs.bin
|
if [[ "${{ steps.check_spiffs.outputs.SPIFFS_CHANGED }}" == "true" ]]; then
|
||||||
|
|
||||||
# Create full binary
|
|
||||||
echo "Creating full binary..."
|
echo "Creating full binary..."
|
||||||
esptool.py --chip esp32 merge_bin \
|
esptool.py --chip esp32 merge_bin \
|
||||||
--fill-flash-size 4MB \
|
--fill-flash-size 4MB \
|
||||||
--flash_mode dio \
|
--flash_mode dio \
|
||||||
--flash_freq 40m \
|
--flash_freq 40m \
|
||||||
--flash_size 4MB \
|
--flash_size 4MB \
|
||||||
-o filaman_full.bin \
|
-o filaman_full_${VERSION}.bin \
|
||||||
0x0000 bootloader.bin \
|
0x0000 bootloader.bin \
|
||||||
0x8000 partitions.bin \
|
0x8000 partitions.bin \
|
||||||
0x10000 firmware.bin \
|
0x10000 firmware.bin \
|
||||||
0x390000 spiffs.bin
|
0x390000 spiffs.bin
|
||||||
|
fi
|
||||||
|
|
||||||
# Verify file sizes
|
# Verify file sizes
|
||||||
echo "File sizes:"
|
echo "File sizes:"
|
||||||
@ -87,16 +94,23 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
# Check which files exist and create a list for upload
|
|
||||||
cd .pio/build/esp32dev
|
cd .pio/build/esp32dev
|
||||||
|
VERSION=$(grep '^version = ' ../../platformio.ini | cut -d'"' -f2)
|
||||||
FILES_TO_UPLOAD=""
|
FILES_TO_UPLOAD=""
|
||||||
for file in filaman_spiffs.bin filaman_full.bin; do
|
|
||||||
if [ -f "$file" ]; then
|
# Always add firmware
|
||||||
FILES_TO_UPLOAD="$FILES_TO_UPLOAD .pio/build/esp32dev/$file"
|
if [ -f "filaman_${VERSION}.bin" ]; then
|
||||||
else
|
FILES_TO_UPLOAD="$FILES_TO_UPLOAD filaman_${VERSION}.bin"
|
||||||
echo "Warning: $file not found"
|
fi
|
||||||
|
|
||||||
|
# Add SPIFFS and full binary only if they exist
|
||||||
|
if [ -f "webpage_${VERSION}.bin" ]; then
|
||||||
|
FILES_TO_UPLOAD="$FILES_TO_UPLOAD webpage_${VERSION}.bin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "filaman_full_${VERSION}.bin" ]; then
|
||||||
|
FILES_TO_UPLOAD="$FILES_TO_UPLOAD filaman_full_${VERSION}.bin"
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
|
|
||||||
# Create release with available files
|
# Create release with available files
|
||||||
if [ -n "$FILES_TO_UPLOAD" ]; then
|
if [ -n "$FILES_TO_UPLOAD" ]; then
|
||||||
@ -107,3 +121,4 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo "Error: No files found to upload"
|
echo "Error: No files found to upload"
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
@ -6,13 +6,24 @@
|
|||||||
<title>FilaMan - Filament Management Tool</title>
|
<title>FilaMan - Filament Management Tool</title>
|
||||||
<link rel="icon" type="image/png" href="/favicon.ico">
|
<link rel="icon" type="image/png" href="/favicon.ico">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<script>
|
||||||
|
fetch('/api/version')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const versionSpan = document.querySelector('.version');
|
||||||
|
if (versionSpan) {
|
||||||
|
versionSpan.textContent = 'v' + data.version;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching version:', error));
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||||
<div class="logo-text">
|
<div class="logo-text">
|
||||||
<h1>FilaMan<span class="version">v1.2.91</span></h1>
|
<h1>FilaMan<span class="version"></span></h1>
|
||||||
<h4>Filament Management Tool</h4>
|
<h4>Filament Management Tool</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -33,4 +44,6 @@
|
|||||||
<div class="ram-status" id="ramStatus"></div>
|
<div class="ram-status" id="ramStatus"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
@ -6,13 +6,24 @@
|
|||||||
<title>FilaMan - Filament Management Tool</title>
|
<title>FilaMan - Filament Management Tool</title>
|
||||||
<link rel="icon" type="image/png" href="/favicon.ico">
|
<link rel="icon" type="image/png" href="/favicon.ico">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<script>
|
||||||
|
fetch('/api/version')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const versionSpan = document.querySelector('.version');
|
||||||
|
if (versionSpan) {
|
||||||
|
versionSpan.textContent = 'v' + data.version;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching version:', error));
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||||
<div class="logo-text">
|
<div class="logo-text">
|
||||||
<h1>FilaMan<span class="version">v1.2.91</span></h1>
|
<h1>FilaMan<span class="version"></span></h1>
|
||||||
<h4>Filament Management Tool</h4>
|
<h4>Filament Management Tool</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -33,6 +44,8 @@
|
|||||||
<div class="ram-status" id="ramStatus"></div>
|
<div class="ram-status" id="ramStatus"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
|
|
||||||
|
@ -6,13 +6,24 @@
|
|||||||
<title>FilaMan - Filament Management Tool</title>
|
<title>FilaMan - Filament Management Tool</title>
|
||||||
<link rel="icon" type="image/png" href="/favicon.ico">
|
<link rel="icon" type="image/png" href="/favicon.ico">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<script>
|
||||||
|
fetch('/api/version')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const versionSpan = document.querySelector('.version');
|
||||||
|
if (versionSpan) {
|
||||||
|
versionSpan.textContent = 'v' + data.version;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching version:', error));
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||||
<div class="logo-text">
|
<div class="logo-text">
|
||||||
<h1>FilaMan<span class="version">v1.2.91</span></h1>
|
<h1>FilaMan<span class="version"></span></h1>
|
||||||
<h4>Filament Management Tool</h4>
|
<h4>Filament Management Tool</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -33,6 +44,8 @@
|
|||||||
<div class="ram-status" id="ramStatus"></div>
|
<div class="ram-status" id="ramStatus"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
|
|
||||||
|
@ -6,13 +6,24 @@
|
|||||||
<title>FilaMan - Filament Management Tool</title>
|
<title>FilaMan - Filament Management Tool</title>
|
||||||
<link rel="icon" type="image/png" href="/favicon.ico">
|
<link rel="icon" type="image/png" href="/favicon.ico">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<script>
|
||||||
|
fetch('/api/version')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const versionSpan = document.querySelector('.version');
|
||||||
|
if (versionSpan) {
|
||||||
|
versionSpan.textContent = 'v' + data.version;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching version:', error));
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||||
<div class="logo-text">
|
<div class="logo-text">
|
||||||
<h1>FilaMan<span class="version">v1.2.91</span></h1>
|
<h1>FilaMan<span class="version"></span></h1>
|
||||||
<h4>Filament Management Tool</h4>
|
<h4>Filament Management Tool</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -33,6 +44,8 @@
|
|||||||
<div class="ram-status" id="ramStatus"></div>
|
<div class="ram-status" id="ramStatus"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
|
|
||||||
|
@ -6,13 +6,24 @@
|
|||||||
<title>FilaMan - Filament Management Tool</title>
|
<title>FilaMan - Filament Management Tool</title>
|
||||||
<link rel="icon" type="image/png" href="/favicon.ico">
|
<link rel="icon" type="image/png" href="/favicon.ico">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<script>
|
||||||
|
fetch('/api/version')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const versionSpan = document.querySelector('.version');
|
||||||
|
if (versionSpan) {
|
||||||
|
versionSpan.textContent = 'v' + data.version;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching version:', error));
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||||
<div class="logo-text">
|
<div class="logo-text">
|
||||||
<h1>FilaMan<span class="version">v1.2.91</span></h1>
|
<h1>FilaMan<span class="version"></span></h1>
|
||||||
<h4>Filament Management Tool</h4>
|
<h4>Filament Management Tool</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -33,6 +44,8 @@
|
|||||||
<div class="ram-status" id="ramStatus"></div>
|
<div class="ram-status" id="ramStatus"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
|
|
||||||
|
@ -6,13 +6,24 @@
|
|||||||
<title>FilaMan - Filament Management Tool</title>
|
<title>FilaMan - Filament Management Tool</title>
|
||||||
<link rel="icon" type="image/png" href="/favicon.ico">
|
<link rel="icon" type="image/png" href="/favicon.ico">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<script>
|
||||||
|
fetch('/api/version')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const versionSpan = document.querySelector('.version');
|
||||||
|
if (versionSpan) {
|
||||||
|
versionSpan.textContent = 'v' + data.version;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching version:', error));
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||||
<div class="logo-text">
|
<div class="logo-text">
|
||||||
<h1>FilaMan<span class="version">v1.2.91</span></h1>
|
<h1>FilaMan<span class="version"></span></h1>
|
||||||
<h4>Filament Management Tool</h4>
|
<h4>Filament Management Tool</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -33,6 +44,8 @@
|
|||||||
<div class="ram-status" id="ramStatus"></div>
|
<div class="ram-status" id="ramStatus"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
|
|
||||||
|
@ -6,13 +6,24 @@
|
|||||||
<title>FilaMan - Filament Management Tool</title>
|
<title>FilaMan - Filament Management Tool</title>
|
||||||
<link rel="icon" type="image/png" href="/favicon.ico">
|
<link rel="icon" type="image/png" href="/favicon.ico">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<script>
|
||||||
|
fetch('/api/version')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const versionSpan = document.querySelector('.version');
|
||||||
|
if (versionSpan) {
|
||||||
|
versionSpan.textContent = 'v' + data.version;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error fetching version:', error));
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||||
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
<img src="/logo.png" alt="FilaMan Logo" class="logo">
|
||||||
<div class="logo-text">
|
<div class="logo-text">
|
||||||
<h1>FilaMan<span class="version">v1.2.91</span></h1>
|
<h1>FilaMan<span class="version"></span></h1>
|
||||||
<h4>Filament Management Tool</h4>
|
<h4>Filament Management Tool</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -33,6 +44,8 @@
|
|||||||
<div class="ram-status" id="ramStatus"></div>
|
<div class="ram-status" id="ramStatus"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
<!-- head -->
|
<!-- head -->
|
||||||
|
|
||||||
|
@ -19,8 +19,10 @@ monitor_speed = 115200
|
|||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
tzapu/WiFiManager @ ^2.0.17
|
tzapu/WiFiManager @ ^2.0.17
|
||||||
https://github.com/me-no-dev/ESPAsyncWebServer.git#master
|
#https://github.com/me-no-dev/ESPAsyncWebServer.git#master
|
||||||
me-no-dev/AsyncTCP @ ^1.1.1
|
#me-no-dev/AsyncTCP @ ^1.1.1
|
||||||
|
mathieucarbou/ESPAsyncWebServer @ ^3.6.0
|
||||||
|
esp32async/AsyncTCP @ ^3.3.5
|
||||||
bogde/HX711 @ ^0.7.5
|
bogde/HX711 @ ^0.7.5
|
||||||
adafruit/Adafruit SSD1306 @ ^2.5.13
|
adafruit/Adafruit SSD1306 @ ^2.5.13
|
||||||
adafruit/Adafruit GFX Library @ ^1.11.11
|
adafruit/Adafruit GFX Library @ ^1.11.11
|
||||||
@ -48,37 +50,20 @@ build_flags =
|
|||||||
-DCORE_DEBUG_LEVEL=3
|
-DCORE_DEBUG_LEVEL=3
|
||||||
-DCONFIG_ARDUHAL_LOG_COLORS=1
|
-DCONFIG_ARDUHAL_LOG_COLORS=1
|
||||||
-DOTA_DEBUG=1
|
-DOTA_DEBUG=1
|
||||||
-DARDUINO_RUNNING_CORE=1
|
|
||||||
-DARDUINO_EVENT_RUNNING_CORE=1
|
|
||||||
-DCONFIG_OPTIMIZATION_LEVEL_DEBUG=1
|
-DCONFIG_OPTIMIZATION_LEVEL_DEBUG=1
|
||||||
-DCONFIG_ESP32_PANIC_PRINT_REBOOT
|
-DCONFIG_ESP32_PANIC_PRINT_REBOOT
|
||||||
-DCONFIG_ARDUINO_OTA_READSIZE=1024
|
|
||||||
-DCONFIG_ASYNC_TCP_RUNNING_CORE=1
|
|
||||||
-DCONFIG_ASYNC_TCP_USE_WDT=0
|
|
||||||
-DCONFIG_LWIP_TCP_MSS=1460
|
|
||||||
-DOTA_PARTITION_SUBTYPE=0x10
|
|
||||||
-DPARTITION_TABLE_OFFSET=0x8000
|
|
||||||
-DPARTITION_TABLE_SIZE=0x1000
|
|
||||||
-DCONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=1
|
|
||||||
-DCONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=1
|
|
||||||
-DCONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON=1
|
|
||||||
-DCONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0x1000
|
|
||||||
-DCONFIG_PARTITION_TABLE_OFFSET=0x8000
|
|
||||||
-DCONFIG_PARTITION_TABLE_MD5=y
|
|
||||||
-DBOOT_APP_PARTITION_OTA_0=1
|
-DBOOT_APP_PARTITION_OTA_0=1
|
||||||
-DCONFIG_LOG_DEFAULT_LEVEL=3
|
-DCONFIG_LOG_DEFAULT_LEVEL=3
|
||||||
|
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
scripts/extra_script.py
|
scripts/extra_script.py
|
||||||
pre:scripts/pre_build.py ; wird zuerst ausgeführt
|
${env:buildfs.extra_scripts}
|
||||||
pre:scripts/pre_spiffs.py ; wird als zweites ausgeführt
|
|
||||||
pre:scripts/combine_html.py ; wird als drittes ausgeführt
|
|
||||||
scripts/gzip_files.py
|
|
||||||
|
|
||||||
; Remove or comment out the targets line
|
[env:buildfs]
|
||||||
;targets = buildfs, build
|
extra_scripts =
|
||||||
|
pre:scripts/combine_html.py ; Combine header with HTML files
|
||||||
|
scripts/gzip_files.py ; Compress files for SPIFFS
|
||||||
|
|
||||||
; Add a custom target to build both
|
|
||||||
[platformio]
|
[platformio]
|
||||||
default_envs = esp32dev
|
default_envs = esp32dev
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
// Cache-Control Header definieren
|
// Cache-Control Header definieren
|
||||||
#define CACHE_CONTROL "max-age=31536000" // Cache für 1 Jahr
|
#define CACHE_CONTROL "max-age=31536000" // Cache für 1 Jahr
|
||||||
|
#define VERSION "1.0.0"
|
||||||
|
|
||||||
AsyncWebServer server(webserverPort);
|
AsyncWebServer server(webserverPort);
|
||||||
AsyncWebSocket ws("/ws");
|
AsyncWebSocket ws("/ws");
|
||||||
@ -363,6 +364,11 @@ void setupWebserver(AsyncWebServer &server) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
server.on("/api/version", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||||
|
String jsonResponse = "{\"version\": \"" VERSION "\"}";
|
||||||
|
request->send(200, "application/json", jsonResponse);
|
||||||
|
});
|
||||||
|
|
||||||
// Fehlerbehandlung für nicht gefundene Seiten
|
// Fehlerbehandlung für nicht gefundene Seiten
|
||||||
server.onNotFound([](AsyncWebServerRequest *request){
|
server.onNotFound([](AsyncWebServerRequest *request){
|
||||||
Serial.print("404 - Nicht gefunden: ");
|
Serial.print("404 - Nicht gefunden: ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user