Skip to content

Commit 715ab38

Browse files
Merge pull request #240 from GoogleCloudDataproc/authentication-runtime-template-ui
Modifications to Runtime template list UI
2 parents 776158b + 400fddf commit 715ab38

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

src/runtime/listRuntimeTemplates.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ function ListRuntimeTemplates({
123123
Header: 'Description',
124124
accessor: 'description'
125125
},
126+
{
127+
Header: 'Authentication',
128+
accessor: 'authentication'
129+
},
126130
{
127131
Header: 'Last Modified',
128132
accessor: 'lastModified'
@@ -343,7 +347,7 @@ function ListRuntimeTemplates({
343347
{isLoading && (
344348
<div className="spin-loader-runtime">
345349
<CircularProgress
346-
className = "spin-loader-custom-style"
350+
className="spin-loader-custom-style"
347351
size={18}
348352
aria-label="Loading Spinner"
349353
data-testid="loader"

src/runtime/runtimeService.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,25 @@ export class RunTimeSerive {
176176
if (data.jupyterSession && data.jupyterSession.displayName) {
177177
displayName = data.jupyterSession.displayName;
178178
}
179+
let authentication = '';
179180

181+
const authType =
182+
data.environmentConfig?.executionConfig?.authenticationConfig
183+
?.userWorkloadAuthenticationType;
184+
185+
if (authType === 'END_USER_CREDENTIALS') {
186+
authentication = 'User Account';
187+
} else {
188+
authentication = 'Service Account';
189+
}
180190
// Extracting runtimeId from name
181191
// Example: "projects/{projectName}/locations/{region}/sessionTemplates/{runtimeid}",
182192

183193
return {
184194
name: displayName,
185195
owner: data.creator,
186196
description: data.description,
197+
authentication: authentication,
187198
lastModified: startTimeDisplay,
188199
actions: renderActions(data),
189200
id: data.name.split('/')[5]

src/utils/listRuntimeTemplateInterface.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface ISessionTemplate {
1313
jupyterSession: IJupyterSession;
1414
creator: string;
1515
labels: ILabels;
16-
environmentConfig: IEnvironmentConfig;
16+
environmentConfig?: IEnvironmentConfig;
1717
description: string;
1818
updateTime: string;
1919
}
@@ -28,17 +28,20 @@ export interface ILabels {
2828
}
2929

3030
export interface IEnvironmentConfig {
31-
executionConfig: IExecutionConfig;
31+
executionConfig?: IExecutionConfig;
3232
}
33-
3433
export interface IExecutionConfig {
3534
subnetworkUri: string;
35+
authenticationConfig?: {
36+
userWorkloadAuthenticationType: string;
37+
};
3638
}
3739

3840
export interface ISessionTemplateDisplay {
3941
name: string;
4042
owner: string;
4143
description: string;
44+
authentication: string;
4245
lastModified: string;
4346
id: string;
4447
}

0 commit comments

Comments
 (0)