@@ -29,9 +29,10 @@ export const generateSummary = async () => {
29
29
// This object will track the summary data of all sites
30
30
const pageStatuses : Array < SiteStatus > = [ ] ;
31
31
32
- // We'll keep incrementing this if there are down sites
32
+ // We'll keep incrementing this if there are down/degraded sites
33
33
// This is used to show the overall status later
34
34
let numberOfDown = 0 ;
35
+ let numberOfDegraded = 0 ;
35
36
36
37
// Loop through each site and add compute the current status
37
38
for await ( const site of config . sites ) {
@@ -64,11 +65,15 @@ export const generateSummary = async () => {
64
65
. filter ( ( item ) => item && ! isNaN ( item ) )
65
66
. reduce ( ( p , c ) => p + c , 0 ) / history . data . length ;
66
67
67
- // Current status is "up" or "down " based on the emoji prefix of the commit message
68
- const status = history . data [ 0 ] . commit . message
68
+ // Current status is "up", "down", or "degraded " based on the emoji prefix of the commit message
69
+ const status : "up" | "down" | "degraded" = history . data [ 0 ] . commit . message
69
70
. split ( " " ) [ 0 ]
70
71
. includes ( config . commitPrefixStatusUp || "π©" )
71
72
? "up"
73
+ : history . data [ 0 ] . commit . message
74
+ . split ( " " ) [ 0 ]
75
+ . includes ( config . commitPrefixStatusDegraded || "π¨" )
76
+ ? "degraded"
72
77
: "down" ;
73
78
74
79
pageStatuses . push ( {
@@ -80,6 +85,7 @@ export const generateSummary = async () => {
80
85
time : Math . floor ( averageTime ) ,
81
86
} ) ;
82
87
if ( status === "down" ) numberOfDown ++ ;
88
+ if ( status === "degraded" ) numberOfDegraded ++ ;
83
89
}
84
90
85
91
let website = `https://${ config . owner } .github.io/${ config . repo } ` ;
@@ -100,7 +106,11 @@ ${pageStatuses
100
106
. map (
101
107
( page ) =>
102
108
`| ${ page . url . includes ( "$" ) ? page . name : `[${ page . name } ](${ page . url } )` } | ${
103
- page . status === "up" ? i18n . up || "π© Up" : i18n . down || "π₯ Down"
109
+ page . status === "up"
110
+ ? i18n . up || "π© Up"
111
+ : page . status === "degraded"
112
+ ? i18n . degraded || "π¨ Degraded"
113
+ : i18n . down || "π₯ Down"
104
114
} | [${ page . slug } .yml](https://github.com/${ owner } /${ repo } /commits/master/history/${
105
115
page . slug
106
116
} .yml) | <img alt="${ i18n . responseTimeGraphAlt || "Response time graph" } " src="./graphs/${
@@ -224,10 +234,12 @@ ${config.summaryEndHtmlComment || "<!--end: status pages-->"}${endText}`;
224
234
if ( line . includes ( "<!--live status-->" ) ) {
225
235
line = `${ line . split ( "<!--live status-->" ) [ 0 ] } <!--live status--> **${
226
236
numberOfDown === 0
227
- ? i18n . allSystemsOperational || "π© All systems operational"
237
+ ? numberOfDegraded === 0
238
+ ? i18n . allSystemsOperational || "π© All systems operational"
239
+ : i18n . degradedPerformance || "π¨ Degraded performance"
228
240
: numberOfDown === config . sites . length
229
241
? i18n . completeOutage || "π₯ Complete outage"
230
- : i18n . partialOutage || "π¨ Partial outage"
242
+ : i18n . partialOutage || "π§ Partial outage"
231
243
} **`;
232
244
}
233
245
return line ;
0 commit comments