- Full-featured monitoring dashboard for local web apps - Real-time status tracking with uptime percentages - Visual sparklines for status history - Add/Edit/Delete apps dynamically - Categories and color coding - Auto-refresh every 30 seconds - API endpoints for apps and status management
60 lines
1.8 KiB
JavaScript
60 lines
1.8 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
callServer: null,
|
|
useServerActionDispatcher: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
callServer: function() {
|
|
return callServer;
|
|
},
|
|
useServerActionDispatcher: function() {
|
|
return useServerActionDispatcher;
|
|
}
|
|
});
|
|
const _react = require("react");
|
|
const _routerreducertypes = require("./components/router-reducer/router-reducer-types");
|
|
let globalServerActionDispatcher = null;
|
|
function useServerActionDispatcher(dispatch) {
|
|
const serverActionDispatcher = (0, _react.useCallback)((actionPayload)=>{
|
|
(0, _react.startTransition)(()=>{
|
|
dispatch({
|
|
...actionPayload,
|
|
type: _routerreducertypes.ACTION_SERVER_ACTION
|
|
});
|
|
});
|
|
}, [
|
|
dispatch
|
|
]);
|
|
globalServerActionDispatcher = serverActionDispatcher;
|
|
}
|
|
async function callServer(actionId, actionArgs) {
|
|
const actionDispatcher = globalServerActionDispatcher;
|
|
if (!actionDispatcher) {
|
|
throw new Error('Invariant: missing action dispatcher.');
|
|
}
|
|
return new Promise((resolve, reject)=>{
|
|
actionDispatcher({
|
|
actionId,
|
|
actionArgs,
|
|
resolve,
|
|
reject
|
|
});
|
|
});
|
|
}
|
|
|
|
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
}
|
|
|
|
//# sourceMappingURL=app-call-server.js.map
|