signalk-container 0.1.7 → 0.2.0
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.
- package/README.md +122 -59
- package/dist/containers.d.ts +1 -1
- package/dist/containers.d.ts.map +1 -1
- package/dist/containers.js +26 -5
- package/dist/containers.js.map +1 -1
- package/dist/index.js +209 -5
- package/dist/index.js.map +1 -1
- package/dist/resources.d.ts +36 -0
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +58 -0
- package/dist/resources.js.map +1 -1
- package/doc/plugin-developer-guide.md +65 -0
- package/package.json +3 -4
- package/public/540.js +1 -1
- package/public/805.js +1 -1
- package/public/main.js +1 -1
- package/public/remoteEntry.js +1 -1
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signalk-container",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Shared container runtime management (Podman/Docker) for Signal K plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"signalk-node-server-plugin",
|
|
7
7
|
"signalk-plugin-configurator"
|
|
8
8
|
],
|
|
9
9
|
"signalk": {
|
|
10
|
-
"displayName": "Container Manager"
|
|
11
|
-
"appIcon": "./icon.svg"
|
|
10
|
+
"displayName": "Container Manager"
|
|
12
11
|
},
|
|
13
12
|
"signalk-plugin-enabled-by-default": true,
|
|
14
13
|
"main": "dist/index.js",
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
"@eslint/js": "^10.0.1",
|
|
39
38
|
"@signalk/server-api": "latest",
|
|
40
39
|
"@types/express": "^5.0.6",
|
|
41
|
-
"@types/node": "^
|
|
40
|
+
"@types/node": "^22.0.0",
|
|
42
41
|
"babel-loader": "^10.1.1",
|
|
43
42
|
"eslint": "^10.2.0",
|
|
44
43
|
"eslint-config-prettier": "^10.1.8",
|
package/public/540.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 540.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunksignalk_container=self.webpackChunksignalk_container||[]).push([[540],{869(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),d=Symbol.iterator,h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,b={};function m(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||h}function v(){}function S(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||h}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=m.prototype;var E=S.prototype=new v;E.constructor=S,_(E,m.prototype),E.isPureReactComponent=!0;var g=Array.isArray;function w(){}var k={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function j(e,t,r){var o=r.ref;return{$$typeof:n,type:e,key:t,ref:void 0!==o?o:null,props:r}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var R=/\/+/g;function $(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function T(e,t,o,u,c){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var s,a,f=!1;if(null===e)f=!0;else switch(i){case"bigint":case"string":case"number":f=!0;break;case"object":switch(e.$$typeof){case n:case r:f=!0;break;case p:return T((f=e._init)(e._payload),t,o,u,c)}}if(f)return c=c(e),f=""===u?"."+$(e,0):u,g(c)?(o="",null!=f&&(o=f.replace(R,"$&/")+"/"),T(c,t,o,"",function(e){return e})):null!=c&&(C(c)&&(s=c,a=o+(null==c.key||e&&e.key===c.key?"":(""+c.key).replace(R,"$&/")+"/")+f,c=j(s.type,a,s.props)),t.push(c)),1;f=0;var l,y=""===u?".":u+":";if(g(e))for(var h=0;h<e.length;h++)f+=T(u=e[h],t,o,i=y+$(u,h),c);else if("function"==typeof(h=null===(l=e)||"object"!=typeof l?null:"function"==typeof(l=d&&l[d]||l["@@iterator"])?l:null))for(e=h.call(e),h=0;!(u=e.next()).done;)f+=T(u=u.value,t,o,i=y+$(u,h++),c);else if("object"===i){if("function"==typeof e.then)return T(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(w,w):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,o,u,c);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return f}function x(e,t,n){if(null==e)return e;var r=[],o=0;return T(e,r,"","",function(e){return t.call(n,e,o++)}),r}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},I={map:x,forEach:function(e,t,n){x(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return x(e,function(){t++}),t},toArray:function(e){return x(e,function(e){return e})||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=y,t.Children=I,t.Component=m,t.Fragment=o,t.Profiler=c,t.PureComponent=S,t.StrictMode=u,t.Suspense=f,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return k.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=_({},e.props),o=e.key;if(null!=t)for(u in void 0!==t.key&&(o=""+t.key),t)!H.call(t,u)||"key"===u||"__self"===u||"__source"===u||"ref"===u&&void 0===t.ref||(r[u]=t[u]);var u=arguments.length-2;if(1===u)r.children=n;else if(1<u){for(var c=Array(u),i=0;i<u;i++)c[i]=arguments[i+2];r.children=c}return j(e.type,o,r)},t.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:i,_context:e},e},t.createElement=function(e,t,n){var r,o={},u=null;if(null!=t)for(r in void 0!==t.key&&(u=""+t.key),t)H.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var c=arguments.length-2;if(1===c)o.children=n;else if(1<c){for(var i=Array(c),s=0;s<c;s++)i[s]=arguments[s+2];o.children=i}if(e&&e.defaultProps)for(r in c=e.defaultProps)void 0===o[r]&&(o[r]=c[r]);return j(e,u,o)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:a,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:A}},t.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=k.T,n={};k.T=n;try{var r=e(),o=k.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(w,O)}catch(e){O(e)}finally{null!==t&&null!==n.types&&(t.types=n.types),k.T=t}},t.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},t.use=function(e){return k.H.use(e)},t.useActionState=function(e,t,n){return k.H.useActionState(e,t,n)},t.useCallback=function(e,t){return k.H.useCallback(e,t)},t.useContext=function(e){return k.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return k.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return k.H.useEffect(e,t)},t.useEffectEvent=function(e){return k.H.useEffectEvent(e)},t.useId=function(){return k.H.useId()},t.useImperativeHandle=function(e,t,n){return k.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return k.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return k.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return k.H.useMemo(e,t)},t.useOptimistic=function(e,t){return k.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return k.H.useReducer(e,t,n)},t.useRef=function(e){return k.H.useRef(e)},t.useState=function(e){return k.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return k.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return k.H.useTransition()},t.version="19.2.
|
|
2
|
+
"use strict";(self.webpackChunksignalk_container=self.webpackChunksignalk_container||[]).push([[540],{869(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),d=Symbol.iterator,h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,b={};function m(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||h}function v(){}function S(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||h}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=m.prototype;var E=S.prototype=new v;E.constructor=S,_(E,m.prototype),E.isPureReactComponent=!0;var g=Array.isArray;function w(){}var k={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function j(e,t,r){var o=r.ref;return{$$typeof:n,type:e,key:t,ref:void 0!==o?o:null,props:r}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var R=/\/+/g;function $(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function T(e,t,o,u,c){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var s,a,f=!1;if(null===e)f=!0;else switch(i){case"bigint":case"string":case"number":f=!0;break;case"object":switch(e.$$typeof){case n:case r:f=!0;break;case p:return T((f=e._init)(e._payload),t,o,u,c)}}if(f)return c=c(e),f=""===u?"."+$(e,0):u,g(c)?(o="",null!=f&&(o=f.replace(R,"$&/")+"/"),T(c,t,o,"",function(e){return e})):null!=c&&(C(c)&&(s=c,a=o+(null==c.key||e&&e.key===c.key?"":(""+c.key).replace(R,"$&/")+"/")+f,c=j(s.type,a,s.props)),t.push(c)),1;f=0;var l,y=""===u?".":u+":";if(g(e))for(var h=0;h<e.length;h++)f+=T(u=e[h],t,o,i=y+$(u,h),c);else if("function"==typeof(h=null===(l=e)||"object"!=typeof l?null:"function"==typeof(l=d&&l[d]||l["@@iterator"])?l:null))for(e=h.call(e),h=0;!(u=e.next()).done;)f+=T(u=u.value,t,o,i=y+$(u,h++),c);else if("object"===i){if("function"==typeof e.then)return T(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(w,w):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,o,u,c);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return f}function x(e,t,n){if(null==e)return e;var r=[],o=0;return T(e,r,"","",function(e){return t.call(n,e,o++)}),r}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},I={map:x,forEach:function(e,t,n){x(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return x(e,function(){t++}),t},toArray:function(e){return x(e,function(e){return e})||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=y,t.Children=I,t.Component=m,t.Fragment=o,t.Profiler=c,t.PureComponent=S,t.StrictMode=u,t.Suspense=f,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return k.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=_({},e.props),o=e.key;if(null!=t)for(u in void 0!==t.key&&(o=""+t.key),t)!H.call(t,u)||"key"===u||"__self"===u||"__source"===u||"ref"===u&&void 0===t.ref||(r[u]=t[u]);var u=arguments.length-2;if(1===u)r.children=n;else if(1<u){for(var c=Array(u),i=0;i<u;i++)c[i]=arguments[i+2];r.children=c}return j(e.type,o,r)},t.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:i,_context:e},e},t.createElement=function(e,t,n){var r,o={},u=null;if(null!=t)for(r in void 0!==t.key&&(u=""+t.key),t)H.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var c=arguments.length-2;if(1===c)o.children=n;else if(1<c){for(var i=Array(c),s=0;s<c;s++)i[s]=arguments[s+2];o.children=i}if(e&&e.defaultProps)for(r in c=e.defaultProps)void 0===o[r]&&(o[r]=c[r]);return j(e,u,o)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:a,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:A}},t.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=k.T,n={};k.T=n;try{var r=e(),o=k.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(w,O)}catch(e){O(e)}finally{null!==t&&null!==n.types&&(t.types=n.types),k.T=t}},t.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},t.use=function(e){return k.H.use(e)},t.useActionState=function(e,t,n){return k.H.useActionState(e,t,n)},t.useCallback=function(e,t){return k.H.useCallback(e,t)},t.useContext=function(e){return k.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return k.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return k.H.useEffect(e,t)},t.useEffectEvent=function(e){return k.H.useEffectEvent(e)},t.useId=function(){return k.H.useId()},t.useImperativeHandle=function(e,t,n){return k.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return k.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return k.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return k.H.useMemo(e,t)},t.useOptimistic=function(e,t){return k.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return k.H.useReducer(e,t,n)},t.useRef=function(e){return k.H.useRef(e)},t.useState=function(e){return k.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return k.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return k.H.useTransition()},t.version="19.2.5"},540(e,t,n){e.exports=n(869)}}]);
|
package/public/805.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunksignalk_container=self.webpackChunksignalk_container||[]).push([[805],{805(e,t,n){n.r(t),n.d(t,{default:()=>u});var r=n(231);const i={root:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',color:"#333",padding:"16px 0"},sectionTitle:{fontSize:13,fontWeight:600,color:"#888",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:10,marginTop:24},btn:{display:"inline-flex",alignItems:"center",gap:8,padding:"8px 16px",border:"none",borderRadius:6,fontSize:13,fontWeight:600,cursor:"pointer"},btnPrimary:{background:"#3b82f6",color:"#fff"},btnDanger:{background:"#ef4444",color:"#fff",padding:"6px 12px",fontSize:12},btnWarning:{background:"#f59e0b",color:"#fff",padding:"6px 12px",fontSize:12},btnSave:{background:"#3b82f6",color:"#fff"},btnSuccess:{background:"#10b981",color:"#fff"},btnDisabled:{opacity:.5,cursor:"not-allowed"},status:{marginTop:8,fontSize:12,minHeight:18},runtimeCard:{display:"flex",alignItems:"center",gap:14,padding:"14px 18px",background:"#f8f9fa",border:"1px solid #e0e0e0",borderRadius:10,marginBottom:12},runtimeIcon:{width:44,height:44,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",fontSize:22,flexShrink:0},runtimeInfo:{flex:1},runtimeName:{fontSize:15,fontWeight:600,color:"#333"},runtimeVersion:{fontSize:12,color:"#888"},containerItem:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",background:"#f8f9fa",border:"1px solid #e0e0e0",borderRadius:10,marginBottom:8},stateIndicator:{width:10,height:10,borderRadius:"50%",flexShrink:0},containerInfo:{flex:1,minWidth:0},containerName:{fontSize:14,fontWeight:600,color:"#333"},containerMeta:{fontSize:11,color:"#888",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},containerActions:{display:"flex",gap:6,flexShrink:0},containerCard:{background:"#f8f9fa",border:"1px solid #e0e0e0",borderRadius:10,marginBottom:8,overflow:"hidden"},containerItemFlat:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px"},limitsRow:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px 10px 34px",fontSize:11,color:"#666",flexWrap:"wrap"},limitBadge:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:12,background:"#e5e7eb",color:"#374151",fontSize:11,fontWeight:500},overrideBadge:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:12,background:"#fef3c7",color:"#92400e",fontSize:10,fontWeight:600},editLimitsBtn:{marginLeft:"auto",padding:"3px 10px",fontSize:11,background:"#fff",color:"#3b82f6",border:"1px solid #3b82f6",borderRadius:6,cursor:"pointer",fontWeight:500},limitsEditor:{borderTop:"1px solid #e0e0e0",padding:"14px 14px 14px 34px",background:"#fff"},limitsEditorGrid:{display:"grid",gridTemplateColumns:"160px 1fr auto",gap:"8px 12px",alignItems:"center",marginBottom:10},limitsEditorLabel:{fontSize:12,fontWeight:500,color:"#555"},limitsEditorInput:{padding:"5px 8px",borderRadius:5,border:"1px solid #ccc",fontSize:12,background:"#fff",color:"#333",fontFamily:"inherit",width:"100%",boxSizing:"border-box"},limitsEditorInputDisabled:{background:"#f3f4f6",color:"#9ca3af",fontStyle:"italic"},limitsEditorUnsetBtn:{width:24,height:24,borderRadius:4,border:"1px solid #d1d5db",background:"#fff",color:"#6b7280",fontSize:14,lineHeight:1,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},limitsEditorUnsetBtnActive:{background:"#fee2e2",color:"#991b1b",border:"1px solid #fca5a5"},limitsEditorAdvancedToggle:{fontSize:11,color:"#3b82f6",cursor:"pointer",userSelect:"none",marginTop:6,marginBottom:10,display:"inline-block"},limitsEditorActions:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:10},limitsEditorResult:{marginTop:10,padding:"8px 10px",borderRadius:6,fontSize:11,lineHeight:1.5},limitsEditorResultLive:{background:"#d1fae5",color:"#065f46"},limitsEditorResultRecreated:{background:"#fef3c7",color:"#92400e"},limitsEditorResultError:{background:"#fee2e2",color:"#991b1b"},limitsEditorWarning:{marginTop:4,fontSize:10,opacity:.85,fontStyle:"italic"},empty:{textAlign:"center",padding:"30px 16px",color:"#999",fontSize:13},fieldRow:{display:"flex",alignItems:"center",gap:12,marginBottom:10},label:{fontSize:13,fontWeight:500,color:"#555",width:160,flexShrink:0},select:{padding:"6px 10px",borderRadius:6,border:"1px solid #ccc",fontSize:13,background:"#fff",color:"#333"},hint:{fontSize:11,color:"#aaa",marginLeft:8},pruneResult:{fontSize:12,color:"#10b981",marginTop:6}},a={running:"#10b981",stopped:"#f59e0b",missing:"#94a3b8","no-runtime":"#ef4444"},o={running:"Running",stopped:"Stopped",missing:"Not created","no-runtime":"No runtime"};function l({label:e,value:t,options:n,onChange:a,hint:o}){return r.createElement("div",{style:i.fieldRow},r.createElement("span",{style:i.label},e),r.createElement("select",{style:i.select,value:t,onChange:e=>a(e.target.value)},n.map(e=>r.createElement("option",{key:e.value,value:e.value},e.label))),o&&r.createElement("span",{style:i.hint},o))}function s({label:e,value:t,onChange:n,hint:a}){return r.createElement("div",{style:i.fieldRow},r.createElement("span",{style:i.label},e),r.createElement("label",{style:{display:"inline-flex",alignItems:"center",cursor:"pointer",gap:8}},r.createElement("input",{type:"checkbox",checked:t,onChange:e=>n(e.target.checked),style:{width:16,height:16,cursor:"pointer"}}),r.createElement("span",{style:{fontSize:13,color:"#555"}},t?"Enabled":"Disabled")),a&&r.createElement("span",{style:i.hint},a))}function c(e){return e&&e.startsWith("sk-")?e.slice(3):e}const d=[{key:"cpus",label:"CPU (cores)",type:"number",step:"0.1",min:"0.1",placeholder:"e.g. 1.5",primary:!0},{key:"memory",label:"Memory",type:"text",placeholder:"e.g. 512m, 2g",primary:!0},{key:"memorySwap",label:"Memory + swap",type:"text",placeholder:"= memory to disable swap",primary:!0},{key:"pidsLimit",label:"Max processes",type:"number",step:"1",min:"1",placeholder:"e.g. 200",primary:!0},{key:"cpuShares",label:"CPU shares (weight)",type:"number",step:"1",min:"2",placeholder:"default 1024",primary:!1},{key:"cpusetCpus",label:"Pin to CPUs",type:"text",placeholder:'e.g. "0,1" or "1-3"',primary:!1},{key:"memoryReservation",label:"Memory reservation",type:"text",placeholder:"soft floor, e.g. 256m",primary:!1},{key:"oomScoreAdj",label:"OOM score adjust",type:"number",step:"1",min:"-1000",max:"1000",placeholder:"-1000 to 1000",primary:!1}];function m({containerName:e,effective:t,initialOverride:n,onApply:a,onClose:o}){const l=()=>{const e={};for(const n of d)t&&void 0!==t[n.key]&&null!==t[n.key]?e[n.key]=String(t[n.key]):e[n.key]="";return e},[s,c]=(0,r.useState)(l),[m,u]=(0,r.useState)(()=>!!n&&d.some(e=>!e.primary&&void 0!==n[e.key])),[p,f]=(0,r.useState)(!1),[g,y]=(0,r.useState)(null),b=t=>{const n=s[t.key],a=null===n;return r.createElement(r.Fragment,{key:t.key},r.createElement("label",{style:i.limitsEditorLabel,htmlFor:`lim-${e}-${t.key}`},t.label),r.createElement("input",{id:`lim-${e}-${t.key}`,type:a?"text":t.type,value:a?"":n,step:t.step,min:t.min,max:t.max,placeholder:a?"(unset — remove limit)":t.placeholder,disabled:a,onChange:e=>{return n=t.key,r=e.target.value,void c(e=>({...e,[n]:r}));var n,r},style:{...i.limitsEditorInput,...a?i.limitsEditorInputDisabled:{}}}),r.createElement("button",{type:"button",onClick:()=>{return e=t.key,void c(t=>({...t,[e]:null===t[e]?"":null}));var e},title:a?"Click to set a value again":"Click to explicitly unset (remove this limit)",style:{...i.limitsEditorUnsetBtn,...a?i.limitsEditorUnsetBtnActive:{}}},a?"↺":"×"))},h=d.filter(e=>e.primary),v=d.filter(e=>!e.primary);return r.createElement("div",{style:i.limitsEditor},r.createElement("div",{style:i.limitsEditorGrid},h.map(b)),r.createElement("span",{onClick:()=>u(!m),style:i.limitsEditorAdvancedToggle},m?"▾":"▸"," Advanced (",v.length," more fields)"),m&&r.createElement("div",{style:i.limitsEditorGrid},v.map(b)),r.createElement("div",{style:i.limitsEditorActions},r.createElement("button",{type:"button",onClick:o,style:{...i.btn,padding:"6px 12px",fontSize:12,background:"#fff",color:"#6b7280",border:"1px solid #d1d5db"}},"Close"),r.createElement("button",{type:"button",onClick:()=>{c(l()),y(null)},style:{...i.btn,padding:"6px 12px",fontSize:12,background:"#fff",color:"#6b7280",border:"1px solid #d1d5db"}},"Reset"),r.createElement("button",{type:"button",onClick:async()=>{f(!0),y(null);try{const e=function(e){const t={};for(const n of d){const r=e[n.key];if(null!==r){if(void 0!==r&&""!==r)if("number"===n.type){const e=Number(r);if(!Number.isFinite(e))continue;t[n.key]=e}else t[n.key]=r}else t[n.key]=null}return t}(s),t=await a(e);y(t)}catch(e){y({error:e.message||String(e)})}f(!1)},disabled:p,style:{...i.btn,...i.btnPrimary,padding:"6px 14px",fontSize:12,...p?i.btnDisabled:{}}},p?"Applying...":"Apply")),g&&r.createElement("div",{style:{...i.limitsEditorResult,...g.error?i.limitsEditorResultError:"recreated"===g.method?i.limitsEditorResultRecreated:i.limitsEditorResultLive}},g.error?r.createElement(r.Fragment,null,r.createElement("strong",null,"Error:")," ",g.error):r.createElement(r.Fragment,null,r.createElement("strong",null,"live"===g.method?"Applied live (no restart)":"Container recreated"),g.warnings&&g.warnings.length>0&&r.createElement("div",{style:i.limitsEditorWarning},g.warnings.map((e,t)=>r.createElement("div",{key:t},"⚠ ",e))))))}function u({configuration:e,save:t}){const n=e||{},[u,p]=(0,r.useState)(n.runtime||"auto"),[f,g]=(0,r.useState)(n.pruneSchedule||"weekly"),[y,b]=(0,r.useState)(n.updateCheckInterval||"24h"),[h,v]=(0,r.useState)(!1!==n.backgroundUpdateChecks),[k,E]=(0,r.useState)(n.containerOverrides||{}),[x,S]=(0,r.useState)(null),[w,C]=(0,r.useState)([]),[R,I]=(0,r.useState)({}),[$,z]=(0,r.useState)(new Set),[T,P]=(0,r.useState)(!0),[A,B]=(0,r.useState)(""),[j,U]=(0,r.useState)(!1),[W,O]=(0,r.useState)(null),D=(0,r.useCallback)(async()=>{try{const[e,t]=await Promise.all([fetch("/plugins/signalk-container/api/runtime"),fetch("/plugins/signalk-container/api/containers")]);e.ok?S(await e.json()):S(null);let n=[];if(t.ok?(n=await t.json(),C(n)):C([]),n.length>0){const e={};await Promise.all(n.map(async t=>{const n=c(t.name);try{const t=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(n)}/resources`);if(t.ok){const r=await t.json();e[n]=r.effective||{}}}catch{}})),I(e)}}catch{S(null),C([])}P(!1)},[]);(0,r.useEffect)(()=>{D();const e=setInterval(D,5e3);return()=>clearInterval(e)},[D]);const N=e=>{const t=c(e);z(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})};return r.createElement("div",{style:i.root},r.createElement("div",{style:i.sectionTitle},"Runtime"),T?r.createElement("div",{style:i.empty},"Detecting container runtime..."):x?r.createElement("div",{style:i.runtimeCard},r.createElement("div",{style:{...i.runtimeIcon,background:"podman"===x.runtime?"#892ca0":"#2496ed",color:"#fff"}},"podman"===x.runtime?"P":"D"),r.createElement("div",{style:i.runtimeInfo},r.createElement("div",{style:i.runtimeName},x.runtime.charAt(0).toUpperCase()+x.runtime.slice(1),x.isPodmanDockerShim?" (via docker shim)":""),r.createElement("div",{style:i.runtimeVersion},"Version ",x.version)),r.createElement("div",{style:{...i.stateIndicator,background:"#10b981"},title:"Runtime available"})):r.createElement("div",{style:i.runtimeCard},r.createElement("div",{style:{...i.runtimeIcon,background:"#fef2f2",color:"#ef4444"}},"!"),r.createElement("div",{style:i.runtimeInfo},r.createElement("div",{style:i.runtimeName},"No container runtime found"),r.createElement("div",{style:i.runtimeVersion},"Install Podman: sudo apt install podman"))),r.createElement("div",{style:i.sectionTitle},"Settings"),r.createElement(l,{label:"Preferred runtime",value:u,onChange:p,options:[{value:"auto",label:"Auto-detect (Podman preferred)"},{value:"podman",label:"Podman"},{value:"docker",label:"Docker"}]}),r.createElement(l,{label:"Auto-prune images",value:f,onChange:g,options:[{value:"off",label:"Off"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"}]}),r.createElement(l,{label:"Update check interval",value:y,onChange:b,options:[{value:"1h",label:"Every hour"},{value:"6h",label:"Every 6 hours"},{value:"12h",label:"Every 12 hours"},{value:"24h",label:"Daily (recommended)"},{value:"48h",label:"Every 2 days"},{value:"168h",label:"Weekly"}],hint:"How often to check for new container images"}),r.createElement(s,{label:"Background update checks",value:h,onChange:v,hint:"Disable on metered connections; manual check still works"}),r.createElement("div",{style:i.sectionTitle},"Managed Containers"),0===w.length?r.createElement("div",{style:i.empty},T?"Loading...":"No managed containers. Other plugins will create them."):w.map(e=>{const t=c(e.name),n=R[t]||{},l=k[t]&&Object.keys(k[t]).length>0,s=$.has(t),u=d.map(e=>function(e,t){if(null==t||""===t)return null;switch(e){case"cpus":return`${t} CPU`;case"memory":return`${t}`;case"memorySwap":return`swap: ${t}`;case"memoryReservation":return`reserve: ${t}`;case"pidsLimit":return`${t} PIDs`;case"cpuShares":return`shares: ${t}`;case"cpusetCpus":return`cpus: ${t}`;case"oomScoreAdj":return`oom: ${t}`;default:return`${e}: ${t}`}}(e.key,n[e.key])).filter(Boolean);return r.createElement("div",{key:e.name,style:i.containerCard},r.createElement("div",{style:i.containerItemFlat},r.createElement("div",{style:{...i.stateIndicator,background:a[e.state]||"#94a3b8"},title:o[e.state]||e.state}),r.createElement("div",{style:i.containerInfo},r.createElement("div",{style:i.containerName},e.name),r.createElement("div",{style:i.containerMeta},e.image," · ",o[e.state]||e.state,e.ports&&e.ports.length>0&&e.ports[0]?` · ${e.ports.join(", ")}`:"")),r.createElement("div",{style:i.containerActions},"stopped"===e.state&&r.createElement("button",{style:{...i.btn,...i.btnPrimary,padding:"6px 12px",fontSize:12},onClick:()=>(async e=>{B(`Starting ${e}...`),U(!1);try{const t=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(e)}/start`,{method:"POST"});if(t.ok)B(`${e} started.`),D();else{const e=await t.json().catch(()=>({error:t.statusText}));B(`Failed: ${e.error}`),U(!0)}}catch(e){B(`Error: ${e.message}`),U(!0)}})(e.name)},"Start"),"running"===e.state&&r.createElement("button",{style:{...i.btn,...i.btnWarning},onClick:()=>(async e=>{B(`Stopping ${e}...`),U(!1);try{const t=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(e)}/stop`,{method:"POST"});if(t.ok)B(`${e} stopped.`),D();else{const e=await t.json().catch(()=>({error:t.statusText}));B(`Failed: ${e.error}`),U(!0)}}catch(e){B(`Error: ${e.message}`),U(!0)}})(e.name)},"Stop"),r.createElement("button",{style:{...i.btn,...i.btnDanger},onClick:()=>(async(e,t)=>{if("running"!==t||window.confirm(`${e} is running. Stop and remove it?`)){B(`Removing ${e}...`),U(!1);try{const t=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(e)}/remove`,{method:"POST"});if(t.ok)B(`${e} removed.`),D();else{const e=await t.json().catch(()=>({error:t.statusText}));B(`Failed: ${e.error}`),U(!0)}}catch(e){B(`Error: ${e.message}`),U(!0)}}})(e.name,e.state)},"Remove"))),r.createElement("div",{style:i.limitsRow},0===u.length?r.createElement("span",{style:{color:"#9ca3af",fontStyle:"italic"}},"No resource limits set"):u.map((e,t)=>r.createElement("span",{key:t,style:i.limitBadge},e)),l&&r.createElement("span",{style:i.overrideBadge,title:"You have a user override configured for this container"},"Override active"),"running"===e.state&&r.createElement("button",{type:"button",style:i.editLimitsBtn,onClick:()=>N(e.name)},s?"Collapse ▾":"Edit Limits ▸")),s&&r.createElement(m,{containerName:t,effective:n,initialOverride:k[t],onApply:e=>(async(e,t)=>{const n=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(e)}/resources`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await n.json().catch(()=>({}));return n.ok?(r.effective&&I(t=>({...t,[e]:r.effective})),E(n=>({...n,[e]:t})),{method:r.method,warnings:r.warnings}):{error:r.error||`${n.status} ${n.statusText}`}})(t,e),onClose:()=>N(e.name)}))}),r.createElement("div",{style:i.sectionTitle},"Maintenance"),r.createElement("button",{style:{...i.btn,...i.btnSuccess},onClick:async()=>{B("Pruning dangling images..."),U(!1),O(null);try{const e=await fetch("/plugins/signalk-container/api/prune",{method:"POST"});if(e.ok){const t=await e.json().catch(()=>({error:e.statusText}));O(t),B(`Pruned ${t.imagesRemoved} image(s), reclaimed ${t.spaceReclaimed}.`)}else{const t=await e.json().catch(()=>({error:e.statusText}));B(`Prune failed: ${t.error}`),U(!0)}}catch(e){B(`Error: ${e.message}`),U(!0)}}},"Prune Dangling Images"),A&&r.createElement("div",{style:{...i.status,color:j?"#ef4444":"#10b981"}},A),r.createElement("div",{style:{...i.sectionTitle,marginTop:28}}," "),r.createElement("button",{style:{...i.btn,...i.btnSave},onClick:()=>{t({...n,runtime:u,pruneSchedule:f,maxConcurrentJobs:n.maxConcurrentJobs||2,updateCheckInterval:y,backgroundUpdateChecks:h,containerOverrides:k}),B("Saved! Plugin will restart."),U(!1)}},"Save Configuration"))}}}]);
|
|
1
|
+
"use strict";(self.webpackChunksignalk_container=self.webpackChunksignalk_container||[]).push([[805],{805(e,t,n){n.r(t),n.d(t,{default:()=>m});var r=n(231);const a={root:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',color:"#333",padding:"16px 0"},sectionTitle:{fontSize:13,fontWeight:600,color:"#888",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:10,marginTop:24},btn:{display:"inline-flex",alignItems:"center",gap:8,padding:"8px 16px",border:"none",borderRadius:6,fontSize:13,fontWeight:600,cursor:"pointer"},btnPrimary:{background:"#3b82f6",color:"#fff"},btnDanger:{background:"#ef4444",color:"#fff",padding:"6px 12px",fontSize:12},btnWarning:{background:"#f59e0b",color:"#fff",padding:"6px 12px",fontSize:12},btnSave:{background:"#3b82f6",color:"#fff"},btnSuccess:{background:"#10b981",color:"#fff"},btnDisabled:{opacity:.5,cursor:"not-allowed"},status:{marginTop:8,fontSize:12,minHeight:18},runtimeCard:{display:"flex",alignItems:"center",gap:14,padding:"14px 18px",background:"#f8f9fa",border:"1px solid #e0e0e0",borderRadius:10,marginBottom:12},runtimeIcon:{width:44,height:44,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",fontSize:22,flexShrink:0},runtimeInfo:{flex:1},runtimeName:{fontSize:15,fontWeight:600,color:"#333"},runtimeVersion:{fontSize:12,color:"#888"},containerItem:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",background:"#f8f9fa",border:"1px solid #e0e0e0",borderRadius:10,marginBottom:8},stateIndicator:{width:10,height:10,borderRadius:"50%",flexShrink:0},containerInfo:{flex:1,minWidth:0},containerName:{fontSize:14,fontWeight:600,color:"#333"},containerMeta:{fontSize:11,color:"#888",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},containerActions:{display:"flex",gap:6,flexShrink:0},containerCard:{background:"#f8f9fa",border:"1px solid #e0e0e0",borderRadius:10,marginBottom:8,overflow:"hidden"},containerItemFlat:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px"},limitsRow:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px 10px 34px",fontSize:11,color:"#666",flexWrap:"wrap"},updatesRow:{display:"flex",alignItems:"center",gap:10,padding:"0 14px 10px 34px",fontSize:11,color:"#666",flexWrap:"wrap"},limitBadge:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:12,background:"#e5e7eb",color:"#374151",fontSize:11,fontWeight:500},overrideBadge:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:12,background:"#fef3c7",color:"#92400e",fontSize:10,fontWeight:600},editLimitsBtn:{marginLeft:"auto",padding:"3px 10px",fontSize:11,background:"#fff",color:"#3b82f6",border:"1px solid #3b82f6",borderRadius:6,cursor:"pointer",fontWeight:500},limitsEditor:{borderTop:"1px solid #e0e0e0",padding:"14px 14px 14px 34px",background:"#fff"},limitsEditorGrid:{display:"grid",gridTemplateColumns:"160px 1fr auto",gap:"8px 12px",alignItems:"center",marginBottom:10},limitsEditorLabel:{fontSize:12,fontWeight:500,color:"#555"},limitsEditorInput:{padding:"5px 8px",borderRadius:5,border:"1px solid #ccc",fontSize:12,background:"#fff",color:"#333",fontFamily:"inherit",width:"100%",boxSizing:"border-box"},limitsEditorInputDisabled:{background:"#f3f4f6",color:"#9ca3af",fontStyle:"italic"},limitsEditorUnsetBtn:{width:24,height:24,borderRadius:4,border:"1px solid #d1d5db",background:"#fff",color:"#6b7280",fontSize:14,lineHeight:1,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},limitsEditorUnsetBtnActive:{background:"#fee2e2",color:"#991b1b",border:"1px solid #fca5a5"},limitsEditorAdvancedToggle:{fontSize:11,color:"#3b82f6",cursor:"pointer",userSelect:"none",marginTop:6,marginBottom:10,display:"inline-block"},limitsEditorActions:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:10},limitsEditorResult:{marginTop:10,padding:"8px 10px",borderRadius:6,fontSize:11,lineHeight:1.5},limitsEditorResultLive:{background:"#d1fae5",color:"#065f46"},limitsEditorResultRecreated:{background:"#fef3c7",color:"#92400e"},limitsEditorResultError:{background:"#fee2e2",color:"#991b1b"},limitsEditorWarning:{marginTop:4,fontSize:10,opacity:.85,fontStyle:"italic"},empty:{textAlign:"center",padding:"30px 16px",color:"#999",fontSize:13},fieldRow:{display:"flex",alignItems:"center",gap:12,marginBottom:10},label:{fontSize:13,fontWeight:500,color:"#555",width:160,flexShrink:0},select:{padding:"6px 10px",borderRadius:6,border:"1px solid #ccc",fontSize:13,background:"#fff",color:"#333"},hint:{fontSize:11,color:"#aaa",marginLeft:8},pruneResult:{fontSize:12,color:"#10b981",marginTop:6}},i={running:"#10b981",stopped:"#f59e0b",missing:"#94a3b8","no-runtime":"#ef4444"},o={running:"Running",stopped:"Stopped",missing:"Not created","no-runtime":"No runtime"};function l({label:e,value:t,options:n,onChange:i,hint:o}){return r.createElement("div",{style:a.fieldRow},r.createElement("span",{style:a.label},e),r.createElement("select",{style:a.select,value:t,onChange:e=>i(e.target.value)},n.map(e=>r.createElement("option",{key:e.value,value:e.value},e.label))),o&&r.createElement("span",{style:a.hint},o))}function s({label:e,value:t,onChange:n,hint:i}){return r.createElement("div",{style:a.fieldRow},r.createElement("span",{style:a.label},e),r.createElement("label",{style:{display:"inline-flex",alignItems:"center",cursor:"pointer",gap:8}},r.createElement("input",{type:"checkbox",checked:t,onChange:e=>n(e.target.checked),style:{width:16,height:16,cursor:"pointer"}}),r.createElement("span",{style:{fontSize:13,color:"#555"}},t?"Enabled":"Disabled")),i&&r.createElement("span",{style:a.hint},i))}function c(e){return e&&e.startsWith("sk-")?e.slice(3):e}const d=[{key:"cpus",label:"CPU (cores)",type:"number",step:"0.1",min:"0.1",placeholder:"e.g. 1.5",primary:!0},{key:"memory",label:"Memory",type:"text",placeholder:"e.g. 512m, 2g",primary:!0},{key:"memorySwap",label:"Memory + swap",type:"text",placeholder:"= memory to disable swap",primary:!0},{key:"pidsLimit",label:"Max processes",type:"number",step:"1",min:"1",placeholder:"e.g. 200",primary:!0},{key:"cpuShares",label:"CPU shares (weight)",type:"number",step:"1",min:"2",placeholder:"default 1024",primary:!1},{key:"cpusetCpus",label:"Pin to CPUs",type:"text",placeholder:'e.g. "0,1" or "1-3"',primary:!1},{key:"memoryReservation",label:"Memory reservation",type:"text",placeholder:"soft floor, e.g. 256m",primary:!1},{key:"oomScoreAdj",label:"OOM score adjust",type:"number",step:"1",min:"-1000",max:"1000",placeholder:"-1000 to 1000",primary:!1}];function u({containerName:e,effective:t,initialOverride:n,onApply:i,onResetToDefault:o,onClose:l}){const s=e=>{const n=e??t,r={};for(const e of d)n&&void 0!==n[e.key]&&null!==n[e.key]?r[e.key]=String(n[e.key]):r[e.key]="";return r},[c,u]=(0,r.useState)(()=>s(t)),[m,p]=(0,r.useState)(()=>!!n&&d.some(e=>!e.primary&&void 0!==n[e.key])),[f,g]=(0,r.useState)(!1),[b,y]=(0,r.useState)(!1),[h,k]=(0,r.useState)(null),v=t=>{const n=c[t.key],i=null===n;return r.createElement(r.Fragment,{key:t.key},r.createElement("label",{style:a.limitsEditorLabel,htmlFor:`lim-${e}-${t.key}`},t.label),r.createElement("input",{id:`lim-${e}-${t.key}`,type:i?"text":t.type,value:i?"":n,step:t.step,min:t.min,max:t.max,placeholder:i?"(unset — remove limit)":t.placeholder,disabled:i,onChange:e=>{return n=t.key,r=e.target.value,void u(e=>({...e,[n]:r}));var n,r},style:{...a.limitsEditorInput,...i?a.limitsEditorInputDisabled:{}}}),r.createElement("button",{type:"button",onClick:()=>{return e=t.key,void u(t=>({...t,[e]:null===t[e]?"":null}));var e},title:i?"Click to set a value again":"Click to explicitly unset (remove this limit)",style:{...a.limitsEditorUnsetBtn,...i?a.limitsEditorUnsetBtnActive:{}}},i?"↺":"×"))},E=d.filter(e=>e.primary),x=d.filter(e=>!e.primary);return r.createElement("div",{style:a.limitsEditor},r.createElement("div",{style:a.limitsEditorGrid},E.map(v)),r.createElement("span",{onClick:()=>p(!m),style:a.limitsEditorAdvancedToggle},m?"▾":"▸"," Advanced (",x.length," more fields)"),m&&r.createElement("div",{style:a.limitsEditorGrid},x.map(v)),r.createElement("div",{style:a.limitsEditorActions},r.createElement("button",{type:"button",onClick:l,disabled:f||b,style:{...a.btn,padding:"6px 12px",fontSize:12,background:"#fff",color:"#6b7280",border:"1px solid #d1d5db",...f||b?a.btnDisabled:{}}},"Close"),r.createElement("button",{type:"button",onClick:async()=>{if(window.confirm(`Reset ${e} to the plugin's default resource limits? This will remove your override and may cause a brief container recreate (~5s of downtime) if memory limits need to be unset.`)){y(!0),k(null);try{const e=await o();k(e),e&&e.effective&&u(s(e.effective))}catch(e){k({error:e.message||String(e)})}y(!1)}},disabled:f||b,title:"Clear override and restore plugin-default limits",style:{...a.btn,padding:"6px 12px",fontSize:12,background:"#fff",color:"#d97706",border:"1px solid #f59e0b",...f||b?a.btnDisabled:{}}},b?"Resetting...":"Reset to default"),r.createElement("button",{type:"button",onClick:()=>{u(s(t)),k(null)},disabled:f||b,title:"Discard unsaved changes in this form (does not touch the server)",style:{...a.btn,padding:"6px 12px",fontSize:12,background:"#fff",color:"#6b7280",border:"1px solid #d1d5db",...f||b?a.btnDisabled:{}}},"Revert"),r.createElement("button",{type:"button",onClick:async()=>{g(!0),k(null);try{const e=function(e){const t={};for(const n of d){const r=e[n.key];if(null!==r){if(void 0!==r&&""!==r)if("number"===n.type){const e=Number(r);if(!Number.isFinite(e))continue;t[n.key]=e}else t[n.key]=r}else t[n.key]=null}return t}(c),t=await i(e);k(t),t&&t.effective&&u(s(t.effective))}catch(e){k({error:e.message||String(e)})}g(!1)},disabled:f||b,style:{...a.btn,...a.btnPrimary,padding:"6px 14px",fontSize:12,...f||b?a.btnDisabled:{}}},f?"Applying...":"Apply")),h&&r.createElement("div",{style:{...a.limitsEditorResult,...h.error?a.limitsEditorResultError:"recreated"===h.method?a.limitsEditorResultRecreated:a.limitsEditorResultLive}},h.error?r.createElement(r.Fragment,null,r.createElement("strong",null,"Error:")," ",h.error):r.createElement(r.Fragment,null,r.createElement("strong",null,"live"===h.method?"Applied live (no restart)":"Container recreated"),h.warnings&&h.warnings.length>0&&r.createElement("div",{style:a.limitsEditorWarning},h.warnings.map((e,t)=>r.createElement("div",{key:t},"⚠ ",e))))))}function m({configuration:e,save:t}){const n=e||{},[m,p]=(0,r.useState)(n.runtime||"auto"),[f,g]=(0,r.useState)(n.pruneSchedule||"weekly"),[b,y]=(0,r.useState)(n.updateCheckInterval||"24h"),[h,k]=(0,r.useState)(!1!==n.backgroundUpdateChecks),[v,E]=(0,r.useState)(n.containerOverrides||{}),[x,S]=(0,r.useState)(null),[w,C]=(0,r.useState)([]),[$,R]=(0,r.useState)({}),[I,T]=(0,r.useState)({}),[z,P]=(0,r.useState)({}),[j,A]=(0,r.useState)({}),[D,U]=(0,r.useState)(new Set),[O,B]=(0,r.useState)(new Set),[N,W]=(0,r.useState)(!0),[L,M]=(0,r.useState)(""),[F,V]=(0,r.useState)(!1),[H,G]=(0,r.useState)(null),J=(0,r.useCallback)(async()=>{try{const[e,t]=await Promise.all([fetch("/plugins/signalk-container/api/runtime"),fetch("/plugins/signalk-container/api/containers")]);e.ok?S(await e.json()):S(null);let n=[];if(t.ok?(n=await t.json(),C(n)):C([]),n.length>0){const e={},t={};await Promise.all(n.map(async n=>{const r=c(n.name);try{const n=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(r)}/resources`);if(n.ok){const a=await n.json();e[r]=a.effective||{},t[r]=a.override??null}}catch{}})),R(e),T(t)}try{const e=await fetch("/plugins/signalk-container/api/updates");if(e.ok){const t=await e.json();if(Array.isArray(t)){const e={},n={};for(const r of t)r&&r.containerName&&(n[r.containerName]=r,r.pluginId&&(e[r.containerName]=r.pluginId));P(e=>{const t={...n};for(const r of Object.keys(n)){const a=n[r],i=e[r];"unknown"===a.reason&&i&&i.reason&&"unknown"!==i.reason&&(t[r]=i)}return t}),A(e)}}}catch{}}catch{S(null),C([])}W(!1)},[]);(0,r.useEffect)(()=>{J();const e=setInterval(J,5e3);return()=>clearInterval(e)},[J]);const _=e=>{const t=c(e);B(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})};return r.createElement("div",{style:a.root},r.createElement("div",{style:a.sectionTitle},"Runtime"),N?r.createElement("div",{style:a.empty},"Detecting container runtime..."):x?r.createElement("div",{style:a.runtimeCard},r.createElement("div",{style:{...a.runtimeIcon,background:"podman"===x.runtime?"#892ca0":"#2496ed",color:"#fff"}},"podman"===x.runtime?"P":"D"),r.createElement("div",{style:a.runtimeInfo},r.createElement("div",{style:a.runtimeName},x.runtime.charAt(0).toUpperCase()+x.runtime.slice(1),x.isPodmanDockerShim?" (via docker shim)":""),r.createElement("div",{style:a.runtimeVersion},"Version ",x.version)),r.createElement("div",{style:{...a.stateIndicator,background:"#10b981"},title:"Runtime available"})):r.createElement("div",{style:a.runtimeCard},r.createElement("div",{style:{...a.runtimeIcon,background:"#fef2f2",color:"#ef4444"}},"!"),r.createElement("div",{style:a.runtimeInfo},r.createElement("div",{style:a.runtimeName},"No container runtime found"),r.createElement("div",{style:a.runtimeVersion},"Install Podman: sudo apt install podman"))),r.createElement("div",{style:a.sectionTitle},"Settings"),r.createElement(l,{label:"Preferred runtime",value:m,onChange:p,options:[{value:"auto",label:"Auto-detect (Podman preferred)"},{value:"podman",label:"Podman"},{value:"docker",label:"Docker"}]}),r.createElement(l,{label:"Auto-prune images",value:f,onChange:g,options:[{value:"off",label:"Off"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"}]}),r.createElement(l,{label:"Update check interval",value:b,onChange:y,options:[{value:"1h",label:"Every hour"},{value:"6h",label:"Every 6 hours"},{value:"12h",label:"Every 12 hours"},{value:"24h",label:"Daily (recommended)"},{value:"48h",label:"Every 2 days"},{value:"168h",label:"Weekly"}],hint:"How often to check for new container images"}),r.createElement(s,{label:"Background update checks",value:h,onChange:k,hint:"Disable on metered connections; manual check still works"}),r.createElement("div",{style:a.sectionTitle},"Managed Containers"),0===w.length?r.createElement("div",{style:a.empty},N?"Loading...":"No managed containers. Other plugins will create them."):w.map(e=>{const t=c(e.name),n=$[t]||{},l=I[t],s=l&&Object.keys(l).length>0,m=O.has(t),p=d.map(e=>function(e,t){if(null==t||""===t)return null;switch(e){case"cpus":return`${t} CPU`;case"memory":return`${t}`;case"memorySwap":return`swap: ${t}`;case"memoryReservation":return`reserve: ${t}`;case"pidsLimit":return`${t} PIDs`;case"cpuShares":return`shares: ${t}`;case"cpusetCpus":return`cpus: ${t}`;case"oomScoreAdj":return`oom: ${t}`;default:return`${e}: ${t}`}}(e.key,n[e.key])).filter(Boolean),f=z[t],g=function(e){if(!e||!e.reason)return null;const{reason:t,runningTag:n,currentVersion:r,latestVersion:a,fromCache:i}=e;return"newer-version"===t?{label:`↑ ${a||"update"} available`,bg:"#fef3c7",fg:"#92400e",title:`Update available: ${r} → ${a}`}:"digest-drift"===t?{label:"↻ rebuild available",bg:"#fef3c7",fg:"#92400e",title:`Image rebuild available for :${n}${a?` (latest stable ${a})`:""}`}:"offline"===t?{label:i?"📡 offline (cached)":"📡 offline",bg:"#e5e7eb",fg:"#4b5563",title:i?"Network unreachable; showing last cached check result":"Network unreachable; no cached result yet"}:"error"===t?{label:"⚠ check error",bg:"#fee2e2",fg:"#991b1b",title:e.error||"Update check error"}:"up-to-date"===t?{label:"✅ up to date",bg:"#dcfce7",fg:"#166534",title:"Up to date"+(r?" ("+r+")":"")}:null}(f),b=!!j[t],y=D.has(t);return r.createElement("div",{key:e.name,style:a.containerCard},r.createElement("div",{style:a.containerItemFlat},r.createElement("div",{style:{...a.stateIndicator,background:i[e.state]||"#94a3b8"},title:o[e.state]||e.state}),r.createElement("div",{style:a.containerInfo},r.createElement("div",{style:a.containerName},e.name),r.createElement("div",{style:a.containerMeta},e.image," · ",o[e.state]||e.state,e.ports&&e.ports.length>0&&e.ports[0]?` · ${e.ports.join(", ")}`:"")),r.createElement("div",{style:a.containerActions},"stopped"===e.state&&r.createElement("button",{style:{...a.btn,...a.btnPrimary,padding:"6px 12px",fontSize:12},onClick:()=>(async e=>{M(`Starting ${e}...`),V(!1);try{const t=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(e)}/start`,{method:"POST"});if(t.ok)M(`${e} started.`),J();else{const e=await t.json().catch(()=>({error:t.statusText}));M(`Failed: ${e.error}`),V(!0)}}catch(e){M(`Error: ${e.message}`),V(!0)}})(e.name)},"Start"),"running"===e.state&&r.createElement("button",{style:{...a.btn,...a.btnWarning},onClick:()=>(async e=>{M(`Stopping ${e}...`),V(!1);try{const t=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(e)}/stop`,{method:"POST"});if(t.ok)M(`${e} stopped.`),J();else{const e=await t.json().catch(()=>({error:t.statusText}));M(`Failed: ${e.error}`),V(!0)}}catch(e){M(`Error: ${e.message}`),V(!0)}})(e.name)},"Stop"),r.createElement("button",{style:{...a.btn,...a.btnDanger},onClick:()=>(async(e,t)=>{if("running"!==t||window.confirm(`${e} is running. Stop and remove it?`)){M(`Removing ${e}...`),V(!1);try{const t=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(e)}/remove`,{method:"POST"});if(t.ok)M(`${e} removed.`),J();else{const e=await t.json().catch(()=>({error:t.statusText}));M(`Failed: ${e.error}`),V(!0)}}catch(e){M(`Error: ${e.message}`),V(!0)}}})(e.name,e.state)},"Remove"))),r.createElement("div",{style:a.limitsRow},0===p.length?r.createElement("span",{style:{color:"#9ca3af",fontStyle:"italic"}},"No resource limits set"):p.map((e,t)=>r.createElement("span",{key:t,style:a.limitBadge},e)),s&&r.createElement("span",{style:a.overrideBadge,title:"You have a user override configured for this container"},"Override active"),"running"===e.state&&r.createElement("button",{type:"button",style:a.editLimitsBtn,onClick:()=>_(e.name)},m?"Collapse ▾":"Edit Limits ▸")),b&&"running"===e.state&&r.createElement("div",{style:a.updatesRow},g?r.createElement("span",{style:{...a.limitBadge,background:g.bg,color:g.fg},title:g.title},g.label):r.createElement("span",{style:{color:"#9ca3af",fontStyle:"italic"}},"No update check yet"),f?.lastSuccessfulCheckAt&&r.createElement("span",{style:{fontSize:10,color:"#9ca3af"},title:`Last successful check: ${f.lastSuccessfulCheckAt}`},"checked"," ",function(e){try{const t=new Date(e).getTime(),n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<5)return"just now";if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}catch{return e}}(f.lastSuccessfulCheckAt)),r.createElement("button",{type:"button",onClick:()=>(async e=>{const t=j[e];if(!t)return M(`${e}: no update service registered. The consumer plugin hasn't migrated to signalk-container's update detection yet.`),void V(!0);U(t=>{const n=new Set(t);return n.add(e),n}),M(`Checking ${e} for updates...`),V(!1);try{const n=await fetch(`/plugins/signalk-container/api/updates/${encodeURIComponent(t)}/check`,{method:"POST"});if(n.ok){const t=await n.json();P(n=>({...n,[e]:t})),M(function(e){if(!e)return"No update data";const{runningTag:t,currentVersion:n,latestVersion:r,updateAvailable:a,reason:i,fromCache:o}=e;return"offline"===i?o?"📡 Offline — last cached result shows "+(a?"update available":"up to date"):"📡 Offline — no cached result yet":"newer-version"===i?`↑ Update available: ${n} → ${r}`:"digest-drift"===i?`↻ Rebuild available for :${t}${r?` (latest stable: ${r})`:""}`:"up-to-date"===i?"✅ Up to date"+(n?" ("+n+")":""):"older-than-pinned"===i?`ℹ Pinned to ${n}, latest stable is ${r}`:"error"===i?`⚠ Check error: ${e.error||"unknown"}`:`State: ${i||"unknown"}`}(t)),V(!1)}else{const e=await n.json().catch(()=>({error:n.statusText}));M(`Check failed: ${e.error}`),V(!0)}}catch(e){M(`Check error: ${e.message}`),V(!0)}U(t=>{const n=new Set(t);return n.delete(e),n})})(t),disabled:y,title:"Force a fresh update check now",style:{...a.editLimitsBtn,marginLeft:"auto",...y?a.btnDisabled:{}}},y?"Checking...":"Check now ↻")),m&&r.createElement(u,{containerName:t,effective:n,initialOverride:l,onApply:e=>(async(e,t)=>{const n=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(e)}/resources`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await n.json().catch(()=>({}));return n.ok?(r.effective&&R(t=>({...t,[e]:r.effective})),T(t=>({...t,[e]:r.override??null})),E(t=>{const n={...t};return r.override&&Object.keys(r.override).length>0?n[e]=r.override:delete n[e],n}),{method:r.method,warnings:r.warnings,effective:r.effective}):{error:r.error||`${n.status} ${n.statusText}`}})(t,e),onResetToDefault:()=>(async e=>{const t=await fetch(`/plugins/signalk-container/api/containers/${encodeURIComponent(e)}/resources`,{method:"DELETE"}),n=await t.json().catch(()=>({}));return t.ok?(n.effective&&R(t=>({...t,[e]:n.effective})),T(t=>({...t,[e]:null})),E(t=>{const n={...t};return delete n[e],n}),{method:n.method,warnings:n.warnings,effective:n.effective}):{error:n.error||`${t.status} ${t.statusText}`}})(t),onClose:()=>_(e.name)}))}),r.createElement("div",{style:a.sectionTitle},"Maintenance"),r.createElement("button",{style:{...a.btn,...a.btnSuccess},onClick:async()=>{M("Pruning dangling images..."),V(!1),G(null);try{const e=await fetch("/plugins/signalk-container/api/prune",{method:"POST"});if(e.ok){const t=await e.json().catch(()=>({error:e.statusText}));G(t),M(`Pruned ${t.imagesRemoved} image(s), reclaimed ${t.spaceReclaimed}.`)}else{const t=await e.json().catch(()=>({error:e.statusText}));M(`Prune failed: ${t.error}`),V(!0)}}catch(e){M(`Error: ${e.message}`),V(!0)}}},"Prune Dangling Images"),L&&r.createElement("div",{style:{...a.status,color:F?"#ef4444":"#10b981"}},L),r.createElement("div",{style:{...a.sectionTitle,marginTop:28}}," "),r.createElement("button",{style:{...a.btn,...a.btnSave},onClick:()=>{const e={};for(const[t,n]of Object.entries(I))n&&Object.keys(n).length>0&&(e[t]=n);t({...n,runtime:m,pruneSchedule:f,maxConcurrentJobs:n.maxConcurrentJobs||2,updateCheckInterval:b,backgroundUpdateChecks:h,containerOverrides:e}),M("Saved! Plugin will restart."),V(!1)}},"Save Configuration"))}}}]);
|
package/public/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e,r,t={316(){}},n={};function a(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,a),o.exports}a.m=t,a.c=n,a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((r,t)=>(a.f[t](e,r),r),[])),a.u=e=>e+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="signalk-container:",a.l=(t,n,o,i)=>{if(e[t])e[t].push(n);else{var l,c;if(void 0!==o)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var p=s[u];if(p.getAttribute("src")==t||p.getAttribute("data-webpack")==r+o){l=p;break}}l||(c=!0,(l=document.createElement("script")).charset="utf-8",a.nc&&l.setAttribute("nonce",a.nc),l.setAttribute("data-webpack",r+o),l.src=t),e[t]=[n];var d=(r,n)=>{l.onerror=l.onload=null,clearTimeout(f);var a=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach(e=>e(n)),r)return r(n)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),c&&document.head.appendChild(l)}},(()=>{a.S={};var e={},r={};a.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];a.o(a.S,t)||(a.S[t]={});var i=a.S[t],l="signalk-container",c=[];return"default"===t&&((e,r,t,n)=>{var o=i[e]=i[e]||{},c=o[r];(!c||!c.loaded&&(1!=!c.eager?n:l>c.from))&&(o[r]={get:()=>a.e(540).then(()=>()=>a(540)),from:l,eager:!1})})("react","19.2.
|
|
1
|
+
(()=>{var e,r,t={316(){}},n={};function a(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,a),o.exports}a.m=t,a.c=n,a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((r,t)=>(a.f[t](e,r),r),[])),a.u=e=>e+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="signalk-container:",a.l=(t,n,o,i)=>{if(e[t])e[t].push(n);else{var l,c;if(void 0!==o)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var p=s[u];if(p.getAttribute("src")==t||p.getAttribute("data-webpack")==r+o){l=p;break}}l||(c=!0,(l=document.createElement("script")).charset="utf-8",a.nc&&l.setAttribute("nonce",a.nc),l.setAttribute("data-webpack",r+o),l.src=t),e[t]=[n];var d=(r,n)=>{l.onerror=l.onload=null,clearTimeout(f);var a=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach(e=>e(n)),r)return r(n)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),c&&document.head.appendChild(l)}},(()=>{a.S={};var e={},r={};a.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];a.o(a.S,t)||(a.S[t]={});var i=a.S[t],l="signalk-container",c=[];return"default"===t&&((e,r,t,n)=>{var o=i[e]=i[e]||{},c=o[r];(!c||!c.loaded&&(1!=!c.eager?n:l>c.from))&&(o[r]={get:()=>a.e(540).then(()=>()=>a(540)),from:l,eager:!1})})("react","19.2.5"),e[t]=c.length?Promise.all(c).then(()=>e[t]=1):1}}})(),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var r=a.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={792:0};a.f.j=(r,t)=>{var n=a.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((t,a)=>n=e[r]=[t,a]);t.push(n[2]=o);var i=a.p+a.u(r),l=new Error;a.l(i,t=>{if(a.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;l.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,n[1](l)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[i,l,c]=t,s=0;if(i.some(r=>0!==e[r])){for(n in l)a.o(l,n)&&(a.m[n]=l[n]);c&&c(a)}for(r&&r(t);s<i.length;s++)o=i[s],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunksignalk_container=self.webpackChunksignalk_container||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),a(316)})();
|
package/public/remoteEntry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var signalk_container;(()=>{"use strict";var e,r,t,n,o,a,i,u,l,s,f,c,p,d,h,v,g,m,b,y={623(e,r,t){var n={"./PluginConfigurationPanel":()=>t.e(805).then(()=>()=>t(805))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then(()=>{throw new Error('Module "'+e+'" does not exist in container.')}),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},w={};function S(e){var r=w[e];if(void 0!==r)return r.exports;var t=w[e]={exports:{}};return y[e](t,t.exports,S),t.exports}S.m=y,S.c=w,S.d=(e,r)=>{for(var t in r)S.o(r,t)&&!S.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},S.f={},S.e=e=>Promise.all(Object.keys(S.f).reduce((r,t)=>(S.f[t](e,r),r),[])),S.u=e=>e+".js",S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="signalk-container:",S.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var i,u;if(void 0!==o)for(var l=document.getElementsByTagName("script"),s=0;s<l.length;s++){var f=l[s];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+o){i=f;break}}i||(u=!0,(i=document.createElement("script")).charset="utf-8",S.nc&&i.setAttribute("nonce",S.nc),i.setAttribute("data-webpack",r+o),i.src=t),e[t]=[n];var c=(r,n)=>{i.onerror=i.onload=null,clearTimeout(p);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(n)),r)return r(n)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=c.bind(null,i.onerror),i.onload=c.bind(null,i.onload),u&&document.head.appendChild(i)}},S.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{S.S={};var e={},r={};S.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];S.o(S.S,t)||(S.S[t]={});var a=S.S[t],i="signalk-container",u=[];return"default"===t&&((e,r,t,n)=>{var o=a[e]=a[e]||{},u=o[r];(!u||!u.loaded&&(1!=!u.eager?n:i>u.from))&&(o[r]={get:()=>S.e(540).then(()=>()=>S(540)),from:i,eager:!1})})("react","19.2.
|
|
1
|
+
var signalk_container;(()=>{"use strict";var e,r,t,n,o,a,i,u,l,s,f,c,p,d,h,v,g,m,b,y={623(e,r,t){var n={"./PluginConfigurationPanel":()=>t.e(805).then(()=>()=>t(805))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then(()=>{throw new Error('Module "'+e+'" does not exist in container.')}),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},w={};function S(e){var r=w[e];if(void 0!==r)return r.exports;var t=w[e]={exports:{}};return y[e](t,t.exports,S),t.exports}S.m=y,S.c=w,S.d=(e,r)=>{for(var t in r)S.o(r,t)&&!S.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},S.f={},S.e=e=>Promise.all(Object.keys(S.f).reduce((r,t)=>(S.f[t](e,r),r),[])),S.u=e=>e+".js",S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="signalk-container:",S.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var i,u;if(void 0!==o)for(var l=document.getElementsByTagName("script"),s=0;s<l.length;s++){var f=l[s];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+o){i=f;break}}i||(u=!0,(i=document.createElement("script")).charset="utf-8",S.nc&&i.setAttribute("nonce",S.nc),i.setAttribute("data-webpack",r+o),i.src=t),e[t]=[n];var c=(r,n)=>{i.onerror=i.onload=null,clearTimeout(p);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(n)),r)return r(n)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=c.bind(null,i.onerror),i.onload=c.bind(null,i.onload),u&&document.head.appendChild(i)}},S.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{S.S={};var e={},r={};S.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];S.o(S.S,t)||(S.S[t]={});var a=S.S[t],i="signalk-container",u=[];return"default"===t&&((e,r,t,n)=>{var o=a[e]=a[e]||{},u=o[r];(!u||!u.loaded&&(1!=!u.eager?n:i>u.from))&&(o[r]={get:()=>S.e(540).then(()=>()=>S(540)),from:i,eager:!1})})("react","19.2.5"),e[t]=u.length?Promise.all(u).then(()=>e[t]=1):1}}})(),(()=>{var e;S.g.importScripts&&(e=S.g.location+"");var r=S.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),S.p=e})(),t=e=>{var r=e=>e.split(".").map(e=>+e==e?+e:e),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n<r.length&&"u"!=(typeof r[n])[0];var o=e[n],a=(typeof o)[0];if(n>=r.length)return"u"==a;var i=r[n],u=(typeof i)[0];if(a!=u)return"o"==a&&"n"==u||"s"==u||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;n++}},o=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,a=1;a<e.length;a++)n--,t+="u"==(typeof(u=e[a]))[0]?"-":(n>0?".":"")+(n=2,u);return t}var i=[];for(a=1;a<e.length;a++){var u=e[a];i.push(0===u?"not("+l()+")":1===u?"("+l()+" || "+l()+")":2===u?i.pop()+" "+i.pop():o(u))}return l();function l(){return i.pop().replace(/^\((.+)\)$/,"$1")}},a=(e,r)=>{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var i=0,u=1,l=!0;;u++,i++){var s,f,c=u<e.length?(typeof e[u])[0]:"";if(i>=r.length||"o"==(f=(typeof(s=r[i]))[0]))return!l||("u"==c?u>n&&!o:""==c!=o);if("u"==f){if(!l||"u"!=c)return!1}else if(l)if(c==f)if(u<=n){if(s!=e[u])return!1}else{if(o?s>e[u]:s<e[u])return!1;s!=e[u]&&(l=!1)}else if("s"!=c&&"n"!=c){if(o||u<=n)return!1;l=!1,u--}else{if(u<=n||f<c!=o)return!1;l=!1}else"s"!=c&&"n"!=c&&(l=!1,u--)}}var p=[],d=p.pop.bind(p);for(i=1;i<e.length;i++){var h=e[i];p.push(1==h?d()|d():2==h?d()&d():h?a(h,r):!d())}return!!d()},i=(e,r)=>e&&S.o(e,r),u=e=>(e.loaded=1,e.get()),l=e=>Object.keys(e).reduce((r,t)=>(e[t].eager&&(r[t]=e[t]),r),{}),s=(e,r,t)=>{var o=t?l(e[r]):e[r];return Object.keys(o).reduce((e,r)=>!e||!o[e].loaded&&n(e,r)?r:e,0)},f=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+o(n)+")",c=e=>{throw new Error(e)},p=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},d=(e,r,t)=>t?t():((e,r)=>c("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),h=(e=>function(r,t,n,o,a){var i=S.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,S.S[r],t,!1,o,a)):e(r,S.S[r],t,n,o,a)})((e,r,t,n,o,l)=>{if(!i(r,t))return d(e,t,l);var c=s(r,t,n);return a(o,c)||p(f(r,t,c,o)),u(r[t][c])}),v={},g={231:()=>h("default","react",!1,[1,19],()=>S.e(540).then(()=>()=>S(540)))},m={805:[231]},b={},S.f.consumes=(e,r)=>{S.o(m,e)&&m[e].forEach(e=>{if(S.o(v,e))return r.push(v[e]);if(!b[e]){var t=r=>{v[e]=0,S.m[e]=t=>{delete S.c[e],t.exports=r()}};b[e]=!0;var n=r=>{delete v[e],S.m[e]=t=>{throw delete S.c[e],r}};try{var o=g[e]();o.then?r.push(v[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}})},(()=>{var e={362:0};S.f.j=(r,t)=>{var n=S.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((t,o)=>n=e[r]=[t,o]);t.push(n[2]=o);var a=S.p+S.u(r),i=new Error;S.l(a,t=>{if(S.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,u]=t,l=0;if(a.some(r=>0!==e[r])){for(n in i)S.o(i,n)&&(S.m[n]=i[n]);u&&u(S)}for(r&&r(t);l<a.length;l++)o=a[l],S.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunksignalk_container=self.webpackChunksignalk_container||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var k=S(623);signalk_container=k})();
|