第一次提交
24
.gitignore
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
3
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
|
||||
}
|
||||
7
README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Tauri + Vanilla
|
||||
|
||||
This template should help get you started developing with Tauri in vanilla HTML, CSS and Javascript.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
|
||||
351
package-lock.json
generated
Normal file
@@ -0,0 +1,351 @@
|
||||
{
|
||||
"name": "attendance_app",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "attendance_app",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@tauri-apps/plugin-dialog": "^2.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^2"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/api": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.9.1.tgz",
|
||||
"integrity": "sha512-IGlhP6EivjXHepbBic618GOmiWe4URJiIeZFlB7x3czM0yDHHYviH1Xvoiv4FefdkQtn6v7TuwWCRfOGdnVUGw==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/tauri"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.9.5.tgz",
|
||||
"integrity": "sha512-z88tX6O6kwTgMjYozhNGbehzQyBazgXejyH784CwSfBOWm06xFcogd0PY/jhcPsqzJF9kLRIkmlQy+cqdrioOQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tauri": "tauri.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/tauri"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@tauri-apps/cli-darwin-arm64": "2.9.5",
|
||||
"@tauri-apps/cli-darwin-x64": "2.9.5",
|
||||
"@tauri-apps/cli-linux-arm-gnueabihf": "2.9.5",
|
||||
"@tauri-apps/cli-linux-arm64-gnu": "2.9.5",
|
||||
"@tauri-apps/cli-linux-arm64-musl": "2.9.5",
|
||||
"@tauri-apps/cli-linux-riscv64-gnu": "2.9.5",
|
||||
"@tauri-apps/cli-linux-x64-gnu": "2.9.5",
|
||||
"@tauri-apps/cli-linux-x64-musl": "2.9.5",
|
||||
"@tauri-apps/cli-win32-arm64-msvc": "2.9.5",
|
||||
"@tauri-apps/cli-win32-ia32-msvc": "2.9.5",
|
||||
"@tauri-apps/cli-win32-x64-msvc": "2.9.5"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli-darwin-arm64": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.9.5.tgz",
|
||||
"integrity": "sha512-P5XDyCwq3VbWGAplyfP/bgmuUITVDcypxgZUyX45SM7HbU1Nrkk0cNK1HCOkuNBAVVbWen2GUNWah/AiupHHXg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli-darwin-x64": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.9.5.tgz",
|
||||
"integrity": "sha512-JC9UfQ2ZKavx60dnNxsWztRF3oUH3dgPwN1WJ3/5RUy2aNwD/vXqvJAfNFZ4GWeQpoQ+PqJxduev0U4OMQonnA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli-linux-arm-gnueabihf": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.9.5.tgz",
|
||||
"integrity": "sha512-iCQm2Uvx8AheghfG/QUv1y8Ga9yquJt6xJwH1uF0x5KfmJmwBi8pHBvB924dDi59PS84qTdIBeJejQT00QX3Iw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli-linux-arm64-gnu": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.9.5.tgz",
|
||||
"integrity": "sha512-b6AW8Gr5nQOQIYH0TsUev7rEThGHIvsx192eElOmOz/dh33J4pninHK32laMj2hzHMJ27qmDq5vANL+wrFo9sg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli-linux-arm64-musl": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.9.5.tgz",
|
||||
"integrity": "sha512-/gRBMnphS9E8riZ0LIbBhZ9Oy16A2rx/g3DGR0DcDBvUtkLfbL0lMu4s+sY85nkn9An15+cZ1ZK6d7AIqWahLA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli-linux-riscv64-gnu": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.9.5.tgz",
|
||||
"integrity": "sha512-NOzjPF9YIBodjdkFcJmqINT0k3YDoR5ANM/jg6Z6s3Zmk8ScN6inI60jTxcfgfWyITiKsPy7GJyYou3Cm2XNzw==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli-linux-x64-gnu": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.9.5.tgz",
|
||||
"integrity": "sha512-SfGbwgvTphM5y+J91NyU/psleMUlyyPkZyDCFg8WU1HX8DpKUT3Vwhb/W1xpUBGb56tJgGCO46FCVkr8w4Areg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli-linux-x64-musl": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.9.5.tgz",
|
||||
"integrity": "sha512-ZfeoiASAOGDzyvN+TDAg8A1pCeS082h4uc0vZKvtWUN+9QBIMfz0yJwltAv+SN/afap6NS6DVkbPV3UVuI9V5A==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli-win32-arm64-msvc": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.9.5.tgz",
|
||||
"integrity": "sha512-ulg7irow+ekjaK4inFHVq7m1KQebDSYNb17DFKV+h+x7qnLZymz2gHK7df2u4YyEjqvzwRd3AJpU3HNxRurSFQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli-win32-ia32-msvc": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.9.5.tgz",
|
||||
"integrity": "sha512-6lF0k/Qduhn1Z3IOXlp2ts8jNOMIX4cK4Fbk3axGeX7LMcVVbOSEAFwbTqS8BKZDFac0WRS8N1C96+Ms5LOS1Q==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/cli-win32-x64-msvc": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.9.5.tgz",
|
||||
"integrity": "sha512-Vg50U74x1A4b2iBVtDcAVPbI1XVuzSmwlduuBM1VewxtRaVj5GDzWnYtBcnuIk+VGzNApRDfDhraAXGaW2a/Gw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/plugin-dialog": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-dialog/-/plugin-dialog-2.4.2.tgz",
|
||||
"integrity": "sha512-lNIn5CZuw8WZOn8zHzmFmDSzg5zfohWoa3mdULP0YFh/VogVdMVWZPcWSHlydsiJhRQYaTNSYKN7RmZKE2lCYQ==",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.8.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.9.1.tgz",
|
||||
"integrity": "sha512-IGlhP6EivjXHepbBic618GOmiWe4URJiIeZFlB7x3czM0yDHHYviH1Xvoiv4FefdkQtn6v7TuwWCRfOGdnVUGw=="
|
||||
},
|
||||
"@tauri-apps/cli": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.9.5.tgz",
|
||||
"integrity": "sha512-z88tX6O6kwTgMjYozhNGbehzQyBazgXejyH784CwSfBOWm06xFcogd0PY/jhcPsqzJF9kLRIkmlQy+cqdrioOQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@tauri-apps/cli-darwin-arm64": "2.9.5",
|
||||
"@tauri-apps/cli-darwin-x64": "2.9.5",
|
||||
"@tauri-apps/cli-linux-arm-gnueabihf": "2.9.5",
|
||||
"@tauri-apps/cli-linux-arm64-gnu": "2.9.5",
|
||||
"@tauri-apps/cli-linux-arm64-musl": "2.9.5",
|
||||
"@tauri-apps/cli-linux-riscv64-gnu": "2.9.5",
|
||||
"@tauri-apps/cli-linux-x64-gnu": "2.9.5",
|
||||
"@tauri-apps/cli-linux-x64-musl": "2.9.5",
|
||||
"@tauri-apps/cli-win32-arm64-msvc": "2.9.5",
|
||||
"@tauri-apps/cli-win32-ia32-msvc": "2.9.5",
|
||||
"@tauri-apps/cli-win32-x64-msvc": "2.9.5"
|
||||
}
|
||||
},
|
||||
"@tauri-apps/cli-darwin-arm64": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.9.5.tgz",
|
||||
"integrity": "sha512-P5XDyCwq3VbWGAplyfP/bgmuUITVDcypxgZUyX45SM7HbU1Nrkk0cNK1HCOkuNBAVVbWen2GUNWah/AiupHHXg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tauri-apps/cli-darwin-x64": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.9.5.tgz",
|
||||
"integrity": "sha512-JC9UfQ2ZKavx60dnNxsWztRF3oUH3dgPwN1WJ3/5RUy2aNwD/vXqvJAfNFZ4GWeQpoQ+PqJxduev0U4OMQonnA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tauri-apps/cli-linux-arm-gnueabihf": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.9.5.tgz",
|
||||
"integrity": "sha512-iCQm2Uvx8AheghfG/QUv1y8Ga9yquJt6xJwH1uF0x5KfmJmwBi8pHBvB924dDi59PS84qTdIBeJejQT00QX3Iw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tauri-apps/cli-linux-arm64-gnu": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.9.5.tgz",
|
||||
"integrity": "sha512-b6AW8Gr5nQOQIYH0TsUev7rEThGHIvsx192eElOmOz/dh33J4pninHK32laMj2hzHMJ27qmDq5vANL+wrFo9sg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tauri-apps/cli-linux-arm64-musl": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.9.5.tgz",
|
||||
"integrity": "sha512-/gRBMnphS9E8riZ0LIbBhZ9Oy16A2rx/g3DGR0DcDBvUtkLfbL0lMu4s+sY85nkn9An15+cZ1ZK6d7AIqWahLA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tauri-apps/cli-linux-riscv64-gnu": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.9.5.tgz",
|
||||
"integrity": "sha512-NOzjPF9YIBodjdkFcJmqINT0k3YDoR5ANM/jg6Z6s3Zmk8ScN6inI60jTxcfgfWyITiKsPy7GJyYou3Cm2XNzw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tauri-apps/cli-linux-x64-gnu": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.9.5.tgz",
|
||||
"integrity": "sha512-SfGbwgvTphM5y+J91NyU/psleMUlyyPkZyDCFg8WU1HX8DpKUT3Vwhb/W1xpUBGb56tJgGCO46FCVkr8w4Areg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tauri-apps/cli-linux-x64-musl": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.9.5.tgz",
|
||||
"integrity": "sha512-ZfeoiASAOGDzyvN+TDAg8A1pCeS082h4uc0vZKvtWUN+9QBIMfz0yJwltAv+SN/afap6NS6DVkbPV3UVuI9V5A==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tauri-apps/cli-win32-arm64-msvc": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.9.5.tgz",
|
||||
"integrity": "sha512-ulg7irow+ekjaK4inFHVq7m1KQebDSYNb17DFKV+h+x7qnLZymz2gHK7df2u4YyEjqvzwRd3AJpU3HNxRurSFQ==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tauri-apps/cli-win32-ia32-msvc": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.9.5.tgz",
|
||||
"integrity": "sha512-6lF0k/Qduhn1Z3IOXlp2ts8jNOMIX4cK4Fbk3axGeX7LMcVVbOSEAFwbTqS8BKZDFac0WRS8N1C96+Ms5LOS1Q==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tauri-apps/cli-win32-x64-msvc": {
|
||||
"version": "2.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.9.5.tgz",
|
||||
"integrity": "sha512-Vg50U74x1A4b2iBVtDcAVPbI1XVuzSmwlduuBM1VewxtRaVj5GDzWnYtBcnuIk+VGzNApRDfDhraAXGaW2a/Gw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@tauri-apps/plugin-dialog": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-dialog/-/plugin-dialog-2.4.2.tgz",
|
||||
"integrity": "sha512-lNIn5CZuw8WZOn8zHzmFmDSzg5zfohWoa3mdULP0YFh/VogVdMVWZPcWSHlydsiJhRQYaTNSYKN7RmZKE2lCYQ==",
|
||||
"requires": {
|
||||
"@tauri-apps/api": "^2.8.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
15
package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "attendance_app",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/plugin-dialog": "^2.4.2"
|
||||
}
|
||||
}
|
||||
7
src-tauri/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
|
||||
# Generated by Tauri
|
||||
# will have schema files for capabilities auto-completion
|
||||
/gen/schemas
|
||||
5594
src-tauri/Cargo.lock
generated
Normal file
31
src-tauri/Cargo.toml
Normal file
@@ -0,0 +1,31 @@
|
||||
[package]
|
||||
name = "attendance_app"
|
||||
version = "0.1.0"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[lib]
|
||||
# The `_lib` suffix may seem redundant but it is necessary
|
||||
# to make the lib name unique and wouldn't conflict with the bin name.
|
||||
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
||||
name = "attendance_app_lib"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "2", features = [] }
|
||||
tauri-plugin-opener = "2"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
tauri-plugin-dialog = "2"
|
||||
calamine = "0.32.0"
|
||||
rust_xlsxwriter = "0.92.2"
|
||||
chrono = { version = "0.4.42", features = ["serde"] }
|
||||
anyhow = "1.0.100"
|
||||
dirs = "6.0.0"
|
||||
|
||||
3
src-tauri/build.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
13
src-tauri/capabilities/default.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "../gen/schemas/desktop-schema.json",
|
||||
"identifier": "default",
|
||||
"description": "Capability for the main window",
|
||||
"windows": [
|
||||
"main"
|
||||
],
|
||||
"permissions": [
|
||||
"core:default",
|
||||
"opener:default",
|
||||
"dialog:default"
|
||||
]
|
||||
}
|
||||
BIN
src-tauri/icons/128x128.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src-tauri/icons/128x128@2x.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
src-tauri/icons/32x32.png
Normal file
|
After Width: | Height: | Size: 974 B |
BIN
src-tauri/icons/Square107x107Logo.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
src-tauri/icons/Square142x142Logo.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
src-tauri/icons/Square150x150Logo.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
src-tauri/icons/Square284x284Logo.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
src-tauri/icons/Square30x30Logo.png
Normal file
|
After Width: | Height: | Size: 903 B |
BIN
src-tauri/icons/Square310x310Logo.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
src-tauri/icons/Square44x44Logo.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src-tauri/icons/Square71x71Logo.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
src-tauri/icons/Square89x89Logo.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
src-tauri/icons/StoreLogo.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src-tauri/icons/icon.icns
Normal file
BIN
src-tauri/icons/icon.ico
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
src-tauri/icons/icon.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
75
src-tauri/src/data_processor.rs
Normal file
@@ -0,0 +1,75 @@
|
||||
use crate::excel_reader::{ClassData, Student};
|
||||
use chrono::Datelike;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct MonthlyRecord {
|
||||
pub month: u32,
|
||||
pub month_name: String, // e.g., "9月"
|
||||
pub count: i32,
|
||||
pub price: f64,
|
||||
pub total: f64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct StudentReport {
|
||||
pub student: Student,
|
||||
pub monthly_records: Vec<MonthlyRecord>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ClassReport {
|
||||
pub class_name: String,
|
||||
pub students: Vec<StudentReport>,
|
||||
}
|
||||
|
||||
pub fn process_data(classes: Vec<ClassData>) -> Vec<ClassReport> {
|
||||
let mut reports = Vec::new();
|
||||
|
||||
for class_data in classes {
|
||||
let price = if class_data.class_name.contains("思维") {
|
||||
30.0
|
||||
} else {
|
||||
24.0
|
||||
};
|
||||
|
||||
let mut student_reports = Vec::new();
|
||||
|
||||
for record in class_data.records {
|
||||
let mut month_counts: HashMap<u32, i32> = HashMap::new();
|
||||
|
||||
for (date, _) in record.attendance {
|
||||
let month = date.month();
|
||||
*month_counts.entry(month).or_insert(0) += 1;
|
||||
}
|
||||
|
||||
let mut monthly_records = Vec::new();
|
||||
let mut months: Vec<u32> = month_counts.keys().cloned().collect();
|
||||
months.sort();
|
||||
|
||||
for month in months {
|
||||
let count = month_counts[&month];
|
||||
monthly_records.push(MonthlyRecord {
|
||||
month,
|
||||
month_name: format!("{}月", month),
|
||||
count,
|
||||
price,
|
||||
total: count as f64 * price,
|
||||
});
|
||||
}
|
||||
|
||||
student_reports.push(StudentReport {
|
||||
student: record.student,
|
||||
monthly_records,
|
||||
});
|
||||
}
|
||||
|
||||
reports.push(ClassReport {
|
||||
class_name: class_data.class_name,
|
||||
students: student_reports,
|
||||
});
|
||||
}
|
||||
|
||||
reports
|
||||
}
|
||||
137
src-tauri/src/excel_reader.rs
Normal file
@@ -0,0 +1,137 @@
|
||||
use anyhow::{Context, Result};
|
||||
use calamine::{open_workbook, Data, DataType, Reader, Xlsx};
|
||||
use chrono::{Duration, NaiveDate};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::Path;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Student {
|
||||
pub id: Option<String>,
|
||||
pub year: Option<String>,
|
||||
pub grade: Option<String>,
|
||||
pub class: Option<String>,
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct AttendanceRecord {
|
||||
pub student: Student,
|
||||
// Date and attendance count (1.0 for present)
|
||||
pub attendance: Vec<(NaiveDate, f64)>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ClassData {
|
||||
pub class_name: String,
|
||||
pub records: Vec<AttendanceRecord>,
|
||||
}
|
||||
|
||||
pub fn read_attendance_file<P: AsRef<Path>>(path: P) -> Result<Vec<ClassData>> {
|
||||
let mut workbook: Xlsx<_> = open_workbook(path).context("Failed to open Excel file")?;
|
||||
let mut classes = Vec::new();
|
||||
|
||||
for sheet_name in workbook.sheet_names().to_owned() {
|
||||
if let Ok(range) = workbook.worksheet_range(&sheet_name) {
|
||||
let mut records = Vec::new();
|
||||
let mut dates = Vec::new();
|
||||
let mut date_col_indices = Vec::new();
|
||||
|
||||
// Find header row (row 2, index 1)
|
||||
if range.height() < 2 {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Parse headers to find date columns
|
||||
// Assuming row 2 (index 1) contains headers and dates
|
||||
let header_row = range.rows().nth(1).unwrap();
|
||||
|
||||
for (col_idx, cell) in header_row.iter().enumerate() {
|
||||
// Dates in Excel are often floats or ints (serial dates)
|
||||
// Check if the cell value looks like a date (e.g., > 40000)
|
||||
if let Some(float_val) = cell.as_f64() {
|
||||
if float_val > 40000.0 && float_val < 50000.0 {
|
||||
// Convert serial date to NaiveDate
|
||||
// Excel base date is usually 1899-12-30
|
||||
let base_date = NaiveDate::from_ymd_opt(1899, 12, 30).unwrap();
|
||||
let days = float_val as i64;
|
||||
if let Some(date) = base_date.checked_add_signed(Duration::days(days)) {
|
||||
dates.push(date);
|
||||
date_col_indices.push(col_idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if dates.is_empty() {
|
||||
// Skip sheets without dates
|
||||
continue;
|
||||
}
|
||||
|
||||
// Iterate over data rows (starting from row 4, index 3)
|
||||
// Row 1: Title, Row 2: Headers, Row 3: Weekdays, Row 4: Data
|
||||
for row in range.rows().skip(3) {
|
||||
// Check if row has a name (Column E, index 4)
|
||||
// If name is empty, skip
|
||||
let name_cell = &row[4];
|
||||
let name = match name_cell {
|
||||
Data::String(s) => s.trim().to_string(),
|
||||
_ => continue, // Skip if no name
|
||||
};
|
||||
|
||||
if name.is_empty() || name == "姓名" {
|
||||
continue;
|
||||
}
|
||||
|
||||
let id = row[0].to_string();
|
||||
let year = row[1].to_string();
|
||||
let grade = row[2].to_string();
|
||||
let class_info = row[3].to_string();
|
||||
|
||||
let student = Student {
|
||||
id: if id.is_empty() { None } else { Some(id) },
|
||||
year: if year.is_empty() { None } else { Some(year) },
|
||||
grade: if grade.is_empty() { None } else { Some(grade) },
|
||||
class: if class_info.is_empty() { None } else { Some(class_info) },
|
||||
name,
|
||||
};
|
||||
|
||||
let mut attendance_entries = Vec::new();
|
||||
|
||||
for (i, &col_idx) in date_col_indices.iter().enumerate() {
|
||||
if col_idx < row.len() {
|
||||
let cell = &row[col_idx];
|
||||
// Check for "1" or numeric 1
|
||||
let is_present = match cell {
|
||||
Data::Int(v) => *v == 1,
|
||||
Data::Float(v) => (*v - 1.0).abs() < 1e-6,
|
||||
Data::String(s) => s.trim() == "1",
|
||||
_ => false,
|
||||
};
|
||||
|
||||
if is_present {
|
||||
if i < dates.len() {
|
||||
attendance_entries.push((dates[i], 1.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !attendance_entries.is_empty() {
|
||||
records.push(AttendanceRecord {
|
||||
student,
|
||||
attendance: attendance_entries,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if !records.is_empty() {
|
||||
classes.push(ClassData {
|
||||
class_name: sheet_name.clone(),
|
||||
records,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(classes)
|
||||
}
|
||||
112
src-tauri/src/excel_writer.rs
Normal file
@@ -0,0 +1,112 @@
|
||||
use crate::data_processor::ClassReport;
|
||||
use anyhow::Result;
|
||||
use rust_xlsxwriter::{Format, Workbook};
|
||||
use std::path::Path;
|
||||
|
||||
pub fn write_report<P: AsRef<Path>>(path: P, reports: Vec<ClassReport>) -> Result<()> {
|
||||
let mut workbook = Workbook::new();
|
||||
let worksheet = workbook.add_worksheet();
|
||||
|
||||
// Formats
|
||||
let header_format = Format::new().set_bold().set_align(rust_xlsxwriter::FormatAlign::Center);
|
||||
let center_format = Format::new().set_align(rust_xlsxwriter::FormatAlign::Center);
|
||||
|
||||
let mut current_row = 0;
|
||||
|
||||
for report in reports {
|
||||
// Write Class Name
|
||||
worksheet.write_string(current_row, 0, &report.class_name)?;
|
||||
current_row += 1;
|
||||
|
||||
// Write Headers
|
||||
let headers = ["序号", "入学年份", "年级", "班级", "姓名"];
|
||||
for (i, header) in headers.iter().enumerate() {
|
||||
worksheet.write_string_with_format(current_row, i as u16, *header, &header_format)?;
|
||||
}
|
||||
|
||||
// Determine all unique months across all students in this class to create columns
|
||||
// Actually, the requirement implies we list months for each student?
|
||||
// Looking at res.xlsx:
|
||||
// Row 148: ..., 9月(陈南岚老师), None, None, 10月(陈南岚老师), ...
|
||||
// Row 149: ..., 次数, 单价, 费用合计, 次数, 单价, 费用合计
|
||||
// It seems the columns are dynamic based on months.
|
||||
// We need to find all months present in this class and create columns for them.
|
||||
|
||||
// Collect all months
|
||||
let mut all_months = std::collections::BTreeSet::new();
|
||||
for student in &report.students {
|
||||
for record in &student.monthly_records {
|
||||
all_months.insert(record.month);
|
||||
}
|
||||
}
|
||||
|
||||
// Map month to start column index
|
||||
let mut month_col_map = std::collections::HashMap::new();
|
||||
let mut col_idx = 5; // Start after "姓名"
|
||||
|
||||
for month in &all_months {
|
||||
// Write Month Header (merged 3 cells)
|
||||
// We don't know the teacher name, so just use "X月"
|
||||
let month_str = format!("{}月", month);
|
||||
worksheet.merge_range(current_row, col_idx, current_row, col_idx + 2, &month_str, &header_format)?;
|
||||
|
||||
month_col_map.insert(*month, col_idx);
|
||||
col_idx += 3;
|
||||
}
|
||||
|
||||
current_row += 1;
|
||||
|
||||
// Write Sub-headers (次数, 单价, 费用合计)
|
||||
for _ in &all_months {
|
||||
// We need to know the column index for this month
|
||||
// But we are iterating linearly.
|
||||
}
|
||||
// Actually, let's iterate columns again
|
||||
let mut sub_col_idx = 5;
|
||||
for _ in &all_months {
|
||||
worksheet.write_string_with_format(current_row, sub_col_idx, "次数", ¢er_format)?;
|
||||
worksheet.write_string_with_format(current_row, sub_col_idx + 1, "单价", ¢er_format)?;
|
||||
worksheet.write_string_with_format(current_row, sub_col_idx + 2, "费用合计", ¢er_format)?;
|
||||
sub_col_idx += 3;
|
||||
}
|
||||
|
||||
current_row += 1;
|
||||
|
||||
// Write Student Data
|
||||
for (i, student) in report.students.iter().enumerate() {
|
||||
worksheet.write_number_with_format(current_row, 0, (i + 1) as f64, ¢er_format)?;
|
||||
if let Some(year) = &student.student.year {
|
||||
worksheet.write_string_with_format(current_row, 1, year, ¢er_format)?;
|
||||
}
|
||||
if let Some(grade) = &student.student.grade {
|
||||
worksheet.write_string_with_format(current_row, 2, grade, ¢er_format)?;
|
||||
}
|
||||
if let Some(class_info) = &student.student.class {
|
||||
worksheet.write_string_with_format(current_row, 3, class_info, ¢er_format)?;
|
||||
}
|
||||
worksheet.write_string_with_format(current_row, 4, &student.student.name, ¢er_format)?;
|
||||
|
||||
for record in &student.monthly_records {
|
||||
if let Some(&start_col) = month_col_map.get(&record.month) {
|
||||
worksheet.write_number_with_format(current_row, start_col, record.count as f64, ¢er_format)?;
|
||||
worksheet.write_number_with_format(current_row, start_col + 1, record.price, ¢er_format)?;
|
||||
|
||||
// Formula: =PRODUCT(次数:单价)
|
||||
// Column indices are 0-based.
|
||||
// rust_xlsxwriter uses (row, col)
|
||||
let count_cell = rust_xlsxwriter::utility::row_col_to_cell(current_row, start_col);
|
||||
let price_cell = rust_xlsxwriter::utility::row_col_to_cell(current_row, start_col + 1);
|
||||
let formula = format!("=PRODUCT({}:{})", count_cell, price_cell);
|
||||
|
||||
worksheet.write_formula_with_format(current_row, start_col + 2, formula.as_str(), ¢er_format)?;
|
||||
}
|
||||
}
|
||||
current_row += 1;
|
||||
}
|
||||
|
||||
current_row += 2; // Spacing between classes
|
||||
}
|
||||
|
||||
workbook.save(path)?;
|
||||
Ok(())
|
||||
}
|
||||
82
src-tauri/src/lib.rs
Normal file
@@ -0,0 +1,82 @@
|
||||
mod data_processor;
|
||||
mod excel_reader;
|
||||
mod excel_writer;
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[tauri::command]
|
||||
async fn process_attendance(input_path: String) -> Result<String, String> {
|
||||
let input_path = PathBuf::from(input_path);
|
||||
|
||||
// 1. Read
|
||||
let classes = excel_reader::read_attendance_file(&input_path)
|
||||
.map_err(|e| format!("Failed to read Excel: {}", e))?;
|
||||
|
||||
// 2. Process
|
||||
let reports = data_processor::process_data(classes);
|
||||
|
||||
// 3. Determine output path
|
||||
let output_name = "res.xlsx";
|
||||
let mut output_path = std::env::current_dir()
|
||||
.map_err(|e| format!("Failed to get current dir: {}", e))?
|
||||
.join(output_name);
|
||||
|
||||
// Logic: If app (executable) is on desktop, save to desktop.
|
||||
// Note: In dev mode, this might be target/debug/...
|
||||
if let Some(desktop_dir) = dirs::desktop_dir() {
|
||||
if let Ok(exe_path) = std::env::current_exe() {
|
||||
if exe_path.starts_with(&desktop_dir) {
|
||||
output_path = desktop_dir.join(output_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If running in bundle on macOS, current_exe is inside .app/Contents/MacOS
|
||||
// We might want to go up 3 levels to get the .app folder's parent.
|
||||
// But for now, let's stick to the simple logic.
|
||||
// If the user launches a shortcut on Desktop, the CWD might be Desktop?
|
||||
// If so, current_dir() handles it.
|
||||
|
||||
// 4. Write
|
||||
excel_writer::write_report(&output_path, reports)
|
||||
.map_err(|e| format!("Failed to write Excel: {}", e))?;
|
||||
|
||||
Ok(format!("Successfully saved to {:?}", output_path))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[test]
|
||||
fn test_process_logic() {
|
||||
// Assuming we are in src-tauri/
|
||||
let input = PathBuf::from("../req.xlsx");
|
||||
if !input.exists() {
|
||||
println!("Skipping test, input file not found at {:?}", input);
|
||||
return;
|
||||
}
|
||||
|
||||
let classes = excel_reader::read_attendance_file(&input).expect("Failed to read");
|
||||
let reports = data_processor::process_data(classes);
|
||||
|
||||
assert!(!reports.is_empty());
|
||||
|
||||
// Write to a test output
|
||||
let output = PathBuf::from("../test_output.xlsx");
|
||||
excel_writer::write_report(&output, reports).expect("Failed to write");
|
||||
|
||||
assert!(output.exists());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
.invoke_handler(tauri::generate_handler![process_attendance])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
6
src-tauri/src/main.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
attendance_app_lib::run()
|
||||
}
|
||||
33
src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "attendance_app",
|
||||
"version": "0.1.0",
|
||||
"identifier": "com.attendance.app",
|
||||
"build": {
|
||||
"frontendDist": "../src"
|
||||
},
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
"windows": [
|
||||
{
|
||||
"title": "attendance_app",
|
||||
"width": 800,
|
||||
"height": 600
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
}
|
||||
}
|
||||
1
src/assets/javascript.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path fill="#F7DF1E" d="M0 0h256v256H0V0Z"></path><path d="m67.312 213.932l19.59-11.856c3.78 6.701 7.218 12.371 15.465 12.371c7.905 0 12.89-3.092 12.89-15.12v-81.798h24.057v82.138c0 24.917-14.606 36.259-35.916 36.259c-19.245 0-30.416-9.967-36.087-21.996m85.07-2.576l19.588-11.341c5.157 8.421 11.859 14.607 23.715 14.607c9.969 0 16.325-4.984 16.325-11.858c0-8.248-6.53-11.17-17.528-15.98l-6.013-2.58c-17.357-7.387-28.87-16.667-28.87-36.257c0-18.044 13.747-31.792 35.228-31.792c15.294 0 26.292 5.328 34.196 19.247l-18.732 12.03c-4.125-7.389-8.591-10.31-15.465-10.31c-7.046 0-11.514 4.468-11.514 10.31c0 7.217 4.468 10.14 14.778 14.608l6.014 2.577c20.45 8.765 31.963 17.7 31.963 37.804c0 21.654-17.012 33.51-39.867 33.51c-22.339 0-36.774-10.654-43.819-24.574"></path></svg>
|
||||
|
After Width: | Height: | Size: 995 B |
6
src/assets/tauri.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg width="206" height="231" viewBox="0 0 206 231" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M143.143 84C143.143 96.1503 133.293 106 121.143 106C108.992 106 99.1426 96.1503 99.1426 84C99.1426 71.8497 108.992 62 121.143 62C133.293 62 143.143 71.8497 143.143 84Z" fill="#FFC131"/>
|
||||
<ellipse cx="84.1426" cy="147" rx="22" ry="22" transform="rotate(180 84.1426 147)" fill="#24C8DB"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M166.738 154.548C157.86 160.286 148.023 164.269 137.757 166.341C139.858 160.282 141 153.774 141 147C141 144.543 140.85 142.121 140.558 139.743C144.975 138.204 149.215 136.139 153.183 133.575C162.73 127.404 170.292 118.608 174.961 108.244C179.63 97.8797 181.207 86.3876 179.502 75.1487C177.798 63.9098 172.884 53.4021 165.352 44.8883C157.82 36.3744 147.99 30.2165 137.042 27.1546C126.095 24.0926 114.496 24.2568 103.64 27.6274C92.7839 30.998 83.1319 37.4317 75.8437 46.1553C74.9102 47.2727 74.0206 48.4216 73.176 49.5993C61.9292 50.8488 51.0363 54.0318 40.9629 58.9556C44.2417 48.4586 49.5653 38.6591 56.679 30.1442C67.0505 17.7298 80.7861 8.57426 96.2354 3.77762C111.685 -1.01901 128.19 -1.25267 143.769 3.10474C159.348 7.46215 173.337 16.2252 184.056 28.3411C194.775 40.457 201.767 55.4101 204.193 71.404C206.619 87.3978 204.374 103.752 197.73 118.501C191.086 133.25 180.324 145.767 166.738 154.548ZM41.9631 74.275L62.5557 76.8042C63.0459 72.813 63.9401 68.9018 65.2138 65.1274C57.0465 67.0016 49.2088 70.087 41.9631 74.275Z" fill="#FFC131"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.4045 76.4519C47.3493 70.6709 57.2677 66.6712 67.6171 64.6132C65.2774 70.9669 64 77.8343 64 85.0001C64 87.1434 64.1143 89.26 64.3371 91.3442C60.0093 92.8732 55.8533 94.9092 51.9599 97.4256C42.4128 103.596 34.8505 112.392 30.1816 122.756C25.5126 133.12 23.9357 144.612 25.6403 155.851C27.3449 167.09 32.2584 177.598 39.7906 186.112C47.3227 194.626 57.153 200.784 68.1003 203.846C79.0476 206.907 90.6462 206.743 101.502 203.373C112.359 200.002 122.011 193.568 129.299 184.845C130.237 183.722 131.131 182.567 131.979 181.383C143.235 180.114 154.132 176.91 164.205 171.962C160.929 182.49 155.596 192.319 148.464 200.856C138.092 213.27 124.357 222.426 108.907 227.222C93.458 232.019 76.9524 232.253 61.3736 227.895C45.7948 223.538 31.8055 214.775 21.0867 202.659C10.3679 190.543 3.37557 175.59 0.949823 159.596C-1.47592 143.602 0.768139 127.248 7.41237 112.499C14.0566 97.7497 24.8183 85.2327 38.4045 76.4519ZM163.062 156.711L163.062 156.711C162.954 156.773 162.846 156.835 162.738 156.897C162.846 156.835 162.954 156.773 163.062 156.711Z" fill="#24C8DB"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
21
src/index.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="stylesheet" href="styles.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Attendance Counter</title>
|
||||
<script type="module" src="/main.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Attendance Counter</h1>
|
||||
|
||||
<div class="card">
|
||||
<p>Select the attendance Excel file to process.</p>
|
||||
<button id="select-file-btn" type="button">Select Input File (.xlsx)</button>
|
||||
<p id="status-msg"></p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
43
src/main.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const { invoke } = window.__TAURI__.core;
|
||||
const { open } = window.__TAURI__.dialog;
|
||||
|
||||
let selectFileBtn;
|
||||
let statusMsg;
|
||||
|
||||
async function selectFile() {
|
||||
try {
|
||||
const selected = await open({
|
||||
multiple: false,
|
||||
filters: [{
|
||||
name: 'Excel',
|
||||
extensions: ['xlsx', 'xls']
|
||||
}]
|
||||
});
|
||||
|
||||
if (selected) {
|
||||
statusMsg.textContent = "Processing...";
|
||||
statusMsg.className = "processing";
|
||||
|
||||
try {
|
||||
const result = await invoke("process_attendance", { inputPath: selected });
|
||||
statusMsg.textContent = result;
|
||||
statusMsg.className = "success";
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
statusMsg.textContent = "Error: " + error;
|
||||
statusMsg.className = "error";
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
statusMsg.textContent = "Error selecting file: " + err;
|
||||
statusMsg.className = "error";
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
selectFileBtn = document.querySelector("#select-file-btn");
|
||||
statusMsg = document.querySelector("#status-msg");
|
||||
|
||||
selectFileBtn.addEventListener("click", selectFile);
|
||||
});
|
||||
83
src/styles.css
Normal file
@@ -0,0 +1,83 @@
|
||||
:root {
|
||||
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
font-weight: 400;
|
||||
|
||||
color: #0f0f0f;
|
||||
background-color: #f6f6f6;
|
||||
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
.container {
|
||||
margin: 0;
|
||||
padding-top: 10vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 8px;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.6em 1.2em;
|
||||
font-size: 1em;
|
||||
font-weight: 500;
|
||||
font-family: inherit;
|
||||
background-color: #1a1a1a;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.25s;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
border-color: #646cff;
|
||||
}
|
||||
|
||||
button:focus,
|
||||
button:focus-visible {
|
||||
outline: 4px auto -webkit-focus-ring-color;
|
||||
}
|
||||
|
||||
#status-msg {
|
||||
margin-top: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.processing {
|
||||
color: #007bff;
|
||||
}
|
||||
|
||||
.success {
|
||||
color: #28a745;
|
||||
}
|
||||
|
||||
.error {
|
||||
color: #dc3545;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
color: #f6f6f6;
|
||||
background-color: #2f2f2f;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: #f9f9f9;
|
||||
color: #0f0f0f;
|
||||
}
|
||||
}
|
||||