Skip to content

Commit

Permalink
Merge pull request #3 from SFSteffensen/Auto-Calculation
Browse files Browse the repository at this point in the history
Add 'Measure Speed' Button and Auto-Calculate Feature
  • Loading branch information
SFSteffensen authored Aug 13, 2024
2 parents 92c5959 + 31fc408 commit 360e0ca
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ jobs:
fail-fast: false
matrix:
include:
- platform: "macos-latest" # for Arm-based Macs (M1 and above).
args: "--target aarch64-apple-darwin"
rust-target: "aarch64-apple-darwin"
- platform: "macos-latest" # for Intel-based Macs.
args: "--target x86_64-apple-darwin"
rust-target: "x86_64-apple-darwin"
- platform: "ubuntu-22.04" # for Ubuntu (Tauri v2)
args: "--target x86_64-unknown-linux-gnu"
rust-target: "x86_64-unknown-linux-gnu"
- platform: "windows-latest" # for Windows
args: "--target x86_64-pc-windows-msvc"
rust-target: "x86_64-pc-windows-msvc"
- platform: "macos-latest" # for Arm-based Macs (M1 and above).
args: "--target aarch64-apple-darwin"
rust-target: "aarch64-apple-darwin"
- platform: "macos-latest" # for Intel-based Macs.
args: "--target x86_64-apple-darwin"
rust-target: "x86_64-apple-darwin"
- platform: "ubuntu-22.04" # for Ubuntu (Tauri v2)
args: "--target x86_64-unknown-linux-gnu"
rust-target: "x86_64-unknown-linux-gnu"
- platform: "windows-latest" # for Windows
args: "--target x86_64-pc-windows-msvc"
rust-target: "x86_64-pc-windows-msvc"

runs-on: ${{ matrix.platform }}
steps:
Expand Down Expand Up @@ -64,4 +64,5 @@ jobs:
releaseBody: "This is the official release of DTime version __VERSION__." # The release notes.
releaseDraft: false # Set to true if you want to create a draft release.
prerelease: false # Set to true if this is a pre-release.
generateReleaseNotes: true # Automatically generate release notes based on commits and PRs.
args: ${{ matrix.args }}
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dtime"
version = "1.0.1"
version = "1.0.2"
description = "DTime"
authors = ["Sebastian Steffensen"]
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"productName": "DTime",
"version": "1.0.1",
"version": "1.0.2",
"identifier": "sfsteffensen.dev",
"build": {
"beforeDevCommand": "yarn run dev",
Expand Down
8 changes: 7 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,17 @@ function App() {

const unitInput = document.getElementById("internet-speed-unit") as HTMLSelectElement;
if (unitInput) unitInput.value = "mbps";

// Automatically run the calculate function if file size and unit are set
if (fileSize() && fileSizeUnit()) {
await calculate();
}
} finally {
setLoadingSpeedTest(false);
}
}


return (
<div class="flex items-center justify-center min-h-screen bg-base-100 text-base-content">
<div class="px-4 sm:px-6 md:px-8 lg:px-32 xl:px-64 2xl:px-96 relative">
Expand Down Expand Up @@ -124,7 +130,7 @@ function App() {
{loadingCalculate() ? "Calculating..." : "Calculate"}
</button>
<button type="button" class="btn btn-outline btn-primary flex-1" onClick={testSpeed} disabled={loadingSpeedTest()}>
{loadingSpeedTest() ? "Testing..." : "Test Speed"}
{loadingSpeedTest() ? "Measuring Speed..." : "Measure Speed"}
</button>
</div>
</form>
Expand Down

0 comments on commit 360e0ca

Please sign in to comment.