From 41c364a1f8d99976b27f06e5e72e0b207f7f0165 Mon Sep 17 00:00:00 2001 From: Ralf Langebrake Date: Mon, 16 Dec 2024 18:30:33 +0100 Subject: [PATCH 1/3] Remove Nova 4 constraint --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8921fb7..01f3270 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "license": "MIT", "require": { "php": ">=8.0", - "laravel/nova": "^4.0|^5.0", + "laravel/nova": "^5.0", "spatie/cpu-load-health-check": "^1.0", "spatie/laravel-health": "^1.9", "spatie/ssl-certificate": "^2.6" From 8270808c1fbb9c28e90e2aed4601f39620741432 Mon Sep 17 00:00:00 2001 From: Ralf Langebrake Date: Mon, 16 Dec 2024 19:18:12 +0100 Subject: [PATCH 2/3] Add vue heroicons and update tool icon types --- dist/css/tool.css | 2 +- dist/js/tool.js | 2 +- package.json | 1 + resources/js/pages/Tool.vue | 30 +- yarn.lock | 1139 ----------------------------------- 5 files changed, 22 insertions(+), 1152 deletions(-) delete mode 100644 yarn.lock diff --git a/dist/css/tool.css b/dist/css/tool.css index af57105..a1947aa 100644 --- a/dist/css/tool.css +++ b/dist/css/tool.css @@ -1 +1 @@ -.nova-health :is(.pointer-events-none){pointer-events:none}.nova-health :is(.absolute){position:absolute}.nova-health :is(.relative){position:relative}.nova-health :is(.inset-0){inset:0}.nova-health :is(.z-20){z-index:20}.nova-health :is(.mb-3){margin-bottom:.75rem}.nova-health :is(.ml-1){margin-left:.25rem}.nova-health :is(.ml-4){margin-left:1rem}.nova-health :is(.ml-auto){margin-left:auto}.nova-health :is(.mr-1){margin-right:.25rem}.nova-health :is(.mr-4){margin-right:1rem}.nova-health :is(.mt-2){margin-top:.5rem}.nova-health :is(.mt-3){margin-top:.75rem}.nova-health :is(.inline-block){display:inline-block}.nova-health :is(.flex){display:flex}.nova-health :is(.table){display:table}.nova-health :is(.grid){display:grid}.nova-health :is(.h-4){height:1rem}.nova-health :is(.h-8){height:2rem}.nova-health :is(.h-full){height:100%}.nova-health :is(.min-h-\[200px\]){min-height:200px}.nova-health :is(.w-4){width:1rem}.nova-health :is(.w-8){width:2rem}.nova-health :is(.flex-shrink-0){flex-shrink:0}@keyframes spin{to{transform:rotate(360deg)}}.nova-health :is(.animate-spin){animation:spin 1s linear infinite}.nova-health :is(.cursor-pointer){cursor:pointer}.nova-health :is(.flex-wrap){flex-wrap:wrap}.nova-health :is(.items-start){align-items:flex-start}.nova-health :is(.items-center){align-items:center}.nova-health :is(.justify-center){justify-content:center}.nova-health :is(.justify-between){justify-content:space-between}.nova-health :is(.gap-1){gap:.25rem}.nova-health :is(.gap-6){gap:1.5rem}.nova-health :is(.overflow-hidden){overflow:hidden}.nova-health :is(.rounded-full){border-radius:9999px}.nova-health :is(.rounded-lg){border-radius:.5rem}.nova-health :is(.border-4){border-width:4px}.nova-health :is(.border-solid){border-style:solid}.nova-health :is(.border-current){border-color:currentColor}.nova-health :is(.border-r-transparent){border-right-color:transparent}.nova-health :is(.bg-transparent){background-color:transparent}.nova-health :is(.bg-white){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.nova-health :is(.bg-white\/50){background-color:#ffffff80}.nova-health :is(.p-6){padding:1.5rem}.nova-health :is(.align-\[-0\.125em\]){vertical-align:-.125em}.nova-health :is(.text-lg){font-size:1.125rem;line-height:1.75rem}.nova-health :is(.text-sm){font-size:.875rem;line-height:1.25rem}.nova-health :is(.text-xl){font-size:1.25rem;line-height:1.75rem}.nova-health :is(.font-bold){font-weight:700}.nova-health :is(.text-blue-500){--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.nova-health :is(.text-gray-400){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.nova-health :is(.text-gray-500){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.nova-health :is(.text-green-500){--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.nova-health :is(.text-red-500){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.nova-health :is(.text-yellow-500){--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity))}.nova-health :is(.opacity-0){opacity:0}.nova-health :is(.shadow){--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.nova-health :is(.shadow-lg){--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.nova-health :is(.transition){transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.nova-health :is(.hover\:opacity-75:hover){opacity:.75}@media (prefers-reduced-motion: reduce){@keyframes spin{to{transform:rotate(360deg)}}.nova-health :is(.motion-reduce\:animate-\[spin_1\.5s_linear_infinite\]){animation:spin 1.5s linear infinite}}.nova-health :is(.dark\:bg-gray-800:is(.dark *)){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.nova-health :is(.dark\:bg-gray-900\/80:is(.dark *)){background-color:#111827cc}@media (min-width: 768px){.nova-health :is(.md\:col-span-4){grid-column:span 4 / span 4}.nova-health :is(.md\:grid-cols-12){grid-template-columns:repeat(12,minmax(0,1fr))}} +.nova-health .pointer-events-none{pointer-events:none}.nova-health .absolute{position:absolute}.nova-health .relative{position:relative}.nova-health .inset-0{inset:0}.nova-health .z-20{z-index:20}.nova-health .mb-3{margin-bottom:.75rem}.nova-health .ml-1{margin-left:.25rem}.nova-health .ml-4{margin-left:1rem}.nova-health .ml-auto{margin-left:auto}.nova-health .mr-1{margin-right:.25rem}.nova-health .mr-4{margin-right:1rem}.nova-health .mt-2{margin-top:.5rem}.nova-health .mt-3{margin-top:.75rem}.nova-health .inline-block{display:inline-block}.nova-health .flex{display:flex}.nova-health .table{display:table}.nova-health .grid{display:grid}.nova-health .h-4{height:1rem}.nova-health .h-7{height:1.75rem}.nova-health .h-8{height:2rem}.nova-health .h-full{height:100%}.nova-health .min-h-\[200px\]{min-height:200px}.nova-health .w-4{width:1rem}.nova-health .w-7{width:1.75rem}.nova-health .w-8{width:2rem}.nova-health .flex-shrink-0{flex-shrink:0}@keyframes spin{to{transform:rotate(360deg)}}.nova-health .animate-spin{animation:spin 1s linear infinite}.nova-health .cursor-pointer{cursor:pointer}.nova-health .flex-wrap{flex-wrap:wrap}.nova-health .items-start{align-items:flex-start}.nova-health .items-center{align-items:center}.nova-health .justify-center{justify-content:center}.nova-health .justify-between{justify-content:space-between}.nova-health .gap-1{gap:.25rem}.nova-health .gap-6{gap:1.5rem}.nova-health .overflow-hidden{overflow:hidden}.nova-health .rounded-full{border-radius:9999px}.nova-health .rounded-lg{border-radius:.5rem}.nova-health .border-4{border-width:4px}.nova-health .border-solid{border-style:solid}.nova-health .border-current{border-color:currentColor}.nova-health .border-r-transparent{border-right-color:transparent}.nova-health .bg-transparent{background-color:transparent}.nova-health .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.nova-health .bg-white\/50{background-color:#ffffff80}.nova-health .p-6{padding:1.5rem}.nova-health .align-\[-0\.125em\]{vertical-align:-.125em}.nova-health .text-lg{font-size:1.125rem;line-height:1.75rem}.nova-health .text-sm{font-size:.875rem;line-height:1.25rem}.nova-health .text-xl{font-size:1.25rem;line-height:1.75rem}.nova-health .font-bold{font-weight:700}.nova-health .text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.nova-health .text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.nova-health .text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.nova-health .text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.nova-health .text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.nova-health .text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.nova-health .opacity-0{opacity:0}.nova-health .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.nova-health .shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.nova-health .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.nova-health .hover\:opacity-75:hover{opacity:.75}@media (prefers-reduced-motion: reduce){@keyframes spin{to{transform:rotate(360deg)}}.nova-health .motion-reduce\:animate-\[spin_1\.5s_linear_infinite\]{animation:spin 1.5s linear infinite}}.nova-health .dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.nova-health .dark\:bg-gray-900\/80:is(.dark *){background-color:#111827cc}@media (min-width: 768px){.nova-health .md\:col-span-4{grid-column:span 4 / span 4}.nova-health .md\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}} diff --git a/dist/js/tool.js b/dist/js/tool.js index 86472dc..17cda12 100644 --- a/dist/js/tool.js +++ b/dist/js/tool.js @@ -1 +1 @@ -(function(e,l){typeof exports=="object"&&typeof module<"u"?l(require("vue")):typeof define=="function"&&define.amd?define(["vue"],l):(e=typeof globalThis<"u"?globalThis:e||self,l(e.Vue))})(this,function(e){"use strict";const l={class:"nova-health"},p={class:"flex items-center justify-between mb-3"},_={class:"text-xl"},g={key:0,class:"text-sm text-gray-400 ml-4"},h=["disabled","loading"],y=[e.createElementVNode("div",{class:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] text-primary-500 motion-reduce:animate-[spin_1.5s_linear_infinite]",role:"status"},null,-1)],f={key:0,class:"grid md:grid-cols-12 gap-6"},E={class:"md:col-span-4 h-full p-6 flex items-start relative overflow-hidden bg-white dark:bg-gray-800 rounded-lg shadow md:col-span-4"},N={class:"text-lg"},V={class:"text-sm mt-2"},x={key:0,class:"mt-3 grid gap-1"},k={class:"flex flex-wrap items-center"},b={class:"inline-block font-bold text-gray-500 mr-1"},B={key:1,class:"mt-3 grid gap-1 text-gray-400"},S={class:"font-bold text-gray-500"},D={class:"font-bold text-gray-500"},w={class:"font-bold text-gray-500"},C={key:2,class:"mt-3 grid gap-1"},z={class:"font-bold text-gray-500 mr-1"},L={key:3,class:"mt-3 grid gap-1"},T={key:0},j={class:"font-bold"},M={class:"ml-1"},F={key:1},I={class:"font-bold"},W={class:"ml-1"},H={key:2},O={class:"font-bold"},A={class:"ml-1"},P={class:"font-bold ml-1"},q=e.defineComponent({__name:"Tool",props:{card:{}},setup(R){const s=e.ref(!1),i=e.ref([]),d=e.ref(null);async function c(){s.value=!0,await fetch("/nova-vendor/stepanenko3/nova-health").then(n=>n.json()).then(n=>{i.value=n.checkResults;const o=new Date(n.finishedAt*1e3),r=("0"+o.getDate()).slice(-2)+"/"+("0"+(o.getMonth()+1)).slice(-2)+"/"+o.getFullYear()+" "+("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2);d.value=r}).catch(n=>{console.error("Error fetching health:",n)}),s.value=!1}e.onMounted(()=>{c()});function m(n,o){return o.hasOwnProperty(n)?o[n]:o.default}return(n,o)=>{const r=e.resolveComponent("Icon");return e.openBlock(),e.createElementBlock("div",l,[e.createElementVNode("div",p,[e.createElementVNode("span",_,e.toDisplayString(n.__("Health")),1),d.value?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(d.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"ml-auto shadow-lg bg-white dark:bg-gray-800 cursor-pointer w-8 h-8 flex items-center justify-center rounded-lg hover:opacity-75 transition",disabled:s.value,loading:s.value,onClick:c},[e.createVNode(r,{type:"refresh",class:"w-4 h-4"})],8,h)]),e.createElementVNode("div",{class:e.normalizeClass(["absolute flex items-center justify-center inset-0 bg-white/50 dark:bg-gray-900/80 z-20",{"opacity-0 pointer-events-none":!s.value,"relative min-h-[200px] bg-transparent":i.value.length<=0}])},y,2),i.value.length?(e.openBlock(),e.createElementBlock("div",f,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,t=>(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(r,{width:"30",height:"30",class:e.normalizeClass(["mr-4 flex-shrink-0",m(t.status,{ok:"text-green-500",warning:"text-yellow-500",skipped:"text-blue-500",failed:"text-red-500",crashed:"text-red-500",default:"text-gray-500"})]),type:m(t.status,{ok:"check-circle",warning:"exclamation-circle",skipped:"arrow-circle-right",failed:"x-circle",crashed:"exclamation-circle",default:"dots-circle-horizontal"})},null,8,["class","type"]),e.createElementVNode("div",null,[e.createElementVNode("div",N,e.toDisplayString(t.label),1),e.createElementVNode("div",V,e.toDisplayString(t.notificationMessage||t.shortSummary),1),t.name.startsWith("OutdatedPackages")&&t?.meta?.outdated?(e.openBlock(),e.createElementBlock("div",x,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.meta.outdated,a=>(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("span",b,e.toDisplayString(a.name),1),e.createElementVNode("span",null,e.toDisplayString(a.version)+" -> "+e.toDisplayString(a.latest),1)]))),256))])):t.name.startsWith("CpuLoad")?(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",null,[e.createTextVNode(" Last minute: "),e.createElementVNode("span",S,e.toDisplayString(t.meta.last_minute)+"%",1)]),e.createElementVNode("div",null,[e.createTextVNode(" Last 5 minutes: "),e.createElementVNode("span",D,e.toDisplayString(t.meta.last_5_minutes)+"%",1)]),e.createElementVNode("div",null,[e.createTextVNode(" Last 15 minutes: "),e.createElementVNode("span",w,e.toDisplayString(t.meta.last_15_minutes)+"%",1)])])):t.name.startsWith("DatabaseTableSize")?(e.openBlock(),e.createElementBlock("div",C,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.values(t.meta),a=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",null,[e.createElementVNode("span",z,e.toDisplayString(a.name),1),e.createElementVNode("span",null," used "+e.toDisplayString(a.actualSize)+" of "+e.toDisplayString(a.maxSize),1)])]))),256))])):t.name.startsWith("Ssl")?(e.openBlock(),e.createElementBlock("div",L,[t?.meta?.domain?(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("span",j,e.toDisplayString(n.__("Domain"))+": ",1),e.createElementVNode("span",M,e.toDisplayString(t.meta.domain),1)])):e.createCommentVNode("",!0),t?.meta?.issuer?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("span",I,e.toDisplayString(n.__("Issuer"))+": ",1),e.createElementVNode("span",W,e.toDisplayString(t.meta.issuer),1)])):e.createCommentVNode("",!0),t?.meta?.expiration_date?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("span",O,e.toDisplayString(n.__("Expiration"))+": ",1),e.createElementVNode("span",A,e.toDisplayString(t.meta.expiration_date),1),e.createElementVNode("span",P," ("+e.toDisplayString(Math.abs(parseInt(t.meta.expiration_date_in_days)))+" "+e.toDisplayString(n.__("days"))+") ",1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])]))),256))])):e.createCommentVNode("",!0)])}}});Nova.booting((R,s)=>{Nova.inertia("NovaHealth",q)})}); +(function(e,s){typeof exports=="object"&&typeof module<"u"?s(require("vue")):typeof define=="function"&&define.amd?define(["vue"],s):(e=typeof globalThis<"u"?globalThis:e||self,s(e.Vue))})(this,function(e){"use strict";function s(a,l){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M13.836 2.477a.75.75 0 0 1 .75.75v3.182a.75.75 0 0 1-.75.75h-3.182a.75.75 0 0 1 0-1.5h1.37l-.84-.841a4.5 4.5 0 0 0-7.08.932.75.75 0 0 1-1.3-.75 6 6 0 0 1 9.44-1.242l.842.84V3.227a.75.75 0 0 1 .75-.75Zm-.911 7.5A.75.75 0 0 1 13.199 11a6 6 0 0 1-9.44 1.241l-.84-.84v1.371a.75.75 0 0 1-1.5 0V9.591a.75.75 0 0 1 .75-.75H5.35a.75.75 0 0 1 0 1.5H3.98l.841.841a4.5 4.5 0 0 0 7.08-.932.75.75 0 0 1 1.025-.273Z","clip-rule":"evenodd"})])}function g(a,l){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M15 8A7 7 0 1 0 1 8a7 7 0 0 0 14 0ZM4.75 7.25a.75.75 0 0 0 0 1.5h4.69L8.22 9.97a.75.75 0 1 0 1.06 1.06l2.5-2.5a.75.75 0 0 0 0-1.06l-2.5-2.5a.75.75 0 0 0-1.06 1.06l1.22 1.22H4.75Z","clip-rule":"evenodd"})])}function _(a,l){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm3.844-8.791a.75.75 0 0 0-1.188-.918l-3.7 4.79-1.649-1.833a.75.75 0 1 0-1.114 1.004l2.25 2.5a.75.75 0 0 0 1.15-.043l4.25-5.5Z","clip-rule":"evenodd"})])}function f(a,l){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM8 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5.5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm6 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z","clip-rule":"evenodd"})])}function c(a,l){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14ZM8 4a.75.75 0 0 1 .75.75v3a.75.75 0 0 1-1.5 0v-3A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z","clip-rule":"evenodd"})])}function h(a,l){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm2.78-4.22a.75.75 0 0 1-1.06 0L8 9.06l-1.72 1.72a.75.75 0 1 1-1.06-1.06L6.94 8 5.22 6.28a.75.75 0 0 1 1.06-1.06L8 6.94l1.72-1.72a.75.75 0 1 1 1.06 1.06L9.06 8l1.72 1.72a.75.75 0 0 1 0 1.06Z","clip-rule":"evenodd"})])}const y={class:"nova-health"},E={class:"flex items-center justify-between mb-3"},B={class:"text-xl"},x={key:0,class:"text-sm text-gray-400 ml-4"},w=["disabled","loading"],k={key:0,class:"grid md:grid-cols-12 gap-6"},N={class:"md:col-span-4 h-full p-6 flex items-start relative overflow-hidden bg-white dark:bg-gray-800 rounded-lg shadow md:col-span-4"},V={class:"text-lg"},b={class:"text-sm mt-2"},S={key:0,class:"mt-3 grid gap-1"},D={class:"flex flex-wrap items-center"},C={class:"inline-block font-bold text-gray-500 mr-1"},M={key:1,class:"mt-3 grid gap-1 text-gray-400"},Z={class:"font-bold text-gray-500"},u={class:"font-bold text-gray-500"},L={class:"font-bold text-gray-500"},A={key:2,class:"mt-3 grid gap-1"},T={class:"font-bold text-gray-500 mr-1"},j={key:3,class:"mt-3 grid gap-1"},z={key:0},H={class:"font-bold"},$={class:"ml-1"},F={key:1},W={class:"font-bold"},O={class:"ml-1"},I={key:2},P={class:"font-bold"},q={class:"ml-1"},R={class:"font-bold ml-1"},Y=e.defineComponent({__name:"Tool",props:{card:{}},setup(a){const l=e.ref(!1),i=e.ref([]),d=e.ref(null);async function m(){l.value=!0,await fetch("/nova-vendor/stepanenko3/nova-health").then(o=>o.json()).then(o=>{i.value=o.checkResults;const n=new Date(o.finishedAt*1e3),t=("0"+n.getDate()).slice(-2)+"/"+("0"+(n.getMonth()+1)).slice(-2)+"/"+n.getFullYear()+" "+("0"+n.getHours()).slice(-2)+":"+("0"+n.getMinutes()).slice(-2);d.value=t}).catch(o=>{console.error("Error fetching health:",o)}),l.value=!1}e.onMounted(()=>{m()});function p(o,n){return n.hasOwnProperty(o)?n[o]:n.default}return(o,n)=>(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("div",E,[e.createElementVNode("span",B,e.toDisplayString(o.__("Health")),1),d.value?(e.openBlock(),e.createElementBlock("span",x,e.toDisplayString(d.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"ml-auto shadow-lg bg-white dark:bg-gray-800 cursor-pointer w-8 h-8 flex items-center justify-center rounded-lg hover:opacity-75 transition",disabled:l.value,loading:l.value,onClick:m},[e.createVNode(e.unref(s),{class:"w-4 h-4"})],8,w)]),e.createElementVNode("div",{class:e.normalizeClass(["absolute flex items-center justify-center inset-0 bg-white/50 dark:bg-gray-900/80 z-20",{"opacity-0 pointer-events-none":!l.value,"relative min-h-[200px] bg-transparent":i.value.length<=0}])},n[0]||(n[0]=[e.createElementVNode("div",{class:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] text-primary-500 motion-reduce:animate-[spin_1.5s_linear_infinite]",role:"status"},null,-1)]),2),i.value.length?(e.openBlock(),e.createElementBlock("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,t=>(e.openBlock(),e.createElementBlock("div",N,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p(t.status,{ok:e.unref(_),warning:e.unref(c),skipped:e.unref(g),failed:e.unref(h),crashed:e.unref(c),default:e.unref(f)})),{width:"30",height:"30",class:e.normalizeClass(["mr-4 w-7 h-7 flex-shrink-0",p(t.status,{ok:"text-green-500",warning:"text-yellow-500",skipped:"text-blue-500",failed:"text-red-500",crashed:"text-red-500",default:"text-gray-500"})])},null,8,["class"])),e.createElementVNode("div",null,[e.createElementVNode("div",V,e.toDisplayString(t.label),1),e.createElementVNode("div",b,e.toDisplayString(t.notificationMessage||t.shortSummary),1),t.name.startsWith("OutdatedPackages")&&t?.meta?.outdated?(e.openBlock(),e.createElementBlock("div",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.meta.outdated,r=>(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("span",C,e.toDisplayString(r.name),1),e.createElementVNode("span",null,e.toDisplayString(r.version)+" -> "+e.toDisplayString(r.latest),1)]))),256))])):t.name.startsWith("CpuLoad")?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",null,[n[1]||(n[1]=e.createTextVNode(" Last minute: ")),e.createElementVNode("span",Z,e.toDisplayString(t.meta.last_minute)+"%",1)]),e.createElementVNode("div",null,[n[2]||(n[2]=e.createTextVNode(" Last 5 minutes: ")),e.createElementVNode("span",u,e.toDisplayString(t.meta.last_5_minutes)+"%",1)]),e.createElementVNode("div",null,[n[3]||(n[3]=e.createTextVNode(" Last 15 minutes: ")),e.createElementVNode("span",L,e.toDisplayString(t.meta.last_15_minutes)+"%",1)])])):t.name.startsWith("DatabaseTableSize")?(e.openBlock(),e.createElementBlock("div",A,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.values(t.meta),r=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",null,[e.createElementVNode("span",T,e.toDisplayString(r.name),1),e.createElementVNode("span",null," used "+e.toDisplayString(r.actualSize)+" of "+e.toDisplayString(r.maxSize),1)])]))),256))])):t.name.startsWith("Ssl")?(e.openBlock(),e.createElementBlock("div",j,[t?.meta?.domain?(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("span",H,e.toDisplayString(o.__("Domain"))+": ",1),e.createElementVNode("span",$,e.toDisplayString(t.meta.domain),1)])):e.createCommentVNode("",!0),t?.meta?.issuer?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("span",W,e.toDisplayString(o.__("Issuer"))+": ",1),e.createElementVNode("span",O,e.toDisplayString(t.meta.issuer),1)])):e.createCommentVNode("",!0),t?.meta?.expiration_date?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("span",P,e.toDisplayString(o.__("Expiration"))+": ",1),e.createElementVNode("span",q,e.toDisplayString(t.meta.expiration_date),1),e.createElementVNode("span",R," ("+e.toDisplayString(Math.abs(parseInt(t.meta.expiration_date_in_days)))+" "+e.toDisplayString(o.__("days"))+") ",1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])]))),256))])):e.createCommentVNode("",!0)]))}});Nova.booting((a,l)=>{Nova.inertia("NovaHealth",Y)})}); diff --git a/package.json b/package.json index a5661b1..46c3147 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "nova:install": "npm --prefix='vendor/laravel/nova' ci" }, "devDependencies": { + "@heroicons/vue": "^2.1.5", "@inertiajs/inertia": "^0.11.1", "@inertiajs/inertia-vue3": "^0.6.0", "@vitejs/plugin-vue": "^5.0.4", diff --git a/resources/js/pages/Tool.vue b/resources/js/pages/Tool.vue index 41ec041..ddefbd9 100644 --- a/resources/js/pages/Tool.vue +++ b/resources/js/pages/Tool.vue @@ -15,7 +15,7 @@ :loading="loading" @click="refresh" > - + @@ -34,13 +34,13 @@
- @@ -175,6 +175,14 @@