Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@
"Device is not suspended.": "Device is not suspended.",
"Error": "Error",
"Degraded": "Degraded",
"No applications": "No applications",
"Healthy": "Healthy",
"Preparing": "Preparing",
"Starting": "Starting",
Expand Down
24 changes: 18 additions & 6 deletions libs/types/models/AapProviderSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AuthOrganizationAssignment } from './AuthOrganizationAssignment';
import type { AuthRoleAssignment } from './AuthRoleAssignment';
/**
* AapProviderSpec describes an Ansible Automation Platform (AAP) provider configuration.
*/
Expand All @@ -21,14 +19,28 @@ export type AapProviderSpec = {
*/
apiUrl: string;
/**
* The external AAP API URL (for external access).
* The OAuth2 authorization endpoint URL.
*/
externalApiUrl?: string;
authorizationUrl: string;
/**
* The OAuth2 token endpoint URL.
*/
tokenUrl: string;
/**
* The OAuth2 client ID.
*/
clientId: string;
/**
* The OAuth2 client secret.
*/
clientSecret: string;
/**
* Whether this AAP provider is enabled.
*/
enabled?: boolean;
organizationAssignment: AuthOrganizationAssignment;
roleAssignment: AuthRoleAssignment;
/**
* List of OAuth2 scopes to request.
*/
scopes: Array<string>;
};

2 changes: 1 addition & 1 deletion libs/types/models/ApplicationProviderSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export type ApplicationProviderSpec = (ApplicationEnvVars & {
* The application name must be 1–253 characters long, start with a letter or number, and contain no whitespace.
*/
name?: string;
appType?: AppType;
appType: AppType;
} & (ImageApplicationProviderSpec | InlineApplicationProviderSpec));

4 changes: 2 additions & 2 deletions libs/types/models/ApplicationResourceLimits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*/
export type ApplicationResourceLimits = {
/**
* CPU limit in cores (e.g., "1", "0.75").
* CPU limit in cores. Format restricted based on application type.
*/
cpu?: string;
/**
* Memory limit with unit (e.g., "256m", "2g") using Podman format (b=bytes, k=kibibytes, m=mebibytes, g=gibibytes).
* Memory limit with optional unit. Format restricted based on application type.
*/
memory?: string;
};
Expand Down
1 change: 1 addition & 0 deletions libs/types/models/ApplicationsSummaryStatusType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export enum ApplicationsSummaryStatusType {
ApplicationsSummaryStatusDegraded = 'Degraded',
ApplicationsSummaryStatusError = 'Error',
ApplicationsSummaryStatusUnknown = 'Unknown',
ApplicationsSummaryStatusNoApplications = 'NoApplications',
}
11 changes: 4 additions & 7 deletions libs/ui-components/src/types/deviceSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import {
HttpConfigProviderSpec,
ImageApplicationProviderSpec,
ImagePullPolicy,
InlineApplicationProviderSpec,
InlineConfigProviderSpec,
KubernetesSecretProviderSpec,
} from '@flightctl/types';
import { FlightCtlLabel } from './extraTypes';
import { ApplicationProviderSpecFixed, FlightCtlLabel } from './extraTypes';
import { UpdateScheduleMode } from '../utils/time';
import { ApplicationProviderSpecFixed } from './extraTypes';

export enum ConfigType {
GIT = 'git',
Expand Down Expand Up @@ -117,10 +115,9 @@ export type AppForm =
| ComposeInlineAppForm
| SingleContainerAppForm;

export const isInlineAppProvider = (app: ApplicationProviderSpecFixed): app is InlineApplicationProviderSpec =>
'inline' in app;
export const isImageAppProvider = (app: ApplicationProviderSpecFixed): app is ImageApplicationProviderSpec =>
'image' in app;
export const isImageAppProvider = (
app: ApplicationProviderSpecFixed,
): app is ApplicationProviderSpecFixed & ImageApplicationProviderSpec => 'image' in app;

// Type guards for the 5 explicit types
export const isQuadletImageAppForm = (app: AppBase): app is QuadletImageAppForm =>
Expand Down
2 changes: 1 addition & 1 deletion libs/ui-components/src/types/extraTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export type InlineApplicationFileFixed = FileContent & RelativePath;
export type ApplicationProviderSpecFixed = ApplicationEnvVars &
ApplicationVolumeProviderSpec & {
name?: string;
appType?: AppType;
appType: AppType;
} & (ImageApplicationProviderSpec | { inline: InlineApplicationFileFixed[] });

type CliArtifact = {
Expand Down
7 changes: 7 additions & 0 deletions libs/ui-components/src/utils/status/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ApplicationsSummaryStatusType as AppSummaryStatus,
} from '@flightctl/types';
import { StatusItem } from './common';
import AsleepIcon from '@patternfly/react-icons/dist/js/icons/asleep-icon';

export const getApplicationSummaryStatusItems = (t: TFunction): StatusItem<AppSummaryStatus>[] => [
{
Expand All @@ -23,6 +24,12 @@ export const getApplicationSummaryStatusItems = (t: TFunction): StatusItem<AppSu
label: t('Unknown'),
level: 'unknown',
},
{
id: AppSummaryStatus.ApplicationsSummaryStatusNoApplications,
label: t('No applications'),
level: 'info',
customIcon: AsleepIcon,
},
{
id: AppSummaryStatus.ApplicationsSummaryStatusHealthy,
label: t('Healthy'),
Expand Down