import{j as t}from"./vendor-react-wBh_31cN.js";import{l as u,p}from"./kubernetes-mdfH7o1Q.js";import{dF as y,R as c}from"./index-BKr2rJhV.js";import{C as m,a as d,b as x,c as j}from"./card-DISTA6Ay.js";import{L as w}from"./label-Dnebucx5.js";import{T as A}from"./tooltip-Da8-EbK8.js";import{E as k}from"./editable-select-Co_-YcCr.js";import{O as f}from"./vendor-icons-BUUmD6ht.js";const r=({data:e,title:o,tooltip:s,isFetching:l})=>{const a=Array.isArray(e),i=a?(e??[]).join(""):[e??""].join("");return t.jsxs("div",{className:"flex flex-col flex-1 w-full gap-5",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx(w,{children:o}),t.jsx(A,{content:s,side:"right",children:t.jsx(f,{className:"ml-1.5 size-3.5 text-quartz-gray"})})]}),t.jsx(k,{disabled:!0,isMulti:a,value:e,options:[],placeholder:"",onChange:()=>{},preventAdding:!0,isLoading:l},i)]})},P=({schedulingConfig:e})=>{const{data:o}=y(),s=e!=null&&e.kubeNodeSelectorLabels?u([],e.kubeNodeSelectorLabels):[],l=e!=null&&e.kubeNodeAntiAffinityLabels?u([],e.kubeNodeAntiAffinityLabels):[],a=e!=null&&e.kubePriorityClass?p([],[e.kubePriorityClass]):[],i=e!=null&&e.kubeQueue?[e==null?void 0:e.kubeQueue.localQueue]:[],n=e!=null&&e.topology?[e.topology]:["None"],b=s.length===0&&l.length===0&&a.length===0&&!o;return t.jsxs(m,{children:[t.jsx(d,{children:t.jsx(x,{children:"Kubernetes scheduling constraints"})}),t.jsxs(j,{className:"flex flex-col w-full gap-5",children:[b?t.jsx(c,{gray:!0,children:"None available"}):t.jsxs(t.Fragment,{children:[t.jsx(r,{data:s,title:"Node affinity",tooltip:"Job will run on a node with any of the following labels. Available Labels are configured by a Hopsworks Admin. If you require the use of a particular Label, not currently available in your project, contact a Hopsworks Admin."}),t.jsx(r,{data:l,title:"Node anti affinity",tooltip:"Job will run on a node that does not have any of the following labels. Available Labels are configured by a Hopsworks Admin. If you require the use of a particular Label, not currently available in your project, contact a Hopsworks Admin."}),t.jsx(r,{data:a,title:"Priority class",tooltip:"Job will run with this priority class. Available Priority Classes are configured by a Hopsworks Admin. If you require the use of a particular Priority Class, not currently available in your project, contact a Hopsworks Admin."})]}),o&&t.jsxs(t.Fragment,{children:[t.jsx(r,{data:i,title:"Queue",tooltip:"Job will run in this queue. Hopsworks queues use the Kueue queue abstraction. Available Queues are configured by a Kubernetes Admin. If you require the use of a particular Cluster Queue, ask the Kubernetes Admin to add access to it in your namespace in the form of a Local Queue."}),t.jsx(r,{data:n,title:"Topology",tooltip:"All pods will be scheduled within the selected topology unit."})]})]})]})};export{P as K};
