fix: update desktop links and skills market

This commit is contained in:
boos
2026-06-29 11:43:49 +08:00
parent 6863ccd16c
commit 8c9fbea822
3 changed files with 35 additions and 8 deletions
+30 -4
View File
@@ -633,6 +633,10 @@ pub async fn search_marketplace(
Ok(results)
}
_ => {
if query.chars().count() < 2 {
return Ok(builtin_results);
}
let url = format!(
"https://skills.sh/api/search?q={}",
urlencoding::encode(query)
@@ -651,24 +655,46 @@ pub async fn search_marketplace(
}
let body: serde_json::Value = response.json().await.map_err(|e| e.to_string())?;
let items = body["skills"].as_array().cloned().unwrap_or_default();
let items = body
.get("skills")
.or_else(|| body.get("results"))
.or_else(|| body.get("items"))
.and_then(|value| value.as_array())
.cloned()
.unwrap_or_default();
let mut results: Vec<MarketplaceSkill> = items
.into_iter()
.map(|item| {
let skill_name = item["name"].as_str().unwrap_or("").to_string();
let repo = item["source"].as_str().unwrap_or("").to_string();
let skill_name = item
.get("name")
.or_else(|| item.get("skillId"))
.and_then(|value| value.as_str())
.unwrap_or("")
.to_string();
let repo = item
.get("source")
.or_else(|| item.get("repo"))
.or_else(|| item.get("repository"))
.and_then(|value| value.as_str())
.unwrap_or("")
.trim()
.trim_start_matches("https://github.com/")
.trim_end_matches(".git")
.trim_end_matches('/')
.to_string();
let installed =
installed_refs.contains(&repo.trim().trim_end_matches('/').to_lowercase());
MarketplaceSkill {
name: skill_name,
description: String::new(),
description: item["description"].as_str().unwrap_or("").to_string(),
repo,
stars: 0,
installs: item["installs"].as_i64().unwrap_or(0),
installed,
}
})
.filter(|item| !item.repo.trim().is_empty())
.collect();
merge_marketplace_results(&mut results, builtin_results);
+3 -2
View File
@@ -303,7 +303,8 @@ export function TitleBar() {
}
}, [message, t]);
const GITHUB_REPO = 'https://github.com/Boos4721/boos-chat';
const GITHUB_PROFILE = 'https://github.com/Boos4721/';
const GITHUB_REPO = 'https://github.com/Boos4721/BoosAPI';
const githubMenuItems: MenuProps['items'] = [
{
key: 'feature',
@@ -323,7 +324,7 @@ export function TitleBar() {
},
];
const handleGithubClick: MenuProps['onClick'] = ({ key }) => {
let url = GITHUB_REPO;
let url = GITHUB_PROFILE;
if (key === 'feature') url = `${GITHUB_REPO}/issues/new?labels=enhancement&template=feature_request.yml`;
else if (key === 'bug') url = `${GITHUB_REPO}/issues/new?labels=bug&template=bug_report.yml`;
if (isTauri()) {
@@ -86,7 +86,7 @@ export function AboutPage() {
<span>{t('settings.website')}</span>
<Button
icon={<Globe size={16} />}
href="https://boos.lat"
href="https://tybossai.com/"
target="_blank"
type="link"
>
@@ -98,7 +98,7 @@ export function AboutPage() {
<span>GitHub</span>
<Button
icon={<Github size={16} />}
href="https://github.com/Boos4721/boos-chat"
href="https://github.com/Boos4721/"
target="_blank"
type="link"
>