-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
463 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import pydantic | ||
|
||
from capellacollab.core import pydantic as core_pydantic | ||
|
||
|
||
class IdleState(core_pydantic.BaseModel): | ||
available: bool | ||
idle_for_minutes: int | None = pydantic.Field( | ||
default=None, | ||
description="The number of minutes the session has been idle. Value is -1 if the session has never been connected to.", | ||
) | ||
terminate_after_minutes: int | ||
unavailable_reason: str | None = pydantic.Field(default=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
frontend/src/app/general/relative-time/relative-time.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!-- | ||
~ SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
<span [matTooltip]="absoluteTime"> | ||
{{ relativeTime }} | ||
</span> |
29 changes: 29 additions & 0 deletions
29
frontend/src/app/general/relative-time/relative-time.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import { Component, Input } from '@angular/core'; | ||
import { MatTooltip } from '@angular/material/tooltip'; | ||
import { formatDistanceToNow, format } from 'date-fns'; | ||
import { DateArg } from 'date-fns/types'; | ||
|
||
@Component({ | ||
selector: 'app-relative-time', | ||
standalone: true, | ||
imports: [MatTooltip], | ||
templateUrl: './relative-time.component.html', | ||
}) | ||
export class RelativeTimeComponent { | ||
@Input() date?: DateArg<Date>; | ||
@Input() suffix = true; | ||
|
||
get relativeTime(): string { | ||
if (!this.date) return ''; | ||
return formatDistanceToNow(this.date, { addSuffix: this.suffix }); | ||
} | ||
|
||
get absoluteTime(): string { | ||
if (!this.date) return ''; | ||
return format(this.date, 'PPpp'); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.