{"app":{"id":17,"summary":"Kubernetes Manager Example","versions":[62],"created_by":"trevor sullivan188","created_at":"2023-07-20T12:14:33.577Z","votes":0,"approved":false,"apps":["k8s","kubernetes","cncf","linux","cluster"],"app_type":"openapp","external_embed_url":null,"value":{"id":17,"path":"u/trevor/stylish_app","value":{"css":{},"grid":[{"3":{"h":8,"w":2,"x":0,"y":0,"fixed":false},"12":{"h":11,"w":12,"x":0,"y":0,"id":"a","fixed":false},"id":"a","data":{"id":"a","tabs":["Namespaces","Pods"],"type":"tabscomponent","customCss":{},"disabledTabs":[{"type":"static","value":false,"fieldType":"boolean"},{"type":"static","value":false,"fieldType":"boolean"}],"configuration":{"tabsKind":{"type":"static","value":"tabs"}},"numberOfSubgrids":2}}],"subgrids":{"a-0":[{"3":{"h":10,"w":3,"x":0,"y":1,"fixed":false},"12":{"h":10,"w":8,"x":0,"y":0,"id":"b","fixed":false},"id":"tblNamespaces","data":{"id":"tblNamespaces","type":"tablecomponent","customCss":{},"actionButtons":[{"id":"tblNamespaces_a","type":"buttoncomponent","customCss":{},"recomputeIds":[],"configuration":{"size":{"type":"static","value":"xs"},"color":{"type":"static","value":"blue"},"label":{"type":"static","value":"Set Active Namespace"},"onError":{"type":"oneOf","selected":"errorOverlay","configuration":{"setTab":{"setTab":{"type":"static","value":[]}},"gotoUrl":{"url":{"type":"static","value":""},"newTab":{"type":"static","value":true}},"openModal":{"modalId":{"type":"static","value":""}},"closeModal":{"modalId":{"type":"static","value":""}},"errorOverlay":{},"sendErrorToast":{"message":{"type":"static","value":""},"appendError":{"type":"static","value":true}}}},"disabled":{"type":"static","value":false},"afterIcon":{"type":"static","value":""},"onSuccess":{"type":"oneOf","selected":"none","configuration":{"none":{},"setTab":{"setTab":{"type":"static","value":[]}},"gotoUrl":{"url":{"type":"static","value":""},"newTab":{"type":"static","value":true}},"openModal":{"modalId":{"type":"static","value":""}},"sendToast":{"message":{"type":"static","value":""}},"closeModal":{"modalId":{"type":"static","value":""}}}},"beforeIcon":{"type":"static","value":""},"fillContainer":{"type":"static","value":false},"triggerOnAppLoad":{"type":"static","value":false}},"componentInput":{"type":"runnable","fields":{},"runnable":{"name":"Inline Script 1","type":"runnableByName","inlineScript":{"path":"u/trevor/stylish_app/Inline Script 1","content":"state.active_namespace = tblNamespaces.selectedRow.name;","language":"frontend"}},"fieldType":"any","autoRefresh":false,"recomputeOnInputChanged":false},"verticalAlignment":"center","horizontalAlignment":"center"}],"configuration":{"search":{"type":"static","value":"Disabled"},"pagination":{"type":"oneOf","selected":"auto","configuration":{"auto":{"pageSize":{"type":"static","value":20}},"manual":{"pageCount":{"type":"static","value":-1}}}},"initialState":{"type":"static","value":{}},"downloadButton":{"type":"static","value":false}},"componentInput":{"type":"runnable","value":[],"fields":{},"runnable":{"name":"Inline Script 0","type":"runnableByName","inlineScript":{"path":"u/trevor/stylish_app/Inline Script 0","content":"if (btnLoadNamespaces.result) {\n  let data = JSON.parse(btnLoadNamespaces.result)\n  return data.items.map(item => {\n    return {\n      name: item.metadata.name\n    }\n  })\n}","language":"frontend"}},"fieldType":"array","autoRefresh":true,"subFieldType":"object","recomputeOnInputChanged":true}}},{"3":{"h":1,"w":1,"x":0,"y":0,"fixed":false},"12":{"h":1,"w":4,"x":8,"y":0,"id":"c","fixed":false},"id":"btnLoadNamespaces","data":{"id":"btnLoadNamespaces","type":"buttoncomponent","customCss":{},"recomputeIds":["tblNamespaces"],"configuration":{"size":{"type":"static","value":"xs"},"color":{"type":"static","value":"blue"},"label":{"type":"static","value":"Load k8s Namespaces"},"onError":{"type":"oneOf","selected":"errorOverlay","configuration":{"setTab":{"setTab":{"type":"static","value":[]}},"gotoUrl":{"url":{"type":"static","value":""},"newTab":{"type":"static","value":true}},"openModal":{"modalId":{"type":"static","value":""}},"closeModal":{"modalId":{"type":"static","value":""}},"errorOverlay":{},"sendErrorToast":{"message":{"type":"static","value":""},"appendError":{"type":"static","value":true}}}},"disabled":{"type":"static","value":false},"afterIcon":{"type":"static","value":""},"onSuccess":{"type":"oneOf","selected":"none","configuration":{"none":{},"setTab":{"setTab":{"type":"static","value":[]}},"gotoUrl":{"url":{"type":"static","value":""},"newTab":{"type":"static","value":true}},"openModal":{"modalId":{"type":"static","value":""}},"sendToast":{"message":{"type":"static","value":""}},"closeModal":{"modalId":{"type":"static","value":""}}}},"beforeIcon":{"type":"static","value":""},"fillContainer":{"type":"static","value":true},"triggerOnAppLoad":{"type":"static","value":false}},"componentInput":{"type":"runnable","fields":{"Command":{"type":"static","value":"get namespace --output=json","fieldType":"string"}},"runnable":{"name":"u/trevor/k8s_run_command","path":"u/trevor/k8s_run_command","type":"runnableByPath","schema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["Command"],"properties":{"Command":{"type":"string","default":null,"description":""}}},"runType":"script"},"fieldType":"any","autoRefresh":false,"recomputeOnInputChanged":false},"verticalAlignment":"center","horizontalAlignment":"center"}}],"a-1":[{"3":{"h":1,"w":1,"x":0,"y":0,"fixed":false},"12":{"h":1,"w":5,"x":0,"y":0,"id":"b","fixed":false},"id":"b","data":{"id":"b","type":"textcomponent","customCss":{},"configuration":{"style":{"type":"static","value":"Body"},"tooltip":{"type":"static","value":""},"copyButton":{"type":"static","value":false}},"componentInput":{"eval":"Active Namespace: ${state.active_namespace}","type":"template","value":"Hello ${ctx.username}","fieldType":"template"},"verticalAlignment":"top","horizontalAlignment":"left"}},{"3":{"h":1,"w":1,"x":1,"y":0,"fixed":false},"12":{"h":1,"w":4,"x":5,"y":0,"id":"d","fixed":false},"id":"btnLoadPods","data":{"id":"btnLoadPods","type":"buttoncomponent","customCss":{},"recomputeIds":["tblPodList"],"configuration":{"size":{"type":"static","value":"xs"},"color":{"type":"static","value":"blue"},"label":{"type":"static","value":"Load Pods from Namespace"},"onError":{"type":"oneOf","selected":"errorOverlay","configuration":{"setTab":{"setTab":{"type":"static","value":[]}},"gotoUrl":{"url":{"type":"static","value":""},"newTab":{"type":"static","value":true}},"openModal":{"modalId":{"type":"static","value":""}},"closeModal":{"modalId":{"type":"static","value":""}},"errorOverlay":{},"sendErrorToast":{"message":{"type":"static","value":""},"appendError":{"type":"static","value":true}}}},"disabled":{"type":"static","value":false},"afterIcon":{"type":"static","value":""},"onSuccess":{"type":"oneOf","selected":"none","configuration":{"none":{},"setTab":{"setTab":{"type":"static","value":[]}},"gotoUrl":{"url":{"type":"static","value":""},"newTab":{"type":"static","value":true}},"openModal":{"modalId":{"type":"static","value":""}},"sendToast":{"message":{"type":"static","value":""}},"closeModal":{"modalId":{"type":"static","value":""}}}},"beforeIcon":{"type":"static","value":""},"fillContainer":{"type":"static","value":false},"triggerOnAppLoad":{"type":"static","value":false}},"componentInput":{"type":"runnable","fields":{"Command":{"expr":"`get pods --namespace ${state.active_namespace} --output=json`","type":"eval","value":"","fieldType":"string"}},"runnable":{"name":"u/trevor/k8s_run_command","path":"u/trevor/k8s_run_command","type":"runnableByPath","schema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["Command"],"properties":{"Command":{"type":"string","default":null,"description":""}}},"runType":"script"},"fieldType":"any","autoRefresh":false,"recomputeOnInputChanged":false},"verticalAlignment":"center","horizontalAlignment":"center"}},{"3":{"h":10,"w":3,"x":0,"y":1,"fixed":false},"12":{"h":10,"w":9,"x":0,"y":1,"id":"c","fixed":false},"id":"tblPodList","data":{"id":"tblPodList","type":"tablecomponent","customCss":{},"actionButtons":[],"configuration":{"search":{"type":"static","value":"Disabled"},"pagination":{"type":"oneOf","selected":"auto","configuration":{"auto":{"pageSize":{"type":"static","value":20}},"manual":{"pageCount":{"type":"static","value":-1}}}},"initialState":{"type":"static","value":{}},"downloadButton":{"type":"static","value":false}},"componentInput":{"type":"runnable","value":[],"fields":{},"runnable":{"name":"Inline Script 2","type":"runnableByName","inlineScript":{"path":"u/trevor/stylish_app/Inline Script 2","content":"if (btnLoadPods.result) {\n  let pod_data = JSON.parse(btnLoadPods.result);\n  return pod_data.items.map(item => {\n    return {\n      namespace: item.metadata.namespace,\n      name: item.metadata.name,\n      container_count: item.spec.containers.length\n    }\n  })\n}","language":"frontend"}},"fieldType":"array","autoRefresh":true,"subFieldType":"object","recomputeOnInputChanged":true}}}]},"fullscreen":false,"norefreshbar":false,"hiddenInlineScripts":[],"unusedInlineScripts":[]},"policy":{"on_behalf_of":"u/trevor","triggerables":{"btnLoadPods:script/u/trevor/k8s_run_command":{},"btnLoadNamespaces:script/u/trevor/k8s_run_command":{"Command":"get namespace --output=json"},"tblPodList:rawscript/3d082fa5fbce494e9ec610c4592834cba75c3f92f1f2a72bb5e2e82fb08c5ca7":{},"tblNamespaces:rawscript/9bf3a223bed7606cea3f236659c7ec937ba013e25064e8987459c081a5c0a8c4":{},"tblNamespaces_a:rawscript/fed27063c2e8063800b2c5b92d90884bf1722bb0ac64e31ac1545385e7322f7f":{}},"execution_mode":"publisher","on_behalf_of_email":"trevor@trevorsullivan.net"},"summary":"","versions":[120,121],"created_at":"2023-07-20T12:08:32.273077Z","created_by":"trevor","extra_perms":{}},"description":"This Windmill application allows you to view Kubernetes namespaces and pods in a tabbed interface. It can be extended to include support for creating / destroying pods, and managing other types of Kubernetes resources (deployments, services, et al.).","vcreated_at":"2023-07-20T12:14:33.577Z","vcreated_by":"trevor sullivan188","comments":[]}}