Skip to content

Commit 876aa89

Browse files
authored
Merge branch 'main' into chore/deps
2 parents 93adbfa + f82956f commit 876aa89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1440
-19
lines changed

LICENSE

+661
Large diffs are not rendered by default.

farm.config.ts

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*****************************************************************************
2+
* AlgoHub: Cross-platform online judge client based on Tauri
3+
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*****************************************************************************/
18+
119
import { defineConfig } from "@farmfe/core";
220
import vue from "@vitejs/plugin-vue";
321
import worker from "@farmfe/plugin-worker";

index.html

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
<!--
2+
AlgoHub: Cross-platform online judge client based on Tauri
3+
Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU Affero General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU Affero General Public License for more details.
14+
15+
You should have received a copy of the GNU Affero General Public License
16+
along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
-->
18+
119
<!DOCTYPE html>
220
<html lang="en">
321
<head>

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"private": true,
44
"version": "0.1.0",
55
"type": "module",
6+
"license": "AGPL-3.0-only",
67
"scripts": {
78
"start": "tailwindcss -i ./input.css -o ./src/assets/tailwind.css --watch",
89
"dev": "farm",

postcss.config.js

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*****************************************************************************
2+
* AlgoHub: Cross-platform online judge client based on Tauri
3+
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*****************************************************************************/
18+
119
export default {
220
plugins: {
321
tailwindcss: {},

public/algohub-day.svg

+1-1
Loading

public/algohub-night.svg

+1-1
Loading

scripts/bump.mjs

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*****************************************************************************
2+
* AlgoHub: Cross-platform online judge client based on Tauri
3+
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*****************************************************************************/
18+
119
import { defineCommand, run } from "archons";
220
import { readFileSync, writeFileSync } from "fs";
321

scripts/release-aur.mjs

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*****************************************************************************
2+
* AlgoHub: Cross-platform online judge client based on Tauri
3+
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*****************************************************************************/
18+
119
// @ts-check
220

321
import { execSync } from "child_process";

scripts/version-check.mjs

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*****************************************************************************
2+
* AlgoHub: Cross-platform online judge client based on Tauri
3+
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*****************************************************************************/
18+
119
import axios from "axios";
220

321
const compareVersion = (a, b) => {

src-tauri/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.1-rc.6"
44
description = "ACM Algorithm Hub"
55
repository = "https://github.com/swpu-acm/algohub"
66
readme = "../README.md"
7+
license = "AGPL-3.0-only"
78
authors = ["苏向夜 <[email protected]>"]
89
edition = "2021"
910

src-tauri/build.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*****************************************************************************
2+
* AlgoHub: Cross-platform online judge client based on Tauri
3+
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*****************************************************************************/
18+
119
fn main() {
220
tauri_build::build()
321
}

src-tauri/src/lib.rs

+27-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*****************************************************************************
2+
* AlgoHub: Cross-platform online judge client based on Tauri
3+
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU Affero General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU Affero General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*****************************************************************************/
18+
119
use serde::{Deserialize, Serialize};
220
use std::fs;
321
use tokio::fs::File;
@@ -61,18 +79,18 @@ async fn get_latest_versions() -> Result<LatestVersions, Error> {
6179
.await
6280
.map_err(|e| e.to_string())?;
6381

64-
82+
6583
let tags = response
6684
.json::<Vec<TagResponse>>()
6785
.await
6886
.map_err(|_| "Failed to parse response".to_string())?;
6987

7088
let mut latest_versions = LatestVersions::default();
7189

72-
90+
7391
for item in tags.into_iter().rev() {
7492
if let Some(tag) = item.r#ref.as_str().strip_prefix("refs/tags/algohub-v") {
75-
93+
7694
let tag = tag.to_string();
7795
if tag.contains("nightly") {
7896
if latest_versions.nightly.is_none()
@@ -102,7 +120,7 @@ async fn get_latest_versions() -> Result<LatestVersions, Error> {
102120
}
103121

104122

105-
123+
106124
if latest_versions.nightly.is_some()
107125
&& latest_versions.alpha.is_some()
108126
&& latest_versions.stable.is_some()
@@ -136,7 +154,7 @@ impl Default for DownloadResult {
136154
#[tauri::command]
137155
async fn download_release(version: &str) -> Result<DownloadResult, Error> {
138156
let os = std::env::consts::OS;
139-
let arch = std::env::consts::ARCH;
157+
let arch = std::env::consts::ARCH;
140158

141159
let mut result = DownloadResult::default();
142160

@@ -195,22 +213,22 @@ async fn download_release(version: &str) -> Result<DownloadResult, Error> {
195213

196214
if !response.status().is_success() {
197215
return Err(format!(
198-
"Failed to download release from {}. HTTP Status: {}",
199-
url,
216+
"Failed to download release from {}. HTTP Status: {}",
217+
url,
200218
response.status()
201219
)
202220
.into());
203221
}
204222

205223
let content = response
206224
.bytes()
207-
.await
225+
.await
208226
.map_err(|e| format!("Failed to read response content: {}", e).to_string())?;
209227

210228

211229

212230
let mut file = File::create(&file_name)
213-
.await
231+
.await
214232
.map_err(|e| format!("Failed to create file {}: {}", file_name, e).to_string())?;
215233

216234
file.write_all(&content)

0 commit comments

Comments
 (0)