Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions farm.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*****************************************************************************
* AlgoHub: Cross-platform online judge cilent based on Tauri

Check warning on line 2 in farm.config.ts

View workflow job for this annotation

GitHub Actions / Code Spell Check

Unknown word (cilent)
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************/

import { defineConfig } from "@farmfe/core";
import vue from "@vitejs/plugin-vue";
import worker from "@farmfe/plugin-worker";
Expand Down
18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<!--
AlgoHub: Cross-platform online judge cilent based on Tauri

Check warning on line 2 in index.html

View workflow job for this annotation

GitHub Actions / Code Spell Check

Unknown word (cilent)
Copyright (C) 2024 Association of Computing Machinery affiliated SWPU

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<!DOCTYPE html>
<html lang="en">
<head>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"version": "0.1.0",
"type": "module",
"license": "AGPL-3.0-only",
"scripts": {
"start": "tailwindcss -i ./input.css -o ./src/assets/tailwind.css --watch",
"dev": "farm",
Expand Down
18 changes: 18 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*****************************************************************************
* AlgoHub: Cross-platform online judge cilent based on Tauri

Check warning on line 2 in postcss.config.js

View workflow job for this annotation

GitHub Actions / Code Spell Check

Unknown word (cilent)
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************/

export default {
plugins: {
tailwindcss: {},
Expand Down
18 changes: 18 additions & 0 deletions scripts/bump.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*****************************************************************************
* AlgoHub: Cross-platform online judge cilent based on Tauri

Check warning on line 2 in scripts/bump.mjs

View workflow job for this annotation

GitHub Actions / Code Spell Check

Unknown word (cilent)
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************/

import { defineCommand, run } from "archons";
import { readFileSync, writeFileSync } from "fs";

Expand Down
18 changes: 18 additions & 0 deletions scripts/release-aur.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*****************************************************************************
* AlgoHub: Cross-platform online judge cilent based on Tauri

Check warning on line 2 in scripts/release-aur.mjs

View workflow job for this annotation

GitHub Actions / Code Spell Check

Unknown word (cilent)
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************/

// @ts-check

import { execSync } from "child_process";
Expand Down
18 changes: 18 additions & 0 deletions scripts/version-check.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*****************************************************************************
* AlgoHub: Cross-platform online judge cilent based on Tauri

Check warning on line 2 in scripts/version-check.mjs

View workflow job for this annotation

GitHub Actions / Code Spell Check

Unknown word (cilent)
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************/

import axios from "axios";

const compareVersion = (a, b) => {
Expand Down
1 change: 1 addition & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.1.1-rc.6"
description = "ACM Algorithm Hub"
repository = "https://github.com/swpu-acm/algohub"
readme = "../README.md"
license = "AGPL-3.0-only"
authors = ["苏向夜 <[email protected]>"]
edition = "2021"

Expand Down
18 changes: 18 additions & 0 deletions src-tauri/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*****************************************************************************
* AlgoHub: Cross-platform online judge cilent based on Tauri

Check warning on line 2 in src-tauri/build.rs

View workflow job for this annotation

GitHub Actions / Code Spell Check

Unknown word (cilent)
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************/

fn main() {
tauri_build::build()
}
36 changes: 27 additions & 9 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*****************************************************************************
* AlgoHub: Cross-platform online judge cilent based on Tauri

Check warning on line 2 in src-tauri/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code Spell Check

Unknown word (cilent)
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************/

use serde::{Deserialize, Serialize};
use std::fs;
use tokio::fs::File;
Expand Down Expand Up @@ -61,18 +79,18 @@
.await
.map_err(|e| e.to_string())?;


let tags = response
.json::<Vec<TagResponse>>()
.await
.map_err(|_| "Failed to parse response".to_string())?;

let mut latest_versions = LatestVersions::default();


for item in tags.into_iter().rev() {
if let Some(tag) = item.r#ref.as_str().strip_prefix("refs/tags/algohub-v") {

let tag = tag.to_string();
if tag.contains("nightly") {
if latest_versions.nightly.is_none()
Expand Down Expand Up @@ -102,7 +120,7 @@
}



if latest_versions.nightly.is_some()
&& latest_versions.alpha.is_some()
&& latest_versions.stable.is_some()
Expand Down Expand Up @@ -136,7 +154,7 @@
#[tauri::command]
async fn download_release(version: &str) -> Result<DownloadResult, Error> {
let os = std::env::consts::OS;
let arch = std::env::consts::ARCH;
let arch = std::env::consts::ARCH;

let mut result = DownloadResult::default();

Expand Down Expand Up @@ -195,22 +213,22 @@

if !response.status().is_success() {
return Err(format!(
"Failed to download release from {}. HTTP Status: {}",
url,
"Failed to download release from {}. HTTP Status: {}",
url,
response.status()
)
.into());
}

let content = response
.bytes()
.await
.await
.map_err(|e| format!("Failed to read response content: {}", e).to_string())?;



let mut file = File::create(&file_name)
.await
.await
.map_err(|e| format!("Failed to create file {}: {}", file_name, e).to_string())?;

file.write_all(&content)
Expand Down
18 changes: 18 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*****************************************************************************
* AlgoHub: Cross-platform online judge cilent based on Tauri

Check warning on line 2 in src-tauri/src/main.rs

View workflow job for this annotation

GitHub Actions / Code Spell Check

Unknown word (cilent)
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************/

// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

Expand Down
4 changes: 3 additions & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
]
],
"licenseFile": "../LICENSE",
"license": "AGPL-3.0-only"
}
}
18 changes: 18 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<!--
AlgoHub: Cross-platform online judge cilent based on Tauri

Check warning on line 2 in src/App.vue

View workflow job for this annotation

GitHub Actions / Code Spell Check

Unknown word (cilent)
Copyright (C) 2024 Association of Computing Machinery affiliated SWPU

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<script setup lang="ts">
import { useThemeStore } from './scripts/store';

Expand Down
18 changes: 18 additions & 0 deletions src/assets/base.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*****************************************************************************
* AlgoHub: Cross-platform online judge cilent based on Tauri
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************/

:root {
font-family: Cascadia Mono, Consolas, Helvetica, Arial, sans-serif;

Expand Down
18 changes: 18 additions & 0 deletions src/assets/tailwind.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*****************************************************************************
* AlgoHub: Cross-platform online judge cilent based on Tauri
* Copyright (C) 2024 Association of Computing Machinery affiliated SWPU
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*****************************************************************************/

@tailwind base;
@tailwind components;
@tailwind utilities;
18 changes: 18 additions & 0 deletions src/components/MarkdownEditor.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<!--
AlgoHub: Cross-platform online judge cilent based on Tauri
Copyright (C) 2024 Association of Computing Machinery affiliated SWPU

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

<script setup lang="ts">
import { useThemeStore } from '@/scripts/store';
import { MdEditor } from 'md-editor-v3';
Expand Down
Loading
Loading