Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc-logs-application-view: init component #967

Closed
pdesoyres-cc opened this issue Feb 27, 2024 · 0 comments · Fixed by #980 or #1023
Closed

cc-logs-application-view: init component #967

pdesoyres-cc opened this issue Feb 27, 2024 · 0 comments · Fixed by #980 or #1023
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@pdesoyres-cc
Copy link
Contributor

pdesoyres-cc commented Feb 27, 2024

Context

A component that displays logs for Clever applications.

Inputs

Attributes/properties

Property Type Default value Mandatory Description
dateRangeSelection DateRangeSelection null false The date range selection
options LogsApplicationViewOptions null false TODO
overflowWatermarkOffset Number 10 false The number of logs before the limit from which the user will be asked to accept or discard logs limit overflow.
selectedInstances Array<string> [] false The array of instances ids that should be selected.
state LogsApplicationViewState LogsApplicationViewStateLoadingInstances false State of the component
limit Number 1000 false The maximum number of logs to display. null for no limit.

Outputs

Event Data type Description
cc-logs-application-view:date-range-change DateRange Fires the range whenever the range changes.
cc-logs-application-view:pause DateRange Fires when the pause button is clicked.
cc-logs-application-view:resume DateRange Fires when the resume button is clicked.

Type Definitions

export interface LogsApplicationViewStateLoadingInstances {
  type: 'loadingInstances';
}

export interface LogsApplicationViewStateErrorInstances {
  type: 'errorInstances';
}

export interface LogsApplicationViewStateLogs {
  type: 'connectingLogs' | 'receivingLogs'| 'logStreamPaused' | 'logStreamEnded' | 'errorLogs';
  instances: Array<Instance | GhostInstance>;
  selection: Array<string>;
}


export type LogsApplicationViewState = LogsApplicationViewStateLoadingInstances | LogsApplicationViewStateLogs | LogsApplicationViewStateErrorInstances;

export type DateRange = {
  since: string;
  until?: string;
}

export interface DateRangeSelectionLive {
  type: 'live',
}

export type DateRangeSelectionPredefinedDefinition = 'lastHour' | 'last4Hours' | 'last7Days' | 'today' | 'yesterday';

export interface DateRangeSelectionPredefined {
  type: 'predefined',
  def: DateRangeSelectionPredefinedDefinition,
}

export interface DateRangeSelectionCustom {
  type: 'custom',
  since: string;
  until: string;
}

export type DateRangeSelection = DateRangeSelectionLive | DateRangeSelectionPredefined | DateRangeSelectionCustom;

export type DateRangeSelectionMenuEntry = 'live' | 'custom' | DateRangeSelectionPredefinedDefinition;

export interface LogsApplicationViewOptions {
  'date-display': DateDisplay,
  'metadata-display': {
    instance: boolean
  },
  palette: LogsControlPalette,
  'strip-ansi': boolean,
  timezone: Timezone,
  'wrap-lines': boolean,
}

Data/APIs

  • GET api.clever-cloud.com/v4/orchestration/organisations/${params.id}/applications/${params.appId}/instances
  • GET api.clever-cloud.com/v4/orchestration/organisations/${params.id}/applications/${params.appId}/instances/${params.instanceId}
  • GET api.clever-cloud.com/v4/orchestration/organisations/${params.id}/applications/${params.appId}/deployments/${params.deploymentId}
  • GET api.clever-cloud.com/v2/organisations/${params.id}/applications/${params.appId}/deployments/${params.deploymentId}
  • GET api.clever-cloud.com/v4/logs/organisations/${this._ownerId}/applications/${this._appId}/logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant