chore(gui): rebrand — strip TG/Boosty/Patreon/feedback-bot, keep CC BY-NC-SA attribution
The previous feature/gui-rebrand-polish work only updated the appInfo store
keys; Footer.svelte, settings, and the commands page were still rendering
upstream's Telegram channel, Boosty/Patreon support links, feedback bot,
and the original author byline. This finishes the job.
Rust side (applies after `cargo build` — currently a no-op until MSVC Build
Tools are reinstalled):
- Cargo.toml: authors = ["Bossiara13"], repository = J.A.R.V.I.S-rust fork.
Original attribution stays in LICENSE.txt per CC BY-NC-SA 4.0; the UI
no longer renders an author byline.
- config.rs: dropped TG_OFFICIAL_LINK / FEEDBACK_LINK / SUPPORT_BOOSTY_LINK
/ SUPPORT_PATREON_LINK. Added UPSTREAM_REPOSITORY_LINK (Priler/jarvis for
the licence attribution), ISSUES_LINK (this fork's GH issues), and
PYTHON_FORK_LINK.
- tauri_commands/etc.rs: dropped get_tg_official_link/get_boosty_link/
get_patreon_link/get_feedback_link. Added get_upstream_link, get_issues_link,
get_python_fork_link. Tidied up the Option<&str> -> String boilerplate
with unwrap_or.
- main.rs: invoke_handler updated to match.
Frontend side (visible only after Rust rebuild — Tauri bundles the dist into
the exe):
- stores.ts: appInfo shape reduced to repositoryLink / upstreamLink /
issuesLink / pythonForkLink / logFilePath. loadAppInfo() uses fetchOr()
with hardcoded fallbacks so the UI still populates correctly when run
against an un-rebuilt binary; fetchRepoOr() additionally overrides
CARGO_PKG_REPOSITORY if it still resolves to upstream's Priler/jarvis.
- Footer.svelte: rewritten — © year + "J.A.R.V.I.S." + repo link + issues
link + small "fork of Priler/jarvis · CC BY-NC-SA 4.0" attribution line.
No author byline (it's in LICENSE.txt).
- routes/settings/index.svelte: feedback link now points to GitHub Issues.
- routes/commands/index.svelte: TG-channel reference replaced with a link
to the Python fork (where the command builder lives) plus a pointer to
resources/commands/ in this repo. Bruh GIF removed.
- locales/{ru,en,ua}.ftl: removed footer-author / footer-telegram /
footer-support, added footer-issues / footer-fork-of, rewrote
commands-wip-* strings, retargeted settings-beta-bot to "GitHub Issues".
Bundle identifier (com.priler.jarvis) kept intact to avoid moving the app
data directory.
This commit is contained in:
parent
85a004e263
commit
24457ad6c9
11 changed files with 130 additions and 195 deletions
|
|
@ -9,9 +9,9 @@ resolver = "2"
|
|||
|
||||
[workspace.package]
|
||||
version = "0.1.0"
|
||||
authors = ["Abraham Tugalov (original)", "Bossiara13 (fork)"]
|
||||
authors = ["Bossiara13"]
|
||||
license = "GPL-3.0-only"
|
||||
repository = "https://github.com/Priler/jarvis"
|
||||
repository = "https://github.com/DmitryBykov-ISPO/J.A.R.V.I.S-rust"
|
||||
edition = "2021"
|
||||
|
||||
[workspace.dependencies]
|
||||
|
|
|
|||
|
|
@ -82,10 +82,9 @@ pub const LOG_FILE_NAME: &str = "log.txt";
|
|||
pub const APP_VERSION: Option<&str> = option_env!("CARGO_PKG_VERSION");
|
||||
pub const AUTHOR_NAME: Option<&str> = option_env!("CARGO_PKG_AUTHORS");
|
||||
pub const REPOSITORY_LINK: Option<&str> = option_env!("CARGO_PKG_REPOSITORY");
|
||||
pub const TG_OFFICIAL_LINK: Option<&str> = Some("https://t.me/howdyho_official");
|
||||
pub const FEEDBACK_LINK: Option<&str> = Some("https://t.me/jarvis_feedback_bot");
|
||||
pub const SUPPORT_BOOSTY_LINK: Option<&str> = Some("https://boosty.to/howdyho");
|
||||
pub const SUPPORT_PATREON_LINK: Option<&str> = Some("https://www.patreon.com/c/priler");
|
||||
pub const UPSTREAM_REPOSITORY_LINK: &str = "https://github.com/Priler/jarvis";
|
||||
pub const ISSUES_LINK: &str = "https://github.com/DmitryBykov-ISPO/J.A.R.V.I.S-rust/issues";
|
||||
pub const PYTHON_FORK_LINK: &str = "https://github.com/DmitryBykov-ISPO/J.A.R.V.I.S-py";
|
||||
|
||||
/*
|
||||
Tray.
|
||||
|
|
|
|||
|
|
@ -42,10 +42,9 @@ stats-not-selected = Not selected
|
|||
stats-loading = Loading...
|
||||
|
||||
# ### FOOTER
|
||||
footer-author = Project author
|
||||
footer-telegram = Our Telegram channel
|
||||
footer-github = Github repository
|
||||
footer-support = Support the project on
|
||||
footer-github = Project repository
|
||||
footer-issues = Report a bug
|
||||
footer-fork-of = Fork of
|
||||
|
||||
# ### SETTINGS
|
||||
settings-title = Settings
|
||||
|
|
@ -84,8 +83,8 @@ settings-disabled = Disabled
|
|||
# settings - beta notice
|
||||
settings-beta-title = BETA version!
|
||||
settings-beta-desc = Some features may not work correctly.
|
||||
settings-beta-feedback = Report all bugs to
|
||||
settings-beta-bot = our Telegram bot
|
||||
settings-beta-feedback = Report bugs via
|
||||
settings-beta-bot = GitHub Issues
|
||||
settings-open-logs = Open logs folder
|
||||
|
||||
# settings - picovoice
|
||||
|
|
@ -112,10 +111,12 @@ settings-openai-not-supported = ChatGPT is not currently supported. It will be a
|
|||
commands-title = Commands
|
||||
commands-search = Search commands...
|
||||
commands-count = { $count } commands
|
||||
commands-wip-title = [404] This section is under development!
|
||||
commands-wip-desc = Here will be a list of commands + full-featured command editor.
|
||||
commands-wip-follow = Follow updates in
|
||||
commands-wip-channel = our Telegram channel
|
||||
commands-wip-title = Section under development
|
||||
commands-wip-desc = This will host the command editor and list of installed packs.
|
||||
commands-wip-builder = For now, use the Python fork with the command builder —
|
||||
commands-wip-builder-link = open repository
|
||||
commands-wip-or-fork = Or check the Rust repo and edit commands directly in
|
||||
commands-wip-fork-link = resources/commands/
|
||||
|
||||
# ### ERRORS
|
||||
error-generic = An error occurred
|
||||
|
|
|
|||
|
|
@ -42,10 +42,9 @@ stats-not-selected = Не выбран
|
|||
stats-loading = Загрузка...
|
||||
|
||||
# FOOTER
|
||||
footer-author = Автор проекта
|
||||
footer-telegram = Наш телеграм канал
|
||||
footer-github = Github репозиторий проекта
|
||||
footer-support = Поддержать проект на
|
||||
footer-github = Репозиторий проекта
|
||||
footer-issues = Сообщить о баге
|
||||
footer-fork-of = Форк
|
||||
|
||||
# SETTINGS
|
||||
settings-title = Настройки
|
||||
|
|
@ -84,8 +83,8 @@ settings-disabled = Отключено
|
|||
# settings - beta notice
|
||||
settings-beta-title = БЕТА версия!
|
||||
settings-beta-desc = Часть функций может работать некорректно.
|
||||
settings-beta-feedback = Сообщайте обо всех найденных багах в
|
||||
settings-beta-bot = наш телеграм бот
|
||||
settings-beta-feedback = Сообщайте обо всех найденных багах через
|
||||
settings-beta-bot = GitHub Issues
|
||||
settings-open-logs = Открыть папку с логами
|
||||
|
||||
# settings - picovoice
|
||||
|
|
@ -112,10 +111,12 @@ settings-openai-not-supported = В данный момент ChatGPT не под
|
|||
commands-title = Команды
|
||||
commands-search = Поиск команд...
|
||||
commands-count = { $count } команд
|
||||
commands-wip-title = [404] Этот раздел еще находится в разработке!
|
||||
commands-wip-desc = Тут будет список команд + полноценный редактор команд.
|
||||
commands-wip-follow = Следите за обновлениями в
|
||||
commands-wip-channel = нашем телеграм канале
|
||||
commands-wip-title = Раздел в разработке
|
||||
commands-wip-desc = Здесь будет редактор команд и список установленных пакетов.
|
||||
commands-wip-builder = Пока что используй Python-форк с конструктором команд —
|
||||
commands-wip-builder-link = открыть репозиторий
|
||||
commands-wip-or-fork = Или загляни в Rust-репозиторий и правь команды напрямую в
|
||||
commands-wip-fork-link = resources/commands/
|
||||
|
||||
# ERRORS
|
||||
error-generic = Произошла ошибка
|
||||
|
|
|
|||
|
|
@ -42,10 +42,9 @@ stats-not-selected = Не вибрано
|
|||
stats-loading = Завантаження...
|
||||
|
||||
# ### FOOTER
|
||||
footer-author = Автор проєкту
|
||||
footer-telegram = Наш телеграм канал
|
||||
footer-github = Github репозиторій проєкту
|
||||
footer-support = Підтримати проєкт на
|
||||
footer-github = Репозиторій проєкту
|
||||
footer-issues = Повідомити про баг
|
||||
footer-fork-of = Форк
|
||||
|
||||
# ### SETTINGS
|
||||
settings-title = Налаштування
|
||||
|
|
@ -84,8 +83,8 @@ settings-disabled = Вимкнено
|
|||
# settings - beta notice
|
||||
settings-beta-title = БЕТА версія!
|
||||
settings-beta-desc = Частина функцій може працювати некоректно.
|
||||
settings-beta-feedback = Повідомляйте про всі знайдені баги в
|
||||
settings-beta-bot = наш телеграм бот
|
||||
settings-beta-feedback = Повідомляйте про знайдені баги через
|
||||
settings-beta-bot = GitHub Issues
|
||||
settings-open-logs = Відкрити папку з логами
|
||||
|
||||
# settings - picovoice
|
||||
|
|
@ -112,10 +111,12 @@ settings-openai-not-supported = Наразі ChatGPT не підтримуєть
|
|||
commands-title = Команди
|
||||
commands-search = Пошук команд...
|
||||
commands-count = { $count } команд
|
||||
commands-wip-title = [404] Цей розділ ще в розробці!
|
||||
commands-wip-desc = Тут буде список команд + повноцінний редактор команд.
|
||||
commands-wip-follow = Слідкуйте за оновленнями в
|
||||
commands-wip-channel = нашому телеграм каналі
|
||||
commands-wip-title = Розділ у розробці
|
||||
commands-wip-desc = Тут буде редактор команд та список встановлених пакетів.
|
||||
commands-wip-builder = Поки що користуйся Python-форком з конструктором команд —
|
||||
commands-wip-builder-link = відкрити репозиторій
|
||||
commands-wip-or-fork = Або зазирни в Rust-репозиторій і правь команди безпосередньо в
|
||||
commands-wip-fork-link = resources/commands/
|
||||
|
||||
# ### ERRORS
|
||||
error-generic = Сталася помилка
|
||||
|
|
|
|||
|
|
@ -60,10 +60,9 @@ fn main() {
|
|||
tauri_commands::get_app_version,
|
||||
tauri_commands::get_author_name,
|
||||
tauri_commands::get_repository_link,
|
||||
tauri_commands::get_tg_official_link,
|
||||
tauri_commands::get_boosty_link,
|
||||
tauri_commands::get_patreon_link,
|
||||
tauri_commands::get_feedback_link,
|
||||
tauri_commands::get_upstream_link,
|
||||
tauri_commands::get_issues_link,
|
||||
tauri_commands::get_python_fork_link,
|
||||
|
||||
// fs
|
||||
tauri_commands::get_log_file_path,
|
||||
|
|
|
|||
|
|
@ -1,68 +1,33 @@
|
|||
use jarvis_core::{config, APP_LOG_DIR};
|
||||
|
||||
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_app_version() -> String {
|
||||
if let Some(res) = config::APP_VERSION {
|
||||
res.to_string()
|
||||
} else {
|
||||
String::from("error")
|
||||
}
|
||||
config::APP_VERSION.unwrap_or("error").to_string()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_author_name() -> String {
|
||||
if let Some(res) = config::AUTHOR_NAME {
|
||||
res.to_string()
|
||||
} else {
|
||||
String::from("error")
|
||||
}
|
||||
config::AUTHOR_NAME.unwrap_or("error").to_string()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_repository_link() -> String {
|
||||
if let Some(res) = config::REPOSITORY_LINK {
|
||||
res.to_string()
|
||||
} else {
|
||||
String::from("error")
|
||||
}
|
||||
config::REPOSITORY_LINK.unwrap_or("error").to_string()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_tg_official_link() -> String {
|
||||
if let Some(ver) = config::TG_OFFICIAL_LINK {
|
||||
ver.to_string()
|
||||
} else {
|
||||
String::from("error")
|
||||
}
|
||||
pub fn get_upstream_link() -> String {
|
||||
config::UPSTREAM_REPOSITORY_LINK.to_string()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_boosty_link() -> String {
|
||||
if let Some(ver) = config::SUPPORT_BOOSTY_LINK {
|
||||
ver.to_string()
|
||||
} else {
|
||||
String::from("error")
|
||||
}
|
||||
pub fn get_issues_link() -> String {
|
||||
config::ISSUES_LINK.to_string()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_patreon_link() -> String {
|
||||
if let Some(ver) = config::SUPPORT_PATREON_LINK {
|
||||
ver.to_string()
|
||||
} else {
|
||||
String::from("error")
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_feedback_link() -> String {
|
||||
if let Some(res) = config::FEEDBACK_LINK {
|
||||
res.to_string()
|
||||
} else {
|
||||
String::from("error")
|
||||
}
|
||||
pub fn get_python_fork_link() -> String {
|
||||
config::PYTHON_FORK_LINK.to_string()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
|
@ -70,4 +35,4 @@ pub fn get_log_file_path() -> String {
|
|||
APP_LOG_DIR.get()
|
||||
.map(|p| p.display().to_string())
|
||||
.unwrap_or_else(|| "unknown".to_string())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,62 +1,39 @@
|
|||
<script lang="ts">
|
||||
import { onMount } from "svelte"
|
||||
import { invoke } from "@tauri-apps/api/core"
|
||||
import { appInfo, currentLanguage, translations, translate } from "@/stores"
|
||||
import { appInfo, translations, translate } from "@/stores"
|
||||
|
||||
$: t = (key: string) => translate($translations, key)
|
||||
|
||||
let authorName = ""
|
||||
let tgLink = ""
|
||||
let repoLink = ""
|
||||
let boostyLink = ""
|
||||
let patreonLink = ""
|
||||
let upstreamLink = ""
|
||||
let issuesLink = ""
|
||||
|
||||
const currentYear = new Date().getFullYear()
|
||||
|
||||
appInfo.subscribe(info => {
|
||||
tgLink = info.tgOfficialLink
|
||||
repoLink = info.repositoryLink
|
||||
boostyLink = info.boostySupportLink
|
||||
patreonLink = info.patreonSupportLink
|
||||
})
|
||||
|
||||
onMount(async () => {
|
||||
try {
|
||||
authorName = await invoke<string>("get_author_name")
|
||||
} catch (err) {
|
||||
console.error("failed to get author name:", err)
|
||||
}
|
||||
upstreamLink = info.upstreamLink
|
||||
issuesLink = info.issuesLink
|
||||
})
|
||||
</script>
|
||||
|
||||
<footer id="footer">
|
||||
<p>© {currentYear}. {t('footer-author')}: <b>{authorName}</b></p>
|
||||
<p>© {currentYear} J.A.R.V.I.S.</p>
|
||||
<p class="links">
|
||||
{#if $currentLanguage === "ru" || $currentLanguage === "ua"}
|
||||
<a href={tgLink} target="_blank" class="telegram-link">
|
||||
<img src="/media/icons/telegram.webp" alt="Telegram" width="18px" />
|
||||
<span>{t('footer-telegram')}</span>
|
||||
</a>
|
||||
|
||||
{/if}
|
||||
<a href={repoLink} target="_blank">
|
||||
<a href={repoLink} target="_blank" rel="noopener noreferrer">
|
||||
<img src="/media/icons/github-logo.png" alt="GitHub" width="18px" />
|
||||
<span>{t('footer-github')}</span>
|
||||
</a>
|
||||
·
|
||||
<a href={issuesLink} target="_blank" rel="noopener noreferrer">
|
||||
<span>{t('footer-issues')}</span>
|
||||
</a>
|
||||
</p>
|
||||
<p class="links last">
|
||||
{#if $currentLanguage === "ru"}
|
||||
{t('footer-support')} <a href={boostyLink} target="_blank" class="telegram-link">
|
||||
<img src="/media/icons/boosty.webp" alt="Boosty" width="18px" />
|
||||
<span>Boosty</span>
|
||||
</a>.
|
||||
{/if}
|
||||
{#if $currentLanguage === "ua" || $currentLanguage === "en"}
|
||||
{t('footer-support')} <a href={patreonLink} target="_blank" class="telegram-link">
|
||||
<img src="/media/icons/patreon.png" alt="Patreon" width="18px" />
|
||||
<span>Patreon</span>
|
||||
</a>.
|
||||
{/if}
|
||||
<small>
|
||||
{t('footer-fork-of')}
|
||||
<a href={upstreamLink} target="_blank" rel="noopener noreferrer">Priler/jarvis</a>
|
||||
· CC BY-NC-SA 4.0
|
||||
</small>
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
|
|
@ -79,15 +56,17 @@
|
|||
|
||||
&.last {
|
||||
margin-top: -5px;
|
||||
color: #8a8d90;
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: #555759!important;
|
||||
color: #555759 !important;
|
||||
text-decoration: none;
|
||||
transition: 0.3s;
|
||||
|
||||
|
||||
& > span {
|
||||
color: #185876;
|
||||
border-bottom: 1px solid #185876;
|
||||
|
|
@ -101,7 +80,7 @@
|
|||
}
|
||||
|
||||
&:hover {
|
||||
color: #777a7d!important;
|
||||
color: #777a7d !important;
|
||||
|
||||
& > span {
|
||||
color: #2A9CD0;
|
||||
|
|
@ -111,30 +90,6 @@
|
|||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&.telegram-link {
|
||||
color: #185876;
|
||||
display: inline-block;
|
||||
|
||||
&:hover {
|
||||
color: #2A9CD0;
|
||||
// background: url(/media/images/bg/bg24.gif);
|
||||
// background-repeat: no-repeat;
|
||||
// background-size: contain;
|
||||
}
|
||||
}
|
||||
|
||||
&.special-link {
|
||||
color: #941d92;
|
||||
display: inline-block;
|
||||
|
||||
&:hover {
|
||||
color: #FF07FC;
|
||||
background: url(/media/images/bg/bg24.gif);
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -8,9 +8,11 @@
|
|||
|
||||
$: t = (key: string) => translate($translations, key)
|
||||
|
||||
let tgLink = ""
|
||||
let pythonForkLink = ""
|
||||
let repoLink = ""
|
||||
appInfo.subscribe(info => {
|
||||
tgLink = info.tgOfficialLink
|
||||
pythonForkLink = info.pythonForkLink
|
||||
repoLink = info.repositoryLink
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
@ -23,19 +25,11 @@
|
|||
withCloseButton={false}
|
||||
>
|
||||
{t('commands-wip-desc')}<br />
|
||||
{t('commands-wip-follow')} <a href={tgLink} target="_blank">{t('commands-wip-channel')}</a>!
|
||||
{t('commands-wip-builder')}
|
||||
<a href={pythonForkLink} target="_blank" rel="noopener noreferrer">{t('commands-wip-builder-link')}</a>.
|
||||
{t('commands-wip-or-fork')}
|
||||
<a href={repoLink} target="_blank" rel="noopener noreferrer">{t('commands-wip-fork-link')}</a>.
|
||||
</Notification>
|
||||
|
||||
<div class="placeholder-image">
|
||||
<img src="/media/images/tenor.gif" alt="bruh" width="320px" />
|
||||
</div>
|
||||
|
||||
<HDivider />
|
||||
<Footer />
|
||||
|
||||
<style>
|
||||
.placeholder-image {
|
||||
text-align: center;
|
||||
margin-top: 25px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -90,10 +90,10 @@
|
|||
voiceVal = value
|
||||
})
|
||||
|
||||
let feedbackLink = ""
|
||||
let issuesLink = ""
|
||||
let logFilePath = ""
|
||||
appInfo.subscribe(info => {
|
||||
feedbackLink = info.feedbackLink
|
||||
issuesLink = info.issuesLink
|
||||
logFilePath = info.logFilePath
|
||||
})
|
||||
|
||||
|
|
@ -230,7 +230,7 @@
|
|||
withCloseButton={false}
|
||||
>
|
||||
{t('settings-beta-desc')}<br />
|
||||
{t('settings-beta-feedback')} <a href={feedbackLink} target="_blank">{t('settings-beta-bot')}</a>.
|
||||
{t('settings-beta-feedback')} <a href={issuesLink} target="_blank" rel="noopener noreferrer">{t('settings-beta-bot')}</a>.
|
||||
<Space h="sm" />
|
||||
<Button
|
||||
color="gray"
|
||||
|
|
|
|||
|
|
@ -39,12 +39,21 @@ export const jarvisCpuUsage = writable(0)
|
|||
export const assistantVoice = writable("")
|
||||
|
||||
// ### APP INFO
|
||||
// Hardcoded fallbacks so the UI keeps working when the Rust side has not
|
||||
// been rebuilt yet (the new get_upstream_link / get_issues_link / get_python_fork_link
|
||||
// Tauri commands only exist after the next cargo build).
|
||||
const BRANDING_FALLBACK = {
|
||||
repositoryLink: "https://github.com/DmitryBykov-ISPO/J.A.R.V.I.S-rust",
|
||||
upstreamLink: "https://github.com/Priler/jarvis",
|
||||
issuesLink: "https://github.com/DmitryBykov-ISPO/J.A.R.V.I.S-rust/issues",
|
||||
pythonForkLink: "https://github.com/DmitryBykov-ISPO/J.A.R.V.I.S-py",
|
||||
}
|
||||
|
||||
export const appInfo = writable({
|
||||
tgOfficialLink: "",
|
||||
feedbackLink: "",
|
||||
repositoryLink: "",
|
||||
boostySupportLink: "",
|
||||
patreonSupportLink: "",
|
||||
repositoryLink: BRANDING_FALLBACK.repositoryLink,
|
||||
upstreamLink: BRANDING_FALLBACK.upstreamLink,
|
||||
issuesLink: BRANDING_FALLBACK.issuesLink,
|
||||
pythonForkLink: BRANDING_FALLBACK.pythonForkLink,
|
||||
logFilePath: ""
|
||||
})
|
||||
|
||||
|
|
@ -59,27 +68,38 @@ export async function loadVoiceSetting() {
|
|||
}
|
||||
|
||||
export async function loadAppInfo() {
|
||||
try {
|
||||
const [tg, feedback, repo, boosty, patreon, logPath] = await Promise.all([
|
||||
invoke<string>("get_tg_official_link"),
|
||||
invoke<string>("get_feedback_link"),
|
||||
invoke<string>("get_repository_link"),
|
||||
invoke<string>("get_boosty_link"),
|
||||
invoke<string>("get_patreon_link"),
|
||||
invoke<string>("get_log_file_path")
|
||||
])
|
||||
|
||||
appInfo.set({
|
||||
tgOfficialLink: tg,
|
||||
feedbackLink: feedback,
|
||||
repositoryLink: repo,
|
||||
boostySupportLink: boosty,
|
||||
patreonSupportLink: patreon,
|
||||
logFilePath: logPath
|
||||
})
|
||||
} catch (err) {
|
||||
console.error("failed to load app info:", err)
|
||||
const fetchOr = async (name: string, fallback: string): Promise<string> => {
|
||||
try {
|
||||
const v = await invoke<string>(name)
|
||||
return v && v !== "error" ? v : fallback
|
||||
} catch {
|
||||
return fallback
|
||||
}
|
||||
}
|
||||
|
||||
// The old binary's get_repository_link returns Priler's upstream — override
|
||||
// so we never display the upstream repo as if it were the current fork.
|
||||
const fetchRepoOr = async (fallback: string): Promise<string> => {
|
||||
const v = await fetchOr("get_repository_link", fallback)
|
||||
if (/priler\/jarvis/i.test(v)) return fallback
|
||||
return v
|
||||
}
|
||||
|
||||
const [repo, upstream, issues, pythonFork, logPath] = await Promise.all([
|
||||
fetchRepoOr(BRANDING_FALLBACK.repositoryLink),
|
||||
fetchOr("get_upstream_link", BRANDING_FALLBACK.upstreamLink),
|
||||
fetchOr("get_issues_link", BRANDING_FALLBACK.issuesLink),
|
||||
fetchOr("get_python_fork_link", BRANDING_FALLBACK.pythonForkLink),
|
||||
fetchOr("get_log_file_path", "")
|
||||
])
|
||||
|
||||
appInfo.set({
|
||||
repositoryLink: repo,
|
||||
upstreamLink: upstream,
|
||||
issuesLink: issues,
|
||||
pythonForkLink: pythonFork,
|
||||
logFilePath: logPath
|
||||
})
|
||||
}
|
||||
|
||||
export async function updateJarvisStats() {
|
||||
|
|
@ -98,7 +118,7 @@ let statsInterval: ReturnType<typeof setInterval> | null = null
|
|||
|
||||
export function startStatsPolling(intervalMs = 5000) {
|
||||
if (statsInterval) return // already running
|
||||
|
||||
|
||||
updateJarvisStats()
|
||||
statsInterval = setInterval(updateJarvisStats, intervalMs)
|
||||
}
|
||||
|
|
@ -108,4 +128,4 @@ export function stopStatsPolling() {
|
|||
clearInterval(statsInterval)
|
||||
statsInterval = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue