mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
Feat/automated backups (#2142)
* initial restructuring * very cool * new structure in place * delete unnecessary T * down the rabbit hole * getting better * dont like it * nice * very nice * sessions select all * nice * backup runs * fix targets and more * small improvements * mostly working * address PR comments * fix error * delete issue with merge * fix checkboxes and add API for deleting backup runs * better styling for checkboxes * small button in ssh kpage too * complete multiple UI launcher * fix actions * present error toast too * fix target forms
This commit is contained in:
committed by
Aiden McClelland
parent
9499ea8ca9
commit
e53c90f8f0
@@ -6,12 +6,7 @@ import { Pipe, PipeTransform } from '@angular/core'
|
||||
})
|
||||
export class ConvertBytesPipe implements PipeTransform {
|
||||
transform(bytes: number): string {
|
||||
if (bytes === 0) return '0 Bytes'
|
||||
|
||||
const k = 1024
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k))
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i]
|
||||
return convertBytes(bytes)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +22,15 @@ export class DurationToSecondsPipe implements PipeTransform {
|
||||
}
|
||||
}
|
||||
|
||||
export function convertBytes(bytes: number) {
|
||||
if (bytes === 0) return '0 Bytes'
|
||||
|
||||
const k = 1000
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k))
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i]
|
||||
}
|
||||
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
|
||||
const unitsToSeconds: Record<string, number> = {
|
||||
|
||||
@@ -24,11 +24,8 @@ ion-alert {
|
||||
}
|
||||
|
||||
ion-modal {
|
||||
--max-height: 600px;
|
||||
--backdrop-opacity: 0.7;
|
||||
&::part(content) {
|
||||
width: 90% !important;
|
||||
left: 5%;
|
||||
|
||||
border-radius: 6px;
|
||||
border: 2px solid rgba(255, 255, 255, 0.03);
|
||||
box-shadow: 0 32px 64px rgba(0, 0, 0, 0.2);
|
||||
@@ -157,3 +154,9 @@ ion-modal {
|
||||
color: var(--ion-color-success);
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
cursor: pointer;
|
||||
color: aqua;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user