@@ -9,6 +9,7 @@ import { useConfirm } from "../hooks/confirm";
9
9
import { useWorkunit , useWorkunitExceptions } from "../hooks/workunit" ;
10
10
import { ReflexContainer , ReflexElement , ReflexSplitter } from "../layouts/react-reflex" ;
11
11
import { pushUrl , replaceUrl } from "../util/history" ;
12
+ import { HolyGrail } from "../layouts/HolyGrail" ;
12
13
import { ShortVerticalDivider } from "./Common" ;
13
14
import { TableGroup } from "./forms/Groups" ;
14
15
import { PublishQueryForm } from "./forms/PublishQuery" ;
@@ -26,10 +27,12 @@ interface MessageBarContent {
26
27
27
28
interface WorkunitSummaryProps {
28
29
wuid : string ;
30
+ fullscreen ?: boolean ;
29
31
}
30
32
31
33
export const WorkunitSummary : React . FunctionComponent < WorkunitSummaryProps > = ( {
32
- wuid
34
+ wuid,
35
+ fullscreen = false
33
36
} ) => {
34
37
35
38
const [ workunit , , , , refresh ] = useWorkunit ( wuid , true ) ;
@@ -171,6 +174,13 @@ export const WorkunitSummary: React.FunctionComponent<WorkunitSummaryProps> = ({
171
174
} ,
172
175
] , [ _protected , canDelete , canDeschedule , canReschedule , canSave , description , jobname , refresh , refreshSavings , setShowDeleteConfirm , showMessageBar , workunit , wuid ] ) ;
173
176
177
+ const rightButtons = React . useMemo ( ( ) : ICommandBarItemProps [ ] => [
178
+ {
179
+ key : "fullscreen" , title : nlsHPCC . MaximizeRestore , iconProps : { iconName : fullscreen ? "ChromeRestore" : "FullScreen" } ,
180
+ onClick : ( ) => pushUrl ( `/workunits/${ wuid } ${ fullscreen ? "" : "?fullscreen" } ` )
181
+ }
182
+ ] , [ fullscreen , wuid ] ) ;
183
+
174
184
const serviceNames = React . useMemo ( ( ) => {
175
185
return workunit ?. ServiceNames ?. Item ?. join ( "\n" ) || "" ;
176
186
} , [ workunit ?. ServiceNames ?. Item ] ) ;
@@ -190,68 +200,70 @@ export const WorkunitSummary: React.FunctionComponent<WorkunitSummaryProps> = ({
190
200
} , 0 ) || 0 ;
191
201
} , [ exceptions ] ) ;
192
202
193
- return < >
194
- < ReflexContainer orientation = "horizontal" >
195
- < ReflexElement >
196
- < div className = "pane-content" >
197
- < ScrollablePane scrollbarVisibility = { ScrollbarVisibility . auto } >
198
- < Sticky stickyPosition = { StickyPositionType . Header } >
199
- < CommandBar items = { buttons } />
200
- { messageBarContent &&
201
- < MessageBar messageBarType = { messageBarContent . type } dismissButtonAriaLabel = { nlsHPCC . Close } onDismiss = { dismissMessageBar } >
202
- { messageBarContent . message }
203
- </ MessageBar >
204
- }
205
- </ Sticky >
206
- < Sticky stickyPosition = { StickyPositionType . Header } >
207
- < WorkunitPersona wuid = { wuid } />
208
- < div style = { { width : "512px" , height : "64px" , float : "right" } } >
209
- < WUStatus wuid = { wuid } > </ WUStatus >
210
- </ div >
211
- </ Sticky >
212
- < TableGroup fields = { {
213
- "wuid" : { label : nlsHPCC . WUID , type : "string" , value : wuid , readonly : true } ,
214
- "action" : { label : nlsHPCC . Action , type : "string" , value : workunit ?. ActionEx , readonly : true } ,
215
- "state" : { label : nlsHPCC . State , type : "string" , value : workunit ?. State + ( workunit ?. StateEx ? ` (${ workunit . StateEx } )` : "" ) , readonly : true } ,
216
- "owner" : { label : nlsHPCC . Owner , type : "string" , value : workunit ?. Owner , readonly : true } ,
217
- "jobname" : { label : nlsHPCC . JobName , type : "string" , value : jobname } ,
218
- "description" : { label : nlsHPCC . Description , type : "string" , value : description } ,
219
- "potentialSavings" : { label : nlsHPCC . PotentialSavings , type : "string" , value : `${ formatCost ( potentialSavings ) } (${ totalCosts > 0 ? Math . round ( ( potentialSavings / totalCosts ) * 10000 ) / 100 : 0 } %)` , readonly : true } ,
220
- "compileCost" : { label : nlsHPCC . CompileCost , type : "string" , value : `${ formatCost ( workunit ?. CompileCost ) } ` , readonly : true } ,
221
- "executeCost" : { label : nlsHPCC . ExecuteCost , type : "string" , value : `${ formatCost ( workunit ?. ExecuteCost ) } ` , readonly : true } ,
222
- "fileAccessCost" : { label : nlsHPCC . FileAccessCost , type : "string" , value : `${ formatCost ( workunit ?. FileAccessCost ) } ` , readonly : true } ,
223
- "protected" : { label : nlsHPCC . Protected , type : "checkbox" , value : _protected } ,
224
- "cluster" : { label : nlsHPCC . Cluster , type : "string" , value : workunit ?. Cluster , readonly : true } ,
225
- "totalClusterTime" : { label : nlsHPCC . TotalClusterTime , type : "string" , value : workunit ?. TotalClusterTime ? workunit ?. TotalClusterTime : "0.00" , readonly : true } ,
226
- "abortedBy" : { label : nlsHPCC . AbortedBy , type : "string" , value : workunit ?. AbortBy , readonly : true } ,
227
- "abortedTime" : { label : nlsHPCC . AbortedTime , type : "string" , value : workunit ?. AbortTime , readonly : true } ,
228
- "ServiceNamesCustom" : { label : nlsHPCC . Services , type : "string" , value : serviceNames , readonly : true , multiline : true } ,
229
- } } onChange = { ( id , value ) => {
230
- switch ( id ) {
231
- case "jobname" :
232
- setJobname ( value ) ;
233
- break ;
234
- case "description" :
235
- setDescription ( value ) ;
236
- break ;
237
- case "protected" :
238
- setProtected ( value ) ;
239
- break ;
240
- default :
241
- logger . debug ( `${ id } : ${ value } ` ) ;
242
- }
243
- } } />
244
- </ ScrollablePane >
245
- </ div >
246
- </ ReflexElement >
247
- < ReflexSplitter />
248
- < ReflexElement >
249
- < InfoGrid wuid = { wuid } > </ InfoGrid >
250
- </ ReflexElement >
251
- </ ReflexContainer >
252
- < PublishQueryForm wuid = { wuid } showForm = { showPublishForm } setShowForm = { setShowPublishForm } />
253
- < ZAPDialog wuid = { wuid } showForm = { showZapForm } setShowForm = { setShowZapForm } />
254
- < SlaveLogs wuid = { wuid } showForm = { showThorSlaveLogs } setShowForm = { setShowThorSlaveLogs } />
255
- < DeleteConfirm />
256
- </ > ;
203
+ return < HolyGrail fullscreen = { fullscreen }
204
+ main = { < >
205
+ < ReflexContainer orientation = "horizontal" >
206
+ < ReflexElement >
207
+ < div className = "pane-content" >
208
+ < ScrollablePane scrollbarVisibility = { ScrollbarVisibility . auto } >
209
+ < Sticky stickyPosition = { StickyPositionType . Header } >
210
+ < CommandBar items = { buttons } farItems = { rightButtons } />
211
+ { messageBarContent &&
212
+ < MessageBar messageBarType = { messageBarContent . type } dismissButtonAriaLabel = { nlsHPCC . Close } onDismiss = { dismissMessageBar } >
213
+ { messageBarContent . message }
214
+ </ MessageBar >
215
+ }
216
+ </ Sticky >
217
+ < Sticky stickyPosition = { StickyPositionType . Header } >
218
+ < WorkunitPersona wuid = { wuid } />
219
+ < div style = { { width : "512px" , height : "64px" , float : "right" } } >
220
+ < WUStatus wuid = { wuid } > </ WUStatus >
221
+ </ div >
222
+ </ Sticky >
223
+ < TableGroup fields = { {
224
+ "wuid" : { label : nlsHPCC . WUID , type : "string" , value : wuid , readonly : true } ,
225
+ "action" : { label : nlsHPCC . Action , type : "string" , value : workunit ?. ActionEx , readonly : true } ,
226
+ "state" : { label : nlsHPCC . State , type : "string" , value : workunit ?. State + ( workunit ?. StateEx ? ` (${ workunit . StateEx } )` : "" ) , readonly : true } ,
227
+ "owner" : { label : nlsHPCC . Owner , type : "string" , value : workunit ?. Owner , readonly : true } ,
228
+ "jobname" : { label : nlsHPCC . JobName , type : "string" , value : jobname } ,
229
+ "description" : { label : nlsHPCC . Description , type : "string" , value : description } ,
230
+ "potentialSavings" : { label : nlsHPCC . PotentialSavings , type : "string" , value : `${ formatCost ( potentialSavings ) } (${ totalCosts > 0 ? Math . round ( ( potentialSavings / totalCosts ) * 10000 ) / 100 : 0 } %)` , readonly : true } ,
231
+ "compileCost" : { label : nlsHPCC . CompileCost , type : "string" , value : `${ formatCost ( workunit ?. CompileCost ) } ` , readonly : true } ,
232
+ "executeCost" : { label : nlsHPCC . ExecuteCost , type : "string" , value : `${ formatCost ( workunit ?. ExecuteCost ) } ` , readonly : true } ,
233
+ "fileAccessCost" : { label : nlsHPCC . FileAccessCost , type : "string" , value : `${ formatCost ( workunit ?. FileAccessCost ) } ` , readonly : true } ,
234
+ "protected" : { label : nlsHPCC . Protected , type : "checkbox" , value : _protected } ,
235
+ "cluster" : { label : nlsHPCC . Cluster , type : "string" , value : workunit ?. Cluster , readonly : true } ,
236
+ "totalClusterTime" : { label : nlsHPCC . TotalClusterTime , type : "string" , value : workunit ?. TotalClusterTime ? workunit ?. TotalClusterTime : "0.00" , readonly : true } ,
237
+ "abortedBy" : { label : nlsHPCC . AbortedBy , type : "string" , value : workunit ?. AbortBy , readonly : true } ,
238
+ "abortedTime" : { label : nlsHPCC . AbortedTime , type : "string" , value : workunit ?. AbortTime , readonly : true } ,
239
+ "ServiceNamesCustom" : { label : nlsHPCC . Services , type : "string" , value : serviceNames , readonly : true , multiline : true } ,
240
+ } } onChange = { ( id , value ) => {
241
+ switch ( id ) {
242
+ case "jobname" :
243
+ setJobname ( value ) ;
244
+ break ;
245
+ case "description" :
246
+ setDescription ( value ) ;
247
+ break ;
248
+ case "protected" :
249
+ setProtected ( value ) ;
250
+ break ;
251
+ default :
252
+ logger . debug ( `${ id } : ${ value } ` ) ;
253
+ }
254
+ } } />
255
+ </ ScrollablePane >
256
+ </ div >
257
+ </ ReflexElement >
258
+ < ReflexSplitter />
259
+ < ReflexElement >
260
+ < InfoGrid wuid = { wuid } > </ InfoGrid >
261
+ </ ReflexElement >
262
+ </ ReflexContainer >
263
+ < PublishQueryForm wuid = { wuid } showForm = { showPublishForm } setShowForm = { setShowPublishForm } />
264
+ < ZAPDialog wuid = { wuid } showForm = { showZapForm } setShowForm = { setShowZapForm } />
265
+ < SlaveLogs wuid = { wuid } showForm = { showThorSlaveLogs } setShowForm = { setShowThorSlaveLogs } />
266
+ < DeleteConfirm />
267
+ </ > }
268
+ /> ;
257
269
} ;
0 commit comments