@amiable-dev/docusaurus-plugin-stentorosaur 0.16.2 → 0.16.4
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,CAwQnE"}
|
|
@@ -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 = [];
|
|
@@ -86,12 +106,16 @@ function StatusPage({ statusData }) {
|
|
|
86
106
|
});
|
|
87
107
|
}
|
|
88
108
|
}
|
|
89
|
-
|
|
90
|
-
|
|
109
|
+
// Only use current.json data if we found matching items
|
|
110
|
+
if (files.length > 0) {
|
|
111
|
+
setSystemFiles(files);
|
|
112
|
+
return; // Success, don't try legacy format
|
|
113
|
+
}
|
|
114
|
+
// Otherwise, fall through to try legacy format or build-time data
|
|
91
115
|
}
|
|
92
116
|
}
|
|
93
117
|
catch (error) {
|
|
94
|
-
// Fall through to legacy format
|
|
118
|
+
// Fall through to legacy format or build-time fallback
|
|
95
119
|
}
|
|
96
120
|
// Fallback to legacy format (systems/*.json)
|
|
97
121
|
for (const item of items) {
|
|
@@ -114,7 +138,14 @@ function StatusPage({ statusData }) {
|
|
|
114
138
|
// Silently ignore - file might not exist
|
|
115
139
|
}
|
|
116
140
|
}
|
|
117
|
-
|
|
141
|
+
// If no runtime data fetched, fall back to build-time data
|
|
142
|
+
if (files.length === 0) {
|
|
143
|
+
const buildTimeFiles = createSystemFilesFromItems();
|
|
144
|
+
setSystemFiles(buildTimeFiles);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
setSystemFiles(files);
|
|
148
|
+
}
|
|
118
149
|
}
|
|
119
150
|
if (items.length > 0) {
|
|
120
151
|
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.4",
|
|
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",
|