Skip to content

Commit

Permalink
Merge branch 'upstream' into feat_lights
Browse files Browse the repository at this point in the history
* upstream: (23 commits)
  fix readme
  nits
  step 2, generate running page from .fit and .gpx
  fix: yihong0618#584 change fit-tool to garmin-fit-sdk (yihong0618#590)
  remove fake device
  nits
  Refactor: sync garmin cn to global
  fix: lock lxml version
  garmin-cn sync garmin-global tutorial in readme and readme-cn
  fix fit download gpx file (yihong0618#582)
  nits
  nits
  github workflow
  feat: sync garmin cn to garmin global
  Reduce svg size & lzay load github.svg and grid.svg (yihong0618#580)
  Update index.tsx (yihong0618#579)
  添加 (yihong0618#578)
  docs: add runner page (yihong0618#577)
  feat: ✨ Support ga, default off (yihong0618#572)
  docs: add runner (yihong0618#571)
  ...

# Conflicts:
#	src/components/RunMap/index.tsx
  • Loading branch information
ben-29 committed Jan 6, 2024
2 parents 5e9703f + 3a35e45 commit b3aea5f
Show file tree
Hide file tree
Showing 42 changed files with 691 additions and 168 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:prettier/recommended',
],
overrides: [],
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/run_data_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:

env:
# please change to your own config.
RUN_TYPE: pass # support strava/nike/garmin/garmin_cn/keep/only_gpx/only_fit/nike_to_strava/strava_to_garmin/strava_to_garmin_cn/garmin_to_strava/garmin_to_strava_cn/codoon, Please change the 'pass' it to your own
RUN_TYPE: pass # support strava/nike/garmin/garmin_cn/garmin_sync_cn_global/keep/only_gpx/only_fit/nike_to_strava/strava_to_garmin/strava_to_garmin_cn/garmin_to_strava/garmin_to_strava_cn/codoon, Please change the 'pass' it to your own
ATHLETE: yihong0618
TITLE: Yihong0618 Running
MIN_GRID_DISTANCE: 10 # change min distance here
Expand Down Expand Up @@ -125,6 +125,15 @@ jobs:
# If you only want to sync `type running` add args --only-run, default script is to sync all data (rides and runs).
# python run_page/garmin_sync.py ${{ secrets.GARMIN_SECRET_STRING_CN }} --only-run --is-cn

- name: Run sync Garmin CN to Garmin script
if: env.RUN_TYPE == 'garmin_sync_cn_global'
run: |
# make garimin secret string `python run_page/garmin_sync_cn_global.py ${email} ${password} --is-cn
python run_page/garmin_sync_cn_global.py ${{ secrets.GARMIN_SECRET_STRING_CN }} ${{ secrets.GARMIN_SECRET_STRING }}
# If you only want to sync `type running` add args --only-run, default script is to sync all data (rides and runs).
# python run_page/garmin_sync_cn_global.py ${{ secrets.GARMIN_SECRET_STRING_CN }} ${{ secrets.GARMIN_SECRET_STRING }} --only-run


- name: Run sync Only GPX script
if: env.RUN_TYPE == 'only_gpx'
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ COPY --from=data /root/running_page /root/running_page
RUN pnpm run build

FROM nginx:alpine AS web
COPY --from=frontend-build /root/running_page/public /usr/share/nginx/html/
COPY --from=frontend-build /root/running_page/dist /usr/share/nginx/html/
COPY --from=frontend-build /root/running_page/assets /usr/share/nginx/html/assets
41 changes: 40 additions & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ R.I.P. 希望大家都能健康顺利的跑过终点,逝者安息。
| [deepinwine](https://github.com/deepinwine) | <https://deepin.autove.dev/> | Garmin-cn |
| [Jeffggmm](https://github.com/Jeffggmm) | <https://jeffggmm.github.io/workouts_page/> | Garmin |
| [s1smart](https://github.com/s1smart) | <https://s1smart.github.io/running_page/> | Strava |

| [Ryan](https://github.com/85Ryan) | <https://85ryan.github.io/gooorun/> | Strava |
| [PPZ](https://github.com/8824PPZ) | <https://run.dudubbbbbbbbb.top/> | Strava |
</details>

## 它是怎么工作的
Expand Down Expand Up @@ -136,6 +137,7 @@ R.I.P. 希望大家都能健康顺利的跑过终点,逝者安息。
- **[GPX](#gpx)**
- **[TCX](#tcx)**
- **[FIT](#fit)**
- **[佳明国内同步国际](#Garmin-CN-to-Garmin)**
- **[Tcx+Strava(upload all tcx data to strava)](#tcx_to_strava)**
- **[Gpx+Strava(upload all tcx data to strava)](#gpx_to_strava)**
- **[Nike+Strava(Using NRC Run, Strava backup data)](#nikestrava)**
Expand Down Expand Up @@ -569,6 +571,43 @@ python3(python) run_page/garmin_sync.py xxxxxxxxxx --is-cn --only-run

</details>

### Garmin-CN to Garmin

<details>
<summary> 同步佳明 CN 数据到 佳明国际区</summary>

<br>

- 如果你只想同步 `type running` 使用参数 --only-run
**The Python version must be >=3.10**

#### 获取佳明 CN 的密钥

在终端中输入以下命令

```bash
python3(python) run_page/get_garmin_secret.py ${your email} ${your password} --is-cn
```

#### 获取佳明全球的密钥

在终端中输入以下命令

```bash
python3(python) run_page/get_garmin_secret.py ${your email} ${your password}
```

#### 同步 佳明 CN 到 佳明全球

在终端中输入以下命令

```bash
python3(python) run_page/garmin_sync_cn_global.py ${garmin_cn_secret_string} ${garmin_secret_string}
```

</details>


### Nike Run Club

<details>
Expand Down
53 changes: 50 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ English | [简体中文](https://github.com/yihong0618/running_page/blob/master/
| [Echo](https://github.com/donghao526) | <https://donghao526.github.io/running> | JoyRun |
| [Jeffggmm](https://github.com/Jeffggmm) | <https://jeffggmm.github.io/workouts_page/> | Garmin |
| [s1smart](https://github.com/s1smart) | <https://s1smart.github.io/running_page/> | Strava |

| [XmchxUp](https://github.com/XmchxUp) | <https://xmchxup.github.io/running_page/> | Strava |
| [Ryan](https://github.com/85Ryan) | <https://85ryan.github.io/gooorun/> | Strava |
| [PPZ](https://github.com/8824PPZ) | <https://run.dudubbbbbbbbb.top/> | Strava |
</details>

## How it works
Expand Down Expand Up @@ -119,6 +121,7 @@ English | [简体中文](https://github.com/yihong0618/running_page/blob/master/
- **[GPX](#gpx)**
- **[TCX](#tcx)**
- **[FIT](#fit)**
- **[Garmin-CN_to_Garmin(Sync Garmin-CN activities to Garmin Global)](#garmin-cn-to-garmin)**
- **[Nike_to_Strava(Using NRC Run, Strava backup data)](#nike_to_strava)**
- **[Tcx_to_Strava(upload all tcx data to strava)](#tcx_to_strava)**
- **[Gpx_to_Strava(upload all gpx data to strava)](#gpx_to_strava)**
Expand Down Expand Up @@ -214,6 +217,13 @@ const USE_DASH_LINE = true;
const LINE_OPACITY = 0.4;
```

- To use Google Analytics, you need to modify the configuration in the `src/utils/const.ts` file.

```typescript
const USE_GOOGLE_ANALYTICS = false;
const GOOGLE_ANALYTICS_TRACKING_ID = '';
```

> privacy protection,setting flowing env:
```bash
Expand Down Expand Up @@ -370,6 +380,45 @@ python3(python) run_page/garmin_sync.py xxxxxxxxxxxxxx(secret_string) --is-cn -

</details>

### Garmin-CN to Garmin

<details>
<summary> Sync your <code>Garmin-CN</code> data to <code>Garmin</code></summary>

<br>

- If you only want to sync `type running` add args --only-run
**The Python version must be >=3.10**

#### Get Garmin CN Secret

Enter the following command in the terminal

```bash
# to get secret_string
python3(python) run_page/get_garmin_secret.py ${your email} ${your password} --is-cn
```

#### Get Garmin Secret

Enter the following command in the terminal

```bash
# to get secret_string
python3(python) run_page/get_garmin_secret.py ${your email} ${your password}
```

#### Sync Garmin CN to Garmin

Enter the following command in the terminal

```bash
# to sync garmin-cn to garmin-global
python3(python) run_page/garmin_sync_cn_global.py ${garmin_cn_secret_string} ${garmin_secret_string}
```

</details>

### Nike Run Club

<details>
Expand Down Expand Up @@ -721,8 +770,6 @@ For more display effects, see:

4. make sure you have write permissions in Workflow permissions settings.



5. If you want to deploy your running_page to xxx.github.io instead of xxx.github.io/running_page, you need to do three things:

- Rename your forked running_page repository to `xxx.github.io`, where xxx is your GitHub username
Expand Down
1 change: 1 addition & 0 deletions assets/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const yearStats = import.meta.glob('./year_*.svg', { import: 'ReactComponent' })
export const totalStat = import.meta.glob(['./github.svg', './grid.svg'], { import: 'ReactComponent' })
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dependencies": {
"@mapbox/mapbox-gl-language": "^1.0.0",
"@mapbox/polyline": "^1.1.1",
"@svgr/plugin-svgo": "^8.1.0",
"@vercel/analytics": "^0.1.6",
"@vitejs/plugin-react": "^4.0.0",
"gcoord": "^0.3.2",
Expand All @@ -14,6 +15,7 @@
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-ga4": "^2.1.0",
"react-helmet-async": "^1.3.0",
"react-map-gl": "^7.1.6",
"react-router-dom": "^6.15.0",
Expand Down
Loading

0 comments on commit b3aea5f

Please sign in to comment.