-
Notifications
You must be signed in to change notification settings - Fork 11
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
1 parent
277f085
commit fd033ff
Showing
48 changed files
with
474 additions
and
511 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
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 @@ | ||
import {Moment} from 'moment'; | ||
import {Configuration, STRectangle} from '@geoengine/openapi-client'; | ||
import {UUID} from '../datasets/dataset.model'; | ||
import {User} from './user.model'; | ||
|
||
/** | ||
* A user session after login | ||
*/ | ||
export interface Session { | ||
sessionToken: string; | ||
user?: User; // TODO: split for pro | ||
apiConfiguration: Configuration; | ||
validUntil: Moment; // TODO: custom time point? | ||
lastProjectId?: UUID; | ||
lastView?: STRectangle; | ||
} |
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,53 @@ | ||
import {HttpErrorResponse} from '@angular/common/http'; | ||
import {Quota as QuotaDict} from '@geoengine/openapi-client'; | ||
|
||
/** | ||
* This class represents a geo engine user. | ||
*/ | ||
export class User { | ||
id: string; | ||
|
||
realName?: string; | ||
email?: string; | ||
|
||
isGuest: boolean; | ||
|
||
constructor(config: {id: string; realName?: string; email?: string}) { | ||
this.id = config.id; | ||
this.realName = config.realName; | ||
this.email = config.email; | ||
|
||
this.isGuest = !config.email || !config.realName; | ||
} | ||
} | ||
|
||
/** | ||
* This interface represents the status of the used geo engine backend. | ||
*/ | ||
export interface BackendStatus { | ||
available: boolean; | ||
httpError?: HttpErrorResponse; | ||
initial?: boolean; | ||
} | ||
|
||
export class Quota { | ||
protected _used: number; | ||
protected _available: number; | ||
|
||
constructor(used: number, available: number) { | ||
this._used = used; | ||
this._available = available; | ||
} | ||
|
||
get used(): number { | ||
return this._used; | ||
} | ||
|
||
get available(): number { | ||
return this._available; | ||
} | ||
|
||
static fromDict(dict: QuotaDict): Quota { | ||
return new Quota(dict.used, dict.available); | ||
} | ||
} |
Oops, something went wrong.