3 lines
7.3 KiB
JavaScript
3 lines
7.3 KiB
JavaScript
import{_ as $}from"./LayoutHeader-1ab0c734.js";import{_ as D}from"./EmptyState-0c9a3a58.js";import{n as b,o as t,c as a,d as n,g as c,b as r,p as k,q as L,e as i,h as R,D as V,_ as F,F as g,k as C,j as f,t as o,E,i as m,r as h}from"./index-ce79e179.js";const B=[{id:"container",label:"logs.containerLogs",icon:"server"},{id:"system",label:"logs.systemLogs",icon:"cpu"},{id:"webserver",label:"logs.webServerLogs",icon:"globe"},{id:"apps",label:"logs.appsLogs",icon:"package"},{id:"admin",label:"logs.adminPanelLogs",icon:"shield"},{id:"billing",label:"logs.billingLogs",icon:"credit-card"},{id:"users",label:"logs.usersLogs",icon:"users"},{id:"sites",label:"logs.sitesLogs",icon:"layers"}],A=[{timestamp:"2024-03-15 14:32:15",level:"info",container:"prod-app-001",message:"Health check passed"},{timestamp:"2024-03-15 14:31:00",level:"info",container:"staging-app-001",message:"New connection from 192.168.1.100"},{timestamp:"2024-03-15 14:30:45",level:"warning",container:"prod-app-001",message:"High memory usage detected: 85%"},{timestamp:"2024-03-15 14:29:20",level:"error",container:"analytics-001",message:"Container failed to start: OCI runtime error"},{timestamp:"2024-03-15 14:28:00",level:"info",container:"client-demo-001",message:"Container started successfully"}],U=[{timestamp:"2024-03-15 14:35:00",level:"info",source:"incusd",message:"Cluster heartbeat successful"},{timestamp:"2024-03-15 14:34:30",level:"info",source:"kernel",message:"Memory reclaim completed, freed 512MB"},{timestamp:"2024-03-15 14:33:15",level:"warning",source:"storage",message:"Pool usage at 75%, consider expansion"},{timestamp:"2024-03-15 14:32:00",level:"info",source:"network",message:"Bridge br0 link up"}],G=[{timestamp:"2024-03-15 14:35:22",level:"info",message:"GET /api/v1/sites 200 45ms"},{timestamp:"2024-03-15 14:35:20",level:"info",message:"POST /api/v1/sites/site-001/start 200 1250ms"},{timestamp:"2024-03-15 14:35:15",level:"warning",message:"Rate limit approached for IP 192.168.1.50"},{timestamp:"2024-03-15 14:35:10",level:"error",message:"POST /api/v1/sites/site-005/start 500 Internal Server Error"}],M=[{timestamp:"2024-03-15 14:30:00",level:"info",user:"admin@example.com",action:"LOGIN",message:"User logged in successfully"},{timestamp:"2024-03-15 14:25:00",level:"info",user:"admin@example.com",action:"START_CONTAINER",message:"Started container client-demo-001"},{timestamp:"2024-03-15 14:20:00",level:"warning",user:"developer@example.com",action:"DELETE_ATTEMPT",message:"Attempted to delete production container (blocked)"}],z=[{timestamp:"2024-03-15 10:00:00",level:"info",customer:"Acme Corporation",action:"PAYMENT_RECEIVED",amount:42500},{timestamp:"2024-03-15 09:30:00",level:"warning",customer:"Startup Labs",action:"PAYMENT_FAILED",message:"Card declined"},{timestamp:"2024-03-14 15:00:00",level:"info",customer:"SmallBiz Inc",action:"ACCOUNT_FROZEN",message:"Auto-frozen due to 60 days overdue"}],H=[{timestamp:"2024-03-15 14:30:00",level:"info",user:"admin@example.com",action:"LOGIN",ip:"192.168.1.100"},{timestamp:"2024-03-15 12:15:00",level:"info",user:"developer@example.com",action:"PASSWORD_CHANGE",ip:"192.168.1.105"},{timestamp:"2024-03-15 10:00:00",level:"warning",user:"unknown@hacker.com",action:"LOGIN_FAILED",ip:"203.0.113.50",message:"Invalid credentials (5 attempts)"}],q=[{timestamp:"2024-03-15 14:28:00",level:"info",site:"client-demo-001",action:"START",user:"admin@example.com"},{timestamp:"2024-03-15 14:00:00",level:"info",site:"prod-app-001",action:"BACKUP_CREATED",user:"system"},{timestamp:"2024-03-15 13:45:00",level:"info",site:"staging-app-001",action:"CONFIG_UPDATE",user:"developer@example.com"}],W={class:"flex flex-col h-full"},Y={class:"flex flex-1 overflow-hidden"},j={class:"w-56 border-r bg-surface-gray-2 overflow-y-auto"},K={class:"p-2"},Q=["onClick"],Z={class:"flex-1 overflow-auto p-5"},J={key:0,class:"bg-gray-900 rounded-lg overflow-hidden"},X={class:"p-4 font-mono text-sm overflow-x-auto max-h-[calc(100vh-200px)]"},ee={class:"text-gray-500 flex-shrink-0 w-40"},se={key:0,class:"text-blue-400 flex-shrink-0 w-32"},te={key:1,class:"text-purple-400 flex-shrink-0 w-24"},ae={key:2,class:"text-cyan-400 flex-shrink-0 w-40"},oe={key:3,class:"text-orange-400 flex-shrink-0 w-28"},le={class:"text-gray-300 flex-1"},ne={key:4,class:"text-green-400"},ie={key:5,class:"text-gray-500"},pe={__name:"Logs",setup(re){const v=h("container"),p=h("all"),d=h(""),N=[{label:"All Levels",value:"all"},{label:"Info",value:"info"},{label:"Warning",value:"warning"},{label:"Error",value:"error"},{label:"Debug",value:"debug"}],I={container:A,system:U,webserver:G,apps:A,admin:M,billing:z,users:H,sites:q},T=b(()=>I[v.value]||[]),_=b(()=>{let s=T.value;if(p.value!=="all"&&(s=s.filter(l=>l.level===p.value)),d.value){const l=d.value.toLowerCase();s=s.filter(e=>{var u,x,w,y;return((u=e.message)==null?void 0:u.toLowerCase().includes(l))||((x=e.container)==null?void 0:x.toLowerCase().includes(l))||((w=e.source)==null?void 0:w.toLowerCase().includes(l))||((y=e.user)==null?void 0:y.toLowerCase().includes(l))})}return s});function S(){console.log("Refreshing logs...")}function O(){console.log("Exporting logs...")}function P(s){return new Intl.NumberFormat("ru-RU",{style:"currency",currency:"RUB",minimumFractionDigits:0}).format(s)}return(s,l)=>(t(),a("div",W,[n($,{title:s.$t("logs.title")},{right:c(()=>[n(i(V),{modelValue:p.value,"onUpdate:modelValue":l[0]||(l[0]=e=>p.value=e),type:"select",options:N,class:"w-32"},null,8,["modelValue"]),n(i(F),{modelValue:d.value,"onUpdate:modelValue":l[1]||(l[1]=e=>d.value=e),type:"text",placeholder:s.$t("common.search"),class:"w-64"},{prefix:c(()=>[n(i(g),{name:"search",class:"h-4 w-4 text-ink-gray-4"})]),_:1},8,["modelValue","placeholder"]),n(i(C),{variant:"subtle",onClick:S},{prefix:c(()=>[n(i(g),{name:"refresh-cw",class:"h-4 w-4"})]),default:c(()=>[f(" "+o(s.$t("common.refresh")),1)]),_:1}),n(i(C),{variant:"subtle",onClick:O},{prefix:c(()=>[n(i(g),{name:"download",class:"h-4 w-4"})]),default:c(()=>[f(" "+o(s.$t("common.export")),1)]),_:1})]),_:1},8,["title"]),r("div",Y,[r("div",j,[r("nav",K,[(t(!0),a(k,null,L(i(B),e=>(t(),a("button",{key:e.id,class:E(["w-full flex items-center gap-2 px-3 py-2 rounded-md text-sm text-left transition-colors",v.value===e.id?"bg-surface-white shadow-sm text-ink-gray-9":"text-ink-gray-5 hover:bg-surface-white hover:text-ink-gray-7"]),onClick:u=>v.value=e.id},[n(i(g),{name:e.icon,class:"h-4 w-4"},null,8,["name"]),f(" "+o(s.$t(e.label)),1)],10,Q))),128))])]),r("div",Z,[_.value.length?(t(),a("div",J,[r("div",X,[(t(!0),a(k,null,L(_.value,(e,u)=>(t(),a("div",{key:u,class:"flex gap-4 py-1 hover:bg-gray-800 px-2 rounded"},[r("span",ee,o(e.timestamp),1),r("span",{class:E(["flex-shrink-0 w-20 uppercase",{"text-green-400":e.level==="info","text-yellow-400":e.level==="warning","text-red-400":e.level==="error","text-gray-400":e.level==="debug"}])}," ["+o(e.level)+"] ",3),e.container?(t(),a("span",se,o(e.container),1)):m("",!0),e.source?(t(),a("span",te,o(e.source),1)):m("",!0),e.user?(t(),a("span",ae,o(e.user),1)):m("",!0),e.action?(t(),a("span",oe,o(e.action),1)):m("",!0),r("span",le,o(e.message),1),e.amount?(t(),a("span",ne,o(P(e.amount)),1)):m("",!0),e.ip?(t(),a("span",ie,o(e.ip),1)):m("",!0)]))),128))])])):(t(),R(D,{key:1,icon:"file-text",title:s.$t("logs.noLogs"),description:"No log entries match your filters"},null,8,["title"]))])])]))}};export{pe as default};
|
|
//# sourceMappingURL=Logs-1cdf7743.js.map
|