feat(apps): allow https protocol

Some apps like portainer require the https protocol to open then. New config option to allow setting
the https protocol
This commit is contained in:
Nicolas Meienberger 2022-08-23 21:40:57 +02:00
parent 9c2bcc2280
commit 64c39ce23d
6 changed files with 17 additions and 2 deletions

View file

@ -56,6 +56,7 @@ export type AppInfo = {
categories: Array<AppCategoriesEnum>;
description: Scalars['String'];
form_fields: Array<FormField>;
https?: Maybe<Scalars['Boolean']>;
id: Scalars['String'];
name: Scalars['String'];
port: Scalars['Float'];
@ -301,6 +302,7 @@ export type GetAppQuery = {
source: string;
categories: Array<AppCategoriesEnum>;
url_suffix?: string | null;
https?: boolean | null;
form_fields: Array<{
__typename?: 'FormField';
type: FieldTypesEnum;
@ -326,7 +328,7 @@ export type InstalledAppsQuery = {
config: any;
version?: number | null;
updateInfo?: { __typename?: 'UpdateInfo'; current: number; latest: number; dockerVersion?: string | null } | null;
info?: { __typename?: 'AppInfo'; id: string; name: string; description: string; tipi_version: number; short_desc: string } | null;
info?: { __typename?: 'AppInfo'; id: string; name: string; description: string; tipi_version: number; short_desc: string; https?: boolean | null } | null;
}>;
};
@ -352,6 +354,7 @@ export type ListAppsQuery = {
short_desc: string;
author: string;
categories: Array<AppCategoriesEnum>;
https?: boolean | null;
}>;
};
};
@ -711,6 +714,7 @@ export const GetAppDocument = gql`
source
categories
url_suffix
https
form_fields {
type
label
@ -770,6 +774,7 @@ export const InstalledAppsDocument = gql`
description
tipi_version
short_desc
https
}
}
}
@ -846,6 +851,7 @@ export const ListAppsDocument = gql`
short_desc
author
categories
https
}
total
}

View file

@ -22,6 +22,7 @@ query GetApp($appId: String!) {
source
categories
url_suffix
https
form_fields {
type
label

View file

@ -15,6 +15,7 @@ query InstalledApps {
description
tipi_version
short_desc
https
}
}
}

View file

@ -11,6 +11,7 @@ query ListApps {
short_desc
author
categories
https
}
total
}

View file

@ -130,7 +130,10 @@ const AppDetails: React.FC<IProps> = ({ app, info }) => {
};
const handleOpen = () => {
window.open(`http://${internalIp}:${info.port}${info.url_suffix || ''}`, '_blank', 'noreferrer');
const { https } = info;
const protocol = https ? 'https' : 'http';
window.open(`${protocol}://${internalIp}:${info.port}${info.url_suffix || ''}`, '_blank', 'noreferrer');
};
const version = [info?.version || 'unknown', app?.version ? `(${app.version})` : ''].join(' ');

View file

@ -121,6 +121,9 @@ class AppInfo {
@Field(() => GraphQLJSONObject, { nullable: true })
requirements?: Requirements;
@Field(() => Boolean, { nullable: true })
https?: boolean;
}
@ObjectType()