mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
* feat: add widgets (#2034) * feat: add Taiga UI library (#1992) * feat: add widgets * update patchdb * right resizable sidebar with widgets * feat: add resizing directive * chore: remove unused code * chore: remove unnecessary dep * feat: `ResponsiveCol` add directive for responsive grid * feat: add widgets edit mode and dialogs * feat: add widgets model and modal * chore: fix import * chore: hide mobile widgets behind flag * chore: add dummy widgets * chore: start working on heath widget and implement other comments * feat: health widget * feat: add saving widgets and sidebar params to patch * feat: preemptive UI update for widgets * update health widget with more accurate states and styling (#2127) * feat: `ResponsiveCol` add directive for responsive grid * chore: some changes after merge Co-authored-by: Matt Hill <matthewonthemoon@gmail.com> Co-authored-by: Lucy C <12953208+elvece@users.noreply.github.com> * fix(shared): `ElasticContainer` fix collapsing margin (#2150) * fix(shared): `ElasticContainer` fix collapsing margin * fix toolbar height so titles not chopped --------- Co-authored-by: Matt Hill <matthewonthemoon@gmail.com> * feat: make widgets sidebar width togglable (#2146) * feat: make widgets sidebar width togglable * feat: move widgets under header * chore: fix wide layout * fix(shared): `ResponsiveCol` fix missing grid steps (#2153) * fix widget flag and refactor for non-persistence * default widget flag to false * fix(shared): fix responsive column size (#2159) * fix(shared): fix responsive column size * fix: add responsiveness to all pages * fix responsiveness on more pages * fix: comments * revert some padding changes --------- Co-authored-by: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Co-authored-by: Matt Hill <matthewonthemoon@gmail.com> * chore: add analyzer (#2165) * fix list styling to previous default (#2173) * fix list styling to previous default * dont need important flag --------- Co-authored-by: Alex Inkin <alexander@inkin.ru> Co-authored-by: Lucy C <12953208+elvece@users.noreply.github.com>
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { PackageDataEntry } from '../services/patch-db/data-model'
|
|
import {
|
|
DependencyStatus,
|
|
HealthStatus,
|
|
PrimaryRendering,
|
|
PrimaryStatus,
|
|
renderPkgStatus,
|
|
StatusRendering,
|
|
} from '../services/pkg-status-rendering.service'
|
|
import { ProgressData } from 'src/app/types/progress-data'
|
|
import { Subscription } from 'rxjs'
|
|
import { packageLoadingProgress } from './package-loading-progress'
|
|
|
|
export function getPackageInfo(entry: PackageDataEntry): PkgInfo {
|
|
const statuses = renderPkgStatus(entry)
|
|
const primaryRendering = PrimaryRendering[statuses.primary]
|
|
|
|
return {
|
|
entry,
|
|
primaryRendering,
|
|
primaryStatus: statuses.primary,
|
|
installProgress: packageLoadingProgress(entry['install-progress']),
|
|
error:
|
|
statuses.health === HealthStatus.Failure ||
|
|
statuses.dependency === DependencyStatus.Warning,
|
|
warning: statuses.primary === PrimaryStatus.NeedsConfig,
|
|
transitioning:
|
|
primaryRendering.showDots ||
|
|
statuses.health === HealthStatus.Waiting ||
|
|
statuses.health === HealthStatus.Loading ||
|
|
statuses.health === HealthStatus.Starting,
|
|
}
|
|
}
|
|
|
|
export interface PkgInfo {
|
|
entry: PackageDataEntry
|
|
primaryRendering: StatusRendering
|
|
primaryStatus: PrimaryStatus
|
|
installProgress: ProgressData | null
|
|
error: boolean
|
|
warning: boolean
|
|
transitioning: boolean
|
|
sub?: Subscription | null
|
|
}
|