feat: show new updates in dashboard (#690)

* feat: show new update banner

* feat(http): add request logger

* refactor: updates checker

* feat: make update check optional

* fix: empty releases

* add toggle switch for update checks

* feat: toggle updates check from settings

* feat: toggle updates check from settings

* feat: check on toggle enabled

---------

Co-authored-by: soup <soup@r4tio.dev>
This commit is contained in:
ze0s 2023-02-05 18:44:11 +01:00 committed by GitHub
parent 3fdd7cf5e4
commit 2917a7d42d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 687 additions and 121 deletions

20
web/src/types/Config.d.ts vendored Normal file
View file

@ -0,0 +1,20 @@
interface Config {
host: string;
port: number;
log_level: string;
log_path: string;
base_url: string;
check_for_updates: boolean;
version: string;
commit: string;
date: string;
}
interface ConfigUpdate {
host?: string;
port?: number;
log_level?: string;
log_path?: string;
base_url?: string;
check_for_updates: boolean;
}

View file

@ -67,14 +67,3 @@ interface IrcAuth {
account?: string; // optional
password?: string; // optional
}
interface Config {
host: string;
port: number;
log_level: string;
log_path: string;
base_url: string;
version: string;
commit: string;
date: string;
}

46
web/src/types/Update.d.ts vendored Normal file
View file

@ -0,0 +1,46 @@
interface UpdateAvailableResponse {
id: number;
name: string;
}
export interface GithubRelease {
id: number;
node_id: string;
url: string;
html_url: string;
tag_name: string;
target_commitish: string;
name: string;
body: string;
created_at: Date;
published_at: Date;
author: GithubAuthor;
assets: GitHubReleaseAsset[];
}
export interface GitHubReleaseAsset {
url: string;
id: number;
node_id: string;
name: string;
label: string;
uploader: GithubAuthor;
content_type: string;
state: string;
size: number;
download_count: number;
created_at: Date;
updated_at: Date;
browser_download_url: string;
}
export interface GithubAuthor {
login: string;
id: number;
node_id: string;
avatar_url: string;
gravatar_id: string;
url: string;
html_url: string;
type: string;
}