1
1
import { t } from '@lingui/macro' ;
2
2
import * as React from 'react' ;
3
-
4
- import { withRouter , RouteComponentProps } from 'react-router-dom' ;
3
+ import { withRouter , RouteComponentProps , Link } from 'react-router-dom' ;
5
4
6
5
import {
7
6
BaseHeader ,
@@ -24,6 +23,8 @@ import {
24
23
DistributionType ,
25
24
} from 'src/api' ;
26
25
import { AppContext } from 'src/loaders/app-context' ;
26
+ import { Button , ToolbarItem } from '@patternfly/react-core' ;
27
+ import { Paths } from 'src/paths' ;
27
28
28
29
export class Repository {
29
30
name : string ;
@@ -159,7 +160,10 @@ class RepositoryList extends React.Component<RouteComponentProps, IState> {
159
160
}
160
161
/>
161
162
) }
162
- < BaseHeader title = { t `Repo Management` } >
163
+ < BaseHeader
164
+ title = { t `Repo Management` }
165
+ pageControls = { this . renderControls ( ) }
166
+ >
163
167
{ DEPLOYMENT_MODE === Constants . STANDALONE_DEPLOYMENT_MODE &&
164
168
! loading &&
165
169
! unauthorised ? (
@@ -285,6 +289,18 @@ class RepositoryList extends React.Component<RouteComponentProps, IState> {
285
289
} ) ;
286
290
} ;
287
291
292
+ private renderControls ( ) {
293
+ if ( this . state . params . tab == 'local' ) {
294
+ return (
295
+ < ToolbarItem >
296
+ < Link to = { Paths . token } >
297
+ < Button > { t `Get token` } </ Button >
298
+ </ Link >
299
+ </ ToolbarItem >
300
+ ) ;
301
+ }
302
+ }
303
+
288
304
private get updateParams ( ) {
289
305
return ParamHelper . updateParamsMixin ( this . nonQueryStringParams ) ;
290
306
}
0 commit comments