@amiable-dev/docusaurus-plugin-stentorosaur 0.16.2 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/StatusPage/index.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,KAAK,EAAC,UAAU,EAA+B,MAAM,aAAa,CAAC;AAK1E,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAC,UAAU,EAAC,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/StatusPage/index.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,KAAK,EAAC,UAAU,EAA+B,MAAM,aAAa,CAAC;AAK1E,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAC,UAAU,EAAC,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAoQnE"}
|
|
@@ -43,14 +43,34 @@ function StatusPage({ statusData }) {
|
|
|
43
43
|
// Fall back to legacy fetchUrl or default
|
|
44
44
|
return fetchUrl || '/status-data';
|
|
45
45
|
}, [dataSource, fetchUrl]);
|
|
46
|
+
// Helper: Create SystemStatusFile from build-time item data
|
|
47
|
+
const createSystemFilesFromItems = () => {
|
|
48
|
+
const files = [];
|
|
49
|
+
for (const item of items) {
|
|
50
|
+
if (item.history && item.history.length > 0) {
|
|
51
|
+
files.push({
|
|
52
|
+
name: item.name,
|
|
53
|
+
url: '',
|
|
54
|
+
lastChecked: item.lastChecked || new Date().toISOString(),
|
|
55
|
+
currentStatus: item.status,
|
|
56
|
+
history: item.history,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return files;
|
|
61
|
+
};
|
|
46
62
|
// Load system files with historical data for charts
|
|
47
63
|
(0, react_1.useEffect)(() => {
|
|
48
64
|
async function loadSystemFiles() {
|
|
49
65
|
if (!showPerformanceMetrics) {
|
|
50
66
|
return;
|
|
51
67
|
}
|
|
52
|
-
//
|
|
68
|
+
// For build-only strategy, use build-time data from items
|
|
53
69
|
if (dataSource?.strategy === 'build-only') {
|
|
70
|
+
const buildTimeFiles = createSystemFilesFromItems();
|
|
71
|
+
if (buildTimeFiles.length > 0) {
|
|
72
|
+
setSystemFiles(buildTimeFiles);
|
|
73
|
+
}
|
|
54
74
|
return;
|
|
55
75
|
}
|
|
56
76
|
const files = [];
|
|
@@ -91,7 +111,7 @@ function StatusPage({ statusData }) {
|
|
|
91
111
|
}
|
|
92
112
|
}
|
|
93
113
|
catch (error) {
|
|
94
|
-
// Fall through to legacy format
|
|
114
|
+
// Fall through to legacy format or build-time fallback
|
|
95
115
|
}
|
|
96
116
|
// Fallback to legacy format (systems/*.json)
|
|
97
117
|
for (const item of items) {
|
|
@@ -114,7 +134,14 @@ function StatusPage({ statusData }) {
|
|
|
114
134
|
// Silently ignore - file might not exist
|
|
115
135
|
}
|
|
116
136
|
}
|
|
117
|
-
|
|
137
|
+
// If no runtime data fetched, fall back to build-time data
|
|
138
|
+
if (files.length === 0) {
|
|
139
|
+
const buildTimeFiles = createSystemFilesFromItems();
|
|
140
|
+
setSystemFiles(buildTimeFiles);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
setSystemFiles(files);
|
|
144
|
+
}
|
|
118
145
|
}
|
|
119
146
|
if (items.length > 0) {
|
|
120
147
|
loadSystemFiles();
|
package/lib/version.d.ts
CHANGED
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amiable-dev/docusaurus-plugin-stentorosaur",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"description": "A Docusaurus plugin for displaying status monitoring dashboard powered by GitHub Issues and Actions, similar to Upptime",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-status.d.ts",
|