@@ -15,16 +15,16 @@ import {
1515 Paper ,
1616} from '@furystack/shades-common-components'
1717import { ObservableValue } from '@furystack/utils'
18+ import type { ServiceView , StackView } from 'common'
1819import {
20+ getServiceCwd ,
1921 GitHubRepository ,
2022 ServiceConfig ,
2123 ServiceDefinition ,
2224 ServiceStateHistory ,
2325 ServiceStatus ,
2426 StackDefinition ,
2527} from 'common'
26- import type { ServiceView , StackView } from 'common'
27- import { getServiceCwd } from 'common'
2828
2929import { navigate } from '../../utils/navigate.js'
3030
@@ -440,12 +440,12 @@ type ServiceHistoryProps = {
440440 serviceId : string
441441}
442442
443- type HistoryColumn = 'createdAt' | 'event' | 'triggeredBy' | 'triggerSource' | 'metadata'
443+ type HistoryColumn = 'createdAt' | 'event' | 'triggeredBy' | 'triggerSource' | 'metadata' | 'processUid'
444444
445445const ServiceHistory = Shade < ServiceHistoryProps > ( {
446446 shadowDomName : 'shade-service-history' ,
447447 render : ( options ) => {
448- const { props, useDisposable } = options
448+ const { props, injector , useDisposable } = options
449449
450450 const historyState = useCollectionSync ( options , ServiceStateHistory , {
451451 filter : { serviceId : { $eq : props . serviceId } } ,
@@ -479,7 +479,7 @@ const ServiceHistory = Shade<ServiceHistoryProps>({
479479 < div style = { { opacity : '0.6' , padding : '12px 0' } } > No history entries yet.</ div >
480480 ) : (
481481 < DataGrid < ServiceStateHistory , HistoryColumn >
482- columns = { [ 'createdAt' , 'event' , 'triggeredBy' , 'triggerSource' , 'metadata' ] }
482+ columns = { [ 'createdAt' , 'event' , 'triggeredBy' , 'triggerSource' , 'metadata' , 'processUid' ] }
483483 findOptions = { findOptions }
484484 styles = { undefined }
485485 collectionService = { collectionService }
@@ -489,6 +489,7 @@ const ServiceHistory = Shade<ServiceHistoryProps>({
489489 triggeredBy : ( ) => < span > Triggered by</ span > ,
490490 triggerSource : ( ) => < span > Source</ span > ,
491491 metadata : ( ) => < span > Details</ span > ,
492+ processUid : ( ) => < span > Logs</ span > ,
492493 } }
493494 rowComponents = { {
494495 createdAt : ( entry ) => < span > { new Date ( entry . createdAt ) . toLocaleString ( ) } </ span > ,
@@ -500,6 +501,17 @@ const ServiceHistory = Shade<ServiceHistoryProps>({
500501 { entry . metadata ?? '' }
501502 </ span >
502503 ) ,
504+ processUid : ( entry ) =>
505+ entry . processUid ? (
506+ < Button
507+ size = "small"
508+ onclick = { ( ) => navigate ( injector , `/services/${ props . serviceId } /logs/${ entry . processUid } ` ) }
509+ >
510+ Show Logs
511+ </ Button >
512+ ) : (
513+ < span />
514+ ) ,
503515 } }
504516 />
505517 ) }
0 commit comments