Skip to content

Commit 58aec58

Browse files
Add type column to the auth. modules page
1 parent 8544cf9 commit 58aec58

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

otoroshi/javascript/src/pages/AuthModuleConfigsPage.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,35 @@ export class AuthModuleConfigsPage extends Component {
1212
showWizard: false,
1313
};
1414

15+
static TYPE_BADGE_COLORS = {
16+
oauth2: 'bg-primary',
17+
'oauth2-global': 'bg-primary',
18+
oauth1: 'bg-info',
19+
basic: 'bg-secondary',
20+
ldap: 'bg-warning',
21+
saml: 'bg-danger',
22+
wasm: 'bg-dark',
23+
workflow: 'bg-success',
24+
};
25+
1526
columns = [
1627
{ title: 'Name', filterId: 'name', content: (item) => item.name },
1728
{ title: 'Description', filterId: 'desc', content: (item) => item.desc },
29+
{
30+
title: 'Type',
31+
filterId: 'type',
32+
content: (item) => {
33+
const cls = AuthModuleConfigsPage.TYPE_BADGE_COLORS[item.type];
34+
return (
35+
<span
36+
className={`badge ${cls || ''}`}
37+
style={cls ? undefined : { backgroundColor: 'rgba(128, 128, 128, 0.25)', color: 'inherit' }}
38+
>
39+
{item.type}
40+
</span>
41+
);
42+
},
43+
},
1844
];
1945

2046
componentDidMount() {
@@ -124,7 +150,7 @@ export class AuthModuleConfigsPage extends Component {
124150
BackOfficeServices.findAllAuthConfigs({
125151
// findAuthConfigs
126152
...paginationState,
127-
fields: ['id', 'name', 'desc'],
153+
fields: ['id', 'name', 'desc', 'type'],
128154
})
129155
}
130156
updateItem={BackOfficeServices.updateAuthConfig}

0 commit comments

Comments
 (0)