Merge branch 'main' into patch-1

This commit is contained in:
Abdenasser Elidrissi 2024-11-07 23:37:39 +01:00 committed by GitHub
commit 66500d0a55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 926 additions and 90 deletions

48
.github/workflows/build-check.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: Build Check
on:
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Linux Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
pkg-config \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libglib2.0-dev \
libjavascriptcoregtk-4.0-dev \
libsoup-3.0-dev \
libwebkit2gtk-4.1-dev
- name: Install Dependencies
run: npm install
- name: Build Frontend
run: npm run build
- name: Build Application
run: npm run tauri build

View File

@ -0,0 +1,156 @@
name: Linux (aarch64) Nightly Build
on:
workflow_dispatch: # Allows manual triggering
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC
env:
CARGO_TERM_COLOR: always
PKG_CONFIG_ALLOW_CROSS: 1
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG: /usr/bin/aarch64-linux-gnu-pkg-config
jobs:
build:
name: Build Linux aarch64 Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-unknown-linux-gnu
- name: Configure ARM64 repositories
run: |
sudo dpkg --add-architecture arm64
# Remove all existing sources
sudo rm -rf /etc/apt/sources.list.d/*
sudo truncate -s 0 /etc/apt/sources.list
# Add only ports.ubuntu.com repository
sudo tee /etc/apt/sources.list << EOF
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse
deb [arch=amd64] http://azure.archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
deb [arch=amd64] http://azure.archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse
deb [arch=amd64] http://azure.archive.ubuntu.com/ubuntu jammy-security main restricted universe multiverse
EOF
sudo apt-get update
# Install required packages including cross-compilation tools
sudo apt-get install -y \
build-essential \
pkg-config \
crossbuild-essential-arm64 \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
libgtk-3-dev:arm64 \
libayatana-appindicator3-dev:arm64 \
librsvg2-dev:arm64 \
libglib2.0-dev:arm64 \
libjavascriptcoregtk-4.0-dev:arm64 \
libsoup-3.0-dev:arm64 \
libwebkit2gtk-4.1-dev:arm64 \
libssl-dev:arm64 \
libssl-dev \
openssl:arm64
# Configure pkg-config for cross-compilation
echo "PKG_CONFIG=/usr/bin/aarch64-linux-gnu-pkg-config" >> $GITHUB_ENV
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
- name: Install Dependencies
run: npm install
- name: Setup cross-compilation environment
run: |
sudo apt-get install -y \
crossbuild-essential-arm64 \
pkg-config \
libssl-dev:arm64 \
libssl-dev \
openssl:arm64 \
file \
desktop-file-utils \
libfuse2 \
qemu-user-static
# Setup pkg-config
sudo tee /usr/bin/aarch64-linux-gnu-pkg-config << 'EOF'
#!/bin/sh
export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
exec pkg-config "$@"
EOF
sudo chmod +x /usr/bin/aarch64-linux-gnu-pkg-config
# Create .cargo/config
mkdir -p .cargo
cat > .cargo/config << EOF
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
ar = "aarch64-linux-gnu-ar"
EOF
# Download and setup appimagetool for ARM64
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage
chmod +x appimagetool-aarch64.AppImage
sudo mv appimagetool-aarch64.AppImage /usr/local/bin/appimagetool
# Set environment variables
echo "PKG_CONFIG=/usr/bin/aarch64-linux-gnu-pkg-config" >> $GITHUB_ENV
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
echo "OPENSSL_DIR=/usr" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=/usr/include/aarch64-linux-gnu" >> $GITHUB_ENV
echo "OPENSSL_LIB_DIR=/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "APPIMAGE_EXTRACT_AND_RUN=1" >> $GITHUB_ENV
- name: Build Frontend
run: npm run build
- name: Build AppImage
run: |
echo "Building AppImage for aarch64..."
npm run tauri build -- --target aarch64-unknown-linux-gnu --bundles appimage
- name: Build Debian Package
run: |
echo "Building Debian package for aarch64..."
npm run tauri build -- --target aarch64-unknown-linux-gnu --bundles deb
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: linux-appimage-aarch64
path: src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/appimage/*.AppImage
- name: Upload Debian Package
uses: actions/upload-artifact@v4
with:
name: linux-deb-aarch64
path: src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/deb/*.deb
- name: Get version from package.json
id: version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Create Release
if: github.event_name == 'workflow_dispatch'
uses: softprops/action-gh-release@v1
with:
name: "Linux ARM64 Nightly Build v${{ steps.version.outputs.version }}"
tag_name: "linux-arm64-nightly-${{ steps.version.outputs.version }}"
files: |
src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/appimage/*.AppImage
src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/deb/*.deb
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}

View File

@ -0,0 +1,84 @@
name: Linux (x86_64) Nightly Build
on:
workflow_dispatch: # Allows manual triggering
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build Linux Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Linux Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
pkg-config \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libglib2.0-dev \
libjavascriptcoregtk-4.0-dev \
libsoup-3.0-dev \
libwebkit2gtk-4.1-dev
- name: Install Dependencies
run: |
npm install
- name: Build Frontend
run: npm run build
- name: Build AppImage (x86_64)
run: |
echo "Building AppImage for x86_64..."
npm run tauri build -- --target x86_64-unknown-linux-gnu --bundles appimage
- name: Build Debian Package (x86_64)
run: |
echo "Building Debian package for x86_64..."
npm run tauri build -- --target x86_64-unknown-linux-gnu --bundles deb
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: linux-appimage
path: src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage
- name: Upload Debian Package
uses: actions/upload-artifact@v4
with:
name: linux-deb
path: src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb
- name: Get version from package.json
id: version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Create Release
if: github.event_name == 'workflow_dispatch'
uses: softprops/action-gh-release@v1
with:
name: "Linux x86_64 Nightly Build v${{ steps.version.outputs.version }}"
tag_name: "linux-x86_64-nightly-${{ steps.version.outputs.version }}"
files: |
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}

98
.github/workflows/macos-nightly.yml vendored Normal file
View File

@ -0,0 +1,98 @@
name: MacOS (Intel/Apple Silicon) Nightly Build
on:
workflow_dispatch: # Allows manual triggering
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build MacOS Apps
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Dependencies
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
npm install
- name: Set up keychain
run: |
security create-keychain -p "" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "" build.keychain
echo "$MACOS_CERTIFICATE" | base64 --decode > /tmp/certificate.p12
security import /tmp/certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
- name: Build Frontend
run: npm run build
- name: Build for Intel Mac
run: |
echo "Building for Intel Mac..."
npm run tauri build -- --target x86_64-apple-darwin --bundles dmg
# Rename the Intel build
cd src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/
for f in *.dmg; do mv "$f" "intel-$f"; done
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Build for Apple Silicon
run: |
echo "Building for aarch64..."
npm run tauri build -- --target aarch64-apple-darwin --bundles dmg
# Rename the Apple Silicon build
cd src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/
for f in *.dmg; do mv "$f" "silicon-$f"; done
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Upload Intel Build
uses: actions/upload-artifact@v4
with:
name: macos-intel-build
path: src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/*.dmg
- name: Upload Apple Silicon Build
uses: actions/upload-artifact@v4
with:
name: macos-apple-silicon-build
path: src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg
- name: Get version from package.json
id: version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Create Release
if: github.event_name == 'workflow_dispatch'
uses: softprops/action-gh-release@v1
with:
name: "MacOS Nightly Build v${{ steps.version.outputs.version }}"
tag_name: "macos-nightly-${{ steps.version.outputs.version }}"
files: |
src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/*.dmg
src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}

34
.github/workflows/test-release.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Test Release Build
on:
workflow_dispatch: # Manual trigger
jobs:
trigger-builds:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Trigger MacOS Build
uses: benc-uk/workflow-dispatch@v1
with:
workflow: macos-nightly.yml
token: ${{ secrets.PAT_TOKEN }}
- name: Trigger Windows Build
uses: benc-uk/workflow-dispatch@v1
with:
workflow: windows-nightly.yml
token: ${{ secrets.PAT_TOKEN }}
- name: Trigger Linux x86_64 Build
uses: benc-uk/workflow-dispatch@v1
with:
workflow: linux-x86_64-nightly.yml
token: ${{ secrets.PAT_TOKEN }}
- name: Trigger Linux ARM64 Build
uses: benc-uk/workflow-dispatch@v1
with:
workflow: linux-aarch64-nightly.yml
token: ${{ secrets.PAT_TOKEN }}

64
.github/workflows/windows-nightly.yml vendored Normal file
View File

@ -0,0 +1,64 @@
name: Windows (x86_64) Nightly Build
on:
workflow_dispatch: # Allows manual triggering
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build Windows Executable
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install WebView2
run: |
$WebView2InstallPath = "$env:TEMP\MicrosoftEdgeWebview2Setup.exe"
Invoke-WebRequest "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile $WebView2InstallPath
Start-Process -FilePath $WebView2InstallPath -Args "/silent /install" -Wait
- name: Install Dependencies
run: |
npm install
- name: Build Frontend
run: npm run build
- name: Build Windows Executable
run: |
echo "Building Windows executable..."
npm run tauri build
- name: Upload Executable
uses: actions/upload-artifact@v4
with:
name: windows-exe
path: src-tauri/target/release/*.exe
- name: Get version from package.json
id: version
shell: bash # Force using bash shell
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Create Release
if: github.event_name == 'workflow_dispatch'
uses: softprops/action-gh-release@v1
with:
name: "Windows Nightly Build v${{ steps.version.outputs.version }}"
tag_name: "windows-nightly-${{ steps.version.outputs.version }}"
files: src-tauri/target/release/*.exe
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}

View File

@ -1,38 +0,0 @@
#!/bin/bash
# source .env for notarization credentials
echo "Sourcing .env..."
if [ -f .env ]; then
source .env
# Verify that required environment variables are set
if [ -z "$APPLE_ID" ] || [ -z "$APPLE_PASSWORD" ] || [ -z "$APPLE_TEAM_ID" ]; then
echo "Error: Required environment variables are not set"
echo "Please ensure your .env file contains:"
echo "APPLE_ID=your.email@example.com"
echo "APPLE_PASSWORD=your-app-specific-password"
echo "APPLE_TEAM_ID=your-team-id"
exit 1
fi
# Export the variables so they are available to child processes
export APPLE_ID
export APPLE_PASSWORD
export APPLE_TEAM_ID
else
echo "Error: .env file not found"
echo "Please create a .env file with the following variables:"
echo "APPLE_ID=your.email@example.com"
echo "APPLE_PASSWORD=your-app-specific-password"
echo "APPLE_TEAM_ID=your-team-id"
exit 1
fi
# Build frontend
npm run build
# Build for Intel
echo "Building for x86_64..."
npm run tauri build -- --target x86_64-apple-darwin --bundles dmg
# Build for Apple Silicon
echo "Building for aarch64..."
npm run tauri build -- --target aarch64-apple-darwin --bundles dmg

View File

@ -127,39 +127,98 @@
<section id="download" class="downloads">
<div class="download-container glass-card">
<h2>Download</h2>
<p class="download-subtitle">Choose the version that matches your system</p>
<div class="download-options">
<a href="https://github.com/Abdenasser/neohtop/releases/download/v1.0.5/NeoHtop-intel.dmg"
class="download-button intel">
<span class="icon">💻</span>
<div class="button-text">
<span class="primary">Intel Mac</span>
<span class="secondary">For Intel-based Macs</span>
</div>
</a>
<a href="https://github.com/Abdenasser/neohtop/releases/download/v1.0.5/NeoHtop-silicon.dmg"
class="download-button silicon">
<span class="icon">🍎</span>
<div class="button-text">
<span class="primary">Apple Silicon</span>
<span class="secondary">For M1/M2/M3 Macs</span>
</div>
</a>
<a href="https://github.com/Abdenasser/neohtop/releases/download/v1.0.5/NeoHtop-linux-arm64.deb"
class="download-button linux">
<span class="icon">🐧</span>
<div class="button-text">
<span class="primary">Linux ARM64</span>
<span class="secondary">For ARM64-based Linux (.deb)</span>
</div>
</a>
<h2>Download NeoHtop</h2>
<p class="download-subtitle">Choose your platform to get started</p>
<div class="version-info">
Current Version: <span id="current-version">Loading...</span>
</div>
<div class="trust-badge">
<span class="verified-icon"></span>
<span class="verified-text">Notarized by Apple for enhanced security</span>
<a href="https://developer.apple.com/documentation/security/notarizing-macos-software-before-distribution"
target="_blank" rel="noopener" class="learn-more">Learn more</a>
<div class="download-options">
<!-- macOS Downloads -->
<div class="download-group">
<h3 class="platform-title">macOS</h3>
<!-- notarized by apple badge -->
<div class="notarized-badge">
<img
src="https://img.shields.io/badge/Notarized%20by%20Apple-000000?style=for-the-badge&logo=apple&logoColor=white"
alt="Notarized by Apple">
</div>
<div class="platform-options">
<a href="" class="download-button macos" data-type="macos-intel" data-version="latest">
<span class="icon">💻</span>
<div class="button-text">
<span class="primary">Intel Chip</span>
<span class="secondary">macOS 10.15 or later</span>
</div>
</a>
<a href="" class="download-button macos" data-type="macos-silicon" data-version="latest">
<span class="icon">🍎</span>
<div class="button-text">
<span class="primary">Apple Silicon</span>
<span class="secondary">macOS 11.0 or later</span>
</div>
</a>
</div>
</div>
<!-- Windows Download -->
<div class="download-group">
<h3 class="platform-title">Windows</h3>
<div class="platform-options">
<a href="" class="download-button windows" data-type="windows" data-version="latest">
<span class="icon">🫣</span>
<div class="button-text">
<span class="primary">Windows</span>
<span class="secondary">Windows 10 or later</span>
</div>
</a>
</div>
</div>
<!-- Linux Downloads -->
<div class="download-group">
<h3 class="platform-title">Linux</h3>
<div class="platform-options">
<!-- x86_64 Downloads -->
<div class="linux-downloads">
<h4>x86_64</h4>
<a href="" class="download-button linux" data-type="linux-deb-x64" data-version="latest">
<span class="icon">📦</span>
<div class="button-text">
<span class="primary">.deb Package</span>
<span class="secondary">Debian/Ubuntu</span>
</div>
</a>
<a href="" class="download-button linux" data-type="linux-appimage-x64" data-version="latest"
style="margin-top: 10px;">
<span class="icon">🐧</span>
<div class="button-text">
<span class="primary">AppImage</span>
<span class="secondary">Universal Linux</span>
</div>
</a>
</div>
<!-- ARM64 Downloads -->
<div class="linux-downloads">
<h4>ARM64</h4>
<a href="" class="download-button linux" data-type="linux-deb-arm64" data-version="latest">
<span class="icon">📦</span>
<div class="button-text">
<span class="primary">.deb Package</span>
<span class="secondary">Debian/Ubuntu ARM64</span>
</div>
</a>
<a href="" class="download-button linux" data-type="linux-appimage-arm64" data-version="latest"
style="margin-top: 10px;">
<span class="icon">🐧</span>
<div class="button-text">
<span class="primary">AppImage</span>
<span class="secondary">Universal Linux ARM64</span>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
</section>
@ -327,6 +386,62 @@
</p>
</div>
</footer>
<script>
async function updateVersion() {
try {
const response = await fetch('https://api.github.com/repos/Abdenasser/neohtop/releases/latest');
const data = await response.json();
const version = data.tag_name;
// Extract just the version number (e.g., "1.0.6" from "macos-nightly-1.0.6")
const versionNumber = version.match(/\d+\.\d+\.\d+/)?.[0];
document.getElementById('current-version').textContent = versionNumber;
if (versionNumber) {
// Update all download URLs with the latest version
const downloadLinks = document.querySelectorAll('.download-button');
downloadLinks.forEach(link => {
const platform = link.getAttribute('data-type');
let newHref;
switch (platform) {
case 'macos-intel':
newHref = `https://github.com/Abdenasser/neohtop/releases/download/macos-nightly-${versionNumber}/intel-NeoHtop_${versionNumber}_x64.dmg`;
break;
case 'macos-silicon':
newHref = `https://github.com/Abdenasser/neohtop/releases/download/macos-nightly-${versionNumber}/silicon-NeoHtop_${versionNumber}_aarch64.dmg`;
break;
case 'windows':
newHref = `https://github.com/Abdenasser/neohtop/releases/download/windows-nightly-${versionNumber}/NeoHtop.exe`;
break;
case 'linux-deb-x64':
newHref = `https://github.com/Abdenasser/neohtop/releases/download/linux-x86_64-nightly-${versionNumber}/NeoHtop_${versionNumber}_amd64.deb`;
break;
case 'linux-appimage-x64':
newHref = `https://github.com/Abdenasser/neohtop/releases/download/linux-x86_64-nightly-${versionNumber}/NeoHtop_${versionNumber}_amd64.AppImage`;
break;
case 'linux-deb-arm64':
newHref = `https://github.com/Abdenasser/neohtop/releases/download/linux-arm64-nightly-${versionNumber}/NeoHtop_${versionNumber}_arm64.deb`;
break;
case 'linux-appimage-arm64':
newHref = `https://github.com/Abdenasser/neohtop/releases/download/linux-arm64-nightly-${versionNumber}/NeoHtop_${versionNumber}_aarch64.AppImage`;
break;
}
if (newHref) {
link.href = newHref;
}
});
}
} catch (error) {
console.error('Failed to fetch version:', error);
}
}
document.addEventListener('DOMContentLoaded', () => {
updateVersion();
});
</script>
</body>
</html>

View File

@ -348,28 +348,60 @@ section {
/* Download Section */
.download-options {
display: flex;
gap: 1rem;
gap: 1.5rem;
justify-content: center;
margin: 2rem 0;
flex-wrap: wrap;
padding: 0 1rem;
}
.download-button {
background: var(--primary-color);
color: white;
padding: 1rem 2rem;
padding: 1rem 1.5rem;
border-radius: 8px;
text-decoration: none;
display: flex;
align-items: center;
gap: 0.5rem;
gap: 1rem;
transition: all 0.2s;
position: relative;
min-width: 250px;
}
.download-button .button-text {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.download-button .primary {
font-weight: 600;
font-size: 1rem;
}
.download-button .secondary {
font-size: 0.85rem;
opacity: 0.9;
}
/* New styles for nested links */
.download-button .secondary a {
color: inherit;
text-decoration: none;
padding: 2px 6px;
border-radius: 4px;
transition: all 0.2s;
display: inline-block;
}
.download-button .secondary a:hover {
background-color: rgba(255, 255, 255, 0.2);
transform: translateY(-1px);
}
.download-button:hover {
transform: translateY(-2px);
background: var(--secondary-color);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.download-button .icon {
@ -1104,4 +1136,221 @@ footer {
.hero-background {
flex: 0 0 100%;
}
}
.download-button.windows {
background: #00a4ef;
}
.download-button.windows:hover {
background: #0090d5;
}
.download-button.linux {
background: #E95420;
}
.download-button.linux:hover {
background: #C7431B;
}
.download-options-group {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.download-option {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.85rem;
}
.download-option .format {
color: rgba(255, 255, 255, 0.8);
min-width: 65px;
}
.download-option .separator {
color: rgba(255, 255, 255, 0.4);
font-size: 0.7rem;
}
.download-option a {
color: inherit;
text-decoration: none;
padding: 2px 6px;
border-radius: 4px;
transition: all 0.2s;
}
.download-option a:hover {
background-color: rgba(255, 255, 255, 0.2);
transform: translateY(-1px);
}
.download-button.linux .secondary {
line-height: 1.6;
font-size: 0.85rem;
}
.download-button.linux .secondary a {
color: inherit;
text-decoration: none;
padding: 2px 6px;
border-radius: 4px;
transition: all 0.2s;
white-space: nowrap;
}
.download-button.linux .secondary a:hover {
background-color: rgba(255, 255, 255, 0.2);
transform: translateY(-1px);
}
.download-button.linux .secondary .separator {
opacity: 0.7;
margin: 0 2px;
}
.downloads {
padding: 2rem 0;
}
.download-container {
max-width: 900px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
.download-container h2 {
font-size: 2.5rem;
margin-bottom: 1rem;
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.download-subtitle {
color: var(--text-secondary);
margin-bottom: 3rem;
}
.download-options {
display: flex;
flex-direction: column;
gap: 2.5rem;
}
.download-group {
display: flex;
flex-direction: column;
gap: 1rem;
}
.platform-title {
font-size: 1.2rem;
color: var(--text-secondary);
text-align: left;
margin-bottom: 0.5rem;
}
.platform-options {
display: flex;
gap: 1rem;
justify-content: center;
}
.download-button {
background: var(--primary-color);
color: white;
padding: 1rem 1.5rem;
border-radius: 12px;
text-decoration: none;
display: flex;
align-items: center;
gap: 1rem;
transition: all 0.2s;
border: 1px solid transparent;
min-width: 250px;
}
.download-button:hover {
transform: translateY(-2px);
background: var(--secondary-color);
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.download-button .icon {
font-size: 1.5rem;
}
.button-text {
display: flex;
flex-direction: column;
gap: 0.25rem;
text-align: left;
}
.button-text .primary {
font-weight: 600;
font-size: 1rem;
}
.button-text .secondary {
font-size: 0.85rem;
opacity: 0.9;
}
.linux-options {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.format-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.format-label {
font-size: 0.9rem;
color: var(--text-secondary);
text-align: left;
}
.format-buttons {
display: flex;
gap: 1rem;
justify-content: center;
}
.format-buttons .download-button {
min-width: 150px;
}
/* Dark mode adjustments */
[data-theme="dark"] .download-button {
background: rgba(30, 41, 59, 0.8);
border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .download-button:hover {
border-color: var(--primary-color);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.version-info {
text-align: center;
margin: 1rem 0;
font-size: 0.9rem;
color: var(--text-secondary);
}
#current-version {
font-weight: 600;
color: var(--primary-color);
}

View File

@ -1,6 +1,6 @@
{
"name": "macos-task-manager",
"version": "1.0.5",
"version": "1.0.7",
"description": "",
"type": "module",
"scripts": {

2
src-tauri/Cargo.lock generated
View File

@ -1608,7 +1608,7 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
[[package]]
name = "macos-task-manager"
version = "1.0.5"
version = "1.0.7"
dependencies = [
"serde",
"serde_json",

View File

@ -1,6 +1,6 @@
[package]
name = "macos-task-manager"
version = "1.0.5"
version = "1.0.7"
description = "A Tauri App"
authors = ["you"]
edition = "2021"

View File

@ -28,7 +28,7 @@
},
"productName": "NeoHtop",
"mainBinaryName": "NeoHtop",
"version": "1.0.5",
"version": "1.0.7",
"identifier": "com.neohtop.dev",
"plugins": {},
"app": {

View File

@ -32,16 +32,43 @@
"https://api.github.com/repos/abdenasser/neohtop/releases/latest",
);
const data = await response.json();
latestVersion = data.tag_name.replace("v", "");
hasUpdate = version && latestVersion && version !== latestVersion;
// Extract version number from tag (e.g., "1.0.6" from "macos-nightly-1.0.6")
const versionMatch = data.tag_name.match(/\d+\.\d+\.\d+/);
if (!versionMatch) {
console.warn(
"Unexpected version format in latest release:",
data.tag_name,
);
return;
}
latestVersion = versionMatch[0];
// Extract version number from current version
const currentVersionMatch = version.match(/\d+\.\d+\.\d+/);
if (!currentVersionMatch) {
console.warn("Unexpected current version format:", version);
return;
}
// Compare only the version numbers
hasUpdate = currentVersionMatch[0] !== latestVersion;
} catch (error) {
console.error("Failed to check latest version:", error);
latestVersion = "";
hasUpdate = false;
}
}
onMount(async () => {
version = await getVersion();
await checkLatestVersion();
try {
version = await getVersion();
await checkLatestVersion();
} catch (error) {
console.error("Failed to initialize version info:", error);
version = "";
}
});
</script>
@ -85,14 +112,13 @@
<span class="label">source</span>
<span class="separator">::</span>
<a
href={APP_INFO.github}
class="value"
target="_blank"
rel="noopener noreferrer"
>
href={APP_INFO.github}
class="value"
target="_blank"
rel="noopener noreferrer"
>
{APP_INFO.github}
</a>
</a>
</div>
<div class="detail-row">
<span class="label">stack</span>