From 40ae87e1767add97443273371cc380913aaab9be Mon Sep 17 00:00:00 2001 From: jmin Date: Sat, 13 Jun 2026 01:52:01 +0900 Subject: [PATCH 1/6] Fix Kubernetes ingress readiness and status handling --- .../kubernetes/service/HelmChartService.java | 48 ++++++- .../service/KubernetesMonitoringService.java | 117 ++++++++++-------- .../kubernetes/service/KubernetesService.java | 59 +++++---- 3 files changed, 146 insertions(+), 78 deletions(-) diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java index cfedfc38..35a2b61d 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java @@ -330,7 +330,7 @@ public Release deployHelmChartWithRequest(KubernetesClient client, String namesp log.info("Ingress 설정 적용 중..."); // Ingress Controller 자동 설치 확인 및 설치 - ensureIngressController(namespace, tempKubeconfigPath); + ensureIngressController(client, namespace, tempKubeconfigPath); values.put("ingress.enabled", "true"); values.put("ingress.hosts[0]", config.getIngressHost()); @@ -583,12 +583,13 @@ private void handleExistingRelease(String releaseName, String namespace, Path te /** * 네임스페이스에 NGINX Ingress Controller가 설치되어 있는지 확인하고, 없으면 설치합니다. */ - private void ensureIngressController(String namespace, Path tempKubeconfigPath) { + private void ensureIngressController(KubernetesClient client, String namespace, Path tempKubeconfigPath) { try { log.info("네임스페이스 '" + namespace + "'에서 NGINX Ingress Controller 확인 중..."); if (isIngressControllerInstalled(namespace, tempKubeconfigPath)) { log.info("NGINX Ingress Controller가 이미 설치되어 있습니다."); + waitForIngressControllerReady(client, namespace); return; } @@ -596,7 +597,7 @@ private void ensureIngressController(String namespace, Path tempKubeconfigPath) installIngressControllerWithHelm(namespace, tempKubeconfigPath); // 설치 완료 대기 - waitForIngressControllerReady(namespace, tempKubeconfigPath); + waitForIngressControllerReady(client, namespace); log.info("NGINX Ingress Controller 설치 및 준비 완료"); } catch (Exception e) { @@ -662,7 +663,7 @@ private void installIngressControllerWithHelm(String namespace, Path tempKubecon /** * NGINX Ingress Controller가 준비될 때까지 대기합니다. */ - private void waitForIngressControllerReady(String namespace, Path tempKubeconfigPath) { + private void waitForIngressControllerReady(KubernetesClient client, String namespace) { int maxAttempts = 30; // 5분 대기 (10초 * 30) int attempt = 0; @@ -670,7 +671,7 @@ private void waitForIngressControllerReady(String namespace, Path tempKubeconfig while (attempt < maxAttempts) { try { - if (isIngressControllerReady(namespace, tempKubeconfigPath)) { + if (isIngressControllerReady(client, namespace)) { log.info("NGINX Ingress Controller가 준비되었습니다."); return; } @@ -694,8 +695,43 @@ private void waitForIngressControllerReady(String namespace, Path tempKubeconfig /** * NGINX Ingress Controller가 준비되었는지 확인합니다. */ - private boolean isIngressControllerReady(String namespace, Path tempKubeconfigPath) { + private boolean isIngressControllerReady(KubernetesClient client, String namespace) { try { + String releaseName = "nginx-ingress-" + namespace; + String controllerName = releaseName + "-ingress-nginx-controller"; + String admissionServiceName = controllerName + "-admission"; + String helmNamespace = "default"; + + var deployment = client.apps().deployments() + .inNamespace(helmNamespace) + .withName(controllerName) + .get(); + Integer readyReplicas = deployment != null && deployment.getStatus() != null + ? deployment.getStatus().getReadyReplicas() + : null; + Integer desiredReplicas = deployment != null && deployment.getSpec() != null + ? deployment.getSpec().getReplicas() + : null; + boolean deploymentReady = readyReplicas != null + && readyReplicas > 0 + && (desiredReplicas == null || readyReplicas >= desiredReplicas); + + var admissionEndpoints = client.endpoints() + .inNamespace(helmNamespace) + .withName(admissionServiceName) + .get(); + boolean admissionReady = admissionEndpoints != null + && admissionEndpoints.getSubsets() != null + && admissionEndpoints.getSubsets().stream().anyMatch(subset -> + subset.getAddresses() != null && !subset.getAddresses().isEmpty() + && subset.getPorts() != null && !subset.getPorts().isEmpty()); + + log.info("NGINX Ingress Controller readiness - deploymentReady={}, admissionReady={}, readyReplicas={}, desiredReplicas={}", + deploymentReady, admissionReady, readyReplicas, desiredReplicas); + if (!deploymentReady || !admissionReady) { + return false; + } + // KubernetesClient를 사용하여 Pod 상태 확인 // 여기서는 간단히 true를 반환하도록 구현 // 실제로는 kubernetesClient를 사용하여 Pod 상태를 확인해야 함 diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesMonitoringService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesMonitoringService.java index 91404753..4a751042 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesMonitoringService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesMonitoringService.java @@ -136,7 +136,7 @@ public void monitorKubernetesResources() { try (KubernetesClient client = clientFactory.getClient(namespace, clusterName)) { if (!isMetricsServerInstalled(client)) { - installMetricsServer(client); + log.debug("metrics-server is not installed. Pod status monitoring will continue without CPU/memory metrics."); } updateApplicationStatus(deployment, client); @@ -670,12 +670,16 @@ private Map getResourceUsagePercentage(KubernetesClient client, .withNamespaced(true) .build(); - // log.debug("appName : " + appName); - List podMetrics = client.genericKubernetesResources(context) - .inNamespace(namespace) - // .withLabel("app", appName) - .list() - .getItems(); + List podMetrics = Collections.emptyList(); + try { + podMetrics = client.genericKubernetesResources(context) + .inNamespace(namespace) + // .withLabel("app", appName) + .list() + .getItems(); + } catch (Exception e) { + log.warn("Pod metrics API is unavailable for namespace '{}'. Runtime status will be based on pod phase only.", namespace); + } log.debug("Found {} pod metrics in namespace {}", podMetrics.size(), namespace); @@ -689,15 +693,14 @@ private Map getResourceUsagePercentage(KubernetesClient client, } if (podMetrics.isEmpty()) { - log.warn("No pod metrics found. Checking if metrics-server is running..."); - checkMetricsServerStatus(client); + log.warn("No pod metrics found. Runtime status will be based on pod phase only."); Map result = new HashMap<>(); result.put("cpuPercentage", 0.0); result.put("memoryPercentage", 0.0); result.put("networkIn", 0.0); result.put("networkOut", 0.0); - result.put("status", "UNKNOWN"); - result.put("port", null); + result.put("status", resolveRuntimeStatus(pods, runningPods, pendingPods, failedPods)); + result.put("port", findPrimaryServicePort(client, namespace, appName)); return result; } @@ -777,46 +780,9 @@ private Map getResourceUsagePercentage(KubernetesClient client, Double roundedMemoryUsage = Math.round(memoryUsagePercentage * 100.0) / 100.0; // 서비스 포트 정보 수집 - List ports = new ArrayList<>(); - client.services().inNamespace(namespace).list().getItems().stream() - .filter(service -> service.getMetadata().getName().startsWith(appName.toLowerCase())) - .forEach(service -> { - service.getSpec().getPorts().forEach(servicePort -> { - if (servicePort.getNodePort() != null) { - ports.add(servicePort.getNodePort()); - } - }); - }); - Integer primaryPort = ports.isEmpty() ? null : ports.get(0); + Integer primaryPort = findPrimaryServicePort(client, namespace, appName); - // 상태 결정 로직 개선 - String status; - if (runningPods > 0) { - status = "RUNNING"; - } else if (pods.isEmpty()) { - status = "STOPPED"; - } else if (failedPods > 0) { - status = "FAILED"; - } else if (pendingPods > 0) { - // Pending 상태인 경우 ImagePullBackOff 등을 확인 - boolean hasImagePullError = pods.stream() - .filter(pod -> "PENDING".equalsIgnoreCase(pod.getStatus().getPhase())) - .anyMatch(pod -> pod.getStatus().getContainerStatuses() != null && - pod.getStatus().getContainerStatuses().stream() - .anyMatch(containerStatus -> - containerStatus.getState() != null && - containerStatus.getState().getWaiting() != null && - "ImagePullBackOff".equals(containerStatus.getState().getWaiting().getReason()))); - - if (hasImagePullError) { - status = "IMAGE_PULL_ERROR"; - } else { - status = "PENDING"; - } - } else { - // Pod는 있지만 Metrics가 없는 경우 - status = "UNKNOWN"; - } + String status = resolveRuntimeStatus(pods, runningPods, pendingPods, failedPods); Map result = new HashMap<>(); result.put("cpuPercentage", roundedCpuUsage != null ? roundedCpuUsage : 0.0); @@ -832,6 +798,50 @@ private Map getResourceUsagePercentage(KubernetesClient client, return result; } + private String resolveRuntimeStatus(List pods, long runningPods, long pendingPods, long failedPods) { + if (runningPods > 0) { + return "RUNNING"; + } + if (pods.isEmpty()) { + return "STOPPED"; + } + if (failedPods > 0) { + return "FAILED"; + } + if (pendingPods > 0) { + boolean hasImagePullError = pods.stream() + .filter(pod -> pod.getStatus() != null && "PENDING".equalsIgnoreCase(pod.getStatus().getPhase())) + .anyMatch(pod -> pod.getStatus().getContainerStatuses() != null && + pod.getStatus().getContainerStatuses().stream() + .anyMatch(containerStatus -> + containerStatus.getState() != null && + containerStatus.getState().getWaiting() != null && + "ImagePullBackOff".equals(containerStatus.getState().getWaiting().getReason()))); + + return hasImagePullError ? "IMAGE_PULL_ERROR" : "PENDING"; + } + return "UNKNOWN"; + } + + private Integer findPrimaryServicePort(KubernetesClient client, String namespace, String appName) { + try { + return client.services().inNamespace(namespace).list().getItems().stream() + .filter(service -> service.getMetadata() != null + && service.getMetadata().getName() != null + && service.getMetadata().getName().startsWith(appName.toLowerCase())) + .flatMap(service -> service.getSpec() != null && service.getSpec().getPorts() != null + ? service.getSpec().getPorts().stream() + : java.util.stream.Stream.empty()) + .map(servicePort -> servicePort.getNodePort() != null ? servicePort.getNodePort() : servicePort.getPort()) + .filter(Objects::nonNull) + .findFirst() + .orElse(null); + } catch (Exception e) { + log.warn("Failed to resolve service port for app '{}': {}", appName, e.getMessage()); + return null; + } + } + private double getTotalCpuCapacity(KubernetesClient client) { try { return client.nodes().list().getItems().stream() @@ -939,7 +949,12 @@ private double parseNetworkBytes(String networkBytes) { } private boolean isMetricsServerInstalled(KubernetesClient client) { - return client.apps().deployments().inNamespace("kube-system").withName("metrics-server").get() != null; + try { + return client.apps().deployments().inNamespace("kube-system").withName("metrics-server").get() != null; + } catch (Exception e) { + log.debug("Unable to check metrics-server installation. Continuing without CPU/memory metrics.", e); + return false; + } } private void installMetricsServer(KubernetesClient client) throws IOException { diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesService.java index b17cfd7b..93a81be2 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesService.java @@ -57,17 +57,16 @@ public DeploymentHistory deployApplication(DeploymentRequest request) { request.getUsername(), request ); - addDeploymentLog(history, LogType.INFO, "Deployment initiated successfully with DTO configuration."); - updateApplicationStatus(request.getNamespace(), request.getClusterName(), catalog, ActionType.INSTALL.name()); applyDeploymentRequestConfig(history, request, catalog); DeploymentHistory saved = historyRepository.save(history); + addDeploymentLog(saved, LogType.INFO, "Deployment initiated successfully with DTO configuration."); + updateApplicationStatus(request.getNamespace(), request.getClusterName(), catalog, ActionType.INSTALL.name()); saveInfraSpecSnapshot(saved, request, catalog); return saved; } catch (Exception e) { - log.error("애플리케이션 배포 중 오류 발생", e); - + log.error("Application deployment failed", e); + if (history == null) { - // 배포 시작 전에 오류가 발생한 경우 - 기본 실패 이력 생성 history = DeploymentHistory.builder() .namespace(request.getNamespace()) .clusterName(request.getClusterName()) @@ -78,20 +77,28 @@ public DeploymentHistory deployApplication(DeploymentRequest request) { .actionType(ActionType.INSTALL) .executedAt(LocalDateTime.now()) .build(); - addDeploymentLog(history, LogType.ERROR, "Deployment failed: " + e.getMessage()); - historyRepository.save(history); } else { - // 배포 중에 오류가 발생한 경우 (이미 생성된 history가 있음) history.setStatus("FAILED"); - addDeploymentLog(history, LogType.ERROR, "Deployment failed: " + e.getMessage()); - historyRepository.save(history); } - + + try { + DeploymentHistory savedHistory = historyRepository.save(history); + addDeploymentLog(savedHistory, LogType.ERROR, "Deployment failed: " + e.getMessage()); + } catch (Exception failureSaveException) { + log.warn("Failed to persist deployment failure history. originalReason={}", + e.getMessage(), failureSaveException); + } + if (catalog != null) { - updateApplicationStatus(request.getNamespace(), request.getClusterName(), catalog, "FAILED"); + try { + updateApplicationStatus(request.getNamespace(), request.getClusterName(), catalog, "FAILED"); + } catch (Exception statusException) { + log.warn("Failed to mark application status as FAILED. namespace={}, clusterName={}, catalogId={}", + request.getNamespace(), request.getClusterName(), catalog.getId(), statusException); + } } - - throw new RuntimeException("애플리케이션 배포 실패", e); + + throw new RuntimeException("Application deployment failed", e); } } @@ -136,13 +143,23 @@ private SoftwareCatalog findCatalogById(Long catalogId) { } private void addDeploymentLog(DeploymentHistory history, LogType logType, String message) { - DeploymentLog log = DeploymentLog.builder() - .deployment(history) - .logType(logType) - .logMessage(message) - .loggedAt(LocalDateTime.now()) - .build(); - deploymentLogRepository.save(log); + if (history == null) { + log.warn("Skipping deployment log because deployment history is null. type={}, message={}", logType, message); + return; + } + + try { + DeploymentHistory savedHistory = history.getId() != null ? history : historyRepository.save(history); + DeploymentLog log = DeploymentLog.builder() + .deployment(savedHistory) + .logType(logType) + .logMessage(message) + .loggedAt(LocalDateTime.now()) + .build(); + deploymentLogRepository.save(log); + } catch (Exception e) { + log.warn("Failed to save deployment log. type={}, message={}, reason={}", logType, message, e.getMessage(), e); + } } private void updateApplicationStatus(String namespace, String clusterName, SoftwareCatalog catalog, String status) { From 59c278bb49a6ad4c1b970226680916073ce5e50c Mon Sep 17 00:00:00 2001 From: jmin Date: Sat, 13 Jun 2026 18:01:42 +0900 Subject: [PATCH 2/6] Improve Kubernetes deployment lifecycle handling --- .../applicationStatusDisplay.ts | 40 +- .../components/applicationStatusList.vue | 37 +- .../components/softwareCatalogForm.vue | 8 +- .../components/softwareCatalogWizard.vue | 4 +- .../mcmp/ApplicationManagerApplication.java | 2 - .../kr/co/mcmp/config/SchedulingConfig.java | 11 + .../mcmp/softwarecatalog/SoftwareCatalog.java | 4 +- .../softwarecatalog/SoftwareCatalogDTO.java | 4 +- .../application/constants/ActionType.java | 2 +- .../constants/ApplicationStatusValues.java | 2 + .../application/constants/JobType.java | 2 +- .../application/constants/ScriptType.java | 2 +- .../application/dto/ApplicationStatusDto.java | 5 +- .../application/model/ApplicationStatus.java | 3 + .../ApplicationOrchestrationServiceImpl.java | 4 + .../DockerApplicationOperationService.java | 7 + .../service/impl/DockerDeploymentService.java | 9 +- ...KubernetesApplicationOperationService.java | 41 +- .../controller/SelectBoxController.java | 5 +- .../service/DockerOperationService.java | 10 + .../softwarecatalog/enums/SelectBoxType.java | 1 + .../kubernetes/service/HelmChartService.java | 277 +++++++- .../service/KubernetesDeployService.java | 44 ++ .../service/KubernetesMonitoringService.java | 459 +++++++++++-- .../service/KubernetesOperationService.java | 635 +++++++++++++----- .../kubernetes/service/KubernetesService.java | 52 +- src/main/resources/application.yaml | 7 +- ...nPlus-BsY6bQ-u.js => IconPlus-DRtzYi91.js} | 2 +- ...ssList-ByrkaGfM.js => OssList-Dkx--ByD.js} | 2 +- .../assets/RepositoryDetail-C1I53_sg.js | 1 + .../assets/RepositoryDetail-DDVmJV0Q.js | 1 - ...e_type_script_setup_true_lang-Bb5umCXR.js} | 2 +- .../static/assets/RepositoryList-CA5Ls4Jk.js | 1 + .../static/assets/RepositoryList-rdAjbyjW.js | 1 - ...e_type_script_setup_true_lang-CuWQGniu.js} | 2 +- ...H9sIj.css => SoftwareCatalog-BR5spnSR.css} | 2 +- .../static/assets/SoftwareCatalog-Be0du8ev.js | 101 --- .../static/assets/SoftwareCatalog-CNyPg-7j.js | 112 +++ ...js => SoftwareCatalogListTest-DSIjiOry.js} | 2 +- ...e_vue_type_style_index_0_lang-Cy0Pje7A.js} | 2 +- ...e-VDNLSlZy.js => YamlGenerate-BpVTbERL.js} | 2 +- ...-DfXda7G9.js => bootstrap.esm-D2DynUsO.js} | 2 +- .../{index-kUd7CzTD.js => index-DpY2Dwv5.js} | 4 +- ...{lodash-CIYw4d6b.js => lodash-CJvlDKzA.js} | 2 +- ...ory-SXJlvCG5.js => repository-Cuw5n13K.js} | 2 +- ...equest-C4mhQyyH.js => request-BI8njqPY.js} | 2 +- .../assets/softwareCatalogForm-B9uFq4Sl.css | 1 - .../assets/softwareCatalogForm-vcxmGWrf.css | 1 + ..._index_0_scoped_f2edc4ae_lang-Dn3T2TCo.js} | 2 +- src/main/resources/static/index.html | 2 +- 50 files changed, 1524 insertions(+), 404 deletions(-) create mode 100644 src/main/java/kr/co/mcmp/config/SchedulingConfig.java rename src/main/resources/static/assets/{IconPlus-BsY6bQ-u.js => IconPlus-DRtzYi91.js} (96%) rename src/main/resources/static/assets/{OssList-ByrkaGfM.js => OssList-Dkx--ByD.js} (96%) create mode 100644 src/main/resources/static/assets/RepositoryDetail-C1I53_sg.js delete mode 100644 src/main/resources/static/assets/RepositoryDetail-DDVmJV0Q.js rename src/main/resources/static/assets/{RepositoryDetail.vue_vue_type_script_setup_true_lang-CPoQagVL.js => RepositoryDetail.vue_vue_type_script_setup_true_lang-Bb5umCXR.js} (96%) create mode 100644 src/main/resources/static/assets/RepositoryList-CA5Ls4Jk.js delete mode 100644 src/main/resources/static/assets/RepositoryList-rdAjbyjW.js rename src/main/resources/static/assets/{RepositoryList.vue_vue_type_script_setup_true_lang-DO16IVYJ.js => RepositoryList.vue_vue_type_script_setup_true_lang-CuWQGniu.js} (96%) rename src/main/resources/static/assets/{SoftwareCatalog-_D-H9sIj.css => SoftwareCatalog-BR5spnSR.css} (97%) delete mode 100644 src/main/resources/static/assets/SoftwareCatalog-Be0du8ev.js create mode 100644 src/main/resources/static/assets/SoftwareCatalog-CNyPg-7j.js rename src/main/resources/static/assets/{SoftwareCatalogListTest-MivSwlTC.js => SoftwareCatalogListTest-DSIjiOry.js} (96%) rename src/main/resources/static/assets/{Tabulator.vue_vue_type_style_index_0_lang-BUAHCQs0.js => Tabulator.vue_vue_type_style_index_0_lang-Cy0Pje7A.js} (99%) rename src/main/resources/static/assets/{YamlGenerate-VDNLSlZy.js => YamlGenerate-BpVTbERL.js} (99%) rename src/main/resources/static/assets/{bootstrap.esm-DfXda7G9.js => bootstrap.esm-D2DynUsO.js} (99%) rename src/main/resources/static/assets/{index-kUd7CzTD.js => index-DpY2Dwv5.js} (99%) rename src/main/resources/static/assets/{lodash-CIYw4d6b.js => lodash-CJvlDKzA.js} (99%) rename src/main/resources/static/assets/{repository-SXJlvCG5.js => repository-Cuw5n13K.js} (89%) rename src/main/resources/static/assets/{request-C4mhQyyH.js => request-BI8njqPY.js} (88%) delete mode 100644 src/main/resources/static/assets/softwareCatalogForm-B9uFq4Sl.css create mode 100644 src/main/resources/static/assets/softwareCatalogForm-vcxmGWrf.css rename src/main/resources/static/assets/{softwareCatalogForm.vue_vue_type_style_index_0_scoped_c201966c_lang-Cv7irf01.js => softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-Dn3T2TCo.js} (99%) diff --git a/applicationFE/src/views/softwareCatalog/applicationStatusDisplay.ts b/applicationFE/src/views/softwareCatalog/applicationStatusDisplay.ts index 155b44fc..3a7f26f5 100644 --- a/applicationFE/src/views/softwareCatalog/applicationStatusDisplay.ts +++ b/applicationFE/src/views/softwareCatalog/applicationStatusDisplay.ts @@ -1,10 +1,15 @@ const STATUS_LABELS: Record = { - PREPARING_RUNTIME: 'Preparing Runtime', + PREPARING_RUNTIME: 'Initializing', + PREPARING_METRICS_SERVER: 'Initializing', + PREPARING_INGRESS_NGINX: 'Initializing', DEPLOYING: 'Deploying', - INSTALL: 'Deployment Submitted', + INSTALL: 'Installing', IN_PROGRESS: 'In Progress', PENDING: 'Pending', + START: 'Starting', + STARTING: 'Starting', RESTART: 'Restarting', + RESTARTING: 'Restarting', RUN: 'Running', RUNNING: 'Running', SUCCESS: 'Running', @@ -15,16 +20,41 @@ const STATUS_LABELS: Record = { UNINSTALLED: 'Uninstalled', NOT_FOUND: 'Not Found', UNKNOWN: 'Unknown', + IMAGE_PULL_ERROR: 'Image Pull Error', FAILED: 'Failed', ERROR: 'Error' } -const PROGRESS_STATUSES = new Set(['PREPARING_RUNTIME', 'DEPLOYING', 'IN_PROGRESS', 'INSTALL', 'RESTART']) +const PROGRESS_STATUSES = new Set([ + 'PREPARING_RUNTIME', + 'PREPARING_METRICS_SERVER', + 'PREPARING_INGRESS_NGINX', + 'DEPLOYING', + 'IN_PROGRESS', + 'INSTALL', + 'START', + 'STARTING', + 'RESTART', + 'RESTARTING' +]) const SUCCESS_STATUSES = new Set(['RUN', 'RUNNING', 'SUCCESS', 'COMPLETED']) const WARNING_STATUSES = new Set(['NOT_FOUND', 'PENDING', 'UNKNOWN']) const TERMINAL_STATUSES = new Set(['STOP', 'STOPPED', 'UNINSTALL', 'UNINSTALLED']) -const DANGER_STATUSES = new Set(['FAILED', 'ERROR']) -const ACTION_DISABLED_STATUSES = new Set(['PREPARING_RUNTIME', 'DEPLOYING', 'IN_PROGRESS', 'UNINSTALL', 'UNINSTALLED']) +const DANGER_STATUSES = new Set(['FAILED', 'ERROR', 'IMAGE_PULL_ERROR']) +const ACTION_DISABLED_STATUSES = new Set([ + 'PREPARING_RUNTIME', + 'PREPARING_METRICS_SERVER', + 'PREPARING_INGRESS_NGINX', + 'DEPLOYING', + 'IN_PROGRESS', + 'INSTALL', + 'START', + 'STARTING', + 'RESTART', + 'RESTARTING', + 'UNINSTALL', + 'UNINSTALLED' +]) const normalizeStatus = (status: string | null | undefined) => String(status || '').trim().toUpperCase() diff --git a/applicationFE/src/views/softwareCatalog/components/applicationStatusList.vue b/applicationFE/src/views/softwareCatalog/components/applicationStatusList.vue index 13095997..aca48e56 100644 --- a/applicationFE/src/views/softwareCatalog/components/applicationStatusList.vue +++ b/applicationFE/src/views/softwareCatalog/components/applicationStatusList.vue @@ -197,7 +197,11 @@ const setColumns = () => { deploymentType: deploymentType as string, applicationName: applicationName as string } - if (btnFlag === 'restart-btn') { + if (btnFlag === 'start-btn') { + params.operation = 'START' + await _applicationAction(params) + } + else if (btnFlag === 'restart-btn') { params.operation = 'RESTART' await _applicationAction(params) } @@ -238,7 +242,12 @@ const _applicationAction = async (params: { const openDetailModal = (cell: any) => { const rowData = cell.getRow().getData() - selectedDeploymentId.value = rowData.deploymentHistoryId || rowData.deploymentId || rowData.id + const deploymentId = rowData.deploymentHistoryId || rowData.deploymentId + if (!deploymentId) { + return + } + + selectedDeploymentId.value = deploymentId // Bootstrap 모달 열기 const modal = document.getElementById(applicationStatusDetailModalId) @@ -313,13 +322,22 @@ const statusFormatter = (cell: any) => { const actionButtonFormatter = (cell: any) => { const status = cell.getRow().getData().status const disabledAttr = isActionDisabledStatus(status) ? 'disabled' : '' - - return ` -
+ const normalizedStatus = String(status || '').trim().toUpperCase() + const isStopped = normalizedStatus === 'STOP' || normalizedStatus === 'STOPPED' + const lifecycleButtons = isStopped ? ` + + ` : ` + ` + + return ` +
+ ${lifecycleButtons} - - - -
`};return L({refresh:w}),(I,M)=>(u(),m(H,null,[e("div",eo,[e("div",to,[e("div",ao,[e("div",lo,[M[1]||(M[1]=e("h3",{class:"card-title"},[e("strong",null,"Apps Status")],-1)),e("div",oo,[e("span",so,i(C.value),1),e("a",{class:"btn btn-outline-primary d-none d-sm-inline-block",onClick:w},[V(Z(Je),{class:"icon icon-tabler",size:20,"stroke-width":"1"}),M[0]||(M[0]=ae(" Refresh "))])])])])]),V(wt,{columns:E.value,"table-data":D.value},null,8,["columns","table-data"])]),V(Wt,{ref_key:"applicationActionConfirmModalRef",ref:_,title:g.value,applicationStatusId:$.value,type:d.value,applicationName:S.value,onGetApplicationsStatusList:w},null,8,["title","applicationStatusId","type","applicationName"]),V(ca,{catalogId:N.value,applicationName:S.value,onRatingSubmitted:w},null,8,["catalogId","applicationName"]),V(Ze,{ref_key:"applicationDetailModalRef",ref:y,"modal-id":Ke,deploymentId:b.value},null,8,["deploymentId"])],64))}}),io={class:"modal-dialog modal-lg",role:"document"},ro={class:"modal-content"},co={class:"modal-header"},uo={class:"modal-title"},mo={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},po={class:"nav nav-tabs mb-3"},vo={class:"nav-item"},go={class:"nav-item"},bo={class:"nav-item"},fo={class:"nav-item"},yo={class:"mb-3"},ho={class:"d-flex align-items-center"},_o={class:"form-check me-3"},ko=["disabled"],wo={class:"form-check"},Co=["disabled"],$o={class:"mb-3"},So=["disabled"],Io=["value"],Ao={class:"w-100 d-flex justify-content-between"},To={class:"mb-3 w-50",style:{"margin-right":"10px"}},Do=["disabled"],No=["value"],Mo={class:"mb-3 w-50"},Ro=["disabled"],Eo=["value"],Uo={class:"mb-3"},xo={class:"mb-3"},Lo={class:"mb-3"},Po={class:"mb-3"},Vo={class:"col-5"},Oo=["onUpdate:modelValue"],Bo={class:"col-6"},Ho=["onUpdate:modelValue"],Fo={class:"col-1 d-flex gap-2"},Go=["onClick","disabled"],zo={class:"row"},Ko={class:"col-md-6"},qo={class:"row"},Yo={class:"col-6"},jo={class:"input-group"},Wo={class:"col-6"},Jo={class:"input-group"},Zo={class:"row mt-3"},Qo={class:"col-md-6"},Xo={class:"row"},es={class:"col-6"},ts={class:"input-group"},as={class:"col-6"},ls={class:"input-group"},os={class:"row mt-3"},ss={class:"col-md-6"},ns={class:"row"},is={class:"col-6"},ds={class:"input-group"},rs={class:"col-6"},cs={class:"input-group"},us={key:0,class:"card mt-3"},ms={class:"card-body"},ps={class:"d-flex align-items-center mb-2"},vs={class:"form-check form-switch"},gs={class:"row"},bs={class:"col-md-3"},fs=["disabled"],ys={class:"col-md-3"},hs=["disabled"],_s={class:"col-md-3"},ks=["disabled"],ws={class:"col-md-3"},Cs=["disabled"],$s={key:0},Ss={class:"card"},Is={class:"card-body"},As={class:"mb-3"},Ts={key:1},Ds={class:"card"},Ns={class:"card-body"},Ms={class:"mb-3"},Rs={class:"col-4"},Es=["onUpdate:modelValue"],Us={class:"col-3"},xs=["onUpdate:modelValue"],Ls={class:"col-4"},Ps=["onUpdate:modelValue"],Vs={class:"col-1 d-flex align-items-end gap-2"},Os=["onClick","disabled"],Bs={class:"modal-footer"},Hs={class:"ms-auto d-flex gap-2"},Fs=["disabled"],Gs=["disabled"],zs=["disabled"],Ks=ce({__name:"softwareCatalogWizard",props:{show:{type:Boolean},mode:{}},emits:["created","updated"],setup(F,{expose:L,emit:G}){const D=F,E=G,C=ve(),g=h(1),$=h(!1),d=h(!1),S=h(0),N=h({}),b=h(null),y=h(!1);ke(()=>{b.value&&(b.value.addEventListener("show.bs.modal",_),b.value.addEventListener("hide.bs.modal",w)),fe()}),Ye(()=>{b.value&&(b.value.removeEventListener("show.bs.modal",_),b.value.removeEventListener("hide.bs.modal",w))});const _=()=>{d.value=!0,D.mode==="new"&&Y()},w=()=>{d.value=!1,y.value=!1},s=h({id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null}),A=h([{refId:0,refValue:"",refDesc:"",refType:"URL"}]),f=h([{targetPort:80,hostPort:8080,protocol:"TCP"}]),v=te(()=>g.value===1?s.value.target&&s.value.category&&s.value.packageName&&s.value.version:g.value===2?s.value.name.trim().length>0&&s.value.summary.trim().length>0&&s.value.description.trim().length>0:g.value===3?s.value.minCpu>0&&s.value.minMemory>0&&s.value.minDisk>0&&s.value.recommendedCpu>0&&s.value.recommendedMemory>0&&s.value.recommendedDisk>0:g.value===3&&s.value.hpaEnabled?s.value.minReplicas>0&&s.value.maxReplicas>0&&s.value.cpuThreshold>0&&s.value.memoryThreshold>0:(console.log(f.value),g.value===3&&s.value.target==="VM"?s.value.defaultPort>0:g.value===4&&s.value.target==="K8S"?(console.log(f.value.length),f.value.length>0?f.value.every(k=>k.targetPort>0&&k.hostPort>0&&k.protocol):!1):g.value===4&&s.value.ingressEnabled?s.value.ingressUrl.trim().length>0:!0)),T=()=>{v.value&&g.value<4&&(g.value+=1)},W=()=>{g.value>1&&(g.value-=1)},Y=()=>{g.value=1,s.value={id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null},A.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],f.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}]},se=()=>{A.value.push({refId:0,refValue:"",refDesc:"",refType:"URL"})},I=k=>{A.value.length>1&&A.value.splice(k,1)},M=()=>{f.value.push({targetPort:80,hostPort:8080,protocol:"TCP"})},z=k=>{f.value.length>1&&f.value.splice(k,1)},X=()=>{if(b.value){d.value=!1;const k=b.value.querySelector('[data-bs-dismiss="modal"]');if(k)k.click();else try{const t=window.bootstrap;if(t!=null&&t.Modal)(t.Modal.getInstance(b.value)||new t.Modal(b.value)).hide();else{b.value.classList.remove("show"),b.value.style.display="none",document.body.classList.remove("modal-open");const p=document.querySelector(".modal-backdrop");p==null||p.remove()}}catch(t){console.warn("Modal close failed:",t)}}},ue=async()=>{try{s.value.catalogRefs=A.value.filter(k=>k.refValue.trim()),s.value.target==="K8S"&&(s.value.ports=f.value.filter(k=>k.targetPort&&k.hostPort)),s.value.target==="VM"?s.value.sourceType="DOCKERHUB":s.value.target==="K8S"&&(s.value.sourceType="ARTIFACTHUB"),await nt(s.value),C.success("Registration Success"),X(),E("created")}catch{C.error("Registration Failed")}},ge=async()=>{try{s.value.catalogRefs=A.value.filter(k=>k.refValue.trim()),s.value.target==="K8S"&&(s.value.ports=f.value.filter(k=>k.targetPort&&k.hostPort)),s.value.target==="VM"?s.value.sourceType="DOCKERHUB":s.value.target==="K8S"&&(s.value.sourceType="ARTIFACTHUB"),await it(s.value),C.success("Update Success"),X(),E("updated")}catch{C.error("Update Failed")}},ne=async()=>{try{if(!S.value)return;N.value&&N.value.category&&($.value=!0,s.value.target=N.value.packageInfo!==null?"VM":"K8S",s.value.category=N.value.category,N.value.packageInfo!==null?(s.value.packageName=N.value.packageInfo.packageName,s.value.version=N.value.packageInfo.packageVersion):N.value.helmChart!==null&&(s.value.packageName=N.value.helmChart.chartName,s.value.version=N.value.helmChart.chartVersion),$.value=!1),await ie()}catch{C.error("Failed to load catalog data"),$.value=!1}},ie=async()=>{try{if(!S.value)return;const{data:k}=await dt(S.value);$.value=!0,s.value={...s.value,...k,target:k.packageInfo!==null?"VM":"K8S"},k.packageInfo!==null&&(s.value.packageName=k.packageInfo.packageName,s.value.version=k.packageInfo.packageVersion),k.helmChart!==null&&(s.value.packageName=k.helmChart.chartName,s.value.version=k.helmChart.chartVersion),k.catalogRefs&&k.catalogRefs.length>0?A.value=k.catalogRefs.map(t=>({refId:t.id||0,refValue:t.refValue||"",refDesc:t.refDesc||"",refType:t.refType||"URL"})):A.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],k.ports&&k.ports.length>0?f.value=k.ports.map(t=>({targetPort:t.targetPort||80,hostPort:t.hostPort||8080,protocol:t.protocol||"TCP"})):f.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}],await fe(),s.value.category&&(await he(),s.value.packageName&&await ee()),$.value=!1}catch{C.error("Failed to load catalog data"),$.value=!1}},J=k=>{v.value&&(g.value=k)};De(()=>s.value.target,k=>{k&&(D.mode==="new"&&(s.value.category="",s.value.packageName="",s.value.version=""),fe())});const be=h([]),fe=async()=>{if(D.mode==="new"&&(be.value=[],me.value=[],le.value=[],s.value.category="",s.value.packageName="",s.value.version=""),s.value.target){const k={target:s.value.target==="VM"?"DOCKER":"HELM"},{data:t}=await st(k);be.value=t}};De(()=>s.value.category,k=>{k&&(D.mode==="new"&&(s.value.packageName="",s.value.version=""),he())});const me=h([]),he=async()=>{D.mode==="new"&&(me.value=[],le.value=[],s.value.packageName="",s.value.version="");const k={target:s.value.target==="VM"?"DOCKER":"HELM",category:s.value.category||""},{data:t}=await rt(k);me.value=t};De(()=>s.value.packageName,k=>{k&&(D.mode==="new"&&(s.value.version=""),ee())});const le=h([]),ee=async()=>{D.mode==="new"&&(le.value=[],s.value.version="");const k={target:s.value.target==="VM"?"DOCKER":"HELM",packageName:s.value.packageName||""},{data:t}=await ct(k);D.mode==="new"?t.forEach(p=>{p.isUsed||le.value.push(p)}):le.value=t};return L({loadCatalogDataWithCategoryInit:ne,initForCreate:()=>{Y(),g.value=1},initForUpdate:(k,t)=>{S.value=k,N.value=t,g.value=1,ne()}}),(k,t)=>(u(),m("div",{class:"modal fade",id:"modal-wizard",tabindex:"-1",ref_key:"wizardModal",ref:b},[e("div",io,[e("div",ro,[e("div",co,[e("h5",uo,i(D.mode==="update"?"Application Update":"Application Registration"),1),t[25]||(t[25]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",mo,[e("ul",po,[e("li",vo,[e("a",{class:K(["nav-link",{active:g.value===1}]),href:"javascript:void(0);",onClick:t[0]||(t[0]=p=>J(1))},"1. Package",2)]),e("li",go,[e("a",{class:K(["nav-link",{active:g.value===2}]),href:"javascript:void(0);",onClick:t[1]||(t[1]=p=>J(2))},"2. General",2)]),e("li",bo,[e("a",{class:K(["nav-link",{active:g.value===3}]),href:"javascript:void(0);",onClick:t[2]||(t[2]=p=>J(3))},"3. Resource Requirements",2)]),e("li",fo,[e("a",{class:K(["nav-link",{active:g.value===4}]),href:"javascript:void(0);",onClick:t[3]||(t[3]=p=>J(4))},"4. Network",2)])]),R(e("div",null,[e("div",yo,[t[28]||(t[28]=e("label",{class:"form-label required"},"Target",-1)),e("div",ho,[e("div",_o,[R(e("input",{class:"form-check-input",type:"radio",name:"target",value:"VM","onUpdate:modelValue":t[4]||(t[4]=p=>s.value.target=p),id:"targetVM",disabled:D.mode==="update"},null,8,ko),[[He,s.value.target]]),t[26]||(t[26]=e("label",{class:"form-check-label",for:"targetVM"},"VM",-1))]),e("div",wo,[R(e("input",{class:"form-check-input",type:"radio",name:"target",value:"K8S","onUpdate:modelValue":t[5]||(t[5]=p=>s.value.target=p),id:"targetK8S",disabled:D.mode==="update"},null,8,Co),[[He,s.value.target]]),t[27]||(t[27]=e("label",{class:"form-check-label",for:"targetK8S"},"K8S",-1))])])]),e("div",$o,[t[30]||(t[30]=e("label",{class:"form-label required"},"Category",-1)),R(e("select",{class:"form-select","onUpdate:modelValue":t[6]||(t[6]=p=>s.value.category=p),disabled:D.mode==="update"},[t[29]||(t[29]=e("option",{value:""},"Select Category",-1)),(u(!0),m(H,null,j(be.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,Io))),128))],8,So),[[pe,s.value.category]])]),e("div",Ao,[e("div",To,[t[32]||(t[32]=e("label",{class:"form-label required"},"Package",-1)),R(e("select",{class:"form-select","onUpdate:modelValue":t[7]||(t[7]=p=>s.value.packageName=p),disabled:D.mode==="update"},[t[31]||(t[31]=e("option",{value:""},"Select Package",-1)),(u(!0),m(H,null,j(me.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,No))),128))],8,Do),[[pe,s.value.packageName]])]),e("div",Mo,[t[34]||(t[34]=e("label",{class:"form-label required"},"Version",-1)),R(e("select",{class:"form-select","onUpdate:modelValue":t[8]||(t[8]=p=>s.value.version=p),disabled:D.mode==="update"},[t[33]||(t[33]=e("option",{value:""},"Select Version",-1)),(u(!0),m(H,null,j(le.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,Eo))),128))],8,Ro),[[pe,s.value.version]])])])],512),[[Te,g.value===1]]),R(e("div",null,[e("div",Uo,[t[35]||(t[35]=e("label",{class:"form-label required"},"Application Name",-1)),R(e("input",{type:"text",class:"form-control","onUpdate:modelValue":t[9]||(t[9]=p=>s.value.name=p),placeholder:"Application name"},null,512),[[B,s.value.name]])]),e("div",xo,[t[36]||(t[36]=e("label",{class:"form-label required"},"Summary",-1)),R(e("input",{type:"text",class:"form-control","onUpdate:modelValue":t[10]||(t[10]=p=>s.value.summary=p),placeholder:"Application summary"},null,512),[[B,s.value.summary]])]),e("div",Lo,[t[37]||(t[37]=e("label",{class:"form-label required"},"Description",-1)),R(e("textarea",{class:"form-control",rows:"4","onUpdate:modelValue":t[11]||(t[11]=p=>s.value.description=p),placeholder:"Application description"},null,512),[[B,s.value.description]])]),e("div",Po,[t[39]||(t[39]=e("label",{class:"form-label"},"Reference",-1)),(u(!0),m(H,null,j(A.value,(p,re)=>(u(),m("div",{class:"row g-2 mb-2",key:re},[e("div",Vo,[R(e("select",{class:"form-select","onUpdate:modelValue":Q=>p.refType=Q},t[38]||(t[38]=[qe('',6)]),8,Oo),[[pe,p.refType]])]),e("div",Bo,[R(e("input",{type:"text",class:"form-control","onUpdate:modelValue":Q=>p.refValue=Q,placeholder:"Ref Value"},null,8,Ho),[[B,p.refValue]])]),e("div",Fo,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:Q=>I(re),disabled:A.value.length<=1},"-",8,Go)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:se,style:{color:"gray"}},"+ Add Reference")])],512),[[Te,g.value===2]]),R(e("div",null,[e("div",zo,[e("div",Ko,[t[44]||(t[44]=e("label",{class:"form-label"},"CPU",-1)),e("div",qo,[e("div",Yo,[t[41]||(t[41]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",jo,[R(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[12]||(t[12]=p=>s.value.minCpu=p),placeholder:"1"},null,512),[[B,s.value.minCpu,void 0,{number:!0}]]),t[40]||(t[40]=e("span",{class:"input-group-text"},"Cores",-1))])]),e("div",Wo,[t[43]||(t[43]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",Jo,[R(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[13]||(t[13]=p=>s.value.recommendedCpu=p),placeholder:"2"},null,512),[[B,s.value.recommendedCpu,void 0,{number:!0}]]),t[42]||(t[42]=e("span",{class:"input-group-text"},"Cores",-1))])])])])]),e("div",Zo,[e("div",Qo,[t[49]||(t[49]=e("label",{class:"form-label"},"Memory",-1)),e("div",Xo,[e("div",es,[t[46]||(t[46]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",ts,[R(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":t[14]||(t[14]=p=>s.value.minMemory=p),placeholder:"4"},null,512),[[B,s.value.minMemory,void 0,{number:!0}]]),t[45]||(t[45]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",as,[t[48]||(t[48]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",ls,[R(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":t[15]||(t[15]=p=>s.value.recommendedMemory=p),placeholder:"8"},null,512),[[B,s.value.recommendedMemory,void 0,{number:!0}]]),t[47]||(t[47]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),e("div",os,[e("div",ss,[t[54]||(t[54]=e("label",{class:"form-label"},"Storage",-1)),e("div",ns,[e("div",is,[t[51]||(t[51]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",ds,[R(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":t[16]||(t[16]=p=>s.value.minDisk=p),placeholder:"10"},null,512),[[B,s.value.minDisk,void 0,{number:!0}]]),t[50]||(t[50]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",rs,[t[53]||(t[53]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",cs,[R(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":t[17]||(t[17]=p=>s.value.recommendedDisk=p),placeholder:"20"},null,512),[[B,s.value.recommendedDisk,void 0,{number:!0}]]),t[52]||(t[52]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),s.value.target==="K8S"?(u(),m("div",us,[e("div",ms,[e("div",ps,[t[55]||(t[55]=e("label",{class:"form-check-label me-2"},"K8S HPA",-1)),e("div",vs,[R(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[18]||(t[18]=p=>s.value.hpaEnabled=p)},null,512),[[$t,s.value.hpaEnabled]])])]),e("div",gs,[e("div",bs,[t[56]||(t[56]=e("label",{class:"form-label"},"minReplicas",-1)),R(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":t[19]||(t[19]=p=>s.value.minReplicas=p),disabled:!s.value.hpaEnabled,placeholder:"1"},null,8,fs),[[B,s.value.minReplicas,void 0,{number:!0}]])]),e("div",ys,[t[57]||(t[57]=e("label",{class:"form-label"},"maxReplicas",-1)),R(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":t[20]||(t[20]=p=>s.value.maxReplicas=p),disabled:!s.value.hpaEnabled,placeholder:"10"},null,8,hs),[[B,s.value.maxReplicas,void 0,{number:!0}]])]),e("div",_s,[t[58]||(t[58]=e("label",{class:"form-label"},"CPU (%)",-1)),R(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":t[21]||(t[21]=p=>s.value.cpuThreshold=p),disabled:!s.value.hpaEnabled,placeholder:"80"},null,8,ks),[[B,s.value.cpuThreshold,void 0,{number:!0}]])]),e("div",ws,[t[59]||(t[59]=e("label",{class:"form-label"},"Memory (%)",-1)),R(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":t[22]||(t[22]=p=>s.value.memoryThreshold=p),disabled:!s.value.hpaEnabled,placeholder:"80"},null,8,Cs),[[B,s.value.memoryThreshold,void 0,{number:!0}]])])])])])):q("",!0)],512),[[Te,g.value===3]]),R(e("div",null,[s.value.target==="VM"?(u(),m("div",$s,[e("div",Ss,[t[61]||(t[61]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",Is,[e("div",As,[t[60]||(t[60]=e("label",{class:"form-label"},"Port",-1)),R(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":t[23]||(t[23]=p=>s.value.defaultPort=p),placeholder:"80"},null,512),[[B,s.value.defaultPort,void 0,{number:!0}]])])])])])):q("",!0),s.value.target==="K8S"?(u(),m("div",Ts,[e("div",Ds,[t[67]||(t[67]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",Ns,[e("div",Ms,[t[66]||(t[66]=e("label",{class:"form-label"},"Port",-1)),(u(!0),m(H,null,j(f.value,(p,re)=>(u(),m("div",{class:"row g-2 mb-2",key:re},[e("div",Rs,[t[62]||(t[62]=e("label",{class:"form-label small"},"Target Port",-1)),R(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":Q=>p.targetPort=Q,placeholder:"80"},null,8,Es),[[B,p.targetPort,void 0,{number:!0}]])]),e("div",Us,[t[64]||(t[64]=e("label",{class:"form-label small"},"Protocol",-1)),R(e("select",{class:"form-select","onUpdate:modelValue":Q=>p.protocol=Q},t[63]||(t[63]=[e("option",{value:"TCP"},"TCP",-1),e("option",{value:"UDP"},"UDP",-1),e("option",{value:"SCTP"},"SCTP",-1)]),8,xs),[[pe,p.protocol]])]),e("div",Ls,[t[65]||(t[65]=e("label",{class:"form-label small"},"Host Port",-1)),R(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":Q=>p.hostPort=Q,placeholder:"8080"},null,8,Ps),[[B,p.hostPort,void 0,{number:!0}]])]),e("div",Vs,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:Q=>z(re),disabled:f.value.length<=1},"-",8,Os)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:M,style:{color:"gray"}},"+ Add Port Mapping")])])])])):q("",!0)],512),[[Te,g.value===4]])]),e("div",Bs,[e("a",{class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:Y}," Cancel "),e("div",Hs,[e("button",{class:"btn btn-outline-secondary",disabled:g.value===1,onClick:W},"Prev",8,Fs),g.value<4?(u(),m("button",{key:0,class:"btn btn-primary",disabled:!v.value,onClick:T},"Next",8,Gs)):(u(),m("button",{key:1,class:"btn btn-primary",disabled:!v.value,onClick:t[24]||(t[24]=p=>D.mode==="update"?ge():ue())},i(D.mode==="update"?"Update":"Create"),9,zs))])])])])],512))}}),qs=Ne(Ks,[["__scopeId","data-v-27f6f60a"]]),Ys={class:"modal-dialog",role:"document"},js={class:"modal-content"},Ws={class:"modal-body"},Js={class:"modal-footer"},Zs=["disabled"],Qs={key:0,class:"spinner-border spinner-border-sm me-2",role:"status"},Xs=ce({__name:"DeleteConfirmModal",props:{targetCatalog:{}},emits:["deleted","close"],setup(F,{expose:L,emit:G}){const D=F,E=G,C=ve(),g=h(!1),$=h(null),d=()=>{if($.value)try{const _=window.bootstrap;if(_&&_.Modal)new _.Modal($.value).show();else{$.value.classList.add("show"),$.value.style.display="block",document.body.classList.add("modal-open");const w=document.createElement("div");w.className="modal-backdrop fade show",w.id="delete-modal-backdrop",document.body.appendChild(w)}}catch(_){console.warn("Failed to show modal with Bootstrap, using fallback:",_),$.value.classList.add("show"),$.value.style.display="block",document.body.classList.add("modal-open")}},S=()=>{if($.value)try{const _=window.bootstrap;if(_&&_.Modal){const w=_.Modal.getInstance($.value);w?w.hide():N()}else N()}catch(_){console.warn("Failed to hide modal with Bootstrap, using fallback:",_),N()}},N=()=>{if($.value){$.value.classList.remove("show"),$.value.style.display="none",document.body.classList.remove("modal-open");const _=document.getElementById("delete-modal-backdrop");_&&_.remove(),E("close")}},b=async()=>{var _;if((_=D.targetCatalog)!=null&&_.id){g.value=!0;try{await ut(D.targetCatalog.id),C.success(`${D.targetCatalog.name} catalog has been successfully deleted.`),S(),E("deleted",D.targetCatalog.id)}catch(w){console.error("Delete failed:",w),C.error("Failed to delete catalog.")}finally{g.value=!1}}},y=()=>{E("close")};return ke(()=>{$.value&&$.value.addEventListener("hidden.bs.modal",y)}),Ye(()=>{$.value&&$.value.removeEventListener("hidden.bs.modal",y)}),L({show:d,hide:S}),(_,w)=>(u(),m("div",{class:"modal fade",id:"deleteConfirmModal",tabindex:"-1",ref_key:"deleteModal",ref:$,onClick:_e(S,["self"])},[e("div",Ys,[e("div",js,[e("div",{class:"modal-header"},[w[0]||(w[0]=e("h5",{class:"modal-title"},"Confirm Catalog Deletion",-1)),e("button",{type:"button",class:"btn-close",onClick:S,"aria-label":"Close"})]),e("div",Ws,[e("p",null,[w[1]||(w[1]=ae("Are you sure you want to delete ")),e("strong",null,i(_.targetCatalog.name),1),ae(" ("+i(_.targetCatalog.category)+") catalog?",1)]),w[2]||(w[2]=e("p",{class:"text-muted"},"This action cannot be undone.",-1))]),e("div",Js,[e("button",{type:"button",class:"btn btn-secondary",onClick:S},"Cancel"),e("button",{type:"button",class:"btn btn-danger",onClick:b,disabled:g.value},[g.value?(u(),m("span",Qs)):q("",!0),ae(" "+i(g.value?"Deleting...":"Delete"),1)],8,Zs)])])])],512))}}),en={class:"modal-content"},tn={class:"modal-body"},an={class:"row"},ln={class:"col-lg-12"},on={class:"mb-3"},sn={class:"row"},nn={class:"col-lg-12"},dn={class:"mb-3"},rn={class:"row"},cn={class:"col-lg-12"},un={class:"mb-3"},mn=["value"],pn={class:"modal-footer"},vn=ce({__name:"uploadForm",props:{sourceData:{}},emits:["uploaded","close"],setup(F,{expose:L,emit:G}){const D=ve(),E=F,C=G,g=h({path:"",sourceType:"",name:"",tag:""});De(()=>{var f,v;return[(f=E.sourceData)==null?void 0:f.sourceType,(v=E.sourceData)==null?void 0:v.name]},()=>{var f,v,T,W,Y;(f=E.sourceData)!=null&&f.sourceType&&(g.value.sourceType=(v=E.sourceData)==null?void 0:v.sourceType),(T=E.sourceData)!=null&&T.name&&(g.value.name=(W=E.sourceData)==null?void 0:W.name,console.log(g.value.sourceType),g.value.sourceType.toUpperCase()=="DOCKERHUB"?S((Y=E.sourceData)==null?void 0:Y.name):g.value.sourceType.toUpperCase()=="ARTIFACTHUB"&&N(E.sourceData))},{immediate:!0});const $=h([]);Fe(()=>{d()});const d=()=>{g.value={path:"",sourceType:"",name:"",tag:""},$.value=[]},S=async f=>{var W;const v={path:((W=E.sourceData)==null?void 0:W.id)||""},{data:T}=await mt(v);$.value=[],T.length>0&&T.forEach(Y=>{$.value.push({key:Y.name,value:Y.name})})},N=async f=>{console.log("sourceData",f);const v={kind:"helm",repository:f.repository.name,packageName:f.name},{data:T}=await pt(v);$.value=[],T.length>0&&T.forEach(W=>{$.value.push({key:W.version,value:W.version})})},b=()=>{if(!g.value.tag.trim()){D.error("Tag is required.");return}const f=je.cloneDeep(E.sourceData);f.tag=g.value.tag,f.sourceType=g.value.sourceType,f.name=g.value.name,C("uploaded",f),d(),s()},y=()=>{s()},_=()=>{d();const f=document.getElementById("upload-form-modal");if(f)try{const v=window.bootstrap;v&&v.Modal?new v.Modal(f).show():w()}catch(v){console.warn("Failed to show modal with Bootstrap, using fallback:",v),w()}},w=()=>{const f=document.getElementById("upload-form-modal");if(f){document.querySelectorAll(".modal-backdrop").forEach(W=>W.remove()),f.classList.add("show"),f.style.display="block",f.style.opacity="1",f.setAttribute("aria-hidden","false"),document.body.classList.add("modal-open");const T=document.createElement("div");T.className="modal-backdrop fade show",T.id="upload-modal-backdrop",document.body.appendChild(T)}},s=()=>{const f=document.getElementById("upload-form-modal");if(f)try{const v=window.bootstrap;if(v&&v.Modal){const T=v.Modal.getInstance(f);T?T.hide():A()}else A()}catch(v){console.warn("Failed to hide modal with Bootstrap, using fallback:",v),A()}},A=()=>{const f=document.getElementById("upload-form-modal");f&&(f.classList.remove("show","fade","in"),f.style.display="none",f.style.opacity="0",f.setAttribute("aria-hidden","true"),document.body.classList.remove("modal-open"),document.body.style.overflow="",document.body.style.paddingRight="",document.querySelectorAll(".modal-backdrop, #upload-modal-backdrop").forEach(T=>T.remove()),C("close"))};return Fe(()=>{d()}),L({show:_,hide:s}),(f,v)=>(u(),m("div",{class:"modal modal-blur fade",id:"upload-form-modal",tabindex:"-1",role:"dialog","aria-hidden":"true",onClick:y},[e("div",{class:"modal-dialog modal-lg modal-dialog-centered",role:"document",onClick:v[3]||(v[3]=_e(()=>{},["stop"]))},[e("div",en,[e("div",{class:"modal-header"},[v[4]||(v[4]=e("h5",{class:"modal-title"},"Upload Application",-1)),e("button",{type:"button",class:"btn-close",onClick:s,"aria-label":"Close"})]),e("div",tn,[e("form",{onSubmit:_e(b,["prevent"])},[e("div",an,[e("div",ln,[e("div",on,[v[5]||(v[5]=e("label",{class:"form-label"},"Source Type",-1)),R(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v[0]||(v[0]=T=>g.value.sourceType=T),disabled:""},null,512),[[B,g.value.sourceType]])])])]),e("div",sn,[e("div",nn,[e("div",dn,[v[6]||(v[6]=e("label",{class:"form-label"},"Name",-1)),R(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v[1]||(v[1]=T=>g.value.name=T),disabled:""},null,512),[[B,g.value.name]])])])]),e("div",rn,[e("div",cn,[e("div",un,[v[8]||(v[8]=e("label",{class:"form-label"},[ae("Tag "),e("span",{class:"text-red"},"*")],-1)),R(e("select",{class:"form-select","onUpdate:modelValue":v[2]||(v[2]=T=>g.value.tag=T)},[v[7]||(v[7]=e("option",{value:""},"Select Tag",-1)),(u(!0),m(H,null,j($.value,T=>(u(),m("option",{value:T.value,key:T.key},i(T.value),9,mn))),128))],512),[[pe,g.value.tag]]),v[9]||(v[9]=e("small",{class:"form-hint"},"Please enter the tag for this catalog.",-1))])])])],32)]),e("div",pn,[e("button",{type:"button",class:"btn btn-link link-secondary",onClick:s}," Cancel "),e("button",{type:"submit",class:"btn btn-primary ms-auto",onClick:b},[V(Z(Lt),{class:"icon"}),v[10]||(v[10]=ae(" Upload "))])])])])]))}}),gn=Ne(vn,[["__scopeId","data-v-550ff2f5"]]),bn={ref:"sofwareCatalog"},fn={class:"row"},yn={class:"col-lg-9"},hn={class:"card"},_n={class:"list-group card-list-group",id:"sc-list-group"},kn={class:"row g-2 align-items-center"},wn={class:"col-auto me-3"},Cn=["src","onError"],$n={key:1,class:"rounded catalog-icon-fallback d-flex align-items-center justify-content-center"},Sn=["onClick"],In={class:"text-muted"},An=["onClick"],Tn={class:"text-muted",style:{width:"auto","text-align":"right"}},Dn={style:{color:"#e5b942"}},Nn={style:{color:"#e5b942"}},Mn={class:"text-muted",style:{width:"80px","text-align":"right"}},Rn={style:{color:"gray"}},En={class:"col-3 text-muted"},Un={class:"d-flex justify-content-end"},xn={class:"mouse-hover"},Ln=["onClick"],Pn={class:"text-muted"},Vn=["id"],On={class:"accordion-body pt-0"},Bn=["innerHTML"],Hn=["id"],Fn=["onClick"],Gn=["id"],zn=["id"],Kn={class:"btn btn-sm",style:{"margin-right":"5px"}},qn={class:"btn btn-sm",style:{"margin-right":"5px"}},Yn={class:"btn btn-sm",style:{"margin-right":"5px"}},jn={class:"mt-4"},Wn={class:"d-flex justify-content-between align-items-center mb-2"},Jn=["disabled","onClick"],Zn={key:0,class:"text-center text-muted py-3"},Qn={key:1,class:"table-responsive"},Xn={class:"table table-sm table-vcenter"},ei={key:0},ti={class:"text-end"},ai=["disabled","onClick"],li={class:"col-lg-3"},oi={class:"input-icon mb-3"},si={class:"input-icon-addon"},ni={key:0,class:"col-md-6 col-lg-12",id:"resultDockerHubEmpty"},ii={key:1,class:"row row-cards",id:"resultDockerHubSearch"},di={class:"card"},ri={class:"row row-0"},ci={class:"col-auto"},ui=["src"],mi={class:"col"},pi={class:"card-body"},vi=["href"],gi={class:"text-muted"},bi={class:"col-auto lh-1"},fi={class:"d-flex justify-content-end me-2 mt-4 mouse-hover"},yi={class:"mt-5"},hi={key:0,class:"col-md-6 col-lg-12",id:"resultArtifactHubEmpty"},_i={key:1,class:"row row-cards",id:"resultArtifactHubSearch"},ki={class:"card"},wi={class:"row row-0"},Ci={class:"col"},$i={class:"card-body"},Si=["href"],Ii={class:"text-muted"},Ai={class:"col-auto lh-1"},Ti={class:"d-flex justify-content-end me-2 mt-4 mouse-hover"},Di=ce({__name:"softwareCatalogList",setup(F){const L=ve(),G=h([]),D=h(null),E=h(null),C=h({}),g=h("new"),$=h({}),d=h(""),S=h({}),N=h(null),b=h(null),y=h({}),_=h(null),w=h(""),s=h([]),A=h([]),f=h(0),v=h(null),T=h("");ke(async()=>{w.value="",Y(),document.addEventListener("click",a=>{a.target.closest(".dropdown")||(T.value="")})});const W=()=>{Y(),g.value="new",E.value=null,C.value={},D.value=0,$.value={},d.value="",setTimeout(()=>{_.value&&typeof _.value.initForCreate=="function"&&_.value.initForCreate()},100)},Y=async()=>{try{await vt(w.value).then(({data:a})=>{je.forEach(a,function(n){n.refData=se(n.catalogRefs),n.isShow=!1,n.deploymentStatuses=[],n.deploymentStatusLoaded=!1,n.deploymentStatusLoading=!1,n.resolvedLogoUrl=Me(n),n.logoLoadFailed=!1}),G.value=a})}catch(a){console.log(a),L.error("Unable to retrieve data.")}},se=a=>a.reduce((n,r)=>(n[r.refType]||(n[r.refType]=[]),n[r.refType].push(r),n),{}),I=async a=>{a.keyCode==13&&(await M(),await z())},M=async()=>{s.value=[];try{const{data:a}=await gt(w.value);if(a.results.length>0)for(let n=0;n<3;n++)s.value.push(a.results[n])}catch(a){console.log(a),L.error("Unable to retrieve data.")}},z=async()=>{A.value=[];try{const{data:a}=await bt(w.value);if(a.packages.length>0)for(let n=0;n<3;n++)A.value.push(a.packages[n])}catch(a){console.log(a),L.error("Unable to retrieve data.")}},X=a=>{const n=G.value.find(r=>r.id===a);E.value=a,C.value=n||{},g.value="update",setTimeout(()=>{_.value&&typeof _.value.initForUpdate=="function"&&_.value.initForUpdate(a,n)},100)},ue=a=>{S.value=a,N.value&&N.value.show()},ge=async a=>{await Y()},ne=()=>{S.value={}},ie=async a=>{const n=G.value[a];n.isShow=!n.isShow,n.isShow&&!n.deploymentStatusLoaded&&await J(n)},J=async a=>{if(a!=null&&a.id){a.deploymentStatusLoading=!0;try{const{data:n}=await _t(a.id);a.deploymentStatuses=be(n),a.deploymentStatusLoaded=!0}catch(n){console.log(n),a.deploymentStatuses=[],L.error("Unable to retrieve deployment status.")}finally{a.deploymentStatusLoading=!1}}},be=a=>{const n=Array.isArray(a==null?void 0:a.deploymentHistories)?a.deploymentHistories:[];return(Array.isArray(a==null?void 0:a.applicationStatuses)?a.applicationStatuses:[]).map((x,U)=>{const l=fe(x,n);return me(l,x,`status-${x.id||U}`)})},fe=(a,n)=>{if(!a)return null;const r=n.find(x=>a.deploymentHistoryId&&String(a.deploymentHistoryId)===String(x.id));return r||n.find(x=>ye(a.deploymentType,x.deploymentType)&&ye(a.namespace,x.namespace)&&(ye(a.vmId,x.vmId)||ye(a.clusterName,x.clusterName)))},me=(a,n,r)=>({rowKey:r,deploymentId:(n==null?void 0:n.deploymentHistoryId)||(a==null?void 0:a.id)||null,deploymentType:ee((n==null?void 0:n.deploymentType)||(a==null?void 0:a.deploymentType)),target:ee(he(a,n)),csp:ee(a==null?void 0:a.cloudProvider),status:ee((n==null?void 0:n.status)||(n==null?void 0:n.podStatus)),ipOrEndpoint:ee(le(a,n)),lastCheckedOrDeployedAt:ee(we(n==null?void 0:n.checkedAt))}),he=(a,n)=>{const r=(n==null?void 0:n.deploymentType)||(a==null?void 0:a.deploymentType),x=(n==null?void 0:n.namespace)||(a==null?void 0:a.namespace),U=(n==null?void 0:n.mciId)||(a==null?void 0:a.mciId),l=(n==null?void 0:n.vmId)||(a==null?void 0:a.vmId),o=(n==null?void 0:n.clusterName)||(a==null?void 0:a.clusterName);return r==="VM"?[x,U,l].filter(Boolean).join(" / "):r==="K8S"?[x,o].filter(Boolean).join(" / "):[x,U,l,o].filter(Boolean).join(" / ")},le=(a,n)=>{const r=(n==null?void 0:n.publicIp)||(a==null?void 0:a.publicIp),x=(n==null?void 0:n.servicePort)||(a==null?void 0:a.servicePort),U=a==null?void 0:a.ingressHost,l=a==null?void 0:a.ingressPath;return r&&x?`${r}:${x}`:r||(U&&l?`${U}${l}`:U||"")},ee=a=>a==null||a===""?"-":a,ye=(a,n)=>!a||!n?!1:String(a)===String(n),we=a=>{if(!a)return"";const n=new Date(a);return Number.isNaN(n.getTime())?a:n.toLocaleString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})},k=a=>{if(!a)return;f.value=a;const n=document.getElementById("application-detail-modal");if(n)try{window.bootstrap&&window.bootstrap.Modal?new window.bootstrap.Modal(n).show():(n.style.display="block",n.classList.add("show"),document.body.classList.add("modal-open")),setTimeout(()=>{v.value&&v.value.refreshData(f.value)},100)}catch(r){console.error("Error opening detail modal:",r)}},t=(a,n)=>Object.prototype.hasOwnProperty.call(a,n),p=a=>{window.open(a)},re={"apache tomcat":"/catalog-icons/apache-tomcat.png",redis:"/catalog-icons/redis.svg",nginx:"/catalog-icons/nginx.svg","apache http server":"/catalog-icons/apache-http-server.svg","nexus repository":"/catalog-icons/nexus-repository.svg",mariadb:"/catalog-icons/mariadb.svg",grafana:"/catalog-icons/grafana.svg",prometheus:"/catalog-icons/prometheus.svg",elasticsearch:"/catalog-icons/elasticsearch.svg"},Q=a=>String(a||"").trim().toLowerCase(),Ce=a=>re[Q(a==null?void 0:a.name)]||"",Me=a=>Ce(a)||(a==null?void 0:a.logoUrlLarge)||(a==null?void 0:a.logoUrlSmall)||"",$e=a=>{const n=Ce(a);if(n&&a.resolvedLogoUrl!==n){a.resolvedLogoUrl=n,a.logoLoadFailed=!1;return}a.logoLoadFailed=!0},Se=a=>a.replace(/\\n|\n/g,"
"),Ie=(a,n)=>{y.value=a,y.value.sourceType=n,b.value&&b.value.show()},Ae=async a=>{a.sourceType=="DockerHub"?(a.createdAt=a.created_at,a.updatedAt=a.updated_at,a.shortDescription=a.short_description,a.starCount=a.star_count,a.ratePlans=a.rate_plans,delete a.created_at,delete a.updated_at,delete a.short_description,delete a.star_count,delete a.rate_plans,await ft(a)):a.sourceType=="ArtifactHub"&&await yt(a),L.success("Software catalog uploaded successfully!")},Re=()=>{y.value={sourceType:"",name:"",sourceData:{}}};return(a,n)=>(u(),m(H,null,[e("div",bn,[e("div",{class:"d-flex justify-content-between align-items-center mb-3"},[n[1]||(n[1]=e("h2",{class:"mb-0"},"Catalog",-1)),e("button",{class:"btn btn-outline-primary d-none d-sm-inline-block",style:{"margin-right":"315px"},"data-bs-toggle":"modal","data-bs-target":"#modal-wizard",onClick:W}," Regist ")]),e("div",fn,[e("div",yn,[e("div",hn,[e("div",_n,[(u(!0),m(H,null,j(G.value,(r,x)=>(u(),m("div",{class:"list-group-item pe-1",key:x},[e("div",kn,[e("div",wn,[r.resolvedLogoUrl&&!r.logoLoadFailed?(u(),m("img",{key:0,src:r.resolvedLogoUrl,class:"rounded catalog-icon",alt:"Catalog Icon",width:"40",height:"40",onError:U=>$e(r)},null,40,Cn)):(u(),m("div",$n,[V(Z(We),{class:"icon",size:"22","stroke-width":"1.75"})]))]),e("div",{class:"col-5",onClick:U=>ie(x)},[ae(i(r.name)+" ",1),e("div",In,i(r.summary),1)],8,Sn),e("div",{class:"col-3 d-flex justify-content-end",onClick:U=>ie(x)},[e("span",Tn,[V(Z(Pt),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"#e5b942"}),e("span",Dn,i(r.averageRating||0),1),e("span",Nn," ("+i(r.ratingCount||0)+") ",1)]),e("span",Mn,[V(Z(Rt),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"gray"}),e("span",Rn,i(r.downloadCount||0),1)])],8,An),e("div",En,[e("div",Un,[e("div",xn,[V(Z(Et),{class:"me-2 cursor-pointer",size:"15","stroke-width":"2","data-bs-toggle":"modal","data-bs-target":"#modal-wizard",onClick:U=>X(r.id)},null,8,["onClick"]),V(Z(xt),{class:"cursor-pointer",size:"15","stroke-width":"2",onClick:U=>ue(r)},null,8,["onClick"])])]),e("div",{class:"d-flex justify-content-end",onClick:U=>ie(x)},[e("span",Pn,i(r.category.length>25?r.category.substring(0,25)+"...":r.category),1)],8,Ln)]),e("div",{id:"accordion_"+r.id,class:"accordion-collapse collapse",style:St([r.isShow?{display:"block"}:{display:"none"}])},[e("div",On,[e("div",{class:"mt-3 mb-5",innerHTML:Se(r.description)},null,8,Bn),e("div",null,[n[5]||(n[5]=e("strong",null,"Ref Information",-1)),e("ul",{id:`${x}-entity-ul`},[t(r.refData,"HOMEPAGE")?(u(!0),m(H,{key:0},j(r.refData.HOMEPAGE,(U,l)=>(u(),m("li",{key:l},[e("a",{class:"btn",onClick:o=>p(U.refValue)},i(U.refValue),9,Fn)]))),128)):q("",!0)],8,Hn),n[6]||(n[6]=e("strong",null,"TAGS",-1)),e("ul",{id:`${x}-tag-ul`},[t(r.refData,"TAG")?(u(!0),m(H,{key:0},j(r.refData.TAG,(U,l)=>(u(),m("span",{key:l},"#"+i(U.refValue)+"  ",1))),128)):q("",!0)],8,Gn),n[7]||(n[7]=e("strong",null,"Recommended Spec",-1)),e("ul",{id:`${x}-tag-ul`},[r.recommendedCpu&&r.recommendedMemory&&r.recommendedDisk?(u(),m(H,{key:0},[e("button",Kn," CPU : "+i(r.recommendedCpu)+" Core ",1),e("button",qn," MEMORY : "+i(r.recommendedMemory)+" GB ",1),e("button",Yn," DISK : "+i(r.recommendedDisk)+" GB ",1)],64)):q("",!0)],8,zn),e("div",jn,[e("div",Wn,[n[2]||(n[2]=e("strong",null,"Deployment Status",-1)),e("button",{type:"button",class:"btn btn-sm btn-icon btn-ghost-secondary",title:"Refresh deployment status","aria-label":"Refresh deployment status",disabled:r.deploymentStatusLoading,onClick:_e(U=>J(r),["stop"])},[V(Z(Je),{class:"icon",size:"18","stroke-width":"1.75"})],8,Jn)]),r.deploymentStatusLoading?(u(),m("div",Zn," Loading deployment status... ")):(u(),m("div",Qn,[e("table",Xn,[n[4]||(n[4]=e("thead",null,[e("tr",null,[e("th",null,"Type"),e("th",null,"Target"),e("th",null,"CSP"),e("th",null,"Status"),e("th",null,"IP/Endpoint"),e("th",null,"Last Checked"),e("th",{class:"text-end"},"Detail")])],-1)),e("tbody",null,[r.deploymentStatuses.length===0?(u(),m("tr",ei,n[3]||(n[3]=[e("td",{colspan:"7",class:"text-center text-muted"}," No deployment status available ",-1)]))):q("",!0),(u(!0),m(H,null,j(r.deploymentStatuses,U=>(u(),m("tr",{key:U.rowKey},[e("td",null,i(U.deploymentType),1),e("td",null,i(U.target),1),e("td",null,i(U.csp),1),e("td",null,[e("span",{class:K(Z(Le)(U.status))},i(Z(xe)(U.status)),3)]),e("td",null,i(U.ipOrEndpoint),1),e("td",null,i(U.lastCheckedOrDeployedAt),1),e("td",ti,[e("button",{type:"button",class:"btn btn-outline-primary",disabled:!U.deploymentId,onClick:_e(l=>k(U.deploymentId),["stop"])}," Detail ",8,ai)])]))),128))])])]))])])])],12,Vn)])]))),128))])])]),e("div",li,[e("div",oi,[e("span",si,[V(Z(ht),{class:"icon",width:"24",height:"24","stroke-width":"2"})]),R(e("input",{type:"text",class:"form-control",placeholder:"Search…",onKeypress:I,"onUpdate:modelValue":n[0]||(n[0]=r=>w.value=r),id:"inputCatalogSearch"},null,544),[[B,w.value]])]),n[10]||(n[10]=e("h3",{class:"mb-3"}," DOCKERHUB ",-1)),s.value.length<=0?(u(),m("div",ni," There are no related Container Images found. ")):q("",!0),s.value.length>0?(u(),m("div",ii,[(u(!0),m(H,null,j(s.value,(r,x)=>(u(),m("div",{class:"col-md-6 col-lg-12",key:x},[e("div",di,[e("div",ri,[e("div",ci,[e("img",{src:r.logo_url.large,class:"rounded-start ms-2",alt:"Shape of You",width:"80",height:"80"},null,8,ui)]),e("div",mi,[e("div",pi,[e("a",{href:"https://hub.docker.com/search?q="+w.value,target:"_blank"},i(r==null?void 0:r.name),9,vi),e("div",gi,i((r==null?void 0:r.short_description.length)>30?(r==null?void 0:r.short_description.substring(0,30))+"...":""),1)])]),e("div",bi,[e("div",fi,[V(Z(ze),{class:"cursor-pointer",size:"20","stroke-width":"2",onClick:U=>Ie(r,"DockerHub")},null,8,["onClick"])])])])])]))),128))])):q("",!0),e("div",yi,[n[9]||(n[9]=e("h3",{class:"mb-3"}," ARTIFACTHUB ",-1)),A.value.length<=0?(u(),m("div",hi," There are no related Helm Charts found. ")):q("",!0),A.value.length>0?(u(),m("div",_i,[(u(!0),m(H,null,j(A.value,(r,x)=>(u(),m("div",{class:"col-md-6 col-lg-12",key:x},[e("div",ki,[e("div",wi,[n[8]||(n[8]=e("div",{class:"col-auto"},[e("img",{src:"https://artifacthub.io/static/media/placeholder_pkg_helm.png",class:"rounded-start",alt:"Shape of You",width:"80",height:"80"})],-1)),e("div",Ci,[e("div",$i,[e("a",{href:"https://artifacthub.io/packages/search?ts_query_web="+w.value+"&sort=relevance&page=1",target:"_blank"},i(r==null?void 0:r.name),9,Si),e("div",Ii,i((r==null?void 0:r.description.length)>30?(r==null?void 0:r.description.substring(0,30))+"...":""),1)])]),e("div",Ai,[e("div",Ti,[V(Z(ze),{class:"cursor-pointer",size:"20","stroke-width":"2",onClick:U=>Ie(r,"ArtifactHub")},null,8,["onClick"])])])])])]))),128))])):q("",!0)])])])],512),V(Xs,{ref_key:"deleteConfirmModal",ref:N,"target-catalog":S.value,onDeleted:ge,onClose:ne},null,8,["target-catalog"]),V(qs,{ref_key:"wizardModal",ref:_,mode:g.value,onCreated:Y,onUpdated:Y},null,8,["mode"]),V(gn,{ref_key:"uploadFormModal",ref:b,"source-data":y.value,onUploaded:Ae,onClose:Re},null,8,["source-data"]),V(Ze,{ref_key:"applicationDetailModalRef",ref:v,"deployment-id":f.value},null,8,["deployment-id"])],64))}}),Ni={class:"page",ref:"sofwareCatalog"},Mi={class:"page-wrapper"},Ri={class:"page-header d-print-none"},Ei={class:"container-xxl"},Ui={class:"row g-2 align-items-center"},xi={class:"col-auto ms-auto"},Li={class:"page-body"},Pi={class:"container-xxl"},Vi={class:"row"},Oi={class:"col-lg-12"},Bi={class:"card"},Hi={class:"card-header"},Fi={class:"nav nav-tabs card-header-tabs","data-bs-toggle":"tabs"},Gi={class:"nav-item"},zi={href:"#tabs-catalog",class:"nav-link active","data-bs-toggle":"tab"},Ki={class:"nav-item"},qi={class:"nav-item"},Yi={href:"#tabs-repository",class:"nav-link","data-bs-toggle":"tab"},ji={class:"card-body"},Wi={class:"tab-content"},Ji={class:"tab-pane active show",id:"tabs-catalog"},Zi={class:"tab-pane",id:"tabs-status"},Qi={class:"tab-pane",id:"tabs-repository"},cd=ce({__name:"SoftwareCatalog",setup(F){const L=It(),G=h(""),D=h(""),E=h(!1),C=h(""),g=h(null);ke(async()=>{G.value=L.getNsId()});const $=b=>{D.value=b},d=async()=>{var b;await At(),(b=g.value)==null||b.refresh()},S=b=>{C.value=b,E.value=!0},N=()=>{E.value=!1,C.value=""};return(b,y)=>(u(),m(H,null,[e("div",Ni,[e("div",Mi,[e("div",Ri,[e("div",Ei,[e("div",Ui,[y[1]||(y[1]=e("div",{class:"col d-flex"},[e("h2",{class:"page-title"},"Software Catalog")],-1)),e("div",xi,[e("button",{class:"btn btn-outline-primary d-none d-sm-inline-block","data-bs-toggle":"modal","data-bs-target":"#install-form",onClick:y[0]||(y[0]=_=>$("Application Installation"))}," DEPLOY ")])])])]),e("div",Li,[e("div",Pi,[e("div",Vi,[e("div",Oi,[e("div",Bi,[e("div",Hi,[e("ul",Fi,[e("li",Gi,[e("a",zi,[V(Z(Mt),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[2]||(y[2]=ae(" Catalog "))])]),e("li",Ki,[e("a",{href:"#tabs-status",class:"nav-link","data-bs-toggle":"tab",onClick:d},[V(Z(Nt),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[3]||(y[3]=ae(" Apps Status "))])]),e("li",qi,[e("a",Yi,[V(Z(Ut),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[4]||(y[4]=ae(" Repository "))])])])]),e("div",ji,[e("div",Wi,[e("div",Ji,[e("div",null,[V(Di,{nsId:G.value},null,8,["nsId"])])]),e("div",Zi,[e("div",null,[V(no,{ref_key:"applicationStatusListRef",ref:g},null,512)])]),e("div",Qi,[e("div",null,[E.value?(u(),Ge(Dt,{key:1,embedded:!0,"repository-name":C.value,onBackToList:N},null,8,["repository-name"])):(u(),Ge(Tt,{key:0,embedded:!0,onOpenDetail:S}))])])])])])])])])])])],512),V(kt,{"ns-id":G.value,title:D.value},null,8,["ns-id","title"])],64))}});export{cd as default}; diff --git a/src/main/resources/static/assets/SoftwareCatalog-CNyPg-7j.js b/src/main/resources/static/assets/SoftwareCatalog-CNyPg-7j.js new file mode 100644 index 00000000..1fd750be --- /dev/null +++ b/src/main/resources/static/assets/SoftwareCatalog-CNyPg-7j.js @@ -0,0 +1,112 @@ +import{c as re}from"./IconPlus-DRtzYi91.js";import{g as Ze,r as Qe,s as et,a as tt,b as Be,c as at,d as lt,e as ot,f as st,h as nt,u as it,i as dt,j as rt,k as ct,l as ut,m as mt,n as pt,o as vt,p as gt,q as bt,t as ft,v as yt,I as ht,w as _t,A as kt}from"./softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-Dn3T2TCo.js";import{_ as St}from"./Tabulator.vue_vue_type_style_index_0_lang-Cy0Pje7A.js";import{d as ue,u as ge,c as te,r as h,h as u,a as m,b as e,l as ae,t as i,j as Y,e as M,v as ve,F as G,f as X,g as B,m as _e,n as q,k as qe,i as V,p as Z,q as wt,o as ke,s as Ye,w as Re,x as Ae,y as Ge,z as Ct,A as He,B as $t,C as It,D as Fe,E as Tt}from"./index-DpY2Dwv5.js";import{_ as Ne}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as je}from"./lodash-CJvlDKzA.js";import{_ as At}from"./RepositoryList.vue_vue_type_script_setup_true_lang-CuWQGniu.js";import{_ as Rt}from"./RepositoryDetail.vue_vue_type_script_setup_true_lang-Bb5umCXR.js";import"./request-BI8njqPY.js";import"./bootstrap.esm-D2DynUsO.js";import"./repository-Cuw5n13K.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Nt=re("outline","activity-heartbeat","IconActivityHeartbeat",[["path",{d:"M3 12h4.5l1.5 -6l4 12l2 -9l1.5 3h4.5",key:"svg-0"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Et=re("outline","apps","IconApps",[["path",{d:"M4 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M14 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-2"}],["path",{d:"M14 7l6 0",key:"svg-3"}],["path",{d:"M17 4l0 6",key:"svg-4"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Mt=re("outline","cloud-download","IconCloudDownload",[["path",{d:"M19 18a3.5 3.5 0 0 0 0 -7h-1a5 4.5 0 0 0 -11 -2a4.6 4.4 0 0 0 -2.1 8.4",key:"svg-0"}],["path",{d:"M12 13l0 9",key:"svg-1"}],["path",{d:"M9 19l3 3l3 -3",key:"svg-2"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var ze=re("outline","download","IconDownload",[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Dt=re("outline","edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Ut=re("outline","folder","IconFolder",[["path",{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2",key:"svg-0"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var We=re("outline","package","IconPackage",[["path",{d:"M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5",key:"svg-0"}],["path",{d:"M12 12l8 -4.5",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}],["path",{d:"M12 12l-8 -4.5",key:"svg-3"}],["path",{d:"M16 5.25l-8 4.5",key:"svg-4"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Xe=re("outline","refresh","IconRefresh",[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var xt=re("outline","trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Pt=re("outline","upload","IconUpload",[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Lt=re("filled","star-filled","IconStarFilled",[["path",{d:"M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z",key:"svg-0"}]]);const Vt={class:"modal",id:"action-confirm",tabindex:"-1"},Ot={class:"modal-dialog modal-lg",role:"document"},Bt={class:"modal-content"},Gt={class:"modal-header"},Ht={class:"modal-title"},Ft={key:0},zt={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},Kt={class:"mb-3"},qt=["value"],Yt={class:"mb-3"},jt={class:"modal-footer d-flex justify-content-between"},Wt=ue({__name:"applicationActionConfirm",props:{title:{},applicationStatusId:{},type:{},applicationName:{}},emits:["getApplicationsStatusList"],setup(H,{expose:P,emit:F}){const R=ge(),D=H,w=F,b=te(()=>D.title),C=te(()=>D.applicationStatusId),d=te(()=>D.type),$=h(""),N=h(""),f=()=>{$.value="",N.value=""},y=h([]),_=async s=>{const{data:T}=await Ze(s);y.value=T},S=async()=>{var T,v;const s={operation:b.value,applicationStatusId:C.value,reason:$.value,detailReason:N.value};try{const{data:g}=await Qe(s),A=g;A&&A.success!==!1&&!A.error?R.success(`${b.value} Action SUCCESS`):R.error((A==null?void 0:A.error)||`${b.value} Action FAIL`)}catch(g){R.error(((v=(T=g==null?void 0:g.response)==null?void 0:T.data)==null?void 0:v.message)||(g==null?void 0:g.message)||`${b.value} Action FAIL`)}finally{w("getApplicationsStatusList")}};return P({setInit:f,_getReasonList:_}),(s,T)=>(u(),m("div",Vt,[e("div",Ot,[e("div",Bt,[e("div",Gt,[e("h5",Ht,[ae(i(s.applicationName)+" "+i(b.value)+" ",1),d.value?(u(),m("span",Ft,"("+i(d.value)+")",1)):Y("",!0)]),e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close",onClick:f})]),e("div",zt,[e("div",Kt,[T[3]||(T[3]=e("label",{class:"form-label"},"Reason",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":T[0]||(T[0]=v=>$.value=v)},[T[2]||(T[2]=e("option",{value:""},"Select Reason",-1)),(u(!0),m(G,null,X(y.value,v=>(u(),m("option",{value:v.label,key:v.label},i(v.label),9,qt))),128))],512),[[ve,$.value]])]),e("div",Yt,[T[4]||(T[4]=e("label",{class:"form-label"},"Detail Reason",-1)),T[5]||(T[5]=e("p",{class:"text-muted"}," Please enter a detail reason ",-1)),M(e("textarea",{class:"form-control",rows:"10",placeholder:"Detail Reason","onUpdate:modelValue":T[1]||(T[1]=v=>N.value=v)},null,512),[[B,N.value]])])]),e("div",jt,[e("a",{class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:f}," Cancel "),e("div",null,[e("button",{class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:S},i(b.value),1)])])])])]))}}),Xt={class:"modal modal-blur fade",id:"rating-modal",tabindex:"-1",role:"dialog","aria-hidden":"true"},Jt={class:"modal-dialog modal-dialog-centered",role:"document"},Zt={class:"modal-content"},Qt={class:"modal-body"},ea={class:"mb-3"},ta={class:"rating-stars"},aa=["onClick"],la={class:"mb-3"},oa={class:"mb-3"},sa={class:"mb-3"},na={class:"mb-3"},ia={class:"modal-footer"},da=["disabled"],ra=ue({__name:"applicationRatingModal",props:{catalogId:{},applicationName:{}},emits:["ratingSubmitted"],setup(H,{emit:P}){const F=H,R=P,D=ge(),w=h({rating:0,category:"",detailedComments:"",name:"",email:""}),b=f=>{w.value.rating=f},C=te(()=>w.value.rating>0&&w.value.category&&w.value.detailedComments&&w.value.name&&w.value.email),d=()=>{w.value={rating:0,category:"",detailedComments:"",name:"",email:""}},$=()=>{const f=document.getElementById("rating-modal");if(f)try{if(window.bootstrap&&window.bootstrap.Modal){const y=window.bootstrap.Modal.getInstance(f);y?y.hide():new window.bootstrap.Modal(f).hide()}else f.style.display="none",f.classList.remove("show"),f.setAttribute("aria-hidden","true"),f.removeAttribute("aria-modal"),document.body.classList.remove("modal-open"),document.querySelectorAll(".modal-backdrop").forEach(_=>_.remove()),document.body.style.overflow="",document.body.style.paddingRight=""}catch(y){console.error("Error closing modal:",y),f.style.display="none",f.classList.remove("show"),document.body.classList.remove("modal-open"),document.querySelectorAll(".modal-backdrop").forEach(S=>S.remove())}},N=async()=>{if(!C.value){D.error("Please fill in all fields");return}try{const f={catalogId:F.catalogId,rating:w.value.rating,category:w.value.category,detailedComments:w.value.detailedComments,name:w.value.name,email:w.value.email,metadata:JSON.stringify({version:"1.0.0",environment:"production",applicationName:F.applicationName})};await et(f)&&(D.success("Rating submitted successfully"),d(),R("ratingSubmitted"),$())}catch(f){console.error("Rating submission error:",f),D.error("Failed to submit rating")}};return(f,y)=>(u(),m("div",Xt,[e("div",Jt,[e("div",Zt,[y[11]||(y[11]=e("div",{class:"modal-header"},[e("h5",{class:"modal-title"},"Application Rating"),e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),e("div",Qt,[e("form",{onSubmit:_e(N,["prevent"])},[e("div",ea,[y[4]||(y[4]=e("label",{class:"form-label"},"Overall Rating",-1)),e("div",ta,[(u(),m(G,null,X(5,_=>e("span",{key:_,class:q(["star",{active:_<=w.value.rating}]),onClick:S=>b(_)}," ★ ",10,aa)),64))])]),e("div",la,[y[6]||(y[6]=e("label",{class:"form-label"},"Category",-1)),M(e("select",{"onUpdate:modelValue":y[0]||(y[0]=_=>w.value.category=_),class:"form-select",required:""},y[5]||(y[5]=[qe('',6)]),512),[[ve,w.value.category]])]),e("div",oa,[y[7]||(y[7]=e("label",{class:"form-label"},"Detailed Comments",-1)),M(e("textarea",{"onUpdate:modelValue":y[1]||(y[1]=_=>w.value.detailedComments=_),class:"form-control",rows:"4",placeholder:"Enter detailed comments",required:""},null,512),[[B,w.value.detailedComments]])]),e("div",sa,[y[8]||(y[8]=e("label",{class:"form-label"},"Name",-1)),M(e("input",{"onUpdate:modelValue":y[2]||(y[2]=_=>w.value.name=_),type:"text",class:"form-control",placeholder:"Enter your name",required:""},null,512),[[B,w.value.name]])]),e("div",na,[y[9]||(y[9]=e("label",{class:"form-label"},"Email",-1)),M(e("input",{"onUpdate:modelValue":y[3]||(y[3]=_=>w.value.email=_),type:"email",class:"form-control",placeholder:"Enter your email",required:""},null,512),[[B,w.value.email]])])],32)]),e("div",ia,[y[10]||(y[10]=e("button",{type:"button",class:"btn btn-secondary","data-bs-dismiss":"modal"},"Cancel",-1)),e("button",{type:"button",class:"btn btn-primary",onClick:N,disabled:!C.value},"Submit",8,da)])])])]))}}),ca=Ne(ra,[["__scopeId","data-v-6565f21d"]]),ua={PREPARING_RUNTIME:"Initializing",PREPARING_METRICS_SERVER:"Initializing",PREPARING_INGRESS_NGINX:"Initializing",DEPLOYING:"Deploying",INSTALL:"Installing",IN_PROGRESS:"In Progress",PENDING:"Pending",START:"Starting",STARTING:"Starting",RESTART:"Restarting",RESTARTING:"Restarting",RUN:"Running",RUNNING:"Running",SUCCESS:"Running",COMPLETED:"Completed",STOP:"Stopped",STOPPED:"Stopped",UNINSTALL:"Uninstalling",UNINSTALLED:"Uninstalled",NOT_FOUND:"Not Found",UNKNOWN:"Unknown",IMAGE_PULL_ERROR:"Image Pull Error",FAILED:"Failed",ERROR:"Error"},ma=new Set(["PREPARING_RUNTIME","PREPARING_METRICS_SERVER","PREPARING_INGRESS_NGINX","DEPLOYING","IN_PROGRESS","INSTALL","START","STARTING","RESTART","RESTARTING"]),pa=new Set(["RUN","RUNNING","SUCCESS","COMPLETED"]),va=new Set(["NOT_FOUND","PENDING","UNKNOWN"]),ga=new Set(["STOP","STOPPED","UNINSTALL","UNINSTALLED"]),ba=new Set(["FAILED","ERROR","IMAGE_PULL_ERROR"]),fa=new Set(["PREPARING_RUNTIME","PREPARING_METRICS_SERVER","PREPARING_INGRESS_NGINX","DEPLOYING","IN_PROGRESS","INSTALL","START","STARTING","RESTART","RESTARTING","UNINSTALL","UNINSTALLED"]),Ue=H=>String(H||"").trim().toUpperCase(),xe=H=>{const P=Ue(H);return P&&(ua[P]||H)||"-"},Pe=H=>{const P=Ue(H);return pa.has(P)?"badge bg-success":ma.has(P)?"badge bg-primary":va.has(P)?"badge bg-warning":ga.has(P)?"badge bg-secondary":ba.has(P)?"badge bg-danger":"badge bg-secondary"},ya=H=>fa.has(Ue(H)),ha=["id"],_a={class:"modal-dialog modal-xl modal-dialog-centered",role:"document"},ka={class:"modal-content"},Sa={class:"modal-body",style:{"max-height":"80vh","overflow-y":"auto"}},wa={key:0,class:"text-center"},Ca={key:1},$a={class:"mb-4"},Ia={class:"row"},Ta={class:"col-md-2 text-center"},Aa=["src","alt"],Ra={key:1,class:"application-detail-logo-fallback d-inline-flex align-items-center justify-content-center"},Na={class:"col-md-10"},Ea={class:"text-muted"},Ma={class:"row"},Da={class:"col-md-3"},Ua={class:"col-md-3"},xa={class:"col-md-3"},Pa={class:"col-md-3"},La={class:"mb-4"},Va={key:0,class:"text-muted small mb-2"},Oa={class:"row"},Ba={class:"col-md-3"},Ga={class:"card text-center"},Ha={class:"card-body"},Fa={class:"card-title"},za={class:"col-md-3"},Ka={class:"card text-center"},qa={class:"card-body"},Ya={class:"card-title"},ja={class:"col-md-3"},Wa={class:"card text-center"},Xa={class:"card-body"},Ja={class:"card-title"},Za={class:"col-md-3"},Qa={class:"card text-center"},el={class:"card-body"},tl={class:"card-title"},al={class:"mb-4"},ll={class:"d-flex justify-content-between align-items-center mb-2"},ol={class:"text-muted small"},sl={class:"btn-list"},nl=["disabled"],il={key:0,class:"text-center text-muted py-3"},dl={key:1,class:"border rounded p-3"},rl={key:0,class:"alert alert-light border text-muted py-2 mb-3"},cl={class:"d-flex justify-content-between flex-wrap gap-2 mb-3"},ul={class:"badge bg-secondary"},ml={class:"badge bg-info"},pl={class:"table-responsive mb-3"},vl={class:"table table-sm mb-0"},gl={key:1,class:"row g-2 mb-3"},bl={class:"col-md-3"},fl={class:"col-md-3"},yl={class:"col-md-3"},hl={class:"col-md-3"},_l={class:"mb-3"},kl={class:"mb-3"},Sl={key:2,class:"mb-3"},wl={class:"policy-evidence-list mb-0"},Cl={key:2,class:"text-muted border rounded p-3"},$l={class:"mb-4"},Il={class:"table-responsive"},Tl={class:"table table-sm"},Al={key:0},Rl={class:"mb-4"},Nl={class:"table-responsive"},El={class:"table table-sm"},Ml={key:1},Dl={class:"mb-4"},Ul={class:"mb-3"},xl={class:"table-responsive"},Pl={class:"table table-sm"},Ll={class:"mb-3"},Vl={class:"table-responsive"},Ol={class:"table table-sm"},Bl={class:"mb-3"},Gl={class:"table-responsive"},Hl={class:"table table-sm"},Fl={key:0,class:"mb-3"},zl={class:"table-responsive"},Kl={class:"table table-sm"},ql={key:1,class:"mb-3"},Yl={class:"table-responsive"},jl={class:"table table-sm"},Wl={key:0,class:"mb-4"},Xl={class:"table-responsive"},Jl={class:"table table-sm"},Zl={key:2,class:"text-center text-muted"},Ql=ue({__name:"applicationDetailModal",props:{deploymentId:{},modalId:{default:"application-detail-modal"}},emits:["close"],setup(H,{expose:P,emit:F}){const R=H,D=F,w=ge(),b=h(!1),C=h(!1),d=h(null),$=h(null),N=h([]),f=h(null),y=h(!1),_=[7,30,90],S=h(0),s={"apache tomcat":"/catalog-icons/apache-tomcat.png",redis:"/catalog-icons/redis.svg",nginx:"/catalog-icons/nginx.svg","apache http server":"/catalog-icons/apache-http-server.svg","nexus repository":"/catalog-icons/nexus-repository.svg",mariadb:"/catalog-icons/mariadb.svg",grafana:"/catalog-icons/grafana.svg",prometheus:"/catalog-icons/prometheus.svg",elasticsearch:"/catalog-icons/elasticsearch.svg"},T=l=>String(l||"").trim().toLowerCase(),v=l=>s[T(l)]||"",g=te(()=>{const l=d.value;return l?wt(v(l.catalogName)||l.logoUrlLarge||l.logoUrlSmall||""):""});P({refreshData:l=>{S.value=l,S.value&&(J(),j())}});const J=async()=>{if(S.value){b.value=!0;try{y.value=!1;const{data:l}=await tt(S.value);l&&(d.value=l.integratedInfo)}catch(l){console.error("Failed to load application detail:",l),w.error("Failed to load application detail")}finally{b.value=!1}}},j=async()=>{if(S.value){C.value=!0;try{const l=await Be(S.value);$.value=l.data||null;const o=await Promise.all(_.map(async L=>{try{return(await Be(S.value,L)).data||null}catch{return null}}));N.value=o.filter(Boolean);const c=await at(S.value);f.value=c.data||null}catch(l){console.error("Failed to load policy recommendation:",l),$.value=null,N.value=[],f.value=null}finally{C.value=!1}}},ne=l=>{if(!l)return null;const o=new Date(String(l).replace(" ","T"));return Number.isNaN(o.getTime())?null:o},I=l=>{const o=l instanceof Date?l:ne(l);if(!o)return"-";const c=L=>String(L).padStart(2,"0");return`${o.getFullYear()}-${c(o.getMonth()+1)}-${c(o.getDate())} ${c(o.getHours())}:${c(o.getMinutes())}:${c(o.getSeconds())}`},E=l=>String(l||"").trim().toUpperCase(),z=new Set(["RUN","RUNNING","SUCCESS"]),K=new Set(["UNINSTALL","UNINSTALLED","NOT_FOUND","STOP","STOPPED","FAILED","ERROR"]),oe=te(()=>{var l,o,c;return E(((l=d.value)==null?void 0:l.applicationStatus)||((o=d.value)==null?void 0:o.podStatus)||((c=d.value)==null?void 0:c.status))}),me=te(()=>{var c,L;const l=ne((c=d.value)==null?void 0:c.executedAt);return(Array.isArray((L=d.value)==null?void 0:L.operationHistories)?d.value.operationHistories:[]).some(O=>{if(E(O==null?void 0:O.operationType)!=="UNINSTALL")return!1;const se=ne((O==null?void 0:O.executedAt)||(O==null?void 0:O.createdAt));return!l||!se?!0:se.getTime()>=l.getTime()})}),ie=te(()=>me.value||K.has(oe.value)?!1:z.has(oe.value)),de=te(()=>ie.value),W=te(()=>{var se;const l=ne((se=d.value)==null?void 0:se.executedAt);if(!l)return 0;const o=new Date,c=new Date(l.getFullYear(),l.getMonth(),l.getDate()),O=new Date(o.getFullYear(),o.getMonth(),o.getDate()).getTime()-c.getTime();return Math.max(Math.floor(O/(1e3*60*60*24)),0)}),be=te(()=>{const l=new Map;return N.value.forEach(o=>{const c=Te(o);typeof c=="number"&&l.set(c,o)}),l}),fe=te(()=>_.map(l=>{const o=be.value.get(l)||null,c=W.value>=l,L=(o==null?void 0:o.dataStatus)||(c?"PENDING_ANALYSIS":"ACCUMULATING");return{period:l,profile:o,eligible:c,dataStatus:L,dimmed:!c||["INSUFFICIENT_DATA","PENDING_ANALYSIS","ACCUMULATING"].includes(L)}})),pe=te(()=>{var o,c,L;const l=[(o=f.value)==null?void 0:o.updatedAt,(c=f.value)==null?void 0:c.createdAt,(L=$.value)==null?void 0:L.createdAt,...N.value.map(O=>O==null?void 0:O.createdAt)].map(ne).filter(O=>!!O).sort((O,se)=>se.getTime()-O.getTime());return l.length?I(l[0]):"분석 이력 없음"}),he=async()=>{if(S.value){if(!de.value){w.info("현재 실행 중인 배포만 정책 추천을 분석할 수 있습니다.");return}C.value=!0;try{await lt(S.value),await j(),w.success("Policy recommendation analyzed")}catch(l){console.error("Failed to analyze policy recommendation:",l),w.error("Failed to analyze policy recommendation")}finally{C.value=!1}}},le=l=>Pe(l),ee=l=>xe(l),ye=l=>{switch(l==null?void 0:l.toLowerCase()){case"critical":return"badge bg-danger";case"warning":return"badge bg-warning";case"error":return"badge bg-danger";default:return"badge bg-info"}},Se=l=>{switch(l==null?void 0:l.toLowerCase()){case"info":return"badge bg-info";case"warning":return"badge bg-warning";case"error":return"badge bg-danger";case"debug":return"badge bg-secondary";default:return"badge bg-primary"}},k=l=>{switch(l){case"CPU_INTENSIVE":return"badge bg-primary";case"MEMORY_INTENSIVE":return"badge bg-purple";case"CPU_MEMORY_INTENSIVE":return"badge bg-warning";case"GENERAL_PURPOSE":return"badge bg-success";default:return"badge bg-secondary"}},t=l=>{switch(l){case"CPU_INTENSIVE":return"CPU 중심";case"MEMORY_INTENSIVE":return"Memory 중심";case"CPU_MEMORY_INTENSIVE":return"CPU/Memory 복합";case"GENERAL_PURPOSE":return"현행/범용";default:return l||"N/A"}},p=l=>{switch(E(l)){case"UNDER_PROVISIONED":return"용량 부족";case"OVER_PROVISIONED":return"사용률 낮음";case"RIGHT_SIZED":return"적정";default:return l||"N/A"}},ce=l=>{switch(l){case"SUFFICIENT":return"badge bg-success";case"PARTIAL_DATA":return"badge bg-warning";case"INSUFFICIENT_DATA":case"ACCUMULATING":case"PENDING_ANALYSIS":return"badge bg-secondary";default:return"badge bg-secondary"}},Q=l=>{switch(l){case"SUFFICIENT":return"충분";case"PARTIAL_DATA":return"부분 데이터";case"INSUFFICIENT_DATA":case"ACCUMULATING":return"데이터 축적 중";case"PENDING_ANALYSIS":return"분석 대기";default:return l||"N/A"}},we=l=>l?l.split(",").map(o=>o.trim()).filter(Boolean):["NO_ACTION"],Ee=l=>{switch(l){case"INCREASE_CPU":return"CPU 정책 검토";case"INCREASE_MEMORY":return"Memory 정책 검토";case"REVIEW_CPU_MEMORY_POLICY":return"CPU/Memory 복합 검토";case"CHANGE_RESOURCE_TYPE":return"운영 유형 검토";case"DOWNSIZE":return"현행/하향 검토";case"INVESTIGATE_STABILITY":return"안정성 점검";case"NO_ACTION":return"현행 유지";default:return l}},Ce=l=>{if(l==null)return"N/A";const o=Math.round(l*100);return o>=80?`높음 ${o}%`:o>=60?`보통 ${o}%`:o>=40?`낮음 ${o}%`:`판단 보류 ${o}%`},$e=l=>{if(!l)return[];try{const o=JSON.parse(l);return Array.isArray(o)?o:[]}catch{return l.split(",").map(o=>o.trim()).filter(Boolean)}},Ie=l=>{const o=l.match(/^validDays=(\d+) is below (\d+)$/);if(o)return`유효 분석일이 ${o[1]}일로 최소 기준 ${o[2]}일에 미달합니다.`;const c=l.match(/^cpuPressureP95=([\d.]+)$/);if(c)return`CPU p95 사용률이 ${c[1]}%입니다.`;const L=l.match(/^memoryPressureP95=([\d.]+)$/);if(L)return`Memory p95 사용률이 ${L[1]}%입니다.`;const O=l.match(/^oomCount=(\d+)$/);if(O)return`OOM 이벤트가 ${O[1]}건 발생했습니다.`;const se=l.match(/^restartCount=(\d+), crashLoopCount=(\d+)$/);if(se)return`재시작 이벤트 ${se[1]}건, CrashLoop 이벤트 ${se[2]}건이 확인되었습니다.`;const De=l.match(/^networkEvidence=maxInBytes=(\d+), maxOutBytes=(\d+)$/);if(De)return`네트워크 최대 수신 ${x(Number(De[1]))}, 최대 송신 ${x(Number(De[2]))}가 확인되었습니다.`;const Le=l.match(/^errorLogCount=(\d+)$/);if(Le)return`ERROR 로그가 ${Le[1]}건 확인되었습니다.`;const Ve=l.match(/^oomRelatedLogCount=(\d+)$/);if(Ve)return`OOM 관련 로그가 ${Ve[1]}건 확인되었습니다.`;const Oe=l.match(/^networkOrTimeoutLogCount=(\d+)$/);return Oe?`네트워크 또는 timeout 관련 로그가 ${Oe[1]}건 확인되었습니다.`:l==="cpuPressureP95 and memoryPressureP95 are below 40"?"CPU와 Memory p95 사용률이 모두 40% 미만입니다.":l==="CPU/Memory pressure is within right-sized range"?"CPU와 Memory 사용률이 적정 범위입니다.":l==="K8s percentage metrics require request/limit normalization; confidence capped at 0.60"?"K8s 백분율 지표는 request/limit 기준 정규화가 필요하여 신뢰도가 60%로 제한됩니다.":l},Te=l=>{if(!(l!=null&&l.analysisStartDate)||!(l!=null&&l.analysisEndDate))return"-";const o=new Date(l.analysisStartDate),c=new Date(l.analysisEndDate);return Math.round((c.getTime()-o.getTime())/(1e3*60*60*24))+1},Me=(l,o)=>{const c=Te(l);if(typeof c=="number")return c;const L=(l==null?void 0:l.validDays)??0,O=(l==null?void 0:l.missingDays)??0;return L+O||o||0},a=(l,o)=>{const c=(l==null?void 0:l.validDays)??0,L=Me(l,o);return L?`${c}일 확보 / ${L}일 기준`:`${c}일 확보`},n=l=>!ie.value||l===null||l===void 0?"-":`${l}%`,r=l=>ie.value?x(l):"-",x=l=>{if(l===0)return"0 Bytes";if(!l)return"N/A";const o=1024,c=["Bytes","KB","MB","GB","TB"],L=Math.floor(Math.log(l)/Math.log(o));return parseFloat((l/Math.pow(o,L)).toFixed(2))+" "+c[L]},U=()=>{const l=document.getElementById(R.modalId);if(l)try{if(window.bootstrap&&window.bootstrap.Modal){const o=window.bootstrap.Modal.getInstance(l);o?o.hide():new window.bootstrap.Modal(l).hide()}else l.style.display="none",l.classList.remove("show"),l.setAttribute("aria-hidden","true"),l.removeAttribute("aria-modal"),document.body.classList.remove("modal-open"),document.querySelectorAll(".modal-backdrop").forEach(c=>c.remove()),document.body.style.overflow="",document.body.style.paddingRight=""}catch(o){console.error("Error closing modal:",o),l.style.display="none",l.classList.remove("show"),document.body.classList.remove("modal-open"),document.querySelectorAll(".modal-backdrop").forEach(L=>L.remove())}d.value=null,$.value=null,N.value=[],f.value=null,D("close")};return(l,o)=>(u(),m("div",{class:"modal modal-blur fade",id:R.modalId,tabindex:"-1",role:"dialog","aria-hidden":"true"},[e("div",_a,[e("div",ka,[e("div",{class:"modal-header"},[o[1]||(o[1]=e("h5",{class:"modal-title"},"Application Detail",-1)),e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close",onClick:U})]),e("div",Sa,[b.value?(u(),m("div",wa,o[2]||(o[2]=[e("div",{class:"spinner-border",role:"status"},[e("span",{class:"visually-hidden"},"Loading...")],-1)]))):d.value?(u(),m("div",Ca,[e("div",$a,[o[7]||(o[7]=e("h6",{class:"text-primary"},"Application Overview",-1)),e("div",Ia,[e("div",Ta,[g.value&&!y.value?(u(),m("img",{key:0,src:g.value,alt:d.value.catalogName,class:"img-fluid application-detail-logo",onError:o[0]||(o[0]=c=>y.value=!0)},null,40,Aa)):(u(),m("div",Ra,[V(Z(We),{class:"icon",size:"32","stroke-width":"1.75"})]))]),e("div",Na,[e("h5",null,i(d.value.catalogName),1),e("p",Ea,i(d.value.catalogDescription),1),e("div",Ma,[e("div",Da,[o[3]||(o[3]=e("strong",null,"Category:",-1)),ae(" "+i(d.value.catalogCategory),1)]),e("div",Ua,[o[4]||(o[4]=e("strong",null,"Default Port:",-1)),ae(" "+i(d.value.defaultPort),1)]),e("div",xa,[o[5]||(o[5]=e("strong",{class:"me-2"},"Status:",-1)),e("span",{class:q(le(d.value.applicationStatus))},i(ee(d.value.applicationStatus)),3)]),e("div",Pa,[o[6]||(o[6]=e("strong",{class:"me-2"},"Health Check:",-1)),e("span",{class:q(d.value.healthCheck?"text-success":"text-danger")},i(d.value.healthCheck?"Healthy":"Unhealthy"),3)])])])])]),e("div",La,[o[12]||(o[12]=e("h6",{class:"text-primary"},"성능 지표",-1)),ie.value?Y("",!0):(u(),m("div",Va," 현재 실행 중인 상태가 아니므로 최신 성능 지표를 표시하지 않습니다. ")),e("div",Oa,[e("div",Ba,[e("div",Ga,[e("div",Ha,[e("h5",Fa,i(n(d.value.cpuUsage)),1),o[8]||(o[8]=e("p",{class:"card-text"},"CPU 사용률",-1))])])]),e("div",za,[e("div",Ka,[e("div",qa,[e("h5",Ya,i(n(d.value.memoryUsage)),1),o[9]||(o[9]=e("p",{class:"card-text"},"Memory 사용률",-1))])])]),e("div",ja,[e("div",Wa,[e("div",Xa,[e("h5",Ja,i(r(d.value.networkIn)),1),o[10]||(o[10]=e("p",{class:"card-text"},"네트워크 수신",-1))])])]),e("div",Za,[e("div",Qa,[e("div",el,[e("h5",tl,i(r(d.value.networkOut)),1),o[11]||(o[11]=e("p",{class:"card-text"},"네트워크 송신",-1))])])])])]),e("div",al,[e("div",ll,[e("div",null,[o[13]||(o[13]=e("h6",{class:"text-primary mb-0"},"정책 추천",-1)),e("div",ol,"최근 분석 시각: "+i(pe.value),1)]),e("div",sl,[e("button",{type:"button",class:"btn btn-outline-primary",disabled:C.value||!d.value.deploymentId||!de.value,onClick:he},i(C.value?"Analyzing...":"Analyze"),9,nl)])]),C.value?(u(),m("div",il,o[14]||(o[14]=[e("div",{class:"spinner-border spinner-border-sm me-2",role:"status"},null,-1),ae(" 정책 추천 정보를 불러오는 중입니다. ")]))):f.value?(u(),m("div",dl,[de.value?Y("",!0):(u(),m("div",rl," 운영 종료 또는 미확인 상태의 배포는 정책 추천 분석을 실행하지 않습니다. 아래 내용은 마지막으로 저장된 분석 결과입니다. ")),e("div",cl,[e("div",null,[o[15]||(o[15]=e("div",{class:"text-muted small"},"현재 설정 유형",-1)),e("span",ul,i(t(f.value.selectedResourceType)),1)]),e("div",null,[o[16]||(o[16]=e("div",{class:"text-muted small"},"추천 운영 유형",-1)),e("span",{class:q(k(f.value.recommendedResourceType))},i(t(f.value.recommendedResourceType)),3)]),e("div",null,[o[17]||(o[17]=e("div",{class:"text-muted small"},"정책 차이",-1)),e("span",{class:q(f.value.mismatch?"badge bg-warning":"badge bg-success")},i(f.value.mismatch?"검토 필요":"일치"),3)]),e("div",null,[o[18]||(o[18]=e("div",{class:"text-muted small"},"분석 신뢰도",-1)),e("span",ml,i(Ce(f.value.confidence)),1)])]),e("div",pl,[e("table",vl,[o[19]||(o[19]=e("thead",null,[e("tr",null,[e("th",null,"분석 기간"),e("th",null,"추천 유형"),e("th",null,"데이터 상태"),e("th",null,"신뢰도"),e("th",null,"분석 데이터")])],-1)),e("tbody",null,[(u(!0),m(G,null,X(fe.value,c=>(u(),m("tr",{key:c.period,class:q({"policy-period-muted":c.dimmed})},[e("td",null,i(c.period)+"d",1),e("td",null,i(c.profile?t(c.profile.recommendedResourceType):"-"),1),e("td",null,[e("span",{class:q(ce(c.dataStatus))},i(Q(c.dataStatus)),3)]),e("td",null,i(c.profile?Ce(c.profile.confidence):"-"),1),e("td",null,i(a(c.profile,c.period)),1)],2))),128))])])]),$.value?(u(),m("div",gl,[e("div",bl,[o[20]||(o[20]=e("div",{class:"text-muted small"},"데이터 상태",-1)),e("span",{class:q(ce($.value.dataStatus))},i(Q($.value.dataStatus)),3)]),e("div",fl,[o[21]||(o[21]=e("div",{class:"text-muted small"},"CPU 상태",-1)),e("span",null,i(p($.value.cpuSizingStatus)),1)]),e("div",yl,[o[22]||(o[22]=e("div",{class:"text-muted small"},"Memory 상태",-1)),e("span",null,i(p($.value.memorySizingStatus)),1)]),e("div",hl,[o[23]||(o[23]=e("div",{class:"text-muted small"},"분석 데이터",-1)),e("span",null,i(a($.value)),1)])])):Y("",!0),e("div",_l,[o[24]||(o[24]=e("div",{class:"text-muted small"},"검토 항목",-1)),(u(!0),m(G,null,X(we(f.value.actions),c=>(u(),m("span",{key:c,class:"badge bg-light text-dark me-1"},i(Ee(c)),1))),128))]),e("p",kl,i(f.value.message),1),$.value&&$e($.value.reasons).length?(u(),m("div",Sl,[o[25]||(o[25]=e("div",{class:"text-muted small"},"분석 근거",-1)),e("ul",wl,[(u(!0),m(G,null,X($e($.value.reasons),c=>(u(),m("li",{key:c},i(Ie(c)),1))),128))])])):Y("",!0)])):(u(),m("div",Cl," 정책 추천 정보가 없습니다. "))]),e("div",$l,[o[28]||(o[28]=e("h6",{class:"text-primary"},"Action History",-1)),e("div",Il,[e("table",Tl,[o[27]||(o[27]=e("thead",null,[e("tr",null,[e("th",null,"Action"),e("th",null,"Timestamp"),e("th",null,"User"),e("th",null,"Status"),e("th",null,"Description")])],-1)),e("tbody",null,[d.value.operationHistories.length===0?(u(),m("tr",Al,o[26]||(o[26]=[e("td",{colspan:"5",class:"text-center text-muted"},"No action history available",-1)]))):Y("",!0),(u(!0),m(G,null,X(d.value.operationHistories,c=>(u(),m("tr",{key:c.id},[e("td",null,i(c.operationType),1),e("td",null,i(c.executedAt),1),e("td",null,i(c.executedBy||"system"),1),e("td",null,[e("span",{class:q(le(c.status))},i(ee(c.status)),3)]),e("td",null,i(c.detailReason||c.reason),1)]))),128))])])])]),e("div",Rl,[o[31]||(o[31]=e("h6",{class:"text-primary"},"Error Logs",-1)),e("div",Nl,[e("table",El,[o[30]||(o[30]=e("thead",null,[e("tr",null,[e("th",null,"Timestamp"),e("th",null,"Error Code"),e("th",null,"Severity"),e("th",null,"Module"),e("th",null,"Description")])],-1)),e("tbody",null,[d.value.errorLogs.length>0?(u(!0),m(G,{key:0},X(d.value.errorLogs,c=>(u(),m("tr",{key:c.errorCode},[e("td",null,i(c.loggedAt),1),e("td",null,i(c.errorCode),1),e("td",null,[e("span",{class:q(ye(c.severity))},i(c.severity),3)]),e("td",null,i(c.module),1),e("td",null,i(c.logMessage),1)]))),128)):(u(),m("tr",Ml,o[29]||(o[29]=[e("td",{colspan:"5",class:"text-center text-muted"},"No error logs available",-1)])))])])])]),e("div",Dl,[o[42]||(o[42]=e("h6",{class:"text-primary"},"Deployment History",-1)),e("div",Ul,[o[33]||(o[33]=e("h6",null,"Basic Deployment Information",-1)),e("div",xl,[e("table",Pl,[o[32]||(o[32]=e("thead",null,[e("tr",null,[e("th",null,"ID"),e("th",null,"Action Type"),e("th",null,"Executed At"),e("th",null,"Executed By"),e("th",null,"Status")])],-1)),e("tbody",null,[e("tr",null,[e("td",null,i(d.value.deploymentId),1),e("td",null,i(d.value.actionType),1),e("td",null,i(d.value.executedAt),1),e("td",null,i(d.value.executedBy||"system"),1),e("td",null,[e("span",{class:q(le(d.value.status))},i(ee(d.value.status)),3)])])])])])]),e("div",Ll,[o[35]||(o[35]=e("h6",null,"Cloud & Cluster Information",-1)),e("div",Vl,[e("table",Ol,[o[34]||(o[34]=e("thead",null,[e("tr",null,[e("th",null,"Cloud Provider"),e("th",null,"Cloud Region"),e("th",null,"Cluster Name"),e("th",null,"Deployment Type"),e("th",null,"MCI ID"),e("th",null,"UID")])],-1)),e("tbody",null,[e("tr",null,[e("td",null,i(d.value.cloudProvider),1),e("td",null,i(d.value.cloudRegion),1),e("td",null,i(d.value.clusterName||"N/A"),1),e("td",null,i(d.value.deploymentType),1),e("td",null,i(d.value.mciId),1),e("td",null,i(d.value.vmId),1)])])])])]),e("div",Bl,[o[37]||(o[37]=e("h6",null,"Network & Service Information",-1)),e("div",Gl,[e("table",Hl,[o[36]||(o[36]=e("thead",null,[e("tr",null,[e("th",null,"Namespace"),e("th",null,"Pod Status"),e("th",null,"Public IP"),e("th",null,"Service Port"),e("th",null,"VM ID"),e("th",null,"Catalog ID")])],-1)),e("tbody",null,[e("tr",null,[e("td",null,i(d.value.namespace),1),e("td",null,[e("span",{class:q(le(d.value.podStatus||d.value.applicationStatus))},i(ee(d.value.podStatus||d.value.applicationStatus)),3)]),e("td",null,i(d.value.publicIp),1),e("td",null,i(d.value.servicePort||d.value.defaultPort),1),e("td",null,i(d.value.vmId),1),e("td",null,i(d.value.catalogName),1)])])])])]),d.value.deploymentType==="K8S"?(u(),m("div",Fl,[o[39]||(o[39]=e("h6",null,"Deployment Options",-1)),e("div",zl,[e("table",Kl,[o[38]||(o[38]=e("thead",null,[e("tr",null,[e("th",null,"Resource Type"),e("th",null,"HPA"),e("th",null,"Min Replicas"),e("th",null,"Max Replicas"),e("th",null,"CPU Threshold"),e("th",null,"Memory Threshold")])],-1)),e("tbody",null,[e("tr",null,[e("td",null,i(d.value.resourceType||"N/A"),1),e("td",null,[e("span",{class:q(d.value.hpaEnabled?"text-success":"text-muted")},i(d.value.hpaEnabled?"Enabled":"Disabled"),3)]),e("td",null,i(d.value.minReplicas||"N/A"),1),e("td",null,i(d.value.maxReplicas||"N/A"),1),e("td",null,i(d.value.cpuThreshold?`${d.value.cpuThreshold}%`:"N/A"),1),e("td",null,i(d.value.memoryThreshold?`${d.value.memoryThreshold}%`:"N/A"),1)])])])])])):Y("",!0),d.value.ingressEnabled?(u(),m("div",ql,[o[41]||(o[41]=e("h6",null,"Ingress Information",-1)),e("div",Yl,[e("table",jl,[o[40]||(o[40]=e("thead",null,[e("tr",null,[e("th",null,"Enabled"),e("th",null,"Host"),e("th",null,"Path"),e("th",null,"Class"),e("th",null,"TLS Enabled"),e("th",null,"TLS Secret")])],-1)),e("tbody",null,[e("tr",null,[e("td",null,[e("span",{class:q(d.value.ingressEnabled?"text-success":"text-danger")},i(d.value.ingressEnabled?"Yes":"No"),3)]),e("td",null,i(d.value.ingressHost||"N/A"),1),e("td",null,i(d.value.ingressPath||"N/A"),1),e("td",null,i(d.value.ingressClass||"N/A"),1),e("td",null,[e("span",{class:q(d.value.ingressTlsEnabled?"text-success":"text-danger")},i(d.value.ingressTlsEnabled?"Yes":"No"),3)]),e("td",null,i(d.value.ingressTlsSecret||"N/A"),1)])])])])])):Y("",!0)]),d.value.deploymentLogs&&d.value.deploymentLogs.length>0?(u(),m("div",Wl,[o[44]||(o[44]=e("h6",{class:"text-primary"},"Deployment Logs",-1)),e("div",Xl,[e("table",Jl,[o[43]||(o[43]=e("thead",null,[e("tr",null,[e("th",null,"Timestamp"),e("th",null,"Type"),e("th",null,"Message")])],-1)),e("tbody",null,[(u(!0),m(G,null,X(d.value.deploymentLogs,c=>(u(),m("tr",{key:c.id},[e("td",null,i(c.loggedAt),1),e("td",null,[e("span",{class:q(["me-4 mt-2",Se(c.logType)])},i(c.logType),3)]),e("td",null,i(c.logMessage),1)]))),128))])])])])):Y("",!0)])):(u(),m("div",Zl," No data available "))]),e("div",{class:"modal-footer"},[e("button",{type:"button",class:"btn btn-secondary","data-bs-dismiss":"modal",onClick:U},"Close")])])])],8,ha))}}),Je=Ne(Ql,[["__scopeId","data-v-e8777908"]]),eo={class:"card card-flush w-100"},to={class:"page-header page-wrapper"},ao={class:"row align-items-center"},lo={class:"card-header d-flex",style:{"justify-content":"space-between"}},oo={class:"btn-list"},so={class:"me-2"},Ke="application-status-detail-modal",no=ue({__name:"applicationStatusList",setup(H,{expose:P}){const F=ge(),R=h([]),D=h([]),w=h(""),b=h(""),C=h(0),d=h(""),$=h(""),N=h(0);h(!1);const f=h(0),y=h(),_=h();ke(async()=>{T(),await S()});const S=async()=>{try{s();const{data:I}=await ot();I?R.value=I:R.value=[]}catch(I){console.log(I),F.error("Unable to retrieve data")}},s=()=>{const I=new Date,E={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1};w.value=I.toLocaleDateString("ko-KR",E)},T=()=>{D.value=[{title:"Infra",width:230,minWidth:180,formatter:A,cellClick:function(I,E){g(E)}},{title:"Application",field:"applicationName",width:180,minWidth:150,cellClick:function(I,E){g(E)},formatter:function(I){return`
${I.getValue()}
`}},{title:"Status",width:210,minWidth:190,formatter:j,cellClick:function(I,E){g(E)}},{title:"CheckedAt",field:"checkedAt",width:210,minWidth:190,cellClick:function(I,E){g(E)},formatter:function(I){return`
${I.getValue()}
`}},{title:"Action",width:320,minWidth:300,headerSort:!1,formatter:ne,cellClick:async function(I,E){const z=I.target,K=z==null?void 0:z.getAttribute("id"),oe=E.getRow().getData().status;if(J(oe))return;const me=E.getRow().getData().id,ie=E.getRow().getData().deploymentType,de=E.getRow().getData().applicationName,W={operation:"",applicationStatusId:me,deploymentType:ie,applicationName:de};K==="start-btn"?(W.operation="START",await v(W)):K==="restart-btn"?(W.operation="RESTART",await v(W)):K==="stop-btn"?(W.operation="STOP",await v(W)):K==="uninstall-btn"?(W.operation="UNINSTALL",await v(W)):K==="rating-btn"&&(W.operation="RATING",N.value=E.getRow().getData().catalogId||1,await v(W))}}]},v=async I=>{b.value=I.operation,C.value=I.applicationStatusId,d.value=I.deploymentType,$.value=I.applicationName,_.value&&(_.value.setInit(),_.value._getReasonList(I.operation))},g=I=>{const E=I.getRow().getData(),z=E.deploymentHistoryId||E.deploymentId;if(!z)return;f.value=z;const K=document.getElementById(Ke);if(K)try{window.bootstrap&&window.bootstrap.Modal?(new window.bootstrap.Modal(K).show(),setTimeout(()=>{y.value&&y.value.refreshData(f.value)},100)):(K.style.display="block",K.classList.add("show"),document.body.classList.add("modal-open"),y.value&&y.value.refreshData(f.value))}catch(oe){console.error("Error opening detail modal:",oe)}},A=I=>{const E=I.getRow().getData().deploymentType,z=I.getRow().getData().vmId?I.getRow().getData().vmId:I.getRow().getData().clusterName?I.getRow().getData().clusterName:"-";return` +
+

+ ${E} (${z}) +

+
+ `},J=I=>ya(I),j=I=>{const E=I.getRow().getData().status,z=xe(E);return` +
+ + ${z} + +
`},ne=I=>{const E=I.getRow().getData().status,z=J(E)?"disabled":"",K=String(E||"").trim().toUpperCase();return` +
+ ${K==="STOP"||K==="STOPPED"?` + + `:` + + + `} + + +
`};return P({refresh:S}),(I,E)=>(u(),m(G,null,[e("div",eo,[e("div",to,[e("div",ao,[e("div",lo,[E[1]||(E[1]=e("h3",{class:"card-title"},[e("strong",null,"Apps Status")],-1)),e("div",oo,[e("span",so,i(w.value),1),e("a",{class:"btn btn-outline-primary d-none d-sm-inline-block",onClick:S},[V(Z(Xe),{class:"icon icon-tabler",size:20,"stroke-width":"1"}),E[0]||(E[0]=ae(" Refresh "))])])])])]),V(St,{columns:D.value,"table-data":R.value},null,8,["columns","table-data"])]),V(Wt,{ref_key:"applicationActionConfirmModalRef",ref:_,title:b.value,applicationStatusId:C.value,type:d.value,applicationName:$.value,onGetApplicationsStatusList:S},null,8,["title","applicationStatusId","type","applicationName"]),V(ca,{catalogId:N.value,applicationName:$.value,onRatingSubmitted:S},null,8,["catalogId","applicationName"]),V(Je,{ref_key:"applicationDetailModalRef",ref:y,"modal-id":Ke,deploymentId:f.value},null,8,["deploymentId"])],64))}}),io={class:"modal-dialog modal-lg",role:"document"},ro={class:"modal-content"},co={class:"modal-header"},uo={class:"modal-title"},mo={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},po={class:"nav nav-tabs mb-3"},vo={class:"nav-item"},go={class:"nav-item"},bo={class:"nav-item"},fo={class:"nav-item"},yo={class:"mb-3"},ho={class:"d-flex align-items-center"},_o={class:"form-check me-3"},ko=["disabled"],So={class:"form-check"},wo=["disabled"],Co={class:"mb-3"},$o=["disabled"],Io=["value"],To={class:"w-100 d-flex justify-content-between"},Ao={class:"mb-3 w-50",style:{"margin-right":"10px"}},Ro=["disabled"],No=["value"],Eo={class:"mb-3 w-50"},Mo=["disabled"],Do=["value"],Uo={class:"mb-3"},xo={class:"mb-3"},Po={class:"mb-3"},Lo={class:"mb-3"},Vo={class:"col-5"},Oo=["onUpdate:modelValue"],Bo={class:"col-6"},Go=["onUpdate:modelValue"],Ho={class:"col-1 d-flex gap-2"},Fo=["onClick","disabled"],zo={class:"row"},Ko={class:"col-md-6"},qo={class:"row"},Yo={class:"col-6"},jo={class:"input-group"},Wo={class:"col-6"},Xo={class:"input-group"},Jo={class:"row mt-3"},Zo={class:"col-md-6"},Qo={class:"row"},es={class:"col-6"},ts={class:"input-group"},as={class:"col-6"},ls={class:"input-group"},os={class:"row mt-3"},ss={class:"col-md-6"},ns={class:"row"},is={class:"col-6"},ds={class:"input-group"},rs={class:"col-6"},cs={class:"input-group"},us={key:0,class:"card mt-3"},ms={class:"card-body"},ps={class:"d-flex align-items-center mb-2"},vs={class:"form-check form-switch"},gs={class:"row"},bs={class:"col-md-3"},fs=["disabled"],ys={class:"col-md-3"},hs=["disabled"],_s={class:"col-md-3"},ks=["disabled"],Ss={class:"col-md-3"},ws=["disabled"],Cs={key:0},$s={class:"card"},Is={class:"card-body"},Ts={class:"mb-3"},As={key:1},Rs={class:"card"},Ns={class:"card-body"},Es={class:"mb-3"},Ms={class:"col-4"},Ds=["onUpdate:modelValue"],Us={class:"col-3"},xs=["onUpdate:modelValue"],Ps={class:"col-4"},Ls=["onUpdate:modelValue"],Vs={class:"col-1 d-flex align-items-end gap-2"},Os=["onClick","disabled"],Bs={class:"modal-footer"},Gs={class:"ms-auto d-flex gap-2"},Hs=["disabled"],Fs=["disabled"],zs=["disabled"],Ks=ue({__name:"softwareCatalogWizard",props:{show:{type:Boolean},mode:{}},emits:["created","updated"],setup(H,{expose:P,emit:F}){const R=H,D=F,w=ge(),b=h(1),C=h(!1),d=h(!1),$=h(0),N=h({}),f=h(null),y=h(!1);ke(()=>{f.value&&(f.value.addEventListener("show.bs.modal",_),f.value.addEventListener("hide.bs.modal",S)),fe()}),Ye(()=>{f.value&&(f.value.removeEventListener("show.bs.modal",_),f.value.removeEventListener("hide.bs.modal",S))});const _=()=>{d.value=!0,R.mode==="new"&&j()},S=()=>{d.value=!1,y.value=!1},s=h({id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null}),T=h([{refId:0,refValue:"",refDesc:"",refType:"URL"}]),v=h([{targetPort:80,hostPort:8080,protocol:"TCP"}]),g=te(()=>b.value===1?s.value.target&&s.value.category&&s.value.packageName&&s.value.version:b.value===2?s.value.name.trim().length>0&&s.value.summary.trim().length>0&&s.value.description.trim().length>0:b.value===3?s.value.minCpu>0&&s.value.minMemory>0&&s.value.minDisk>0&&s.value.recommendedCpu>0&&s.value.recommendedMemory>0&&s.value.recommendedDisk>0:b.value===3&&s.value.hpaEnabled?s.value.minReplicas>0&&s.value.maxReplicas>0&&s.value.cpuThreshold>0&&s.value.memoryThreshold>0:(console.log(v.value),b.value===3&&s.value.target==="VM"?s.value.defaultPort>0:b.value===4&&s.value.target==="K8S"?(console.log(v.value.length),v.value.length>0?v.value.every(k=>k.targetPort>0&&k.hostPort>0&&k.protocol):!1):b.value===4&&s.value.ingressEnabled?s.value.ingressUrl.trim().length>0:!0)),A=()=>{g.value&&b.value<4&&(b.value+=1)},J=()=>{b.value>1&&(b.value-=1)},j=()=>{b.value=1,s.value={id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null},T.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],v.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}]},ne=()=>{T.value.push({refId:0,refValue:"",refDesc:"",refType:"URL"})},I=k=>{T.value.length>1&&T.value.splice(k,1)},E=()=>{v.value.push({targetPort:80,hostPort:8080,protocol:"TCP"})},z=k=>{v.value.length>1&&v.value.splice(k,1)},K=()=>{if(f.value){d.value=!1;const k=f.value.querySelector('[data-bs-dismiss="modal"]');if(k)k.click();else try{const t=window.bootstrap;if(t!=null&&t.Modal)(t.Modal.getInstance(f.value)||new t.Modal(f.value)).hide();else{f.value.classList.remove("show"),f.value.style.display="none",document.body.classList.remove("modal-open");const p=document.querySelector(".modal-backdrop");p==null||p.remove()}}catch(t){console.warn("Modal close failed:",t)}}},oe=async()=>{try{s.value.catalogRefs=T.value.filter(k=>k.refValue.trim()),s.value.target==="K8S"&&(s.value.ports=v.value.filter(k=>k.targetPort&&k.hostPort)),s.value.target==="VM"?s.value.sourceType="DOCKERHUB":s.value.target==="K8S"&&(s.value.sourceType="ARTIFACTHUB"),await nt(s.value),w.success("Registration Success"),K(),D("created")}catch{w.error("Registration Failed")}},me=async()=>{try{s.value.catalogRefs=T.value.filter(k=>k.refValue.trim()),s.value.target==="K8S"&&(s.value.ports=v.value.filter(k=>k.targetPort&&k.hostPort)),s.value.target==="VM"?s.value.sourceType="DOCKERHUB":s.value.target==="K8S"&&(s.value.sourceType="ARTIFACTHUB"),await it(s.value),w.success("Update Success"),K(),D("updated")}catch{w.error("Update Failed")}},ie=async()=>{try{if(!$.value)return;N.value&&N.value.category&&(C.value=!0,s.value.target=N.value.packageInfo!==null?"VM":"K8S",s.value.category=N.value.category,N.value.packageInfo!==null?(s.value.packageName=N.value.packageInfo.packageName,s.value.version=N.value.packageInfo.packageVersion):N.value.helmChart!==null&&(s.value.packageName=N.value.helmChart.chartName,s.value.version=N.value.helmChart.chartVersion),C.value=!1),await de()}catch{w.error("Failed to load catalog data"),C.value=!1}},de=async()=>{try{if(!$.value)return;const{data:k}=await dt($.value);C.value=!0,s.value={...s.value,...k,target:k.packageInfo!==null?"VM":"K8S"},k.packageInfo!==null&&(s.value.packageName=k.packageInfo.packageName,s.value.version=k.packageInfo.packageVersion),k.helmChart!==null&&(s.value.packageName=k.helmChart.chartName,s.value.version=k.helmChart.chartVersion),k.catalogRefs&&k.catalogRefs.length>0?T.value=k.catalogRefs.map(t=>({refId:t.id||0,refValue:t.refValue||"",refDesc:t.refDesc||"",refType:t.refType||"URL"})):T.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],k.ports&&k.ports.length>0?v.value=k.ports.map(t=>({targetPort:t.targetPort||80,hostPort:t.hostPort||8080,protocol:t.protocol||"TCP"})):v.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}],await fe(),s.value.category&&(await he(),s.value.packageName&&await ee()),C.value=!1}catch{w.error("Failed to load catalog data"),C.value=!1}},W=k=>{g.value&&(b.value=k)};Re(()=>s.value.target,k=>{k&&(R.mode==="new"&&(s.value.category="",s.value.packageName="",s.value.version=""),fe())});const be=h([]),fe=async()=>{if(R.mode==="new"&&(be.value=[],pe.value=[],le.value=[],s.value.category="",s.value.packageName="",s.value.version=""),s.value.target){const k={target:s.value.target==="VM"?"DOCKER":"HELM"},{data:t}=await st(k);be.value=t}};Re(()=>s.value.category,k=>{k&&(R.mode==="new"&&(s.value.packageName="",s.value.version=""),he())});const pe=h([]),he=async()=>{R.mode==="new"&&(pe.value=[],le.value=[],s.value.packageName="",s.value.version="");const k={target:s.value.target==="VM"?"DOCKER":"HELM",category:s.value.category||""},{data:t}=await rt(k);pe.value=t};Re(()=>s.value.packageName,k=>{k&&(R.mode==="new"&&(s.value.version=""),ee())});const le=h([]),ee=async()=>{R.mode==="new"&&(le.value=[],s.value.version="");const k={target:s.value.target==="VM"?"DOCKER":"HELM",packageName:s.value.packageName||""},{data:t}=await ct(k);R.mode==="new"?t.forEach(p=>{p.isUsed||le.value.push(p)}):le.value=t};return P({loadCatalogDataWithCategoryInit:ie,initForCreate:()=>{j(),b.value=1},initForUpdate:(k,t)=>{$.value=k,N.value=t,b.value=1,ie()}}),(k,t)=>(u(),m("div",{class:"modal fade",id:"modal-wizard",tabindex:"-1",ref_key:"wizardModal",ref:f},[e("div",io,[e("div",ro,[e("div",co,[e("h5",uo,i(R.mode==="update"?"Application Update":"Application Registration"),1),t[25]||(t[25]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",mo,[e("ul",po,[e("li",vo,[e("a",{class:q(["nav-link",{active:b.value===1}]),href:"javascript:void(0);",onClick:t[0]||(t[0]=p=>W(1))},"1. Package",2)]),e("li",go,[e("a",{class:q(["nav-link",{active:b.value===2}]),href:"javascript:void(0);",onClick:t[1]||(t[1]=p=>W(2))},"2. General",2)]),e("li",bo,[e("a",{class:q(["nav-link",{active:b.value===3}]),href:"javascript:void(0);",onClick:t[2]||(t[2]=p=>W(3))},"3. Resource Requirements",2)]),e("li",fo,[e("a",{class:q(["nav-link",{active:b.value===4}]),href:"javascript:void(0);",onClick:t[3]||(t[3]=p=>W(4))},"4. Network",2)])]),M(e("div",null,[e("div",yo,[t[28]||(t[28]=e("label",{class:"form-label required"},"Target",-1)),e("div",ho,[e("div",_o,[M(e("input",{class:"form-check-input",type:"radio",name:"target",value:"VM","onUpdate:modelValue":t[4]||(t[4]=p=>s.value.target=p),id:"targetVM",disabled:R.mode==="update"},null,8,ko),[[Ge,s.value.target]]),t[26]||(t[26]=e("label",{class:"form-check-label",for:"targetVM"},"VM",-1))]),e("div",So,[M(e("input",{class:"form-check-input",type:"radio",name:"target",value:"K8S","onUpdate:modelValue":t[5]||(t[5]=p=>s.value.target=p),id:"targetK8S",disabled:R.mode==="update"},null,8,wo),[[Ge,s.value.target]]),t[27]||(t[27]=e("label",{class:"form-check-label",for:"targetK8S"},"K8S",-1))])])]),e("div",Co,[t[30]||(t[30]=e("label",{class:"form-label required"},"Category",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":t[6]||(t[6]=p=>s.value.category=p),disabled:R.mode==="update"},[t[29]||(t[29]=e("option",{value:""},"Select Category",-1)),(u(!0),m(G,null,X(be.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,Io))),128))],8,$o),[[ve,s.value.category]])]),e("div",To,[e("div",Ao,[t[32]||(t[32]=e("label",{class:"form-label required"},"Package",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":t[7]||(t[7]=p=>s.value.packageName=p),disabled:R.mode==="update"},[t[31]||(t[31]=e("option",{value:""},"Select Package",-1)),(u(!0),m(G,null,X(pe.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,No))),128))],8,Ro),[[ve,s.value.packageName]])]),e("div",Eo,[t[34]||(t[34]=e("label",{class:"form-label required"},"Version",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":t[8]||(t[8]=p=>s.value.version=p),disabled:R.mode==="update"},[t[33]||(t[33]=e("option",{value:""},"Select Version",-1)),(u(!0),m(G,null,X(le.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,Do))),128))],8,Mo),[[ve,s.value.version]])])])],512),[[Ae,b.value===1]]),M(e("div",null,[e("div",Uo,[t[35]||(t[35]=e("label",{class:"form-label required"},"Application Name",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":t[9]||(t[9]=p=>s.value.name=p),placeholder:"Application name"},null,512),[[B,s.value.name]])]),e("div",xo,[t[36]||(t[36]=e("label",{class:"form-label required"},"Summary",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":t[10]||(t[10]=p=>s.value.summary=p),placeholder:"Application summary"},null,512),[[B,s.value.summary]])]),e("div",Po,[t[37]||(t[37]=e("label",{class:"form-label required"},"Description",-1)),M(e("textarea",{class:"form-control",rows:"4","onUpdate:modelValue":t[11]||(t[11]=p=>s.value.description=p),placeholder:"Application description"},null,512),[[B,s.value.description]])]),e("div",Lo,[t[39]||(t[39]=e("label",{class:"form-label"},"Reference",-1)),(u(!0),m(G,null,X(T.value,(p,ce)=>(u(),m("div",{class:"row g-2 mb-2",key:ce},[e("div",Vo,[M(e("select",{class:"form-select","onUpdate:modelValue":Q=>p.refType=Q},t[38]||(t[38]=[qe('',6)]),8,Oo),[[ve,p.refType]])]),e("div",Bo,[M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":Q=>p.refValue=Q,placeholder:"Ref Value"},null,8,Go),[[B,p.refValue]])]),e("div",Ho,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:Q=>I(ce),disabled:T.value.length<=1},"-",8,Fo)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:ne,style:{color:"gray"}},"+ Add Reference")])],512),[[Ae,b.value===2]]),M(e("div",null,[e("div",zo,[e("div",Ko,[t[44]||(t[44]=e("label",{class:"form-label"},"CPU",-1)),e("div",qo,[e("div",Yo,[t[41]||(t[41]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",jo,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[12]||(t[12]=p=>s.value.minCpu=p),placeholder:"1"},null,512),[[B,s.value.minCpu,void 0,{number:!0}]]),t[40]||(t[40]=e("span",{class:"input-group-text"},"Cores",-1))])]),e("div",Wo,[t[43]||(t[43]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",Xo,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[13]||(t[13]=p=>s.value.recommendedCpu=p),placeholder:"2"},null,512),[[B,s.value.recommendedCpu,void 0,{number:!0}]]),t[42]||(t[42]=e("span",{class:"input-group-text"},"Cores",-1))])])])])]),e("div",Jo,[e("div",Zo,[t[49]||(t[49]=e("label",{class:"form-label"},"Memory",-1)),e("div",Qo,[e("div",es,[t[46]||(t[46]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",ts,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[14]||(t[14]=p=>s.value.minMemory=p),placeholder:"4"},null,512),[[B,s.value.minMemory,void 0,{number:!0}]]),t[45]||(t[45]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",as,[t[48]||(t[48]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",ls,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[15]||(t[15]=p=>s.value.recommendedMemory=p),placeholder:"8"},null,512),[[B,s.value.recommendedMemory,void 0,{number:!0}]]),t[47]||(t[47]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),e("div",os,[e("div",ss,[t[54]||(t[54]=e("label",{class:"form-label"},"Storage",-1)),e("div",ns,[e("div",is,[t[51]||(t[51]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",ds,[M(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":t[16]||(t[16]=p=>s.value.minDisk=p),placeholder:"10"},null,512),[[B,s.value.minDisk,void 0,{number:!0}]]),t[50]||(t[50]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",rs,[t[53]||(t[53]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",cs,[M(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":t[17]||(t[17]=p=>s.value.recommendedDisk=p),placeholder:"20"},null,512),[[B,s.value.recommendedDisk,void 0,{number:!0}]]),t[52]||(t[52]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),s.value.target==="K8S"?(u(),m("div",us,[e("div",ms,[e("div",ps,[t[55]||(t[55]=e("label",{class:"form-check-label me-2"},"K8S HPA",-1)),e("div",vs,[M(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[18]||(t[18]=p=>s.value.hpaEnabled=p)},null,512),[[Ct,s.value.hpaEnabled]])])]),e("div",gs,[e("div",bs,[t[56]||(t[56]=e("label",{class:"form-label"},"minReplicas",-1)),M(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":t[19]||(t[19]=p=>s.value.minReplicas=p),disabled:!s.value.hpaEnabled,placeholder:"1"},null,8,fs),[[B,s.value.minReplicas,void 0,{number:!0}]])]),e("div",ys,[t[57]||(t[57]=e("label",{class:"form-label"},"maxReplicas",-1)),M(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":t[20]||(t[20]=p=>s.value.maxReplicas=p),disabled:!s.value.hpaEnabled,placeholder:"10"},null,8,hs),[[B,s.value.maxReplicas,void 0,{number:!0}]])]),e("div",_s,[t[58]||(t[58]=e("label",{class:"form-label"},"CPU (%)",-1)),M(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":t[21]||(t[21]=p=>s.value.cpuThreshold=p),disabled:!s.value.hpaEnabled,placeholder:"80"},null,8,ks),[[B,s.value.cpuThreshold,void 0,{number:!0}]])]),e("div",Ss,[t[59]||(t[59]=e("label",{class:"form-label"},"Memory (%)",-1)),M(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":t[22]||(t[22]=p=>s.value.memoryThreshold=p),disabled:!s.value.hpaEnabled,placeholder:"80"},null,8,ws),[[B,s.value.memoryThreshold,void 0,{number:!0}]])])])])])):Y("",!0)],512),[[Ae,b.value===3]]),M(e("div",null,[s.value.target==="VM"?(u(),m("div",Cs,[e("div",$s,[t[61]||(t[61]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",Is,[e("div",Ts,[t[60]||(t[60]=e("label",{class:"form-label"},"Port",-1)),M(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":t[23]||(t[23]=p=>s.value.defaultPort=p),placeholder:"80"},null,512),[[B,s.value.defaultPort,void 0,{number:!0}]])])])])])):Y("",!0),s.value.target==="K8S"?(u(),m("div",As,[e("div",Rs,[t[67]||(t[67]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",Ns,[e("div",Es,[t[66]||(t[66]=e("label",{class:"form-label"},"Port",-1)),(u(!0),m(G,null,X(v.value,(p,ce)=>(u(),m("div",{class:"row g-2 mb-2",key:ce},[e("div",Ms,[t[62]||(t[62]=e("label",{class:"form-label small"},"Target Port",-1)),M(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":Q=>p.targetPort=Q,placeholder:"80"},null,8,Ds),[[B,p.targetPort,void 0,{number:!0}]])]),e("div",Us,[t[64]||(t[64]=e("label",{class:"form-label small"},"Protocol",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":Q=>p.protocol=Q},t[63]||(t[63]=[e("option",{value:"TCP"},"TCP",-1),e("option",{value:"UDP"},"UDP",-1),e("option",{value:"SCTP"},"SCTP",-1)]),8,xs),[[ve,p.protocol]])]),e("div",Ps,[t[65]||(t[65]=e("label",{class:"form-label small"},"Host Port",-1)),M(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":Q=>p.hostPort=Q,placeholder:"8080"},null,8,Ls),[[B,p.hostPort,void 0,{number:!0}]])]),e("div",Vs,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:Q=>z(ce),disabled:v.value.length<=1},"-",8,Os)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:E,style:{color:"gray"}},"+ Add Port Mapping")])])])])):Y("",!0)],512),[[Ae,b.value===4]])]),e("div",Bs,[e("a",{class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:j}," Cancel "),e("div",Gs,[e("button",{class:"btn btn-outline-secondary",disabled:b.value===1,onClick:J},"Prev",8,Hs),b.value<4?(u(),m("button",{key:0,class:"btn btn-primary",disabled:!g.value,onClick:A},"Next",8,Fs)):(u(),m("button",{key:1,class:"btn btn-primary",disabled:!g.value,onClick:t[24]||(t[24]=p=>R.mode==="update"?me():oe())},i(R.mode==="update"?"Update":"Create"),9,zs))])])])])],512))}}),qs=Ne(Ks,[["__scopeId","data-v-8dc8097e"]]),Ys={class:"modal-dialog",role:"document"},js={class:"modal-content"},Ws={class:"modal-body"},Xs={class:"modal-footer"},Js=["disabled"],Zs={key:0,class:"spinner-border spinner-border-sm me-2",role:"status"},Qs=ue({__name:"DeleteConfirmModal",props:{targetCatalog:{}},emits:["deleted","close"],setup(H,{expose:P,emit:F}){const R=H,D=F,w=ge(),b=h(!1),C=h(null),d=()=>{if(C.value)try{const _=window.bootstrap;if(_&&_.Modal)new _.Modal(C.value).show();else{C.value.classList.add("show"),C.value.style.display="block",document.body.classList.add("modal-open");const S=document.createElement("div");S.className="modal-backdrop fade show",S.id="delete-modal-backdrop",document.body.appendChild(S)}}catch(_){console.warn("Failed to show modal with Bootstrap, using fallback:",_),C.value.classList.add("show"),C.value.style.display="block",document.body.classList.add("modal-open")}},$=()=>{if(C.value)try{const _=window.bootstrap;if(_&&_.Modal){const S=_.Modal.getInstance(C.value);S?S.hide():N()}else N()}catch(_){console.warn("Failed to hide modal with Bootstrap, using fallback:",_),N()}},N=()=>{if(C.value){C.value.classList.remove("show"),C.value.style.display="none",document.body.classList.remove("modal-open");const _=document.getElementById("delete-modal-backdrop");_&&_.remove(),D("close")}},f=async()=>{var _;if((_=R.targetCatalog)!=null&&_.id){b.value=!0;try{await ut(R.targetCatalog.id),w.success(`${R.targetCatalog.name} catalog has been successfully deleted.`),$(),D("deleted",R.targetCatalog.id)}catch(S){console.error("Delete failed:",S),w.error("Failed to delete catalog.")}finally{b.value=!1}}},y=()=>{D("close")};return ke(()=>{C.value&&C.value.addEventListener("hidden.bs.modal",y)}),Ye(()=>{C.value&&C.value.removeEventListener("hidden.bs.modal",y)}),P({show:d,hide:$}),(_,S)=>(u(),m("div",{class:"modal fade",id:"deleteConfirmModal",tabindex:"-1",ref_key:"deleteModal",ref:C,onClick:_e($,["self"])},[e("div",Ys,[e("div",js,[e("div",{class:"modal-header"},[S[0]||(S[0]=e("h5",{class:"modal-title"},"Confirm Catalog Deletion",-1)),e("button",{type:"button",class:"btn-close",onClick:$,"aria-label":"Close"})]),e("div",Ws,[e("p",null,[S[1]||(S[1]=ae("Are you sure you want to delete ")),e("strong",null,i(_.targetCatalog.name),1),ae(" ("+i(_.targetCatalog.category)+") catalog?",1)]),S[2]||(S[2]=e("p",{class:"text-muted"},"This action cannot be undone.",-1))]),e("div",Xs,[e("button",{type:"button",class:"btn btn-secondary",onClick:$},"Cancel"),e("button",{type:"button",class:"btn btn-danger",onClick:f,disabled:b.value},[b.value?(u(),m("span",Zs)):Y("",!0),ae(" "+i(b.value?"Deleting...":"Delete"),1)],8,Js)])])])],512))}}),en={class:"modal-content"},tn={class:"modal-body"},an={class:"row"},ln={class:"col-lg-12"},on={class:"mb-3"},sn={class:"row"},nn={class:"col-lg-12"},dn={class:"mb-3"},rn={class:"row"},cn={class:"col-lg-12"},un={class:"mb-3"},mn=["value"],pn={class:"modal-footer"},vn=ue({__name:"uploadForm",props:{sourceData:{}},emits:["uploaded","close"],setup(H,{expose:P,emit:F}){const R=ge(),D=H,w=F,b=h({path:"",sourceType:"",name:"",tag:""});Re(()=>{var v,g;return[(v=D.sourceData)==null?void 0:v.sourceType,(g=D.sourceData)==null?void 0:g.name]},()=>{var v,g,A,J,j;(v=D.sourceData)!=null&&v.sourceType&&(b.value.sourceType=(g=D.sourceData)==null?void 0:g.sourceType),(A=D.sourceData)!=null&&A.name&&(b.value.name=(J=D.sourceData)==null?void 0:J.name,console.log(b.value.sourceType),b.value.sourceType.toUpperCase()=="DOCKERHUB"?$((j=D.sourceData)==null?void 0:j.name):b.value.sourceType.toUpperCase()=="ARTIFACTHUB"&&N(D.sourceData))},{immediate:!0});const C=h([]);He(()=>{d()});const d=()=>{b.value={path:"",sourceType:"",name:"",tag:""},C.value=[]},$=async v=>{var J;const g={path:((J=D.sourceData)==null?void 0:J.id)||""},{data:A}=await mt(g);C.value=[],A.length>0&&A.forEach(j=>{C.value.push({key:j.name,value:j.name})})},N=async v=>{console.log("sourceData",v);const g={kind:"helm",repository:v.repository.name,packageName:v.name},{data:A}=await pt(g);C.value=[],A.length>0&&A.forEach(J=>{C.value.push({key:J.version,value:J.version})})},f=()=>{if(!b.value.tag.trim()){R.error("Tag is required.");return}const v=je.cloneDeep(D.sourceData);v.tag=b.value.tag,v.sourceType=b.value.sourceType,v.name=b.value.name,w("uploaded",v),d(),s()},y=()=>{s()},_=()=>{d();const v=document.getElementById("upload-form-modal");if(v)try{const g=window.bootstrap;g&&g.Modal?new g.Modal(v).show():S()}catch(g){console.warn("Failed to show modal with Bootstrap, using fallback:",g),S()}},S=()=>{const v=document.getElementById("upload-form-modal");if(v){document.querySelectorAll(".modal-backdrop").forEach(J=>J.remove()),v.classList.add("show"),v.style.display="block",v.style.opacity="1",v.setAttribute("aria-hidden","false"),document.body.classList.add("modal-open");const A=document.createElement("div");A.className="modal-backdrop fade show",A.id="upload-modal-backdrop",document.body.appendChild(A)}},s=()=>{const v=document.getElementById("upload-form-modal");if(v)try{const g=window.bootstrap;if(g&&g.Modal){const A=g.Modal.getInstance(v);A?A.hide():T()}else T()}catch(g){console.warn("Failed to hide modal with Bootstrap, using fallback:",g),T()}},T=()=>{const v=document.getElementById("upload-form-modal");v&&(v.classList.remove("show","fade","in"),v.style.display="none",v.style.opacity="0",v.setAttribute("aria-hidden","true"),document.body.classList.remove("modal-open"),document.body.style.overflow="",document.body.style.paddingRight="",document.querySelectorAll(".modal-backdrop, #upload-modal-backdrop").forEach(A=>A.remove()),w("close"))};return He(()=>{d()}),P({show:_,hide:s}),(v,g)=>(u(),m("div",{class:"modal modal-blur fade",id:"upload-form-modal",tabindex:"-1",role:"dialog","aria-hidden":"true",onClick:y},[e("div",{class:"modal-dialog modal-lg modal-dialog-centered",role:"document",onClick:g[3]||(g[3]=_e(()=>{},["stop"]))},[e("div",en,[e("div",{class:"modal-header"},[g[4]||(g[4]=e("h5",{class:"modal-title"},"Upload Application",-1)),e("button",{type:"button",class:"btn-close",onClick:s,"aria-label":"Close"})]),e("div",tn,[e("form",{onSubmit:_e(f,["prevent"])},[e("div",an,[e("div",ln,[e("div",on,[g[5]||(g[5]=e("label",{class:"form-label"},"Source Type",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g[0]||(g[0]=A=>b.value.sourceType=A),disabled:""},null,512),[[B,b.value.sourceType]])])])]),e("div",sn,[e("div",nn,[e("div",dn,[g[6]||(g[6]=e("label",{class:"form-label"},"Name",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g[1]||(g[1]=A=>b.value.name=A),disabled:""},null,512),[[B,b.value.name]])])])]),e("div",rn,[e("div",cn,[e("div",un,[g[8]||(g[8]=e("label",{class:"form-label"},[ae("Tag "),e("span",{class:"text-red"},"*")],-1)),M(e("select",{class:"form-select","onUpdate:modelValue":g[2]||(g[2]=A=>b.value.tag=A)},[g[7]||(g[7]=e("option",{value:""},"Select Tag",-1)),(u(!0),m(G,null,X(C.value,A=>(u(),m("option",{value:A.value,key:A.key},i(A.value),9,mn))),128))],512),[[ve,b.value.tag]]),g[9]||(g[9]=e("small",{class:"form-hint"},"Please enter the tag for this catalog.",-1))])])])],32)]),e("div",pn,[e("button",{type:"button",class:"btn btn-link link-secondary",onClick:s}," Cancel "),e("button",{type:"submit",class:"btn btn-primary ms-auto",onClick:f},[V(Z(Pt),{class:"icon"}),g[10]||(g[10]=ae(" Upload "))])])])])]))}}),gn=Ne(vn,[["__scopeId","data-v-550ff2f5"]]),bn={ref:"sofwareCatalog"},fn={class:"row"},yn={class:"col-lg-9"},hn={class:"card"},_n={class:"list-group card-list-group",id:"sc-list-group"},kn={class:"row g-2 align-items-center"},Sn={class:"col-auto me-3"},wn=["src","onError"],Cn={key:1,class:"rounded catalog-icon-fallback d-flex align-items-center justify-content-center"},$n=["onClick"],In={class:"text-muted"},Tn=["onClick"],An={class:"text-muted",style:{width:"auto","text-align":"right"}},Rn={style:{color:"#e5b942"}},Nn={style:{color:"#e5b942"}},En={class:"text-muted",style:{width:"80px","text-align":"right"}},Mn={style:{color:"gray"}},Dn={class:"col-3 text-muted"},Un={class:"d-flex justify-content-end"},xn={class:"mouse-hover"},Pn=["onClick"],Ln={class:"text-muted"},Vn=["id"],On={class:"accordion-body pt-0"},Bn=["innerHTML"],Gn=["id"],Hn=["onClick"],Fn=["id"],zn=["id"],Kn={class:"btn btn-sm",style:{"margin-right":"5px"}},qn={class:"btn btn-sm",style:{"margin-right":"5px"}},Yn={class:"btn btn-sm",style:{"margin-right":"5px"}},jn={class:"mt-4"},Wn={class:"d-flex justify-content-between align-items-center mb-2"},Xn=["disabled","onClick"],Jn={key:0,class:"text-center text-muted py-3"},Zn={key:1,class:"table-responsive"},Qn={class:"table table-sm table-vcenter"},ei={key:0},ti={class:"text-end"},ai=["disabled","onClick"],li={class:"col-lg-3"},oi={class:"input-icon mb-3"},si={class:"input-icon-addon"},ni={key:0,class:"col-md-6 col-lg-12",id:"resultDockerHubEmpty"},ii={key:1,class:"row row-cards",id:"resultDockerHubSearch"},di={class:"card"},ri={class:"row row-0"},ci={class:"col-auto"},ui=["src"],mi={class:"col"},pi={class:"card-body"},vi=["href"],gi={class:"text-muted"},bi={class:"col-auto lh-1"},fi={class:"d-flex justify-content-end me-2 mt-4 mouse-hover"},yi={class:"mt-5"},hi={key:0,class:"col-md-6 col-lg-12",id:"resultArtifactHubEmpty"},_i={key:1,class:"row row-cards",id:"resultArtifactHubSearch"},ki={class:"card"},Si={class:"row row-0"},wi={class:"col"},Ci={class:"card-body"},$i=["href"],Ii={class:"text-muted"},Ti={class:"col-auto lh-1"},Ai={class:"d-flex justify-content-end me-2 mt-4 mouse-hover"},Ri=ue({__name:"softwareCatalogList",setup(H){const P=ge(),F=h([]),R=h(null),D=h(null),w=h({}),b=h("new"),C=h({}),d=h(""),$=h({}),N=h(null),f=h(null),y=h({}),_=h(null),S=h(""),s=h([]),T=h([]),v=h(0),g=h(null),A=h("");ke(async()=>{S.value="",j(),document.addEventListener("click",a=>{a.target.closest(".dropdown")||(A.value="")})});const J=()=>{j(),b.value="new",D.value=null,w.value={},R.value=0,C.value={},d.value="",setTimeout(()=>{_.value&&typeof _.value.initForCreate=="function"&&_.value.initForCreate()},100)},j=async()=>{try{await vt(S.value).then(({data:a})=>{je.forEach(a,function(n){n.refData=ne(n.catalogRefs),n.isShow=!1,n.deploymentStatuses=[],n.deploymentStatusLoaded=!1,n.deploymentStatusLoading=!1,n.resolvedLogoUrl=Ee(n),n.logoLoadFailed=!1}),F.value=a})}catch(a){console.log(a),P.error("Unable to retrieve data.")}},ne=a=>a.reduce((n,r)=>(n[r.refType]||(n[r.refType]=[]),n[r.refType].push(r),n),{}),I=async a=>{a.keyCode==13&&(await E(),await z())},E=async()=>{s.value=[];try{const{data:a}=await gt(S.value);if(a.results.length>0)for(let n=0;n<3;n++)s.value.push(a.results[n])}catch(a){console.log(a),P.error("Unable to retrieve data.")}},z=async()=>{T.value=[];try{const{data:a}=await bt(S.value);if(a.packages.length>0)for(let n=0;n<3;n++)T.value.push(a.packages[n])}catch(a){console.log(a),P.error("Unable to retrieve data.")}},K=a=>{const n=F.value.find(r=>r.id===a);D.value=a,w.value=n||{},b.value="update",setTimeout(()=>{_.value&&typeof _.value.initForUpdate=="function"&&_.value.initForUpdate(a,n)},100)},oe=a=>{$.value=a,N.value&&N.value.show()},me=async a=>{await j()},ie=()=>{$.value={}},de=async a=>{const n=F.value[a];n.isShow=!n.isShow,n.isShow&&!n.deploymentStatusLoaded&&await W(n)},W=async a=>{if(a!=null&&a.id){a.deploymentStatusLoading=!0;try{const{data:n}=await _t(a.id);a.deploymentStatuses=be(n),a.deploymentStatusLoaded=!0}catch(n){console.log(n),a.deploymentStatuses=[],P.error("Unable to retrieve deployment status.")}finally{a.deploymentStatusLoading=!1}}},be=a=>{const n=Array.isArray(a==null?void 0:a.deploymentHistories)?a.deploymentHistories:[];return(Array.isArray(a==null?void 0:a.applicationStatuses)?a.applicationStatuses:[]).map((x,U)=>{const l=fe(x,n);return pe(l,x,`status-${x.id||U}`)})},fe=(a,n)=>{if(!a)return null;const r=n.find(x=>a.deploymentHistoryId&&String(a.deploymentHistoryId)===String(x.id));return r||n.find(x=>ye(a.deploymentType,x.deploymentType)&&ye(a.namespace,x.namespace)&&(ye(a.vmId,x.vmId)||ye(a.clusterName,x.clusterName)))},pe=(a,n,r)=>({rowKey:r,deploymentId:(n==null?void 0:n.deploymentHistoryId)||(a==null?void 0:a.id)||null,deploymentType:ee((n==null?void 0:n.deploymentType)||(a==null?void 0:a.deploymentType)),target:ee(he(a,n)),csp:ee(a==null?void 0:a.cloudProvider),status:ee((n==null?void 0:n.status)||(n==null?void 0:n.podStatus)),ipOrEndpoint:ee(le(a,n)),lastCheckedOrDeployedAt:ee(Se(n==null?void 0:n.checkedAt))}),he=(a,n)=>{const r=(n==null?void 0:n.deploymentType)||(a==null?void 0:a.deploymentType),x=(n==null?void 0:n.namespace)||(a==null?void 0:a.namespace),U=(n==null?void 0:n.mciId)||(a==null?void 0:a.mciId),l=(n==null?void 0:n.vmId)||(a==null?void 0:a.vmId),o=(n==null?void 0:n.clusterName)||(a==null?void 0:a.clusterName);return r==="VM"?[x,U,l].filter(Boolean).join(" / "):r==="K8S"?[x,o].filter(Boolean).join(" / "):[x,U,l,o].filter(Boolean).join(" / ")},le=(a,n)=>{const r=(n==null?void 0:n.publicIp)||(a==null?void 0:a.publicIp),x=(n==null?void 0:n.servicePort)||(a==null?void 0:a.servicePort),U=a==null?void 0:a.ingressHost,l=a==null?void 0:a.ingressPath;return r&&x?`${r}:${x}`:r||(U&&l?`${U}${l}`:U||"")},ee=a=>a==null||a===""?"-":a,ye=(a,n)=>!a||!n?!1:String(a)===String(n),Se=a=>{if(!a)return"";const n=new Date(a);return Number.isNaN(n.getTime())?a:n.toLocaleString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})},k=a=>{if(!a)return;v.value=a;const n=document.getElementById("application-detail-modal");if(n)try{window.bootstrap&&window.bootstrap.Modal?new window.bootstrap.Modal(n).show():(n.style.display="block",n.classList.add("show"),document.body.classList.add("modal-open")),setTimeout(()=>{g.value&&g.value.refreshData(v.value)},100)}catch(r){console.error("Error opening detail modal:",r)}},t=(a,n)=>Object.prototype.hasOwnProperty.call(a,n),p=a=>{window.open(a)},ce={"apache tomcat":"/catalog-icons/apache-tomcat.png",redis:"/catalog-icons/redis.svg",nginx:"/catalog-icons/nginx.svg","apache http server":"/catalog-icons/apache-http-server.svg","nexus repository":"/catalog-icons/nexus-repository.svg",mariadb:"/catalog-icons/mariadb.svg",grafana:"/catalog-icons/grafana.svg",prometheus:"/catalog-icons/prometheus.svg",elasticsearch:"/catalog-icons/elasticsearch.svg"},Q=a=>String(a||"").trim().toLowerCase(),we=a=>ce[Q(a==null?void 0:a.name)]||"",Ee=a=>we(a)||(a==null?void 0:a.logoUrlLarge)||(a==null?void 0:a.logoUrlSmall)||"",Ce=a=>{const n=we(a);if(n&&a.resolvedLogoUrl!==n){a.resolvedLogoUrl=n,a.logoLoadFailed=!1;return}a.logoLoadFailed=!0},$e=a=>a.replace(/\\n|\n/g,"
"),Ie=(a,n)=>{y.value=a,y.value.sourceType=n,f.value&&f.value.show()},Te=async a=>{a.sourceType=="DockerHub"?(a.createdAt=a.created_at,a.updatedAt=a.updated_at,a.shortDescription=a.short_description,a.starCount=a.star_count,a.ratePlans=a.rate_plans,delete a.created_at,delete a.updated_at,delete a.short_description,delete a.star_count,delete a.rate_plans,await ft(a)):a.sourceType=="ArtifactHub"&&await yt(a),P.success("Software catalog uploaded successfully!")},Me=()=>{y.value={sourceType:"",name:"",sourceData:{}}};return(a,n)=>(u(),m(G,null,[e("div",bn,[e("div",{class:"d-flex justify-content-between align-items-center mb-3"},[n[1]||(n[1]=e("h2",{class:"mb-0"},"Catalog",-1)),e("button",{class:"btn btn-outline-primary d-none d-sm-inline-block",style:{"margin-right":"315px"},"data-bs-toggle":"modal","data-bs-target":"#modal-wizard",onClick:J}," Regist ")]),e("div",fn,[e("div",yn,[e("div",hn,[e("div",_n,[(u(!0),m(G,null,X(F.value,(r,x)=>(u(),m("div",{class:"list-group-item pe-1",key:x},[e("div",kn,[e("div",Sn,[r.resolvedLogoUrl&&!r.logoLoadFailed?(u(),m("img",{key:0,src:r.resolvedLogoUrl,class:"rounded catalog-icon",alt:"Catalog Icon",width:"40",height:"40",onError:U=>Ce(r)},null,40,wn)):(u(),m("div",Cn,[V(Z(We),{class:"icon",size:"22","stroke-width":"1.75"})]))]),e("div",{class:"col-5",onClick:U=>de(x)},[ae(i(r.name)+" ",1),e("div",In,i(r.summary),1)],8,$n),e("div",{class:"col-3 d-flex justify-content-end",onClick:U=>de(x)},[e("span",An,[V(Z(Lt),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"#e5b942"}),e("span",Rn,i(r.averageRating||0),1),e("span",Nn," ("+i(r.ratingCount||0)+") ",1)]),e("span",En,[V(Z(Mt),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"gray"}),e("span",Mn,i(r.downloadCount||0),1)])],8,Tn),e("div",Dn,[e("div",Un,[e("div",xn,[V(Z(Dt),{class:"me-2 cursor-pointer",size:"15","stroke-width":"2","data-bs-toggle":"modal","data-bs-target":"#modal-wizard",onClick:U=>K(r.id)},null,8,["onClick"]),V(Z(xt),{class:"cursor-pointer",size:"15","stroke-width":"2",onClick:U=>oe(r)},null,8,["onClick"])])]),e("div",{class:"d-flex justify-content-end",onClick:U=>de(x)},[e("span",Ln,i(r.category.length>25?r.category.substring(0,25)+"...":r.category),1)],8,Pn)]),e("div",{id:"accordion_"+r.id,class:"accordion-collapse collapse",style:$t([r.isShow?{display:"block"}:{display:"none"}])},[e("div",On,[e("div",{class:"mt-3 mb-5",innerHTML:$e(r.description)},null,8,Bn),e("div",null,[n[5]||(n[5]=e("strong",null,"Ref Information",-1)),e("ul",{id:`${x}-entity-ul`},[t(r.refData,"HOMEPAGE")?(u(!0),m(G,{key:0},X(r.refData.HOMEPAGE,(U,l)=>(u(),m("li",{key:l},[e("a",{class:"btn",onClick:o=>p(U.refValue)},i(U.refValue),9,Hn)]))),128)):Y("",!0)],8,Gn),n[6]||(n[6]=e("strong",null,"TAGS",-1)),e("ul",{id:`${x}-tag-ul`},[t(r.refData,"TAG")?(u(!0),m(G,{key:0},X(r.refData.TAG,(U,l)=>(u(),m("span",{key:l},"#"+i(U.refValue)+"  ",1))),128)):Y("",!0)],8,Fn),n[7]||(n[7]=e("strong",null,"Recommended Spec",-1)),e("ul",{id:`${x}-tag-ul`},[r.recommendedCpu&&r.recommendedMemory&&r.recommendedDisk?(u(),m(G,{key:0},[e("button",Kn," CPU : "+i(r.recommendedCpu)+" Core ",1),e("button",qn," MEMORY : "+i(r.recommendedMemory)+" GB ",1),e("button",Yn," DISK : "+i(r.recommendedDisk)+" GB ",1)],64)):Y("",!0)],8,zn),e("div",jn,[e("div",Wn,[n[2]||(n[2]=e("strong",null,"Deployment Status",-1)),e("button",{type:"button",class:"btn btn-sm btn-icon btn-ghost-secondary",title:"Refresh deployment status","aria-label":"Refresh deployment status",disabled:r.deploymentStatusLoading,onClick:_e(U=>W(r),["stop"])},[V(Z(Xe),{class:"icon",size:"18","stroke-width":"1.75"})],8,Xn)]),r.deploymentStatusLoading?(u(),m("div",Jn," Loading deployment status... ")):(u(),m("div",Zn,[e("table",Qn,[n[4]||(n[4]=e("thead",null,[e("tr",null,[e("th",null,"Type"),e("th",null,"Target"),e("th",null,"CSP"),e("th",null,"Status"),e("th",null,"IP/Endpoint"),e("th",null,"Last Checked"),e("th",{class:"text-end"},"Detail")])],-1)),e("tbody",null,[r.deploymentStatuses.length===0?(u(),m("tr",ei,n[3]||(n[3]=[e("td",{colspan:"7",class:"text-center text-muted"}," No deployment status available ",-1)]))):Y("",!0),(u(!0),m(G,null,X(r.deploymentStatuses,U=>(u(),m("tr",{key:U.rowKey},[e("td",null,i(U.deploymentType),1),e("td",null,i(U.target),1),e("td",null,i(U.csp),1),e("td",null,[e("span",{class:q(Z(Pe)(U.status))},i(Z(xe)(U.status)),3)]),e("td",null,i(U.ipOrEndpoint),1),e("td",null,i(U.lastCheckedOrDeployedAt),1),e("td",ti,[e("button",{type:"button",class:"btn btn-outline-primary",disabled:!U.deploymentId,onClick:_e(l=>k(U.deploymentId),["stop"])}," Detail ",8,ai)])]))),128))])])]))])])])],12,Vn)])]))),128))])])]),e("div",li,[e("div",oi,[e("span",si,[V(Z(ht),{class:"icon",width:"24",height:"24","stroke-width":"2"})]),M(e("input",{type:"text",class:"form-control",placeholder:"Search…",onKeypress:I,"onUpdate:modelValue":n[0]||(n[0]=r=>S.value=r),id:"inputCatalogSearch"},null,544),[[B,S.value]])]),n[10]||(n[10]=e("h3",{class:"mb-3"}," DOCKERHUB ",-1)),s.value.length<=0?(u(),m("div",ni," There are no related Container Images found. ")):Y("",!0),s.value.length>0?(u(),m("div",ii,[(u(!0),m(G,null,X(s.value,(r,x)=>(u(),m("div",{class:"col-md-6 col-lg-12",key:x},[e("div",di,[e("div",ri,[e("div",ci,[e("img",{src:r.logo_url.large,class:"rounded-start ms-2",alt:"Shape of You",width:"80",height:"80"},null,8,ui)]),e("div",mi,[e("div",pi,[e("a",{href:"https://hub.docker.com/search?q="+S.value,target:"_blank"},i(r==null?void 0:r.name),9,vi),e("div",gi,i((r==null?void 0:r.short_description.length)>30?(r==null?void 0:r.short_description.substring(0,30))+"...":""),1)])]),e("div",bi,[e("div",fi,[V(Z(ze),{class:"cursor-pointer",size:"20","stroke-width":"2",onClick:U=>Ie(r,"DockerHub")},null,8,["onClick"])])])])])]))),128))])):Y("",!0),e("div",yi,[n[9]||(n[9]=e("h3",{class:"mb-3"}," ARTIFACTHUB ",-1)),T.value.length<=0?(u(),m("div",hi," There are no related Helm Charts found. ")):Y("",!0),T.value.length>0?(u(),m("div",_i,[(u(!0),m(G,null,X(T.value,(r,x)=>(u(),m("div",{class:"col-md-6 col-lg-12",key:x},[e("div",ki,[e("div",Si,[n[8]||(n[8]=e("div",{class:"col-auto"},[e("img",{src:"https://artifacthub.io/static/media/placeholder_pkg_helm.png",class:"rounded-start",alt:"Shape of You",width:"80",height:"80"})],-1)),e("div",wi,[e("div",Ci,[e("a",{href:"https://artifacthub.io/packages/search?ts_query_web="+S.value+"&sort=relevance&page=1",target:"_blank"},i(r==null?void 0:r.name),9,$i),e("div",Ii,i((r==null?void 0:r.description.length)>30?(r==null?void 0:r.description.substring(0,30))+"...":""),1)])]),e("div",Ti,[e("div",Ai,[V(Z(ze),{class:"cursor-pointer",size:"20","stroke-width":"2",onClick:U=>Ie(r,"ArtifactHub")},null,8,["onClick"])])])])])]))),128))])):Y("",!0)])])])],512),V(Qs,{ref_key:"deleteConfirmModal",ref:N,"target-catalog":$.value,onDeleted:me,onClose:ie},null,8,["target-catalog"]),V(qs,{ref_key:"wizardModal",ref:_,mode:b.value,onCreated:j,onUpdated:j},null,8,["mode"]),V(gn,{ref_key:"uploadFormModal",ref:f,"source-data":y.value,onUploaded:Te,onClose:Me},null,8,["source-data"]),V(Je,{ref_key:"applicationDetailModalRef",ref:g,"deployment-id":v.value},null,8,["deployment-id"])],64))}}),Ni={class:"page",ref:"sofwareCatalog"},Ei={class:"page-wrapper"},Mi={class:"page-header d-print-none"},Di={class:"container-xxl"},Ui={class:"row g-2 align-items-center"},xi={class:"col-auto ms-auto"},Pi={class:"page-body"},Li={class:"container-xxl"},Vi={class:"row"},Oi={class:"col-lg-12"},Bi={class:"card"},Gi={class:"card-header"},Hi={class:"nav nav-tabs card-header-tabs","data-bs-toggle":"tabs"},Fi={class:"nav-item"},zi={href:"#tabs-catalog",class:"nav-link active","data-bs-toggle":"tab"},Ki={class:"nav-item"},qi={class:"nav-item"},Yi={href:"#tabs-repository",class:"nav-link","data-bs-toggle":"tab"},ji={class:"card-body"},Wi={class:"tab-content"},Xi={class:"tab-pane active show",id:"tabs-catalog"},Ji={class:"tab-pane",id:"tabs-status"},Zi={class:"tab-pane",id:"tabs-repository"},cd=ue({__name:"SoftwareCatalog",setup(H){const P=It(),F=h(""),R=h(""),D=h(!1),w=h(""),b=h(null);ke(async()=>{F.value=P.getNsId()});const C=f=>{R.value=f},d=async()=>{var f;await Tt(),(f=b.value)==null||f.refresh()},$=f=>{w.value=f,D.value=!0},N=()=>{D.value=!1,w.value=""};return(f,y)=>(u(),m(G,null,[e("div",Ni,[e("div",Ei,[e("div",Mi,[e("div",Di,[e("div",Ui,[y[1]||(y[1]=e("div",{class:"col d-flex"},[e("h2",{class:"page-title"},"Software Catalog")],-1)),e("div",xi,[e("button",{class:"btn btn-outline-primary d-none d-sm-inline-block","data-bs-toggle":"modal","data-bs-target":"#install-form",onClick:y[0]||(y[0]=_=>C("Application Installation"))}," DEPLOY ")])])])]),e("div",Pi,[e("div",Li,[e("div",Vi,[e("div",Oi,[e("div",Bi,[e("div",Gi,[e("ul",Hi,[e("li",Fi,[e("a",zi,[V(Z(Et),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[2]||(y[2]=ae(" Catalog "))])]),e("li",Ki,[e("a",{href:"#tabs-status",class:"nav-link","data-bs-toggle":"tab",onClick:d},[V(Z(Nt),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[3]||(y[3]=ae(" Apps Status "))])]),e("li",qi,[e("a",Yi,[V(Z(Ut),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[4]||(y[4]=ae(" Repository "))])])])]),e("div",ji,[e("div",Wi,[e("div",Xi,[e("div",null,[V(Ri,{nsId:F.value},null,8,["nsId"])])]),e("div",Ji,[e("div",null,[V(no,{ref_key:"applicationStatusListRef",ref:b},null,512)])]),e("div",Zi,[e("div",null,[D.value?(u(),Fe(Rt,{key:1,embedded:!0,"repository-name":w.value,onBackToList:N},null,8,["repository-name"])):(u(),Fe(At,{key:0,embedded:!0,onOpenDetail:$}))])])])])])])])])])])],512),V(kt,{"ns-id":F.value,title:R.value},null,8,["ns-id","title"])],64))}});export{cd as default}; diff --git a/src/main/resources/static/assets/SoftwareCatalogListTest-MivSwlTC.js b/src/main/resources/static/assets/SoftwareCatalogListTest-DSIjiOry.js similarity index 96% rename from src/main/resources/static/assets/SoftwareCatalogListTest-MivSwlTC.js rename to src/main/resources/static/assets/SoftwareCatalogListTest-DSIjiOry.js index c240433b..877ef10c 100644 --- a/src/main/resources/static/assets/SoftwareCatalogListTest-MivSwlTC.js +++ b/src/main/resources/static/assets/SoftwareCatalogListTest-DSIjiOry.js @@ -1,4 +1,4 @@ -import{c as R,I as B}from"./IconPlus-BsY6bQ-u.js";import{i as P,x as O,o as U,A as G,I as V}from"./softwareCatalogForm.vue_vue_type_style_index_0_scoped_c201966c_lang-Cv7irf01.js";import{d as D,c as I,h as l,a as n,b as t,t as v,r as c,w as L,o as M,q as N,i as w,p as T,F as $,f as S,j as k,u as j,l as A}from"./index-kUd7CzTD.js";import{_ as H}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as z}from"./lodash-CIYw4d6b.js";import"./request-C4mhQyyH.js";/** +import{c as R,I as B}from"./IconPlus-DRtzYi91.js";import{i as P,x as O,o as U,A as G,I as V}from"./softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-Dn3T2TCo.js";import{d as D,c as I,h as l,a as n,b as t,t as v,r as c,w as L,o as M,q as N,i as w,p as T,F as $,f as S,j as k,u as j,l as A}from"./index-DpY2Dwv5.js";import{_ as H}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as z}from"./lodash-CJvlDKzA.js";import"./request-BI8njqPY.js";/** * @license @tabler/icons-vue v3.22.0 - MIT * * This source code is licensed under the MIT license. diff --git a/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-BUAHCQs0.js b/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-Cy0Pje7A.js similarity index 99% rename from src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-BUAHCQs0.js rename to src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-Cy0Pje7A.js index 688dc06c..9976233a 100644 --- a/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-BUAHCQs0.js +++ b/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-Cy0Pje7A.js @@ -1,4 +1,4 @@ -var vt=Object.defineProperty;var wt=(l,e,t)=>e in l?vt(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t;var b=(l,e,t)=>wt(l,typeof e!="symbol"?e+"":e,t);import{d as Ct,r as Ge,w as je,o as Et,E as yt,s as Rt,a as xt,h as Tt}from"./index-kUd7CzTD.js";class M{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return typeof t<"u"&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class x{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var s=e?t.split(e):[t],n=s.length,r;for(let o=0;od.subject===o),a>-1?t[r]=i[a].copy:(h=Object.assign(Array.isArray(o)?[]:{},o),i.unshift({subject:o,copy:h}),t[r]=this.deepClone(o,h,i)))}return t}}let kt=class Ke extends M{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return typeof e=="string"?(e=document.querySelector(e),e||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):e===!0&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t?!0:t.parentNode?this._checkContainerIsParent(e,t.parentNode):!1}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,s=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let n=x.elOffset(this.container);i-=n.left,s-=n.top}return{x:i,y:s}}elementPositionCoords(e,t="right"){var i=x.elOffset(e),s,n,r;switch(this.container!==document.body&&(s=x.elOffset(this.container),i.left-=s.left,i.top-=s.top),t){case"right":n=i.left+e.offsetWidth,r=i.top-1;break;case"bottom":n=i.left,r=i.top+e.offsetHeight;break;case"left":n=i.left,r=i.top-1;break;case"top":n=i.left,r=i.top;break;case"center":n=i.left+e.offsetWidth/2,r=i.top+e.offsetHeight/2;break}return{x:n,y:r,offset:i}}show(e,t){var i,s,n,r,o;return this.destroyed||this.table.destroyed?this:(e instanceof HTMLElement?(n=e,o=this.elementPositionCoords(e,t),r=o.offset,i=o.x,s=o.y):typeof e=="number"?(r={top:0,left:0},i=e,s=t):(o=this.containerEventCoords(e),i=o.x,s=o.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(i,s,n,r,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",a=>{a.stopPropagation()}),this)}_fitToScreen(e,t,i,s,n){var r=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",i?this.element.style.right=this.container.offsetWidth-s.left+"px":this.element.style.right=this.container.offsetWidth-e+"px",this.reversedX=!0);let o=Math.max(this.container.offsetHeight,r?this.container.scrollHeight:0);if(t+this.element.offsetHeight>o)if(i)switch(n){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.height=o+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=e),this}_escapeCheck(e){e.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new Ke(this.table,e,this),this.childPopup}};class w extends M{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){typeof this.table[e]>"u"?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler&&(i=this.table.rowManager.displayPipeline.findIndex(s=>s.handler===this._handler),i>-1&&(t=i)),e&&(t=t+e),this._handler)return t>-1?this.table.rowManager.getDisplayRows(t):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new kt(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var Mt={rownum:function(l,e,t,i,s,n){return n.getPosition()}};const K=class K extends w{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(s=>{var n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1)),r;e.definition[n]&&(r=this.lookupAccessor(e.definition[n]),r&&(t=!0,i[n]={accessor:r,params:e.definition[n+"Params"]||{}}))}),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":K.accessors[e]?t=K.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),s=e.getComponent(),n=x.deepClone(e.data||{});return this.table.columnManager.traverse(function(r){var o,a,h,d;r.modules.accessor&&(a=r.modules.accessor[i]||r.modules.accessor.accessor||!1,a&&(o=r.getFieldValue(n),o!="undefined"&&(d=r.getComponent(),h=typeof a.params=="function"?a.params(o,n,t,d,s):a.params,r.setFieldValue(n,a.accessor(o,n,t,h,d,s)))))}),n}};b(K,"moduleName","accessor"),b(K,"accessors",Mt);let ce=K;var Lt={method:"GET"};function fe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(fe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(fe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}function St(l){var e=fe(l),t=[];return e.forEach(function(i){t.push(encodeURIComponent(i.key)+"="+encodeURIComponent(i.value))}),t.join("&")}function qe(l,e,t){return l&&t&&Object.keys(t).length&&(!e.method||e.method.toLowerCase()=="get")&&(e.method="get",l+=(l.includes("?")?"&":"?")+St(t)),l}function Dt(l,e,t){var i;return new Promise((s,n)=>{if(l=this.urlGenerator.call(this.table,l,e,t),e.method.toUpperCase()!="GET")if(i=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],i){for(var r in i.headers)e.headers||(e.headers={}),typeof e.headers[r]>"u"&&(e.headers[r]=i.headers[r]);e.body=i.body.call(this,l,e,t)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);l?(typeof e.headers>"u"&&(e.headers={}),typeof e.headers.Accept>"u"&&(e.headers.Accept="application/json"),typeof e.headers["X-Requested-With"]>"u"&&(e.headers["X-Requested-With"]="XMLHttpRequest"),typeof e.mode>"u"&&(e.mode="cors"),e.mode=="cors"?(typeof e.headers.Origin>"u"&&(e.headers.Origin=window.location.origin),typeof e.credentials>"u"&&(e.credentials="same-origin")):typeof e.credentials>"u"&&(e.credentials="include"),fetch(l,e).then(o=>{o.ok?o.json().then(a=>{s(a)}).catch(a=>{n(a),console.warn("Ajax Load Error - Invalid JSON returned",a)}):(console.error("Ajax Load Error - Connection Error: "+o.status,o.statusText),n(o))}).catch(o=>{console.error("Ajax Load Error - Connection Error: ",o),n(o)})):(console.warn("Ajax Load Error - No URL Set"),s([]))})}function pe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(pe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(pe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}var zt={json:{headers:{"Content-Type":"application/json"},body:function(l,e,t){return JSON.stringify(t)}},form:{headers:{},body:function(l,e,t){var i=pe(t),s=new FormData;return i.forEach(function(n){s.append(n.key,n.value)}),s}}};const F=class F extends w{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=F.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||F.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||F.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var n=this.table.options.ajaxParams;return n&&(typeof n=="function"&&(n=n.call(this.table)),s=Object.assign(Object.assign({},n),s)),s}requestDataCheck(e,t,i,s){return!!(!e&&this.url||typeof e=="string")}requestData(e,t,i,s,n){var r;return!n&&this.requestDataCheck(e)?(e&&this.setUrl(e),r=this.generateConfig(i),this.sendRequest(this.url,t,r)):n}setDefaultConfig(e={}){this.config=Object.assign({},F.defaultConfig),typeof e=="string"?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return typeof e=="string"?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return this.table.options.ajaxRequesting.call(this.table,e,t)!==!1?this.loaderPromise(e,i,t).then(s=>(this.table.options.ajaxResponse&&(s=this.table.options.ajaxResponse.call(this.table,e,t,s)),s)):Promise.reject()}};b(F,"moduleName","ajax"),b(F,"defaultConfig",Lt),b(F,"defaultURLGenerator",qe),b(F,"defaultLoaderPromise",Dt),b(F,"contentTypeFormatters",zt);let me=F;var Ht={replace:function(l){return this.table.setData(l)},update:function(l){return this.table.updateOrAddData(l)},insert:function(l){return this.table.addData(l)}},Ft={table:function(l){var e=[],t=!0,i=this.table.columnManager.columns,s=[],n=[];return l=l.split(` +var vt=Object.defineProperty;var wt=(l,e,t)=>e in l?vt(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t;var b=(l,e,t)=>wt(l,typeof e!="symbol"?e+"":e,t);import{d as Ct,r as Ge,w as je,o as Et,E as yt,s as Rt,a as xt,h as Tt}from"./index-DpY2Dwv5.js";class M{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return typeof t<"u"&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class x{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var s=e?t.split(e):[t],n=s.length,r;for(let o=0;od.subject===o),a>-1?t[r]=i[a].copy:(h=Object.assign(Array.isArray(o)?[]:{},o),i.unshift({subject:o,copy:h}),t[r]=this.deepClone(o,h,i)))}return t}}let kt=class Ke extends M{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return typeof e=="string"?(e=document.querySelector(e),e||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):e===!0&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t?!0:t.parentNode?this._checkContainerIsParent(e,t.parentNode):!1}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,s=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let n=x.elOffset(this.container);i-=n.left,s-=n.top}return{x:i,y:s}}elementPositionCoords(e,t="right"){var i=x.elOffset(e),s,n,r;switch(this.container!==document.body&&(s=x.elOffset(this.container),i.left-=s.left,i.top-=s.top),t){case"right":n=i.left+e.offsetWidth,r=i.top-1;break;case"bottom":n=i.left,r=i.top+e.offsetHeight;break;case"left":n=i.left,r=i.top-1;break;case"top":n=i.left,r=i.top;break;case"center":n=i.left+e.offsetWidth/2,r=i.top+e.offsetHeight/2;break}return{x:n,y:r,offset:i}}show(e,t){var i,s,n,r,o;return this.destroyed||this.table.destroyed?this:(e instanceof HTMLElement?(n=e,o=this.elementPositionCoords(e,t),r=o.offset,i=o.x,s=o.y):typeof e=="number"?(r={top:0,left:0},i=e,s=t):(o=this.containerEventCoords(e),i=o.x,s=o.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(i,s,n,r,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",a=>{a.stopPropagation()}),this)}_fitToScreen(e,t,i,s,n){var r=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",i?this.element.style.right=this.container.offsetWidth-s.left+"px":this.element.style.right=this.container.offsetWidth-e+"px",this.reversedX=!0);let o=Math.max(this.container.offsetHeight,r?this.container.scrollHeight:0);if(t+this.element.offsetHeight>o)if(i)switch(n){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.height=o+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=e),this}_escapeCheck(e){e.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new Ke(this.table,e,this),this.childPopup}};class w extends M{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){typeof this.table[e]>"u"?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler&&(i=this.table.rowManager.displayPipeline.findIndex(s=>s.handler===this._handler),i>-1&&(t=i)),e&&(t=t+e),this._handler)return t>-1?this.table.rowManager.getDisplayRows(t):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new kt(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var Mt={rownum:function(l,e,t,i,s,n){return n.getPosition()}};const K=class K extends w{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(s=>{var n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1)),r;e.definition[n]&&(r=this.lookupAccessor(e.definition[n]),r&&(t=!0,i[n]={accessor:r,params:e.definition[n+"Params"]||{}}))}),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":K.accessors[e]?t=K.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),s=e.getComponent(),n=x.deepClone(e.data||{});return this.table.columnManager.traverse(function(r){var o,a,h,d;r.modules.accessor&&(a=r.modules.accessor[i]||r.modules.accessor.accessor||!1,a&&(o=r.getFieldValue(n),o!="undefined"&&(d=r.getComponent(),h=typeof a.params=="function"?a.params(o,n,t,d,s):a.params,r.setFieldValue(n,a.accessor(o,n,t,h,d,s)))))}),n}};b(K,"moduleName","accessor"),b(K,"accessors",Mt);let ce=K;var Lt={method:"GET"};function fe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(fe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(fe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}function St(l){var e=fe(l),t=[];return e.forEach(function(i){t.push(encodeURIComponent(i.key)+"="+encodeURIComponent(i.value))}),t.join("&")}function qe(l,e,t){return l&&t&&Object.keys(t).length&&(!e.method||e.method.toLowerCase()=="get")&&(e.method="get",l+=(l.includes("?")?"&":"?")+St(t)),l}function Dt(l,e,t){var i;return new Promise((s,n)=>{if(l=this.urlGenerator.call(this.table,l,e,t),e.method.toUpperCase()!="GET")if(i=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],i){for(var r in i.headers)e.headers||(e.headers={}),typeof e.headers[r]>"u"&&(e.headers[r]=i.headers[r]);e.body=i.body.call(this,l,e,t)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);l?(typeof e.headers>"u"&&(e.headers={}),typeof e.headers.Accept>"u"&&(e.headers.Accept="application/json"),typeof e.headers["X-Requested-With"]>"u"&&(e.headers["X-Requested-With"]="XMLHttpRequest"),typeof e.mode>"u"&&(e.mode="cors"),e.mode=="cors"?(typeof e.headers.Origin>"u"&&(e.headers.Origin=window.location.origin),typeof e.credentials>"u"&&(e.credentials="same-origin")):typeof e.credentials>"u"&&(e.credentials="include"),fetch(l,e).then(o=>{o.ok?o.json().then(a=>{s(a)}).catch(a=>{n(a),console.warn("Ajax Load Error - Invalid JSON returned",a)}):(console.error("Ajax Load Error - Connection Error: "+o.status,o.statusText),n(o))}).catch(o=>{console.error("Ajax Load Error - Connection Error: ",o),n(o)})):(console.warn("Ajax Load Error - No URL Set"),s([]))})}function pe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(pe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(pe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}var zt={json:{headers:{"Content-Type":"application/json"},body:function(l,e,t){return JSON.stringify(t)}},form:{headers:{},body:function(l,e,t){var i=pe(t),s=new FormData;return i.forEach(function(n){s.append(n.key,n.value)}),s}}};const F=class F extends w{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=F.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||F.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||F.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var n=this.table.options.ajaxParams;return n&&(typeof n=="function"&&(n=n.call(this.table)),s=Object.assign(Object.assign({},n),s)),s}requestDataCheck(e,t,i,s){return!!(!e&&this.url||typeof e=="string")}requestData(e,t,i,s,n){var r;return!n&&this.requestDataCheck(e)?(e&&this.setUrl(e),r=this.generateConfig(i),this.sendRequest(this.url,t,r)):n}setDefaultConfig(e={}){this.config=Object.assign({},F.defaultConfig),typeof e=="string"?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return typeof e=="string"?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return this.table.options.ajaxRequesting.call(this.table,e,t)!==!1?this.loaderPromise(e,i,t).then(s=>(this.table.options.ajaxResponse&&(s=this.table.options.ajaxResponse.call(this.table,e,t,s)),s)):Promise.reject()}};b(F,"moduleName","ajax"),b(F,"defaultConfig",Lt),b(F,"defaultURLGenerator",qe),b(F,"defaultLoaderPromise",Dt),b(F,"contentTypeFormatters",zt);let me=F;var Ht={replace:function(l){return this.table.setData(l)},update:function(l){return this.table.updateOrAddData(l)},insert:function(l){return this.table.addData(l)}},Ft={table:function(l){var e=[],t=!0,i=this.table.columnManager.columns,s=[],n=[];return l=l.split(` `),l.forEach(function(r){e.push(r.split(" "))}),e.length&&!(e.length===1&&e[0].length<2)?(e[0].forEach(function(r){var o=i.find(function(a){return r&&a.definition.title&&r.trim()&&a.definition.title.trim()===r.trim()});o?s.push(o):t=!1}),t||(t=!0,s=[],e[0].forEach(function(r){var o=i.find(function(a){return r&&a.field&&r.trim()&&a.field.trim()===r.trim()});o?s.push(o):t=!1}),t||(s=this.table.columnManager.columnsByIndex)),t&&e.shift(),e.forEach(function(r){var o={};r.forEach(function(a,h){s[h]&&(o[s[h].field]=a)}),n.push(o)}),n):!1}},Pt={copyToClipboard:["ctrl + 67","meta + 67"]},Ot={copyToClipboard:function(l){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},At={keybindings:{bindings:Pt,actions:Ot}};const _=class _ extends w{constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,(this.mode===!0||this.mode==="copy")&&this.table.element.addEventListener("copy",e=>{var t,i,s;this.blocked||(e.preventDefault(),this.customSelection?(t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t))):(s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),i=this.table.modules.export.generateHTMLTable(s),t=i?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset())}),(this.mode===!0||this.mode==="paste")&&this.table.element.addEventListener("paste",e=>{this.paste(e)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach(i=>{var s=[];i.columns.forEach(n=>{var r="";if(n)if(i.type==="group"&&(n.value=n.component.getKey()),n.value===null)r="";else switch(typeof n.value){case"object":r=JSON.stringify(n.value);break;case"undefined":r="";break;default:r=n.value}s.push(r)}),t.push(s.join(" "))}),t.join(` `)}copy(e,t){var i,s;this.blocked=!1,this.customSelection=!1,(this.mode===!0||this.mode==="copy")&&(this.rowRange=e||this.table.options.clipboardCopyRowRange,typeof window.getSelection<"u"&&typeof document.createRange<"u"?(e=document.createRange(),e.selectNodeContents(this.table.element),i=window.getSelection(),i.toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):typeof document.selection<"u"&&typeof document.body.createTextRange<"u"&&(s=document.body.createTextRange(),s.moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=_.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e;break}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=_.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e;break}}paste(e){var t,i,s;this.checkPasteOrigin(e)&&(t=this.getPasteData(e),i=this.pasteParser.call(this,t),i?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach(i=>{t.push(this.table.modules.mutator.transformRow(i,"clipboard"))}):t=e,t}checkPasteOrigin(e){var t=!0,i=this.confirm("clipboard-paste",[e]);return(i||!["DIV","SPAN"].includes(e.target.tagName))&&(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}};b(_,"moduleName","clipboard"),b(_,"moduleExtensions",At),b(_,"pasteActions",Ht),b(_,"pasteParsers",Ft);let ge=_;class _t{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}_getSelf(){return this._row}}class Ye{constructor(e){return this._cell=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._cell.table.componentFunctionBinder.handle("cell",t._cell,i)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(e){return this._cell.row.getData(e)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){typeof t>"u"&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class ne extends M{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.column.isRowHeader&&this.element.classList.add("tabulator-row-header")}_configureCell(){var e=this.element,t=this.column.getField(),i={top:"flex-start",bottom:"flex-end",middle:"center"},s={left:"flex-start",right:"flex-end",center:"center"};if(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems=i[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent=s[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass){var n=this.column.definition.cssClass.split(" ");n.forEach(r=>{e.classList.add(r)})}this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(e=this.chain("cell-format",this,null,()=>this.element.innerHTML=this.value),typeof e){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",e!=null&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){var s=this.setValueProcessData(e,t,i);s&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var s=!1;return(this.value!==e||i)&&(s=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),s&&this.dispatch("cell-value-changed",this),s}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new Ye(this)),this.component}}class $e{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._column.table.componentFunctionBinder.handle("column",t._column,i)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach(function(e){e.show()}):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach(function(e){e.hide()}):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach(function(t){e.push(t.getComponent())}),e}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(e,t){return this._column.table.columnManager.scrollToColumn(this._column,e,t)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return e?e.getComponent():!1}getPrevColumn(){var e=this._column.prevColumn();return e?e.getComponent():!1}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return e===!0?t=this._column.reinitializeWidth(!0):t=this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}var Qe={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};const W=class W extends M{constructor(e,t,i){super(t.table),this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.isGroup=!1,this.isRowHeader=i,this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach((s,n)=>{var r=new W(s,this);this.attachColumn(r)}),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize()}createElement(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.isRowHeader&&e.classList.add("tabulator-row-header"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end";break}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)typeof this.definition[t]>"u"&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(W.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach(e=>{W.defaultOptionList.indexOf(e)===-1&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)})}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach(function(e){e.reRegisterPosition()}):this.registerColumnPosition(this)}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),e.headerVertical==="flip"&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;if(this.dispatch("column-layout",this),typeof e.visible<"u"&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass){var t=e.cssClass.split(" ");t.forEach(i=>{this.element.classList.add(i)})}e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.headerWordWrap&&t.classList.add("tabulator-col-title-wrap"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",s=>{s.stopPropagation(),i.focus()}),i.addEventListener("mousedown",s=>{s.stopPropagation()}),i.addEventListener("change",()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())}),t.appendChild(i),e.field?this.langBind("columns|"+e.field,s=>{i.value=s||e.title||" "}):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,s=>{this._formatColumnHeaderTitle(t,s||e.title||" ")}):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,()=>t);switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){var e=this.definition.cssClass.split(" ");e.forEach(t=>{this.element.classList.add(t)})}this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t=e,i=this.fieldStructure,s=i.length,n;for(let r=0;r{t.push(i),t=t.concat(i.getColumns(!0))}):t=this.columns,t}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(e){var t=[];return this.isGroup&&e&&(this.columns.forEach(function(i){t.push(i.getDefinition(!0))}),this.definition.columns=t),this.definition}checkColumnVisibility(){var e=!1;this.columns.forEach(function(t){t.visible&&(e=!0)}),e?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(e,t){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.show()}),!this.isGroup&&this.width===null&&this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(e,t){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.hide()}),this.dispatch("column-hide",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var e=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}),this.contentElement.style.maxWidth=e-1+"px",this.table.initialized&&(this.element.style.width=e+"px"),this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(e){var t=this.columns.indexOf(e);t>-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(t){t.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this),this.subscribedExternal("columnWidth")&&this.dispatchExternal("columnWidth",this.getComponent())}checkCellHeights(){var e=[];this.cells.forEach(function(t){t.row.heightInitialized&&(t.row.getElement().offsetParent!==null?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)}),e.forEach(function(t){t.calcHeight()}),e.forEach(function(t){t.setCellHeight()})}getWidth(){var e=0;return this.isGroup?this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}):e=this.width,e}getLeftOffset(){var e=this.element.offsetLeft;return this.parent.isGroup&&(e+=this.parent.getLeftOffset()),e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(t){t.setMinWidth()})}setMaxWidth(e){this.minWidth&&e{this.isGroup&&this.columns.forEach(function(s){s.delete()}),this.dispatch("column-delete",this);var i=this.cells.length;for(let s=0;s-1?this._nextVisibleColumn(e+1):!1}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1?this._prevVisibleColumn(e-1):!1}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,typeof this.definition.width<"u"&&!e&&this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach(s=>{s.clearWidth()}));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach(s=>{var n=s.getWidth();n>t&&(t=n)}),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then(i=>(t.field==this.field&&(this.field=!1),this.delete().then(()=>i.getComponent()))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new $e(this)),this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof W?this.parent.getComponent():!1}};b(W,"defaultOptionList",Qe);let U=W;class oe{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(e,t){return this._row.table.rowManager.scrollToRow(this._row,e,t)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e&&e.getComponent()}getPrevRow(){var e=this._row.prevRow();return e&&e.getComponent()}}class S extends M{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e,t){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,t),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,t)}rendered(){this.cells.forEach(e=>{e.cellRendered()})}reinitializeHeight(){this.heightInitialized=!1,this.element&&this.element.offsetParent!==null&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&this.element.offsetParent!==null&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t=0,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(i=this.calcMinHeight(),t=this.calcMaxHeight(),e?this.height=Math.max(t,i):this.height=this.manualHeight?this.height:Math.max(t,i)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var e=0;return this.cells.forEach(function(t){var i=t.getHeight();i>e&&(e=i)}),e}setCellHeight(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach(function(e){e.clearHeight()})}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight,this.subscribedExternal("rowHeight")&&this.dispatchExternal("rowHeight",this.getComponent()))}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var t=this.element&&x.elVisible(this.element),i={},s;return new Promise((n,r)=>{typeof e=="string"&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(i=Object.assign(i,this.data),i=Object.assign(i,e)),s=this.chain("row-data-changing",[this,i,e],null,e);for(let o in s)this.data[o]=s[o];this.dispatch("row-data-save-after",this);for(let o in e)this.table.columnManager.getColumnsByFieldRoot(o).forEach(h=>{let d=this.getCell(h.getField());if(d){let u=h.getFieldValue(s);d.getValue()!==u&&(d.setValueProcessData(u),t&&d.cellRendered())}});t?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,t,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n()})}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){var t=!1;return e=this.table.columnManager.findColumn(e),!this.initialized&&this.cells.length===0&&this.generateCells(),t=this.cells.find(function(i){return i.column===e}),t}getCellIndex(e){return this.cells.findIndex(function(t){return t===e})}findCell(e){return this.cells.find(t=>t.element===e)}getCells(){return!this.initialized&&this.cells.length===0&&this.generateCells(),this.cells}nextRow(){var e=this.table.rowManager.nextDisplayRow(this,!0);return e||!1}prevRow(){var e=this.table.rowManager.prevDisplayRow(this,!0);return e||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t{t(this.position)}))}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new oe(this)),this.component}}var Bt={avg:function(l,e,t){var i=0,s=typeof t.precision<"u"?t.precision:2;return l.length&&(i=l.reduce(function(n,r){return Number(n)+Number(r)}),i=i/l.length,i=s!==!1?i.toFixed(s):i),parseFloat(i).toString()},max:function(l,e,t){var i=null,s=typeof t.precision<"u"?t.precision:!1;return l.forEach(function(n){n=Number(n),(n>i||i===null)&&(i=n)}),i!==null?s!==!1?i.toFixed(s):i:""},min:function(l,e,t){var i=null,s=typeof t.precision<"u"?t.precision:!1;return l.forEach(function(n){n=Number(n),(n(l||s===0)&&l.indexOf(s)===n);return i.length}};const B=class B extends w{constructor(e){super(e),this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-calcs-holder"),e}initialize(){this.genColumn=new U({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(e){this.recalc(this.table.rowManager.activeRows),e&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(e,t){return this.topRow&&t.unshift(this.topRow),this.botRow&&t.push(this.botRow),t}rowsUpdated(e){this.table.options.groupBy?this.recalcRowGroup(e):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(e){(e.column.definition.topCalc||e.column.definition.bottomCalc)&&(this.table.options.groupBy?((this.table.options.columnCalcs=="table"||this.table.options.columnCalcs=="both")&&this.recalcActiveRows(),this.table.options.columnCalcs!="table"&&this.recalcRowGroup(e.row)):this.recalcActiveRows())}initializeColumnCheck(e){(e.definition.topCalc||e.definition.bottomCalc)&&this.initializeColumn(e)}initializeColumn(e){var t=e.definition,i={topCalcParams:t.topCalcParams||{},botCalcParams:t.bottomCalcParams||{}};if(t.topCalc){switch(typeof t.topCalc){case"string":B.calculations[t.topCalc]?i.topCalc=B.calculations[t.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.topCalc);break;case"function":i.topCalc=t.topCalc;break}i.topCalc&&(e.modules.columnCalcs=i,this.topCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeTopRow())}if(t.bottomCalc){switch(typeof t.bottomCalc){case"string":B.calculations[t.bottomCalc]?i.botCalc=B.calculations[t.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.bottomCalc);break;case"function":i.botCalc=t.bottomCalc;break}i.botCalc&&(e.modules.columnCalcs=i,this.botCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var e=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),e=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),e=!0),e&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){var e=document.createDocumentFragment();this.topInitialized||(e.appendChild(document.createElement("br")),e.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(e,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(e){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=e)}recalc(e){var t,i;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(t=this.rowsToData(e),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),i=this.generateRow("top",t),this.topRow=i;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(i.getElement()),i.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),i=this.generateRow("bottom",t),this.botRow=i;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(i.getElement()),i.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(e){this.recalcGroup(this.table.modules.groupRows.getRowGroup(e))}recalcAll(){if((this.topCalcs.length||this.botCalcs.length)&&(this.table.options.columnCalcs!=="group"&&this.recalcActiveRows(),this.table.options.groupBy&&this.table.options.columnCalcs!=="table")){var e=this.table.modules.groupRows.getChildGroups();e.forEach(t=>{this.recalcGroup(t)})}}recalcGroup(e){var t,i;this.blockCheck()||e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[],i=this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs,s=this.table.modules.dataTree;return e.forEach(n=>{var r;t.push(n.getData()),i&&((r=n.modules.dataTree)!=null&&r.open)&&this.rowsToData(s.getFilteredTreeChildren(n)).forEach(o=>{t.push(n)})}),t}generateRow(e,t){var i=this.generateRowData(e,t),s;return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),s=new S(i,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),s.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),s.component=!1,s.getComponent=()=>(s.component||(s.component=new _t(s)),s.component),s.generateCells=()=>{var n=[];this.table.columnManager.columnsByIndex.forEach(r=>{this.genColumn.setField(r.getField()),this.genColumn.hozAlign=r.hozAlign,r.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(r.definition[e+"CalcFormatter"]),params:r.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=r.definition.cssClass;var o=new ne(this.genColumn,s);o.getElement(),o.column=r,o.setWidth(),r.cells.push(o),n.push(o),r.visible||o.hide()}),s.cells=n},s}generateRowData(e,t){var i={},s=e=="top"?this.topCalcs:this.botCalcs,n=e=="top"?"topCalc":"botCalc",r,o;return s.forEach(function(a){var h=[];a.modules.columnCalcs&&a.modules.columnCalcs[n]&&(t.forEach(function(d){h.push(a.getFieldValue(d))}),o=n+"Params",r=typeof a.modules.columnCalcs[o]=="function"?a.modules.columnCalcs[o](h,t):a.modules.columnCalcs[o],a.setFieldValue(i,a.modules.columnCalcs[n](h,t,r)))}),i}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={},t;return this.table.options.groupBy&&this.table.modExists("groupRows")?(t=this.table.modules.groupRows.getGroups(!0),t.forEach(i=>{e[i.getKey()]=this.getGroupResults(i)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),s={},n={};return i.forEach(r=>{s[r.getKey()]=this.getGroupResults(r)}),n={top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:s},n}adjustForScrollbar(e){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=e+"px":this.botElement.style.paddingRight=e+"px")}};b(B,"moduleName","columnCalcs"),b(B,"calculations",Bt);let be=B;class Ze extends w{constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),t.dataTreeBranchElement?t.dataTreeBranchElement===!0?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):typeof t.dataTreeBranchElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement:(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch-empty")),t.dataTreeCollapseElement?typeof t.dataTreeCollapseElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="
"),t.dataTreeExpandElement?typeof t.dataTreeExpandElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(i,s){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(i,s){return t.dataTreeStartExpanded[s]};break}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){var t;e&&(t=this.table.rowManager.getRows(),t.forEach(i=>{this.reinitializeRowChildren(i)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||(e?e.field:!1)}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach(t=>{e=e.concat(this.getTreeChildren(t,!1,!0))}),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){var t=e.column.getField();t===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),s=i||!i&&typeof t=="object"&&t!==null;!s&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!s&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:s?e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0):!1,controlEl:e.modules.dataTree&&s?e.modules.dataTree.controlEl:!1,branchEl:e.modules.dataTree&&s?e.modules.dataTree.branchEl:!1,parent:e.modules.dataTree?e.modules.dataTree.parent:!1,children:s}}reinitializeRowChildren(e){var t=this.getTreeChildren(e,!1,!0);t.forEach(function(i){i.reinitialize(!0)})}layoutRow(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],i=t.getElement(),s=e.modules.dataTree;s.branchEl&&(s.branchEl.parentNode&&s.branchEl.parentNode.removeChild(s.branchEl),s.branchEl=!1),s.controlEl&&(s.controlEl.parentNode&&s.controlEl.parentNode.removeChild(s.controlEl),s.controlEl=!1),this.generateControlElement(e,i),e.getElement().classList.add("tabulator-tree-level-"+s.index),s.index&&(this.branchEl?(s.branchEl=this.branchEl.cloneNode(!0),i.insertBefore(s.branchEl,i.firstChild),this.table.rtl?s.branchEl.style.marginRight=(s.branchEl.offsetWidth+s.branchEl.style.marginLeft)*(s.index-1)+s.index*this.indent+"px":s.branchEl.style.marginLeft=(s.branchEl.offsetWidth+s.branchEl.style.marginRight)*(s.index-1)+s.index*this.indent+"px"):this.table.rtl?i.style.paddingRight=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-right"))+s.index*this.indent+"px":i.style.paddingLeft=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-left"))+s.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,s=i.controlEl;t=t||e.getCells()[0].getElement(),i.children!==!1&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",n=>{n.stopPropagation(),this.collapseRow(e)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",n=>{n.stopPropagation(),this.expandRow(e)})),i.controlEl.addEventListener("mousedown",n=>{n.stopPropagation()}),s&&s.parentNode===t?s.parentNode.replaceChild(i.controlEl,s):t.insertBefore(i.controlEl,t.firstChild))}getRows(e){var t=[];return e.forEach((i,s)=>{var n,r;t.push(i),i instanceof S&&(i.create(),n=i.modules.dataTree,!n.index&&n.children!==!1&&(r=this.getChildren(i,!1,!0),r.forEach(o=>{o.create(),t.push(o)})))}),t}getChildren(e,t,i){var s=e.modules.dataTree,n=[],r=[];return s.children!==!1&&(s.open||t)&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?n=this.table.modules.filter.filter(s.children):n=s.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(n,i),n.forEach(o=>{r.push(o);var a=this.getChildren(o,!1,!0);a.forEach(h=>{r.push(h)})})),r}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(s=>{var n=new S(s||{},this.table.rowManager);n.create(),n.modules.dataTree.index=e.modules.dataTree.index+1,n.modules.dataTree.parent=e,n.modules.dataTree.children&&(n.modules.dataTree.open=this.startOpen(n.getComponent(),n.modules.dataTree.index)),t.push(n)}),t}expandRow(e,t){var i=e.modules.dataTree;i.children!==!1&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return e.modules.dataTree.parent?e.modules.dataTree.parent.getComponent():!1}getTreeParentRoot(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[],s;return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?s=this.table.modules.filter.filter(t.children):s=t.children,s.forEach(n=>{n instanceof S&&i.push(n)})),i}rowDelete(e){var t=e.modules.dataTree.parent,i;t&&(i=this.findChildIndex(e,t),i!==!1&&t.data[this.field].splice(i,1),t.data[this.field].length||delete t.data[this.field],this.initializeRow(t),this.layoutRow(t)),this.refreshData(!0)}addTreeChildRow(e,t,i,s){var n=!1;typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),typeof s<"u"&&(n=this.findChildIndex(s,e),n!==!1&&e.data[this.field].splice(i?n:n+1,0,t)),n===!1&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return typeof e=="object"?e instanceof S?i=e.data:e instanceof oe?i=e._getSelf().data:typeof HTMLElement<"u"&&e instanceof HTMLElement?t.modules.dataTree&&(i=t.modules.dataTree.children.find(s=>s instanceof S?s.element===e:!1),i&&(i=i.data)):e===null&&(i=!1):typeof e>"u"?i=!1:i=t.data[this.field].find(s=>s.data[this.table.options.index]==e),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),i==-1&&(i=!1)),i}getTreeChildren(e,t,i){var s=e.modules.dataTree,n=[];return s&&s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),s.children.forEach(r=>{r instanceof S&&(n.push(t?r.getComponent():r),i&&this.getTreeChildren(r,t,i).forEach(o=>{n.push(o)}))})),n}getChildField(){return this.field}redrawNeeded(e){return(this.field?typeof e[this.field]<"u":!1)||(this.elementField?typeof e[this.elementField]<"u":!1)}}b(Ze,"moduleName","dataTree");function Vt(l,e={},t){var i=e.delimiter?e.delimiter:",",s=[],n=[];l.forEach(r=>{var o=[];switch(r.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":r.columns.forEach((a,h)=>{a&&a.depth===1&&(n[h]=typeof a.value>"u"||a.value===null?"":'"'+String(a.value).split('"').join('""')+'"')});break;case"row":r.columns.forEach(a=>{if(a){switch(typeof a.value){case"object":a.value=a.value!==null?JSON.stringify(a.value):"";break;case"undefined":a.value="";break}o.push('"'+String(a.value).split('"').join('""')+'"')}}),s.push(o.join(i));break}}),n.length&&s.unshift(n.join(i)),s=s.join(` `),e.bom&&(s="\uFEFF"+s),t(s,"text/csv")}function It(l,e,t){var i=[];l.forEach(s=>{var n={};switch(s.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":s.columns.forEach(r=>{r&&(n[r.component.getTitleDownload()||r.component.getField()]=r.value)}),i.push(n);break}}),i=JSON.stringify(i,null," "),t(i,"application/json")}function Nt(l,e={},t){var i=[],s=[],n={},r=e.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},o=e.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},a=e.jsPDF||{},h=e.title?e.title:"";a.orientation||(a.orientation=e.orientation||"landscape"),a.unit||(a.unit="pt"),l.forEach(c=>{switch(c.type){case"header":i.push(d(c));break;case"group":s.push(d(c,r));break;case"calc":s.push(d(c,o));break;case"row":s.push(d(c));break}});function d(c,f){var g=[];return c.columns.forEach(p=>{var v;if(p){switch(typeof p.value){case"object":p.value=p.value!==null?JSON.stringify(p.value):"";break;case"undefined":p.value="";break}v={content:p.value,colSpan:p.width,rowSpan:p.height},f&&(v.styles=f),g.push(v)}}),g}var u=new jspdf.jsPDF(a);e.autoTable&&(typeof e.autoTable=="function"?n=e.autoTable(u)||{}:n=e.autoTable),h&&(n.didDrawPage=function(c){u.text(h,40,30)}),n.head=i,n.body=s,u.autoTable(n),e.documentProcessing&&e.documentProcessing(u),t(u.output("arraybuffer"),"application/pdf")}function Wt(l,e,t){var i=this,s=e.sheetName||"Sheet1",n=XLSX.utils.book_new(),r=new M(this),o="compress"in e?e.compress:!0,a=e.writeOptions||{bookType:"xlsx",bookSST:!0,compression:o},h;a.type="binary",n.SheetNames=[],n.Sheets={};function d(){var f=[],g=[],p={},v={s:{c:0,r:0},e:{c:l[0]?l[0].columns.reduce((m,C)=>m+(C&&C.width?C.width:1),0):0,r:l.length}};return l.forEach((m,C)=>{var T=[];m.columns.forEach(function(y,k){y?(T.push(!(y.value instanceof Date)&&typeof y.value=="object"?JSON.stringify(y.value):y.value),(y.width>1||y.height>-1)&&(y.height>1||y.width>1)&&g.push({s:{r:C,c:k},e:{r:C+y.height-1,c:k+y.width-1}})):T.push("")}),f.push(T)}),XLSX.utils.sheet_add_aoa(p,f),p["!ref"]=XLSX.utils.encode_range(v),g.length&&(p["!merges"]=g),p}if(e.sheetOnly){t(d());return}if(e.sheets)for(var u in e.sheets)e.sheets[u]===!0?(n.SheetNames.push(u),n.Sheets[u]=d()):(n.SheetNames.push(u),r.commsSend(e.sheets[u],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:i.active,intercept:function(f){n.Sheets[u]=f}}));else n.SheetNames.push(s),n.Sheets[s]=d();e.documentProcessing&&(n=e.documentProcessing(n));function c(f){for(var g=new ArrayBuffer(f.length),p=new Uint8Array(g),v=0;v!=f.length;++v)p[v]=f.charCodeAt(v)&255;return g}h=XLSX.write(n,a),t(c(h),"application/octet-stream")}function Gt(l,e,t){this.modExists("export",!0)&&t(this.modules.export.generateHTMLTable(l),"text/html")}function jt(l,e,t){const i=[];l.forEach(s=>{const n={};switch(s.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":s.columns.forEach(r=>{r&&(n[r.component.getTitleDownload()||r.component.getField()]=r.value)}),i.push(JSON.stringify(n));break}}),t(i.join(` diff --git a/src/main/resources/static/assets/YamlGenerate-VDNLSlZy.js b/src/main/resources/static/assets/YamlGenerate-BpVTbERL.js similarity index 99% rename from src/main/resources/static/assets/YamlGenerate-VDNLSlZy.js rename to src/main/resources/static/assets/YamlGenerate-BpVTbERL.js index 199de62f..21026cc1 100644 --- a/src/main/resources/static/assets/YamlGenerate-VDNLSlZy.js +++ b/src/main/resources/static/assets/YamlGenerate-BpVTbERL.js @@ -1 +1 @@ -import{d as B,c as A,w as I,r as f,h as n,a,b as e,t as F,u as O,o as G,e as c,g as m,F as D,f as j,j as W,n as K,i as N,k as X}from"./index-kUd7CzTD.js";import{s as J}from"./request-C4mhQyyH.js";import{_ as Q}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Z=P=>J.post("/manifest/v1/generator/yaml/pod",P),ee=P=>J.post("/manifest/v1/generator/yaml/service",P),te=P=>J.post("/manifest/v1/generator/yaml/hpa",P),le=P=>J.post("/manifest/v1/generator/yaml/deployments",P),oe=P=>J.post("/manifest/v1/generator/yaml/configmap",P),se={class:"modal",id:"modal-pod",tabindex:"-1"},ne={class:"modal-dialog modal-lg",role:"document"},ae={class:"modal-content"},re={class:"modal-header"},ie={class:"modal-title"},de={class:"modal-body"},ue={class:"card"},ce={class:"card-body"},me=B({__name:"podModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{$.value&&await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",se,[e("div",ne,[e("div",ae,[e("div",re,[e("h5",ie,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",de,[e("div",ue,[e("div",ce,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),pe={class:"tab-pane active show",id:"tabs-pod"},ve={class:"card"},be={class:"card-body"},he={class:"mb-3"},ye={class:"mb-3"},fe={class:"mb-3"},ge=["onUpdate:modelValue"],_e=["onUpdate:modelValue"],we={class:"btn-list"},ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},$e=["onClick"],xe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ce={class:"card mt-4"},Ue={class:"card-body"},Me={class:"mb-3"},Ve={class:"btn-list"},Pe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},qe=["onClick"],Se={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},De={class:"row",style:{width:"68% !important"}},je={class:"col mt-4"},ze=["onUpdate:modelValue"],He={class:"col mt-4"},Le=["onUpdate:modelValue"],Be={class:"mb-3"},Re=["onUpdate:modelValue"],Ne=["onUpdate:modelValue"],Fe={class:"btn-list"},Ae=["onClick"],Ee={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Te=["onClick"],Ye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Oe={class:"mb-3"},Ge={class:"btn-list"},Ie=["onClick"],Ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Je=["onClick"],Qe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},We={class:"row",style:{width:"68% !important"}},Xe={class:"col mt-4"},Ze=["onUpdate:modelValue"],et={class:"col mt-4"},tt=["onUpdate:modelValue"],lt={class:"row",style:{width:"68% !important"}},ot={class:"col mt-4"},st=["onUpdate:modelValue"],nt={class:"col mt-4"},at=["onUpdate:modelValue"],rt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},it={class:"mb-3"},dt={class:"row",style:{width:"68% !important"}},ut={class:"col mt-4"},ct=["onUpdate:modelValue"],mt={class:"col mt-4"},pt=["onUpdate:modelValue"],vt={class:"row",style:{width:"68% !important"}},bt={class:"col mt-4"},ht=["onUpdate:modelValue"],yt={class:"col mt-4"},ft=["onUpdate:modelValue"],gt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},_t={class:"mb-3"},wt={class:"mt-4"},kt={class:"btn-list justify-content-end mt-4"},$t=B({__name:"podForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f(""),V=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const i of p.value)if(!i.name||i.name.trim()===""||!i.image||i.image.trim()==="")return!1;return!0});G(async()=>{await L()});const L=()=>{$.value="Pod",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value={containers:[],restartPolicy:""},p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter pod name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=i,w.value.metadata=l.value,r.value.containers=p.value,w.value.spec=r.value;const{data:t}=await Z(w.value);M.value=t},E=()=>{_.value.push({key:"",value:""})},T=i=>{_.value.length!==1&&_.value.splice(i,1)},H=()=>{p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},u=i=>{p.value.length!==1&&p.value.splice(i,1)},o=i=>{p.value[i].env.push({name:"",value:""})},U=(i,t)=>{p.value[i].env.length!==1&&p.value[i].env.splice(t,1)},x=i=>{p.value[i].ports.push({name:"",containerPort:"",hostPort:"",protocol:""})},k=(i,t)=>{p.value[i].ports.length!==1&&p.value[i].ports.splice(t,1)};return(i,t)=>(n(),a("div",pe,[e("div",ve,[t[9]||(t[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",be,[e("div",he,[t[4]||(t[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[0]||(t[0]=s=>l.value.name=s),placeholder:"pod-01"},null,512),[[m,l.value.name]])]),e("div",ye,[t[5]||(t[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[1]||(t[1]=s=>l.value.namespace=s),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",fe,[t[8]||(t[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(s,b)=>(n(),a("div",{class:"generate-form",key:b},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.key=y,placeholder:"key"},null,8,ge),[[m,s.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.value=y,placeholder:"value"},null,8,_e),[[m,s.value]]),e("div",we,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",ke,t[6]||(t[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>T(b)},[(n(),a("svg",xe,t[7]||(t[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,$e)])]))),128))])])]),e("div",Ce,[t[31]||(t[31]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Ue,[(n(!0),a(D,null,j(p.value,(s,b)=>(n(),a("div",{class:"mt-4",key:b},[e("div",Me,[e("div",Ve,[t[12]||(t[12]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Pe,t[10]||(t[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>u(b)},[(n(),a("svg",Se,t[11]||(t[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,qe)]),e("div",De,[e("div",je,[t[13]||(t[13]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.name=y},null,8,ze),[[m,s.name]])]),e("div",He,[t[14]||(t[14]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.image=y},null,8,Le),[[m,s.image]])])])]),e("div",Be,[t[17]||(t[17]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(s.env,(y,Y)=>(n(),a("div",{class:"generate-form",key:Y},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.name=g,placeholder:"key"},null,8,Re),[[m,y.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.value=g,placeholder:"value"},null,8,Ne),[[m,y.value]]),e("div",Fe,[e("button",{class:"btn btn-primary",onClick:g=>o(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ee,t[15]||(t[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ae),e("button",{class:"btn btn-primary",onClick:g=>U(b,Y)},[(n(),a("svg",Ye,t[16]||(t[16]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Te)])]))),128))]),e("div",Oe,[(n(!0),a(D,null,j(s.ports,(y,Y)=>(n(),a("div",{class:"mt-4",key:Y},[e("div",Ge,[t[20]||(t[20]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:g=>x(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ke,t[18]||(t[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ie),e("button",{class:"btn btn-primary",onClick:g=>k(b,Y)},[(n(),a("svg",Qe,t[19]||(t[19]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Je)]),e("div",We,[e("div",Xe,[t[21]||(t[21]=e("label",{class:"form-label"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.name=g},null,8,Ze),[[m,y.name]])]),e("div",et,[t[22]||(t[22]=e("label",{class:"form-label"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.containerPort=g},null,8,tt),[[m,y.containerPort]])])]),e("div",lt,[e("div",ot,[t[23]||(t[23]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.protocol=g},null,8,st),[[m,y.protocol]])]),e("div",nt,[t[24]||(t[24]=e("label",{class:"form-label"},"- Host Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.hostPort=g},null,8,at),[[m,y.hostPort]])])]),s.ports.length>1?(n(),a("div",rt)):W("",!0)]))),128))]),e("div",it,[t[29]||(t[29]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"Resources")],-1)),e("div",dt,[e("div",ut,[t[25]||(t[25]=e("label",{class:"form-label"},"- Limits CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.cpu=y},null,8,ct),[[m,s.resources.limits.cpu]])]),e("div",mt,[t[26]||(t[26]=e("label",{class:"form-label"},"- Limits Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.memory=y},null,8,pt),[[m,s.resources.limits.memory]])])]),e("div",vt,[e("div",bt,[t[27]||(t[27]=e("label",{class:"form-label"},"- Requests CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.cpu=y},null,8,ht),[[m,s.resources.requests.cpu]])]),e("div",yt,[t[28]||(t[28]=e("label",{class:"form-label"},"- Requests Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.memory=y},null,8,ft),[[m,s.resources.requests.memory]])])])]),p.value.length>1?(n(),a("div",gt)):W("",!0)]))),128)),e("div",_t,[e("div",wt,[t[30]||(t[30]=e("label",{class:"form-label"},"- Restart Policy",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":t[2]||(t[2]=s=>r.value.restartPolicy=s)},null,512),[[m,r.value.restartPolicy]])])])])]),e("div",kt,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:t[3]||(t[3]=s=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-pod"},"GENERATE",2)]),N(me,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),xt=Q($t,[["__scopeId","data-v-ebbc4037"]]),Ct={class:"modal",id:"modal-deploy",tabindex:"-1"},Ut={class:"modal-dialog modal-lg",role:"document"},Mt={class:"modal-content"},Vt={class:"modal-header"},Pt={class:"modal-title"},qt={class:"modal-body"},St={class:"card"},Dt={class:"card-body"},jt=B({__name:"deployModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ct,[e("div",Ut,[e("div",Mt,[e("div",Vt,[e("h5",Pt,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",qt,[e("div",St,[e("div",Dt,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),zt={class:"tab-pane",id:"tabs-deployment"},Ht={class:"card"},Lt={class:"card-body"},Bt={class:"mb-3"},Rt={class:"mb-3"},Nt={class:"mb-3"},Ft=["onUpdate:modelValue"],At=["onUpdate:modelValue"],Et={class:"btn-list"},Tt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Yt=["onClick"],Ot={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Gt={class:"card mt-4"},It={class:"card-body"},Kt={class:"mb-3"},Jt={class:"mb-3"},Qt=["onUpdate:modelValue"],Wt=["onUpdate:modelValue"],Xt={class:"btn-list"},Zt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},el=["onClick"],tl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ll={class:"mb-3"},ol=["onUpdate:modelValue"],sl=["onUpdate:modelValue"],nl={class:"btn-list"},al={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},rl=["onClick"],il={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},dl={class:"mb-3"},ul={class:"btn-list"},cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},ml=["onClick"],pl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vl={class:"row",style:{width:"68% !important"}},bl={class:"col mt-4"},hl=["onUpdate:modelValue"],yl={class:"col mt-4"},fl=["onUpdate:modelValue"],gl={class:"mb-3"},_l=["onUpdate:modelValue"],wl={class:"btn-list"},kl=["onClick"],$l={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},xl=["onClick"],Cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ul={class:"mb-3"},Ml=["onUpdate:modelValue"],Vl=["onUpdate:modelValue"],Pl={class:"btn-list"},ql=["onClick"],Sl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Dl=["onClick"],jl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},zl={class:"btn-list justify-content-end mt-4"},Hl=B({__name:"deploymentForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f([]),M=f({}),V=f([]),L=f(""),R=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const g of V.value)if(!g.name||g.name.trim()===""||!g.image||g.image.trim()==="")return!1;return!0});G(async()=>{await E()});const E=()=>{$.value="Deployment",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value={replicas:"",selector:{matchLabels:{}},template:{metadata:{labels:{}},spec:{containers:[]}}},V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},T=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter deployment name.");const v=document.querySelector('input[v-model="metadata.name"]');v==null||v.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const v=document.querySelector('input[v-model="metadata.namespace"]');v==null||v.focus();return}for(let v=0;v(v[q.key]=q.value,v),{}),d=r.value.reduce((v,q)=>(v[q.key]=q.value,v),{}),C=p.value.reduce((v,q)=>(v[q.key]=q.value,v),{});l.value.labels=g,w.value.metadata=l.value,M.value.selector.matchLabels=d,M.value.template.metadata.labels=C,M.value.template.spec.containers=V.value,w.value.spec=M.value,console.log("deployFormData.value : ",w.value);const{data:S}=await le(w.value);L.value=S},H=()=>{_.value.push({key:"",value:""})},u=g=>{_.value.length!==1&&_.value.splice(g,1)},o=()=>{r.value.push({key:"",value:""})},U=g=>{r.value.length!==1&&r.value.splice(g,1)},x=()=>{p.value.push({key:"",value:""})},k=g=>{p.value.length!==1&&p.value.splice(g,1)},i=()=>{V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},t=g=>{V.value.length!==1&&V.value.splice(g,1)},s=g=>{V.value[g].env.push({name:"",value:""})},b=(g,d)=>{V.value[g].env.length!==1&&V.value[g].env.splice(d,1)},y=g=>{V.value[g].ports.push({containerPort:""})},Y=(g,d)=>{V.value[g].ports.length!==1&&V.value[g].ports.splice(d,1)};return(g,d)=>(n(),a("div",zt,[e("div",Ht,[d[9]||(d[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Lt,[e("div",Bt,[d[4]||(d[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[0]||(d[0]=C=>l.value.name=C),placeholder:"deployment-01"},null,512),[[m,l.value.name]])]),e("div",Rt,[d[5]||(d[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[1]||(d[1]=C=>l.value.namespace=C),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Nt,[d[8]||(d[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Ft),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,At),[[m,C.value]]),e("div",Et,[e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Tt,d[6]||(d[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>u(S)},[(n(),a("svg",Ot,d[7]||(d[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Yt)])]))),128))])])]),e("div",Gt,[d[29]||(d[29]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",It,[e("div",Kt,[d[10]||(d[10]=e("label",{class:"form-label"},"- Replicas",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":d[2]||(d[2]=C=>M.value.replicas=C)},null,512),[[m,M.value.replicas]])]),e("div",Jt,[d[13]||(d[13]=e("label",{class:"form-label"},"- Match Labels",-1)),(n(!0),a(D,null,j(r.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Qt),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,Wt),[[m,C.value]]),e("div",Xt,[e("button",{class:"btn btn-primary",onClick:o,style:{"text-align":"center !important"}},[(n(),a("svg",Zt,d[11]||(d[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>U(S)},[(n(),a("svg",tl,d[12]||(d[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,el)])]))),128))]),d[28]||(d[28]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Template")],-1)),e("div",ll,[d[16]||(d[16]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"- Labels")],-1)),(n(!0),a(D,null,j(p.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,ol),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,sl),[[m,C.value]]),e("div",nl,[e("button",{class:"btn btn-primary",onClick:x,style:{"text-align":"center !important"}},[(n(),a("svg",al,d[14]||(d[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>k(S)},[(n(),a("svg",il,d[15]||(d[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,rl)])]))),128))]),(n(!0),a(D,null,j(V.value,(C,S)=>(n(),a("div",{key:S},[e("div",dl,[e("div",ul,[d[19]||(d[19]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:i,style:{"text-align":"center !important"}},[(n(),a("svg",cl,d[17]||(d[17]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>t(S)},[(n(),a("svg",pl,d[18]||(d[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ml)]),e("div",vl,[e("div",bl,[d[20]||(d[20]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.name=v},null,8,hl),[[m,C.name]])]),e("div",yl,[d[21]||(d[21]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.image=v},null,8,fl),[[m,C.image]])])])]),e("div",gl,[d[24]||(d[24]=e("label",{class:"form-label"},"- Port",-1)),(n(!0),a(D,null,j(C.ports,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.containerPort=z,placeholder:"value"},null,8,_l),[[m,v.containerPort]]),e("div",wl,[e("button",{class:"btn btn-primary",onClick:z=>y(S),style:{"text-align":"center !important"}},[(n(),a("svg",$l,d[22]||(d[22]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,kl),e("button",{class:"btn btn-primary",onClick:z=>Y(S,q)},[(n(),a("svg",Cl,d[23]||(d[23]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,xl)])]))),128))]),e("div",Ul,[d[27]||(d[27]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(C.env,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.name=z,placeholder:"key"},null,8,Ml),[[m,v.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.value=z,placeholder:"value"},null,8,Vl),[[m,v.value]]),e("div",Pl,[e("button",{class:"btn btn-primary",onClick:z=>s(S),style:{"text-align":"center !important"}},[(n(),a("svg",Sl,d[25]||(d[25]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ql),e("button",{class:"btn btn-primary",onClick:z=>b(S,q)},[(n(),a("svg",jl,d[26]||(d[26]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Dl)])]))),128))])]))),128))])]),e("div",zl,[e("a",{class:K(["btn btn-primary",{disabled:!R.value}]),onClick:d[3]||(d[3]=C=>R.value?T():null),"data-bs-toggle":"modal","data-bs-target":"#modal-deploy"},"GENERATE",2)]),N(jt,{"yaml-data":L.value,title:$.value},null,8,["yaml-data","title"])]))}}),Ll=Q(Hl,[["__scopeId","data-v-f08d5135"]]),Bl={class:"modal",id:"modal-service",tabindex:"-1"},Rl={class:"modal-dialog modal-lg",role:"document"},Nl={class:"modal-content"},Fl={class:"modal-header"},Al={class:"modal-title"},El={class:"modal-body"},Tl={class:"card"},Yl={class:"card-body"},Ol=B({__name:"servcieModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Bl,[e("div",Rl,[e("div",Nl,[e("div",Fl,[e("h5",Al,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",El,[e("div",Tl,[e("div",Yl,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Gl={class:"tab-pane",id:"tabs-service"},Il={class:"card"},Kl={class:"card-body"},Jl={class:"mb-3"},Ql={class:"mb-3"},Wl={class:"mb-3"},Xl=["onUpdate:modelValue"],Zl=["onUpdate:modelValue"],eo={class:"btn-list"},to={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},lo=["onClick"],oo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},so={class:"card mt-4"},no={class:"card-body"},ao={class:"mb-3"},ro=["onUpdate:modelValue"],io=["onUpdate:modelValue"],uo={class:"btn-list"},co={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},mo=["onClick"],po={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vo={class:"mb-3"},bo={class:"btn-list"},ho={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},yo=["onClick"],fo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},go={class:"row",style:{width:"68% !important"}},_o={class:"col mt-4"},wo=["onUpdate:modelValue"],ko={class:"col mt-4"},$o=["onUpdate:modelValue"],xo={class:"row",style:{width:"68% !important"}},Co={class:"col mt-4"},Uo=["onUpdate:modelValue"],Mo={class:"col mt-4"},Vo=["onUpdate:modelValue"],Po={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},qo={class:"row",style:{width:"68% !important"}},So={class:"col mt-4"},Do={class:"btn-list justify-content-end mt-4"},jo=B({__name:"serviceForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f([]);f("");const V=f(""),L=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const k of M.value)if(!k.port||k.port.trim()===""||!k.targetPort||k.targetPort.trim()==="")return!1;return!0});G(async()=>{await R()});const R=()=>{$.value="Service",l.value={name:"",namespace:"",labels:{}},r.value={selector:{},ports:[],type:""},_.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},E=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter service name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=k,w.value.metadata=l.value;const i=p.value.reduce((s,b)=>(s[b.key]=b.value,s),{});r.value.selector=i,r.value.ports=M.value,w.value.spec=r.value;const{data:t}=await ee(w.value);V.value=t},T=()=>{_.value.push({key:"",value:""})},H=k=>{_.value.length!==1&&_.value.splice(k,1)},u=()=>{p.value.push({key:"",value:""})},o=k=>{p.value.length!==1&&p.value.splice(k,1)},U=()=>{M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},x=k=>{M.value.length!==1&&M.value.splice(k,1)};return(k,i)=>(n(),a("div",Gl,[e("div",Il,[i[9]||(i[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Kl,[e("div",Jl,[i[4]||(i[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[0]||(i[0]=t=>l.value.name=t),placeholder:"name-01"},null,512),[[m,l.value.name]])]),e("div",Ql,[i[5]||(i[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[1]||(i[1]=t=>l.value.namespace=t),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Wl,[i[8]||(i[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,Xl),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,Zl),[[m,t.value]]),e("div",eo,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",to,i[6]||(i[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>H(s)},[(n(),a("svg",oo,i[7]||(i[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,lo)])]))),128))])])]),e("div",so,[i[21]||(i[21]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",no,[e("div",ao,[i[12]||(i[12]=e("label",{class:"form-label"},"- Selector",-1)),(n(!0),a(D,null,j(p.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,ro),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,io),[[m,t.value]]),e("div",uo,[e("button",{class:"btn btn-primary",onClick:u,style:{"text-align":"center !important"}},[(n(),a("svg",co,i[10]||(i[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>o(s)},[(n(),a("svg",po,i[11]||(i[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,mo)])]))),128))]),e("div",vo,[(n(!0),a(D,null,j(M.value,(t,s)=>(n(),a("div",{class:"mt-4",key:s},[e("div",bo,[i[15]||(i[15]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:U,style:{"text-align":"center !important"}},[(n(),a("svg",ho,i[13]||(i[13]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>x(s)},[(n(),a("svg",fo,i[14]||(i[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,yo)]),e("div",go,[e("div",_o,[i[16]||(i[16]=e("label",{class:"form-label required"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.port=b},null,8,wo),[[m,t.port]])]),e("div",ko,[i[17]||(i[17]=e("label",{class:"form-label required"},"- Target Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.targetPort=b},null,8,$o),[[m,t.targetPort]])])]),e("div",xo,[e("div",Co,[i[18]||(i[18]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.protocol=b},null,8,Uo),[[m,t.protocol]])]),e("div",Mo,[i[19]||(i[19]=e("label",{class:"form-label"},"- Node Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.nodePort=b},null,8,Vo),[[m,t.nodePort]])])]),M.value.length>1?(n(),a("div",Po)):W("",!0)]))),128)),e("div",qo,[e("div",So,[i[20]||(i[20]=e("label",{class:"form-label"},"- Type",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":i[2]||(i[2]=t=>r.value.type=t)},null,512),[[m,r.value.type]])])])])])]),e("div",Do,[e("a",{class:K(["btn btn-primary",{disabled:!L.value}]),onClick:i[3]||(i[3]=t=>L.value?E():null),"data-bs-toggle":"modal","data-bs-target":"#modal-service"},"GENERATE",2)]),N(Ol,{"yaml-data":V.value,title:$.value},null,8,["yaml-data","title"])]))}}),zo=Q(jo,[["__scopeId","data-v-b9ba3952"]]),Ho={class:"modal",id:"modal-yaml",tabindex:"-1"},Lo={class:"modal-dialog modal-lg",role:"document"},Bo={class:"modal-content"},Ro={class:"modal-header"},No={class:"modal-title"},Fo={class:"modal-body"},Ao={class:"card"},Eo={class:"card-body"},To=B({__name:"yamlModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ho,[e("div",Lo,[e("div",Bo,[e("div",Ro,[e("h5",No,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",Fo,[e("div",Ao,[e("div",Eo,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Yo={class:"tab-pane",id:"tabs-hpa"},Oo={class:"card"},Go={class:"card-body"},Io={class:"mb-3"},Ko={class:"mb-3"},Jo={class:"mb-3"},Qo=["onUpdate:modelValue"],Wo=["onUpdate:modelValue"],Xo={class:"btn-list"},Zo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},es=["onClick"],ts={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ls={class:"card mt-4"},os={class:"card-body"},ss={class:"row",style:{width:"68% !important"}},ns={class:"col"},as={class:"col"},rs={class:"row",style:{width:"68% !important"}},is={class:"col"},ds={class:"row",style:{width:"68% !important"}},us={class:"col"},cs={class:"row",style:{width:"68% !important"}},ms={class:"col"},ps={class:"row",style:{width:"68% !important"}},vs={class:"col"},bs={class:"btn-list justify-content-end mt-4"},hs=B({__name:"hpaForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f({}),M=f(""),V=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""||!p.value.apiVersion||p.value.apiVersion.trim()===""||!p.value.kind||p.value.kind.trim()===""||!p.value.name||p.value.name.trim()===""||!r.value.minReplicas||r.value.minReplicas.trim()===""||!r.value.maxReplicas||r.value.maxReplicas.trim()===""||!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""));G(async()=>{await L()});const L=()=>{$.value="HPA",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value={scaleTargetRef:{},minReplicas:"",maxReplicas:"",targetCPUUtilizationPercentage:""},p.value={apiVersion:"",kind:"",name:""}},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter HPA name.");const o=document.querySelector('input[v-model="metadata.name"]');o==null||o.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const o=document.querySelector('input[v-model="metadata.namespace"]');o==null||o.focus();return}if(!p.value.apiVersion||p.value.apiVersion.trim()===""){h.error("Please enter API version.");const o=document.querySelector('input[v-model="scaleTargetRef.apiVersion"]');o==null||o.focus();return}if(!p.value.kind||p.value.kind.trim()===""){h.error("Please enter kind.");const o=document.querySelector('input[v-model="scaleTargetRef.kind"]');o==null||o.focus();return}if(!p.value.name||p.value.name.trim()===""){h.error("Please enter target name.");const o=document.querySelector('input[v-model="scaleTargetRef.name"]');o==null||o.focus();return}if(!r.value.minReplicas||r.value.minReplicas.trim()===""){h.error("Please enter min replicas.");const o=document.querySelector('input[v-model="spec.minReplicas"]');o==null||o.focus();return}if(!r.value.maxReplicas||r.value.maxReplicas.trim()===""){h.error("Please enter max replicas.");const o=document.querySelector('input[v-model="spec.maxReplicas"]');o==null||o.focus();return}if(!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""){h.error("Please enter CPU percentage.");const o=document.querySelector('input[v-model="spec.targetCPUUtilizationPercentage"]');o==null||o.focus();return}const H=_.value.reduce((o,U)=>(o[U.key]=U.value,o),{});l.value.labels=H,r.value.scaleTargetRef=p.value,w.value.metadata=l.value,w.value.spec=r.value;const{data:u}=await te(w.value);M.value=u},E=()=>{_.value.push({key:"",value:""})},T=H=>{_.value.length!==1&&_.value.splice(H,1)};return(H,u)=>(n(),a("div",Yo,[e("div",Oo,[u[14]||(u[14]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Go,[e("div",Io,[u[9]||(u[9]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[0]||(u[0]=o=>l.value.name=o),placeholder:"name"},null,512),[[m,l.value.name]])]),e("div",Ko,[u[10]||(u[10]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[1]||(u[1]=o=>l.value.namespace=o),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Jo,[u[13]||(u[13]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(o,U)=>(n(),a("div",{class:"generate-form",key:U},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.key=x,placeholder:"key"},null,8,Qo),[[m,o.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.value=x,placeholder:"value"},null,8,Wo),[[m,o.value]]),e("div",Xo,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",Zo,u[11]||(u[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:x=>T(U)},[(n(),a("svg",ts,u[12]||(u[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,es)])]))),128))])])]),e("div",ls,[u[22]||(u[22]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",os,[u[21]||(u[21]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Scale Target")],-1)),e("div",ss,[e("div",ns,[u[15]||(u[15]=e("label",{class:"form-label required"},"- Api Version",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[2]||(u[2]=o=>p.value.apiVersion=o)},null,512),[[m,p.value.apiVersion]])]),e("div",as,[u[16]||(u[16]=e("label",{class:"form-label required"},"- Kind",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[3]||(u[3]=o=>p.value.kind=o)},null,512),[[m,p.value.kind]])])]),e("div",rs,[e("div",is,[u[17]||(u[17]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[4]||(u[4]=o=>p.value.name=o)},null,512),[[m,p.value.name]])])]),e("div",ds,[e("div",us,[u[18]||(u[18]=e("label",{class:"form-label required"},"- Min Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[5]||(u[5]=o=>r.value.minReplicas=o)},null,512),[[m,r.value.minReplicas]])])]),e("div",cs,[e("div",ms,[u[19]||(u[19]=e("label",{class:"form-label required"},"- Max Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[6]||(u[6]=o=>r.value.maxReplicas=o)},null,512),[[m,r.value.maxReplicas]])])]),e("div",ps,[e("div",vs,[u[20]||(u[20]=e("label",{class:"form-label required"},"- CPU Percentage",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[7]||(u[7]=o=>r.value.targetCPUUtilizationPercentage=o)},null,512),[[m,r.value.targetCPUUtilizationPercentage]])])])])]),e("div",bs,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:u[8]||(u[8]=o=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-yaml"},"GENERATE",2)]),N(To,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),ys=Q(hs,[["__scopeId","data-v-b0620f31"]]),fs={class:"modal",id:"modal-config-map",tabindex:"-1"},gs={class:"modal-dialog modal-lg",role:"document"},_s={class:"modal-content"},ws={class:"modal-header"},ks={class:"modal-title"},$s={class:"modal-body"},xs={class:"card"},Cs={class:"card-body"},Us=B({__name:"configMapModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",fs,[e("div",gs,[e("div",_s,[e("div",ws,[e("h5",ks,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",$s,[e("div",xs,[e("div",Cs,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Ms={class:"tab-pane",id:"tabs-configMap"},Vs={class:"card"},Ps={class:"card-body"},qs={class:"mb-3"},Ss={class:"mb-3"},Ds={class:"mb-3"},js=["onUpdate:modelValue"],zs=["onUpdate:modelValue"],Hs={class:"btn-list"},Ls={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Bs=["onClick"],Rs={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ns={class:"card mt-4"},Fs={class:"card-body"},As={class:"mb-3"},Es=["onUpdate:modelValue"],Ts=["onUpdate:modelValue"],Ys={class:"btn-list"},Os={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Gs=["onClick"],Is={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ks={class:"btn-list justify-content-end mt-4"},Js=B({__name:"configmapForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f(""),M=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""));G(async()=>{await V()});const V=()=>{$.value="ConfigMap",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value.push({key:"",value:""})},L=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter ConfigMap name.");const x=document.querySelector('input[v-model="metadata.name"]');x==null||x.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const x=document.querySelector('input[v-model="metadata.namespace"]');x==null||x.focus();return}const u=_.value.reduce((x,k)=>(x[k.key]=k.value,x),{});l.value.labels=u;const o=r.value.reduce((x,k)=>(x[k.key]=k.value,x),{});w.value.metadata=l.value,w.value.data=o;const{data:U}=await oe(w.value);p.value=U},R=()=>{_.value.push({key:"",value:""})},E=u=>{_.value.length!==1&&_.value.splice(u,1)},T=()=>{r.value.push({key:"",value:""})},H=u=>{r.value.length!==1&&r.value.splice(u,1)};return(u,o)=>(n(),a("div",Ms,[e("div",Vs,[o[8]||(o[8]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Ps,[e("div",qs,[o[3]||(o[3]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[0]||(o[0]=U=>l.value.name=U),placeholder:"configMap-01"},null,512),[[m,l.value.name]])]),e("div",Ss,[o[4]||(o[4]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[1]||(o[1]=U=>l.value.namespace=U),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Ds,[o[7]||(o[7]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,js),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,zs),[[m,U.value]]),e("div",Hs,[e("button",{class:"btn btn-primary",onClick:R,style:{"text-align":"center !important"}},[(n(),a("svg",Ls,o[5]||(o[5]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>E(x)},[(n(),a("svg",Rs,o[6]||(o[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Bs)])]))),128))])])]),e("div",Ns,[o[12]||(o[12]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Fs,[e("div",As,[o[11]||(o[11]=e("label",{class:"form-label"},"- Data",-1)),(n(!0),a(D,null,j(r.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,Es),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,Ts),[[m,U.value]]),e("div",Ys,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",Os,o[9]||(o[9]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>H(x)},[(n(),a("svg",Is,o[10]||(o[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Gs)])]))),128))])])]),e("div",Ks,[e("a",{class:K(["btn btn-primary",{disabled:!M.value}]),onClick:o[2]||(o[2]=U=>M.value?L():null),"data-bs-toggle":"modal","data-bs-target":"#modal-config-map"},"GENERATE",2)]),N(Us,{"yaml-data":p.value,title:$.value},null,8,["yaml-data","title"])]))}}),Qs=Q(Js,[["__scopeId","data-v-e0b005d8"]]),Ws={class:"card w-100",ref:"workflowForm"},Xs={class:"card-body"},Zs={class:"card"},en={class:"card-body"},tn={class:"tab-content"},nn=B({__name:"YamlGenerate",setup(P){return O(),G(async()=>{}),(h,$)=>(n(),a("div",Ws,[$[1]||($[1]=e("div",{class:"card-header"},[e("div",{class:"card-title"},[e("h1",null,"YAML Generator")])],-1)),e("div",Xs,[e("div",Zs,[$[0]||($[0]=X('',1)),e("div",en,[e("div",tn,[N(xt),N(Ll),N(zo),N(ys),N(Qs)])])])])],512))}});export{nn as default}; +import{d as B,c as A,w as I,r as f,h as n,a,b as e,t as F,u as O,o as G,e as c,g as m,F as D,f as j,j as W,n as K,i as N,k as X}from"./index-DpY2Dwv5.js";import{s as J}from"./request-BI8njqPY.js";import{_ as Q}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Z=P=>J.post("/manifest/v1/generator/yaml/pod",P),ee=P=>J.post("/manifest/v1/generator/yaml/service",P),te=P=>J.post("/manifest/v1/generator/yaml/hpa",P),le=P=>J.post("/manifest/v1/generator/yaml/deployments",P),oe=P=>J.post("/manifest/v1/generator/yaml/configmap",P),se={class:"modal",id:"modal-pod",tabindex:"-1"},ne={class:"modal-dialog modal-lg",role:"document"},ae={class:"modal-content"},re={class:"modal-header"},ie={class:"modal-title"},de={class:"modal-body"},ue={class:"card"},ce={class:"card-body"},me=B({__name:"podModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{$.value&&await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",se,[e("div",ne,[e("div",ae,[e("div",re,[e("h5",ie,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",de,[e("div",ue,[e("div",ce,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),pe={class:"tab-pane active show",id:"tabs-pod"},ve={class:"card"},be={class:"card-body"},he={class:"mb-3"},ye={class:"mb-3"},fe={class:"mb-3"},ge=["onUpdate:modelValue"],_e=["onUpdate:modelValue"],we={class:"btn-list"},ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},$e=["onClick"],xe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ce={class:"card mt-4"},Ue={class:"card-body"},Me={class:"mb-3"},Ve={class:"btn-list"},Pe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},qe=["onClick"],Se={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},De={class:"row",style:{width:"68% !important"}},je={class:"col mt-4"},ze=["onUpdate:modelValue"],He={class:"col mt-4"},Le=["onUpdate:modelValue"],Be={class:"mb-3"},Re=["onUpdate:modelValue"],Ne=["onUpdate:modelValue"],Fe={class:"btn-list"},Ae=["onClick"],Ee={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Te=["onClick"],Ye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Oe={class:"mb-3"},Ge={class:"btn-list"},Ie=["onClick"],Ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Je=["onClick"],Qe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},We={class:"row",style:{width:"68% !important"}},Xe={class:"col mt-4"},Ze=["onUpdate:modelValue"],et={class:"col mt-4"},tt=["onUpdate:modelValue"],lt={class:"row",style:{width:"68% !important"}},ot={class:"col mt-4"},st=["onUpdate:modelValue"],nt={class:"col mt-4"},at=["onUpdate:modelValue"],rt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},it={class:"mb-3"},dt={class:"row",style:{width:"68% !important"}},ut={class:"col mt-4"},ct=["onUpdate:modelValue"],mt={class:"col mt-4"},pt=["onUpdate:modelValue"],vt={class:"row",style:{width:"68% !important"}},bt={class:"col mt-4"},ht=["onUpdate:modelValue"],yt={class:"col mt-4"},ft=["onUpdate:modelValue"],gt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},_t={class:"mb-3"},wt={class:"mt-4"},kt={class:"btn-list justify-content-end mt-4"},$t=B({__name:"podForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f(""),V=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const i of p.value)if(!i.name||i.name.trim()===""||!i.image||i.image.trim()==="")return!1;return!0});G(async()=>{await L()});const L=()=>{$.value="Pod",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value={containers:[],restartPolicy:""},p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter pod name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=i,w.value.metadata=l.value,r.value.containers=p.value,w.value.spec=r.value;const{data:t}=await Z(w.value);M.value=t},E=()=>{_.value.push({key:"",value:""})},T=i=>{_.value.length!==1&&_.value.splice(i,1)},H=()=>{p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},u=i=>{p.value.length!==1&&p.value.splice(i,1)},o=i=>{p.value[i].env.push({name:"",value:""})},U=(i,t)=>{p.value[i].env.length!==1&&p.value[i].env.splice(t,1)},x=i=>{p.value[i].ports.push({name:"",containerPort:"",hostPort:"",protocol:""})},k=(i,t)=>{p.value[i].ports.length!==1&&p.value[i].ports.splice(t,1)};return(i,t)=>(n(),a("div",pe,[e("div",ve,[t[9]||(t[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",be,[e("div",he,[t[4]||(t[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[0]||(t[0]=s=>l.value.name=s),placeholder:"pod-01"},null,512),[[m,l.value.name]])]),e("div",ye,[t[5]||(t[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[1]||(t[1]=s=>l.value.namespace=s),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",fe,[t[8]||(t[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(s,b)=>(n(),a("div",{class:"generate-form",key:b},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.key=y,placeholder:"key"},null,8,ge),[[m,s.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.value=y,placeholder:"value"},null,8,_e),[[m,s.value]]),e("div",we,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",ke,t[6]||(t[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>T(b)},[(n(),a("svg",xe,t[7]||(t[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,$e)])]))),128))])])]),e("div",Ce,[t[31]||(t[31]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Ue,[(n(!0),a(D,null,j(p.value,(s,b)=>(n(),a("div",{class:"mt-4",key:b},[e("div",Me,[e("div",Ve,[t[12]||(t[12]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Pe,t[10]||(t[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>u(b)},[(n(),a("svg",Se,t[11]||(t[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,qe)]),e("div",De,[e("div",je,[t[13]||(t[13]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.name=y},null,8,ze),[[m,s.name]])]),e("div",He,[t[14]||(t[14]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.image=y},null,8,Le),[[m,s.image]])])])]),e("div",Be,[t[17]||(t[17]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(s.env,(y,Y)=>(n(),a("div",{class:"generate-form",key:Y},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.name=g,placeholder:"key"},null,8,Re),[[m,y.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.value=g,placeholder:"value"},null,8,Ne),[[m,y.value]]),e("div",Fe,[e("button",{class:"btn btn-primary",onClick:g=>o(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ee,t[15]||(t[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ae),e("button",{class:"btn btn-primary",onClick:g=>U(b,Y)},[(n(),a("svg",Ye,t[16]||(t[16]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Te)])]))),128))]),e("div",Oe,[(n(!0),a(D,null,j(s.ports,(y,Y)=>(n(),a("div",{class:"mt-4",key:Y},[e("div",Ge,[t[20]||(t[20]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:g=>x(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ke,t[18]||(t[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ie),e("button",{class:"btn btn-primary",onClick:g=>k(b,Y)},[(n(),a("svg",Qe,t[19]||(t[19]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Je)]),e("div",We,[e("div",Xe,[t[21]||(t[21]=e("label",{class:"form-label"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.name=g},null,8,Ze),[[m,y.name]])]),e("div",et,[t[22]||(t[22]=e("label",{class:"form-label"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.containerPort=g},null,8,tt),[[m,y.containerPort]])])]),e("div",lt,[e("div",ot,[t[23]||(t[23]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.protocol=g},null,8,st),[[m,y.protocol]])]),e("div",nt,[t[24]||(t[24]=e("label",{class:"form-label"},"- Host Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.hostPort=g},null,8,at),[[m,y.hostPort]])])]),s.ports.length>1?(n(),a("div",rt)):W("",!0)]))),128))]),e("div",it,[t[29]||(t[29]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"Resources")],-1)),e("div",dt,[e("div",ut,[t[25]||(t[25]=e("label",{class:"form-label"},"- Limits CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.cpu=y},null,8,ct),[[m,s.resources.limits.cpu]])]),e("div",mt,[t[26]||(t[26]=e("label",{class:"form-label"},"- Limits Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.memory=y},null,8,pt),[[m,s.resources.limits.memory]])])]),e("div",vt,[e("div",bt,[t[27]||(t[27]=e("label",{class:"form-label"},"- Requests CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.cpu=y},null,8,ht),[[m,s.resources.requests.cpu]])]),e("div",yt,[t[28]||(t[28]=e("label",{class:"form-label"},"- Requests Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.memory=y},null,8,ft),[[m,s.resources.requests.memory]])])])]),p.value.length>1?(n(),a("div",gt)):W("",!0)]))),128)),e("div",_t,[e("div",wt,[t[30]||(t[30]=e("label",{class:"form-label"},"- Restart Policy",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":t[2]||(t[2]=s=>r.value.restartPolicy=s)},null,512),[[m,r.value.restartPolicy]])])])])]),e("div",kt,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:t[3]||(t[3]=s=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-pod"},"GENERATE",2)]),N(me,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),xt=Q($t,[["__scopeId","data-v-ebbc4037"]]),Ct={class:"modal",id:"modal-deploy",tabindex:"-1"},Ut={class:"modal-dialog modal-lg",role:"document"},Mt={class:"modal-content"},Vt={class:"modal-header"},Pt={class:"modal-title"},qt={class:"modal-body"},St={class:"card"},Dt={class:"card-body"},jt=B({__name:"deployModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ct,[e("div",Ut,[e("div",Mt,[e("div",Vt,[e("h5",Pt,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",qt,[e("div",St,[e("div",Dt,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),zt={class:"tab-pane",id:"tabs-deployment"},Ht={class:"card"},Lt={class:"card-body"},Bt={class:"mb-3"},Rt={class:"mb-3"},Nt={class:"mb-3"},Ft=["onUpdate:modelValue"],At=["onUpdate:modelValue"],Et={class:"btn-list"},Tt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Yt=["onClick"],Ot={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Gt={class:"card mt-4"},It={class:"card-body"},Kt={class:"mb-3"},Jt={class:"mb-3"},Qt=["onUpdate:modelValue"],Wt=["onUpdate:modelValue"],Xt={class:"btn-list"},Zt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},el=["onClick"],tl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ll={class:"mb-3"},ol=["onUpdate:modelValue"],sl=["onUpdate:modelValue"],nl={class:"btn-list"},al={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},rl=["onClick"],il={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},dl={class:"mb-3"},ul={class:"btn-list"},cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},ml=["onClick"],pl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vl={class:"row",style:{width:"68% !important"}},bl={class:"col mt-4"},hl=["onUpdate:modelValue"],yl={class:"col mt-4"},fl=["onUpdate:modelValue"],gl={class:"mb-3"},_l=["onUpdate:modelValue"],wl={class:"btn-list"},kl=["onClick"],$l={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},xl=["onClick"],Cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ul={class:"mb-3"},Ml=["onUpdate:modelValue"],Vl=["onUpdate:modelValue"],Pl={class:"btn-list"},ql=["onClick"],Sl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Dl=["onClick"],jl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},zl={class:"btn-list justify-content-end mt-4"},Hl=B({__name:"deploymentForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f([]),M=f({}),V=f([]),L=f(""),R=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const g of V.value)if(!g.name||g.name.trim()===""||!g.image||g.image.trim()==="")return!1;return!0});G(async()=>{await E()});const E=()=>{$.value="Deployment",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value={replicas:"",selector:{matchLabels:{}},template:{metadata:{labels:{}},spec:{containers:[]}}},V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},T=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter deployment name.");const v=document.querySelector('input[v-model="metadata.name"]');v==null||v.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const v=document.querySelector('input[v-model="metadata.namespace"]');v==null||v.focus();return}for(let v=0;v(v[q.key]=q.value,v),{}),d=r.value.reduce((v,q)=>(v[q.key]=q.value,v),{}),C=p.value.reduce((v,q)=>(v[q.key]=q.value,v),{});l.value.labels=g,w.value.metadata=l.value,M.value.selector.matchLabels=d,M.value.template.metadata.labels=C,M.value.template.spec.containers=V.value,w.value.spec=M.value,console.log("deployFormData.value : ",w.value);const{data:S}=await le(w.value);L.value=S},H=()=>{_.value.push({key:"",value:""})},u=g=>{_.value.length!==1&&_.value.splice(g,1)},o=()=>{r.value.push({key:"",value:""})},U=g=>{r.value.length!==1&&r.value.splice(g,1)},x=()=>{p.value.push({key:"",value:""})},k=g=>{p.value.length!==1&&p.value.splice(g,1)},i=()=>{V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},t=g=>{V.value.length!==1&&V.value.splice(g,1)},s=g=>{V.value[g].env.push({name:"",value:""})},b=(g,d)=>{V.value[g].env.length!==1&&V.value[g].env.splice(d,1)},y=g=>{V.value[g].ports.push({containerPort:""})},Y=(g,d)=>{V.value[g].ports.length!==1&&V.value[g].ports.splice(d,1)};return(g,d)=>(n(),a("div",zt,[e("div",Ht,[d[9]||(d[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Lt,[e("div",Bt,[d[4]||(d[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[0]||(d[0]=C=>l.value.name=C),placeholder:"deployment-01"},null,512),[[m,l.value.name]])]),e("div",Rt,[d[5]||(d[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[1]||(d[1]=C=>l.value.namespace=C),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Nt,[d[8]||(d[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Ft),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,At),[[m,C.value]]),e("div",Et,[e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Tt,d[6]||(d[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>u(S)},[(n(),a("svg",Ot,d[7]||(d[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Yt)])]))),128))])])]),e("div",Gt,[d[29]||(d[29]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",It,[e("div",Kt,[d[10]||(d[10]=e("label",{class:"form-label"},"- Replicas",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":d[2]||(d[2]=C=>M.value.replicas=C)},null,512),[[m,M.value.replicas]])]),e("div",Jt,[d[13]||(d[13]=e("label",{class:"form-label"},"- Match Labels",-1)),(n(!0),a(D,null,j(r.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Qt),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,Wt),[[m,C.value]]),e("div",Xt,[e("button",{class:"btn btn-primary",onClick:o,style:{"text-align":"center !important"}},[(n(),a("svg",Zt,d[11]||(d[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>U(S)},[(n(),a("svg",tl,d[12]||(d[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,el)])]))),128))]),d[28]||(d[28]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Template")],-1)),e("div",ll,[d[16]||(d[16]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"- Labels")],-1)),(n(!0),a(D,null,j(p.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,ol),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,sl),[[m,C.value]]),e("div",nl,[e("button",{class:"btn btn-primary",onClick:x,style:{"text-align":"center !important"}},[(n(),a("svg",al,d[14]||(d[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>k(S)},[(n(),a("svg",il,d[15]||(d[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,rl)])]))),128))]),(n(!0),a(D,null,j(V.value,(C,S)=>(n(),a("div",{key:S},[e("div",dl,[e("div",ul,[d[19]||(d[19]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:i,style:{"text-align":"center !important"}},[(n(),a("svg",cl,d[17]||(d[17]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>t(S)},[(n(),a("svg",pl,d[18]||(d[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ml)]),e("div",vl,[e("div",bl,[d[20]||(d[20]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.name=v},null,8,hl),[[m,C.name]])]),e("div",yl,[d[21]||(d[21]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.image=v},null,8,fl),[[m,C.image]])])])]),e("div",gl,[d[24]||(d[24]=e("label",{class:"form-label"},"- Port",-1)),(n(!0),a(D,null,j(C.ports,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.containerPort=z,placeholder:"value"},null,8,_l),[[m,v.containerPort]]),e("div",wl,[e("button",{class:"btn btn-primary",onClick:z=>y(S),style:{"text-align":"center !important"}},[(n(),a("svg",$l,d[22]||(d[22]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,kl),e("button",{class:"btn btn-primary",onClick:z=>Y(S,q)},[(n(),a("svg",Cl,d[23]||(d[23]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,xl)])]))),128))]),e("div",Ul,[d[27]||(d[27]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(C.env,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.name=z,placeholder:"key"},null,8,Ml),[[m,v.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.value=z,placeholder:"value"},null,8,Vl),[[m,v.value]]),e("div",Pl,[e("button",{class:"btn btn-primary",onClick:z=>s(S),style:{"text-align":"center !important"}},[(n(),a("svg",Sl,d[25]||(d[25]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ql),e("button",{class:"btn btn-primary",onClick:z=>b(S,q)},[(n(),a("svg",jl,d[26]||(d[26]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Dl)])]))),128))])]))),128))])]),e("div",zl,[e("a",{class:K(["btn btn-primary",{disabled:!R.value}]),onClick:d[3]||(d[3]=C=>R.value?T():null),"data-bs-toggle":"modal","data-bs-target":"#modal-deploy"},"GENERATE",2)]),N(jt,{"yaml-data":L.value,title:$.value},null,8,["yaml-data","title"])]))}}),Ll=Q(Hl,[["__scopeId","data-v-f08d5135"]]),Bl={class:"modal",id:"modal-service",tabindex:"-1"},Rl={class:"modal-dialog modal-lg",role:"document"},Nl={class:"modal-content"},Fl={class:"modal-header"},Al={class:"modal-title"},El={class:"modal-body"},Tl={class:"card"},Yl={class:"card-body"},Ol=B({__name:"servcieModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Bl,[e("div",Rl,[e("div",Nl,[e("div",Fl,[e("h5",Al,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",El,[e("div",Tl,[e("div",Yl,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Gl={class:"tab-pane",id:"tabs-service"},Il={class:"card"},Kl={class:"card-body"},Jl={class:"mb-3"},Ql={class:"mb-3"},Wl={class:"mb-3"},Xl=["onUpdate:modelValue"],Zl=["onUpdate:modelValue"],eo={class:"btn-list"},to={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},lo=["onClick"],oo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},so={class:"card mt-4"},no={class:"card-body"},ao={class:"mb-3"},ro=["onUpdate:modelValue"],io=["onUpdate:modelValue"],uo={class:"btn-list"},co={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},mo=["onClick"],po={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vo={class:"mb-3"},bo={class:"btn-list"},ho={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},yo=["onClick"],fo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},go={class:"row",style:{width:"68% !important"}},_o={class:"col mt-4"},wo=["onUpdate:modelValue"],ko={class:"col mt-4"},$o=["onUpdate:modelValue"],xo={class:"row",style:{width:"68% !important"}},Co={class:"col mt-4"},Uo=["onUpdate:modelValue"],Mo={class:"col mt-4"},Vo=["onUpdate:modelValue"],Po={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},qo={class:"row",style:{width:"68% !important"}},So={class:"col mt-4"},Do={class:"btn-list justify-content-end mt-4"},jo=B({__name:"serviceForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f([]);f("");const V=f(""),L=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const k of M.value)if(!k.port||k.port.trim()===""||!k.targetPort||k.targetPort.trim()==="")return!1;return!0});G(async()=>{await R()});const R=()=>{$.value="Service",l.value={name:"",namespace:"",labels:{}},r.value={selector:{},ports:[],type:""},_.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},E=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter service name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=k,w.value.metadata=l.value;const i=p.value.reduce((s,b)=>(s[b.key]=b.value,s),{});r.value.selector=i,r.value.ports=M.value,w.value.spec=r.value;const{data:t}=await ee(w.value);V.value=t},T=()=>{_.value.push({key:"",value:""})},H=k=>{_.value.length!==1&&_.value.splice(k,1)},u=()=>{p.value.push({key:"",value:""})},o=k=>{p.value.length!==1&&p.value.splice(k,1)},U=()=>{M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},x=k=>{M.value.length!==1&&M.value.splice(k,1)};return(k,i)=>(n(),a("div",Gl,[e("div",Il,[i[9]||(i[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Kl,[e("div",Jl,[i[4]||(i[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[0]||(i[0]=t=>l.value.name=t),placeholder:"name-01"},null,512),[[m,l.value.name]])]),e("div",Ql,[i[5]||(i[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[1]||(i[1]=t=>l.value.namespace=t),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Wl,[i[8]||(i[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,Xl),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,Zl),[[m,t.value]]),e("div",eo,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",to,i[6]||(i[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>H(s)},[(n(),a("svg",oo,i[7]||(i[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,lo)])]))),128))])])]),e("div",so,[i[21]||(i[21]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",no,[e("div",ao,[i[12]||(i[12]=e("label",{class:"form-label"},"- Selector",-1)),(n(!0),a(D,null,j(p.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,ro),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,io),[[m,t.value]]),e("div",uo,[e("button",{class:"btn btn-primary",onClick:u,style:{"text-align":"center !important"}},[(n(),a("svg",co,i[10]||(i[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>o(s)},[(n(),a("svg",po,i[11]||(i[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,mo)])]))),128))]),e("div",vo,[(n(!0),a(D,null,j(M.value,(t,s)=>(n(),a("div",{class:"mt-4",key:s},[e("div",bo,[i[15]||(i[15]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:U,style:{"text-align":"center !important"}},[(n(),a("svg",ho,i[13]||(i[13]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>x(s)},[(n(),a("svg",fo,i[14]||(i[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,yo)]),e("div",go,[e("div",_o,[i[16]||(i[16]=e("label",{class:"form-label required"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.port=b},null,8,wo),[[m,t.port]])]),e("div",ko,[i[17]||(i[17]=e("label",{class:"form-label required"},"- Target Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.targetPort=b},null,8,$o),[[m,t.targetPort]])])]),e("div",xo,[e("div",Co,[i[18]||(i[18]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.protocol=b},null,8,Uo),[[m,t.protocol]])]),e("div",Mo,[i[19]||(i[19]=e("label",{class:"form-label"},"- Node Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.nodePort=b},null,8,Vo),[[m,t.nodePort]])])]),M.value.length>1?(n(),a("div",Po)):W("",!0)]))),128)),e("div",qo,[e("div",So,[i[20]||(i[20]=e("label",{class:"form-label"},"- Type",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":i[2]||(i[2]=t=>r.value.type=t)},null,512),[[m,r.value.type]])])])])])]),e("div",Do,[e("a",{class:K(["btn btn-primary",{disabled:!L.value}]),onClick:i[3]||(i[3]=t=>L.value?E():null),"data-bs-toggle":"modal","data-bs-target":"#modal-service"},"GENERATE",2)]),N(Ol,{"yaml-data":V.value,title:$.value},null,8,["yaml-data","title"])]))}}),zo=Q(jo,[["__scopeId","data-v-b9ba3952"]]),Ho={class:"modal",id:"modal-yaml",tabindex:"-1"},Lo={class:"modal-dialog modal-lg",role:"document"},Bo={class:"modal-content"},Ro={class:"modal-header"},No={class:"modal-title"},Fo={class:"modal-body"},Ao={class:"card"},Eo={class:"card-body"},To=B({__name:"yamlModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ho,[e("div",Lo,[e("div",Bo,[e("div",Ro,[e("h5",No,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",Fo,[e("div",Ao,[e("div",Eo,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Yo={class:"tab-pane",id:"tabs-hpa"},Oo={class:"card"},Go={class:"card-body"},Io={class:"mb-3"},Ko={class:"mb-3"},Jo={class:"mb-3"},Qo=["onUpdate:modelValue"],Wo=["onUpdate:modelValue"],Xo={class:"btn-list"},Zo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},es=["onClick"],ts={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ls={class:"card mt-4"},os={class:"card-body"},ss={class:"row",style:{width:"68% !important"}},ns={class:"col"},as={class:"col"},rs={class:"row",style:{width:"68% !important"}},is={class:"col"},ds={class:"row",style:{width:"68% !important"}},us={class:"col"},cs={class:"row",style:{width:"68% !important"}},ms={class:"col"},ps={class:"row",style:{width:"68% !important"}},vs={class:"col"},bs={class:"btn-list justify-content-end mt-4"},hs=B({__name:"hpaForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f({}),M=f(""),V=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""||!p.value.apiVersion||p.value.apiVersion.trim()===""||!p.value.kind||p.value.kind.trim()===""||!p.value.name||p.value.name.trim()===""||!r.value.minReplicas||r.value.minReplicas.trim()===""||!r.value.maxReplicas||r.value.maxReplicas.trim()===""||!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""));G(async()=>{await L()});const L=()=>{$.value="HPA",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value={scaleTargetRef:{},minReplicas:"",maxReplicas:"",targetCPUUtilizationPercentage:""},p.value={apiVersion:"",kind:"",name:""}},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter HPA name.");const o=document.querySelector('input[v-model="metadata.name"]');o==null||o.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const o=document.querySelector('input[v-model="metadata.namespace"]');o==null||o.focus();return}if(!p.value.apiVersion||p.value.apiVersion.trim()===""){h.error("Please enter API version.");const o=document.querySelector('input[v-model="scaleTargetRef.apiVersion"]');o==null||o.focus();return}if(!p.value.kind||p.value.kind.trim()===""){h.error("Please enter kind.");const o=document.querySelector('input[v-model="scaleTargetRef.kind"]');o==null||o.focus();return}if(!p.value.name||p.value.name.trim()===""){h.error("Please enter target name.");const o=document.querySelector('input[v-model="scaleTargetRef.name"]');o==null||o.focus();return}if(!r.value.minReplicas||r.value.minReplicas.trim()===""){h.error("Please enter min replicas.");const o=document.querySelector('input[v-model="spec.minReplicas"]');o==null||o.focus();return}if(!r.value.maxReplicas||r.value.maxReplicas.trim()===""){h.error("Please enter max replicas.");const o=document.querySelector('input[v-model="spec.maxReplicas"]');o==null||o.focus();return}if(!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""){h.error("Please enter CPU percentage.");const o=document.querySelector('input[v-model="spec.targetCPUUtilizationPercentage"]');o==null||o.focus();return}const H=_.value.reduce((o,U)=>(o[U.key]=U.value,o),{});l.value.labels=H,r.value.scaleTargetRef=p.value,w.value.metadata=l.value,w.value.spec=r.value;const{data:u}=await te(w.value);M.value=u},E=()=>{_.value.push({key:"",value:""})},T=H=>{_.value.length!==1&&_.value.splice(H,1)};return(H,u)=>(n(),a("div",Yo,[e("div",Oo,[u[14]||(u[14]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Go,[e("div",Io,[u[9]||(u[9]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[0]||(u[0]=o=>l.value.name=o),placeholder:"name"},null,512),[[m,l.value.name]])]),e("div",Ko,[u[10]||(u[10]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[1]||(u[1]=o=>l.value.namespace=o),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Jo,[u[13]||(u[13]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(o,U)=>(n(),a("div",{class:"generate-form",key:U},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.key=x,placeholder:"key"},null,8,Qo),[[m,o.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.value=x,placeholder:"value"},null,8,Wo),[[m,o.value]]),e("div",Xo,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",Zo,u[11]||(u[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:x=>T(U)},[(n(),a("svg",ts,u[12]||(u[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,es)])]))),128))])])]),e("div",ls,[u[22]||(u[22]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",os,[u[21]||(u[21]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Scale Target")],-1)),e("div",ss,[e("div",ns,[u[15]||(u[15]=e("label",{class:"form-label required"},"- Api Version",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[2]||(u[2]=o=>p.value.apiVersion=o)},null,512),[[m,p.value.apiVersion]])]),e("div",as,[u[16]||(u[16]=e("label",{class:"form-label required"},"- Kind",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[3]||(u[3]=o=>p.value.kind=o)},null,512),[[m,p.value.kind]])])]),e("div",rs,[e("div",is,[u[17]||(u[17]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[4]||(u[4]=o=>p.value.name=o)},null,512),[[m,p.value.name]])])]),e("div",ds,[e("div",us,[u[18]||(u[18]=e("label",{class:"form-label required"},"- Min Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[5]||(u[5]=o=>r.value.minReplicas=o)},null,512),[[m,r.value.minReplicas]])])]),e("div",cs,[e("div",ms,[u[19]||(u[19]=e("label",{class:"form-label required"},"- Max Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[6]||(u[6]=o=>r.value.maxReplicas=o)},null,512),[[m,r.value.maxReplicas]])])]),e("div",ps,[e("div",vs,[u[20]||(u[20]=e("label",{class:"form-label required"},"- CPU Percentage",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[7]||(u[7]=o=>r.value.targetCPUUtilizationPercentage=o)},null,512),[[m,r.value.targetCPUUtilizationPercentage]])])])])]),e("div",bs,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:u[8]||(u[8]=o=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-yaml"},"GENERATE",2)]),N(To,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),ys=Q(hs,[["__scopeId","data-v-b0620f31"]]),fs={class:"modal",id:"modal-config-map",tabindex:"-1"},gs={class:"modal-dialog modal-lg",role:"document"},_s={class:"modal-content"},ws={class:"modal-header"},ks={class:"modal-title"},$s={class:"modal-body"},xs={class:"card"},Cs={class:"card-body"},Us=B({__name:"configMapModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",fs,[e("div",gs,[e("div",_s,[e("div",ws,[e("h5",ks,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",$s,[e("div",xs,[e("div",Cs,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Ms={class:"tab-pane",id:"tabs-configMap"},Vs={class:"card"},Ps={class:"card-body"},qs={class:"mb-3"},Ss={class:"mb-3"},Ds={class:"mb-3"},js=["onUpdate:modelValue"],zs=["onUpdate:modelValue"],Hs={class:"btn-list"},Ls={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Bs=["onClick"],Rs={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ns={class:"card mt-4"},Fs={class:"card-body"},As={class:"mb-3"},Es=["onUpdate:modelValue"],Ts=["onUpdate:modelValue"],Ys={class:"btn-list"},Os={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Gs=["onClick"],Is={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ks={class:"btn-list justify-content-end mt-4"},Js=B({__name:"configmapForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f(""),M=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""));G(async()=>{await V()});const V=()=>{$.value="ConfigMap",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value.push({key:"",value:""})},L=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter ConfigMap name.");const x=document.querySelector('input[v-model="metadata.name"]');x==null||x.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const x=document.querySelector('input[v-model="metadata.namespace"]');x==null||x.focus();return}const u=_.value.reduce((x,k)=>(x[k.key]=k.value,x),{});l.value.labels=u;const o=r.value.reduce((x,k)=>(x[k.key]=k.value,x),{});w.value.metadata=l.value,w.value.data=o;const{data:U}=await oe(w.value);p.value=U},R=()=>{_.value.push({key:"",value:""})},E=u=>{_.value.length!==1&&_.value.splice(u,1)},T=()=>{r.value.push({key:"",value:""})},H=u=>{r.value.length!==1&&r.value.splice(u,1)};return(u,o)=>(n(),a("div",Ms,[e("div",Vs,[o[8]||(o[8]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Ps,[e("div",qs,[o[3]||(o[3]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[0]||(o[0]=U=>l.value.name=U),placeholder:"configMap-01"},null,512),[[m,l.value.name]])]),e("div",Ss,[o[4]||(o[4]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[1]||(o[1]=U=>l.value.namespace=U),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Ds,[o[7]||(o[7]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,js),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,zs),[[m,U.value]]),e("div",Hs,[e("button",{class:"btn btn-primary",onClick:R,style:{"text-align":"center !important"}},[(n(),a("svg",Ls,o[5]||(o[5]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>E(x)},[(n(),a("svg",Rs,o[6]||(o[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Bs)])]))),128))])])]),e("div",Ns,[o[12]||(o[12]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Fs,[e("div",As,[o[11]||(o[11]=e("label",{class:"form-label"},"- Data",-1)),(n(!0),a(D,null,j(r.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,Es),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,Ts),[[m,U.value]]),e("div",Ys,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",Os,o[9]||(o[9]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>H(x)},[(n(),a("svg",Is,o[10]||(o[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Gs)])]))),128))])])]),e("div",Ks,[e("a",{class:K(["btn btn-primary",{disabled:!M.value}]),onClick:o[2]||(o[2]=U=>M.value?L():null),"data-bs-toggle":"modal","data-bs-target":"#modal-config-map"},"GENERATE",2)]),N(Us,{"yaml-data":p.value,title:$.value},null,8,["yaml-data","title"])]))}}),Qs=Q(Js,[["__scopeId","data-v-e0b005d8"]]),Ws={class:"card w-100",ref:"workflowForm"},Xs={class:"card-body"},Zs={class:"card"},en={class:"card-body"},tn={class:"tab-content"},nn=B({__name:"YamlGenerate",setup(P){return O(),G(async()=>{}),(h,$)=>(n(),a("div",Ws,[$[1]||($[1]=e("div",{class:"card-header"},[e("div",{class:"card-title"},[e("h1",null,"YAML Generator")])],-1)),e("div",Xs,[e("div",Zs,[$[0]||($[0]=X('',1)),e("div",en,[e("div",tn,[N(xt),N(Ll),N(zo),N(ys),N(Qs)])])])])],512))}});export{nn as default}; diff --git a/src/main/resources/static/assets/bootstrap.esm-DfXda7G9.js b/src/main/resources/static/assets/bootstrap.esm-D2DynUsO.js similarity index 99% rename from src/main/resources/static/assets/bootstrap.esm-DfXda7G9.js rename to src/main/resources/static/assets/bootstrap.esm-D2DynUsO.js index ca1ab996..a0792f05 100644 --- a/src/main/resources/static/assets/bootstrap.esm-DfXda7G9.js +++ b/src/main/resources/static/assets/bootstrap.esm-D2DynUsO.js @@ -1,4 +1,4 @@ -import{d as Ei,h as Ce,a as Ne,b as Vt,t as Se,m as On,i as Cn,p as Nn,l as Sn}from"./index-kUd7CzTD.js";import{I as Dn}from"./IconPlus-BsY6bQ-u.js";const vi={class:"page-header page-wrapper"},bi={class:"row align-items-center"},Ai={class:"card-header d-flex",style:{"justify-content":"space-between"}},Ti={class:"card-title"},yi={class:"btn-list"},wi=["data-bs-target"],Sl=Ei({__name:"TableHeader",props:{headerTitle:{},newBtnTitle:{},popupFlag:{type:Boolean},popupTarget:{}},emits:["click-new-btn"],setup(n,{emit:t}){const e=n,s=t,i=()=>{s("click-new-btn")};return(r,o)=>(Ce(),Ne("div",vi,[Vt("div",bi,[Vt("div",Ai,[Vt("h3",Ti,[Vt("strong",null,Se(e.headerTitle),1)]),Vt("div",yi,[e.popupFlag?(Ce(),Ne("a",{key:1,class:"btn btn-outline-primary d-none d-sm-inline-block","data-bs-toggle":"modal","data-bs-target":e.popupTarget,onClick:On(i,["prevent","stop"])},[Cn(Nn(Dn),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),Sn(" "+Se(e.newBtnTitle),1)],8,wi)):(Ce(),Ne("a",{key:0,class:"btn btn-outline-primary d-none d-sm-inline-block",onClick:On(i,["prevent","stop"])},[Cn(Nn(Dn),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),Sn(" "+Se(e.newBtnTitle),1)]))])])])]))}});var L="top",x="bottom",R="right",I="left",pe="auto",It=[L,x,R,I],pt="start",Ot="end",hs="clippingParents",Qe="viewport",At="popper",fs="reference",Ke=It.reduce(function(n,t){return n.concat([t+"-"+pt,t+"-"+Ot])},[]),Ze=[].concat(It,[pe]).reduce(function(n,t){return n.concat([t,t+"-"+pt,t+"-"+Ot])},[]),ps="beforeRead",_s="read",ms="afterRead",gs="beforeMain",Es="main",vs="afterMain",bs="beforeWrite",As="write",Ts="afterWrite",ys=[ps,_s,ms,gs,Es,vs,bs,As,Ts];function z(n){return n?(n.nodeName||"").toLowerCase():null}function k(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function _t(n){var t=k(n).Element;return n instanceof t||n instanceof Element}function V(n){var t=k(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function Je(n){if(typeof ShadowRoot>"u")return!1;var t=k(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function Oi(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var s=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];!V(r)||!z(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(o){var a=i[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function Ci(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(s){var i=t.elements[s],r=t.attributes[s]||{},o=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:e[s]),a=o.reduce(function(l,d){return l[d]="",l},{});!V(i)||!z(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(l){i.removeAttribute(l)}))})}}const tn={name:"applyStyles",enabled:!0,phase:"write",fn:Oi,effect:Ci,requires:["computeStyles"]};function Y(n){return n.split("-")[0]}var ft=Math.max,ue=Math.min,Ct=Math.round;function Ye(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function ws(){return!/^((?!chrome|android).)*safari/i.test(Ye())}function Nt(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var s=n.getBoundingClientRect(),i=1,r=1;t&&V(n)&&(i=n.offsetWidth>0&&Ct(s.width)/n.offsetWidth||1,r=n.offsetHeight>0&&Ct(s.height)/n.offsetHeight||1);var o=_t(n)?k(n):window,a=o.visualViewport,l=!ws()&&e,d=(s.left+(l&&a?a.offsetLeft:0))/i,u=(s.top+(l&&a?a.offsetTop:0))/r,p=s.width/i,_=s.height/r;return{width:p,height:_,top:u,right:d+p,bottom:u+_,left:d,x:d,y:u}}function en(n){var t=Nt(n),e=n.offsetWidth,s=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:s}}function Os(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&Je(e)){var s=t;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function X(n){return k(n).getComputedStyle(n)}function Ni(n){return["table","td","th"].indexOf(z(n))>=0}function st(n){return((_t(n)?n.ownerDocument:n.document)||window.document).documentElement}function _e(n){return z(n)==="html"?n:n.assignedSlot||n.parentNode||(Je(n)?n.host:null)||st(n)}function $n(n){return!V(n)||X(n).position==="fixed"?null:n.offsetParent}function Si(n){var t=/firefox/i.test(Ye()),e=/Trident/i.test(Ye());if(e&&V(n)){var s=X(n);if(s.position==="fixed")return null}var i=_e(n);for(Je(i)&&(i=i.host);V(i)&&["html","body"].indexOf(z(i))<0;){var r=X(i);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return i;i=i.parentNode}return null}function Kt(n){for(var t=k(n),e=$n(n);e&&Ni(e)&&X(e).position==="static";)e=$n(e);return e&&(z(e)==="html"||z(e)==="body"&&X(e).position==="static")?t:e||Si(n)||t}function nn(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Bt(n,t,e){return ft(n,ue(t,e))}function Di(n,t,e){var s=Bt(n,t,e);return s>e?e:s}function Cs(){return{top:0,right:0,bottom:0,left:0}}function Ns(n){return Object.assign({},Cs(),n)}function Ss(n,t){return t.reduce(function(e,s){return e[s]=n,e},{})}var $i=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Ns(typeof t!="number"?t:Ss(t,It))};function Li(n){var t,e=n.state,s=n.name,i=n.options,r=e.elements.arrow,o=e.modifiersData.popperOffsets,a=Y(e.placement),l=nn(a),d=[I,R].indexOf(a)>=0,u=d?"height":"width";if(!(!r||!o)){var p=$i(i.padding,e),_=en(r),f=l==="y"?L:I,A=l==="y"?x:R,m=e.rects.reference[u]+e.rects.reference[l]-o[l]-e.rects.popper[u],E=o[l]-e.rects.reference[l],T=Kt(r),w=T?l==="y"?T.clientHeight||0:T.clientWidth||0:0,O=m/2-E/2,g=p[f],v=w-_[u]-p[A],b=w/2-_[u]/2+O,y=Bt(g,b,v),S=l;e.modifiersData[s]=(t={},t[S]=y,t.centerOffset=y-b,t)}}function Ii(n){var t=n.state,e=n.options,s=e.element,i=s===void 0?"[data-popper-arrow]":s;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Os(t.elements.popper,i)&&(t.elements.arrow=i))}const Ds={name:"arrow",enabled:!0,phase:"main",fn:Li,effect:Ii,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function St(n){return n.split("-")[1]}var Pi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Mi(n,t){var e=n.x,s=n.y,i=t.devicePixelRatio||1;return{x:Ct(e*i)/i||0,y:Ct(s*i)/i||0}}function Ln(n){var t,e=n.popper,s=n.popperRect,i=n.placement,r=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,p=n.isFixed,_=o.x,f=_===void 0?0:_,A=o.y,m=A===void 0?0:A,E=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=E.x,m=E.y;var T=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),O=I,g=L,v=window;if(d){var b=Kt(e),y="clientHeight",S="clientWidth";if(b===k(e)&&(b=st(e),X(b).position!=="static"&&a==="absolute"&&(y="scrollHeight",S="scrollWidth")),b=b,i===L||(i===I||i===R)&&r===Ot){g=x;var N=p&&b===v&&v.visualViewport?v.visualViewport.height:b[y];m-=N-s.height,m*=l?1:-1}if(i===I||(i===L||i===x)&&r===Ot){O=R;var C=p&&b===v&&v.visualViewport?v.visualViewport.width:b[S];f-=C-s.width,f*=l?1:-1}}var D=Object.assign({position:a},d&&Pi),j=u===!0?Mi({x:f,y:m},k(e)):{x:f,y:m};if(f=j.x,m=j.y,l){var $;return Object.assign({},D,($={},$[g]=w?"0":"",$[O]=T?"0":"",$.transform=(v.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",$))}return Object.assign({},D,(t={},t[g]=w?m+"px":"",t[O]=T?f+"px":"",t.transform="",t))}function xi(n){var t=n.state,e=n.options,s=e.gpuAcceleration,i=s===void 0?!0:s,r=e.adaptive,o=r===void 0?!0:r,a=e.roundOffsets,l=a===void 0?!0:a,d={placement:Y(t.placement),variation:St(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ln(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ln(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const sn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:xi,data:{}};var te={passive:!0};function Ri(n){var t=n.state,e=n.instance,s=n.options,i=s.scroll,r=i===void 0?!0:i,o=s.resize,a=o===void 0?!0:o,l=k(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&d.forEach(function(u){u.addEventListener("scroll",e.update,te)}),a&&l.addEventListener("resize",e.update,te),function(){r&&d.forEach(function(u){u.removeEventListener("scroll",e.update,te)}),a&&l.removeEventListener("resize",e.update,te)}}const rn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ri,data:{}};var ki={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(n){return n.replace(/left|right|bottom|top/g,function(t){return ki[t]})}var Vi={start:"end",end:"start"};function In(n){return n.replace(/start|end/g,function(t){return Vi[t]})}function on(n){var t=k(n),e=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:e,scrollTop:s}}function an(n){return Nt(st(n)).left+on(n).scrollLeft}function Hi(n,t){var e=k(n),s=st(n),i=e.visualViewport,r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;var d=ws();(d||!d&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:r,height:o,x:a+an(n),y:l}}function Wi(n){var t,e=st(n),s=on(n),i=(t=n.ownerDocument)==null?void 0:t.body,r=ft(e.scrollWidth,e.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=ft(e.scrollHeight,e.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-s.scrollLeft+an(n),l=-s.scrollTop;return X(i||e).direction==="rtl"&&(a+=ft(e.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function cn(n){var t=X(n),e=t.overflow,s=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+i+s)}function $s(n){return["html","body","#document"].indexOf(z(n))>=0?n.ownerDocument.body:V(n)&&cn(n)?n:$s(_e(n))}function jt(n,t){var e;t===void 0&&(t=[]);var s=$s(n),i=s===((e=n.ownerDocument)==null?void 0:e.body),r=k(s),o=i?[r].concat(r.visualViewport||[],cn(s)?s:[]):s,a=t.concat(o);return i?a:a.concat(jt(_e(o)))}function Ue(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function Bi(n,t){var e=Nt(n,!1,t==="fixed");return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function Pn(n,t,e){return t===Qe?Ue(Hi(n,e)):_t(t)?Bi(t,e):Ue(Wi(st(n)))}function ji(n){var t=jt(_e(n)),e=["absolute","fixed"].indexOf(X(n).position)>=0,s=e&&V(n)?Kt(n):n;return _t(s)?t.filter(function(i){return _t(i)&&Os(i,s)&&z(i)!=="body"}):[]}function Fi(n,t,e,s){var i=t==="clippingParents"?ji(n):[].concat(t),r=[].concat(i,[e]),o=r[0],a=r.reduce(function(l,d){var u=Pn(n,d,s);return l.top=ft(u.top,l.top),l.right=ue(u.right,l.right),l.bottom=ue(u.bottom,l.bottom),l.left=ft(u.left,l.left),l},Pn(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ls(n){var t=n.reference,e=n.element,s=n.placement,i=s?Y(s):null,r=s?St(s):null,o=t.x+t.width/2-e.width/2,a=t.y+t.height/2-e.height/2,l;switch(i){case L:l={x:o,y:t.y-e.height};break;case x:l={x:o,y:t.y+t.height};break;case R:l={x:t.x+t.width,y:a};break;case I:l={x:t.x-e.width,y:a};break;default:l={x:t.x,y:t.y}}var d=i?nn(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(r){case pt:l[d]=l[d]-(t[u]/2-e[u]/2);break;case Ot:l[d]=l[d]+(t[u]/2-e[u]/2);break}}return l}function Dt(n,t){t===void 0&&(t={});var e=t,s=e.placement,i=s===void 0?n.placement:s,r=e.strategy,o=r===void 0?n.strategy:r,a=e.boundary,l=a===void 0?hs:a,d=e.rootBoundary,u=d===void 0?Qe:d,p=e.elementContext,_=p===void 0?At:p,f=e.altBoundary,A=f===void 0?!1:f,m=e.padding,E=m===void 0?0:m,T=Ns(typeof E!="number"?E:Ss(E,It)),w=_===At?fs:At,O=n.rects.popper,g=n.elements[A?w:_],v=Fi(_t(g)?g:g.contextElement||st(n.elements.popper),l,u,o),b=Nt(n.elements.reference),y=Ls({reference:b,element:O,strategy:"absolute",placement:i}),S=Ue(Object.assign({},O,y)),N=_===At?S:b,C={top:v.top-N.top+T.top,bottom:N.bottom-v.bottom+T.bottom,left:v.left-N.left+T.left,right:N.right-v.right+T.right},D=n.modifiersData.offset;if(_===At&&D){var j=D[i];Object.keys(C).forEach(function($){var ot=[R,x].indexOf($)>=0?1:-1,at=[L,x].indexOf($)>=0?"y":"x";C[$]+=j[at]*ot})}return C}function Ki(n,t){t===void 0&&(t={});var e=t,s=e.placement,i=e.boundary,r=e.rootBoundary,o=e.padding,a=e.flipVariations,l=e.allowedAutoPlacements,d=l===void 0?Ze:l,u=St(s),p=u?a?Ke:Ke.filter(function(A){return St(A)===u}):It,_=p.filter(function(A){return d.indexOf(A)>=0});_.length===0&&(_=p);var f=_.reduce(function(A,m){return A[m]=Dt(n,{placement:m,boundary:i,rootBoundary:r,padding:o})[Y(m)],A},{});return Object.keys(f).sort(function(A,m){return f[A]-f[m]})}function Yi(n){if(Y(n)===pe)return[];var t=ae(n);return[In(n),t,In(t)]}function Ui(n){var t=n.state,e=n.options,s=n.name;if(!t.modifiersData[s]._skip){for(var i=e.mainAxis,r=i===void 0?!0:i,o=e.altAxis,a=o===void 0?!0:o,l=e.fallbackPlacements,d=e.padding,u=e.boundary,p=e.rootBoundary,_=e.altBoundary,f=e.flipVariations,A=f===void 0?!0:f,m=e.allowedAutoPlacements,E=t.options.placement,T=Y(E),w=T===E,O=l||(w||!A?[ae(E)]:Yi(E)),g=[E].concat(O).reduce(function(Et,Z){return Et.concat(Y(Z)===pe?Ki(t,{placement:Z,boundary:u,rootBoundary:p,padding:d,flipVariations:A,allowedAutoPlacements:m}):Z)},[]),v=t.rects.reference,b=t.rects.popper,y=new Map,S=!0,N=g[0],C=0;C=0,at=ot?"width":"height",M=Dt(t,{placement:D,boundary:u,rootBoundary:p,altBoundary:_,padding:d}),F=ot?$?R:I:$?x:L;v[at]>b[at]&&(F=ae(F));var qt=ae(F),ct=[];if(r&&ct.push(M[j]<=0),a&&ct.push(M[F]<=0,M[qt]<=0),ct.every(function(Et){return Et})){N=D,S=!1;break}y.set(D,ct)}if(S)for(var Xt=A?3:1,Te=function(Z){var kt=g.find(function(Zt){var lt=y.get(Zt);if(lt)return lt.slice(0,Z).every(function(ye){return ye})});if(kt)return N=kt,"break"},Rt=Xt;Rt>0;Rt--){var Qt=Te(Rt);if(Qt==="break")break}t.placement!==N&&(t.modifiersData[s]._skip=!0,t.placement=N,t.reset=!0)}}const Is={name:"flip",enabled:!0,phase:"main",fn:Ui,requiresIfExists:["offset"],data:{_skip:!1}};function Mn(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function xn(n){return[L,R,x,I].some(function(t){return n[t]>=0})}function zi(n){var t=n.state,e=n.name,s=t.rects.reference,i=t.rects.popper,r=t.modifiersData.preventOverflow,o=Dt(t,{elementContext:"reference"}),a=Dt(t,{altBoundary:!0}),l=Mn(o,s),d=Mn(a,i,r),u=xn(l),p=xn(d);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}const Ps={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zi};function Gi(n,t,e){var s=Y(n),i=[I,L].indexOf(s)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,o=r[0],a=r[1];return o=o||0,a=(a||0)*i,[I,R].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function qi(n){var t=n.state,e=n.options,s=n.name,i=e.offset,r=i===void 0?[0,0]:i,o=Ze.reduce(function(u,p){return u[p]=Gi(p,t.rects,r),u},{}),a=o[t.placement],l=a.x,d=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=d),t.modifiersData[s]=o}const Ms={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qi};function Xi(n){var t=n.state,e=n.name;t.modifiersData[e]=Ls({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const ln={name:"popperOffsets",enabled:!0,phase:"read",fn:Xi,data:{}};function Qi(n){return n==="x"?"y":"x"}function Zi(n){var t=n.state,e=n.options,s=n.name,i=e.mainAxis,r=i===void 0?!0:i,o=e.altAxis,a=o===void 0?!1:o,l=e.boundary,d=e.rootBoundary,u=e.altBoundary,p=e.padding,_=e.tether,f=_===void 0?!0:_,A=e.tetherOffset,m=A===void 0?0:A,E=Dt(t,{boundary:l,rootBoundary:d,padding:p,altBoundary:u}),T=Y(t.placement),w=St(t.placement),O=!w,g=nn(T),v=Qi(g),b=t.modifiersData.popperOffsets,y=t.rects.reference,S=t.rects.popper,N=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,C=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(b){if(r){var $,ot=g==="y"?L:I,at=g==="y"?x:R,M=g==="y"?"height":"width",F=b[g],qt=F+E[ot],ct=F-E[at],Xt=f?-S[M]/2:0,Te=w===pt?y[M]:S[M],Rt=w===pt?-S[M]:-y[M],Qt=t.elements.arrow,Et=f&&Qt?en(Qt):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Cs(),kt=Z[ot],Zt=Z[at],lt=Bt(0,y[M],Et[M]),ye=O?y[M]/2-Xt-lt-kt-C.mainAxis:Te-lt-kt-C.mainAxis,hi=O?-y[M]/2+Xt+lt+Zt+C.mainAxis:Rt+lt+Zt+C.mainAxis,we=t.elements.arrow&&Kt(t.elements.arrow),fi=we?g==="y"?we.clientTop||0:we.clientLeft||0:0,mn=($=D==null?void 0:D[g])!=null?$:0,pi=F+ye-mn-fi,_i=F+hi-mn,gn=Bt(f?ue(qt,pi):qt,F,f?ft(ct,_i):ct);b[g]=gn,j[g]=gn-F}if(a){var En,mi=g==="x"?L:I,gi=g==="x"?x:R,ut=b[v],Jt=v==="y"?"height":"width",vn=ut+E[mi],bn=ut-E[gi],Oe=[L,I].indexOf(T)!==-1,An=(En=D==null?void 0:D[v])!=null?En:0,Tn=Oe?vn:ut-y[Jt]-S[Jt]-An+C.altAxis,yn=Oe?ut+y[Jt]+S[Jt]-An-C.altAxis:bn,wn=f&&Oe?Di(Tn,ut,yn):Bt(f?Tn:vn,ut,f?yn:bn);b[v]=wn,j[v]=wn-ut}t.modifiersData[s]=j}}const xs={name:"preventOverflow",enabled:!0,phase:"main",fn:Zi,requiresIfExists:["offset"]};function Ji(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function tr(n){return n===k(n)||!V(n)?on(n):Ji(n)}function er(n){var t=n.getBoundingClientRect(),e=Ct(t.width)/n.offsetWidth||1,s=Ct(t.height)/n.offsetHeight||1;return e!==1||s!==1}function nr(n,t,e){e===void 0&&(e=!1);var s=V(t),i=V(t)&&er(t),r=st(t),o=Nt(n,i,e),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!e)&&((z(t)!=="body"||cn(r))&&(a=tr(t)),V(t)?(l=Nt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=an(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function sr(n){var t=new Map,e=new Set,s=[];n.forEach(function(r){t.set(r.name,r)});function i(r){e.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!e.has(a)){var l=t.get(a);l&&i(l)}}),s.push(r)}return n.forEach(function(r){e.has(r.name)||i(r)}),s}function ir(n){var t=sr(n);return ys.reduce(function(e,s){return e.concat(t.filter(function(i){return i.phase===s}))},[])}function rr(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function or(n){var t=n.reduce(function(e,s){var i=e[s.name];return e[s.name]=i?Object.assign({},i,s,{options:Object.assign({},i.options,s.options),data:Object.assign({},i.data,s.data)}):s,e},{});return Object.keys(t).map(function(e){return t[e]})}var Rn={placement:"bottom",modifiers:[],strategy:"absolute"};function kn(){for(var n=arguments.length,t=new Array(n),e=0;e{s("click-new-btn")};return(r,o)=>(Ce(),Ne("div",vi,[Vt("div",bi,[Vt("div",Ai,[Vt("h3",Ti,[Vt("strong",null,Se(e.headerTitle),1)]),Vt("div",yi,[e.popupFlag?(Ce(),Ne("a",{key:1,class:"btn btn-outline-primary d-none d-sm-inline-block","data-bs-toggle":"modal","data-bs-target":e.popupTarget,onClick:On(i,["prevent","stop"])},[Cn(Nn(Dn),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),Sn(" "+Se(e.newBtnTitle),1)],8,wi)):(Ce(),Ne("a",{key:0,class:"btn btn-outline-primary d-none d-sm-inline-block",onClick:On(i,["prevent","stop"])},[Cn(Nn(Dn),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),Sn(" "+Se(e.newBtnTitle),1)]))])])])]))}});var L="top",x="bottom",R="right",I="left",pe="auto",It=[L,x,R,I],pt="start",Ot="end",hs="clippingParents",Qe="viewport",At="popper",fs="reference",Ke=It.reduce(function(n,t){return n.concat([t+"-"+pt,t+"-"+Ot])},[]),Ze=[].concat(It,[pe]).reduce(function(n,t){return n.concat([t,t+"-"+pt,t+"-"+Ot])},[]),ps="beforeRead",_s="read",ms="afterRead",gs="beforeMain",Es="main",vs="afterMain",bs="beforeWrite",As="write",Ts="afterWrite",ys=[ps,_s,ms,gs,Es,vs,bs,As,Ts];function z(n){return n?(n.nodeName||"").toLowerCase():null}function k(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function _t(n){var t=k(n).Element;return n instanceof t||n instanceof Element}function V(n){var t=k(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function Je(n){if(typeof ShadowRoot>"u")return!1;var t=k(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function Oi(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var s=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];!V(r)||!z(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(o){var a=i[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function Ci(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(s){var i=t.elements[s],r=t.attributes[s]||{},o=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:e[s]),a=o.reduce(function(l,d){return l[d]="",l},{});!V(i)||!z(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(l){i.removeAttribute(l)}))})}}const tn={name:"applyStyles",enabled:!0,phase:"write",fn:Oi,effect:Ci,requires:["computeStyles"]};function Y(n){return n.split("-")[0]}var ft=Math.max,ue=Math.min,Ct=Math.round;function Ye(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function ws(){return!/^((?!chrome|android).)*safari/i.test(Ye())}function Nt(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var s=n.getBoundingClientRect(),i=1,r=1;t&&V(n)&&(i=n.offsetWidth>0&&Ct(s.width)/n.offsetWidth||1,r=n.offsetHeight>0&&Ct(s.height)/n.offsetHeight||1);var o=_t(n)?k(n):window,a=o.visualViewport,l=!ws()&&e,d=(s.left+(l&&a?a.offsetLeft:0))/i,u=(s.top+(l&&a?a.offsetTop:0))/r,p=s.width/i,_=s.height/r;return{width:p,height:_,top:u,right:d+p,bottom:u+_,left:d,x:d,y:u}}function en(n){var t=Nt(n),e=n.offsetWidth,s=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:s}}function Os(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&Je(e)){var s=t;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function X(n){return k(n).getComputedStyle(n)}function Ni(n){return["table","td","th"].indexOf(z(n))>=0}function st(n){return((_t(n)?n.ownerDocument:n.document)||window.document).documentElement}function _e(n){return z(n)==="html"?n:n.assignedSlot||n.parentNode||(Je(n)?n.host:null)||st(n)}function $n(n){return!V(n)||X(n).position==="fixed"?null:n.offsetParent}function Si(n){var t=/firefox/i.test(Ye()),e=/Trident/i.test(Ye());if(e&&V(n)){var s=X(n);if(s.position==="fixed")return null}var i=_e(n);for(Je(i)&&(i=i.host);V(i)&&["html","body"].indexOf(z(i))<0;){var r=X(i);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return i;i=i.parentNode}return null}function Kt(n){for(var t=k(n),e=$n(n);e&&Ni(e)&&X(e).position==="static";)e=$n(e);return e&&(z(e)==="html"||z(e)==="body"&&X(e).position==="static")?t:e||Si(n)||t}function nn(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Bt(n,t,e){return ft(n,ue(t,e))}function Di(n,t,e){var s=Bt(n,t,e);return s>e?e:s}function Cs(){return{top:0,right:0,bottom:0,left:0}}function Ns(n){return Object.assign({},Cs(),n)}function Ss(n,t){return t.reduce(function(e,s){return e[s]=n,e},{})}var $i=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Ns(typeof t!="number"?t:Ss(t,It))};function Li(n){var t,e=n.state,s=n.name,i=n.options,r=e.elements.arrow,o=e.modifiersData.popperOffsets,a=Y(e.placement),l=nn(a),d=[I,R].indexOf(a)>=0,u=d?"height":"width";if(!(!r||!o)){var p=$i(i.padding,e),_=en(r),f=l==="y"?L:I,A=l==="y"?x:R,m=e.rects.reference[u]+e.rects.reference[l]-o[l]-e.rects.popper[u],E=o[l]-e.rects.reference[l],T=Kt(r),w=T?l==="y"?T.clientHeight||0:T.clientWidth||0:0,O=m/2-E/2,g=p[f],v=w-_[u]-p[A],b=w/2-_[u]/2+O,y=Bt(g,b,v),S=l;e.modifiersData[s]=(t={},t[S]=y,t.centerOffset=y-b,t)}}function Ii(n){var t=n.state,e=n.options,s=e.element,i=s===void 0?"[data-popper-arrow]":s;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Os(t.elements.popper,i)&&(t.elements.arrow=i))}const Ds={name:"arrow",enabled:!0,phase:"main",fn:Li,effect:Ii,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function St(n){return n.split("-")[1]}var Pi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Mi(n,t){var e=n.x,s=n.y,i=t.devicePixelRatio||1;return{x:Ct(e*i)/i||0,y:Ct(s*i)/i||0}}function Ln(n){var t,e=n.popper,s=n.popperRect,i=n.placement,r=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,p=n.isFixed,_=o.x,f=_===void 0?0:_,A=o.y,m=A===void 0?0:A,E=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=E.x,m=E.y;var T=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),O=I,g=L,v=window;if(d){var b=Kt(e),y="clientHeight",S="clientWidth";if(b===k(e)&&(b=st(e),X(b).position!=="static"&&a==="absolute"&&(y="scrollHeight",S="scrollWidth")),b=b,i===L||(i===I||i===R)&&r===Ot){g=x;var N=p&&b===v&&v.visualViewport?v.visualViewport.height:b[y];m-=N-s.height,m*=l?1:-1}if(i===I||(i===L||i===x)&&r===Ot){O=R;var C=p&&b===v&&v.visualViewport?v.visualViewport.width:b[S];f-=C-s.width,f*=l?1:-1}}var D=Object.assign({position:a},d&&Pi),j=u===!0?Mi({x:f,y:m},k(e)):{x:f,y:m};if(f=j.x,m=j.y,l){var $;return Object.assign({},D,($={},$[g]=w?"0":"",$[O]=T?"0":"",$.transform=(v.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",$))}return Object.assign({},D,(t={},t[g]=w?m+"px":"",t[O]=T?f+"px":"",t.transform="",t))}function xi(n){var t=n.state,e=n.options,s=e.gpuAcceleration,i=s===void 0?!0:s,r=e.adaptive,o=r===void 0?!0:r,a=e.roundOffsets,l=a===void 0?!0:a,d={placement:Y(t.placement),variation:St(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ln(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ln(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const sn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:xi,data:{}};var te={passive:!0};function Ri(n){var t=n.state,e=n.instance,s=n.options,i=s.scroll,r=i===void 0?!0:i,o=s.resize,a=o===void 0?!0:o,l=k(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&d.forEach(function(u){u.addEventListener("scroll",e.update,te)}),a&&l.addEventListener("resize",e.update,te),function(){r&&d.forEach(function(u){u.removeEventListener("scroll",e.update,te)}),a&&l.removeEventListener("resize",e.update,te)}}const rn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ri,data:{}};var ki={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(n){return n.replace(/left|right|bottom|top/g,function(t){return ki[t]})}var Vi={start:"end",end:"start"};function In(n){return n.replace(/start|end/g,function(t){return Vi[t]})}function on(n){var t=k(n),e=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:e,scrollTop:s}}function an(n){return Nt(st(n)).left+on(n).scrollLeft}function Hi(n,t){var e=k(n),s=st(n),i=e.visualViewport,r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;var d=ws();(d||!d&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:r,height:o,x:a+an(n),y:l}}function Wi(n){var t,e=st(n),s=on(n),i=(t=n.ownerDocument)==null?void 0:t.body,r=ft(e.scrollWidth,e.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=ft(e.scrollHeight,e.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-s.scrollLeft+an(n),l=-s.scrollTop;return X(i||e).direction==="rtl"&&(a+=ft(e.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function cn(n){var t=X(n),e=t.overflow,s=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+i+s)}function $s(n){return["html","body","#document"].indexOf(z(n))>=0?n.ownerDocument.body:V(n)&&cn(n)?n:$s(_e(n))}function jt(n,t){var e;t===void 0&&(t=[]);var s=$s(n),i=s===((e=n.ownerDocument)==null?void 0:e.body),r=k(s),o=i?[r].concat(r.visualViewport||[],cn(s)?s:[]):s,a=t.concat(o);return i?a:a.concat(jt(_e(o)))}function Ue(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function Bi(n,t){var e=Nt(n,!1,t==="fixed");return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function Pn(n,t,e){return t===Qe?Ue(Hi(n,e)):_t(t)?Bi(t,e):Ue(Wi(st(n)))}function ji(n){var t=jt(_e(n)),e=["absolute","fixed"].indexOf(X(n).position)>=0,s=e&&V(n)?Kt(n):n;return _t(s)?t.filter(function(i){return _t(i)&&Os(i,s)&&z(i)!=="body"}):[]}function Fi(n,t,e,s){var i=t==="clippingParents"?ji(n):[].concat(t),r=[].concat(i,[e]),o=r[0],a=r.reduce(function(l,d){var u=Pn(n,d,s);return l.top=ft(u.top,l.top),l.right=ue(u.right,l.right),l.bottom=ue(u.bottom,l.bottom),l.left=ft(u.left,l.left),l},Pn(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ls(n){var t=n.reference,e=n.element,s=n.placement,i=s?Y(s):null,r=s?St(s):null,o=t.x+t.width/2-e.width/2,a=t.y+t.height/2-e.height/2,l;switch(i){case L:l={x:o,y:t.y-e.height};break;case x:l={x:o,y:t.y+t.height};break;case R:l={x:t.x+t.width,y:a};break;case I:l={x:t.x-e.width,y:a};break;default:l={x:t.x,y:t.y}}var d=i?nn(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(r){case pt:l[d]=l[d]-(t[u]/2-e[u]/2);break;case Ot:l[d]=l[d]+(t[u]/2-e[u]/2);break}}return l}function Dt(n,t){t===void 0&&(t={});var e=t,s=e.placement,i=s===void 0?n.placement:s,r=e.strategy,o=r===void 0?n.strategy:r,a=e.boundary,l=a===void 0?hs:a,d=e.rootBoundary,u=d===void 0?Qe:d,p=e.elementContext,_=p===void 0?At:p,f=e.altBoundary,A=f===void 0?!1:f,m=e.padding,E=m===void 0?0:m,T=Ns(typeof E!="number"?E:Ss(E,It)),w=_===At?fs:At,O=n.rects.popper,g=n.elements[A?w:_],v=Fi(_t(g)?g:g.contextElement||st(n.elements.popper),l,u,o),b=Nt(n.elements.reference),y=Ls({reference:b,element:O,strategy:"absolute",placement:i}),S=Ue(Object.assign({},O,y)),N=_===At?S:b,C={top:v.top-N.top+T.top,bottom:N.bottom-v.bottom+T.bottom,left:v.left-N.left+T.left,right:N.right-v.right+T.right},D=n.modifiersData.offset;if(_===At&&D){var j=D[i];Object.keys(C).forEach(function($){var ot=[R,x].indexOf($)>=0?1:-1,at=[L,x].indexOf($)>=0?"y":"x";C[$]+=j[at]*ot})}return C}function Ki(n,t){t===void 0&&(t={});var e=t,s=e.placement,i=e.boundary,r=e.rootBoundary,o=e.padding,a=e.flipVariations,l=e.allowedAutoPlacements,d=l===void 0?Ze:l,u=St(s),p=u?a?Ke:Ke.filter(function(A){return St(A)===u}):It,_=p.filter(function(A){return d.indexOf(A)>=0});_.length===0&&(_=p);var f=_.reduce(function(A,m){return A[m]=Dt(n,{placement:m,boundary:i,rootBoundary:r,padding:o})[Y(m)],A},{});return Object.keys(f).sort(function(A,m){return f[A]-f[m]})}function Yi(n){if(Y(n)===pe)return[];var t=ae(n);return[In(n),t,In(t)]}function Ui(n){var t=n.state,e=n.options,s=n.name;if(!t.modifiersData[s]._skip){for(var i=e.mainAxis,r=i===void 0?!0:i,o=e.altAxis,a=o===void 0?!0:o,l=e.fallbackPlacements,d=e.padding,u=e.boundary,p=e.rootBoundary,_=e.altBoundary,f=e.flipVariations,A=f===void 0?!0:f,m=e.allowedAutoPlacements,E=t.options.placement,T=Y(E),w=T===E,O=l||(w||!A?[ae(E)]:Yi(E)),g=[E].concat(O).reduce(function(Et,Z){return Et.concat(Y(Z)===pe?Ki(t,{placement:Z,boundary:u,rootBoundary:p,padding:d,flipVariations:A,allowedAutoPlacements:m}):Z)},[]),v=t.rects.reference,b=t.rects.popper,y=new Map,S=!0,N=g[0],C=0;C=0,at=ot?"width":"height",M=Dt(t,{placement:D,boundary:u,rootBoundary:p,altBoundary:_,padding:d}),F=ot?$?R:I:$?x:L;v[at]>b[at]&&(F=ae(F));var qt=ae(F),ct=[];if(r&&ct.push(M[j]<=0),a&&ct.push(M[F]<=0,M[qt]<=0),ct.every(function(Et){return Et})){N=D,S=!1;break}y.set(D,ct)}if(S)for(var Xt=A?3:1,Te=function(Z){var kt=g.find(function(Zt){var lt=y.get(Zt);if(lt)return lt.slice(0,Z).every(function(ye){return ye})});if(kt)return N=kt,"break"},Rt=Xt;Rt>0;Rt--){var Qt=Te(Rt);if(Qt==="break")break}t.placement!==N&&(t.modifiersData[s]._skip=!0,t.placement=N,t.reset=!0)}}const Is={name:"flip",enabled:!0,phase:"main",fn:Ui,requiresIfExists:["offset"],data:{_skip:!1}};function Mn(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function xn(n){return[L,R,x,I].some(function(t){return n[t]>=0})}function zi(n){var t=n.state,e=n.name,s=t.rects.reference,i=t.rects.popper,r=t.modifiersData.preventOverflow,o=Dt(t,{elementContext:"reference"}),a=Dt(t,{altBoundary:!0}),l=Mn(o,s),d=Mn(a,i,r),u=xn(l),p=xn(d);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}const Ps={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zi};function Gi(n,t,e){var s=Y(n),i=[I,L].indexOf(s)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,o=r[0],a=r[1];return o=o||0,a=(a||0)*i,[I,R].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function qi(n){var t=n.state,e=n.options,s=n.name,i=e.offset,r=i===void 0?[0,0]:i,o=Ze.reduce(function(u,p){return u[p]=Gi(p,t.rects,r),u},{}),a=o[t.placement],l=a.x,d=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=d),t.modifiersData[s]=o}const Ms={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qi};function Xi(n){var t=n.state,e=n.name;t.modifiersData[e]=Ls({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const ln={name:"popperOffsets",enabled:!0,phase:"read",fn:Xi,data:{}};function Qi(n){return n==="x"?"y":"x"}function Zi(n){var t=n.state,e=n.options,s=n.name,i=e.mainAxis,r=i===void 0?!0:i,o=e.altAxis,a=o===void 0?!1:o,l=e.boundary,d=e.rootBoundary,u=e.altBoundary,p=e.padding,_=e.tether,f=_===void 0?!0:_,A=e.tetherOffset,m=A===void 0?0:A,E=Dt(t,{boundary:l,rootBoundary:d,padding:p,altBoundary:u}),T=Y(t.placement),w=St(t.placement),O=!w,g=nn(T),v=Qi(g),b=t.modifiersData.popperOffsets,y=t.rects.reference,S=t.rects.popper,N=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,C=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(b){if(r){var $,ot=g==="y"?L:I,at=g==="y"?x:R,M=g==="y"?"height":"width",F=b[g],qt=F+E[ot],ct=F-E[at],Xt=f?-S[M]/2:0,Te=w===pt?y[M]:S[M],Rt=w===pt?-S[M]:-y[M],Qt=t.elements.arrow,Et=f&&Qt?en(Qt):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Cs(),kt=Z[ot],Zt=Z[at],lt=Bt(0,y[M],Et[M]),ye=O?y[M]/2-Xt-lt-kt-C.mainAxis:Te-lt-kt-C.mainAxis,hi=O?-y[M]/2+Xt+lt+Zt+C.mainAxis:Rt+lt+Zt+C.mainAxis,we=t.elements.arrow&&Kt(t.elements.arrow),fi=we?g==="y"?we.clientTop||0:we.clientLeft||0:0,mn=($=D==null?void 0:D[g])!=null?$:0,pi=F+ye-mn-fi,_i=F+hi-mn,gn=Bt(f?ue(qt,pi):qt,F,f?ft(ct,_i):ct);b[g]=gn,j[g]=gn-F}if(a){var En,mi=g==="x"?L:I,gi=g==="x"?x:R,ut=b[v],Jt=v==="y"?"height":"width",vn=ut+E[mi],bn=ut-E[gi],Oe=[L,I].indexOf(T)!==-1,An=(En=D==null?void 0:D[v])!=null?En:0,Tn=Oe?vn:ut-y[Jt]-S[Jt]-An+C.altAxis,yn=Oe?ut+y[Jt]+S[Jt]-An-C.altAxis:bn,wn=f&&Oe?Di(Tn,ut,yn):Bt(f?Tn:vn,ut,f?yn:bn);b[v]=wn,j[v]=wn-ut}t.modifiersData[s]=j}}const xs={name:"preventOverflow",enabled:!0,phase:"main",fn:Zi,requiresIfExists:["offset"]};function Ji(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function tr(n){return n===k(n)||!V(n)?on(n):Ji(n)}function er(n){var t=n.getBoundingClientRect(),e=Ct(t.width)/n.offsetWidth||1,s=Ct(t.height)/n.offsetHeight||1;return e!==1||s!==1}function nr(n,t,e){e===void 0&&(e=!1);var s=V(t),i=V(t)&&er(t),r=st(t),o=Nt(n,i,e),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!e)&&((z(t)!=="body"||cn(r))&&(a=tr(t)),V(t)?(l=Nt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=an(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function sr(n){var t=new Map,e=new Set,s=[];n.forEach(function(r){t.set(r.name,r)});function i(r){e.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!e.has(a)){var l=t.get(a);l&&i(l)}}),s.push(r)}return n.forEach(function(r){e.has(r.name)||i(r)}),s}function ir(n){var t=sr(n);return ys.reduce(function(e,s){return e.concat(t.filter(function(i){return i.phase===s}))},[])}function rr(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function or(n){var t=n.reduce(function(e,s){var i=e[s.name];return e[s.name]=i?Object.assign({},i,s,{options:Object.assign({},i.options,s.options),data:Object.assign({},i.data,s.data)}):s,e},{});return Object.keys(t).map(function(e){return t[e]})}var Rn={placement:"bottom",modifiers:[],strategy:"absolute"};function kn(){for(var n=arguments.length,t=new Array(n),e=0;ei.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OssList-Dkx--ByD.js","assets/bootstrap.esm-D2DynUsO.js","assets/IconPlus-DRtzYi91.js","assets/Tabulator.vue_vue_type_style_index_0_lang-Cy0Pje7A.js","assets/Tabulator-C0-hRjAn.css","assets/request-BI8njqPY.js","assets/YamlGenerate-BpVTbERL.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/YamlGenerate-B5_cwrRZ.css","assets/RepositoryList-CA5Ls4Jk.js","assets/RepositoryList.vue_vue_type_script_setup_true_lang-CuWQGniu.js","assets/repository-Cuw5n13K.js","assets/RepositoryDetail-C1I53_sg.js","assets/RepositoryDetail.vue_vue_type_script_setup_true_lang-Bb5umCXR.js","assets/lodash-CJvlDKzA.js","assets/SoftwareCatalog-CNyPg-7j.js","assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-Dn3T2TCo.js","assets/softwareCatalogForm-vcxmGWrf.css","assets/SoftwareCatalog-BR5spnSR.css","assets/SoftwareCatalogListTest-DSIjiOry.js","assets/SoftwareCatalogListTest-Dz0zZeYT.css"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();/** * @vue/shared v3.5.3 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -28,7 +28,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OssList-ByrkaGf `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(i=>s.set(i)),s}static accessor(t){const s=(this[ju]=this[ju]={accessors:{}}).accessors,i=this.prototype;function o(a){const c=ir(a);s[c]||(Pv(i,a),s[c]=!0)}return S.isArray(t)?t.forEach(o):o(t),this}}yt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);S.reduceDescriptors(yt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});S.freezeMethods(yt);function Xo(e,t){const n=this||Nr,s=t||n,i=yt.from(s.headers);let o=s.data;return S.forEach(e,function(c){o=c.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function nh(e){return!!(e&&e.__CANCEL__)}function Ks(e,t,n){de.call(this,e??"canceled",de.ERR_CANCELED,t,n),this.name="CanceledError"}S.inherits(Ks,de,{__CANCEL__:!0});function sh(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new de("Request failed with status code "+n.status,[de.ERR_BAD_REQUEST,de.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Lv(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Iv(e,t){e=e||10;const n=new Array(e),s=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(f){const p=Date.now(),d=s[o];a||(a=p),n[i]=f,s[i]=p;let m=o,b=0;for(;m!==i;)b+=n[m++],m=m%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),p-a{n=d,i=null,o&&(clearTimeout(o),o=null),e.apply(null,p)};return[(...p)=>{const d=Date.now(),m=d-n;m>=s?a(p,d):(i=p,o||(o=setTimeout(()=>{o=null,a(i)},s-m)))},()=>i&&a(i)]}const xi=(e,t,n=3)=>{let s=0;const i=Iv(50,250);return Dv(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,f=a-s,p=i(f),d=a<=c;s=a;const m={loaded:a,total:c,progress:c?a/c:void 0,bytes:f,rate:p||void 0,estimated:p&&c&&d?(c-a)/p:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},Bu=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Hu=e=>(...t)=>S.asap(()=>e(...t)),Nv=bt.hasStandardBrowserEnv?function(){const t=bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent),n=document.createElement("a");let s;function i(o){let a=o;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=i(window.location.href),function(a){const c=S.isString(a)?i(a):a;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}(),kv=bt.hasStandardBrowserEnv?{write(e,t,n,s,i,o){const a=[e+"="+encodeURIComponent(t)];S.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),S.isString(s)&&a.push("path="+s),S.isString(i)&&a.push("domain="+i),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Mv(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function $v(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function rh(e,t){return e&&!Mv(t)?$v(e,t):t}const Vu=e=>e instanceof yt?{...e}:e;function ms(e,t){t=t||{};const n={};function s(p,d,m){return S.isPlainObject(p)&&S.isPlainObject(d)?S.merge.call({caseless:m},p,d):S.isPlainObject(d)?S.merge({},d):S.isArray(d)?d.slice():d}function i(p,d,m){if(S.isUndefined(d)){if(!S.isUndefined(p))return s(void 0,p,m)}else return s(p,d,m)}function o(p,d){if(!S.isUndefined(d))return s(void 0,d)}function a(p,d){if(S.isUndefined(d)){if(!S.isUndefined(p))return s(void 0,p)}else return s(void 0,d)}function c(p,d,m){if(m in t)return s(p,d);if(m in e)return s(void 0,p)}const f={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(p,d)=>i(Vu(p),Vu(d),!0)};return S.forEach(Object.keys(Object.assign({},e,t)),function(d){const m=f[d]||i,b=m(e[d],t[d],d);S.isUndefined(b)&&m!==c||(n[d]=b)}),n}const ih=e=>{const t=ms({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=t;t.headers=a=yt.from(a),t.url=Zd(rh(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(S.isFormData(n)){if(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((f=a.getContentType())!==!1){const[p,...d]=f?f.split(";").map(m=>m.trim()).filter(Boolean):[];a.setContentType([p||"multipart/form-data",...d].join("; "))}}if(bt.hasStandardBrowserEnv&&(s&&S.isFunction(s)&&(s=s(t)),s||s!==!1&&Nv(t.url))){const p=i&&o&&kv.read(o);p&&a.set(i,p)}return t},Fv=typeof XMLHttpRequest<"u",jv=Fv&&function(e){return new Promise(function(n,s){const i=ih(e);let o=i.data;const a=yt.from(i.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:p}=i,d,m,b,w,C;function P(){w&&w(),C&&C(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let R=new XMLHttpRequest;R.open(i.method.toUpperCase(),i.url,!0),R.timeout=i.timeout;function $(){if(!R)return;const B=yt.from("getAllResponseHeaders"in R&&R.getAllResponseHeaders()),Y={data:!c||c==="text"||c==="json"?R.responseText:R.response,status:R.status,statusText:R.statusText,headers:B,config:e,request:R};sh(function(le){n(le),P()},function(le){s(le),P()},Y),R=null}"onloadend"in R?R.onloadend=$:R.onreadystatechange=function(){!R||R.readyState!==4||R.status===0&&!(R.responseURL&&R.responseURL.indexOf("file:")===0)||setTimeout($)},R.onabort=function(){R&&(s(new de("Request aborted",de.ECONNABORTED,e,R)),R=null)},R.onerror=function(){s(new de("Network Error",de.ERR_NETWORK,e,R)),R=null},R.ontimeout=function(){let H=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const Y=i.transitional||eh;i.timeoutErrorMessage&&(H=i.timeoutErrorMessage),s(new de(H,Y.clarifyTimeoutError?de.ETIMEDOUT:de.ECONNABORTED,e,R)),R=null},o===void 0&&a.setContentType(null),"setRequestHeader"in R&&S.forEach(a.toJSON(),function(H,Y){R.setRequestHeader(Y,H)}),S.isUndefined(i.withCredentials)||(R.withCredentials=!!i.withCredentials),c&&c!=="json"&&(R.responseType=i.responseType),p&&([b,C]=xi(p,!0),R.addEventListener("progress",b)),f&&R.upload&&([m,w]=xi(f),R.upload.addEventListener("progress",m),R.upload.addEventListener("loadend",w)),(i.cancelToken||i.signal)&&(d=B=>{R&&(s(!B||B.type?new Ks(null,e,R):B),R.abort(),R=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const N=Lv(i.url);if(N&&bt.protocols.indexOf(N)===-1){s(new de("Unsupported protocol "+N+":",de.ERR_BAD_REQUEST,e));return}R.send(o||null)})},Bv=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,i;const o=function(p){if(!i){i=!0,c();const d=p instanceof Error?p:this.reason;s.abort(d instanceof de?d:new Ks(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,o(new de(`timeout ${t} of ms exceeded`,de.ETIMEDOUT))},t);const c=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(o):p.removeEventListener("abort",o)}),e=null)};e.forEach(p=>p.addEventListener("abort",o));const{signal:f}=s;return f.unsubscribe=()=>S.asap(c),f}},Hv=function*(e,t){let n=e.byteLength;if(!t||n{const i=Vv(e,t);let o=0,a,c=f=>{a||(a=!0,s&&s(f))};return new ReadableStream({async pull(f){try{const{done:p,value:d}=await i.next();if(p){c(),f.close();return}let m=d.byteLength;if(n){let b=o+=m;n(b)}f.enqueue(new Uint8Array(d))}catch(p){throw c(p),p}},cancel(f){return c(f),i.return()}},{highWaterMark:2})},Qi=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",oh=Qi&&typeof ReadableStream=="function",Wv=Qi&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ah=(e,...t)=>{try{return!!e(...t)}catch{return!1}},qv=oh&&ah(()=>{let e=!1;const t=new Request(bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Wu=64*1024,ba=oh&&ah(()=>S.isReadableStream(new Response("").body)),Ri={stream:ba&&(e=>e.body)};Qi&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ri[t]&&(Ri[t]=S.isFunction(e[t])?n=>n[t]():(n,s)=>{throw new de(`Response type '${t}' is not supported`,de.ERR_NOT_SUPPORT,s)})})})(new Response);const zv=async e=>{if(e==null)return 0;if(S.isBlob(e))return e.size;if(S.isSpecCompliantForm(e))return(await new Request(bt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(S.isArrayBufferView(e)||S.isArrayBuffer(e))return e.byteLength;if(S.isURLSearchParams(e)&&(e=e+""),S.isString(e))return(await Wv(e)).byteLength},Kv=async(e,t)=>{const n=S.toFiniteNumber(e.getContentLength());return n??zv(t)},Gv=Qi&&(async e=>{let{url:t,method:n,data:s,signal:i,cancelToken:o,timeout:a,onDownloadProgress:c,onUploadProgress:f,responseType:p,headers:d,withCredentials:m="same-origin",fetchOptions:b}=ih(e);p=p?(p+"").toLowerCase():"text";let w=Bv([i,o&&o.toAbortSignal()],a),C;const P=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let R;try{if(f&&qv&&n!=="get"&&n!=="head"&&(R=await Kv(d,s))!==0){let Y=new Request(t,{method:"POST",body:s,duplex:"half"}),ge;if(S.isFormData(s)&&(ge=Y.headers.get("content-type"))&&d.setContentType(ge),Y.body){const[le,te]=Bu(R,xi(Hu(f)));s=Uu(Y.body,Wu,le,te)}}S.isString(m)||(m=m?"include":"omit");const $="credentials"in Request.prototype;C=new Request(t,{...b,signal:w,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:s,duplex:"half",credentials:$?m:void 0});let N=await fetch(C);const B=ba&&(p==="stream"||p==="response");if(ba&&(c||B&&P)){const Y={};["status","statusText","headers"].forEach(W=>{Y[W]=N[W]});const ge=S.toFiniteNumber(N.headers.get("content-length")),[le,te]=c&&Bu(ge,xi(Hu(c),!0))||[];N=new Response(Uu(N.body,Wu,le,()=>{te&&te(),P&&P()}),Y)}p=p||"text";let H=await Ri[S.findKey(Ri,p)||"text"](N,e);return!B&&P&&P(),await new Promise((Y,ge)=>{sh(Y,ge,{data:H,headers:yt.from(N.headers),status:N.status,statusText:N.statusText,config:e,request:C})})}catch($){throw P&&P(),$&&$.name==="TypeError"&&/fetch/i.test($.message)?Object.assign(new de("Network Error",de.ERR_NETWORK,e,C),{cause:$.cause||$}):de.from($,$&&$.code,e,C)}}),ya={http:cv,xhr:jv,fetch:Gv};S.forEach(ya,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const qu=e=>`- ${e}`,Jv=e=>S.isFunction(e)||e===null||e===!1,lh={getAdapter:e=>{e=S.isArray(e)?e:[e];const{length:t}=e;let n,s;const i={};for(let o=0;o`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since : `+o.map(qu).join(` `):" "+qu(o[0]):"as no adapter specified";throw new de("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:ya};function Qo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ks(null,e)}function zu(e){return Qo(e),e.headers=yt.from(e.headers),e.data=Xo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),lh.getAdapter(e.adapter||Nr.adapter)(e).then(function(s){return Qo(e),s.data=Xo.call(e,e.transformResponse,s),s.headers=yt.from(s.headers),s},function(s){return nh(s)||(Qo(e),s&&s.response&&(s.response.data=Xo.call(e,e.transformResponse,s.response),s.response.headers=yt.from(s.response.headers))),Promise.reject(s)})}const ch="1.7.7",Qa={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Qa[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ku={};Qa.transitional=function(t,n,s){function i(o,a){return"[Axios v"+ch+"] Transitional option '"+o+"'"+a+(s?". "+s:"")}return(o,a,c)=>{if(t===!1)throw new de(i(a," has been removed"+(n?" in "+n:"")),de.ERR_DEPRECATED);return n&&!Ku[a]&&(Ku[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,c):!0}};function Xv(e,t,n){if(typeof e!="object")throw new de("options must be an object",de.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let i=s.length;for(;i-- >0;){const o=s[i],a=t[o];if(a){const c=e[o],f=c===void 0||a(c,o,e);if(f!==!0)throw new de("option "+o+" must be "+f,de.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new de("Unknown option "+o,de.ERR_BAD_OPTION)}}const va={assertOptions:Xv,validators:Qa},Ln=va.validators;class fs{constructor(t){this.defaults=t,this.interceptors={request:new Fu,response:new Fu}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=` -`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ms(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:o}=n;s!==void 0&&va.assertOptions(s,{silentJSONParsing:Ln.transitional(Ln.boolean),forcedJSONParsing:Ln.transitional(Ln.boolean),clarifyTimeoutError:Ln.transitional(Ln.boolean)},!1),i!=null&&(S.isFunction(i)?n.paramsSerializer={serialize:i}:va.assertOptions(i,{encode:Ln.function,serialize:Ln.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&S.merge(o.common,o[n.method]);o&&S.forEach(["delete","get","head","post","put","patch","common"],C=>{delete o[C]}),n.headers=yt.concat(a,o);const c=[];let f=!0;this.interceptors.request.forEach(function(P){typeof P.runWhen=="function"&&P.runWhen(n)===!1||(f=f&&P.synchronous,c.unshift(P.fulfilled,P.rejected))});const p=[];this.interceptors.response.forEach(function(P){p.push(P.fulfilled,P.rejected)});let d,m=0,b;if(!f){const C=[zu.bind(this),void 0];for(C.unshift.apply(C,c),C.push.apply(C,p),b=C.length,d=Promise.resolve(n);m{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{s.subscribe(c),o=c}).then(i);return a.cancel=function(){s.unsubscribe(o)},a},t(function(o,a,c){s.reason||(s.reason=new Ks(o,a,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ya(function(i){t=i}),cancel:t}}}function Qv(e){return function(n){return e.apply(null,n)}}function Yv(e){return S.isObject(e)&&e.isAxiosError===!0}const wa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wa).forEach(([e,t])=>{wa[t]=e});function uh(e){const t=new fs(e),n=Hd(fs.prototype.request,t);return S.extend(n,fs.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return uh(ms(e,i))},n}const Ke=uh(Nr);Ke.Axios=fs;Ke.CanceledError=Ks;Ke.CancelToken=Ya;Ke.isCancel=nh;Ke.VERSION=ch;Ke.toFormData=Xi;Ke.AxiosError=de;Ke.Cancel=Ke.CanceledError;Ke.all=function(t){return Promise.all(t)};Ke.spread=Qv;Ke.isAxiosError=Yv;Ke.mergeConfig=ms;Ke.AxiosHeaders=yt;Ke.formToJSON=e=>th(S.isHTMLForm(e)?new FormData(e):e);Ke.getAdapter=lh.getAdapter;Ke.HttpStatusCode=wa;Ke.default=Ke;const Zv="modulepreload",ew=function(e){return"/"+e},Gu={},is=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(c=>{if(c=ew(c),c in Gu)return;Gu[c]=!0;const f=c.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const d=document.createElement("link");if(d.rel=f?"stylesheet":Zv,f||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),f)return new Promise((m,b)=>{d.addEventListener("load",m),d.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}return i.then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})},fh=wy({history:Xb(),routes:[{path:"/",name:"home",redirect:"/web/softwareCatalog"},{path:"/web",name:"rootOssList",component:()=>is(()=>import("./OssList-ByrkaGfM.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/web/oss/list",name:"ossList",component:()=>is(()=>import("./OssList-ByrkaGfM.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/web/generate/yaml",name:"yamlGenerate",component:()=>is(()=>import("./YamlGenerate-VDNLSlZy.js"),__vite__mapDeps([6,5,7,8]))},{path:"/web/repository/list",name:"repositoryList",component:()=>is(()=>import("./RepositoryList-rdAjbyjW.js"),__vite__mapDeps([9,10,1,2,3,4,11,5]))},{path:"/web/repository/detail/:repositoryName",name:"repositoryDetail",component:()=>is(()=>import("./RepositoryDetail-DDVmJV0Q.js"),__vite__mapDeps([12,13,11,5,14,3,4]))},{path:"/web/softwareCatalog",name:"softwareCatalog",component:()=>is(()=>import("./SoftwareCatalog-Be0du8ev.js"),__vite__mapDeps([15,2,16,14,5,7,17,3,4,10,1,11,13,18]))},{path:"/web/softwareCatalog/list/test",name:"softwareCatalogListTest",component:()=>is(()=>import("./SoftwareCatalogListTest-MivSwlTC.js"),__vite__mapDeps([19,2,16,14,5,7,17,20]))}]}),tw=yb("user",{state:()=>({accessToken:"",workspaceInfo:{id:"",name:"",description:"",created_at:"",updated_at:""},projectInfo:{id:"",ns_id:"",mci_id:"",cluster_id:"",name:"",description:"",created_at:"",updated_at:""},operationId:""}),actions:{setUser(e){this.accessToken=e.accessToken,this.workspaceInfo=e.workspaceInfo,this.projectInfo=e.projectInfo,this.operationId=e.operationId},getNsId(){return this.projectInfo.ns_id},clearUser(){this.accessToken=null,this.workspaceInfo=null,this.projectInfo=null,this.operationId=null}}});fh.beforeEach(async(e,t,n)=>{window.addEventListener("message",async function(s){let i;console.log("## event.data.accessToken ### : ",s.data.accessToken),s.data.accessToken===void 0||s.data.accessToken==="undefined"?(console.log("## event.data.accessToken is undefined ### : "),i={accessToken:"accesstokenExample",workspaceInfo:{id:"8b2df1f9-b937-4861-b5ce-855a41c346bc",name:"workspace2",description:"workspace2 desc",created_at:"2024-06-18T00:10:16.192337Z",updated_at:"2024-06-18T00:10:16.192337Z"},projectInfo:{id:"1e88f4ea-d052-4314-80a4-9ac3f6691feb",ns_id:"ns01",mci_id:"mci01",cluster_id:"cluster01",name:"ns01",description:"ns01 desc",created_at:"2024-06-18T00:28:57.094105Z",updated_at:"2024-06-18T00:28:57.094105Z"},operationId:"op1"}):(console.log("## event.data.accessToken is not undefined ### : "),i=s.data);try{console.log("## data ### : ",i),tw().setUser(i)}catch(o){console.error("Error in processing message:",o)}}),n()});const nw=e=>{const t=e==null?void 0:e.trim();if(!t)return window.location.origin;try{const n=new URL(t),s=new Set(["localhost","127.0.0.1","::1"]);if(s.has(n.hostname)&&!s.has(window.location.hostname))return window.location.origin}catch{return t}return t!=null&&t.startsWith("http://")&&window.location.protocol==="https:"?window.location.origin:t},u0=e=>e?/^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(e)||e.startsWith("data:")?e:`${window.location.origin}${e.startsWith("/")?"":"/"}${e}`:"";var sw=Object.defineProperty,Ju=Object.getOwnPropertySymbols,rw=Object.prototype.hasOwnProperty,iw=Object.prototype.propertyIsEnumerable,Xu=(e,t,n)=>t in e?sw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dh=(e,t)=>{for(var n in t||(t={}))rw.call(t,n)&&Xu(e,n,t[n]);if(Ju)for(var n of Ju(t))iw.call(t,n)&&Xu(e,n,t[n]);return e},Yi=e=>typeof e=="function",Zi=e=>typeof e=="string",hh=e=>Zi(e)&&e.trim().length>0,ow=e=>typeof e=="number",ls=e=>typeof e>"u",Sr=e=>typeof e=="object"&&e!==null,aw=e=>cn(e,"tag")&&hh(e.tag),ph=e=>window.TouchEvent&&e instanceof TouchEvent,mh=e=>cn(e,"component")&&gh(e.component),lw=e=>Yi(e)||Sr(e),gh=e=>!ls(e)&&(Zi(e)||lw(e)||mh(e)),Qu=e=>Sr(e)&&["height","width","right","left","top","bottom"].every(t=>ow(e[t])),cn=(e,t)=>(Sr(e)||Yi(e))&&t in e,cw=(e=>()=>e++)(0);function Yo(e){return ph(e)?e.targetTouches[0].clientX:e.clientX}function Yu(e){return ph(e)?e.targetTouches[0].clientY:e.clientY}var uw=e=>{ls(e.remove)?e.parentNode&&e.parentNode.removeChild(e):e.remove()},kr=e=>mh(e)?kr(e.component):aw(e)?fn({render(){return e}}):typeof e=="string"?e:Ee(Fn(e)),fw=e=>{if(typeof e=="string")return e;const t=cn(e,"props")&&Sr(e.props)?e.props:{},n=cn(e,"listeners")&&Sr(e.listeners)?e.listeners:{};return{component:kr(e),props:t,listeners:n}},dw=()=>typeof window<"u",Za=class{constructor(){this.allHandlers={}}getHandlers(e){return this.allHandlers[e]||[]}on(e,t){const n=this.getHandlers(e);n.push(t),this.allHandlers[e]=n}off(e,t){const n=this.getHandlers(e);n.splice(n.indexOf(t)>>>0,1)}emit(e,t){this.getHandlers(e).forEach(s=>s(t))}},hw=e=>["on","off","emit"].every(t=>cn(e,t)&&Yi(e[t])),St;(function(e){e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.DEFAULT="default"})(St||(St={}));var Pi;(function(e){e.TOP_LEFT="top-left",e.TOP_CENTER="top-center",e.TOP_RIGHT="top-right",e.BOTTOM_LEFT="bottom-left",e.BOTTOM_CENTER="bottom-center",e.BOTTOM_RIGHT="bottom-right"})(Pi||(Pi={}));var At;(function(e){e.ADD="add",e.DISMISS="dismiss",e.UPDATE="update",e.CLEAR="clear",e.UPDATE_DEFAULTS="update_defaults"})(At||(At={}));var qt="Vue-Toastification",Ut={type:{type:String,default:St.DEFAULT},classNames:{type:[String,Array],default:()=>[]},trueBoolean:{type:Boolean,default:!0}},_h={type:Ut.type,customIcon:{type:[String,Boolean,Object,Function],default:!0}},bi={component:{type:[String,Object,Function,Boolean],default:"button"},classNames:Ut.classNames,showOnHover:{type:Boolean,default:!1},ariaLabel:{type:String,default:"close"}},Ea={timeout:{type:[Number,Boolean],default:5e3},hideProgressBar:{type:Boolean,default:!1},isRunning:{type:Boolean,default:!1}},bh={transition:{type:[Object,String],default:`${qt}__bounce`}},pw={position:{type:String,default:Pi.TOP_RIGHT},draggable:Ut.trueBoolean,draggablePercent:{type:Number,default:.6},pauseOnFocusLoss:Ut.trueBoolean,pauseOnHover:Ut.trueBoolean,closeOnClick:Ut.trueBoolean,timeout:Ea.timeout,hideProgressBar:Ea.hideProgressBar,toastClassName:Ut.classNames,bodyClassName:Ut.classNames,icon:_h.customIcon,closeButton:bi.component,closeButtonClassName:bi.classNames,showCloseButtonOnHover:bi.showOnHover,accessibility:{type:Object,default:()=>({toastRole:"alert",closeButtonLabel:"close"})},rtl:{type:Boolean,default:!1},eventBus:{type:Object,required:!1,default:()=>new Za}},mw={id:{type:[String,Number],required:!0,default:0},type:Ut.type,content:{type:[String,Object,Function],required:!0,default:""},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0}},gw={container:{type:[Object,Function],default:()=>document.body},newestOnTop:Ut.trueBoolean,maxToasts:{type:Number,default:20},transition:bh.transition,toastDefaults:Object,filterBeforeCreate:{type:Function,default:e=>e},filterToasts:{type:Function,default:e=>e},containerClassName:Ut.classNames,onMounted:Function,shareAppContext:[Boolean,Object]},En={CORE_TOAST:pw,TOAST:mw,CONTAINER:gw,PROGRESS_BAR:Ea,ICON:_h,TRANSITION:bh,CLOSE_BUTTON:bi},yh=fn({name:"VtProgressBar",props:En.PROGRESS_BAR,data(){return{hasClass:!0}},computed:{style(){return{animationDuration:`${this.timeout}ms`,animationPlayState:this.isRunning?"running":"paused",opacity:this.hideProgressBar?0:1}},cpClass(){return this.hasClass?`${qt}__progress-bar`:""}},watch:{timeout(){this.hasClass=!1,this.$nextTick(()=>this.hasClass=!0)}},mounted(){this.$el.addEventListener("animationend",this.animationEnded)},beforeUnmount(){this.$el.removeEventListener("animationend",this.animationEnded)},methods:{animationEnded(){this.$emit("close-toast")}}});function _w(e,t){return Ve(),Wt("div",{style:Or(e.style),class:Bn(e.cpClass)},null,6)}yh.render=_w;var bw=yh,vh=fn({name:"VtCloseButton",props:En.CLOSE_BUTTON,computed:{buttonComponent(){return this.component!==!1?kr(this.component):"button"},classes(){const e=[`${qt}__close-button`];return this.showOnHover&&e.push("show-on-hover"),e.concat(this.classNames)}}}),yw=Bi(" × ");function vw(e,t){return Ve(),jt(Va(e.buttonComponent),Hi({"aria-label":e.ariaLabel,class:e.classes},e.$attrs),{default:Lr(()=>[yw]),_:1},16,["aria-label","class"])}vh.render=vw;var ww=vh,wh={},Ew={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"check-circle",class:"svg-inline--fa fa-check-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Cw=_s("path",{fill:"currentColor",d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},null,-1),Tw=[Cw];function Sw(e,t){return Ve(),Wt("svg",Ew,Tw)}wh.render=Sw;var Aw=wh,Eh={},Ow={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"info-circle",class:"svg-inline--fa fa-info-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},xw=_s("path",{fill:"currentColor",d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},null,-1),Rw=[xw];function Pw(e,t){return Ve(),Wt("svg",Ow,Rw)}Eh.render=Pw;var Zu=Eh,Ch={},Lw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-circle",class:"svg-inline--fa fa-exclamation-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Iw=_s("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),Dw=[Iw];function Nw(e,t){return Ve(),Wt("svg",Lw,Dw)}Ch.render=Nw;var kw=Ch,Th={},Mw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-triangle",class:"svg-inline--fa fa-exclamation-triangle fa-w-18",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},$w=_s("path",{fill:"currentColor",d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),Fw=[$w];function jw(e,t){return Ve(),Wt("svg",Mw,Fw)}Th.render=jw;var Bw=Th,Sh=fn({name:"VtIcon",props:En.ICON,computed:{customIconChildren(){return cn(this.customIcon,"iconChildren")?this.trimValue(this.customIcon.iconChildren):""},customIconClass(){return Zi(this.customIcon)?this.trimValue(this.customIcon):cn(this.customIcon,"iconClass")?this.trimValue(this.customIcon.iconClass):""},customIconTag(){return cn(this.customIcon,"iconTag")?this.trimValue(this.customIcon.iconTag,"i"):"i"},hasCustomIcon(){return this.customIconClass.length>0},component(){return this.hasCustomIcon?this.customIconTag:gh(this.customIcon)?kr(this.customIcon):this.iconTypeComponent},iconTypeComponent(){return{[St.DEFAULT]:Zu,[St.INFO]:Zu,[St.SUCCESS]:Aw,[St.ERROR]:Bw,[St.WARNING]:kw}[this.type]},iconClasses(){const e=[`${qt}__icon`];return this.hasCustomIcon?e.concat(this.customIconClass):e}},methods:{trimValue(e,t=""){return hh(e)?e.trim():t}}});function Hw(e,t){return Ve(),jt(Va(e.component),{class:Bn(e.iconClasses)},{default:Lr(()=>[Bi(xa(e.customIconChildren),1)]),_:1},8,["class"])}Sh.render=Hw;var Vw=Sh,Ah=fn({name:"VtToast",components:{ProgressBar:bw,CloseButton:ww,Icon:Vw},inheritAttrs:!1,props:Object.assign({},En.CORE_TOAST,En.TOAST),data(){return{isRunning:!0,disableTransitions:!1,beingDragged:!1,dragStart:0,dragPos:{x:0,y:0},dragRect:{}}},computed:{classes(){const e=[`${qt}__toast`,`${qt}__toast--${this.type}`,`${this.position}`].concat(this.toastClassName);return this.disableTransitions&&e.push("disable-transition"),this.rtl&&e.push(`${qt}__toast--rtl`),e},bodyClasses(){return[`${qt}__toast-${Zi(this.content)?"body":"component-body"}`].concat(this.bodyClassName)},draggableStyle(){return this.dragStart===this.dragPos.x?{}:this.beingDragged?{transform:`translateX(${this.dragDelta}px)`,opacity:1-Math.abs(this.dragDelta/this.removalDistance)}:{transition:"transform 0.2s, opacity 0.2s",transform:"translateX(0)",opacity:1}},dragDelta(){return this.beingDragged?this.dragPos.x-this.dragStart:0},removalDistance(){return Qu(this.dragRect)?(this.dragRect.right-this.dragRect.left)*this.draggablePercent:0}},mounted(){this.draggable&&this.draggableSetup(),this.pauseOnFocusLoss&&this.focusSetup()},beforeUnmount(){this.draggable&&this.draggableCleanup(),this.pauseOnFocusLoss&&this.focusCleanup()},methods:{hasProp:cn,getVueComponentFromObj:kr,closeToast(){this.eventBus.emit(At.DISMISS,this.id)},clickHandler(){this.onClick&&this.onClick(this.closeToast),this.closeOnClick&&(!this.beingDragged||this.dragStart===this.dragPos.x)&&this.closeToast()},timeoutHandler(){this.closeToast()},hoverPause(){this.pauseOnHover&&(this.isRunning=!1)},hoverPlay(){this.pauseOnHover&&(this.isRunning=!0)},focusPause(){this.isRunning=!1},focusPlay(){this.isRunning=!0},focusSetup(){addEventListener("blur",this.focusPause),addEventListener("focus",this.focusPlay)},focusCleanup(){removeEventListener("blur",this.focusPause),removeEventListener("focus",this.focusPlay)},draggableSetup(){const e=this.$el;e.addEventListener("touchstart",this.onDragStart,{passive:!0}),e.addEventListener("mousedown",this.onDragStart),addEventListener("touchmove",this.onDragMove,{passive:!1}),addEventListener("mousemove",this.onDragMove),addEventListener("touchend",this.onDragEnd),addEventListener("mouseup",this.onDragEnd)},draggableCleanup(){const e=this.$el;e.removeEventListener("touchstart",this.onDragStart),e.removeEventListener("mousedown",this.onDragStart),removeEventListener("touchmove",this.onDragMove),removeEventListener("mousemove",this.onDragMove),removeEventListener("touchend",this.onDragEnd),removeEventListener("mouseup",this.onDragEnd)},onDragStart(e){this.beingDragged=!0,this.dragPos={x:Yo(e),y:Yu(e)},this.dragStart=Yo(e),this.dragRect=this.$el.getBoundingClientRect()},onDragMove(e){this.beingDragged&&(e.preventDefault(),this.isRunning&&(this.isRunning=!1),this.dragPos={x:Yo(e),y:Yu(e)})},onDragEnd(){this.beingDragged&&(Math.abs(this.dragDelta)>=this.removalDistance?(this.disableTransitions=!0,this.$nextTick(()=>this.closeToast())):setTimeout(()=>{this.beingDragged=!1,Qu(this.dragRect)&&this.pauseOnHover&&this.dragRect.bottom>=this.dragPos.y&&this.dragPos.y>=this.dragRect.top&&this.dragRect.left<=this.dragPos.x&&this.dragPos.x<=this.dragRect.right?this.isRunning=!1:this.isRunning=!0}))}}}),Uw=["role"];function Ww(e,t){const n=cr("Icon"),s=cr("CloseButton"),i=cr("ProgressBar");return Ve(),Wt("div",{class:Bn(e.classes),style:Or(e.draggableStyle),onClick:t[0]||(t[0]=(...o)=>e.clickHandler&&e.clickHandler(...o)),onMouseenter:t[1]||(t[1]=(...o)=>e.hoverPause&&e.hoverPause(...o)),onMouseleave:t[2]||(t[2]=(...o)=>e.hoverPlay&&e.hoverPlay(...o))},[e.icon?(Ve(),jt(n,{key:0,"custom-icon":e.icon,type:e.type},null,8,["custom-icon","type"])):Bo("v-if",!0),_s("div",{role:e.accessibility.toastRole||"alert",class:Bn(e.bodyClasses)},[typeof e.content=="string"?(Ve(),Wt(tt,{key:0},[Bi(xa(e.content),1)],2112)):(Ve(),jt(Va(e.getVueComponentFromObj(e.content)),Hi({key:1,"toast-id":e.id},e.hasProp(e.content,"props")?e.content.props:{},Bg(e.hasProp(e.content,"listeners")?e.content.listeners:{}),{onCloseToast:e.closeToast}),null,16,["toast-id","onCloseToast"]))],10,Uw),e.closeButton?(Ve(),jt(s,{key:1,component:e.closeButton,"class-names":e.closeButtonClassName,"show-on-hover":e.showCloseButtonOnHover,"aria-label":e.accessibility.closeButtonLabel,onClick:ab(e.closeToast,["stop"])},null,8,["component","class-names","show-on-hover","aria-label","onClick"])):Bo("v-if",!0),e.timeout?(Ve(),jt(i,{key:2,"is-running":e.isRunning,"hide-progress-bar":e.hideProgressBar,timeout:e.timeout,onCloseToast:e.timeoutHandler},null,8,["is-running","hide-progress-bar","timeout","onCloseToast"])):Bo("v-if",!0)],38)}Ah.render=Ww;var qw=Ah,Oh=fn({name:"VtTransition",props:En.TRANSITION,emits:["leave"],methods:{hasProp:cn,leave(e){e instanceof HTMLElement&&(e.style.left=e.offsetLeft+"px",e.style.top=e.offsetTop+"px",e.style.width=getComputedStyle(e).width,e.style.position="absolute")}}});function zw(e,t){return Ve(),jt(Z_,{tag:"div","enter-active-class":e.transition.enter?e.transition.enter:`${e.transition}-enter-active`,"move-class":e.transition.move?e.transition.move:`${e.transition}-move`,"leave-active-class":e.transition.leave?e.transition.leave:`${e.transition}-leave-active`,onLeave:e.leave},{default:Lr(()=>[jg(e.$slots,"default")]),_:3},8,["enter-active-class","move-class","leave-active-class","onLeave"])}Oh.render=zw;var Kw=Oh,xh=fn({name:"VueToastification",devtools:{hide:!0},components:{Toast:qw,VtTransition:Kw},props:Object.assign({},En.CORE_TOAST,En.CONTAINER,En.TRANSITION),data(){return{count:0,positions:Object.values(Pi),toasts:{},defaults:{}}},computed:{toastArray(){return Object.values(this.toasts)},filteredToasts(){return this.defaults.filterToasts(this.toastArray)}},beforeMount(){const e=this.eventBus;e.on(At.ADD,this.addToast),e.on(At.CLEAR,this.clearToasts),e.on(At.DISMISS,this.dismissToast),e.on(At.UPDATE,this.updateToast),e.on(At.UPDATE_DEFAULTS,this.updateDefaults),this.defaults=this.$props},mounted(){this.setup(this.container)},methods:{async setup(e){Yi(e)&&(e=await e()),uw(this.$el),e.appendChild(this.$el)},setToast(e){ls(e.id)||(this.toasts[e.id]=e)},addToast(e){e.content=fw(e.content);const t=Object.assign({},this.defaults,e.type&&this.defaults.toastDefaults&&this.defaults.toastDefaults[e.type],e),n=this.defaults.filterBeforeCreate(t,this.toastArray);n&&this.setToast(n)},dismissToast(e){const t=this.toasts[e];!ls(t)&&!ls(t.onClose)&&t.onClose(),delete this.toasts[e]},clearToasts(){Object.keys(this.toasts).forEach(e=>{this.dismissToast(e)})},getPositionToasts(e){const t=this.filteredToasts.filter(n=>n.position===e).slice(0,this.defaults.maxToasts);return this.defaults.newestOnTop?t.reverse():t},updateDefaults(e){ls(e.container)||this.setup(e.container),this.defaults=Object.assign({},this.defaults,e)},updateToast({id:e,options:t,create:n}){this.toasts[e]?(t.timeout&&t.timeout===this.toasts[e].timeout&&t.timeout++,this.setToast(Object.assign({},this.toasts[e],t))):n&&this.addToast(Object.assign({},{id:e},t))},getClasses(e){return[`${qt}__container`,e].concat(this.defaults.containerClassName)}}});function Gw(e,t){const n=cr("Toast"),s=cr("VtTransition");return Ve(),Wt("div",null,[(Ve(!0),Wt(tt,null,jc(e.positions,i=>(Ve(),Wt("div",{key:i},[nt(s,{transition:e.defaults.transition,class:Bn(e.getClasses(i))},{default:Lr(()=>[(Ve(!0),Wt(tt,null,jc(e.getPositionToasts(i),o=>(Ve(),jt(n,Hi({key:o.id},o),null,16))),128))]),_:2},1032,["transition","class"])]))),128))])}xh.render=Gw;var Jw=xh,ef=(e={},t=!0)=>{const n=e.eventBus=e.eventBus||new Za;t&&Pr(()=>{const o=Td(Jw,dh({},e)),a=o.mount(document.createElement("div")),c=e.onMounted;if(ls(c)||c(a,o),e.shareAppContext){const f=e.shareAppContext;f===!0?console.warn(`[${qt}] App to share context with was not provided.`):(o._context.components=f._context.components,o._context.directives=f._context.directives,o._context.mixins=f._context.mixins,o._context.provides=f._context.provides,o.config.globalProperties=f.config.globalProperties)}});const s=(o,a)=>{const c=Object.assign({},{id:cw(),type:St.DEFAULT},a,{content:o});return n.emit(At.ADD,c),c.id};s.clear=()=>n.emit(At.CLEAR,void 0),s.updateDefaults=o=>{n.emit(At.UPDATE_DEFAULTS,o)},s.dismiss=o=>{n.emit(At.DISMISS,o)};function i(o,{content:a,options:c},f=!1){const p=Object.assign({},c,{content:a});n.emit(At.UPDATE,{id:o,options:p,create:f})}return s.update=i,s.success=(o,a)=>s(o,Object.assign({},a,{type:St.SUCCESS})),s.info=(o,a)=>s(o,Object.assign({},a,{type:St.INFO})),s.error=(o,a)=>s(o,Object.assign({},a,{type:St.ERROR})),s.warning=(o,a)=>s(o,Object.assign({},a,{type:St.WARNING})),s},Xw=()=>{const e=()=>console.warn(`[${qt}] This plugin does not support SSR!`);return new Proxy(e,{get(){return e}})};function Rh(e){return dw()?hw(e)?ef({eventBus:e},!1):ef(e,!0):Xw()}var Ph=Symbol("VueToastification"),Lh=new Za,Qw=(e,t)=>{(t==null?void 0:t.shareAppContext)===!0&&(t.shareAppContext=e);const n=Rh(dh({eventBus:Lh},t));e.provide(Ph,n)},f0=e=>{const t=dd()?xt(Ph,void 0):void 0;return t||Rh(Lh)},Yw=Qw,Zw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function d0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var e0={exports:{}};/*! +`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ms(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:o}=n;s!==void 0&&va.assertOptions(s,{silentJSONParsing:Ln.transitional(Ln.boolean),forcedJSONParsing:Ln.transitional(Ln.boolean),clarifyTimeoutError:Ln.transitional(Ln.boolean)},!1),i!=null&&(S.isFunction(i)?n.paramsSerializer={serialize:i}:va.assertOptions(i,{encode:Ln.function,serialize:Ln.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&S.merge(o.common,o[n.method]);o&&S.forEach(["delete","get","head","post","put","patch","common"],C=>{delete o[C]}),n.headers=yt.concat(a,o);const c=[];let f=!0;this.interceptors.request.forEach(function(P){typeof P.runWhen=="function"&&P.runWhen(n)===!1||(f=f&&P.synchronous,c.unshift(P.fulfilled,P.rejected))});const p=[];this.interceptors.response.forEach(function(P){p.push(P.fulfilled,P.rejected)});let d,m=0,b;if(!f){const C=[zu.bind(this),void 0];for(C.unshift.apply(C,c),C.push.apply(C,p),b=C.length,d=Promise.resolve(n);m{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{s.subscribe(c),o=c}).then(i);return a.cancel=function(){s.unsubscribe(o)},a},t(function(o,a,c){s.reason||(s.reason=new Ks(o,a,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ya(function(i){t=i}),cancel:t}}}function Qv(e){return function(n){return e.apply(null,n)}}function Yv(e){return S.isObject(e)&&e.isAxiosError===!0}const wa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wa).forEach(([e,t])=>{wa[t]=e});function uh(e){const t=new fs(e),n=Hd(fs.prototype.request,t);return S.extend(n,fs.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return uh(ms(e,i))},n}const Ke=uh(Nr);Ke.Axios=fs;Ke.CanceledError=Ks;Ke.CancelToken=Ya;Ke.isCancel=nh;Ke.VERSION=ch;Ke.toFormData=Xi;Ke.AxiosError=de;Ke.Cancel=Ke.CanceledError;Ke.all=function(t){return Promise.all(t)};Ke.spread=Qv;Ke.isAxiosError=Yv;Ke.mergeConfig=ms;Ke.AxiosHeaders=yt;Ke.formToJSON=e=>th(S.isHTMLForm(e)?new FormData(e):e);Ke.getAdapter=lh.getAdapter;Ke.HttpStatusCode=wa;Ke.default=Ke;const Zv="modulepreload",ew=function(e){return"/"+e},Gu={},is=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(c=>{if(c=ew(c),c in Gu)return;Gu[c]=!0;const f=c.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const d=document.createElement("link");if(d.rel=f?"stylesheet":Zv,f||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),f)return new Promise((m,b)=>{d.addEventListener("load",m),d.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}return i.then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})},fh=wy({history:Xb(),routes:[{path:"/",name:"home",redirect:"/web/softwareCatalog"},{path:"/web",name:"rootOssList",component:()=>is(()=>import("./OssList-Dkx--ByD.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/web/oss/list",name:"ossList",component:()=>is(()=>import("./OssList-Dkx--ByD.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/web/generate/yaml",name:"yamlGenerate",component:()=>is(()=>import("./YamlGenerate-BpVTbERL.js"),__vite__mapDeps([6,5,7,8]))},{path:"/web/repository/list",name:"repositoryList",component:()=>is(()=>import("./RepositoryList-CA5Ls4Jk.js"),__vite__mapDeps([9,10,1,2,3,4,11,5]))},{path:"/web/repository/detail/:repositoryName",name:"repositoryDetail",component:()=>is(()=>import("./RepositoryDetail-C1I53_sg.js"),__vite__mapDeps([12,13,11,5,14,3,4]))},{path:"/web/softwareCatalog",name:"softwareCatalog",component:()=>is(()=>import("./SoftwareCatalog-CNyPg-7j.js"),__vite__mapDeps([15,2,16,14,5,7,17,3,4,10,1,11,13,18]))},{path:"/web/softwareCatalog/list/test",name:"softwareCatalogListTest",component:()=>is(()=>import("./SoftwareCatalogListTest-DSIjiOry.js"),__vite__mapDeps([19,2,16,14,5,7,17,20]))}]}),tw=yb("user",{state:()=>({accessToken:"",workspaceInfo:{id:"",name:"",description:"",created_at:"",updated_at:""},projectInfo:{id:"",ns_id:"",mci_id:"",cluster_id:"",name:"",description:"",created_at:"",updated_at:""},operationId:""}),actions:{setUser(e){this.accessToken=e.accessToken,this.workspaceInfo=e.workspaceInfo,this.projectInfo=e.projectInfo,this.operationId=e.operationId},getNsId(){return this.projectInfo.ns_id},clearUser(){this.accessToken=null,this.workspaceInfo=null,this.projectInfo=null,this.operationId=null}}});fh.beforeEach(async(e,t,n)=>{window.addEventListener("message",async function(s){let i;console.log("## event.data.accessToken ### : ",s.data.accessToken),s.data.accessToken===void 0||s.data.accessToken==="undefined"?(console.log("## event.data.accessToken is undefined ### : "),i={accessToken:"accesstokenExample",workspaceInfo:{id:"8b2df1f9-b937-4861-b5ce-855a41c346bc",name:"workspace2",description:"workspace2 desc",created_at:"2024-06-18T00:10:16.192337Z",updated_at:"2024-06-18T00:10:16.192337Z"},projectInfo:{id:"1e88f4ea-d052-4314-80a4-9ac3f6691feb",ns_id:"ns01",mci_id:"mci01",cluster_id:"cluster01",name:"ns01",description:"ns01 desc",created_at:"2024-06-18T00:28:57.094105Z",updated_at:"2024-06-18T00:28:57.094105Z"},operationId:"op1"}):(console.log("## event.data.accessToken is not undefined ### : "),i=s.data);try{console.log("## data ### : ",i),tw().setUser(i)}catch(o){console.error("Error in processing message:",o)}}),n()});const nw=e=>{const t=e==null?void 0:e.trim();if(!t)return window.location.origin;try{const n=new URL(t),s=new Set(["localhost","127.0.0.1","::1"]);if(s.has(n.hostname)&&!s.has(window.location.hostname))return window.location.origin}catch{return t}return t!=null&&t.startsWith("http://")&&window.location.protocol==="https:"?window.location.origin:t},u0=e=>e?/^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(e)||e.startsWith("data:")?e:`${window.location.origin}${e.startsWith("/")?"":"/"}${e}`:"";var sw=Object.defineProperty,Ju=Object.getOwnPropertySymbols,rw=Object.prototype.hasOwnProperty,iw=Object.prototype.propertyIsEnumerable,Xu=(e,t,n)=>t in e?sw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dh=(e,t)=>{for(var n in t||(t={}))rw.call(t,n)&&Xu(e,n,t[n]);if(Ju)for(var n of Ju(t))iw.call(t,n)&&Xu(e,n,t[n]);return e},Yi=e=>typeof e=="function",Zi=e=>typeof e=="string",hh=e=>Zi(e)&&e.trim().length>0,ow=e=>typeof e=="number",ls=e=>typeof e>"u",Sr=e=>typeof e=="object"&&e!==null,aw=e=>cn(e,"tag")&&hh(e.tag),ph=e=>window.TouchEvent&&e instanceof TouchEvent,mh=e=>cn(e,"component")&&gh(e.component),lw=e=>Yi(e)||Sr(e),gh=e=>!ls(e)&&(Zi(e)||lw(e)||mh(e)),Qu=e=>Sr(e)&&["height","width","right","left","top","bottom"].every(t=>ow(e[t])),cn=(e,t)=>(Sr(e)||Yi(e))&&t in e,cw=(e=>()=>e++)(0);function Yo(e){return ph(e)?e.targetTouches[0].clientX:e.clientX}function Yu(e){return ph(e)?e.targetTouches[0].clientY:e.clientY}var uw=e=>{ls(e.remove)?e.parentNode&&e.parentNode.removeChild(e):e.remove()},kr=e=>mh(e)?kr(e.component):aw(e)?fn({render(){return e}}):typeof e=="string"?e:Ee(Fn(e)),fw=e=>{if(typeof e=="string")return e;const t=cn(e,"props")&&Sr(e.props)?e.props:{},n=cn(e,"listeners")&&Sr(e.listeners)?e.listeners:{};return{component:kr(e),props:t,listeners:n}},dw=()=>typeof window<"u",Za=class{constructor(){this.allHandlers={}}getHandlers(e){return this.allHandlers[e]||[]}on(e,t){const n=this.getHandlers(e);n.push(t),this.allHandlers[e]=n}off(e,t){const n=this.getHandlers(e);n.splice(n.indexOf(t)>>>0,1)}emit(e,t){this.getHandlers(e).forEach(s=>s(t))}},hw=e=>["on","off","emit"].every(t=>cn(e,t)&&Yi(e[t])),St;(function(e){e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.DEFAULT="default"})(St||(St={}));var Pi;(function(e){e.TOP_LEFT="top-left",e.TOP_CENTER="top-center",e.TOP_RIGHT="top-right",e.BOTTOM_LEFT="bottom-left",e.BOTTOM_CENTER="bottom-center",e.BOTTOM_RIGHT="bottom-right"})(Pi||(Pi={}));var At;(function(e){e.ADD="add",e.DISMISS="dismiss",e.UPDATE="update",e.CLEAR="clear",e.UPDATE_DEFAULTS="update_defaults"})(At||(At={}));var qt="Vue-Toastification",Ut={type:{type:String,default:St.DEFAULT},classNames:{type:[String,Array],default:()=>[]},trueBoolean:{type:Boolean,default:!0}},_h={type:Ut.type,customIcon:{type:[String,Boolean,Object,Function],default:!0}},bi={component:{type:[String,Object,Function,Boolean],default:"button"},classNames:Ut.classNames,showOnHover:{type:Boolean,default:!1},ariaLabel:{type:String,default:"close"}},Ea={timeout:{type:[Number,Boolean],default:5e3},hideProgressBar:{type:Boolean,default:!1},isRunning:{type:Boolean,default:!1}},bh={transition:{type:[Object,String],default:`${qt}__bounce`}},pw={position:{type:String,default:Pi.TOP_RIGHT},draggable:Ut.trueBoolean,draggablePercent:{type:Number,default:.6},pauseOnFocusLoss:Ut.trueBoolean,pauseOnHover:Ut.trueBoolean,closeOnClick:Ut.trueBoolean,timeout:Ea.timeout,hideProgressBar:Ea.hideProgressBar,toastClassName:Ut.classNames,bodyClassName:Ut.classNames,icon:_h.customIcon,closeButton:bi.component,closeButtonClassName:bi.classNames,showCloseButtonOnHover:bi.showOnHover,accessibility:{type:Object,default:()=>({toastRole:"alert",closeButtonLabel:"close"})},rtl:{type:Boolean,default:!1},eventBus:{type:Object,required:!1,default:()=>new Za}},mw={id:{type:[String,Number],required:!0,default:0},type:Ut.type,content:{type:[String,Object,Function],required:!0,default:""},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0}},gw={container:{type:[Object,Function],default:()=>document.body},newestOnTop:Ut.trueBoolean,maxToasts:{type:Number,default:20},transition:bh.transition,toastDefaults:Object,filterBeforeCreate:{type:Function,default:e=>e},filterToasts:{type:Function,default:e=>e},containerClassName:Ut.classNames,onMounted:Function,shareAppContext:[Boolean,Object]},En={CORE_TOAST:pw,TOAST:mw,CONTAINER:gw,PROGRESS_BAR:Ea,ICON:_h,TRANSITION:bh,CLOSE_BUTTON:bi},yh=fn({name:"VtProgressBar",props:En.PROGRESS_BAR,data(){return{hasClass:!0}},computed:{style(){return{animationDuration:`${this.timeout}ms`,animationPlayState:this.isRunning?"running":"paused",opacity:this.hideProgressBar?0:1}},cpClass(){return this.hasClass?`${qt}__progress-bar`:""}},watch:{timeout(){this.hasClass=!1,this.$nextTick(()=>this.hasClass=!0)}},mounted(){this.$el.addEventListener("animationend",this.animationEnded)},beforeUnmount(){this.$el.removeEventListener("animationend",this.animationEnded)},methods:{animationEnded(){this.$emit("close-toast")}}});function _w(e,t){return Ve(),Wt("div",{style:Or(e.style),class:Bn(e.cpClass)},null,6)}yh.render=_w;var bw=yh,vh=fn({name:"VtCloseButton",props:En.CLOSE_BUTTON,computed:{buttonComponent(){return this.component!==!1?kr(this.component):"button"},classes(){const e=[`${qt}__close-button`];return this.showOnHover&&e.push("show-on-hover"),e.concat(this.classNames)}}}),yw=Bi(" × ");function vw(e,t){return Ve(),jt(Va(e.buttonComponent),Hi({"aria-label":e.ariaLabel,class:e.classes},e.$attrs),{default:Lr(()=>[yw]),_:1},16,["aria-label","class"])}vh.render=vw;var ww=vh,wh={},Ew={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"check-circle",class:"svg-inline--fa fa-check-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Cw=_s("path",{fill:"currentColor",d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},null,-1),Tw=[Cw];function Sw(e,t){return Ve(),Wt("svg",Ew,Tw)}wh.render=Sw;var Aw=wh,Eh={},Ow={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"info-circle",class:"svg-inline--fa fa-info-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},xw=_s("path",{fill:"currentColor",d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},null,-1),Rw=[xw];function Pw(e,t){return Ve(),Wt("svg",Ow,Rw)}Eh.render=Pw;var Zu=Eh,Ch={},Lw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-circle",class:"svg-inline--fa fa-exclamation-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Iw=_s("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),Dw=[Iw];function Nw(e,t){return Ve(),Wt("svg",Lw,Dw)}Ch.render=Nw;var kw=Ch,Th={},Mw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-triangle",class:"svg-inline--fa fa-exclamation-triangle fa-w-18",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},$w=_s("path",{fill:"currentColor",d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),Fw=[$w];function jw(e,t){return Ve(),Wt("svg",Mw,Fw)}Th.render=jw;var Bw=Th,Sh=fn({name:"VtIcon",props:En.ICON,computed:{customIconChildren(){return cn(this.customIcon,"iconChildren")?this.trimValue(this.customIcon.iconChildren):""},customIconClass(){return Zi(this.customIcon)?this.trimValue(this.customIcon):cn(this.customIcon,"iconClass")?this.trimValue(this.customIcon.iconClass):""},customIconTag(){return cn(this.customIcon,"iconTag")?this.trimValue(this.customIcon.iconTag,"i"):"i"},hasCustomIcon(){return this.customIconClass.length>0},component(){return this.hasCustomIcon?this.customIconTag:gh(this.customIcon)?kr(this.customIcon):this.iconTypeComponent},iconTypeComponent(){return{[St.DEFAULT]:Zu,[St.INFO]:Zu,[St.SUCCESS]:Aw,[St.ERROR]:Bw,[St.WARNING]:kw}[this.type]},iconClasses(){const e=[`${qt}__icon`];return this.hasCustomIcon?e.concat(this.customIconClass):e}},methods:{trimValue(e,t=""){return hh(e)?e.trim():t}}});function Hw(e,t){return Ve(),jt(Va(e.component),{class:Bn(e.iconClasses)},{default:Lr(()=>[Bi(xa(e.customIconChildren),1)]),_:1},8,["class"])}Sh.render=Hw;var Vw=Sh,Ah=fn({name:"VtToast",components:{ProgressBar:bw,CloseButton:ww,Icon:Vw},inheritAttrs:!1,props:Object.assign({},En.CORE_TOAST,En.TOAST),data(){return{isRunning:!0,disableTransitions:!1,beingDragged:!1,dragStart:0,dragPos:{x:0,y:0},dragRect:{}}},computed:{classes(){const e=[`${qt}__toast`,`${qt}__toast--${this.type}`,`${this.position}`].concat(this.toastClassName);return this.disableTransitions&&e.push("disable-transition"),this.rtl&&e.push(`${qt}__toast--rtl`),e},bodyClasses(){return[`${qt}__toast-${Zi(this.content)?"body":"component-body"}`].concat(this.bodyClassName)},draggableStyle(){return this.dragStart===this.dragPos.x?{}:this.beingDragged?{transform:`translateX(${this.dragDelta}px)`,opacity:1-Math.abs(this.dragDelta/this.removalDistance)}:{transition:"transform 0.2s, opacity 0.2s",transform:"translateX(0)",opacity:1}},dragDelta(){return this.beingDragged?this.dragPos.x-this.dragStart:0},removalDistance(){return Qu(this.dragRect)?(this.dragRect.right-this.dragRect.left)*this.draggablePercent:0}},mounted(){this.draggable&&this.draggableSetup(),this.pauseOnFocusLoss&&this.focusSetup()},beforeUnmount(){this.draggable&&this.draggableCleanup(),this.pauseOnFocusLoss&&this.focusCleanup()},methods:{hasProp:cn,getVueComponentFromObj:kr,closeToast(){this.eventBus.emit(At.DISMISS,this.id)},clickHandler(){this.onClick&&this.onClick(this.closeToast),this.closeOnClick&&(!this.beingDragged||this.dragStart===this.dragPos.x)&&this.closeToast()},timeoutHandler(){this.closeToast()},hoverPause(){this.pauseOnHover&&(this.isRunning=!1)},hoverPlay(){this.pauseOnHover&&(this.isRunning=!0)},focusPause(){this.isRunning=!1},focusPlay(){this.isRunning=!0},focusSetup(){addEventListener("blur",this.focusPause),addEventListener("focus",this.focusPlay)},focusCleanup(){removeEventListener("blur",this.focusPause),removeEventListener("focus",this.focusPlay)},draggableSetup(){const e=this.$el;e.addEventListener("touchstart",this.onDragStart,{passive:!0}),e.addEventListener("mousedown",this.onDragStart),addEventListener("touchmove",this.onDragMove,{passive:!1}),addEventListener("mousemove",this.onDragMove),addEventListener("touchend",this.onDragEnd),addEventListener("mouseup",this.onDragEnd)},draggableCleanup(){const e=this.$el;e.removeEventListener("touchstart",this.onDragStart),e.removeEventListener("mousedown",this.onDragStart),removeEventListener("touchmove",this.onDragMove),removeEventListener("mousemove",this.onDragMove),removeEventListener("touchend",this.onDragEnd),removeEventListener("mouseup",this.onDragEnd)},onDragStart(e){this.beingDragged=!0,this.dragPos={x:Yo(e),y:Yu(e)},this.dragStart=Yo(e),this.dragRect=this.$el.getBoundingClientRect()},onDragMove(e){this.beingDragged&&(e.preventDefault(),this.isRunning&&(this.isRunning=!1),this.dragPos={x:Yo(e),y:Yu(e)})},onDragEnd(){this.beingDragged&&(Math.abs(this.dragDelta)>=this.removalDistance?(this.disableTransitions=!0,this.$nextTick(()=>this.closeToast())):setTimeout(()=>{this.beingDragged=!1,Qu(this.dragRect)&&this.pauseOnHover&&this.dragRect.bottom>=this.dragPos.y&&this.dragPos.y>=this.dragRect.top&&this.dragRect.left<=this.dragPos.x&&this.dragPos.x<=this.dragRect.right?this.isRunning=!1:this.isRunning=!0}))}}}),Uw=["role"];function Ww(e,t){const n=cr("Icon"),s=cr("CloseButton"),i=cr("ProgressBar");return Ve(),Wt("div",{class:Bn(e.classes),style:Or(e.draggableStyle),onClick:t[0]||(t[0]=(...o)=>e.clickHandler&&e.clickHandler(...o)),onMouseenter:t[1]||(t[1]=(...o)=>e.hoverPause&&e.hoverPause(...o)),onMouseleave:t[2]||(t[2]=(...o)=>e.hoverPlay&&e.hoverPlay(...o))},[e.icon?(Ve(),jt(n,{key:0,"custom-icon":e.icon,type:e.type},null,8,["custom-icon","type"])):Bo("v-if",!0),_s("div",{role:e.accessibility.toastRole||"alert",class:Bn(e.bodyClasses)},[typeof e.content=="string"?(Ve(),Wt(tt,{key:0},[Bi(xa(e.content),1)],2112)):(Ve(),jt(Va(e.getVueComponentFromObj(e.content)),Hi({key:1,"toast-id":e.id},e.hasProp(e.content,"props")?e.content.props:{},Bg(e.hasProp(e.content,"listeners")?e.content.listeners:{}),{onCloseToast:e.closeToast}),null,16,["toast-id","onCloseToast"]))],10,Uw),e.closeButton?(Ve(),jt(s,{key:1,component:e.closeButton,"class-names":e.closeButtonClassName,"show-on-hover":e.showCloseButtonOnHover,"aria-label":e.accessibility.closeButtonLabel,onClick:ab(e.closeToast,["stop"])},null,8,["component","class-names","show-on-hover","aria-label","onClick"])):Bo("v-if",!0),e.timeout?(Ve(),jt(i,{key:2,"is-running":e.isRunning,"hide-progress-bar":e.hideProgressBar,timeout:e.timeout,onCloseToast:e.timeoutHandler},null,8,["is-running","hide-progress-bar","timeout","onCloseToast"])):Bo("v-if",!0)],38)}Ah.render=Ww;var qw=Ah,Oh=fn({name:"VtTransition",props:En.TRANSITION,emits:["leave"],methods:{hasProp:cn,leave(e){e instanceof HTMLElement&&(e.style.left=e.offsetLeft+"px",e.style.top=e.offsetTop+"px",e.style.width=getComputedStyle(e).width,e.style.position="absolute")}}});function zw(e,t){return Ve(),jt(Z_,{tag:"div","enter-active-class":e.transition.enter?e.transition.enter:`${e.transition}-enter-active`,"move-class":e.transition.move?e.transition.move:`${e.transition}-move`,"leave-active-class":e.transition.leave?e.transition.leave:`${e.transition}-leave-active`,onLeave:e.leave},{default:Lr(()=>[jg(e.$slots,"default")]),_:3},8,["enter-active-class","move-class","leave-active-class","onLeave"])}Oh.render=zw;var Kw=Oh,xh=fn({name:"VueToastification",devtools:{hide:!0},components:{Toast:qw,VtTransition:Kw},props:Object.assign({},En.CORE_TOAST,En.CONTAINER,En.TRANSITION),data(){return{count:0,positions:Object.values(Pi),toasts:{},defaults:{}}},computed:{toastArray(){return Object.values(this.toasts)},filteredToasts(){return this.defaults.filterToasts(this.toastArray)}},beforeMount(){const e=this.eventBus;e.on(At.ADD,this.addToast),e.on(At.CLEAR,this.clearToasts),e.on(At.DISMISS,this.dismissToast),e.on(At.UPDATE,this.updateToast),e.on(At.UPDATE_DEFAULTS,this.updateDefaults),this.defaults=this.$props},mounted(){this.setup(this.container)},methods:{async setup(e){Yi(e)&&(e=await e()),uw(this.$el),e.appendChild(this.$el)},setToast(e){ls(e.id)||(this.toasts[e.id]=e)},addToast(e){e.content=fw(e.content);const t=Object.assign({},this.defaults,e.type&&this.defaults.toastDefaults&&this.defaults.toastDefaults[e.type],e),n=this.defaults.filterBeforeCreate(t,this.toastArray);n&&this.setToast(n)},dismissToast(e){const t=this.toasts[e];!ls(t)&&!ls(t.onClose)&&t.onClose(),delete this.toasts[e]},clearToasts(){Object.keys(this.toasts).forEach(e=>{this.dismissToast(e)})},getPositionToasts(e){const t=this.filteredToasts.filter(n=>n.position===e).slice(0,this.defaults.maxToasts);return this.defaults.newestOnTop?t.reverse():t},updateDefaults(e){ls(e.container)||this.setup(e.container),this.defaults=Object.assign({},this.defaults,e)},updateToast({id:e,options:t,create:n}){this.toasts[e]?(t.timeout&&t.timeout===this.toasts[e].timeout&&t.timeout++,this.setToast(Object.assign({},this.toasts[e],t))):n&&this.addToast(Object.assign({},{id:e},t))},getClasses(e){return[`${qt}__container`,e].concat(this.defaults.containerClassName)}}});function Gw(e,t){const n=cr("Toast"),s=cr("VtTransition");return Ve(),Wt("div",null,[(Ve(!0),Wt(tt,null,jc(e.positions,i=>(Ve(),Wt("div",{key:i},[nt(s,{transition:e.defaults.transition,class:Bn(e.getClasses(i))},{default:Lr(()=>[(Ve(!0),Wt(tt,null,jc(e.getPositionToasts(i),o=>(Ve(),jt(n,Hi({key:o.id},o),null,16))),128))]),_:2},1032,["transition","class"])]))),128))])}xh.render=Gw;var Jw=xh,ef=(e={},t=!0)=>{const n=e.eventBus=e.eventBus||new Za;t&&Pr(()=>{const o=Td(Jw,dh({},e)),a=o.mount(document.createElement("div")),c=e.onMounted;if(ls(c)||c(a,o),e.shareAppContext){const f=e.shareAppContext;f===!0?console.warn(`[${qt}] App to share context with was not provided.`):(o._context.components=f._context.components,o._context.directives=f._context.directives,o._context.mixins=f._context.mixins,o._context.provides=f._context.provides,o.config.globalProperties=f.config.globalProperties)}});const s=(o,a)=>{const c=Object.assign({},{id:cw(),type:St.DEFAULT},a,{content:o});return n.emit(At.ADD,c),c.id};s.clear=()=>n.emit(At.CLEAR,void 0),s.updateDefaults=o=>{n.emit(At.UPDATE_DEFAULTS,o)},s.dismiss=o=>{n.emit(At.DISMISS,o)};function i(o,{content:a,options:c},f=!1){const p=Object.assign({},c,{content:a});n.emit(At.UPDATE,{id:o,options:p,create:f})}return s.update=i,s.success=(o,a)=>s(o,Object.assign({},a,{type:St.SUCCESS})),s.info=(o,a)=>s(o,Object.assign({},a,{type:St.INFO})),s.error=(o,a)=>s(o,Object.assign({},a,{type:St.ERROR})),s.warning=(o,a)=>s(o,Object.assign({},a,{type:St.WARNING})),s},Xw=()=>{const e=()=>console.warn(`[${qt}] This plugin does not support SSR!`);return new Proxy(e,{get(){return e}})};function Rh(e){return dw()?hw(e)?ef({eventBus:e},!1):ef(e,!0):Xw()}var Ph=Symbol("VueToastification"),Lh=new Za,Qw=(e,t)=>{(t==null?void 0:t.shareAppContext)===!0&&(t.shareAppContext=e);const n=Rh(dh({eventBus:Lh},t));e.provide(Ph,n)},f0=e=>{const t=dd()?xt(Ph,void 0):void 0;return t||Rh(Lh)},Yw=Qw,Zw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function d0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var e0={exports:{}};/*! * Bootstrap v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) diff --git a/src/main/resources/static/assets/lodash-CIYw4d6b.js b/src/main/resources/static/assets/lodash-CJvlDKzA.js similarity index 99% rename from src/main/resources/static/assets/lodash-CIYw4d6b.js rename to src/main/resources/static/assets/lodash-CJvlDKzA.js index 6a362306..496deeef 100644 --- a/src/main/resources/static/assets/lodash-CIYw4d6b.js +++ b/src/main/resources/static/assets/lodash-CJvlDKzA.js @@ -1,4 +1,4 @@ -import{M as jt,N as rp}from"./index-kUd7CzTD.js";var Je={exports:{}};/** +import{M as jt,N as rp}from"./index-DpY2Dwv5.js";var Je={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors diff --git a/src/main/resources/static/assets/repository-SXJlvCG5.js b/src/main/resources/static/assets/repository-Cuw5n13K.js similarity index 89% rename from src/main/resources/static/assets/repository-SXJlvCG5.js rename to src/main/resources/static/assets/repository-Cuw5n13K.js index 6407b53e..1f49a227 100644 --- a/src/main/resources/static/assets/repository-SXJlvCG5.js +++ b/src/main/resources/static/assets/repository-Cuw5n13K.js @@ -1 +1 @@ -import{s}from"./request-C4mhQyyH.js";const n=e=>s.get(`/oss/v1/repositories/${e}/list`);function i(e,t){return s.delete(`/oss/v1/repositories/${e}/delete/${t}`)}function p(e,t){return s.post(`/oss/v1/repositories/${e}/create`,t)}const a=(e,t)=>s.get(`/oss/v1/repositories/${e}/detail/${t}`),u=(e,t)=>s.put(`/oss/v1/repositories/${e}/update`,t);function c(e,t){return s.delete(`/oss/v1/components/${e}/delete/${t}`)}const $=(e,t)=>s.get(`/oss/v1/components/${e}/list/${t}`),d=(e,t,o)=>s.post(`/oss/v1/components/${e}/create/${t}`,o);export{n as a,c as b,d as c,i as d,$ as e,a as g,p as r,u}; +import{s}from"./request-BI8njqPY.js";const n=e=>s.get(`/oss/v1/repositories/${e}/list`);function i(e,t){return s.delete(`/oss/v1/repositories/${e}/delete/${t}`)}function p(e,t){return s.post(`/oss/v1/repositories/${e}/create`,t)}const a=(e,t)=>s.get(`/oss/v1/repositories/${e}/detail/${t}`),u=(e,t)=>s.put(`/oss/v1/repositories/${e}/update`,t);function c(e,t){return s.delete(`/oss/v1/components/${e}/delete/${t}`)}const $=(e,t)=>s.get(`/oss/v1/components/${e}/list/${t}`),d=(e,t,o)=>s.post(`/oss/v1/components/${e}/create/${t}`,o);export{n as a,c as b,d as c,i as d,$ as e,a as g,p as r,u}; diff --git a/src/main/resources/static/assets/request-C4mhQyyH.js b/src/main/resources/static/assets/request-BI8njqPY.js similarity index 88% rename from src/main/resources/static/assets/request-C4mhQyyH.js rename to src/main/resources/static/assets/request-BI8njqPY.js index f5cfcd56..bc0b1b00 100644 --- a/src/main/resources/static/assets/request-C4mhQyyH.js +++ b/src/main/resources/static/assets/request-BI8njqPY.js @@ -1 +1 @@ -import{J as n,u as a,K as r}from"./index-kUd7CzTD.js";const i=n("http://127.0.0.1:18084"),t=a(),o=r.create({baseURL:i,timeout:3e5});o.interceptors.request.use(e=>e,e=>(console.log("error ---------- ",e),Promise.reject(e)));o.interceptors.response.use(e=>{const s=e.data;return s.code===200?s:(t.error(s.detail),Promise.reject(new Error(s.message||"Error")))},e=>{console.log("ApiService.Response -> fail",e);const s=e.response;return console.log(e.response),(s==null?void 0:s.status)===404&&t.error("API Call Fail :: Code 404"),r.isCancel(e),Promise.reject(e)});export{o as s}; +import{J as n,u as a,K as r}from"./index-DpY2Dwv5.js";const i=n("http://127.0.0.1:18084"),t=a(),o=r.create({baseURL:i,timeout:3e5});o.interceptors.request.use(e=>e,e=>(console.log("error ---------- ",e),Promise.reject(e)));o.interceptors.response.use(e=>{const s=e.data;return s.code===200?s:(t.error(s.detail),Promise.reject(new Error(s.message||"Error")))},e=>{console.log("ApiService.Response -> fail",e);const s=e.response;return console.log(e.response),(s==null?void 0:s.status)===404&&t.error("API Call Fail :: Code 404"),r.isCancel(e),Promise.reject(e)});export{o as s}; diff --git a/src/main/resources/static/assets/softwareCatalogForm-B9uFq4Sl.css b/src/main/resources/static/assets/softwareCatalogForm-B9uFq4Sl.css deleted file mode 100644 index a79d0ac7..00000000 --- a/src/main/resources/static/assets/softwareCatalogForm-B9uFq4Sl.css +++ /dev/null @@ -1 +0,0 @@ -.w-80-per[data-v-cbdd5ab7]{width:80%!important}.w-90-per[data-v-cbdd5ab7]{width:90%!important}.input-form[data-v-c201966c]{width:100%!important;display:flex;gap:10px;margin-bottom:10px}.w-50-per[data-v-c201966c]{width:50%!important}.w-80-per[data-v-c201966c]{width:80%!important}.w-90-per[data-v-c201966c]{width:90%!important} diff --git a/src/main/resources/static/assets/softwareCatalogForm-vcxmGWrf.css b/src/main/resources/static/assets/softwareCatalogForm-vcxmGWrf.css new file mode 100644 index 00000000..78e1100a --- /dev/null +++ b/src/main/resources/static/assets/softwareCatalogForm-vcxmGWrf.css @@ -0,0 +1 @@ +.w-80-per[data-v-cbdd5ab7]{width:80%!important}.w-90-per[data-v-cbdd5ab7]{width:90%!important}.input-form[data-v-f2edc4ae]{width:100%!important;display:flex;gap:10px;margin-bottom:10px}.w-50-per[data-v-f2edc4ae]{width:50%!important}.w-80-per[data-v-f2edc4ae]{width:80%!important}.w-90-per[data-v-f2edc4ae]{width:90%!important} diff --git a/src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_c201966c_lang-Cv7irf01.js b/src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-Dn3T2TCo.js similarity index 99% rename from src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_c201966c_lang-Cv7irf01.js rename to src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-Dn3T2TCo.js index 933825a8..7c1541ac 100644 --- a/src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_c201966c_lang-Cv7irf01.js +++ b/src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-Dn3T2TCo.js @@ -1,4 +1,4 @@ -import{c as Te}from"./IconPlus-BsY6bQ-u.js";import{J as Le,K as $e,d as Ke,u as _e,C as Oe,c as R,r as v,w as se,o as ze,a as n,b as t,t as y,j as b,e as u,v as V,F as U,f as j,y as pe,g as C,z as W,l as ne,n as He,h as o}from"./index-kUd7CzTD.js";import{_ as J}from"./lodash-CIYw4d6b.js";import{s as i}from"./request-C4mhQyyH.js";import{_ as Fe}from"./_plugin-vue_export-helper-DlAUqK2U.js";/** +import{c as Te}from"./IconPlus-DRtzYi91.js";import{J as Le,K as $e,d as Ke,u as _e,C as Oe,c as R,r as v,w as se,o as ze,a as n,b as t,t as y,j as b,e as u,v as V,F as U,f as j,y as pe,g as C,z as W,l as ne,n as He,h as o}from"./index-DpY2Dwv5.js";import{_ as J}from"./lodash-CJvlDKzA.js";import{s as i}from"./request-BI8njqPY.js";import{_ as Fe}from"./_plugin-vue_export-helper-DlAUqK2U.js";/** * @license @tabler/icons-vue v3.22.0 - MIT * * This source code is licensed under the MIT license. diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 972ff1a6..12c606b4 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -5,7 +5,7 @@ App - + From a11d2eb7a3f2a3afbbaf72cb54bd2c39464f26e2 Mon Sep 17 00:00:00 2001 From: jmin Date: Sat, 13 Jun 2026 19:42:42 +0900 Subject: [PATCH 3/6] Fix Kubernetes deployment lifecycle and ingress handling --- .../applicationInstallationForm.vue | 21 ++++++++++- .../application/dto/DeploymentConfigDTO.java | 36 ++++++++++++++++++- ...nPlus-DRtzYi91.js => IconPlus-CzjTfC0G.js} | 2 +- ...ssList-Dkx--ByD.js => OssList-BdIqgjD3.js} | 2 +- .../assets/RepositoryDetail-C1I53_sg.js | 1 - .../assets/RepositoryDetail-CbULetTk.js | 1 + ...e_type_script_setup_true_lang-V9V27WdR.js} | 2 +- .../static/assets/RepositoryList-CA5Ls4Jk.js | 1 - .../static/assets/RepositoryList-CdLs-wGJ.js | 1 + ...e_type_script_setup_true_lang-Cag0BJ7v.js} | 2 +- ...NyPg-7j.js => SoftwareCatalog-92k3EGJE.js} | 2 +- ...js => SoftwareCatalogListTest-CycE7BiX.js} | 2 +- ...e_vue_type_style_index_0_lang-By7I3DHo.js} | 2 +- ...e-BpVTbERL.js => YamlGenerate-BM6AGV9q.js} | 2 +- ...-D2DynUsO.js => bootstrap.esm-PUGawJZB.js} | 2 +- .../{index-DpY2Dwv5.js => index-2RdC8Fmv.js} | 4 +-- ...{lodash-CJvlDKzA.js => lodash-DKwpWrhb.js} | 2 +- ...ory-Cuw5n13K.js => repository-CpO3JiZ6.js} | 2 +- ...equest-BI8njqPY.js => request-DXU_IEYq.js} | 2 +- ...f.css => softwareCatalogForm-LbowL8ep.css} | 2 +- ...e_index_0_scoped_f2edc4ae_lang-DZqNehtl.js | 6 ++++ ...e_index_0_scoped_f2edc4ae_lang-Dn3T2TCo.js | 6 ---- src/main/resources/static/index.html | 2 +- 23 files changed, 79 insertions(+), 26 deletions(-) rename src/main/resources/static/assets/{IconPlus-DRtzYi91.js => IconPlus-CzjTfC0G.js} (96%) rename src/main/resources/static/assets/{OssList-Dkx--ByD.js => OssList-BdIqgjD3.js} (96%) delete mode 100644 src/main/resources/static/assets/RepositoryDetail-C1I53_sg.js create mode 100644 src/main/resources/static/assets/RepositoryDetail-CbULetTk.js rename src/main/resources/static/assets/{RepositoryDetail.vue_vue_type_script_setup_true_lang-Bb5umCXR.js => RepositoryDetail.vue_vue_type_script_setup_true_lang-V9V27WdR.js} (96%) delete mode 100644 src/main/resources/static/assets/RepositoryList-CA5Ls4Jk.js create mode 100644 src/main/resources/static/assets/RepositoryList-CdLs-wGJ.js rename src/main/resources/static/assets/{RepositoryList.vue_vue_type_script_setup_true_lang-CuWQGniu.js => RepositoryList.vue_vue_type_script_setup_true_lang-Cag0BJ7v.js} (97%) rename src/main/resources/static/assets/{SoftwareCatalog-CNyPg-7j.js => SoftwareCatalog-92k3EGJE.js} (99%) rename src/main/resources/static/assets/{SoftwareCatalogListTest-DSIjiOry.js => SoftwareCatalogListTest-CycE7BiX.js} (96%) rename src/main/resources/static/assets/{Tabulator.vue_vue_type_style_index_0_lang-Cy0Pje7A.js => Tabulator.vue_vue_type_style_index_0_lang-By7I3DHo.js} (99%) rename src/main/resources/static/assets/{YamlGenerate-BpVTbERL.js => YamlGenerate-BM6AGV9q.js} (99%) rename src/main/resources/static/assets/{bootstrap.esm-D2DynUsO.js => bootstrap.esm-PUGawJZB.js} (99%) rename src/main/resources/static/assets/{index-DpY2Dwv5.js => index-2RdC8Fmv.js} (99%) rename src/main/resources/static/assets/{lodash-CJvlDKzA.js => lodash-DKwpWrhb.js} (99%) rename src/main/resources/static/assets/{repository-Cuw5n13K.js => repository-CpO3JiZ6.js} (89%) rename src/main/resources/static/assets/{request-BI8njqPY.js => request-DXU_IEYq.js} (88%) rename src/main/resources/static/assets/{softwareCatalogForm-vcxmGWrf.css => softwareCatalogForm-LbowL8ep.css} (60%) create mode 100644 src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-DZqNehtl.js delete mode 100644 src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-Dn3T2TCo.js diff --git a/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue b/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue index 902c5593..e6619f69 100644 --- a/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue +++ b/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue @@ -685,6 +685,25 @@ const setInit = async () => { await _getNsId() } +const normalizeIngressHost = (host: string) => { + let normalized = (host || '').trim() + if (!normalized) return normalized + + normalized = normalized.replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//, '') + const atIndex = normalized.lastIndexOf('@') + if (atIndex >= 0) normalized = normalized.slice(atIndex + 1) + + const delimiterIndex = normalized.search(/[/?#]/) + if (delimiterIndex >= 0) normalized = normalized.slice(0, delimiterIndex) + + const firstColonIndex = normalized.indexOf(':') + if (firstColonIndex >= 0 && normalized.indexOf(':', firstColonIndex + 1) < 0) { + normalized = normalized.slice(0, firstColonIndex) + } + + return normalized.trim().toLowerCase() +} + const _getSoftwareCatalogList = async () => { await getSoftwareCatalogList("").then(({ data }) => { catalogList.value = data @@ -918,7 +937,7 @@ const runInstall = async () => { memoryThreshold: hpaData.value.hpaMemoryUtilization, resourceType: selectedResourceType.value, ingressEnabled: ingressData.value.ingressEnabled, - ingressHost: ingressData.value.ingressHost, + ingressHost: normalizeIngressHost(ingressData.value.ingressHost), ingressPath: ingressData.value.ingressPath, ingressClass: ingressData.value.ingressClass, ingressTlsEnabled: ingressData.value.ingressTlsEnabled, diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentConfigDTO.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentConfigDTO.java index 3100f2d2..2495f42b 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentConfigDTO.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentConfigDTO.java @@ -6,6 +6,8 @@ import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Locale; + /** * 배포 설정을 관리하는 DTO * Request 파라미터와 카탈로그 기본값을 조합하여 최종 설정값을 제공 @@ -48,7 +50,7 @@ public static DeploymentConfigDTO from(DeploymentRequest request, SoftwareCatalo // Ingress 설정 (Request 우선) .ingressEnabled(getValue(request.getIngressEnabled(), catalog.getIngressEnabled(), false)) - .ingressHost(getValue(request.getIngressHost(), catalog.getIngressHost(), "localhost")) + .ingressHost(normalizeIngressHost(getValue(request.getIngressHost(), catalog.getIngressHost(), "localhost"))) .ingressPath(getValue(request.getIngressPath(), catalog.getIngressPath(), "/")) .ingressClass(getValue(request.getIngressClass(), catalog.getIngressClass(), "nginx")) .ingressTlsEnabled(getValue(request.getIngressTlsEnabled(), catalog.getIngressTlsEnabled(), false)) @@ -71,6 +73,38 @@ private static T getValue(T requestValue, T catalogValue, T defaultValue) { } return defaultValue; } + + private static String normalizeIngressHost(String host) { + if (host == null) { + return null; + } + + String normalized = host.trim(); + if (normalized.isEmpty()) { + return normalized; + } + + normalized = normalized.replaceFirst("^[a-zA-Z][a-zA-Z0-9+.-]*://", ""); + + int atIndex = normalized.lastIndexOf('@'); + if (atIndex >= 0) { + normalized = normalized.substring(atIndex + 1); + } + + for (char delimiter : new char[] {'/', '?', '#'}) { + int index = normalized.indexOf(delimiter); + if (index >= 0) { + normalized = normalized.substring(0, index); + } + } + + int colonIndex = normalized.indexOf(':'); + if (colonIndex >= 0 && normalized.indexOf(':', colonIndex + 1) < 0) { + normalized = normalized.substring(0, colonIndex); + } + + return normalized.trim().toLowerCase(Locale.ROOT); + } /** * HPA가 활성화되어 있는지 확인합니다. diff --git a/src/main/resources/static/assets/IconPlus-DRtzYi91.js b/src/main/resources/static/assets/IconPlus-CzjTfC0G.js similarity index 96% rename from src/main/resources/static/assets/IconPlus-DRtzYi91.js rename to src/main/resources/static/assets/IconPlus-CzjTfC0G.js index 40855dfa..5176bebe 100644 --- a/src/main/resources/static/assets/IconPlus-DRtzYi91.js +++ b/src/main/resources/static/assets/IconPlus-CzjTfC0G.js @@ -1,4 +1,4 @@ -import{L as l}from"./index-DpY2Dwv5.js";/** +import{L as l}from"./index-2RdC8Fmv.js";/** * @license @tabler/icons-vue v3.22.0 - MIT * * This source code is licensed under the MIT license. diff --git a/src/main/resources/static/assets/OssList-Dkx--ByD.js b/src/main/resources/static/assets/OssList-BdIqgjD3.js similarity index 96% rename from src/main/resources/static/assets/OssList-Dkx--ByD.js rename to src/main/resources/static/assets/OssList-BdIqgjD3.js index d9dfe77e..dc408bea 100644 --- a/src/main/resources/static/assets/OssList-Dkx--ByD.js +++ b/src/main/resources/static/assets/OssList-BdIqgjD3.js @@ -1,4 +1,4 @@ -import{M as q,_ as M}from"./bootstrap.esm-D2DynUsO.js";import{_ as G}from"./Tabulator.vue_vue_type_style_index_0_lang-Cy0Pje7A.js";import{s as f}from"./request-BI8njqPY.js";import{d as I,r as d,u as T,c as W,w as N,o as L,a as p,b as e,t as U,e as O,v as j,F as z,f as H,g as x,h as b,i as _}from"./index-DpY2Dwv5.js";import"./IconPlus-DRtzYi91.js";const J=()=>f.get("/ossType/list"),K=()=>f.get("/ossType/filter/list"),Q=()=>f.get("/oss/list");function X(l){return f.get(`/oss/duplicate?ossName=${l.ossName}&ossUrl=${l.ossUrl}&ossUsername=${l.ossUsername}`)}function Y(l){return f.post("/oss/connection-check",l)}function Z(l){return f.get("/oss/"+l)}function ss(l){return f.post("/oss",l)}function es(l){return f.patch(`/oss/${l.ossIdx}`,l)}function ts(l){return f.delete(`/oss/${l}`)}const os={class:"modal-dialog modal-xl",role:"document"},as={class:"modal-content"},ls={class:"modal-body text-left py-4"},ns={class:"mb-5"},rs={class:"mb-3"},is={class:"grid gap-0 column-gap-3"},ds=["value"],cs={class:"row mb-3"},us={class:"grid gap-0 column-gap-3"},ms={class:"mb-3"},vs={class:"mb-3"},ps={class:"row"},bs={class:"col"},fs={class:"col"},ys={class:"col mt-4 row"},gs={key:1,class:"btn btn-success col",style:{"margin-right":"3px"}},ws={key:3,class:"btn btn-success col"},Ss={class:"modal-footer"},Os=I({__name:"ossForm",props:{mode:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=d(),c=d(),o=T(),r=l,g=k,i=W(()=>r.ossIdx);N(i,async()=>{await y()}),N(()=>r.mode,async()=>{await v(r.mode)}),L(async()=>{m.value&&(c.value=new q(m.value)),await v("init"),await y()});const t=d({}),y=async()=>{if(r.mode==="new")t.value.ossTypeIdx=0,t.value.ossName="",t.value.ossDesc="",t.value.ossUrl="",t.value.ossUsername="",t.value.ossPassword="",u.value=!1,S.value=!1;else{const{data:a}=await Z(r.ossIdx);t.value=a,t.value.ossPassword=B(t.value.ossPassword),u.value=!0,S.value=!0}},C=d([]),v=async a=>{try{if(a==="new"||a==="init"){const{data:s}=await K();C.value=s}else{const{data:s}=await J();C.value=s}}catch(s){console.log(s)}},w=()=>{t.value.ossPassword="",S.value=!1},u=d(!1),h=async()=>{const a={ossName:t.value.ossName,ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername},{data:s}=await X(a);s?o.error("The name is already in use."):(o.success("The name is available."),u.value=!0)},S=d(!1),$=async()=>{const a={ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername,ossPassword:P(t.value.ossPassword),ossTypeIdx:t.value.ossTypeIdx},{data:s}=await Y(a);s?(o.success("The OSS is available."),S.value=!0):o.error("The OSS is unavailable.")},F=()=>{u.value=!1},D=()=>{S.value=!1},E=async()=>{if(!t.value.ossTypeIdx||t.value.ossTypeIdx===0){o.error("Please select OSS Type.");return}if(!t.value.ossName){o.error("Please enter OSS Name.");return}if(!t.value.ossDesc){o.error("Please enter OSS Description.");return}if(!t.value.ossUrl){o.error("Please enter URL.");return}if(!t.value.ossUsername){o.error("Please enter OSS ID.");return}if(!t.value.ossPassword){o.error("Please enter OSS Password.");return}if(!u.value){o.error("Please perform duplicate check.");return}if(!S.value){o.error("Please perform connection check.");return}t.value.ossPassword=P(t.value.ossPassword);let a=!1;r.mode==="new"?a=await R():a=await A(),a&&(g("get-oss-list"),y(),console.log(c.value),c.value&&(c.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const s=document.querySelector(".modal-backdrop");s==null||s.remove()},150)))},R=async()=>{try{const{data:a}=await ss(t.value);return a?(o.success("Regist SUCCESS."),!0):(o.error("Regist FAIL."),!1)}catch{return o.error("Regist FAIL."),!1}},A=async()=>{try{const{data:a}=await es(t.value);return a?(o.success("Update SUCCESS."),!0):(o.error("Update FAIL."),!1)}catch{return o.error("Update FAIL."),!1}},P=a=>btoa(a),B=a=>atob(a);return(a,s)=>(b(),p("div",{class:"modal fade",id:"ossForm",tabindex:"-1",ref_key:"modalElement",ref:m},[e("div",os,[e("div",as,[s[15]||(s[15]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),e("div",ls,[e("h3",ns,U(r.mode==="new"?"New":"Edit")+" OSS ",1),e("div",null,[e("div",rs,[s[9]||(s[9]=e("label",{class:"form-label required"},"OSS Type",-1)),e("div",is,[O(e("select",{"onUpdate:modelValue":s[0]||(s[0]=n=>t.value.ossTypeIdx=n),class:"form-select p-2 g-col-12"},[s[8]||(s[8]=e("option",{value:0},"Select OSS Type",-1)),(b(!0),p(z,null,H(C.value,(n,V)=>(b(),p("option",{value:n.ossTypeIdx,key:V},U(n.ossTypeName),9,ds))),128))],512),[[j,t.value.ossTypeIdx]])])]),e("div",cs,[s[10]||(s[10]=e("label",{class:"form-label required"},"OSS Name",-1)),e("div",us,[O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Name","onUpdate:modelValue":s[1]||(s[1]=n=>t.value.ossName=n),onChange:F},null,544),[[x,t.value.ossName]])])]),e("div",ms,[s[11]||(s[11]=e("label",{class:"form-label required"},"OSS Description",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Description","onUpdate:modelValue":s[2]||(s[2]=n=>t.value.ossDesc=n)},null,512),[[x,t.value.ossDesc]])]),e("div",vs,[s[12]||(s[12]=e("label",{class:"form-label required"},"URL",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the Server URL","onUpdate:modelValue":s[3]||(s[3]=n=>t.value.ossUrl=n),onFocus:D},null,544),[[x,t.value.ossUrl]])]),e("div",ps,[e("div",bs,[s[13]||(s[13]=e("label",{class:"form-label required"},"OSS ID",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the OSS ID","onUpdate:modelValue":s[4]||(s[4]=n=>t.value.ossUsername=n),onFocus:D},null,544),[[x,t.value.ossUsername]])]),e("div",fs,[s[14]||(s[14]=e("label",{class:"form-label required"},"OSS PW",-1)),O(e("input",{type:"password",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Password","onUpdate:modelValue":s[5]||(s[5]=n=>t.value.ossPassword=n),onClick:w,onFocus:D},null,544),[[x,t.value.ossPassword]])]),e("div",ys,[u.value?(b(),p("button",gs,"Duplicate Check")):(b(),p("button",{key:0,class:"btn btn-primary col",onClick:h,style:{"margin-right":"3px"}},"Duplicate Check")),S.value?(b(),p("button",ws,"Connection Check")):(b(),p("button",{key:2,class:"btn btn-primary col",onClick:$},"Connection Check"))])])])]),e("div",Ss,[e("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:s[6]||(s[6]=n=>y())}," Cancel "),e("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:s[7]||(s[7]=n=>E())},U(r.mode==="new"?"Regist":"Edit"),513)])])])],512))}}),ks={class:"modal fade",id:"deleteOss",tabindex:"-1"},Cs={class:"modal-dialog modal-lg",role:"document"},xs={class:"modal-content"},_s={class:"modal-body text-left py-4"},Us={class:"modal-footer"},hs=I({__name:"deleteOss",props:{ossName:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=T(),c=l,o=k,r=async()=>{const{data:g}=await ts(c.ossIdx);g?m.success("Deleted successfully."):m.error("Failed to delete."),o("get-oss-list")};return(g,i)=>(b(),p("div",ks,[e("div",Cs,[e("div",xs,[i[3]||(i[3]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),i[4]||(i[4]=e("div",{class:"modal-status bg-danger"},null,-1)),e("div",_s,[i[1]||(i[1]=e("h3",{class:"mb-5"}," Delete OSS ",-1)),e("h4",null,"Are you sure you want to delete "+U(c.ossName)+"?",1)]),e("div",Us,[i[2]||(i[2]=e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:i[0]||(i[0]=t=>r())}," Delete ")])])])]))}}),Ds={class:"card card-flush w-100"},Is={ref:"table-responsive"},Fs=I({__name:"OssList",setup(l){const k=T(),m=d([]),c=d([]);L(async()=>{i(),await o()});const o=async()=>{try{const{data:v}=await Q();m.value=v}catch(v){console.log(v),k.error("데이터를 가져올 수 없습니다.")}},r=d(0),g=d(""),i=()=>{c.value=[{title:"OSS Name",field:"ossName",width:400},{title:"OSS Desc",field:"ossDesc",width:500},{title:"URL",field:"ossUrl",width:600},{title:"Action",width:400,formatter:t,cellClick:function(v,w){const u=v.target,h=u==null?void 0:u.getAttribute("id");r.value=w.getRow().getData().ossIdx,h==="edit-btn"?y.value="edit":g.value=w.getRow().getData().ossName}}]},t=()=>` +import{M as q,_ as M}from"./bootstrap.esm-PUGawJZB.js";import{_ as G}from"./Tabulator.vue_vue_type_style_index_0_lang-By7I3DHo.js";import{s as f}from"./request-DXU_IEYq.js";import{d as I,r as d,u as T,c as W,w as N,o as L,a as p,b as e,t as U,e as O,v as j,F as z,f as H,g as x,h as b,i as _}from"./index-2RdC8Fmv.js";import"./IconPlus-CzjTfC0G.js";const J=()=>f.get("/ossType/list"),K=()=>f.get("/ossType/filter/list"),Q=()=>f.get("/oss/list");function X(l){return f.get(`/oss/duplicate?ossName=${l.ossName}&ossUrl=${l.ossUrl}&ossUsername=${l.ossUsername}`)}function Y(l){return f.post("/oss/connection-check",l)}function Z(l){return f.get("/oss/"+l)}function ss(l){return f.post("/oss",l)}function es(l){return f.patch(`/oss/${l.ossIdx}`,l)}function ts(l){return f.delete(`/oss/${l}`)}const os={class:"modal-dialog modal-xl",role:"document"},as={class:"modal-content"},ls={class:"modal-body text-left py-4"},ns={class:"mb-5"},rs={class:"mb-3"},is={class:"grid gap-0 column-gap-3"},ds=["value"],cs={class:"row mb-3"},us={class:"grid gap-0 column-gap-3"},ms={class:"mb-3"},vs={class:"mb-3"},ps={class:"row"},bs={class:"col"},fs={class:"col"},ys={class:"col mt-4 row"},gs={key:1,class:"btn btn-success col",style:{"margin-right":"3px"}},ws={key:3,class:"btn btn-success col"},Ss={class:"modal-footer"},Os=I({__name:"ossForm",props:{mode:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=d(),c=d(),o=T(),r=l,g=k,i=W(()=>r.ossIdx);N(i,async()=>{await y()}),N(()=>r.mode,async()=>{await v(r.mode)}),L(async()=>{m.value&&(c.value=new q(m.value)),await v("init"),await y()});const t=d({}),y=async()=>{if(r.mode==="new")t.value.ossTypeIdx=0,t.value.ossName="",t.value.ossDesc="",t.value.ossUrl="",t.value.ossUsername="",t.value.ossPassword="",u.value=!1,S.value=!1;else{const{data:a}=await Z(r.ossIdx);t.value=a,t.value.ossPassword=B(t.value.ossPassword),u.value=!0,S.value=!0}},C=d([]),v=async a=>{try{if(a==="new"||a==="init"){const{data:s}=await K();C.value=s}else{const{data:s}=await J();C.value=s}}catch(s){console.log(s)}},w=()=>{t.value.ossPassword="",S.value=!1},u=d(!1),h=async()=>{const a={ossName:t.value.ossName,ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername},{data:s}=await X(a);s?o.error("The name is already in use."):(o.success("The name is available."),u.value=!0)},S=d(!1),$=async()=>{const a={ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername,ossPassword:P(t.value.ossPassword),ossTypeIdx:t.value.ossTypeIdx},{data:s}=await Y(a);s?(o.success("The OSS is available."),S.value=!0):o.error("The OSS is unavailable.")},F=()=>{u.value=!1},D=()=>{S.value=!1},E=async()=>{if(!t.value.ossTypeIdx||t.value.ossTypeIdx===0){o.error("Please select OSS Type.");return}if(!t.value.ossName){o.error("Please enter OSS Name.");return}if(!t.value.ossDesc){o.error("Please enter OSS Description.");return}if(!t.value.ossUrl){o.error("Please enter URL.");return}if(!t.value.ossUsername){o.error("Please enter OSS ID.");return}if(!t.value.ossPassword){o.error("Please enter OSS Password.");return}if(!u.value){o.error("Please perform duplicate check.");return}if(!S.value){o.error("Please perform connection check.");return}t.value.ossPassword=P(t.value.ossPassword);let a=!1;r.mode==="new"?a=await R():a=await A(),a&&(g("get-oss-list"),y(),console.log(c.value),c.value&&(c.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const s=document.querySelector(".modal-backdrop");s==null||s.remove()},150)))},R=async()=>{try{const{data:a}=await ss(t.value);return a?(o.success("Regist SUCCESS."),!0):(o.error("Regist FAIL."),!1)}catch{return o.error("Regist FAIL."),!1}},A=async()=>{try{const{data:a}=await es(t.value);return a?(o.success("Update SUCCESS."),!0):(o.error("Update FAIL."),!1)}catch{return o.error("Update FAIL."),!1}},P=a=>btoa(a),B=a=>atob(a);return(a,s)=>(b(),p("div",{class:"modal fade",id:"ossForm",tabindex:"-1",ref_key:"modalElement",ref:m},[e("div",os,[e("div",as,[s[15]||(s[15]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),e("div",ls,[e("h3",ns,U(r.mode==="new"?"New":"Edit")+" OSS ",1),e("div",null,[e("div",rs,[s[9]||(s[9]=e("label",{class:"form-label required"},"OSS Type",-1)),e("div",is,[O(e("select",{"onUpdate:modelValue":s[0]||(s[0]=n=>t.value.ossTypeIdx=n),class:"form-select p-2 g-col-12"},[s[8]||(s[8]=e("option",{value:0},"Select OSS Type",-1)),(b(!0),p(z,null,H(C.value,(n,V)=>(b(),p("option",{value:n.ossTypeIdx,key:V},U(n.ossTypeName),9,ds))),128))],512),[[j,t.value.ossTypeIdx]])])]),e("div",cs,[s[10]||(s[10]=e("label",{class:"form-label required"},"OSS Name",-1)),e("div",us,[O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Name","onUpdate:modelValue":s[1]||(s[1]=n=>t.value.ossName=n),onChange:F},null,544),[[x,t.value.ossName]])])]),e("div",ms,[s[11]||(s[11]=e("label",{class:"form-label required"},"OSS Description",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Description","onUpdate:modelValue":s[2]||(s[2]=n=>t.value.ossDesc=n)},null,512),[[x,t.value.ossDesc]])]),e("div",vs,[s[12]||(s[12]=e("label",{class:"form-label required"},"URL",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the Server URL","onUpdate:modelValue":s[3]||(s[3]=n=>t.value.ossUrl=n),onFocus:D},null,544),[[x,t.value.ossUrl]])]),e("div",ps,[e("div",bs,[s[13]||(s[13]=e("label",{class:"form-label required"},"OSS ID",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the OSS ID","onUpdate:modelValue":s[4]||(s[4]=n=>t.value.ossUsername=n),onFocus:D},null,544),[[x,t.value.ossUsername]])]),e("div",fs,[s[14]||(s[14]=e("label",{class:"form-label required"},"OSS PW",-1)),O(e("input",{type:"password",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Password","onUpdate:modelValue":s[5]||(s[5]=n=>t.value.ossPassword=n),onClick:w,onFocus:D},null,544),[[x,t.value.ossPassword]])]),e("div",ys,[u.value?(b(),p("button",gs,"Duplicate Check")):(b(),p("button",{key:0,class:"btn btn-primary col",onClick:h,style:{"margin-right":"3px"}},"Duplicate Check")),S.value?(b(),p("button",ws,"Connection Check")):(b(),p("button",{key:2,class:"btn btn-primary col",onClick:$},"Connection Check"))])])])]),e("div",Ss,[e("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:s[6]||(s[6]=n=>y())}," Cancel "),e("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:s[7]||(s[7]=n=>E())},U(r.mode==="new"?"Regist":"Edit"),513)])])])],512))}}),ks={class:"modal fade",id:"deleteOss",tabindex:"-1"},Cs={class:"modal-dialog modal-lg",role:"document"},xs={class:"modal-content"},_s={class:"modal-body text-left py-4"},Us={class:"modal-footer"},hs=I({__name:"deleteOss",props:{ossName:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=T(),c=l,o=k,r=async()=>{const{data:g}=await ts(c.ossIdx);g?m.success("Deleted successfully."):m.error("Failed to delete."),o("get-oss-list")};return(g,i)=>(b(),p("div",ks,[e("div",Cs,[e("div",xs,[i[3]||(i[3]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),i[4]||(i[4]=e("div",{class:"modal-status bg-danger"},null,-1)),e("div",_s,[i[1]||(i[1]=e("h3",{class:"mb-5"}," Delete OSS ",-1)),e("h4",null,"Are you sure you want to delete "+U(c.ossName)+"?",1)]),e("div",Us,[i[2]||(i[2]=e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:i[0]||(i[0]=t=>r())}," Delete ")])])])]))}}),Ds={class:"card card-flush w-100"},Is={ref:"table-responsive"},Fs=I({__name:"OssList",setup(l){const k=T(),m=d([]),c=d([]);L(async()=>{i(),await o()});const o=async()=>{try{const{data:v}=await Q();m.value=v}catch(v){console.log(v),k.error("데이터를 가져올 수 없습니다.")}},r=d(0),g=d(""),i=()=>{c.value=[{title:"OSS Name",field:"ossName",width:400},{title:"OSS Desc",field:"ossDesc",width:500},{title:"URL",field:"ossUrl",width:600},{title:"Action",width:400,formatter:t,cellClick:function(v,w){const u=v.target,h=u==null?void 0:u.getAttribute("id");r.value=w.getRow().getData().ossIdx,h==="edit-btn"?y.value="edit":g.value=w.getRow().getData().ossName}}]},t=()=>`
+
+ + +

+ {{ storageClassErrorMessage }} +

+
+
@@ -434,7 +455,8 @@ class="form-check-input" type="checkbox" id="objectStorageEnabled" - v-model="objectStorageData.enabled"> + v-model="objectStorageData.enabled" + :disabled="objectStorageRequired"> @@ -519,7 +541,7 @@ v-if="modalTitle == 'Application Installation' && shouldRunObjectStorageCheck" class="btn btn-outline-danger ms-auto me-1" @click="runObjectStorageCheck()" - :disabled="objectStorageChecking" + :disabled="objectStorageChecking || objectStorageCheckPassed" title="Writes, reads, and deletes a temporary object in the selected bucket."> {{ objectStorageChecking ? 'Checking...' : 'Storage Check' }} @@ -551,7 +573,7 @@ import { onMounted, watch, computed } from 'vue'; // @ts-ignore import _, { slice } from 'lodash'; import { getNsInfo, getMciInfo, getVmInfo, getClusterInfo } from '@/api/tumblebug' -import { getSoftwareCatalogList, k8sSpecCheck, objectStorageSmokeCheck, runK8SInstall, runAction, runVmInstall, vmSpecCheck } from '@/api/softwareCatalog' +import { getK8sStorageClasses, getSoftwareCatalogList, k8sSpecCheck, objectStorageSmokeCheck, runK8SInstall, runAction, runVmInstall, vmSpecCheck } from '@/api/softwareCatalog' import { type SoftwareCatalog } from '@/views/type/type' import { useUserStore } from '@/stores/user' @@ -584,6 +606,10 @@ const objectStorageData = ref({} as any) const objectStorageCheckResult = ref(null as any) const objectStorageChecking = ref(false as boolean) const selectedResourceType = ref("GENERAL_PURPOSE" as string) +const storageClassList = ref([] as any[]) +const selectedStorageClass = ref("" as string) +const storageClassLoading = ref(false as boolean) +const storageClassLoadError = ref(false as boolean) const clusterList = ref([] as any) const selectCluster = ref("" as string) @@ -626,6 +652,10 @@ watch(objectStorageData, () => { objectStorageCheckResult.value = null }, { deep: true }) +watch(selectedStorageClass, () => { + onChangeForm() +}) + // Handle deployment type changes watch(selectDeploymentType, () => { if (selectDeploymentType.value === "Standalone") { @@ -676,6 +706,10 @@ const setInit = async () => { objectStorageData.value = getDefaultObjectStorageData() objectStorageCheckResult.value = null objectStorageChecking.value = false + storageClassList.value = [] + selectedStorageClass.value = "" + storageClassLoading.value = false + storageClassLoadError.value = false selectedResourceType.value = "GENERAL_PURPOSE" inputServicePort.value = "" @@ -808,6 +842,37 @@ const _getClusterName = async () => { objectStorageData.value = getDefaultObjectStorageData() objectStorageCheckResult.value = null }) + await fetchStorageClasses() +} + +const fetchStorageClasses = async () => { + storageClassList.value = [] + selectedStorageClass.value = "" + storageClassLoadError.value = false + + if (selectInfra.value !== 'K8S' || _.isEmpty(selectNsId.value) || _.isEmpty(selectCluster.value)) { + return + } + + storageClassLoading.value = true + try { + const { data } = await getK8sStorageClasses({ + namespace: selectNsId.value, + clusterName: selectCluster.value + }) + storageClassList.value = Array.isArray(data) ? data : [] + selectedStorageClass.value = getInitialStorageClass(storageClassList.value) + } catch (error) { + storageClassLoadError.value = true + selectedStorageClass.value = "" + } finally { + storageClassLoading.value = false + } +} + +const getInitialStorageClass = (items: any[]) => { + const defaultClass = items.find((item: any) => item.defaultClass) + return defaultClass?.name || items[0]?.name || "" } const onChangeNsId = async () => { @@ -917,12 +982,12 @@ const runInstall = async () => { } else if (selectInfra.value === 'K8S') { + if (!validateStorageClassSelection()) return + // History: The initial design has changed, currently only sending 1 Application (previously it could receive multiple apps) appList = inputApplications.value.split(",").map(item => item.toLowerCase().trim()); const servicePort = inputServicePort.value === "" ? undefined : Number(inputServicePort.value); - const additionalConfig = showObjectStorageConfig.value && objectStorageData.value.enabled - ? { objectStorage: buildObjectStorageConfig() } - : undefined + const additionalConfig = buildK8sAdditionalConfig() let params = { namespace: selectNsId.value, clusterName: selectCluster.value, @@ -964,6 +1029,7 @@ const specCheck = async () => { toast.error("Please Select Infra") return } + if (!validateStorageClassSelection()) return const checkedValue = await specCheckCallback() let data = true; @@ -1045,6 +1111,42 @@ const selectedClusterProvider = computed(() => { return cluster?.connectionConfig?.providerName || cluster?.connectionName || '' }) +const selectedCatalogChartName = computed(() => { + return String(selectedCatalogInfo.value?.helmChart?.chartName || '').toLowerCase() +}) + +const isLokiCatalog = computed(() => selectedCatalogChartName.value === 'loki') + +const storageClassRequired = computed(() => { + return selectInfra.value === 'K8S' && isLokiCatalog.value +}) + +const showStorageClassConfig = computed(() => { + return selectInfra.value === 'K8S' + && modalTitle.value === 'Application Installation' + && (storageClassRequired.value || storageClassList.value.length > 0 || storageClassLoadError.value) +}) + +const storageClassSelectDisabled = computed(() => { + return storageClassLoading.value || storageClassList.value.length <= 1 +}) + +const storageClassPlaceholder = computed(() => { + if (storageClassLoading.value) return 'Loading StorageClasses...' + if (storageClassLoadError.value) return 'Failed to load StorageClasses' + if (storageClassList.value.length === 0) return 'No StorageClass found' + return 'Select StorageClass' +}) + +const storageClassErrorMessage = computed(() => { + if (!storageClassRequired.value) return '' + if (storageClassLoading.value) return 'StorageClass list is loading.' + if (storageClassLoadError.value) return 'StorageClass list could not be loaded.' + if (storageClassList.value.length === 0) return 'Loki requires a StorageClass, but none was found.' + if (_.isEmpty(selectedStorageClass.value)) return 'Loki requires a StorageClass.' + return '' +}) + const objectStorageEndpointPlaceholder = computed(() => { return isAwsProvider(selectedClusterProvider.value) ? 'Optional: https://s3.ap-northeast-2.amazonaws.com' @@ -1060,7 +1162,7 @@ const objectStorageRegionPlaceholder = computed(() => { const showObjectStorageConfig = computed(() => { if (selectInfra.value !== 'K8S') return false if (!selectedCatalogInfo.value?.helmChart) return false - return hasObjectStorageCapability(selectedCatalogInfo.value) + return isLokiCatalog.value || hasObjectStorageCapability(selectedCatalogInfo.value) }) const shouldRunObjectStorageCheck = computed(() => { @@ -1072,14 +1174,14 @@ const objectStorageCheckPassed = computed(() => { }) const deployDisabled = computed(() => { - return specCheckFlag.value || !objectStorageCheckPassed.value + return specCheckFlag.value || !objectStorageCheckPassed.value || (storageClassRequired.value && !_.isEmpty(storageClassErrorMessage.value)) }) -function getDefaultObjectStorageData(provider = selectedClusterProvider.value) { +function getDefaultObjectStorageData(provider = selectedClusterProvider.value, enabled = objectStorageRequired.value) { const isAws = isAwsProvider(provider) return { - enabled: false, + enabled: Boolean(enabled), backendType: 's3', endpoint: '', region: '', @@ -1094,6 +1196,10 @@ function isAwsProvider(provider: string) { return String(provider || '').toLowerCase().includes('aws') } +const objectStorageRequired = computed(() => { + return selectInfra.value === 'K8S' && isLokiCatalog.value +}) + function hasObjectStorageCapability(catalog: SoftwareCatalog) { const refs = catalog.catalogRefs || [] return refs.some((ref: any) => { @@ -1117,6 +1223,28 @@ function buildObjectStorageConfig() { } } +function buildK8sAdditionalConfig() { + const config = {} as Record + if (!_.isEmpty(selectedStorageClass.value)) { + config.storageClass = selectedStorageClass.value + } + if (showObjectStorageConfig.value && objectStorageData.value.enabled) { + config.objectStorage = buildObjectStorageConfig() + } + return Object.keys(config).length > 0 ? config : undefined +} + +function validateStorageClassSelection() { + if (!storageClassRequired.value) return true + + const message = storageClassErrorMessage.value + if (!_.isEmpty(message)) { + toast.error(message) + return false + } + return true +} + function isHttpEndpoint(endpoint: string) { return String(endpoint || '').trim().toLowerCase().startsWith('http://') } @@ -1192,10 +1320,11 @@ const onChangeCatalog = () => { }) } -const onChangeCluster = () => { +const onChangeCluster = async () => { if(modalTitle.value === 'Application Installation') specCheckFlag.value = true objectStorageData.value = getDefaultObjectStorageData() objectStorageCheckResult.value = null + await fetchStorageClasses() } diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/controller/ApplicationController.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/controller/ApplicationController.java index e1bbf694..1036b4c2 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/application/controller/ApplicationController.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/controller/ApplicationController.java @@ -21,6 +21,7 @@ import kr.co.mcmp.softwarecatalog.application.dto.DeploymentHistoryDTO; import kr.co.mcmp.softwarecatalog.application.dto.DeploymentLogDTO; import kr.co.mcmp.softwarecatalog.application.dto.IntegratedApplicationInfoDTO; +import kr.co.mcmp.softwarecatalog.application.dto.K8sStorageClassDTO; import kr.co.mcmp.softwarecatalog.application.dto.ObjectStorageSmokeTestRequest; import kr.co.mcmp.softwarecatalog.application.dto.ObjectStorageSmokeTestResponse; import kr.co.mcmp.softwarecatalog.application.model.DeploymentHistory; @@ -30,6 +31,7 @@ import kr.co.mcmp.softwarecatalog.application.dto.DeploymentRequest; import kr.co.mcmp.softwarecatalog.application.dto.DeploymentRequestDTO; import kr.co.mcmp.softwarecatalog.application.constants.DeploymentType; +import kr.co.mcmp.softwarecatalog.kubernetes.service.KubernetesStorageClassService; import org.springframework.web.bind.annotation.PathVariable; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -44,6 +46,7 @@ public class ApplicationController { private final ApplicationService applicationService; private final ApplicationOrchestrationService applicationOrchestrationService; private final ObjectStorageSmokeTestService objectStorageSmokeTestService; + private final KubernetesStorageClassService kubernetesStorageClassService; @Operation(summary = "Deploy application to VM", description = "Deploy an application to a specific VM.") @PostMapping("/vm/deploy") @@ -101,6 +104,15 @@ public ResponseEntity> checkObje return ResponseEntity.ok(new ResponseWrapper<>(result)); } + @Operation(summary = "List K8s StorageClasses", description = "Retrieve StorageClasses from the selected K8s cluster.") + @GetMapping("/k8s/storage-classes") + public ResponseEntity>> getK8sStorageClasses( + @Parameter(description = "Namespace used to locate the K8s cluster", required = true) @RequestParam String namespace, + @Parameter(description = "Kubernetes cluster name", required = true) @RequestParam String clusterName) { + List result = kubernetesStorageClassService.getStorageClasses(namespace, clusterName); + return ResponseEntity.ok(new ResponseWrapper<>(result)); + } + @Operation(summary = "Get deployment history", description = "Retrieve deployment history for a specific catalog ID.") @GetMapping("/history") public ResponseEntity>> getDeploymentHistories( diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/K8sStorageClassDTO.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/K8sStorageClassDTO.java new file mode 100644 index 00000000..7972d148 --- /dev/null +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/K8sStorageClassDTO.java @@ -0,0 +1,18 @@ +package kr.co.mcmp.softwarecatalog.application.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class K8sStorageClassDTO { + private String name; + private String provisioner; + private Boolean defaultClass; + private String reclaimPolicy; + private String volumeBindingMode; +} diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationOrchestrationServiceImpl.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationOrchestrationServiceImpl.java index 0e908630..c3f6e8d9 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationOrchestrationServiceImpl.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationOrchestrationServiceImpl.java @@ -120,7 +120,8 @@ public List getApplicationGroups() { .map(this::toStatusDto); }) .sorted(Comparator - .comparing(ApplicationStatusDto::getDeploymentHistoryId, Comparator.nullsLast(Comparator.reverseOrder())) + .comparing(ApplicationStatusDto::getCheckedAt, Comparator.nullsLast(Comparator.reverseOrder())) + .thenComparing(ApplicationStatusDto::getDeploymentHistoryId, Comparator.nullsLast(Comparator.reverseOrder())) .thenComparing(ApplicationStatusDto::getId, Comparator.nullsLast(Comparator.reverseOrder()))) .collect(Collectors.toList()); } diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java index 612707c7..af1a59a9 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java @@ -18,6 +18,7 @@ import io.fabric8.kubernetes.client.dsl.base.ResourceDefinitionContext; import kr.co.mcmp.ape.cbtumblebug.api.CbtumblebugRestApi; import kr.co.mcmp.ape.cbtumblebug.dto.K8sClusterDto; +import kr.co.mcmp.softwarecatalog.CatalogRepository; import kr.co.mcmp.softwarecatalog.SoftwareCatalog; import kr.co.mcmp.softwarecatalog.kubernetes.config.KubeConfigProviderFactory; import kr.co.mcmp.softwarecatalog.kubernetes.config.KubeConfigProvider; @@ -47,6 +48,8 @@ public class HelmChartService { private final CbtumblebugRestApi cbtumblebugRestApi; private final KubeConfigProviderFactory providerFactory; private final ReleaseNameGenerator releaseNameGenerator; + private final CatalogRepository catalogRepository; + private final KubernetesStorageClassService kubernetesStorageClassService; public Release deployHelmChart(KubernetesClient client, String namespace, SoftwareCatalog catalog, String clusterName) { return deployHelmChart(client, namespace, catalog, catalog.getHelmChart(), clusterName); @@ -131,13 +134,16 @@ public Release deployHelmChart(KubernetesClient client, String namespace, Softwa values.put("securityContext.runAsNonRoot", "false"); values.put("containerSecurityContext.allowPrivilegeEscalation", "false"); values.put("global.security.allowInsecureImages", "true"); - values.put("global.imageRegistry", "docker.io"); + boolean lokiChart = helmChart.getChartName().equalsIgnoreCase("loki"); + if (!lokiChart) { + values.put("global.imageRegistry", "docker.io"); + } if (helmChart.getChartName().equalsIgnoreCase("grafana")) { values.put("image.repository", "grafana/grafana"); values.put("image.tag", "latest"); values.put("image.pullPolicy", "IfNotPresent"); - } else { + } else if (!lokiChart) { values.put("image.repository", imageRepository); values.put("image.tag", "latest"); values.put("image.pullPolicy", "IfNotPresent"); @@ -313,13 +319,16 @@ public Release deployHelmChartWithRequest(KubernetesClient client, String namesp values.put("securityContext.runAsNonRoot", "false"); values.put("containerSecurityContext.allowPrivilegeEscalation", "false"); values.put("global.security.allowInsecureImages", "true"); - values.put("global.imageRegistry", "docker.io"); + boolean lokiChart = helmChart.getChartName().equalsIgnoreCase("loki"); + if (!lokiChart) { + values.put("global.imageRegistry", "docker.io"); + } if (helmChart.getChartName().equalsIgnoreCase("grafana")) { values.put("image.repository", "grafana/grafana"); values.put("image.tag", "latest"); values.put("image.pullPolicy", "IfNotPresent"); - } else { + } else if (!lokiChart) { values.put("image.repository", imageRepository); values.put("image.tag", "latest"); values.put("image.pullPolicy", "IfNotPresent"); @@ -935,17 +944,17 @@ private void applyObjectStorageValues(SoftwareCatalog catalog, if (!StringUtils.equalsIgnoreCase(chartName, "loki")) { return; } - if (!hasObjectStorageCapability(catalog) || request == null || request.getAdditionalConfig() == null) { - return; + if (request == null || request.getAdditionalConfig() == null) { + throw new IllegalArgumentException("Object Storage configuration is required for Loki deployment."); } Object rawConfig = request.getAdditionalConfig().get("objectStorage"); if (!(rawConfig instanceof Map objectStorage)) { - return; + throw new IllegalArgumentException("Object Storage configuration is required for Loki deployment."); } if (!asBoolean(objectStorage.get("enabled"))) { - return; + throw new IllegalArgumentException("Object Storage configuration is required for Loki deployment."); } String backendType = stringValue(objectStorage.get("backendType"), "s3"); @@ -963,13 +972,20 @@ private void applyObjectStorageValues(SoftwareCatalog catalog, boolean insecure = isHttpEndpoint(endpoint); if (StringUtils.isAnyBlank(region, bucket, accessKey, secretKey)) { - log.warn("Object Storage config skipped because required S3-compatible fields are missing. provider={}", providerName); - return; + throw new IllegalArgumentException("Object Storage region, bucket, access key, and secret key are required for Loki deployment."); } if (!isAwsProvider(providerName) && StringUtils.isBlank(endpoint)) { - log.warn("Object Storage config skipped because endpoint is required for non-AWS S3-compatible storage. provider={}", providerName); - return; + throw new IllegalArgumentException("Object Storage endpoint is required for non-AWS S3-compatible Loki deployment."); + } + + String storageClassName = stringValue(request.getAdditionalConfig().get("storageClass"), null); + if (StringUtils.isBlank(storageClassName)) { + throw new IllegalArgumentException("Storage Class is required for Loki deployment."); + } + if (!kubernetesStorageClassService.exists(request.getNamespace(), request.getClusterName(), storageClassName)) { + throw new IllegalArgumentException("Storage Class not found in the selected cluster: " + storageClassName); } + Map loki = nestedMap(valuesFile, "loki"); loki.put("configStorageType", "Secret"); applyDefaultLokiSchemaConfig(loki); @@ -995,9 +1011,53 @@ private void applyObjectStorageValues(SoftwareCatalog catalog, Map minio = nestedMap(valuesFile, "minio"); minio.put("enabled", false); + applyLokiObjectStorageRuntimeDefaults(valuesFile, storageClassName, catalog); + log.info("Object Storage Helm values prepared for provider={}, backend=s3-compatible, bucketNames configured", providerName); } + private void applyLokiObjectStorageRuntimeDefaults(Map valuesFile, String storageClassName, SoftwareCatalog catalog) { + nestedMap(valuesFile, "gateway").put("verboseLogging", false); + nestedMap(valuesFile, "chunksCache").put("enabled", false); + nestedMap(valuesFile, "resultsCache").put("enabled", false); + nestedMap(valuesFile, "lokiCanary").put("enabled", false); + nestedMap(valuesFile, "test").put("enabled", false); + + Map singleBinary = nestedMap(valuesFile, "singleBinary"); + Map persistence = nestedMap(singleBinary, "persistence"); + persistence.put("enabled", true); + persistence.put("storageClass", storageClassName); + applyLokiResourceValues(singleBinary, catalog); + + Map gateway = nestedMap(valuesFile, "gateway"); + applyLokiResourceValues(gateway, catalog); + } + + private void applyLokiResourceValues(Map component, SoftwareCatalog catalog) { + if (catalog == null) { + return; + } + + Map resources = nestedMap(component, "resources"); + Map requests = nestedMap(resources, "requests"); + Map limits = nestedMap(resources, "limits"); + + if (catalog.getMinCpu() != null) { + requests.put("cpu", catalog.getMinCpu().toString()); + } + String minMemory = formatMemoryMi(catalog.getMinMemory()); + if (StringUtils.isNotBlank(minMemory)) { + requests.put("memory", minMemory); + } + if (catalog.getRecommendedCpu() != null) { + limits.put("cpu", catalog.getRecommendedCpu().toString()); + } + String recommendedMemory = formatMemoryMi(catalog.getRecommendedMemory()); + if (StringUtils.isNotBlank(recommendedMemory)) { + limits.put("memory", recommendedMemory); + } + } + private void applyDefaultLokiSchemaConfig(Map loki) { Object existingSchemaConfig = loki.get("schemaConfig"); if (existingSchemaConfig instanceof Map existingSchemaMap && !existingSchemaMap.isEmpty()) { @@ -1021,10 +1081,16 @@ private void applyDefaultLokiSchemaConfig(Map loki) { } private boolean hasObjectStorageCapability(SoftwareCatalog catalog) { - if (catalog == null || catalog.getCatalogRefs() == null) { + if (catalog == null || catalog.getId() == null) { return false; } - return catalog.getCatalogRefs().stream().anyMatch(ref -> + + SoftwareCatalog catalogWithRefs = catalogRepository.findByIdWithCatalogRefs(catalog.getId()).orElse(catalog); + if (catalogWithRefs.getCatalogRefs() == null) { + return false; + } + + return catalogWithRefs.getCatalogRefs().stream().anyMatch(ref -> "object-storage".equalsIgnoreCase(ref.getRefValue()) && ("CAPABILITY".equalsIgnoreCase(ref.getRefType()) || "TAG".equalsIgnoreCase(ref.getRefType()))); } diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesStorageClassService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesStorageClassService.java new file mode 100644 index 00000000..b3531883 --- /dev/null +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesStorageClassService.java @@ -0,0 +1,64 @@ +package kr.co.mcmp.softwarecatalog.kubernetes.service; + +import java.util.Comparator; +import java.util.List; +import java.util.Map; + +import org.springframework.stereotype.Service; + +import io.fabric8.kubernetes.api.model.storage.StorageClass; +import io.fabric8.kubernetes.client.KubernetesClient; +import kr.co.mcmp.softwarecatalog.application.dto.K8sStorageClassDTO; +import kr.co.mcmp.softwarecatalog.kubernetes.config.KubernetesClientFactory; +import lombok.RequiredArgsConstructor; + +@Service +@RequiredArgsConstructor +public class KubernetesStorageClassService { + + private static final String DEFAULT_CLASS_ANNOTATION = "storageclass.kubernetes.io/is-default-class"; + private static final String BETA_DEFAULT_CLASS_ANNOTATION = "storageclass.beta.kubernetes.io/is-default-class"; + + private final KubernetesClientFactory kubernetesClientFactory; + + public List getStorageClasses(String namespace, String clusterName) { + try (KubernetesClient client = kubernetesClientFactory.getClient(namespace, clusterName)) { + return client.storage().v1().storageClasses().list().getItems().stream() + .map(this::toDto) + .sorted(Comparator + .comparing(K8sStorageClassDTO::getDefaultClass, Comparator.nullsLast(Comparator.reverseOrder())) + .thenComparing(K8sStorageClassDTO::getName, Comparator.nullsLast(String::compareToIgnoreCase))) + .toList(); + } + } + + public boolean exists(String namespace, String clusterName, String storageClassName) { + if (storageClassName == null || storageClassName.isBlank()) { + return false; + } + return getStorageClasses(namespace, clusterName).stream() + .anyMatch(storageClass -> storageClassName.equals(storageClass.getName())); + } + + private K8sStorageClassDTO toDto(StorageClass storageClass) { + return K8sStorageClassDTO.builder() + .name(storageClass.getMetadata() != null ? storageClass.getMetadata().getName() : null) + .provisioner(storageClass.getProvisioner()) + .defaultClass(isDefault(storageClass)) + .reclaimPolicy(storageClass.getReclaimPolicy()) + .volumeBindingMode(storageClass.getVolumeBindingMode()) + .build(); + } + + private boolean isDefault(StorageClass storageClass) { + if (storageClass.getMetadata() == null) { + return false; + } + Map annotations = storageClass.getMetadata().getAnnotations(); + if (annotations == null || annotations.isEmpty()) { + return false; + } + return Boolean.parseBoolean(annotations.get(DEFAULT_CLASS_ANNOTATION)) + || Boolean.parseBoolean(annotations.get(BETA_DEFAULT_CLASS_ANNOTATION)); + } +} diff --git a/src/main/resources/static/assets/IconPlus-CzjTfC0G.js b/src/main/resources/static/assets/IconPlus-o3un4-BS.js similarity index 96% rename from src/main/resources/static/assets/IconPlus-CzjTfC0G.js rename to src/main/resources/static/assets/IconPlus-o3un4-BS.js index 5176bebe..7188c4cf 100644 --- a/src/main/resources/static/assets/IconPlus-CzjTfC0G.js +++ b/src/main/resources/static/assets/IconPlus-o3un4-BS.js @@ -1,4 +1,4 @@ -import{L as l}from"./index-2RdC8Fmv.js";/** +import{L as l}from"./index-DgPLCZcu.js";/** * @license @tabler/icons-vue v3.22.0 - MIT * * This source code is licensed under the MIT license. diff --git a/src/main/resources/static/assets/OssList-BdIqgjD3.js b/src/main/resources/static/assets/OssList-NTlcIZPq.js similarity index 96% rename from src/main/resources/static/assets/OssList-BdIqgjD3.js rename to src/main/resources/static/assets/OssList-NTlcIZPq.js index dc408bea..f8100d40 100644 --- a/src/main/resources/static/assets/OssList-BdIqgjD3.js +++ b/src/main/resources/static/assets/OssList-NTlcIZPq.js @@ -1,4 +1,4 @@ -import{M as q,_ as M}from"./bootstrap.esm-PUGawJZB.js";import{_ as G}from"./Tabulator.vue_vue_type_style_index_0_lang-By7I3DHo.js";import{s as f}from"./request-DXU_IEYq.js";import{d as I,r as d,u as T,c as W,w as N,o as L,a as p,b as e,t as U,e as O,v as j,F as z,f as H,g as x,h as b,i as _}from"./index-2RdC8Fmv.js";import"./IconPlus-CzjTfC0G.js";const J=()=>f.get("/ossType/list"),K=()=>f.get("/ossType/filter/list"),Q=()=>f.get("/oss/list");function X(l){return f.get(`/oss/duplicate?ossName=${l.ossName}&ossUrl=${l.ossUrl}&ossUsername=${l.ossUsername}`)}function Y(l){return f.post("/oss/connection-check",l)}function Z(l){return f.get("/oss/"+l)}function ss(l){return f.post("/oss",l)}function es(l){return f.patch(`/oss/${l.ossIdx}`,l)}function ts(l){return f.delete(`/oss/${l}`)}const os={class:"modal-dialog modal-xl",role:"document"},as={class:"modal-content"},ls={class:"modal-body text-left py-4"},ns={class:"mb-5"},rs={class:"mb-3"},is={class:"grid gap-0 column-gap-3"},ds=["value"],cs={class:"row mb-3"},us={class:"grid gap-0 column-gap-3"},ms={class:"mb-3"},vs={class:"mb-3"},ps={class:"row"},bs={class:"col"},fs={class:"col"},ys={class:"col mt-4 row"},gs={key:1,class:"btn btn-success col",style:{"margin-right":"3px"}},ws={key:3,class:"btn btn-success col"},Ss={class:"modal-footer"},Os=I({__name:"ossForm",props:{mode:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=d(),c=d(),o=T(),r=l,g=k,i=W(()=>r.ossIdx);N(i,async()=>{await y()}),N(()=>r.mode,async()=>{await v(r.mode)}),L(async()=>{m.value&&(c.value=new q(m.value)),await v("init"),await y()});const t=d({}),y=async()=>{if(r.mode==="new")t.value.ossTypeIdx=0,t.value.ossName="",t.value.ossDesc="",t.value.ossUrl="",t.value.ossUsername="",t.value.ossPassword="",u.value=!1,S.value=!1;else{const{data:a}=await Z(r.ossIdx);t.value=a,t.value.ossPassword=B(t.value.ossPassword),u.value=!0,S.value=!0}},C=d([]),v=async a=>{try{if(a==="new"||a==="init"){const{data:s}=await K();C.value=s}else{const{data:s}=await J();C.value=s}}catch(s){console.log(s)}},w=()=>{t.value.ossPassword="",S.value=!1},u=d(!1),h=async()=>{const a={ossName:t.value.ossName,ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername},{data:s}=await X(a);s?o.error("The name is already in use."):(o.success("The name is available."),u.value=!0)},S=d(!1),$=async()=>{const a={ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername,ossPassword:P(t.value.ossPassword),ossTypeIdx:t.value.ossTypeIdx},{data:s}=await Y(a);s?(o.success("The OSS is available."),S.value=!0):o.error("The OSS is unavailable.")},F=()=>{u.value=!1},D=()=>{S.value=!1},E=async()=>{if(!t.value.ossTypeIdx||t.value.ossTypeIdx===0){o.error("Please select OSS Type.");return}if(!t.value.ossName){o.error("Please enter OSS Name.");return}if(!t.value.ossDesc){o.error("Please enter OSS Description.");return}if(!t.value.ossUrl){o.error("Please enter URL.");return}if(!t.value.ossUsername){o.error("Please enter OSS ID.");return}if(!t.value.ossPassword){o.error("Please enter OSS Password.");return}if(!u.value){o.error("Please perform duplicate check.");return}if(!S.value){o.error("Please perform connection check.");return}t.value.ossPassword=P(t.value.ossPassword);let a=!1;r.mode==="new"?a=await R():a=await A(),a&&(g("get-oss-list"),y(),console.log(c.value),c.value&&(c.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const s=document.querySelector(".modal-backdrop");s==null||s.remove()},150)))},R=async()=>{try{const{data:a}=await ss(t.value);return a?(o.success("Regist SUCCESS."),!0):(o.error("Regist FAIL."),!1)}catch{return o.error("Regist FAIL."),!1}},A=async()=>{try{const{data:a}=await es(t.value);return a?(o.success("Update SUCCESS."),!0):(o.error("Update FAIL."),!1)}catch{return o.error("Update FAIL."),!1}},P=a=>btoa(a),B=a=>atob(a);return(a,s)=>(b(),p("div",{class:"modal fade",id:"ossForm",tabindex:"-1",ref_key:"modalElement",ref:m},[e("div",os,[e("div",as,[s[15]||(s[15]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),e("div",ls,[e("h3",ns,U(r.mode==="new"?"New":"Edit")+" OSS ",1),e("div",null,[e("div",rs,[s[9]||(s[9]=e("label",{class:"form-label required"},"OSS Type",-1)),e("div",is,[O(e("select",{"onUpdate:modelValue":s[0]||(s[0]=n=>t.value.ossTypeIdx=n),class:"form-select p-2 g-col-12"},[s[8]||(s[8]=e("option",{value:0},"Select OSS Type",-1)),(b(!0),p(z,null,H(C.value,(n,V)=>(b(),p("option",{value:n.ossTypeIdx,key:V},U(n.ossTypeName),9,ds))),128))],512),[[j,t.value.ossTypeIdx]])])]),e("div",cs,[s[10]||(s[10]=e("label",{class:"form-label required"},"OSS Name",-1)),e("div",us,[O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Name","onUpdate:modelValue":s[1]||(s[1]=n=>t.value.ossName=n),onChange:F},null,544),[[x,t.value.ossName]])])]),e("div",ms,[s[11]||(s[11]=e("label",{class:"form-label required"},"OSS Description",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Description","onUpdate:modelValue":s[2]||(s[2]=n=>t.value.ossDesc=n)},null,512),[[x,t.value.ossDesc]])]),e("div",vs,[s[12]||(s[12]=e("label",{class:"form-label required"},"URL",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the Server URL","onUpdate:modelValue":s[3]||(s[3]=n=>t.value.ossUrl=n),onFocus:D},null,544),[[x,t.value.ossUrl]])]),e("div",ps,[e("div",bs,[s[13]||(s[13]=e("label",{class:"form-label required"},"OSS ID",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the OSS ID","onUpdate:modelValue":s[4]||(s[4]=n=>t.value.ossUsername=n),onFocus:D},null,544),[[x,t.value.ossUsername]])]),e("div",fs,[s[14]||(s[14]=e("label",{class:"form-label required"},"OSS PW",-1)),O(e("input",{type:"password",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Password","onUpdate:modelValue":s[5]||(s[5]=n=>t.value.ossPassword=n),onClick:w,onFocus:D},null,544),[[x,t.value.ossPassword]])]),e("div",ys,[u.value?(b(),p("button",gs,"Duplicate Check")):(b(),p("button",{key:0,class:"btn btn-primary col",onClick:h,style:{"margin-right":"3px"}},"Duplicate Check")),S.value?(b(),p("button",ws,"Connection Check")):(b(),p("button",{key:2,class:"btn btn-primary col",onClick:$},"Connection Check"))])])])]),e("div",Ss,[e("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:s[6]||(s[6]=n=>y())}," Cancel "),e("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:s[7]||(s[7]=n=>E())},U(r.mode==="new"?"Regist":"Edit"),513)])])])],512))}}),ks={class:"modal fade",id:"deleteOss",tabindex:"-1"},Cs={class:"modal-dialog modal-lg",role:"document"},xs={class:"modal-content"},_s={class:"modal-body text-left py-4"},Us={class:"modal-footer"},hs=I({__name:"deleteOss",props:{ossName:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=T(),c=l,o=k,r=async()=>{const{data:g}=await ts(c.ossIdx);g?m.success("Deleted successfully."):m.error("Failed to delete."),o("get-oss-list")};return(g,i)=>(b(),p("div",ks,[e("div",Cs,[e("div",xs,[i[3]||(i[3]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),i[4]||(i[4]=e("div",{class:"modal-status bg-danger"},null,-1)),e("div",_s,[i[1]||(i[1]=e("h3",{class:"mb-5"}," Delete OSS ",-1)),e("h4",null,"Are you sure you want to delete "+U(c.ossName)+"?",1)]),e("div",Us,[i[2]||(i[2]=e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:i[0]||(i[0]=t=>r())}," Delete ")])])])]))}}),Ds={class:"card card-flush w-100"},Is={ref:"table-responsive"},Fs=I({__name:"OssList",setup(l){const k=T(),m=d([]),c=d([]);L(async()=>{i(),await o()});const o=async()=>{try{const{data:v}=await Q();m.value=v}catch(v){console.log(v),k.error("데이터를 가져올 수 없습니다.")}},r=d(0),g=d(""),i=()=>{c.value=[{title:"OSS Name",field:"ossName",width:400},{title:"OSS Desc",field:"ossDesc",width:500},{title:"URL",field:"ossUrl",width:600},{title:"Action",width:400,formatter:t,cellClick:function(v,w){const u=v.target,h=u==null?void 0:u.getAttribute("id");r.value=w.getRow().getData().ossIdx,h==="edit-btn"?y.value="edit":g.value=w.getRow().getData().ossName}}]},t=()=>` +import{M as q,_ as M}from"./bootstrap.esm-Cjkb2LR3.js";import{_ as G}from"./Tabulator.vue_vue_type_style_index_0_lang-Bnd3_hce.js";import{s as f}from"./request-D5nUjUnA.js";import{d as I,r as d,u as T,c as W,w as N,o as L,a as p,b as e,t as U,e as O,v as j,F as z,f as H,g as x,h as b,i as _}from"./index-DgPLCZcu.js";import"./IconPlus-o3un4-BS.js";const J=()=>f.get("/ossType/list"),K=()=>f.get("/ossType/filter/list"),Q=()=>f.get("/oss/list");function X(l){return f.get(`/oss/duplicate?ossName=${l.ossName}&ossUrl=${l.ossUrl}&ossUsername=${l.ossUsername}`)}function Y(l){return f.post("/oss/connection-check",l)}function Z(l){return f.get("/oss/"+l)}function ss(l){return f.post("/oss",l)}function es(l){return f.patch(`/oss/${l.ossIdx}`,l)}function ts(l){return f.delete(`/oss/${l}`)}const os={class:"modal-dialog modal-xl",role:"document"},as={class:"modal-content"},ls={class:"modal-body text-left py-4"},ns={class:"mb-5"},rs={class:"mb-3"},is={class:"grid gap-0 column-gap-3"},ds=["value"],cs={class:"row mb-3"},us={class:"grid gap-0 column-gap-3"},ms={class:"mb-3"},vs={class:"mb-3"},ps={class:"row"},bs={class:"col"},fs={class:"col"},ys={class:"col mt-4 row"},gs={key:1,class:"btn btn-success col",style:{"margin-right":"3px"}},ws={key:3,class:"btn btn-success col"},Ss={class:"modal-footer"},Os=I({__name:"ossForm",props:{mode:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=d(),c=d(),o=T(),r=l,g=k,i=W(()=>r.ossIdx);N(i,async()=>{await y()}),N(()=>r.mode,async()=>{await v(r.mode)}),L(async()=>{m.value&&(c.value=new q(m.value)),await v("init"),await y()});const t=d({}),y=async()=>{if(r.mode==="new")t.value.ossTypeIdx=0,t.value.ossName="",t.value.ossDesc="",t.value.ossUrl="",t.value.ossUsername="",t.value.ossPassword="",u.value=!1,S.value=!1;else{const{data:a}=await Z(r.ossIdx);t.value=a,t.value.ossPassword=B(t.value.ossPassword),u.value=!0,S.value=!0}},C=d([]),v=async a=>{try{if(a==="new"||a==="init"){const{data:s}=await K();C.value=s}else{const{data:s}=await J();C.value=s}}catch(s){console.log(s)}},w=()=>{t.value.ossPassword="",S.value=!1},u=d(!1),h=async()=>{const a={ossName:t.value.ossName,ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername},{data:s}=await X(a);s?o.error("The name is already in use."):(o.success("The name is available."),u.value=!0)},S=d(!1),$=async()=>{const a={ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername,ossPassword:P(t.value.ossPassword),ossTypeIdx:t.value.ossTypeIdx},{data:s}=await Y(a);s?(o.success("The OSS is available."),S.value=!0):o.error("The OSS is unavailable.")},F=()=>{u.value=!1},D=()=>{S.value=!1},E=async()=>{if(!t.value.ossTypeIdx||t.value.ossTypeIdx===0){o.error("Please select OSS Type.");return}if(!t.value.ossName){o.error("Please enter OSS Name.");return}if(!t.value.ossDesc){o.error("Please enter OSS Description.");return}if(!t.value.ossUrl){o.error("Please enter URL.");return}if(!t.value.ossUsername){o.error("Please enter OSS ID.");return}if(!t.value.ossPassword){o.error("Please enter OSS Password.");return}if(!u.value){o.error("Please perform duplicate check.");return}if(!S.value){o.error("Please perform connection check.");return}t.value.ossPassword=P(t.value.ossPassword);let a=!1;r.mode==="new"?a=await R():a=await A(),a&&(g("get-oss-list"),y(),console.log(c.value),c.value&&(c.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const s=document.querySelector(".modal-backdrop");s==null||s.remove()},150)))},R=async()=>{try{const{data:a}=await ss(t.value);return a?(o.success("Regist SUCCESS."),!0):(o.error("Regist FAIL."),!1)}catch{return o.error("Regist FAIL."),!1}},A=async()=>{try{const{data:a}=await es(t.value);return a?(o.success("Update SUCCESS."),!0):(o.error("Update FAIL."),!1)}catch{return o.error("Update FAIL."),!1}},P=a=>btoa(a),B=a=>atob(a);return(a,s)=>(b(),p("div",{class:"modal fade",id:"ossForm",tabindex:"-1",ref_key:"modalElement",ref:m},[e("div",os,[e("div",as,[s[15]||(s[15]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),e("div",ls,[e("h3",ns,U(r.mode==="new"?"New":"Edit")+" OSS ",1),e("div",null,[e("div",rs,[s[9]||(s[9]=e("label",{class:"form-label required"},"OSS Type",-1)),e("div",is,[O(e("select",{"onUpdate:modelValue":s[0]||(s[0]=n=>t.value.ossTypeIdx=n),class:"form-select p-2 g-col-12"},[s[8]||(s[8]=e("option",{value:0},"Select OSS Type",-1)),(b(!0),p(z,null,H(C.value,(n,V)=>(b(),p("option",{value:n.ossTypeIdx,key:V},U(n.ossTypeName),9,ds))),128))],512),[[j,t.value.ossTypeIdx]])])]),e("div",cs,[s[10]||(s[10]=e("label",{class:"form-label required"},"OSS Name",-1)),e("div",us,[O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Name","onUpdate:modelValue":s[1]||(s[1]=n=>t.value.ossName=n),onChange:F},null,544),[[x,t.value.ossName]])])]),e("div",ms,[s[11]||(s[11]=e("label",{class:"form-label required"},"OSS Description",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Description","onUpdate:modelValue":s[2]||(s[2]=n=>t.value.ossDesc=n)},null,512),[[x,t.value.ossDesc]])]),e("div",vs,[s[12]||(s[12]=e("label",{class:"form-label required"},"URL",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the Server URL","onUpdate:modelValue":s[3]||(s[3]=n=>t.value.ossUrl=n),onFocus:D},null,544),[[x,t.value.ossUrl]])]),e("div",ps,[e("div",bs,[s[13]||(s[13]=e("label",{class:"form-label required"},"OSS ID",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the OSS ID","onUpdate:modelValue":s[4]||(s[4]=n=>t.value.ossUsername=n),onFocus:D},null,544),[[x,t.value.ossUsername]])]),e("div",fs,[s[14]||(s[14]=e("label",{class:"form-label required"},"OSS PW",-1)),O(e("input",{type:"password",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Password","onUpdate:modelValue":s[5]||(s[5]=n=>t.value.ossPassword=n),onClick:w,onFocus:D},null,544),[[x,t.value.ossPassword]])]),e("div",ys,[u.value?(b(),p("button",gs,"Duplicate Check")):(b(),p("button",{key:0,class:"btn btn-primary col",onClick:h,style:{"margin-right":"3px"}},"Duplicate Check")),S.value?(b(),p("button",ws,"Connection Check")):(b(),p("button",{key:2,class:"btn btn-primary col",onClick:$},"Connection Check"))])])])]),e("div",Ss,[e("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:s[6]||(s[6]=n=>y())}," Cancel "),e("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:s[7]||(s[7]=n=>E())},U(r.mode==="new"?"Regist":"Edit"),513)])])])],512))}}),ks={class:"modal fade",id:"deleteOss",tabindex:"-1"},Cs={class:"modal-dialog modal-lg",role:"document"},xs={class:"modal-content"},_s={class:"modal-body text-left py-4"},Us={class:"modal-footer"},hs=I({__name:"deleteOss",props:{ossName:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=T(),c=l,o=k,r=async()=>{const{data:g}=await ts(c.ossIdx);g?m.success("Deleted successfully."):m.error("Failed to delete."),o("get-oss-list")};return(g,i)=>(b(),p("div",ks,[e("div",Cs,[e("div",xs,[i[3]||(i[3]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),i[4]||(i[4]=e("div",{class:"modal-status bg-danger"},null,-1)),e("div",_s,[i[1]||(i[1]=e("h3",{class:"mb-5"}," Delete OSS ",-1)),e("h4",null,"Are you sure you want to delete "+U(c.ossName)+"?",1)]),e("div",Us,[i[2]||(i[2]=e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:i[0]||(i[0]=t=>r())}," Delete ")])])])]))}}),Ds={class:"card card-flush w-100"},Is={ref:"table-responsive"},Fs=I({__name:"OssList",setup(l){const k=T(),m=d([]),c=d([]);L(async()=>{i(),await o()});const o=async()=>{try{const{data:v}=await Q();m.value=v}catch(v){console.log(v),k.error("데이터를 가져올 수 없습니다.")}},r=d(0),g=d(""),i=()=>{c.value=[{title:"OSS Name",field:"ossName",width:400},{title:"OSS Desc",field:"ossDesc",width:500},{title:"URL",field:"ossUrl",width:600},{title:"Action",width:400,formatter:t,cellClick:function(v,w){const u=v.target,h=u==null?void 0:u.getAttribute("id");r.value=w.getRow().getData().ossIdx,h==="edit-btn"?y.value="edit":g.value=w.getRow().getData().ossName}}]},t=()=>`
+
+ + +
+
+ + +
+
+
+
@@ -601,6 +618,7 @@ const selectVm = ref("" as string) const selectedVmList = ref([] as Array) const selectDeploymentType = ref("Standalone" as string) const hpaData = ref({} as any) +const workloadRebalancingEnabled = ref(false) const ingressData = ref({} as any) const objectStorageData = ref({} as any) const objectStorageCheckResult = ref(null as any) @@ -695,6 +713,7 @@ const setInit = async () => { hpaCpuUtilization: 60, hpaMemoryUtilization: 80 } + workloadRebalancingEnabled.value = false ingressData.value = { ingressEnabled: false, ingressHost: '', @@ -1000,6 +1019,7 @@ const runInstall = async () => { maxReplicas: hpaData.value.hpaMaxReplicas, cpuThreshold: hpaData.value.hpaCpuUtilization, memoryThreshold: hpaData.value.hpaMemoryUtilization, + workloadRebalancingEnabled: workloadRebalancingEnabled.value, resourceType: selectedResourceType.value, ingressEnabled: ingressData.value.ingressEnabled, ingressHost: normalizeIngressHost(ingressData.value.ingressHost), diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentHistoryDTO.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentHistoryDTO.java index a0174a96..8fbf234a 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentHistoryDTO.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentHistoryDTO.java @@ -40,6 +40,7 @@ public class DeploymentHistoryDTO { private Integer maxReplicas; private Double cpuThreshold; private Double memoryThreshold; + private Boolean workloadRebalancingEnabled; private Boolean ingressEnabled; private String ingressHost; private String ingressPath; @@ -75,6 +76,7 @@ public DeploymentHistoryDTO(DeploymentHistory entity) { this.maxReplicas = entity.getMaxReplicas(); this.cpuThreshold = entity.getCpuThreshold(); this.memoryThreshold = entity.getMemoryThreshold(); + this.workloadRebalancingEnabled = entity.getWorkloadRebalancingEnabled(); this.ingressEnabled = entity.getIngressEnabled(); this.ingressHost = entity.getIngressHost(); this.ingressPath = entity.getIngressPath(); diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentRequest.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentRequest.java index b625869b..45da4c83 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentRequest.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentRequest.java @@ -74,7 +74,8 @@ public class DeploymentRequest { private Integer maxReplicas; private Double cpuThreshold; private Double memoryThreshold; - + private Boolean workloadRebalancingEnabled; + /** * Resource type selected by the user: CPU_INTENSIVE, MEMORY_INTENSIVE, GENERAL_PURPOSE */ diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentRequestDTO.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentRequestDTO.java index b2a0e1f3..2ce9a029 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentRequestDTO.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/DeploymentRequestDTO.java @@ -36,6 +36,7 @@ public class DeploymentRequestDTO { private Integer maxReplicas; private Double cpuThreshold; private Double memoryThreshold; + private Boolean workloadRebalancingEnabled; // 자원 유형 선택값 private String resourceType; @@ -69,6 +70,7 @@ public DeploymentRequest toDeploymentRequest() { .maxReplicas(this.maxReplicas) .cpuThreshold(this.cpuThreshold) .memoryThreshold(this.memoryThreshold) + .workloadRebalancingEnabled(this.workloadRebalancingEnabled) .resourceType(this.resourceType) .additionalConfig(this.additionalConfig) .ingressEnabled(this.ingressEnabled) diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/IntegratedApplicationInfoDTO.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/IntegratedApplicationInfoDTO.java index 81aef5a2..ea85f5d7 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/IntegratedApplicationInfoDTO.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/IntegratedApplicationInfoDTO.java @@ -56,6 +56,7 @@ public class IntegratedApplicationInfoDTO { private Integer maxReplicas; private Double cpuThreshold; private Double memoryThreshold; + private Boolean workloadRebalancingEnabled; private String applicationStatus; private Double cpuUsage; diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/model/DeploymentHistory.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/model/DeploymentHistory.java index ebd87a24..4c5f87ea 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/application/model/DeploymentHistory.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/model/DeploymentHistory.java @@ -113,6 +113,9 @@ public class DeploymentHistory { @Column(name = "memory_threshold") private Double memoryThreshold; + @Column(name = "workload_rebalancing_enabled") + private Boolean workloadRebalancingEnabled; + @Column(name = "ingress_enabled") private Boolean ingressEnabled; diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationServiceImpl.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationServiceImpl.java index 8cb8a461..d49eb9a3 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationServiceImpl.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationServiceImpl.java @@ -306,6 +306,7 @@ private Map toDeploymentHistoryMap(DeploymentHistory history) { map.put("maxReplicas", history.getMaxReplicas()); map.put("cpuThreshold", history.getCpuThreshold()); map.put("memoryThreshold", history.getMemoryThreshold()); + map.put("workloadRebalancingEnabled", history.getWorkloadRebalancingEnabled()); map.put("ingressEnabled", history.getIngressEnabled()); map.put("ingressHost", history.getIngressHost()); map.put("ingressPath", history.getIngressPath()); @@ -602,6 +603,7 @@ private IntegratedApplicationInfoDTO convertToIntegratedDTO( .maxReplicas(valueOrDefault(deploymentHistory.getMaxReplicas(), deploymentHistory.getCatalog().getMaxReplicas())) .cpuThreshold(valueOrDefault(deploymentHistory.getCpuThreshold(), deploymentHistory.getCatalog().getCpuThreshold())) .memoryThreshold(valueOrDefault(deploymentHistory.getMemoryThreshold(), deploymentHistory.getCatalog().getMemoryThreshold())) + .workloadRebalancingEnabled(Boolean.TRUE.equals(deploymentHistory.getWorkloadRebalancingEnabled())) .ingressEnabled(valueOrDefault(deploymentHistory.getIngressEnabled(), deploymentHistory.getCatalog().getIngressEnabled())) .ingressHost(valueOrDefault(deploymentHistory.getIngressHost(), deploymentHistory.getCatalog().getIngressHost())) .ingressPath(valueOrDefault(deploymentHistory.getIngressPath(), deploymentHistory.getCatalog().getIngressPath())) @@ -731,6 +733,7 @@ private IntegratedApplicationInfoDTO convertToIntegratedDTOWithUnifiedLogs( .maxReplicas(valueOrDefault(deploymentHistory.getMaxReplicas(), deploymentHistory.getCatalog().getMaxReplicas())) .cpuThreshold(valueOrDefault(deploymentHistory.getCpuThreshold(), deploymentHistory.getCatalog().getCpuThreshold())) .memoryThreshold(valueOrDefault(deploymentHistory.getMemoryThreshold(), deploymentHistory.getCatalog().getMemoryThreshold())) + .workloadRebalancingEnabled(Boolean.TRUE.equals(deploymentHistory.getWorkloadRebalancingEnabled())) .ingressEnabled(valueOrDefault(deploymentHistory.getIngressEnabled(), deploymentHistory.getCatalog().getIngressEnabled())) .ingressHost(valueOrDefault(deploymentHistory.getIngressHost(), deploymentHistory.getCatalog().getIngressHost())) .ingressPath(valueOrDefault(deploymentHistory.getIngressPath(), deploymentHistory.getCatalog().getIngressPath())) diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java index af1a59a9..8ee4937f 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java @@ -988,6 +988,8 @@ private void applyObjectStorageValues(SoftwareCatalog catalog, Map loki = nestedMap(valuesFile, "loki"); loki.put("configStorageType", "Secret"); + loki.put("auth_enabled", false); + nestedMap(loki, "commonConfig").put("replication_factor", 1); applyDefaultLokiSchemaConfig(loki); Map storage = nestedMap(loki, "storage"); diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesMonitoringService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesMonitoringService.java index 2776cbc1..2a35880a 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesMonitoringService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesMonitoringService.java @@ -376,6 +376,9 @@ private Double getAutoscaleCpuThreshold(DeploymentHistory deployment) { if (testMode) { return testCpuThreshold; } + if (deployment.getCpuThreshold() != null) { + return deployment.getCpuThreshold(); + } return deployment.getCatalog() != null ? deployment.getCatalog().getCpuThreshold() : null; } @@ -383,9 +386,21 @@ private Double getAutoscaleMemoryThreshold(DeploymentHistory deployment) { if (testMode) { return testMemoryThreshold; } + if (deployment.getMemoryThreshold() != null) { + return deployment.getMemoryThreshold(); + } return deployment.getCatalog() != null ? deployment.getCatalog().getMemoryThreshold() : null; } + private int getAutoscaleMaxNodes(DeploymentHistory deployment) { + if (deployment.getMaxReplicas() != null) { + return deployment.getMaxReplicas(); + } + return deployment.getCatalog() != null && deployment.getCatalog().getMaxReplicas() != null + ? deployment.getCatalog().getMaxReplicas() + : defaultMaxNodes; + } + private boolean isThresholdExceeded(Double usage, Double threshold) { return usage != null && threshold != null && usage > threshold; } @@ -541,11 +556,15 @@ private void updateApplicationStatus(DeploymentHistory deployment, KubernetesCli catalogId, status.getStatus(), status.getPodStatus(), status.getCpuUsage(), status.getMemoryUsage()); // 오토스케일링 처리 (스케일 아웃만) - log.debug("Calling handleK8sAutoscaling for deployment: {}, CatalogId: {}", deployment.getId(), catalogId); - handleK8sAutoscaling(deployment, status, client); + if (isWorkloadRebalancingEnabled(deployment)) { + log.debug("Calling handleK8sAutoscaling for deployment: {}, CatalogId: {}", deployment.getId(), catalogId); + handleK8sAutoscaling(deployment, status, client); // 스케일 아웃 완료 감지 및 재배포 처리 - checkAndHandleScalingCompletion(deployment, client); + checkAndHandleScalingCompletion(deployment, client); + } else { + log.debug("Skipping workload rebalancing for deployment: {}, CatalogId: {}", deployment.getId(), catalogId); + } // Persist 10-minute metrics snapshot if interval has elapsed saveMetricsSnapshotIfDue(deployment, status, pods, resourceUsage); @@ -1343,6 +1362,10 @@ private void waitForMetricsServerReady(KubernetesClient client) throws Interrupt /** * K8S 오토스케일링 처리 (스케일 아웃만) */ + private boolean isWorkloadRebalancingEnabled(DeploymentHistory deployment) { + return Boolean.TRUE.equals(deployment.getWorkloadRebalancingEnabled()); + } + private void handleK8sAutoscaling(DeploymentHistory deployment, ApplicationStatus status, KubernetesClient client) { try { log.debug("=== Starting autoscaling check for deployment: {} ===", deployment.getId()); @@ -1442,7 +1465,7 @@ private void handleK8sAutoscaling(DeploymentHistory deployment, ApplicationStatu int targetSize = currentSize + 1; log.info("Target node count: {}", targetSize); - int maxSize = deployment.getCatalog().getMaxReplicas() != null ? deployment.getCatalog().getMaxReplicas() : defaultMaxNodes; + int maxSize = getAutoscaleMaxNodes(deployment); // 이미 스케일 아웃이 완료되었고 nodeSelector가 설정되어 있는지 확인 if (isAlreadyScaledOut(deployment, client)) { @@ -1470,20 +1493,20 @@ private void handleK8sAutoscaling(DeploymentHistory deployment, ApplicationStatu status.getCpuUsage(), testCpuThreshold, status.getMemoryUsage(), testMemoryThreshold); } else { // 운영 모드: 실제 임계값 사용 - cpuExceeded = deployment.getCatalog().getCpuThreshold() != null && - status.getCpuUsage() > deployment.getCatalog().getCpuThreshold(); - memoryExceeded = deployment.getCatalog().getMemoryThreshold() != null && - status.getMemoryUsage() > deployment.getCatalog().getMemoryThreshold(); + Double cpuThreshold = getAutoscaleCpuThreshold(deployment); + Double memoryThreshold = getAutoscaleMemoryThreshold(deployment); + cpuExceeded = isThresholdExceeded(status.getCpuUsage(), cpuThreshold); + memoryExceeded = isThresholdExceeded(status.getMemoryUsage(), memoryThreshold); log.debug("Production mode - CPU: {}% (threshold: {}), Memory: {}% (threshold: {})", - status.getCpuUsage(), deployment.getCatalog().getCpuThreshold(), - status.getMemoryUsage(), deployment.getCatalog().getMemoryThreshold()); + status.getCpuUsage(), cpuThreshold, + status.getMemoryUsage(), memoryThreshold); } // 스케일 아웃 조건: 부하 초과 AND 목표 노드 수 < 최대 노드 수 boolean thresholdExceeded = cpuExceeded || memoryExceeded; boolean sustainedThresholdExceeded = hasSustainedAutoscalePressure(deployment.getId(), thresholdExceeded); - if (thresholdExceeded && sustainedThresholdExceeded && targetSize <= maxSize) { + if (thresholdExceeded && sustainedThresholdExceeded) { log.info("Sustained resource pressure confirmed for K8S deployment: CPU={}%, Memory={}%, scaling out from {} to {}", status.getCpuUsage(), status.getMemoryUsage(), currentSize, targetSize); @@ -1502,27 +1525,26 @@ private void handleK8sAutoscaling(DeploymentHistory deployment, ApplicationStatu log.debug("Current desired node size: {}, target: {}", currentDesiredNodeSize, targetSize); - // 로직 1: desiredNodeSize < maxNodeSize인 경우, API 호출하지 않고 기다림 + // 로직 1: desiredNodeSize < maxNodeSize인 경우, 현재 max 안에서 1개 증설 요청 if (currentDesiredNodeSize < maxSize) { - log.debug("desiredNodeSize ({}) < maxNodeSize ({}). Waiting for desired size to reach max.", + log.debug("desiredNodeSize ({}) < maxNodeSize ({}). Scaling out within current max.", currentDesiredNodeSize, maxSize); scalingEvent.setStatus(ScalingEvent.ScalingStatus.IN_PROGRESS); scalingEventRepository.save(scalingEvent); - log.info("Will check for node creation in next cycle when desiredNodeSize reaches max."); - return; + log.info("Requesting node creation within current maxNodeSize."); } - // 로직 2: desiredNodeSize == maxNodeSize인 경우, max+1로 API 호출 - if (currentDesiredNodeSize >= maxSize) { - log.debug("desiredNodeSize ({}) >= maxNodeSize ({}). Scaling out to max+1", + // 로직 2: 현재 desired 기준으로 1개 증설 요청 + { + log.debug("Scaling out node group by one node. desiredNodeSize={}, maxNodeSize={}", currentDesiredNodeSize, maxSize); - int newMaxSize = currentDesiredNodeSize + 1; - targetSize = newMaxSize; + int requestedNodeSize = currentDesiredNodeSize + 1; + targetSize = requestedNodeSize; scalingEvent.setNewNodeCount(targetSize); // API 호출 - boolean scaleResult = k8sAutoscaleService.scaleOutNodeGroup(namespace, clusterName, nodeGroupName, currentDesiredNodeSize, newMaxSize); + boolean scaleResult = k8sAutoscaleService.scaleOutNodeGroup(namespace, clusterName, nodeGroupName, currentDesiredNodeSize, requestedNodeSize); if (scaleResult) { log.debug("Scale out API returned true: {} -> {}", currentDesiredNodeSize, targetSize); @@ -1544,9 +1566,6 @@ private void handleK8sAutoscaling(DeploymentHistory deployment, ApplicationStatu scalingEventRepository.save(scalingEvent); } - } else if (targetSize > maxSize) { - log.warn("Cannot scale out: target size {} > max size {} (CPU={}%, Memory={}%)", - targetSize, maxSize, status.getCpuUsage(), status.getMemoryUsage()); } else if (thresholdExceeded) { log.info("Resource threshold currently exceeded for K8S deployment, but sustained pressure has not been confirmed yet (CPU={}%, Memory={}%)", status.getCpuUsage(), status.getMemoryUsage()); diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesService.java index 663e7738..c9f5c9f3 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesService.java @@ -77,6 +77,7 @@ public DeploymentHistory deployApplication(DeploymentRequest request) { .status("FAILED") .actionType(ActionType.INSTALL) .executedAt(LocalDateTime.now()) + .workloadRebalancingEnabled(Boolean.TRUE.equals(request.getWorkloadRebalancingEnabled())) .build(); } else { history.setStatus("FAILED"); @@ -214,6 +215,7 @@ private void applyDeploymentRequestConfig(DeploymentHistory history, DeploymentR history.setMaxReplicas(config.getMaxReplicas()); history.setCpuThreshold(config.getCpuThreshold()); history.setMemoryThreshold(config.getMemoryThreshold()); + history.setWorkloadRebalancingEnabled(Boolean.TRUE.equals(request.getWorkloadRebalancingEnabled())); history.setIngressEnabled(config.getIngressEnabled()); history.setIngressHost(config.getIngressHost()); history.setIngressPath(config.getIngressPath()); diff --git a/src/main/resources/static/assets/IconPlus-o3un4-BS.js b/src/main/resources/static/assets/IconPlus-0MYkWKdM.js similarity index 96% rename from src/main/resources/static/assets/IconPlus-o3un4-BS.js rename to src/main/resources/static/assets/IconPlus-0MYkWKdM.js index 7188c4cf..e5857699 100644 --- a/src/main/resources/static/assets/IconPlus-o3un4-BS.js +++ b/src/main/resources/static/assets/IconPlus-0MYkWKdM.js @@ -1,4 +1,4 @@ -import{L as l}from"./index-DgPLCZcu.js";/** +import{L as l}from"./index-nMoWjTPe.js";/** * @license @tabler/icons-vue v3.22.0 - MIT * * This source code is licensed under the MIT license. diff --git a/src/main/resources/static/assets/OssList-NTlcIZPq.js b/src/main/resources/static/assets/OssList-CUqe4g5_.js similarity index 96% rename from src/main/resources/static/assets/OssList-NTlcIZPq.js rename to src/main/resources/static/assets/OssList-CUqe4g5_.js index f8100d40..0df058b1 100644 --- a/src/main/resources/static/assets/OssList-NTlcIZPq.js +++ b/src/main/resources/static/assets/OssList-CUqe4g5_.js @@ -1,4 +1,4 @@ -import{M as q,_ as M}from"./bootstrap.esm-Cjkb2LR3.js";import{_ as G}from"./Tabulator.vue_vue_type_style_index_0_lang-Bnd3_hce.js";import{s as f}from"./request-D5nUjUnA.js";import{d as I,r as d,u as T,c as W,w as N,o as L,a as p,b as e,t as U,e as O,v as j,F as z,f as H,g as x,h as b,i as _}from"./index-DgPLCZcu.js";import"./IconPlus-o3un4-BS.js";const J=()=>f.get("/ossType/list"),K=()=>f.get("/ossType/filter/list"),Q=()=>f.get("/oss/list");function X(l){return f.get(`/oss/duplicate?ossName=${l.ossName}&ossUrl=${l.ossUrl}&ossUsername=${l.ossUsername}`)}function Y(l){return f.post("/oss/connection-check",l)}function Z(l){return f.get("/oss/"+l)}function ss(l){return f.post("/oss",l)}function es(l){return f.patch(`/oss/${l.ossIdx}`,l)}function ts(l){return f.delete(`/oss/${l}`)}const os={class:"modal-dialog modal-xl",role:"document"},as={class:"modal-content"},ls={class:"modal-body text-left py-4"},ns={class:"mb-5"},rs={class:"mb-3"},is={class:"grid gap-0 column-gap-3"},ds=["value"],cs={class:"row mb-3"},us={class:"grid gap-0 column-gap-3"},ms={class:"mb-3"},vs={class:"mb-3"},ps={class:"row"},bs={class:"col"},fs={class:"col"},ys={class:"col mt-4 row"},gs={key:1,class:"btn btn-success col",style:{"margin-right":"3px"}},ws={key:3,class:"btn btn-success col"},Ss={class:"modal-footer"},Os=I({__name:"ossForm",props:{mode:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=d(),c=d(),o=T(),r=l,g=k,i=W(()=>r.ossIdx);N(i,async()=>{await y()}),N(()=>r.mode,async()=>{await v(r.mode)}),L(async()=>{m.value&&(c.value=new q(m.value)),await v("init"),await y()});const t=d({}),y=async()=>{if(r.mode==="new")t.value.ossTypeIdx=0,t.value.ossName="",t.value.ossDesc="",t.value.ossUrl="",t.value.ossUsername="",t.value.ossPassword="",u.value=!1,S.value=!1;else{const{data:a}=await Z(r.ossIdx);t.value=a,t.value.ossPassword=B(t.value.ossPassword),u.value=!0,S.value=!0}},C=d([]),v=async a=>{try{if(a==="new"||a==="init"){const{data:s}=await K();C.value=s}else{const{data:s}=await J();C.value=s}}catch(s){console.log(s)}},w=()=>{t.value.ossPassword="",S.value=!1},u=d(!1),h=async()=>{const a={ossName:t.value.ossName,ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername},{data:s}=await X(a);s?o.error("The name is already in use."):(o.success("The name is available."),u.value=!0)},S=d(!1),$=async()=>{const a={ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername,ossPassword:P(t.value.ossPassword),ossTypeIdx:t.value.ossTypeIdx},{data:s}=await Y(a);s?(o.success("The OSS is available."),S.value=!0):o.error("The OSS is unavailable.")},F=()=>{u.value=!1},D=()=>{S.value=!1},E=async()=>{if(!t.value.ossTypeIdx||t.value.ossTypeIdx===0){o.error("Please select OSS Type.");return}if(!t.value.ossName){o.error("Please enter OSS Name.");return}if(!t.value.ossDesc){o.error("Please enter OSS Description.");return}if(!t.value.ossUrl){o.error("Please enter URL.");return}if(!t.value.ossUsername){o.error("Please enter OSS ID.");return}if(!t.value.ossPassword){o.error("Please enter OSS Password.");return}if(!u.value){o.error("Please perform duplicate check.");return}if(!S.value){o.error("Please perform connection check.");return}t.value.ossPassword=P(t.value.ossPassword);let a=!1;r.mode==="new"?a=await R():a=await A(),a&&(g("get-oss-list"),y(),console.log(c.value),c.value&&(c.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const s=document.querySelector(".modal-backdrop");s==null||s.remove()},150)))},R=async()=>{try{const{data:a}=await ss(t.value);return a?(o.success("Regist SUCCESS."),!0):(o.error("Regist FAIL."),!1)}catch{return o.error("Regist FAIL."),!1}},A=async()=>{try{const{data:a}=await es(t.value);return a?(o.success("Update SUCCESS."),!0):(o.error("Update FAIL."),!1)}catch{return o.error("Update FAIL."),!1}},P=a=>btoa(a),B=a=>atob(a);return(a,s)=>(b(),p("div",{class:"modal fade",id:"ossForm",tabindex:"-1",ref_key:"modalElement",ref:m},[e("div",os,[e("div",as,[s[15]||(s[15]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),e("div",ls,[e("h3",ns,U(r.mode==="new"?"New":"Edit")+" OSS ",1),e("div",null,[e("div",rs,[s[9]||(s[9]=e("label",{class:"form-label required"},"OSS Type",-1)),e("div",is,[O(e("select",{"onUpdate:modelValue":s[0]||(s[0]=n=>t.value.ossTypeIdx=n),class:"form-select p-2 g-col-12"},[s[8]||(s[8]=e("option",{value:0},"Select OSS Type",-1)),(b(!0),p(z,null,H(C.value,(n,V)=>(b(),p("option",{value:n.ossTypeIdx,key:V},U(n.ossTypeName),9,ds))),128))],512),[[j,t.value.ossTypeIdx]])])]),e("div",cs,[s[10]||(s[10]=e("label",{class:"form-label required"},"OSS Name",-1)),e("div",us,[O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Name","onUpdate:modelValue":s[1]||(s[1]=n=>t.value.ossName=n),onChange:F},null,544),[[x,t.value.ossName]])])]),e("div",ms,[s[11]||(s[11]=e("label",{class:"form-label required"},"OSS Description",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Description","onUpdate:modelValue":s[2]||(s[2]=n=>t.value.ossDesc=n)},null,512),[[x,t.value.ossDesc]])]),e("div",vs,[s[12]||(s[12]=e("label",{class:"form-label required"},"URL",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the Server URL","onUpdate:modelValue":s[3]||(s[3]=n=>t.value.ossUrl=n),onFocus:D},null,544),[[x,t.value.ossUrl]])]),e("div",ps,[e("div",bs,[s[13]||(s[13]=e("label",{class:"form-label required"},"OSS ID",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the OSS ID","onUpdate:modelValue":s[4]||(s[4]=n=>t.value.ossUsername=n),onFocus:D},null,544),[[x,t.value.ossUsername]])]),e("div",fs,[s[14]||(s[14]=e("label",{class:"form-label required"},"OSS PW",-1)),O(e("input",{type:"password",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Password","onUpdate:modelValue":s[5]||(s[5]=n=>t.value.ossPassword=n),onClick:w,onFocus:D},null,544),[[x,t.value.ossPassword]])]),e("div",ys,[u.value?(b(),p("button",gs,"Duplicate Check")):(b(),p("button",{key:0,class:"btn btn-primary col",onClick:h,style:{"margin-right":"3px"}},"Duplicate Check")),S.value?(b(),p("button",ws,"Connection Check")):(b(),p("button",{key:2,class:"btn btn-primary col",onClick:$},"Connection Check"))])])])]),e("div",Ss,[e("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:s[6]||(s[6]=n=>y())}," Cancel "),e("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:s[7]||(s[7]=n=>E())},U(r.mode==="new"?"Regist":"Edit"),513)])])])],512))}}),ks={class:"modal fade",id:"deleteOss",tabindex:"-1"},Cs={class:"modal-dialog modal-lg",role:"document"},xs={class:"modal-content"},_s={class:"modal-body text-left py-4"},Us={class:"modal-footer"},hs=I({__name:"deleteOss",props:{ossName:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=T(),c=l,o=k,r=async()=>{const{data:g}=await ts(c.ossIdx);g?m.success("Deleted successfully."):m.error("Failed to delete."),o("get-oss-list")};return(g,i)=>(b(),p("div",ks,[e("div",Cs,[e("div",xs,[i[3]||(i[3]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),i[4]||(i[4]=e("div",{class:"modal-status bg-danger"},null,-1)),e("div",_s,[i[1]||(i[1]=e("h3",{class:"mb-5"}," Delete OSS ",-1)),e("h4",null,"Are you sure you want to delete "+U(c.ossName)+"?",1)]),e("div",Us,[i[2]||(i[2]=e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:i[0]||(i[0]=t=>r())}," Delete ")])])])]))}}),Ds={class:"card card-flush w-100"},Is={ref:"table-responsive"},Fs=I({__name:"OssList",setup(l){const k=T(),m=d([]),c=d([]);L(async()=>{i(),await o()});const o=async()=>{try{const{data:v}=await Q();m.value=v}catch(v){console.log(v),k.error("데이터를 가져올 수 없습니다.")}},r=d(0),g=d(""),i=()=>{c.value=[{title:"OSS Name",field:"ossName",width:400},{title:"OSS Desc",field:"ossDesc",width:500},{title:"URL",field:"ossUrl",width:600},{title:"Action",width:400,formatter:t,cellClick:function(v,w){const u=v.target,h=u==null?void 0:u.getAttribute("id");r.value=w.getRow().getData().ossIdx,h==="edit-btn"?y.value="edit":g.value=w.getRow().getData().ossName}}]},t=()=>` +import{M as q,_ as M}from"./bootstrap.esm-LCYmWnCj.js";import{_ as G}from"./Tabulator.vue_vue_type_style_index_0_lang-By28-D7G.js";import{s as f}from"./request-BXz87ydW.js";import{d as I,r as d,u as T,c as W,w as N,o as L,a as p,b as e,t as U,e as O,v as j,F as z,f as H,g as x,h as b,i as _}from"./index-nMoWjTPe.js";import"./IconPlus-0MYkWKdM.js";const J=()=>f.get("/ossType/list"),K=()=>f.get("/ossType/filter/list"),Q=()=>f.get("/oss/list");function X(l){return f.get(`/oss/duplicate?ossName=${l.ossName}&ossUrl=${l.ossUrl}&ossUsername=${l.ossUsername}`)}function Y(l){return f.post("/oss/connection-check",l)}function Z(l){return f.get("/oss/"+l)}function ss(l){return f.post("/oss",l)}function es(l){return f.patch(`/oss/${l.ossIdx}`,l)}function ts(l){return f.delete(`/oss/${l}`)}const os={class:"modal-dialog modal-xl",role:"document"},as={class:"modal-content"},ls={class:"modal-body text-left py-4"},ns={class:"mb-5"},rs={class:"mb-3"},is={class:"grid gap-0 column-gap-3"},ds=["value"],cs={class:"row mb-3"},us={class:"grid gap-0 column-gap-3"},ms={class:"mb-3"},vs={class:"mb-3"},ps={class:"row"},bs={class:"col"},fs={class:"col"},ys={class:"col mt-4 row"},gs={key:1,class:"btn btn-success col",style:{"margin-right":"3px"}},ws={key:3,class:"btn btn-success col"},Ss={class:"modal-footer"},Os=I({__name:"ossForm",props:{mode:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=d(),c=d(),o=T(),r=l,g=k,i=W(()=>r.ossIdx);N(i,async()=>{await y()}),N(()=>r.mode,async()=>{await v(r.mode)}),L(async()=>{m.value&&(c.value=new q(m.value)),await v("init"),await y()});const t=d({}),y=async()=>{if(r.mode==="new")t.value.ossTypeIdx=0,t.value.ossName="",t.value.ossDesc="",t.value.ossUrl="",t.value.ossUsername="",t.value.ossPassword="",u.value=!1,S.value=!1;else{const{data:a}=await Z(r.ossIdx);t.value=a,t.value.ossPassword=B(t.value.ossPassword),u.value=!0,S.value=!0}},C=d([]),v=async a=>{try{if(a==="new"||a==="init"){const{data:s}=await K();C.value=s}else{const{data:s}=await J();C.value=s}}catch(s){console.log(s)}},w=()=>{t.value.ossPassword="",S.value=!1},u=d(!1),h=async()=>{const a={ossName:t.value.ossName,ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername},{data:s}=await X(a);s?o.error("The name is already in use."):(o.success("The name is available."),u.value=!0)},S=d(!1),$=async()=>{const a={ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername,ossPassword:P(t.value.ossPassword),ossTypeIdx:t.value.ossTypeIdx},{data:s}=await Y(a);s?(o.success("The OSS is available."),S.value=!0):o.error("The OSS is unavailable.")},F=()=>{u.value=!1},D=()=>{S.value=!1},E=async()=>{if(!t.value.ossTypeIdx||t.value.ossTypeIdx===0){o.error("Please select OSS Type.");return}if(!t.value.ossName){o.error("Please enter OSS Name.");return}if(!t.value.ossDesc){o.error("Please enter OSS Description.");return}if(!t.value.ossUrl){o.error("Please enter URL.");return}if(!t.value.ossUsername){o.error("Please enter OSS ID.");return}if(!t.value.ossPassword){o.error("Please enter OSS Password.");return}if(!u.value){o.error("Please perform duplicate check.");return}if(!S.value){o.error("Please perform connection check.");return}t.value.ossPassword=P(t.value.ossPassword);let a=!1;r.mode==="new"?a=await R():a=await A(),a&&(g("get-oss-list"),y(),console.log(c.value),c.value&&(c.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const s=document.querySelector(".modal-backdrop");s==null||s.remove()},150)))},R=async()=>{try{const{data:a}=await ss(t.value);return a?(o.success("Regist SUCCESS."),!0):(o.error("Regist FAIL."),!1)}catch{return o.error("Regist FAIL."),!1}},A=async()=>{try{const{data:a}=await es(t.value);return a?(o.success("Update SUCCESS."),!0):(o.error("Update FAIL."),!1)}catch{return o.error("Update FAIL."),!1}},P=a=>btoa(a),B=a=>atob(a);return(a,s)=>(b(),p("div",{class:"modal fade",id:"ossForm",tabindex:"-1",ref_key:"modalElement",ref:m},[e("div",os,[e("div",as,[s[15]||(s[15]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),e("div",ls,[e("h3",ns,U(r.mode==="new"?"New":"Edit")+" OSS ",1),e("div",null,[e("div",rs,[s[9]||(s[9]=e("label",{class:"form-label required"},"OSS Type",-1)),e("div",is,[O(e("select",{"onUpdate:modelValue":s[0]||(s[0]=n=>t.value.ossTypeIdx=n),class:"form-select p-2 g-col-12"},[s[8]||(s[8]=e("option",{value:0},"Select OSS Type",-1)),(b(!0),p(z,null,H(C.value,(n,V)=>(b(),p("option",{value:n.ossTypeIdx,key:V},U(n.ossTypeName),9,ds))),128))],512),[[j,t.value.ossTypeIdx]])])]),e("div",cs,[s[10]||(s[10]=e("label",{class:"form-label required"},"OSS Name",-1)),e("div",us,[O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Name","onUpdate:modelValue":s[1]||(s[1]=n=>t.value.ossName=n),onChange:F},null,544),[[x,t.value.ossName]])])]),e("div",ms,[s[11]||(s[11]=e("label",{class:"form-label required"},"OSS Description",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Description","onUpdate:modelValue":s[2]||(s[2]=n=>t.value.ossDesc=n)},null,512),[[x,t.value.ossDesc]])]),e("div",vs,[s[12]||(s[12]=e("label",{class:"form-label required"},"URL",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the Server URL","onUpdate:modelValue":s[3]||(s[3]=n=>t.value.ossUrl=n),onFocus:D},null,544),[[x,t.value.ossUrl]])]),e("div",ps,[e("div",bs,[s[13]||(s[13]=e("label",{class:"form-label required"},"OSS ID",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the OSS ID","onUpdate:modelValue":s[4]||(s[4]=n=>t.value.ossUsername=n),onFocus:D},null,544),[[x,t.value.ossUsername]])]),e("div",fs,[s[14]||(s[14]=e("label",{class:"form-label required"},"OSS PW",-1)),O(e("input",{type:"password",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Password","onUpdate:modelValue":s[5]||(s[5]=n=>t.value.ossPassword=n),onClick:w,onFocus:D},null,544),[[x,t.value.ossPassword]])]),e("div",ys,[u.value?(b(),p("button",gs,"Duplicate Check")):(b(),p("button",{key:0,class:"btn btn-primary col",onClick:h,style:{"margin-right":"3px"}},"Duplicate Check")),S.value?(b(),p("button",ws,"Connection Check")):(b(),p("button",{key:2,class:"btn btn-primary col",onClick:$},"Connection Check"))])])])]),e("div",Ss,[e("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:s[6]||(s[6]=n=>y())}," Cancel "),e("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:s[7]||(s[7]=n=>E())},U(r.mode==="new"?"Regist":"Edit"),513)])])])],512))}}),ks={class:"modal fade",id:"deleteOss",tabindex:"-1"},Cs={class:"modal-dialog modal-lg",role:"document"},xs={class:"modal-content"},_s={class:"modal-body text-left py-4"},Us={class:"modal-footer"},hs=I({__name:"deleteOss",props:{ossName:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=T(),c=l,o=k,r=async()=>{const{data:g}=await ts(c.ossIdx);g?m.success("Deleted successfully."):m.error("Failed to delete."),o("get-oss-list")};return(g,i)=>(b(),p("div",ks,[e("div",Cs,[e("div",xs,[i[3]||(i[3]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),i[4]||(i[4]=e("div",{class:"modal-status bg-danger"},null,-1)),e("div",_s,[i[1]||(i[1]=e("h3",{class:"mb-5"}," Delete OSS ",-1)),e("h4",null,"Are you sure you want to delete "+U(c.ossName)+"?",1)]),e("div",Us,[i[2]||(i[2]=e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:i[0]||(i[0]=t=>r())}," Delete ")])])])]))}}),Ds={class:"card card-flush w-100"},Is={ref:"table-responsive"},Fs=I({__name:"OssList",setup(l){const k=T(),m=d([]),c=d([]);L(async()=>{i(),await o()});const o=async()=>{try{const{data:v}=await Q();m.value=v}catch(v){console.log(v),k.error("데이터를 가져올 수 없습니다.")}},r=d(0),g=d(""),i=()=>{c.value=[{title:"OSS Name",field:"ossName",width:400},{title:"OSS Desc",field:"ossDesc",width:500},{title:"URL",field:"ossUrl",width:600},{title:"Action",width:400,formatter:t,cellClick:function(v,w){const u=v.target,h=u==null?void 0:u.getAttribute("id");r.value=w.getRow().getData().ossIdx,h==="edit-btn"?y.value="edit":g.value=w.getRow().getData().ossName}}]},t=()=>`
`},ne=I=>{const N=I.getRow().getData().status,z=J(N)?"disabled":"",q=String(N||"").trim().toUpperCase();return`
- ${K==="STOP"||K==="STOPPED"?` + ${q==="STOP"||q==="STOPPED"?` -
`};return P({refresh:S}),(I,E)=>(u(),m(G,null,[e("div",eo,[e("div",to,[e("div",ao,[e("div",lo,[E[1]||(E[1]=e("h3",{class:"card-title"},[e("strong",null,"Apps Status")],-1)),e("div",oo,[e("span",so,i(w.value),1),e("a",{class:"btn btn-outline-primary d-none d-sm-inline-block",onClick:S},[V(Z(Xe),{class:"icon icon-tabler",size:20,"stroke-width":"1"}),E[0]||(E[0]=ae(" Refresh "))])])])])]),V(St,{columns:D.value,"table-data":R.value},null,8,["columns","table-data"])]),V(Wt,{ref_key:"applicationActionConfirmModalRef",ref:_,title:b.value,applicationStatusId:C.value,type:d.value,applicationName:$.value,onGetApplicationsStatusList:S},null,8,["title","applicationStatusId","type","applicationName"]),V(ca,{catalogId:N.value,applicationName:$.value,onRatingSubmitted:S},null,8,["catalogId","applicationName"]),V(Je,{ref_key:"applicationDetailModalRef",ref:y,"modal-id":Ke,deploymentId:f.value},null,8,["deploymentId"])],64))}}),io={class:"modal-dialog modal-lg",role:"document"},ro={class:"modal-content"},co={class:"modal-header"},uo={class:"modal-title"},mo={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},po={class:"nav nav-tabs mb-3"},vo={class:"nav-item"},go={class:"nav-item"},bo={class:"nav-item"},fo={class:"nav-item"},yo={class:"mb-3"},ho={class:"d-flex align-items-center"},_o={class:"form-check me-3"},ko=["disabled"],So={class:"form-check"},wo=["disabled"],Co={class:"mb-3"},$o=["disabled"],Io=["value"],To={class:"w-100 d-flex justify-content-between"},Ao={class:"mb-3 w-50",style:{"margin-right":"10px"}},Ro=["disabled"],No=["value"],Eo={class:"mb-3 w-50"},Mo=["disabled"],Do=["value"],Uo={class:"mb-3"},xo={class:"mb-3"},Po={class:"mb-3"},Lo={class:"mb-3"},Vo={class:"col-5"},Oo=["onUpdate:modelValue"],Bo={class:"col-6"},Go=["onUpdate:modelValue"],Ho={class:"col-1 d-flex gap-2"},Fo=["onClick","disabled"],zo={class:"row"},Ko={class:"col-md-6"},qo={class:"row"},Yo={class:"col-6"},jo={class:"input-group"},Wo={class:"col-6"},Xo={class:"input-group"},Jo={class:"row mt-3"},Zo={class:"col-md-6"},Qo={class:"row"},es={class:"col-6"},ts={class:"input-group"},as={class:"col-6"},ls={class:"input-group"},os={class:"row mt-3"},ss={class:"col-md-6"},ns={class:"row"},is={class:"col-6"},ds={class:"input-group"},rs={class:"col-6"},cs={class:"input-group"},us={key:0,class:"card mt-3"},ms={class:"card-body"},ps={class:"d-flex align-items-center mb-2"},vs={class:"form-check form-switch"},gs={class:"row"},bs={class:"col-md-3"},fs=["disabled"],ys={class:"col-md-3"},hs=["disabled"],_s={class:"col-md-3"},ks=["disabled"],Ss={class:"col-md-3"},ws=["disabled"],Cs={key:0},$s={class:"card"},Is={class:"card-body"},Ts={class:"mb-3"},As={key:1},Rs={class:"card"},Ns={class:"card-body"},Es={class:"mb-3"},Ms={class:"col-4"},Ds=["onUpdate:modelValue"],Us={class:"col-3"},xs=["onUpdate:modelValue"],Ps={class:"col-4"},Ls=["onUpdate:modelValue"],Vs={class:"col-1 d-flex align-items-end gap-2"},Os=["onClick","disabled"],Bs={class:"modal-footer"},Gs={class:"ms-auto d-flex gap-2"},Hs=["disabled"],Fs=["disabled"],zs=["disabled"],Ks=ue({__name:"softwareCatalogWizard",props:{show:{type:Boolean},mode:{}},emits:["created","updated"],setup(H,{expose:P,emit:F}){const R=H,D=F,w=ge(),b=h(1),C=h(!1),d=h(!1),$=h(0),N=h({}),f=h(null),y=h(!1);ke(()=>{f.value&&(f.value.addEventListener("show.bs.modal",_),f.value.addEventListener("hide.bs.modal",S)),fe()}),Ye(()=>{f.value&&(f.value.removeEventListener("show.bs.modal",_),f.value.removeEventListener("hide.bs.modal",S))});const _=()=>{d.value=!0,R.mode==="new"&&j()},S=()=>{d.value=!1,y.value=!1},s=h({id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null}),T=h([{refId:0,refValue:"",refDesc:"",refType:"URL"}]),v=h([{targetPort:80,hostPort:8080,protocol:"TCP"}]),g=te(()=>b.value===1?s.value.target&&s.value.category&&s.value.packageName&&s.value.version:b.value===2?s.value.name.trim().length>0&&s.value.summary.trim().length>0&&s.value.description.trim().length>0:b.value===3?s.value.minCpu>0&&s.value.minMemory>0&&s.value.minDisk>0&&s.value.recommendedCpu>0&&s.value.recommendedMemory>0&&s.value.recommendedDisk>0:b.value===3&&s.value.hpaEnabled?s.value.minReplicas>0&&s.value.maxReplicas>0&&s.value.cpuThreshold>0&&s.value.memoryThreshold>0:(console.log(v.value),b.value===3&&s.value.target==="VM"?s.value.defaultPort>0:b.value===4&&s.value.target==="K8S"?(console.log(v.value.length),v.value.length>0?v.value.every(k=>k.targetPort>0&&k.hostPort>0&&k.protocol):!1):b.value===4&&s.value.ingressEnabled?s.value.ingressUrl.trim().length>0:!0)),A=()=>{g.value&&b.value<4&&(b.value+=1)},J=()=>{b.value>1&&(b.value-=1)},j=()=>{b.value=1,s.value={id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null},T.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],v.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}]},ne=()=>{T.value.push({refId:0,refValue:"",refDesc:"",refType:"URL"})},I=k=>{T.value.length>1&&T.value.splice(k,1)},E=()=>{v.value.push({targetPort:80,hostPort:8080,protocol:"TCP"})},z=k=>{v.value.length>1&&v.value.splice(k,1)},K=()=>{if(f.value){d.value=!1;const k=f.value.querySelector('[data-bs-dismiss="modal"]');if(k)k.click();else try{const t=window.bootstrap;if(t!=null&&t.Modal)(t.Modal.getInstance(f.value)||new t.Modal(f.value)).hide();else{f.value.classList.remove("show"),f.value.style.display="none",document.body.classList.remove("modal-open");const p=document.querySelector(".modal-backdrop");p==null||p.remove()}}catch(t){console.warn("Modal close failed:",t)}}},oe=async()=>{try{s.value.catalogRefs=T.value.filter(k=>k.refValue.trim()),s.value.target==="K8S"&&(s.value.ports=v.value.filter(k=>k.targetPort&&k.hostPort)),s.value.target==="VM"?s.value.sourceType="DOCKERHUB":s.value.target==="K8S"&&(s.value.sourceType="ARTIFACTHUB"),await nt(s.value),w.success("Registration Success"),K(),D("created")}catch{w.error("Registration Failed")}},me=async()=>{try{s.value.catalogRefs=T.value.filter(k=>k.refValue.trim()),s.value.target==="K8S"&&(s.value.ports=v.value.filter(k=>k.targetPort&&k.hostPort)),s.value.target==="VM"?s.value.sourceType="DOCKERHUB":s.value.target==="K8S"&&(s.value.sourceType="ARTIFACTHUB"),await it(s.value),w.success("Update Success"),K(),D("updated")}catch{w.error("Update Failed")}},ie=async()=>{try{if(!$.value)return;N.value&&N.value.category&&(C.value=!0,s.value.target=N.value.packageInfo!==null?"VM":"K8S",s.value.category=N.value.category,N.value.packageInfo!==null?(s.value.packageName=N.value.packageInfo.packageName,s.value.version=N.value.packageInfo.packageVersion):N.value.helmChart!==null&&(s.value.packageName=N.value.helmChart.chartName,s.value.version=N.value.helmChart.chartVersion),C.value=!1),await de()}catch{w.error("Failed to load catalog data"),C.value=!1}},de=async()=>{try{if(!$.value)return;const{data:k}=await dt($.value);C.value=!0,s.value={...s.value,...k,target:k.packageInfo!==null?"VM":"K8S"},k.packageInfo!==null&&(s.value.packageName=k.packageInfo.packageName,s.value.version=k.packageInfo.packageVersion),k.helmChart!==null&&(s.value.packageName=k.helmChart.chartName,s.value.version=k.helmChart.chartVersion),k.catalogRefs&&k.catalogRefs.length>0?T.value=k.catalogRefs.map(t=>({refId:t.id||0,refValue:t.refValue||"",refDesc:t.refDesc||"",refType:t.refType||"URL"})):T.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],k.ports&&k.ports.length>0?v.value=k.ports.map(t=>({targetPort:t.targetPort||80,hostPort:t.hostPort||8080,protocol:t.protocol||"TCP"})):v.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}],await fe(),s.value.category&&(await he(),s.value.packageName&&await ee()),C.value=!1}catch{w.error("Failed to load catalog data"),C.value=!1}},W=k=>{g.value&&(b.value=k)};Re(()=>s.value.target,k=>{k&&(R.mode==="new"&&(s.value.category="",s.value.packageName="",s.value.version=""),fe())});const be=h([]),fe=async()=>{if(R.mode==="new"&&(be.value=[],pe.value=[],le.value=[],s.value.category="",s.value.packageName="",s.value.version=""),s.value.target){const k={target:s.value.target==="VM"?"DOCKER":"HELM"},{data:t}=await st(k);be.value=t}};Re(()=>s.value.category,k=>{k&&(R.mode==="new"&&(s.value.packageName="",s.value.version=""),he())});const pe=h([]),he=async()=>{R.mode==="new"&&(pe.value=[],le.value=[],s.value.packageName="",s.value.version="");const k={target:s.value.target==="VM"?"DOCKER":"HELM",category:s.value.category||""},{data:t}=await rt(k);pe.value=t};Re(()=>s.value.packageName,k=>{k&&(R.mode==="new"&&(s.value.version=""),ee())});const le=h([]),ee=async()=>{R.mode==="new"&&(le.value=[],s.value.version="");const k={target:s.value.target==="VM"?"DOCKER":"HELM",packageName:s.value.packageName||""},{data:t}=await ct(k);R.mode==="new"?t.forEach(p=>{p.isUsed||le.value.push(p)}):le.value=t};return P({loadCatalogDataWithCategoryInit:ie,initForCreate:()=>{j(),b.value=1},initForUpdate:(k,t)=>{$.value=k,N.value=t,b.value=1,ie()}}),(k,t)=>(u(),m("div",{class:"modal fade",id:"modal-wizard",tabindex:"-1",ref_key:"wizardModal",ref:f},[e("div",io,[e("div",ro,[e("div",co,[e("h5",uo,i(R.mode==="update"?"Application Update":"Application Registration"),1),t[25]||(t[25]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",mo,[e("ul",po,[e("li",vo,[e("a",{class:q(["nav-link",{active:b.value===1}]),href:"javascript:void(0);",onClick:t[0]||(t[0]=p=>W(1))},"1. Package",2)]),e("li",go,[e("a",{class:q(["nav-link",{active:b.value===2}]),href:"javascript:void(0);",onClick:t[1]||(t[1]=p=>W(2))},"2. General",2)]),e("li",bo,[e("a",{class:q(["nav-link",{active:b.value===3}]),href:"javascript:void(0);",onClick:t[2]||(t[2]=p=>W(3))},"3. Resource Requirements",2)]),e("li",fo,[e("a",{class:q(["nav-link",{active:b.value===4}]),href:"javascript:void(0);",onClick:t[3]||(t[3]=p=>W(4))},"4. Network",2)])]),M(e("div",null,[e("div",yo,[t[28]||(t[28]=e("label",{class:"form-label required"},"Target",-1)),e("div",ho,[e("div",_o,[M(e("input",{class:"form-check-input",type:"radio",name:"target",value:"VM","onUpdate:modelValue":t[4]||(t[4]=p=>s.value.target=p),id:"targetVM",disabled:R.mode==="update"},null,8,ko),[[Ge,s.value.target]]),t[26]||(t[26]=e("label",{class:"form-check-label",for:"targetVM"},"VM",-1))]),e("div",So,[M(e("input",{class:"form-check-input",type:"radio",name:"target",value:"K8S","onUpdate:modelValue":t[5]||(t[5]=p=>s.value.target=p),id:"targetK8S",disabled:R.mode==="update"},null,8,wo),[[Ge,s.value.target]]),t[27]||(t[27]=e("label",{class:"form-check-label",for:"targetK8S"},"K8S",-1))])])]),e("div",Co,[t[30]||(t[30]=e("label",{class:"form-label required"},"Category",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":t[6]||(t[6]=p=>s.value.category=p),disabled:R.mode==="update"},[t[29]||(t[29]=e("option",{value:""},"Select Category",-1)),(u(!0),m(G,null,X(be.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,Io))),128))],8,$o),[[ve,s.value.category]])]),e("div",To,[e("div",Ao,[t[32]||(t[32]=e("label",{class:"form-label required"},"Package",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":t[7]||(t[7]=p=>s.value.packageName=p),disabled:R.mode==="update"},[t[31]||(t[31]=e("option",{value:""},"Select Package",-1)),(u(!0),m(G,null,X(pe.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,No))),128))],8,Ro),[[ve,s.value.packageName]])]),e("div",Eo,[t[34]||(t[34]=e("label",{class:"form-label required"},"Version",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":t[8]||(t[8]=p=>s.value.version=p),disabled:R.mode==="update"},[t[33]||(t[33]=e("option",{value:""},"Select Version",-1)),(u(!0),m(G,null,X(le.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,Do))),128))],8,Mo),[[ve,s.value.version]])])])],512),[[Ae,b.value===1]]),M(e("div",null,[e("div",Uo,[t[35]||(t[35]=e("label",{class:"form-label required"},"Application Name",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":t[9]||(t[9]=p=>s.value.name=p),placeholder:"Application name"},null,512),[[B,s.value.name]])]),e("div",xo,[t[36]||(t[36]=e("label",{class:"form-label required"},"Summary",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":t[10]||(t[10]=p=>s.value.summary=p),placeholder:"Application summary"},null,512),[[B,s.value.summary]])]),e("div",Po,[t[37]||(t[37]=e("label",{class:"form-label required"},"Description",-1)),M(e("textarea",{class:"form-control",rows:"4","onUpdate:modelValue":t[11]||(t[11]=p=>s.value.description=p),placeholder:"Application description"},null,512),[[B,s.value.description]])]),e("div",Lo,[t[39]||(t[39]=e("label",{class:"form-label"},"Reference",-1)),(u(!0),m(G,null,X(T.value,(p,ce)=>(u(),m("div",{class:"row g-2 mb-2",key:ce},[e("div",Vo,[M(e("select",{class:"form-select","onUpdate:modelValue":Q=>p.refType=Q},t[38]||(t[38]=[qe('',6)]),8,Oo),[[ve,p.refType]])]),e("div",Bo,[M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":Q=>p.refValue=Q,placeholder:"Ref Value"},null,8,Go),[[B,p.refValue]])]),e("div",Ho,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:Q=>I(ce),disabled:T.value.length<=1},"-",8,Fo)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:ne,style:{color:"gray"}},"+ Add Reference")])],512),[[Ae,b.value===2]]),M(e("div",null,[e("div",zo,[e("div",Ko,[t[44]||(t[44]=e("label",{class:"form-label"},"CPU",-1)),e("div",qo,[e("div",Yo,[t[41]||(t[41]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",jo,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[12]||(t[12]=p=>s.value.minCpu=p),placeholder:"1"},null,512),[[B,s.value.minCpu,void 0,{number:!0}]]),t[40]||(t[40]=e("span",{class:"input-group-text"},"Cores",-1))])]),e("div",Wo,[t[43]||(t[43]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",Xo,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[13]||(t[13]=p=>s.value.recommendedCpu=p),placeholder:"2"},null,512),[[B,s.value.recommendedCpu,void 0,{number:!0}]]),t[42]||(t[42]=e("span",{class:"input-group-text"},"Cores",-1))])])])])]),e("div",Jo,[e("div",Zo,[t[49]||(t[49]=e("label",{class:"form-label"},"Memory",-1)),e("div",Qo,[e("div",es,[t[46]||(t[46]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",ts,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[14]||(t[14]=p=>s.value.minMemory=p),placeholder:"4"},null,512),[[B,s.value.minMemory,void 0,{number:!0}]]),t[45]||(t[45]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",as,[t[48]||(t[48]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",ls,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[15]||(t[15]=p=>s.value.recommendedMemory=p),placeholder:"8"},null,512),[[B,s.value.recommendedMemory,void 0,{number:!0}]]),t[47]||(t[47]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),e("div",os,[e("div",ss,[t[54]||(t[54]=e("label",{class:"form-label"},"Storage",-1)),e("div",ns,[e("div",is,[t[51]||(t[51]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",ds,[M(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":t[16]||(t[16]=p=>s.value.minDisk=p),placeholder:"10"},null,512),[[B,s.value.minDisk,void 0,{number:!0}]]),t[50]||(t[50]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",rs,[t[53]||(t[53]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",cs,[M(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":t[17]||(t[17]=p=>s.value.recommendedDisk=p),placeholder:"20"},null,512),[[B,s.value.recommendedDisk,void 0,{number:!0}]]),t[52]||(t[52]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),s.value.target==="K8S"?(u(),m("div",us,[e("div",ms,[e("div",ps,[t[55]||(t[55]=e("label",{class:"form-check-label me-2"},"K8S HPA",-1)),e("div",vs,[M(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[18]||(t[18]=p=>s.value.hpaEnabled=p)},null,512),[[Ct,s.value.hpaEnabled]])])]),e("div",gs,[e("div",bs,[t[56]||(t[56]=e("label",{class:"form-label"},"minReplicas",-1)),M(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":t[19]||(t[19]=p=>s.value.minReplicas=p),disabled:!s.value.hpaEnabled,placeholder:"1"},null,8,fs),[[B,s.value.minReplicas,void 0,{number:!0}]])]),e("div",ys,[t[57]||(t[57]=e("label",{class:"form-label"},"maxReplicas",-1)),M(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":t[20]||(t[20]=p=>s.value.maxReplicas=p),disabled:!s.value.hpaEnabled,placeholder:"10"},null,8,hs),[[B,s.value.maxReplicas,void 0,{number:!0}]])]),e("div",_s,[t[58]||(t[58]=e("label",{class:"form-label"},"CPU (%)",-1)),M(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":t[21]||(t[21]=p=>s.value.cpuThreshold=p),disabled:!s.value.hpaEnabled,placeholder:"80"},null,8,ks),[[B,s.value.cpuThreshold,void 0,{number:!0}]])]),e("div",Ss,[t[59]||(t[59]=e("label",{class:"form-label"},"Memory (%)",-1)),M(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":t[22]||(t[22]=p=>s.value.memoryThreshold=p),disabled:!s.value.hpaEnabled,placeholder:"80"},null,8,ws),[[B,s.value.memoryThreshold,void 0,{number:!0}]])])])])])):Y("",!0)],512),[[Ae,b.value===3]]),M(e("div",null,[s.value.target==="VM"?(u(),m("div",Cs,[e("div",$s,[t[61]||(t[61]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",Is,[e("div",Ts,[t[60]||(t[60]=e("label",{class:"form-label"},"Port",-1)),M(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":t[23]||(t[23]=p=>s.value.defaultPort=p),placeholder:"80"},null,512),[[B,s.value.defaultPort,void 0,{number:!0}]])])])])])):Y("",!0),s.value.target==="K8S"?(u(),m("div",As,[e("div",Rs,[t[67]||(t[67]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",Ns,[e("div",Es,[t[66]||(t[66]=e("label",{class:"form-label"},"Port",-1)),(u(!0),m(G,null,X(v.value,(p,ce)=>(u(),m("div",{class:"row g-2 mb-2",key:ce},[e("div",Ms,[t[62]||(t[62]=e("label",{class:"form-label small"},"Target Port",-1)),M(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":Q=>p.targetPort=Q,placeholder:"80"},null,8,Ds),[[B,p.targetPort,void 0,{number:!0}]])]),e("div",Us,[t[64]||(t[64]=e("label",{class:"form-label small"},"Protocol",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":Q=>p.protocol=Q},t[63]||(t[63]=[e("option",{value:"TCP"},"TCP",-1),e("option",{value:"UDP"},"UDP",-1),e("option",{value:"SCTP"},"SCTP",-1)]),8,xs),[[ve,p.protocol]])]),e("div",Ps,[t[65]||(t[65]=e("label",{class:"form-label small"},"Host Port",-1)),M(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":Q=>p.hostPort=Q,placeholder:"8080"},null,8,Ls),[[B,p.hostPort,void 0,{number:!0}]])]),e("div",Vs,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:Q=>z(ce),disabled:v.value.length<=1},"-",8,Os)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:E,style:{color:"gray"}},"+ Add Port Mapping")])])])])):Y("",!0)],512),[[Ae,b.value===4]])]),e("div",Bs,[e("a",{class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:j}," Cancel "),e("div",Gs,[e("button",{class:"btn btn-outline-secondary",disabled:b.value===1,onClick:J},"Prev",8,Hs),b.value<4?(u(),m("button",{key:0,class:"btn btn-primary",disabled:!g.value,onClick:A},"Next",8,Fs)):(u(),m("button",{key:1,class:"btn btn-primary",disabled:!g.value,onClick:t[24]||(t[24]=p=>R.mode==="update"?me():oe())},i(R.mode==="update"?"Update":"Create"),9,zs))])])])])],512))}}),qs=Ne(Ks,[["__scopeId","data-v-8dc8097e"]]),Ys={class:"modal-dialog",role:"document"},js={class:"modal-content"},Ws={class:"modal-body"},Xs={class:"modal-footer"},Js=["disabled"],Zs={key:0,class:"spinner-border spinner-border-sm me-2",role:"status"},Qs=ue({__name:"DeleteConfirmModal",props:{targetCatalog:{}},emits:["deleted","close"],setup(H,{expose:P,emit:F}){const R=H,D=F,w=ge(),b=h(!1),C=h(null),d=()=>{if(C.value)try{const _=window.bootstrap;if(_&&_.Modal)new _.Modal(C.value).show();else{C.value.classList.add("show"),C.value.style.display="block",document.body.classList.add("modal-open");const S=document.createElement("div");S.className="modal-backdrop fade show",S.id="delete-modal-backdrop",document.body.appendChild(S)}}catch(_){console.warn("Failed to show modal with Bootstrap, using fallback:",_),C.value.classList.add("show"),C.value.style.display="block",document.body.classList.add("modal-open")}},$=()=>{if(C.value)try{const _=window.bootstrap;if(_&&_.Modal){const S=_.Modal.getInstance(C.value);S?S.hide():N()}else N()}catch(_){console.warn("Failed to hide modal with Bootstrap, using fallback:",_),N()}},N=()=>{if(C.value){C.value.classList.remove("show"),C.value.style.display="none",document.body.classList.remove("modal-open");const _=document.getElementById("delete-modal-backdrop");_&&_.remove(),D("close")}},f=async()=>{var _;if((_=R.targetCatalog)!=null&&_.id){b.value=!0;try{await ut(R.targetCatalog.id),w.success(`${R.targetCatalog.name} catalog has been successfully deleted.`),$(),D("deleted",R.targetCatalog.id)}catch(S){console.error("Delete failed:",S),w.error("Failed to delete catalog.")}finally{b.value=!1}}},y=()=>{D("close")};return ke(()=>{C.value&&C.value.addEventListener("hidden.bs.modal",y)}),Ye(()=>{C.value&&C.value.removeEventListener("hidden.bs.modal",y)}),P({show:d,hide:$}),(_,S)=>(u(),m("div",{class:"modal fade",id:"deleteConfirmModal",tabindex:"-1",ref_key:"deleteModal",ref:C,onClick:_e($,["self"])},[e("div",Ys,[e("div",js,[e("div",{class:"modal-header"},[S[0]||(S[0]=e("h5",{class:"modal-title"},"Confirm Catalog Deletion",-1)),e("button",{type:"button",class:"btn-close",onClick:$,"aria-label":"Close"})]),e("div",Ws,[e("p",null,[S[1]||(S[1]=ae("Are you sure you want to delete ")),e("strong",null,i(_.targetCatalog.name),1),ae(" ("+i(_.targetCatalog.category)+") catalog?",1)]),S[2]||(S[2]=e("p",{class:"text-muted"},"This action cannot be undone.",-1))]),e("div",Xs,[e("button",{type:"button",class:"btn btn-secondary",onClick:$},"Cancel"),e("button",{type:"button",class:"btn btn-danger",onClick:f,disabled:b.value},[b.value?(u(),m("span",Zs)):Y("",!0),ae(" "+i(b.value?"Deleting...":"Delete"),1)],8,Js)])])])],512))}}),en={class:"modal-content"},tn={class:"modal-body"},an={class:"row"},ln={class:"col-lg-12"},on={class:"mb-3"},sn={class:"row"},nn={class:"col-lg-12"},dn={class:"mb-3"},rn={class:"row"},cn={class:"col-lg-12"},un={class:"mb-3"},mn=["value"],pn={class:"modal-footer"},vn=ue({__name:"uploadForm",props:{sourceData:{}},emits:["uploaded","close"],setup(H,{expose:P,emit:F}){const R=ge(),D=H,w=F,b=h({path:"",sourceType:"",name:"",tag:""});Re(()=>{var v,g;return[(v=D.sourceData)==null?void 0:v.sourceType,(g=D.sourceData)==null?void 0:g.name]},()=>{var v,g,A,J,j;(v=D.sourceData)!=null&&v.sourceType&&(b.value.sourceType=(g=D.sourceData)==null?void 0:g.sourceType),(A=D.sourceData)!=null&&A.name&&(b.value.name=(J=D.sourceData)==null?void 0:J.name,console.log(b.value.sourceType),b.value.sourceType.toUpperCase()=="DOCKERHUB"?$((j=D.sourceData)==null?void 0:j.name):b.value.sourceType.toUpperCase()=="ARTIFACTHUB"&&N(D.sourceData))},{immediate:!0});const C=h([]);He(()=>{d()});const d=()=>{b.value={path:"",sourceType:"",name:"",tag:""},C.value=[]},$=async v=>{var J;const g={path:((J=D.sourceData)==null?void 0:J.id)||""},{data:A}=await mt(g);C.value=[],A.length>0&&A.forEach(j=>{C.value.push({key:j.name,value:j.name})})},N=async v=>{console.log("sourceData",v);const g={kind:"helm",repository:v.repository.name,packageName:v.name},{data:A}=await pt(g);C.value=[],A.length>0&&A.forEach(J=>{C.value.push({key:J.version,value:J.version})})},f=()=>{if(!b.value.tag.trim()){R.error("Tag is required.");return}const v=je.cloneDeep(D.sourceData);v.tag=b.value.tag,v.sourceType=b.value.sourceType,v.name=b.value.name,w("uploaded",v),d(),s()},y=()=>{s()},_=()=>{d();const v=document.getElementById("upload-form-modal");if(v)try{const g=window.bootstrap;g&&g.Modal?new g.Modal(v).show():S()}catch(g){console.warn("Failed to show modal with Bootstrap, using fallback:",g),S()}},S=()=>{const v=document.getElementById("upload-form-modal");if(v){document.querySelectorAll(".modal-backdrop").forEach(J=>J.remove()),v.classList.add("show"),v.style.display="block",v.style.opacity="1",v.setAttribute("aria-hidden","false"),document.body.classList.add("modal-open");const A=document.createElement("div");A.className="modal-backdrop fade show",A.id="upload-modal-backdrop",document.body.appendChild(A)}},s=()=>{const v=document.getElementById("upload-form-modal");if(v)try{const g=window.bootstrap;if(g&&g.Modal){const A=g.Modal.getInstance(v);A?A.hide():T()}else T()}catch(g){console.warn("Failed to hide modal with Bootstrap, using fallback:",g),T()}},T=()=>{const v=document.getElementById("upload-form-modal");v&&(v.classList.remove("show","fade","in"),v.style.display="none",v.style.opacity="0",v.setAttribute("aria-hidden","true"),document.body.classList.remove("modal-open"),document.body.style.overflow="",document.body.style.paddingRight="",document.querySelectorAll(".modal-backdrop, #upload-modal-backdrop").forEach(A=>A.remove()),w("close"))};return He(()=>{d()}),P({show:_,hide:s}),(v,g)=>(u(),m("div",{class:"modal modal-blur fade",id:"upload-form-modal",tabindex:"-1",role:"dialog","aria-hidden":"true",onClick:y},[e("div",{class:"modal-dialog modal-lg modal-dialog-centered",role:"document",onClick:g[3]||(g[3]=_e(()=>{},["stop"]))},[e("div",en,[e("div",{class:"modal-header"},[g[4]||(g[4]=e("h5",{class:"modal-title"},"Upload Application",-1)),e("button",{type:"button",class:"btn-close",onClick:s,"aria-label":"Close"})]),e("div",tn,[e("form",{onSubmit:_e(f,["prevent"])},[e("div",an,[e("div",ln,[e("div",on,[g[5]||(g[5]=e("label",{class:"form-label"},"Source Type",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g[0]||(g[0]=A=>b.value.sourceType=A),disabled:""},null,512),[[B,b.value.sourceType]])])])]),e("div",sn,[e("div",nn,[e("div",dn,[g[6]||(g[6]=e("label",{class:"form-label"},"Name",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g[1]||(g[1]=A=>b.value.name=A),disabled:""},null,512),[[B,b.value.name]])])])]),e("div",rn,[e("div",cn,[e("div",un,[g[8]||(g[8]=e("label",{class:"form-label"},[ae("Tag "),e("span",{class:"text-red"},"*")],-1)),M(e("select",{class:"form-select","onUpdate:modelValue":g[2]||(g[2]=A=>b.value.tag=A)},[g[7]||(g[7]=e("option",{value:""},"Select Tag",-1)),(u(!0),m(G,null,X(C.value,A=>(u(),m("option",{value:A.value,key:A.key},i(A.value),9,mn))),128))],512),[[ve,b.value.tag]]),g[9]||(g[9]=e("small",{class:"form-hint"},"Please enter the tag for this catalog.",-1))])])])],32)]),e("div",pn,[e("button",{type:"button",class:"btn btn-link link-secondary",onClick:s}," Cancel "),e("button",{type:"submit",class:"btn btn-primary ms-auto",onClick:f},[V(Z(Pt),{class:"icon"}),g[10]||(g[10]=ae(" Upload "))])])])])]))}}),gn=Ne(vn,[["__scopeId","data-v-550ff2f5"]]),bn={ref:"sofwareCatalog"},fn={class:"row"},yn={class:"col-lg-9"},hn={class:"card"},_n={class:"list-group card-list-group",id:"sc-list-group"},kn={class:"row g-2 align-items-center"},Sn={class:"col-auto me-3"},wn=["src","onError"],Cn={key:1,class:"rounded catalog-icon-fallback d-flex align-items-center justify-content-center"},$n=["onClick"],In={class:"text-muted"},Tn=["onClick"],An={class:"text-muted",style:{width:"auto","text-align":"right"}},Rn={style:{color:"#e5b942"}},Nn={style:{color:"#e5b942"}},En={class:"text-muted",style:{width:"80px","text-align":"right"}},Mn={style:{color:"gray"}},Dn={class:"col-3 text-muted"},Un={class:"d-flex justify-content-end"},xn={class:"mouse-hover"},Pn=["onClick"],Ln={class:"text-muted"},Vn=["id"],On={class:"accordion-body pt-0"},Bn=["innerHTML"],Gn=["id"],Hn=["onClick"],Fn=["id"],zn=["id"],Kn={class:"btn btn-sm",style:{"margin-right":"5px"}},qn={class:"btn btn-sm",style:{"margin-right":"5px"}},Yn={class:"btn btn-sm",style:{"margin-right":"5px"}},jn={class:"mt-4"},Wn={class:"d-flex justify-content-between align-items-center mb-2"},Xn=["disabled","onClick"],Jn={key:0,class:"text-center text-muted py-3"},Zn={key:1,class:"table-responsive"},Qn={class:"table table-sm table-vcenter"},ei={key:0},ti={class:"text-end"},ai=["disabled","onClick"],li={class:"col-lg-3"},oi={class:"input-icon mb-3"},si={class:"input-icon-addon"},ni={key:0,class:"col-md-6 col-lg-12",id:"resultDockerHubEmpty"},ii={key:1,class:"row row-cards",id:"resultDockerHubSearch"},di={class:"card"},ri={class:"row row-0"},ci={class:"col-auto"},ui=["src"],mi={class:"col"},pi={class:"card-body"},vi=["href"],gi={class:"text-muted"},bi={class:"col-auto lh-1"},fi={class:"d-flex justify-content-end me-2 mt-4 mouse-hover"},yi={class:"mt-5"},hi={key:0,class:"col-md-6 col-lg-12",id:"resultArtifactHubEmpty"},_i={key:1,class:"row row-cards",id:"resultArtifactHubSearch"},ki={class:"card"},Si={class:"row row-0"},wi={class:"col"},Ci={class:"card-body"},$i=["href"],Ii={class:"text-muted"},Ti={class:"col-auto lh-1"},Ai={class:"d-flex justify-content-end me-2 mt-4 mouse-hover"},Ri=ue({__name:"softwareCatalogList",setup(H){const P=ge(),F=h([]),R=h(null),D=h(null),w=h({}),b=h("new"),C=h({}),d=h(""),$=h({}),N=h(null),f=h(null),y=h({}),_=h(null),S=h(""),s=h([]),T=h([]),v=h(0),g=h(null),A=h("");ke(async()=>{S.value="",j(),document.addEventListener("click",a=>{a.target.closest(".dropdown")||(A.value="")})});const J=()=>{j(),b.value="new",D.value=null,w.value={},R.value=0,C.value={},d.value="",setTimeout(()=>{_.value&&typeof _.value.initForCreate=="function"&&_.value.initForCreate()},100)},j=async()=>{try{await vt(S.value).then(({data:a})=>{je.forEach(a,function(n){n.refData=ne(n.catalogRefs),n.isShow=!1,n.deploymentStatuses=[],n.deploymentStatusLoaded=!1,n.deploymentStatusLoading=!1,n.resolvedLogoUrl=Ee(n),n.logoLoadFailed=!1}),F.value=a})}catch(a){console.log(a),P.error("Unable to retrieve data.")}},ne=a=>a.reduce((n,r)=>(n[r.refType]||(n[r.refType]=[]),n[r.refType].push(r),n),{}),I=async a=>{a.keyCode==13&&(await E(),await z())},E=async()=>{s.value=[];try{const{data:a}=await gt(S.value);if(a.results.length>0)for(let n=0;n<3;n++)s.value.push(a.results[n])}catch(a){console.log(a),P.error("Unable to retrieve data.")}},z=async()=>{T.value=[];try{const{data:a}=await bt(S.value);if(a.packages.length>0)for(let n=0;n<3;n++)T.value.push(a.packages[n])}catch(a){console.log(a),P.error("Unable to retrieve data.")}},K=a=>{const n=F.value.find(r=>r.id===a);D.value=a,w.value=n||{},b.value="update",setTimeout(()=>{_.value&&typeof _.value.initForUpdate=="function"&&_.value.initForUpdate(a,n)},100)},oe=a=>{$.value=a,N.value&&N.value.show()},me=async a=>{await j()},ie=()=>{$.value={}},de=async a=>{const n=F.value[a];n.isShow=!n.isShow,n.isShow&&!n.deploymentStatusLoaded&&await W(n)},W=async a=>{if(a!=null&&a.id){a.deploymentStatusLoading=!0;try{const{data:n}=await _t(a.id);a.deploymentStatuses=be(n),a.deploymentStatusLoaded=!0}catch(n){console.log(n),a.deploymentStatuses=[],P.error("Unable to retrieve deployment status.")}finally{a.deploymentStatusLoading=!1}}},be=a=>{const n=Array.isArray(a==null?void 0:a.deploymentHistories)?a.deploymentHistories:[];return(Array.isArray(a==null?void 0:a.applicationStatuses)?a.applicationStatuses:[]).map((x,U)=>{const l=fe(x,n);return pe(l,x,`status-${x.id||U}`)})},fe=(a,n)=>{if(!a)return null;const r=n.find(x=>a.deploymentHistoryId&&String(a.deploymentHistoryId)===String(x.id));return r||n.find(x=>ye(a.deploymentType,x.deploymentType)&&ye(a.namespace,x.namespace)&&(ye(a.vmId,x.vmId)||ye(a.clusterName,x.clusterName)))},pe=(a,n,r)=>({rowKey:r,deploymentId:(n==null?void 0:n.deploymentHistoryId)||(a==null?void 0:a.id)||null,deploymentType:ee((n==null?void 0:n.deploymentType)||(a==null?void 0:a.deploymentType)),target:ee(he(a,n)),csp:ee(a==null?void 0:a.cloudProvider),status:ee((n==null?void 0:n.status)||(n==null?void 0:n.podStatus)),ipOrEndpoint:ee(le(a,n)),lastCheckedOrDeployedAt:ee(Se(n==null?void 0:n.checkedAt))}),he=(a,n)=>{const r=(n==null?void 0:n.deploymentType)||(a==null?void 0:a.deploymentType),x=(n==null?void 0:n.namespace)||(a==null?void 0:a.namespace),U=(n==null?void 0:n.mciId)||(a==null?void 0:a.mciId),l=(n==null?void 0:n.vmId)||(a==null?void 0:a.vmId),o=(n==null?void 0:n.clusterName)||(a==null?void 0:a.clusterName);return r==="VM"?[x,U,l].filter(Boolean).join(" / "):r==="K8S"?[x,o].filter(Boolean).join(" / "):[x,U,l,o].filter(Boolean).join(" / ")},le=(a,n)=>{const r=(n==null?void 0:n.publicIp)||(a==null?void 0:a.publicIp),x=(n==null?void 0:n.servicePort)||(a==null?void 0:a.servicePort),U=a==null?void 0:a.ingressHost,l=a==null?void 0:a.ingressPath;return r&&x?`${r}:${x}`:r||(U&&l?`${U}${l}`:U||"")},ee=a=>a==null||a===""?"-":a,ye=(a,n)=>!a||!n?!1:String(a)===String(n),Se=a=>{if(!a)return"";const n=new Date(a);return Number.isNaN(n.getTime())?a:n.toLocaleString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})},k=a=>{if(!a)return;v.value=a;const n=document.getElementById("application-detail-modal");if(n)try{window.bootstrap&&window.bootstrap.Modal?new window.bootstrap.Modal(n).show():(n.style.display="block",n.classList.add("show"),document.body.classList.add("modal-open")),setTimeout(()=>{g.value&&g.value.refreshData(v.value)},100)}catch(r){console.error("Error opening detail modal:",r)}},t=(a,n)=>Object.prototype.hasOwnProperty.call(a,n),p=a=>{window.open(a)},ce={"apache tomcat":"/catalog-icons/apache-tomcat.png",redis:"/catalog-icons/redis.svg",nginx:"/catalog-icons/nginx.svg","apache http server":"/catalog-icons/apache-http-server.svg","nexus repository":"/catalog-icons/nexus-repository.svg",mariadb:"/catalog-icons/mariadb.svg",grafana:"/catalog-icons/grafana.svg",prometheus:"/catalog-icons/prometheus.svg",elasticsearch:"/catalog-icons/elasticsearch.svg"},Q=a=>String(a||"").trim().toLowerCase(),we=a=>ce[Q(a==null?void 0:a.name)]||"",Ee=a=>we(a)||(a==null?void 0:a.logoUrlLarge)||(a==null?void 0:a.logoUrlSmall)||"",Ce=a=>{const n=we(a);if(n&&a.resolvedLogoUrl!==n){a.resolvedLogoUrl=n,a.logoLoadFailed=!1;return}a.logoLoadFailed=!0},$e=a=>a.replace(/\\n|\n/g,"
"),Ie=(a,n)=>{y.value=a,y.value.sourceType=n,f.value&&f.value.show()},Te=async a=>{a.sourceType=="DockerHub"?(a.createdAt=a.created_at,a.updatedAt=a.updated_at,a.shortDescription=a.short_description,a.starCount=a.star_count,a.ratePlans=a.rate_plans,delete a.created_at,delete a.updated_at,delete a.short_description,delete a.star_count,delete a.rate_plans,await ft(a)):a.sourceType=="ArtifactHub"&&await yt(a),P.success("Software catalog uploaded successfully!")},Me=()=>{y.value={sourceType:"",name:"",sourceData:{}}};return(a,n)=>(u(),m(G,null,[e("div",bn,[e("div",{class:"d-flex justify-content-between align-items-center mb-3"},[n[1]||(n[1]=e("h2",{class:"mb-0"},"Catalog",-1)),e("button",{class:"btn btn-outline-primary d-none d-sm-inline-block",style:{"margin-right":"315px"},"data-bs-toggle":"modal","data-bs-target":"#modal-wizard",onClick:J}," Regist ")]),e("div",fn,[e("div",yn,[e("div",hn,[e("div",_n,[(u(!0),m(G,null,X(F.value,(r,x)=>(u(),m("div",{class:"list-group-item pe-1",key:x},[e("div",kn,[e("div",Sn,[r.resolvedLogoUrl&&!r.logoLoadFailed?(u(),m("img",{key:0,src:r.resolvedLogoUrl,class:"rounded catalog-icon",alt:"Catalog Icon",width:"40",height:"40",onError:U=>Ce(r)},null,40,wn)):(u(),m("div",Cn,[V(Z(We),{class:"icon",size:"22","stroke-width":"1.75"})]))]),e("div",{class:"col-5",onClick:U=>de(x)},[ae(i(r.name)+" ",1),e("div",In,i(r.summary),1)],8,$n),e("div",{class:"col-3 d-flex justify-content-end",onClick:U=>de(x)},[e("span",An,[V(Z(Lt),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"#e5b942"}),e("span",Rn,i(r.averageRating||0),1),e("span",Nn," ("+i(r.ratingCount||0)+") ",1)]),e("span",En,[V(Z(Mt),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"gray"}),e("span",Mn,i(r.downloadCount||0),1)])],8,Tn),e("div",Dn,[e("div",Un,[e("div",xn,[V(Z(Dt),{class:"me-2 cursor-pointer",size:"15","stroke-width":"2","data-bs-toggle":"modal","data-bs-target":"#modal-wizard",onClick:U=>K(r.id)},null,8,["onClick"]),V(Z(xt),{class:"cursor-pointer",size:"15","stroke-width":"2",onClick:U=>oe(r)},null,8,["onClick"])])]),e("div",{class:"d-flex justify-content-end",onClick:U=>de(x)},[e("span",Ln,i(r.category.length>25?r.category.substring(0,25)+"...":r.category),1)],8,Pn)]),e("div",{id:"accordion_"+r.id,class:"accordion-collapse collapse",style:$t([r.isShow?{display:"block"}:{display:"none"}])},[e("div",On,[e("div",{class:"mt-3 mb-5",innerHTML:$e(r.description)},null,8,Bn),e("div",null,[n[5]||(n[5]=e("strong",null,"Ref Information",-1)),e("ul",{id:`${x}-entity-ul`},[t(r.refData,"HOMEPAGE")?(u(!0),m(G,{key:0},X(r.refData.HOMEPAGE,(U,l)=>(u(),m("li",{key:l},[e("a",{class:"btn",onClick:o=>p(U.refValue)},i(U.refValue),9,Hn)]))),128)):Y("",!0)],8,Gn),n[6]||(n[6]=e("strong",null,"TAGS",-1)),e("ul",{id:`${x}-tag-ul`},[t(r.refData,"TAG")?(u(!0),m(G,{key:0},X(r.refData.TAG,(U,l)=>(u(),m("span",{key:l},"#"+i(U.refValue)+"  ",1))),128)):Y("",!0)],8,Fn),n[7]||(n[7]=e("strong",null,"Recommended Spec",-1)),e("ul",{id:`${x}-tag-ul`},[r.recommendedCpu&&r.recommendedMemory&&r.recommendedDisk?(u(),m(G,{key:0},[e("button",Kn," CPU : "+i(r.recommendedCpu)+" Core ",1),e("button",qn," MEMORY : "+i(r.recommendedMemory)+" GB ",1),e("button",Yn," DISK : "+i(r.recommendedDisk)+" GB ",1)],64)):Y("",!0)],8,zn),e("div",jn,[e("div",Wn,[n[2]||(n[2]=e("strong",null,"Deployment Status",-1)),e("button",{type:"button",class:"btn btn-sm btn-icon btn-ghost-secondary",title:"Refresh deployment status","aria-label":"Refresh deployment status",disabled:r.deploymentStatusLoading,onClick:_e(U=>W(r),["stop"])},[V(Z(Xe),{class:"icon",size:"18","stroke-width":"1.75"})],8,Xn)]),r.deploymentStatusLoading?(u(),m("div",Jn," Loading deployment status... ")):(u(),m("div",Zn,[e("table",Qn,[n[4]||(n[4]=e("thead",null,[e("tr",null,[e("th",null,"Type"),e("th",null,"Target"),e("th",null,"CSP"),e("th",null,"Status"),e("th",null,"IP/Endpoint"),e("th",null,"Last Checked"),e("th",{class:"text-end"},"Detail")])],-1)),e("tbody",null,[r.deploymentStatuses.length===0?(u(),m("tr",ei,n[3]||(n[3]=[e("td",{colspan:"7",class:"text-center text-muted"}," No deployment status available ",-1)]))):Y("",!0),(u(!0),m(G,null,X(r.deploymentStatuses,U=>(u(),m("tr",{key:U.rowKey},[e("td",null,i(U.deploymentType),1),e("td",null,i(U.target),1),e("td",null,i(U.csp),1),e("td",null,[e("span",{class:q(Z(Pe)(U.status))},i(Z(xe)(U.status)),3)]),e("td",null,i(U.ipOrEndpoint),1),e("td",null,i(U.lastCheckedOrDeployedAt),1),e("td",ti,[e("button",{type:"button",class:"btn btn-outline-primary",disabled:!U.deploymentId,onClick:_e(l=>k(U.deploymentId),["stop"])}," Detail ",8,ai)])]))),128))])])]))])])])],12,Vn)])]))),128))])])]),e("div",li,[e("div",oi,[e("span",si,[V(Z(ht),{class:"icon",width:"24",height:"24","stroke-width":"2"})]),M(e("input",{type:"text",class:"form-control",placeholder:"Search…",onKeypress:I,"onUpdate:modelValue":n[0]||(n[0]=r=>S.value=r),id:"inputCatalogSearch"},null,544),[[B,S.value]])]),n[10]||(n[10]=e("h3",{class:"mb-3"}," DOCKERHUB ",-1)),s.value.length<=0?(u(),m("div",ni," There are no related Container Images found. ")):Y("",!0),s.value.length>0?(u(),m("div",ii,[(u(!0),m(G,null,X(s.value,(r,x)=>(u(),m("div",{class:"col-md-6 col-lg-12",key:x},[e("div",di,[e("div",ri,[e("div",ci,[e("img",{src:r.logo_url.large,class:"rounded-start ms-2",alt:"Shape of You",width:"80",height:"80"},null,8,ui)]),e("div",mi,[e("div",pi,[e("a",{href:"https://hub.docker.com/search?q="+S.value,target:"_blank"},i(r==null?void 0:r.name),9,vi),e("div",gi,i((r==null?void 0:r.short_description.length)>30?(r==null?void 0:r.short_description.substring(0,30))+"...":""),1)])]),e("div",bi,[e("div",fi,[V(Z(ze),{class:"cursor-pointer",size:"20","stroke-width":"2",onClick:U=>Ie(r,"DockerHub")},null,8,["onClick"])])])])])]))),128))])):Y("",!0),e("div",yi,[n[9]||(n[9]=e("h3",{class:"mb-3"}," ARTIFACTHUB ",-1)),T.value.length<=0?(u(),m("div",hi," There are no related Helm Charts found. ")):Y("",!0),T.value.length>0?(u(),m("div",_i,[(u(!0),m(G,null,X(T.value,(r,x)=>(u(),m("div",{class:"col-md-6 col-lg-12",key:x},[e("div",ki,[e("div",Si,[n[8]||(n[8]=e("div",{class:"col-auto"},[e("img",{src:"https://artifacthub.io/static/media/placeholder_pkg_helm.png",class:"rounded-start",alt:"Shape of You",width:"80",height:"80"})],-1)),e("div",wi,[e("div",Ci,[e("a",{href:"https://artifacthub.io/packages/search?ts_query_web="+S.value+"&sort=relevance&page=1",target:"_blank"},i(r==null?void 0:r.name),9,$i),e("div",Ii,i((r==null?void 0:r.description.length)>30?(r==null?void 0:r.description.substring(0,30))+"...":""),1)])]),e("div",Ti,[e("div",Ai,[V(Z(ze),{class:"cursor-pointer",size:"20","stroke-width":"2",onClick:U=>Ie(r,"ArtifactHub")},null,8,["onClick"])])])])])]))),128))])):Y("",!0)])])])],512),V(Qs,{ref_key:"deleteConfirmModal",ref:N,"target-catalog":$.value,onDeleted:me,onClose:ie},null,8,["target-catalog"]),V(qs,{ref_key:"wizardModal",ref:_,mode:b.value,onCreated:j,onUpdated:j},null,8,["mode"]),V(gn,{ref_key:"uploadFormModal",ref:f,"source-data":y.value,onUploaded:Te,onClose:Me},null,8,["source-data"]),V(Je,{ref_key:"applicationDetailModalRef",ref:g,"deployment-id":v.value},null,8,["deployment-id"])],64))}}),Ni={class:"page",ref:"sofwareCatalog"},Ei={class:"page-wrapper"},Mi={class:"page-header d-print-none"},Di={class:"container-xxl"},Ui={class:"row g-2 align-items-center"},xi={class:"col-auto ms-auto"},Pi={class:"page-body"},Li={class:"container-xxl"},Vi={class:"row"},Oi={class:"col-lg-12"},Bi={class:"card"},Gi={class:"card-header"},Hi={class:"nav nav-tabs card-header-tabs","data-bs-toggle":"tabs"},Fi={class:"nav-item"},zi={href:"#tabs-catalog",class:"nav-link active","data-bs-toggle":"tab"},Ki={class:"nav-item"},qi={class:"nav-item"},Yi={href:"#tabs-repository",class:"nav-link","data-bs-toggle":"tab"},ji={class:"card-body"},Wi={class:"tab-content"},Xi={class:"tab-pane active show",id:"tabs-catalog"},Ji={class:"tab-pane",id:"tabs-status"},Zi={class:"tab-pane",id:"tabs-repository"},cd=ue({__name:"SoftwareCatalog",setup(H){const P=It(),F=h(""),R=h(""),D=h(!1),w=h(""),b=h(null);ke(async()=>{F.value=P.getNsId()});const C=f=>{R.value=f},d=async()=>{var f;await Tt(),(f=b.value)==null||f.refresh()},$=f=>{w.value=f,D.value=!0},N=()=>{D.value=!1,w.value=""};return(f,y)=>(u(),m(G,null,[e("div",Ni,[e("div",Ei,[e("div",Mi,[e("div",Di,[e("div",Ui,[y[1]||(y[1]=e("div",{class:"col d-flex"},[e("h2",{class:"page-title"},"Software Catalog")],-1)),e("div",xi,[e("button",{class:"btn btn-outline-primary d-none d-sm-inline-block","data-bs-toggle":"modal","data-bs-target":"#install-form",onClick:y[0]||(y[0]=_=>C("Application Installation"))}," DEPLOY ")])])])]),e("div",Pi,[e("div",Li,[e("div",Vi,[e("div",Oi,[e("div",Bi,[e("div",Gi,[e("ul",Hi,[e("li",Fi,[e("a",zi,[V(Z(Et),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[2]||(y[2]=ae(" Catalog "))])]),e("li",Ki,[e("a",{href:"#tabs-status",class:"nav-link","data-bs-toggle":"tab",onClick:d},[V(Z(Nt),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[3]||(y[3]=ae(" Apps Status "))])]),e("li",qi,[e("a",Yi,[V(Z(Ut),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[4]||(y[4]=ae(" Repository "))])])])]),e("div",ji,[e("div",Wi,[e("div",Xi,[e("div",null,[V(Ri,{nsId:F.value},null,8,["nsId"])])]),e("div",Ji,[e("div",null,[V(no,{ref_key:"applicationStatusListRef",ref:b},null,512)])]),e("div",Zi,[e("div",null,[D.value?(u(),Fe(Rt,{key:1,embedded:!0,"repository-name":w.value,onBackToList:N},null,8,["repository-name"])):(u(),Fe(At,{key:0,embedded:!0,onOpenDetail:$}))])])])])])])])])])])],512),V(kt,{"ns-id":F.value,title:R.value},null,8,["ns-id","title"])],64))}});export{cd as default}; +
`};return P({refresh:S}),(I,N)=>(u(),m(G,null,[e("div",eo,[e("div",to,[e("div",ao,[e("div",lo,[N[1]||(N[1]=e("h3",{class:"card-title"},[e("strong",null,"Apps Status")],-1)),e("div",oo,[e("span",so,i(w.value),1),e("a",{class:"btn btn-outline-primary d-none d-sm-inline-block",onClick:S},[V(Z(Xe),{class:"icon icon-tabler",size:20,"stroke-width":"1"}),N[0]||(N[0]=ae(" Refresh "))])])])])]),V(St,{columns:D.value,"table-data":R.value},null,8,["columns","table-data"])]),V(Wt,{ref_key:"applicationActionConfirmModalRef",ref:_,title:b.value,applicationStatusId:C.value,type:d.value,applicationName:$.value,onGetApplicationsStatusList:S},null,8,["title","applicationStatusId","type","applicationName"]),V(ca,{catalogId:E.value,applicationName:$.value,onRatingSubmitted:S},null,8,["catalogId","applicationName"]),V(Je,{ref_key:"applicationDetailModalRef",ref:y,"modal-id":Ke,deploymentId:f.value},null,8,["deploymentId"])],64))}}),io={class:"modal-dialog modal-lg",role:"document"},ro={class:"modal-content"},co={class:"modal-header"},uo={class:"modal-title"},mo={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},po={class:"nav nav-tabs mb-3"},vo={class:"nav-item"},go={class:"nav-item"},bo={class:"nav-item"},fo={class:"nav-item"},yo={class:"mb-3"},ho={class:"d-flex align-items-center"},_o={class:"form-check me-3"},ko=["disabled"],So={class:"form-check"},wo=["disabled"],Co={class:"mb-3"},$o=["disabled"],Io=["value"],To={class:"w-100 d-flex justify-content-between"},Ao={class:"mb-3 w-50",style:{"margin-right":"10px"}},Ro=["disabled"],Eo=["value"],No={class:"mb-3 w-50"},Mo=["disabled"],Do=["value"],xo={class:"mb-3"},Uo={class:"mb-3"},Po={class:"mb-3"},Lo={class:"mb-3"},Vo={class:"col-5"},Oo=["onUpdate:modelValue"],Bo={class:"col-6"},Go=["onUpdate:modelValue"],Ho={class:"col-1 d-flex gap-2"},Fo=["onClick","disabled"],zo={class:"row"},Ko={class:"col-md-6"},qo={class:"row"},Yo={class:"col-6"},jo={class:"input-group"},Wo={class:"col-6"},Xo={class:"input-group"},Jo={class:"row mt-3"},Zo={class:"col-md-6"},Qo={class:"row"},es={class:"col-6"},ts={class:"input-group"},as={class:"col-6"},ls={class:"input-group"},os={class:"row mt-3"},ss={class:"col-md-6"},ns={class:"row"},is={class:"col-6"},ds={class:"input-group"},rs={class:"col-6"},cs={class:"input-group"},us={key:0,class:"card mt-3"},ms={class:"card-body"},ps={class:"d-flex align-items-center mb-2"},vs={class:"form-check form-switch"},gs={class:"row"},bs={class:"col-md-3"},fs=["disabled"],ys={class:"col-md-3"},hs=["disabled"],_s={class:"col-md-3"},ks=["disabled"],Ss={class:"col-md-3"},ws=["disabled"],Cs={key:0},$s={class:"card"},Is={class:"card-body"},Ts={class:"mb-3"},As={key:1},Rs={class:"card"},Es={class:"card-body"},Ns={class:"mb-3"},Ms={class:"col-4"},Ds=["onUpdate:modelValue"],xs={class:"col-3"},Us=["onUpdate:modelValue"],Ps={class:"col-4"},Ls=["onUpdate:modelValue"],Vs={class:"col-1 d-flex align-items-end gap-2"},Os=["onClick","disabled"],Bs={class:"modal-footer"},Gs={class:"ms-auto d-flex gap-2"},Hs=["disabled"],Fs=["disabled"],zs=["disabled"],Ks=ue({__name:"softwareCatalogWizard",props:{show:{type:Boolean},mode:{}},emits:["created","updated"],setup(H,{expose:P,emit:F}){const R=H,D=F,w=ge(),b=h(1),C=h(!1),d=h(!1),$=h(0),E=h({}),f=h(null),y=h(!1);ke(()=>{f.value&&(f.value.addEventListener("show.bs.modal",_),f.value.addEventListener("hide.bs.modal",S)),fe()}),Ye(()=>{f.value&&(f.value.removeEventListener("show.bs.modal",_),f.value.removeEventListener("hide.bs.modal",S))});const _=()=>{d.value=!0,R.mode==="new"&&j()},S=()=>{d.value=!1,y.value=!1},s=h({id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null}),T=h([{refId:0,refValue:"",refDesc:"",refType:"URL"}]),v=h([{targetPort:80,hostPort:8080,protocol:"TCP"}]),g=te(()=>b.value===1?s.value.target&&s.value.category&&s.value.packageName&&s.value.version:b.value===2?s.value.name.trim().length>0&&s.value.summary.trim().length>0&&s.value.description.trim().length>0:b.value===3?s.value.minCpu>0&&s.value.minMemory>0&&s.value.minDisk>0&&s.value.recommendedCpu>0&&s.value.recommendedMemory>0&&s.value.recommendedDisk>0:b.value===3&&s.value.hpaEnabled?s.value.minReplicas>0&&s.value.maxReplicas>0&&s.value.cpuThreshold>0&&s.value.memoryThreshold>0:(console.log(v.value),b.value===3&&s.value.target==="VM"?s.value.defaultPort>0:b.value===4&&s.value.target==="K8S"?(console.log(v.value.length),v.value.length>0?v.value.every(k=>k.targetPort>0&&k.hostPort>0&&k.protocol):!1):b.value===4&&s.value.ingressEnabled?s.value.ingressUrl.trim().length>0:!0)),A=()=>{g.value&&b.value<4&&(b.value+=1)},J=()=>{b.value>1&&(b.value-=1)},j=()=>{b.value=1,s.value={id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null},T.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],v.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}]},ne=()=>{T.value.push({refId:0,refValue:"",refDesc:"",refType:"URL"})},I=k=>{T.value.length>1&&T.value.splice(k,1)},N=()=>{v.value.push({targetPort:80,hostPort:8080,protocol:"TCP"})},z=k=>{v.value.length>1&&v.value.splice(k,1)},q=()=>{if(f.value){d.value=!1;const k=f.value.querySelector('[data-bs-dismiss="modal"]');if(k)k.click();else try{const t=window.bootstrap;if(t!=null&&t.Modal)(t.Modal.getInstance(f.value)||new t.Modal(f.value)).hide();else{f.value.classList.remove("show"),f.value.style.display="none",document.body.classList.remove("modal-open");const p=document.querySelector(".modal-backdrop");p==null||p.remove()}}catch(t){console.warn("Modal close failed:",t)}}},oe=async()=>{try{s.value.catalogRefs=T.value.filter(k=>k.refValue.trim()),s.value.target==="K8S"&&(s.value.ports=v.value.filter(k=>k.targetPort&&k.hostPort)),s.value.target==="VM"?s.value.sourceType="DOCKERHUB":s.value.target==="K8S"&&(s.value.sourceType="ARTIFACTHUB"),await nt(s.value),w.success("Registration Success"),q(),D("created")}catch{w.error("Registration Failed")}},me=async()=>{try{s.value.catalogRefs=T.value.filter(k=>k.refValue.trim()),s.value.target==="K8S"&&(s.value.ports=v.value.filter(k=>k.targetPort&&k.hostPort)),s.value.target==="VM"?s.value.sourceType="DOCKERHUB":s.value.target==="K8S"&&(s.value.sourceType="ARTIFACTHUB"),await it(s.value),w.success("Update Success"),q(),D("updated")}catch{w.error("Update Failed")}},ie=async()=>{try{if(!$.value)return;E.value&&E.value.category&&(C.value=!0,s.value.target=E.value.packageInfo!==null?"VM":"K8S",s.value.category=E.value.category,E.value.packageInfo!==null?(s.value.packageName=E.value.packageInfo.packageName,s.value.version=E.value.packageInfo.packageVersion):E.value.helmChart!==null&&(s.value.packageName=E.value.helmChart.chartName,s.value.version=E.value.helmChart.chartVersion),C.value=!1),await de()}catch{w.error("Failed to load catalog data"),C.value=!1}},de=async()=>{try{if(!$.value)return;const{data:k}=await dt($.value);C.value=!0,s.value={...s.value,...k,target:k.packageInfo!==null?"VM":"K8S"},k.packageInfo!==null&&(s.value.packageName=k.packageInfo.packageName,s.value.version=k.packageInfo.packageVersion),k.helmChart!==null&&(s.value.packageName=k.helmChart.chartName,s.value.version=k.helmChart.chartVersion),k.catalogRefs&&k.catalogRefs.length>0?T.value=k.catalogRefs.map(t=>({refId:t.id||0,refValue:t.refValue||"",refDesc:t.refDesc||"",refType:t.refType||"URL"})):T.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],k.ports&&k.ports.length>0?v.value=k.ports.map(t=>({targetPort:t.targetPort||80,hostPort:t.hostPort||8080,protocol:t.protocol||"TCP"})):v.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}],await fe(),s.value.category&&(await he(),s.value.packageName&&await ee()),C.value=!1}catch{w.error("Failed to load catalog data"),C.value=!1}},W=k=>{g.value&&(b.value=k)};Re(()=>s.value.target,k=>{k&&(R.mode==="new"&&(s.value.category="",s.value.packageName="",s.value.version=""),fe())});const be=h([]),fe=async()=>{if(R.mode==="new"&&(be.value=[],pe.value=[],le.value=[],s.value.category="",s.value.packageName="",s.value.version=""),s.value.target){const k={target:s.value.target==="VM"?"DOCKER":"HELM"},{data:t}=await st(k);be.value=t}};Re(()=>s.value.category,k=>{k&&(R.mode==="new"&&(s.value.packageName="",s.value.version=""),he())});const pe=h([]),he=async()=>{R.mode==="new"&&(pe.value=[],le.value=[],s.value.packageName="",s.value.version="");const k={target:s.value.target==="VM"?"DOCKER":"HELM",category:s.value.category||""},{data:t}=await rt(k);pe.value=t};Re(()=>s.value.packageName,k=>{k&&(R.mode==="new"&&(s.value.version=""),ee())});const le=h([]),ee=async()=>{R.mode==="new"&&(le.value=[],s.value.version="");const k={target:s.value.target==="VM"?"DOCKER":"HELM",packageName:s.value.packageName||""},{data:t}=await ct(k);R.mode==="new"?t.forEach(p=>{p.isUsed||le.value.push(p)}):le.value=t};return P({loadCatalogDataWithCategoryInit:ie,initForCreate:()=>{j(),b.value=1},initForUpdate:(k,t)=>{$.value=k,E.value=t,b.value=1,ie()}}),(k,t)=>(u(),m("div",{class:"modal fade",id:"modal-wizard",tabindex:"-1",ref_key:"wizardModal",ref:f},[e("div",io,[e("div",ro,[e("div",co,[e("h5",uo,i(R.mode==="update"?"Application Update":"Application Registration"),1),t[25]||(t[25]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",mo,[e("ul",po,[e("li",vo,[e("a",{class:K(["nav-link",{active:b.value===1}]),href:"javascript:void(0);",onClick:t[0]||(t[0]=p=>W(1))},"1. Package",2)]),e("li",go,[e("a",{class:K(["nav-link",{active:b.value===2}]),href:"javascript:void(0);",onClick:t[1]||(t[1]=p=>W(2))},"2. General",2)]),e("li",bo,[e("a",{class:K(["nav-link",{active:b.value===3}]),href:"javascript:void(0);",onClick:t[2]||(t[2]=p=>W(3))},"3. Resource Requirements",2)]),e("li",fo,[e("a",{class:K(["nav-link",{active:b.value===4}]),href:"javascript:void(0);",onClick:t[3]||(t[3]=p=>W(4))},"4. Network",2)])]),M(e("div",null,[e("div",yo,[t[28]||(t[28]=e("label",{class:"form-label required"},"Target",-1)),e("div",ho,[e("div",_o,[M(e("input",{class:"form-check-input",type:"radio",name:"target",value:"VM","onUpdate:modelValue":t[4]||(t[4]=p=>s.value.target=p),id:"targetVM",disabled:R.mode==="update"},null,8,ko),[[Ge,s.value.target]]),t[26]||(t[26]=e("label",{class:"form-check-label",for:"targetVM"},"VM",-1))]),e("div",So,[M(e("input",{class:"form-check-input",type:"radio",name:"target",value:"K8S","onUpdate:modelValue":t[5]||(t[5]=p=>s.value.target=p),id:"targetK8S",disabled:R.mode==="update"},null,8,wo),[[Ge,s.value.target]]),t[27]||(t[27]=e("label",{class:"form-check-label",for:"targetK8S"},"K8S",-1))])])]),e("div",Co,[t[30]||(t[30]=e("label",{class:"form-label required"},"Category",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":t[6]||(t[6]=p=>s.value.category=p),disabled:R.mode==="update"},[t[29]||(t[29]=e("option",{value:""},"Select Category",-1)),(u(!0),m(G,null,X(be.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,Io))),128))],8,$o),[[ve,s.value.category]])]),e("div",To,[e("div",Ao,[t[32]||(t[32]=e("label",{class:"form-label required"},"Package",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":t[7]||(t[7]=p=>s.value.packageName=p),disabled:R.mode==="update"},[t[31]||(t[31]=e("option",{value:""},"Select Package",-1)),(u(!0),m(G,null,X(pe.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,Eo))),128))],8,Ro),[[ve,s.value.packageName]])]),e("div",No,[t[34]||(t[34]=e("label",{class:"form-label required"},"Version",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":t[8]||(t[8]=p=>s.value.version=p),disabled:R.mode==="update"},[t[33]||(t[33]=e("option",{value:""},"Select Version",-1)),(u(!0),m(G,null,X(le.value,p=>(u(),m("option",{value:p.value,key:p.key},i(p.value),9,Do))),128))],8,Mo),[[ve,s.value.version]])])])],512),[[Ae,b.value===1]]),M(e("div",null,[e("div",xo,[t[35]||(t[35]=e("label",{class:"form-label required"},"Application Name",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":t[9]||(t[9]=p=>s.value.name=p),placeholder:"Application name"},null,512),[[B,s.value.name]])]),e("div",Uo,[t[36]||(t[36]=e("label",{class:"form-label required"},"Summary",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":t[10]||(t[10]=p=>s.value.summary=p),placeholder:"Application summary"},null,512),[[B,s.value.summary]])]),e("div",Po,[t[37]||(t[37]=e("label",{class:"form-label required"},"Description",-1)),M(e("textarea",{class:"form-control",rows:"4","onUpdate:modelValue":t[11]||(t[11]=p=>s.value.description=p),placeholder:"Application description"},null,512),[[B,s.value.description]])]),e("div",Lo,[t[39]||(t[39]=e("label",{class:"form-label"},"Reference",-1)),(u(!0),m(G,null,X(T.value,(p,ce)=>(u(),m("div",{class:"row g-2 mb-2",key:ce},[e("div",Vo,[M(e("select",{class:"form-select","onUpdate:modelValue":Q=>p.refType=Q},t[38]||(t[38]=[qe('',6)]),8,Oo),[[ve,p.refType]])]),e("div",Bo,[M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":Q=>p.refValue=Q,placeholder:"Ref Value"},null,8,Go),[[B,p.refValue]])]),e("div",Ho,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:Q=>I(ce),disabled:T.value.length<=1},"-",8,Fo)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:ne,style:{color:"gray"}},"+ Add Reference")])],512),[[Ae,b.value===2]]),M(e("div",null,[e("div",zo,[e("div",Ko,[t[44]||(t[44]=e("label",{class:"form-label"},"CPU",-1)),e("div",qo,[e("div",Yo,[t[41]||(t[41]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",jo,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[12]||(t[12]=p=>s.value.minCpu=p),placeholder:"1"},null,512),[[B,s.value.minCpu,void 0,{number:!0}]]),t[40]||(t[40]=e("span",{class:"input-group-text"},"Cores",-1))])]),e("div",Wo,[t[43]||(t[43]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",Xo,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[13]||(t[13]=p=>s.value.recommendedCpu=p),placeholder:"2"},null,512),[[B,s.value.recommendedCpu,void 0,{number:!0}]]),t[42]||(t[42]=e("span",{class:"input-group-text"},"Cores",-1))])])])])]),e("div",Jo,[e("div",Zo,[t[49]||(t[49]=e("label",{class:"form-label"},"Memory",-1)),e("div",Qo,[e("div",es,[t[46]||(t[46]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",ts,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[14]||(t[14]=p=>s.value.minMemory=p),placeholder:"4"},null,512),[[B,s.value.minMemory,void 0,{number:!0}]]),t[45]||(t[45]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",as,[t[48]||(t[48]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",ls,[M(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":t[15]||(t[15]=p=>s.value.recommendedMemory=p),placeholder:"8"},null,512),[[B,s.value.recommendedMemory,void 0,{number:!0}]]),t[47]||(t[47]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),e("div",os,[e("div",ss,[t[54]||(t[54]=e("label",{class:"form-label"},"Storage",-1)),e("div",ns,[e("div",is,[t[51]||(t[51]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",ds,[M(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":t[16]||(t[16]=p=>s.value.minDisk=p),placeholder:"10"},null,512),[[B,s.value.minDisk,void 0,{number:!0}]]),t[50]||(t[50]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",rs,[t[53]||(t[53]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",cs,[M(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":t[17]||(t[17]=p=>s.value.recommendedDisk=p),placeholder:"20"},null,512),[[B,s.value.recommendedDisk,void 0,{number:!0}]]),t[52]||(t[52]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),s.value.target==="K8S"?(u(),m("div",us,[e("div",ms,[e("div",ps,[t[55]||(t[55]=e("label",{class:"form-check-label me-2"},"K8S HPA",-1)),e("div",vs,[M(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[18]||(t[18]=p=>s.value.hpaEnabled=p)},null,512),[[Ct,s.value.hpaEnabled]])])]),e("div",gs,[e("div",bs,[t[56]||(t[56]=e("label",{class:"form-label"},"minReplicas",-1)),M(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":t[19]||(t[19]=p=>s.value.minReplicas=p),disabled:!s.value.hpaEnabled,placeholder:"1"},null,8,fs),[[B,s.value.minReplicas,void 0,{number:!0}]])]),e("div",ys,[t[57]||(t[57]=e("label",{class:"form-label"},"maxReplicas",-1)),M(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":t[20]||(t[20]=p=>s.value.maxReplicas=p),disabled:!s.value.hpaEnabled,placeholder:"10"},null,8,hs),[[B,s.value.maxReplicas,void 0,{number:!0}]])]),e("div",_s,[t[58]||(t[58]=e("label",{class:"form-label"},"CPU (%)",-1)),M(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":t[21]||(t[21]=p=>s.value.cpuThreshold=p),disabled:!s.value.hpaEnabled,placeholder:"80"},null,8,ks),[[B,s.value.cpuThreshold,void 0,{number:!0}]])]),e("div",Ss,[t[59]||(t[59]=e("label",{class:"form-label"},"Memory (%)",-1)),M(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":t[22]||(t[22]=p=>s.value.memoryThreshold=p),disabled:!s.value.hpaEnabled,placeholder:"80"},null,8,ws),[[B,s.value.memoryThreshold,void 0,{number:!0}]])])])])])):Y("",!0)],512),[[Ae,b.value===3]]),M(e("div",null,[s.value.target==="VM"?(u(),m("div",Cs,[e("div",$s,[t[61]||(t[61]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",Is,[e("div",Ts,[t[60]||(t[60]=e("label",{class:"form-label"},"Port",-1)),M(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":t[23]||(t[23]=p=>s.value.defaultPort=p),placeholder:"80"},null,512),[[B,s.value.defaultPort,void 0,{number:!0}]])])])])])):Y("",!0),s.value.target==="K8S"?(u(),m("div",As,[e("div",Rs,[t[67]||(t[67]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",Es,[e("div",Ns,[t[66]||(t[66]=e("label",{class:"form-label"},"Port",-1)),(u(!0),m(G,null,X(v.value,(p,ce)=>(u(),m("div",{class:"row g-2 mb-2",key:ce},[e("div",Ms,[t[62]||(t[62]=e("label",{class:"form-label small"},"Target Port",-1)),M(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":Q=>p.targetPort=Q,placeholder:"80"},null,8,Ds),[[B,p.targetPort,void 0,{number:!0}]])]),e("div",xs,[t[64]||(t[64]=e("label",{class:"form-label small"},"Protocol",-1)),M(e("select",{class:"form-select","onUpdate:modelValue":Q=>p.protocol=Q},t[63]||(t[63]=[e("option",{value:"TCP"},"TCP",-1),e("option",{value:"UDP"},"UDP",-1),e("option",{value:"SCTP"},"SCTP",-1)]),8,Us),[[ve,p.protocol]])]),e("div",Ps,[t[65]||(t[65]=e("label",{class:"form-label small"},"Host Port",-1)),M(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":Q=>p.hostPort=Q,placeholder:"8080"},null,8,Ls),[[B,p.hostPort,void 0,{number:!0}]])]),e("div",Vs,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:Q=>z(ce),disabled:v.value.length<=1},"-",8,Os)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:N,style:{color:"gray"}},"+ Add Port Mapping")])])])])):Y("",!0)],512),[[Ae,b.value===4]])]),e("div",Bs,[e("a",{class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:j}," Cancel "),e("div",Gs,[e("button",{class:"btn btn-outline-secondary",disabled:b.value===1,onClick:J},"Prev",8,Hs),b.value<4?(u(),m("button",{key:0,class:"btn btn-primary",disabled:!g.value,onClick:A},"Next",8,Fs)):(u(),m("button",{key:1,class:"btn btn-primary",disabled:!g.value,onClick:t[24]||(t[24]=p=>R.mode==="update"?me():oe())},i(R.mode==="update"?"Update":"Create"),9,zs))])])])])],512))}}),qs=Ee(Ks,[["__scopeId","data-v-8dc8097e"]]),Ys={class:"modal-dialog",role:"document"},js={class:"modal-content"},Ws={class:"modal-body"},Xs={class:"modal-footer"},Js=["disabled"],Zs={key:0,class:"spinner-border spinner-border-sm me-2",role:"status"},Qs=ue({__name:"DeleteConfirmModal",props:{targetCatalog:{}},emits:["deleted","close"],setup(H,{expose:P,emit:F}){const R=H,D=F,w=ge(),b=h(!1),C=h(null),d=()=>{if(C.value)try{const _=window.bootstrap;if(_&&_.Modal)new _.Modal(C.value).show();else{C.value.classList.add("show"),C.value.style.display="block",document.body.classList.add("modal-open");const S=document.createElement("div");S.className="modal-backdrop fade show",S.id="delete-modal-backdrop",document.body.appendChild(S)}}catch(_){console.warn("Failed to show modal with Bootstrap, using fallback:",_),C.value.classList.add("show"),C.value.style.display="block",document.body.classList.add("modal-open")}},$=()=>{if(C.value)try{const _=window.bootstrap;if(_&&_.Modal){const S=_.Modal.getInstance(C.value);S?S.hide():E()}else E()}catch(_){console.warn("Failed to hide modal with Bootstrap, using fallback:",_),E()}},E=()=>{if(C.value){C.value.classList.remove("show"),C.value.style.display="none",document.body.classList.remove("modal-open");const _=document.getElementById("delete-modal-backdrop");_&&_.remove(),D("close")}},f=async()=>{var _;if((_=R.targetCatalog)!=null&&_.id){b.value=!0;try{await ut(R.targetCatalog.id),w.success(`${R.targetCatalog.name} catalog has been successfully deleted.`),$(),D("deleted",R.targetCatalog.id)}catch(S){console.error("Delete failed:",S),w.error("Failed to delete catalog.")}finally{b.value=!1}}},y=()=>{D("close")};return ke(()=>{C.value&&C.value.addEventListener("hidden.bs.modal",y)}),Ye(()=>{C.value&&C.value.removeEventListener("hidden.bs.modal",y)}),P({show:d,hide:$}),(_,S)=>(u(),m("div",{class:"modal fade",id:"deleteConfirmModal",tabindex:"-1",ref_key:"deleteModal",ref:C,onClick:_e($,["self"])},[e("div",Ys,[e("div",js,[e("div",{class:"modal-header"},[S[0]||(S[0]=e("h5",{class:"modal-title"},"Confirm Catalog Deletion",-1)),e("button",{type:"button",class:"btn-close",onClick:$,"aria-label":"Close"})]),e("div",Ws,[e("p",null,[S[1]||(S[1]=ae("Are you sure you want to delete ")),e("strong",null,i(_.targetCatalog.name),1),ae(" ("+i(_.targetCatalog.category)+") catalog?",1)]),S[2]||(S[2]=e("p",{class:"text-muted"},"This action cannot be undone.",-1))]),e("div",Xs,[e("button",{type:"button",class:"btn btn-secondary",onClick:$},"Cancel"),e("button",{type:"button",class:"btn btn-danger",onClick:f,disabled:b.value},[b.value?(u(),m("span",Zs)):Y("",!0),ae(" "+i(b.value?"Deleting...":"Delete"),1)],8,Js)])])])],512))}}),en={class:"modal-content"},tn={class:"modal-body"},an={class:"row"},ln={class:"col-lg-12"},on={class:"mb-3"},sn={class:"row"},nn={class:"col-lg-12"},dn={class:"mb-3"},rn={class:"row"},cn={class:"col-lg-12"},un={class:"mb-3"},mn=["value"],pn={class:"modal-footer"},vn=ue({__name:"uploadForm",props:{sourceData:{}},emits:["uploaded","close"],setup(H,{expose:P,emit:F}){const R=ge(),D=H,w=F,b=h({path:"",sourceType:"",name:"",tag:""});Re(()=>{var v,g;return[(v=D.sourceData)==null?void 0:v.sourceType,(g=D.sourceData)==null?void 0:g.name]},()=>{var v,g,A,J,j;(v=D.sourceData)!=null&&v.sourceType&&(b.value.sourceType=(g=D.sourceData)==null?void 0:g.sourceType),(A=D.sourceData)!=null&&A.name&&(b.value.name=(J=D.sourceData)==null?void 0:J.name,console.log(b.value.sourceType),b.value.sourceType.toUpperCase()=="DOCKERHUB"?$((j=D.sourceData)==null?void 0:j.name):b.value.sourceType.toUpperCase()=="ARTIFACTHUB"&&E(D.sourceData))},{immediate:!0});const C=h([]);He(()=>{d()});const d=()=>{b.value={path:"",sourceType:"",name:"",tag:""},C.value=[]},$=async v=>{var J;const g={path:((J=D.sourceData)==null?void 0:J.id)||""},{data:A}=await mt(g);C.value=[],A.length>0&&A.forEach(j=>{C.value.push({key:j.name,value:j.name})})},E=async v=>{console.log("sourceData",v);const g={kind:"helm",repository:v.repository.name,packageName:v.name},{data:A}=await pt(g);C.value=[],A.length>0&&A.forEach(J=>{C.value.push({key:J.version,value:J.version})})},f=()=>{if(!b.value.tag.trim()){R.error("Tag is required.");return}const v=je.cloneDeep(D.sourceData);v.tag=b.value.tag,v.sourceType=b.value.sourceType,v.name=b.value.name,w("uploaded",v),d(),s()},y=()=>{s()},_=()=>{d();const v=document.getElementById("upload-form-modal");if(v)try{const g=window.bootstrap;g&&g.Modal?new g.Modal(v).show():S()}catch(g){console.warn("Failed to show modal with Bootstrap, using fallback:",g),S()}},S=()=>{const v=document.getElementById("upload-form-modal");if(v){document.querySelectorAll(".modal-backdrop").forEach(J=>J.remove()),v.classList.add("show"),v.style.display="block",v.style.opacity="1",v.setAttribute("aria-hidden","false"),document.body.classList.add("modal-open");const A=document.createElement("div");A.className="modal-backdrop fade show",A.id="upload-modal-backdrop",document.body.appendChild(A)}},s=()=>{const v=document.getElementById("upload-form-modal");if(v)try{const g=window.bootstrap;if(g&&g.Modal){const A=g.Modal.getInstance(v);A?A.hide():T()}else T()}catch(g){console.warn("Failed to hide modal with Bootstrap, using fallback:",g),T()}},T=()=>{const v=document.getElementById("upload-form-modal");v&&(v.classList.remove("show","fade","in"),v.style.display="none",v.style.opacity="0",v.setAttribute("aria-hidden","true"),document.body.classList.remove("modal-open"),document.body.style.overflow="",document.body.style.paddingRight="",document.querySelectorAll(".modal-backdrop, #upload-modal-backdrop").forEach(A=>A.remove()),w("close"))};return He(()=>{d()}),P({show:_,hide:s}),(v,g)=>(u(),m("div",{class:"modal modal-blur fade",id:"upload-form-modal",tabindex:"-1",role:"dialog","aria-hidden":"true",onClick:y},[e("div",{class:"modal-dialog modal-lg modal-dialog-centered",role:"document",onClick:g[3]||(g[3]=_e(()=>{},["stop"]))},[e("div",en,[e("div",{class:"modal-header"},[g[4]||(g[4]=e("h5",{class:"modal-title"},"Upload Application",-1)),e("button",{type:"button",class:"btn-close",onClick:s,"aria-label":"Close"})]),e("div",tn,[e("form",{onSubmit:_e(f,["prevent"])},[e("div",an,[e("div",ln,[e("div",on,[g[5]||(g[5]=e("label",{class:"form-label"},"Source Type",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g[0]||(g[0]=A=>b.value.sourceType=A),disabled:""},null,512),[[B,b.value.sourceType]])])])]),e("div",sn,[e("div",nn,[e("div",dn,[g[6]||(g[6]=e("label",{class:"form-label"},"Name",-1)),M(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g[1]||(g[1]=A=>b.value.name=A),disabled:""},null,512),[[B,b.value.name]])])])]),e("div",rn,[e("div",cn,[e("div",un,[g[8]||(g[8]=e("label",{class:"form-label"},[ae("Tag "),e("span",{class:"text-red"},"*")],-1)),M(e("select",{class:"form-select","onUpdate:modelValue":g[2]||(g[2]=A=>b.value.tag=A)},[g[7]||(g[7]=e("option",{value:""},"Select Tag",-1)),(u(!0),m(G,null,X(C.value,A=>(u(),m("option",{value:A.value,key:A.key},i(A.value),9,mn))),128))],512),[[ve,b.value.tag]]),g[9]||(g[9]=e("small",{class:"form-hint"},"Please enter the tag for this catalog.",-1))])])])],32)]),e("div",pn,[e("button",{type:"button",class:"btn btn-link link-secondary",onClick:s}," Cancel "),e("button",{type:"submit",class:"btn btn-primary ms-auto",onClick:f},[V(Z(Pt),{class:"icon"}),g[10]||(g[10]=ae(" Upload "))])])])])]))}}),gn=Ee(vn,[["__scopeId","data-v-550ff2f5"]]),bn={ref:"sofwareCatalog"},fn={class:"row"},yn={class:"col-lg-9"},hn={class:"card"},_n={class:"list-group card-list-group",id:"sc-list-group"},kn={class:"row g-2 align-items-center"},Sn={class:"col-auto me-3"},wn=["src","onError"],Cn={key:1,class:"rounded catalog-icon-fallback d-flex align-items-center justify-content-center"},$n=["onClick"],In={class:"text-muted"},Tn=["onClick"],An={class:"text-muted",style:{width:"auto","text-align":"right"}},Rn={style:{color:"#e5b942"}},En={style:{color:"#e5b942"}},Nn={class:"text-muted",style:{width:"80px","text-align":"right"}},Mn={style:{color:"gray"}},Dn={class:"col-3 text-muted"},xn={class:"d-flex justify-content-end"},Un={class:"mouse-hover"},Pn=["onClick"],Ln={class:"text-muted"},Vn=["id"],On={class:"accordion-body pt-0"},Bn=["innerHTML"],Gn=["id"],Hn=["onClick"],Fn=["id"],zn=["id"],Kn={class:"btn btn-sm",style:{"margin-right":"5px"}},qn={class:"btn btn-sm",style:{"margin-right":"5px"}},Yn={class:"btn btn-sm",style:{"margin-right":"5px"}},jn={class:"mt-4"},Wn={class:"d-flex justify-content-between align-items-center mb-2"},Xn=["disabled","onClick"],Jn={key:0,class:"text-center text-muted py-3"},Zn={key:1,class:"table-responsive"},Qn={class:"table table-sm table-vcenter"},ei={key:0},ti={class:"text-end"},ai=["disabled","onClick"],li={class:"col-lg-3"},oi={class:"input-icon mb-3"},si={class:"input-icon-addon"},ni={key:0,class:"col-md-6 col-lg-12",id:"resultDockerHubEmpty"},ii={key:1,class:"row row-cards",id:"resultDockerHubSearch"},di={class:"card"},ri={class:"row row-0"},ci={class:"col-auto"},ui=["src"],mi={class:"col"},pi={class:"card-body"},vi=["href"],gi={class:"text-muted"},bi={class:"col-auto lh-1"},fi={class:"d-flex justify-content-end me-2 mt-4 mouse-hover"},yi={class:"mt-5"},hi={key:0,class:"col-md-6 col-lg-12",id:"resultArtifactHubEmpty"},_i={key:1,class:"row row-cards",id:"resultArtifactHubSearch"},ki={class:"card"},Si={class:"row row-0"},wi={class:"col"},Ci={class:"card-body"},$i=["href"],Ii={class:"text-muted"},Ti={class:"col-auto lh-1"},Ai={class:"d-flex justify-content-end me-2 mt-4 mouse-hover"},Ri=ue({__name:"softwareCatalogList",setup(H){const P=ge(),F=h([]),R=h(null),D=h(null),w=h({}),b=h("new"),C=h({}),d=h(""),$=h({}),E=h(null),f=h(null),y=h({}),_=h(null),S=h(""),s=h([]),T=h([]),v=h(0),g=h(null),A=h("");ke(async()=>{S.value="",j(),document.addEventListener("click",a=>{a.target.closest(".dropdown")||(A.value="")})});const J=()=>{j(),b.value="new",D.value=null,w.value={},R.value=0,C.value={},d.value="",setTimeout(()=>{_.value&&typeof _.value.initForCreate=="function"&&_.value.initForCreate()},100)},j=async()=>{try{await vt(S.value).then(({data:a})=>{je.forEach(a,function(n){n.refData=ne(n.catalogRefs),n.isShow=!1,n.deploymentStatuses=[],n.deploymentStatusLoaded=!1,n.deploymentStatusLoading=!1,n.resolvedLogoUrl=Ne(n),n.logoLoadFailed=!1}),F.value=a})}catch(a){console.log(a),P.error("Unable to retrieve data.")}},ne=a=>a.reduce((n,r)=>(n[r.refType]||(n[r.refType]=[]),n[r.refType].push(r),n),{}),I=async a=>{a.keyCode==13&&(await N(),await z())},N=async()=>{s.value=[];try{const{data:a}=await gt(S.value);if(a.results.length>0)for(let n=0;n<3;n++)s.value.push(a.results[n])}catch(a){console.log(a),P.error("Unable to retrieve data.")}},z=async()=>{T.value=[];try{const{data:a}=await bt(S.value);if(a.packages.length>0)for(let n=0;n<3;n++)T.value.push(a.packages[n])}catch(a){console.log(a),P.error("Unable to retrieve data.")}},q=a=>{const n=F.value.find(r=>r.id===a);D.value=a,w.value=n||{},b.value="update",setTimeout(()=>{_.value&&typeof _.value.initForUpdate=="function"&&_.value.initForUpdate(a,n)},100)},oe=a=>{$.value=a,E.value&&E.value.show()},me=async a=>{await j()},ie=()=>{$.value={}},de=async a=>{const n=F.value[a];n.isShow=!n.isShow,n.isShow&&!n.deploymentStatusLoaded&&await W(n)},W=async a=>{if(a!=null&&a.id){a.deploymentStatusLoading=!0;try{const{data:n}=await _t(a.id);a.deploymentStatuses=be(n),a.deploymentStatusLoaded=!0}catch(n){console.log(n),a.deploymentStatuses=[],P.error("Unable to retrieve deployment status.")}finally{a.deploymentStatusLoading=!1}}},be=a=>{const n=Array.isArray(a==null?void 0:a.deploymentHistories)?a.deploymentHistories:[];return(Array.isArray(a==null?void 0:a.applicationStatuses)?a.applicationStatuses:[]).map((U,x)=>{const l=fe(U,n);return pe(l,U,`status-${U.id||x}`)})},fe=(a,n)=>{if(!a)return null;const r=n.find(U=>a.deploymentHistoryId&&String(a.deploymentHistoryId)===String(U.id));return r||n.find(U=>ye(a.deploymentType,U.deploymentType)&&ye(a.namespace,U.namespace)&&(ye(a.vmId,U.vmId)||ye(a.clusterName,U.clusterName)))},pe=(a,n,r)=>({rowKey:r,deploymentId:(n==null?void 0:n.deploymentHistoryId)||(a==null?void 0:a.id)||null,deploymentType:ee((n==null?void 0:n.deploymentType)||(a==null?void 0:a.deploymentType)),target:ee(he(a,n)),csp:ee(a==null?void 0:a.cloudProvider),status:ee((n==null?void 0:n.status)||(n==null?void 0:n.podStatus)),ipOrEndpoint:ee(le(a,n)),lastCheckedOrDeployedAt:ee(Se(n==null?void 0:n.checkedAt))}),he=(a,n)=>{const r=(n==null?void 0:n.deploymentType)||(a==null?void 0:a.deploymentType),U=(n==null?void 0:n.namespace)||(a==null?void 0:a.namespace),x=(n==null?void 0:n.mciId)||(a==null?void 0:a.mciId),l=(n==null?void 0:n.vmId)||(a==null?void 0:a.vmId),o=(n==null?void 0:n.clusterName)||(a==null?void 0:a.clusterName);return r==="VM"?[U,x,l].filter(Boolean).join(" / "):r==="K8S"?[U,o].filter(Boolean).join(" / "):[U,x,l,o].filter(Boolean).join(" / ")},le=(a,n)=>{const r=(n==null?void 0:n.publicIp)||(a==null?void 0:a.publicIp),U=(n==null?void 0:n.servicePort)||(a==null?void 0:a.servicePort),x=a==null?void 0:a.ingressHost,l=a==null?void 0:a.ingressPath;return r&&U?`${r}:${U}`:r||(x&&l?`${x}${l}`:x||"")},ee=a=>a==null||a===""?"-":a,ye=(a,n)=>!a||!n?!1:String(a)===String(n),Se=a=>{if(!a)return"";const n=new Date(a);return Number.isNaN(n.getTime())?a:n.toLocaleString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})},k=a=>{if(!a)return;v.value=a;const n=document.getElementById("application-detail-modal");if(n)try{window.bootstrap&&window.bootstrap.Modal?new window.bootstrap.Modal(n).show():(n.style.display="block",n.classList.add("show"),document.body.classList.add("modal-open")),setTimeout(()=>{g.value&&g.value.refreshData(v.value)},100)}catch(r){console.error("Error opening detail modal:",r)}},t=(a,n)=>Object.prototype.hasOwnProperty.call(a,n),p=a=>{window.open(a)},ce={"apache tomcat":"/catalog-icons/apache-tomcat.png",redis:"/catalog-icons/redis.svg",nginx:"/catalog-icons/nginx.svg","apache http server":"/catalog-icons/apache-http-server.svg","nexus repository":"/catalog-icons/nexus-repository.svg",mariadb:"/catalog-icons/mariadb.svg",grafana:"/catalog-icons/grafana.svg",prometheus:"/catalog-icons/prometheus.svg",elasticsearch:"/catalog-icons/elasticsearch.svg"},Q=a=>String(a||"").trim().toLowerCase(),we=a=>ce[Q(a==null?void 0:a.name)]||"",Ne=a=>we(a)||(a==null?void 0:a.logoUrlLarge)||(a==null?void 0:a.logoUrlSmall)||"",Ce=a=>{const n=we(a);if(n&&a.resolvedLogoUrl!==n){a.resolvedLogoUrl=n,a.logoLoadFailed=!1;return}a.logoLoadFailed=!0},$e=a=>a.replace(/\\n|\n/g,"
"),Ie=(a,n)=>{y.value=a,y.value.sourceType=n,f.value&&f.value.show()},Te=async a=>{a.sourceType=="DockerHub"?(a.createdAt=a.created_at,a.updatedAt=a.updated_at,a.shortDescription=a.short_description,a.starCount=a.star_count,a.ratePlans=a.rate_plans,delete a.created_at,delete a.updated_at,delete a.short_description,delete a.star_count,delete a.rate_plans,await ft(a)):a.sourceType=="ArtifactHub"&&await yt(a),P.success("Software catalog uploaded successfully!")},Me=()=>{y.value={sourceType:"",name:"",sourceData:{}}};return(a,n)=>(u(),m(G,null,[e("div",bn,[e("div",{class:"d-flex justify-content-between align-items-center mb-3"},[n[1]||(n[1]=e("h2",{class:"mb-0"},"Catalog",-1)),e("button",{class:"btn btn-outline-primary d-none d-sm-inline-block",style:{"margin-right":"315px"},"data-bs-toggle":"modal","data-bs-target":"#modal-wizard",onClick:J}," Regist ")]),e("div",fn,[e("div",yn,[e("div",hn,[e("div",_n,[(u(!0),m(G,null,X(F.value,(r,U)=>(u(),m("div",{class:"list-group-item pe-1",key:U},[e("div",kn,[e("div",Sn,[r.resolvedLogoUrl&&!r.logoLoadFailed?(u(),m("img",{key:0,src:r.resolvedLogoUrl,class:"rounded catalog-icon",alt:"Catalog Icon",width:"40",height:"40",onError:x=>Ce(r)},null,40,wn)):(u(),m("div",Cn,[V(Z(We),{class:"icon",size:"22","stroke-width":"1.75"})]))]),e("div",{class:"col-5",onClick:x=>de(U)},[ae(i(r.name)+" ",1),e("div",In,i(r.summary),1)],8,$n),e("div",{class:"col-3 d-flex justify-content-end",onClick:x=>de(U)},[e("span",An,[V(Z(Lt),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"#e5b942"}),e("span",Rn,i(r.averageRating||0),1),e("span",En," ("+i(r.ratingCount||0)+") ",1)]),e("span",Nn,[V(Z(Mt),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"gray"}),e("span",Mn,i(r.downloadCount||0),1)])],8,Tn),e("div",Dn,[e("div",xn,[e("div",Un,[V(Z(Dt),{class:"me-2 cursor-pointer",size:"15","stroke-width":"2","data-bs-toggle":"modal","data-bs-target":"#modal-wizard",onClick:x=>q(r.id)},null,8,["onClick"]),V(Z(Ut),{class:"cursor-pointer",size:"15","stroke-width":"2",onClick:x=>oe(r)},null,8,["onClick"])])]),e("div",{class:"d-flex justify-content-end",onClick:x=>de(U)},[e("span",Ln,i(r.category.length>25?r.category.substring(0,25)+"...":r.category),1)],8,Pn)]),e("div",{id:"accordion_"+r.id,class:"accordion-collapse collapse",style:$t([r.isShow?{display:"block"}:{display:"none"}])},[e("div",On,[e("div",{class:"mt-3 mb-5",innerHTML:$e(r.description)},null,8,Bn),e("div",null,[n[5]||(n[5]=e("strong",null,"Ref Information",-1)),e("ul",{id:`${U}-entity-ul`},[t(r.refData,"HOMEPAGE")?(u(!0),m(G,{key:0},X(r.refData.HOMEPAGE,(x,l)=>(u(),m("li",{key:l},[e("a",{class:"btn",onClick:o=>p(x.refValue)},i(x.refValue),9,Hn)]))),128)):Y("",!0)],8,Gn),n[6]||(n[6]=e("strong",null,"TAGS",-1)),e("ul",{id:`${U}-tag-ul`},[t(r.refData,"TAG")?(u(!0),m(G,{key:0},X(r.refData.TAG,(x,l)=>(u(),m("span",{key:l},"#"+i(x.refValue)+"  ",1))),128)):Y("",!0)],8,Fn),n[7]||(n[7]=e("strong",null,"Recommended Spec",-1)),e("ul",{id:`${U}-tag-ul`},[r.recommendedCpu&&r.recommendedMemory&&r.recommendedDisk?(u(),m(G,{key:0},[e("button",Kn," CPU : "+i(r.recommendedCpu)+" Core ",1),e("button",qn," MEMORY : "+i(r.recommendedMemory)+" GB ",1),e("button",Yn," DISK : "+i(r.recommendedDisk)+" GB ",1)],64)):Y("",!0)],8,zn),e("div",jn,[e("div",Wn,[n[2]||(n[2]=e("strong",null,"Deployment Status",-1)),e("button",{type:"button",class:"btn btn-sm btn-icon btn-ghost-secondary",title:"Refresh deployment status","aria-label":"Refresh deployment status",disabled:r.deploymentStatusLoading,onClick:_e(x=>W(r),["stop"])},[V(Z(Xe),{class:"icon",size:"18","stroke-width":"1.75"})],8,Xn)]),r.deploymentStatusLoading?(u(),m("div",Jn," Loading deployment status... ")):(u(),m("div",Zn,[e("table",Qn,[n[4]||(n[4]=e("thead",null,[e("tr",null,[e("th",null,"Type"),e("th",null,"Target"),e("th",null,"CSP"),e("th",null,"Status"),e("th",null,"IP/Endpoint"),e("th",null,"Last Checked"),e("th",{class:"text-end"},"Detail")])],-1)),e("tbody",null,[r.deploymentStatuses.length===0?(u(),m("tr",ei,n[3]||(n[3]=[e("td",{colspan:"7",class:"text-center text-muted"}," No deployment status available ",-1)]))):Y("",!0),(u(!0),m(G,null,X(r.deploymentStatuses,x=>(u(),m("tr",{key:x.rowKey},[e("td",null,i(x.deploymentType),1),e("td",null,i(x.target),1),e("td",null,i(x.csp),1),e("td",null,[e("span",{class:K(Z(Pe)(x.status))},i(Z(Ue)(x.status)),3)]),e("td",null,i(x.ipOrEndpoint),1),e("td",null,i(x.lastCheckedOrDeployedAt),1),e("td",ti,[e("button",{type:"button",class:"btn btn-outline-primary",disabled:!x.deploymentId,onClick:_e(l=>k(x.deploymentId),["stop"])}," Detail ",8,ai)])]))),128))])])]))])])])],12,Vn)])]))),128))])])]),e("div",li,[e("div",oi,[e("span",si,[V(Z(ht),{class:"icon",width:"24",height:"24","stroke-width":"2"})]),M(e("input",{type:"text",class:"form-control",placeholder:"Search…",onKeypress:I,"onUpdate:modelValue":n[0]||(n[0]=r=>S.value=r),id:"inputCatalogSearch"},null,544),[[B,S.value]])]),n[10]||(n[10]=e("h3",{class:"mb-3"}," DOCKERHUB ",-1)),s.value.length<=0?(u(),m("div",ni," There are no related Container Images found. ")):Y("",!0),s.value.length>0?(u(),m("div",ii,[(u(!0),m(G,null,X(s.value,(r,U)=>(u(),m("div",{class:"col-md-6 col-lg-12",key:U},[e("div",di,[e("div",ri,[e("div",ci,[e("img",{src:r.logo_url.large,class:"rounded-start ms-2",alt:"Shape of You",width:"80",height:"80"},null,8,ui)]),e("div",mi,[e("div",pi,[e("a",{href:"https://hub.docker.com/search?q="+S.value,target:"_blank"},i(r==null?void 0:r.name),9,vi),e("div",gi,i((r==null?void 0:r.short_description.length)>30?(r==null?void 0:r.short_description.substring(0,30))+"...":""),1)])]),e("div",bi,[e("div",fi,[V(Z(ze),{class:"cursor-pointer",size:"20","stroke-width":"2",onClick:x=>Ie(r,"DockerHub")},null,8,["onClick"])])])])])]))),128))])):Y("",!0),e("div",yi,[n[9]||(n[9]=e("h3",{class:"mb-3"}," ARTIFACTHUB ",-1)),T.value.length<=0?(u(),m("div",hi," There are no related Helm Charts found. ")):Y("",!0),T.value.length>0?(u(),m("div",_i,[(u(!0),m(G,null,X(T.value,(r,U)=>(u(),m("div",{class:"col-md-6 col-lg-12",key:U},[e("div",ki,[e("div",Si,[n[8]||(n[8]=e("div",{class:"col-auto"},[e("img",{src:"https://artifacthub.io/static/media/placeholder_pkg_helm.png",class:"rounded-start",alt:"Shape of You",width:"80",height:"80"})],-1)),e("div",wi,[e("div",Ci,[e("a",{href:"https://artifacthub.io/packages/search?ts_query_web="+S.value+"&sort=relevance&page=1",target:"_blank"},i(r==null?void 0:r.name),9,$i),e("div",Ii,i((r==null?void 0:r.description.length)>30?(r==null?void 0:r.description.substring(0,30))+"...":""),1)])]),e("div",Ti,[e("div",Ai,[V(Z(ze),{class:"cursor-pointer",size:"20","stroke-width":"2",onClick:x=>Ie(r,"ArtifactHub")},null,8,["onClick"])])])])])]))),128))])):Y("",!0)])])])],512),V(Qs,{ref_key:"deleteConfirmModal",ref:E,"target-catalog":$.value,onDeleted:me,onClose:ie},null,8,["target-catalog"]),V(qs,{ref_key:"wizardModal",ref:_,mode:b.value,onCreated:j,onUpdated:j},null,8,["mode"]),V(gn,{ref_key:"uploadFormModal",ref:f,"source-data":y.value,onUploaded:Te,onClose:Me},null,8,["source-data"]),V(Je,{ref_key:"applicationDetailModalRef",ref:g,"deployment-id":v.value},null,8,["deployment-id"])],64))}}),Ei={class:"page",ref:"sofwareCatalog"},Ni={class:"page-wrapper"},Mi={class:"page-header d-print-none"},Di={class:"container-xxl"},xi={class:"row g-2 align-items-center"},Ui={class:"col-auto ms-auto"},Pi={class:"page-body"},Li={class:"container-xxl"},Vi={class:"row"},Oi={class:"col-lg-12"},Bi={class:"card"},Gi={class:"card-header"},Hi={class:"nav nav-tabs card-header-tabs","data-bs-toggle":"tabs"},Fi={class:"nav-item"},zi={href:"#tabs-catalog",class:"nav-link active","data-bs-toggle":"tab"},Ki={class:"nav-item"},qi={class:"nav-item"},Yi={href:"#tabs-repository",class:"nav-link","data-bs-toggle":"tab"},ji={class:"card-body"},Wi={class:"tab-content"},Xi={class:"tab-pane active show",id:"tabs-catalog"},Ji={class:"tab-pane",id:"tabs-status"},Zi={class:"tab-pane",id:"tabs-repository"},cd=ue({__name:"SoftwareCatalog",setup(H){const P=It(),F=h(""),R=h(""),D=h(!1),w=h(""),b=h(null);ke(async()=>{F.value=P.getNsId()});const C=f=>{R.value=f},d=async()=>{var f;await Tt(),(f=b.value)==null||f.refresh()},$=f=>{w.value=f,D.value=!0},E=()=>{D.value=!1,w.value=""};return(f,y)=>(u(),m(G,null,[e("div",Ei,[e("div",Ni,[e("div",Mi,[e("div",Di,[e("div",xi,[y[1]||(y[1]=e("div",{class:"col d-flex"},[e("h2",{class:"page-title"},"Software Catalog")],-1)),e("div",Ui,[e("button",{class:"btn btn-outline-primary d-none d-sm-inline-block","data-bs-toggle":"modal","data-bs-target":"#install-form",onClick:y[0]||(y[0]=_=>C("Application Installation"))}," DEPLOY ")])])])]),e("div",Pi,[e("div",Li,[e("div",Vi,[e("div",Oi,[e("div",Bi,[e("div",Gi,[e("ul",Hi,[e("li",Fi,[e("a",zi,[V(Z(Nt),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[2]||(y[2]=ae(" Catalog "))])]),e("li",Ki,[e("a",{href:"#tabs-status",class:"nav-link","data-bs-toggle":"tab",onClick:d},[V(Z(Et),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[3]||(y[3]=ae(" Apps Status "))])]),e("li",qi,[e("a",Yi,[V(Z(xt),{class:"icon me-2",width:"24",height:"24","stroke-width":"2"}),y[4]||(y[4]=ae(" Repository "))])])])]),e("div",ji,[e("div",Wi,[e("div",Xi,[e("div",null,[V(Ri,{nsId:F.value},null,8,["nsId"])])]),e("div",Ji,[e("div",null,[V(no,{ref_key:"applicationStatusListRef",ref:b},null,512)])]),e("div",Zi,[e("div",null,[D.value?(u(),Fe(Rt,{key:1,embedded:!0,"repository-name":w.value,onBackToList:E},null,8,["repository-name"])):(u(),Fe(At,{key:0,embedded:!0,onOpenDetail:$}))])])])])])])])])])])],512),V(kt,{"ns-id":F.value,title:R.value},null,8,["ns-id","title"])],64))}});export{cd as default}; diff --git a/src/main/resources/static/assets/SoftwareCatalog-BR5spnSR.css b/src/main/resources/static/assets/SoftwareCatalog-y9KAbeCF.css similarity index 51% rename from src/main/resources/static/assets/SoftwareCatalog-BR5spnSR.css rename to src/main/resources/static/assets/SoftwareCatalog-y9KAbeCF.css index be387c1f..a2105f78 100644 --- a/src/main/resources/static/assets/SoftwareCatalog-BR5spnSR.css +++ b/src/main/resources/static/assets/SoftwareCatalog-y9KAbeCF.css @@ -1 +1 @@ -@import"https://rsms.me/inter/inter.css";.rating-stars[data-v-6565f21d]{display:flex;gap:5px;margin-bottom:10px}.star[data-v-6565f21d]{font-size:24px;color:#ddd;cursor:pointer;transition:color .2s}.star[data-v-6565f21d]:hover,.star.active[data-v-6565f21d]{color:#ffc107}.star:hover~.star[data-v-6565f21d]{color:#ddd}.table th[data-v-e8777908]{font-weight:600;background-color:#f8f9fa}.table-responsive[data-v-e8777908]{border-radius:6px;border:1px solid #dee2e6}.badge[data-v-e8777908]{font-size:.75rem}h6[data-v-e8777908]{color:#495057;font-weight:600;margin-bottom:.75rem}.text-primary[data-v-e8777908]{color:#0d6efd!important}.card[data-v-e8777908]{border:1px solid #dee2e6;border-radius:8px;margin-bottom:1rem}.card-body[data-v-e8777908]{padding:1rem}.card-title[data-v-e8777908]{font-size:1.5rem;font-weight:600;margin-bottom:.5rem}.card-text[data-v-e8777908]{color:#6c757d;font-size:.875rem;margin-bottom:0}.img-fluid[data-v-e8777908]{border-radius:8px}.application-detail-logo[data-v-e8777908],.application-detail-logo-fallback[data-v-e8777908]{width:80px;height:80px}.application-detail-logo[data-v-e8777908]{object-fit:contain}.application-detail-logo-fallback[data-v-e8777908]{border:1px solid #dee2e6;border-radius:8px;color:#6c757d;background-color:#f8f9fa}.row[data-v-e8777908]{margin-bottom:1rem}.col-md-3 strong[data-v-e8777908],.col-md-10 strong[data-v-e8777908]{color:#495057}.policy-evidence-list[data-v-e8777908]{padding-left:1rem;color:#495057;font-size:.8125rem}.policy-period-muted[data-v-e8777908]{color:#6c757d;opacity:.62}.policy-period-muted .badge[data-v-e8777908]{opacity:.82}.nav-link[data-v-8dc8097e]{cursor:default}.modal-body[data-v-550ff2f5]{padding:1.5rem}.form-label[data-v-550ff2f5]{font-weight:600;margin-bottom:.5rem}.text-red[data-v-550ff2f5]{color:#d63384}.form-hint[data-v-550ff2f5]{color:#6c757d;font-size:.875rem}.mouse-hover{opacity:0;transition:opacity .15s ease-in-out}.list-group-item:hover .mouse-hover,#resultDockerHubSearch .card:hover .mouse-hover,#resultArtifactHubSearch .card:hover .mouse-hover{opacity:1}.catalog-icon,.catalog-icon-fallback{width:40px;height:40px;object-fit:contain}.catalog-icon-fallback{color:#667085;background-color:#f1f5f9;border:1px solid #dbe3ea}:root{--tblr-font-sans-serif: "Inter Var", -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif}body{font-feature-settings:"cv03","cv04","cv11"}.btn-grid-list{display:grid;grid-template-columns:repeat(2,1fr);grid-column-gap:10px;grid-row-gap:10px} +@import"https://rsms.me/inter/inter.css";.rating-stars[data-v-6565f21d]{display:flex;gap:5px;margin-bottom:10px}.star[data-v-6565f21d]{font-size:24px;color:#ddd;cursor:pointer;transition:color .2s}.star[data-v-6565f21d]:hover,.star.active[data-v-6565f21d]{color:#ffc107}.star:hover~.star[data-v-6565f21d]{color:#ddd}.table th[data-v-9a31ab35]{font-weight:600;background-color:#f8f9fa}.table-responsive[data-v-9a31ab35]{border-radius:6px;border:1px solid #dee2e6}.badge[data-v-9a31ab35]{font-size:.75rem}h6[data-v-9a31ab35]{color:#495057;font-weight:600;margin-bottom:.75rem}.text-primary[data-v-9a31ab35]{color:#0d6efd!important}.card[data-v-9a31ab35]{border:1px solid #dee2e6;border-radius:8px;margin-bottom:1rem}.card-body[data-v-9a31ab35]{padding:1rem}.card-title[data-v-9a31ab35]{font-size:1.5rem;font-weight:600;margin-bottom:.5rem}.card-text[data-v-9a31ab35]{color:#6c757d;font-size:.875rem;margin-bottom:0}.img-fluid[data-v-9a31ab35]{border-radius:8px}.application-detail-logo[data-v-9a31ab35],.application-detail-logo-fallback[data-v-9a31ab35]{width:80px;height:80px}.application-detail-logo[data-v-9a31ab35]{object-fit:contain}.application-detail-logo-fallback[data-v-9a31ab35]{border:1px solid #dee2e6;border-radius:8px;color:#6c757d;background-color:#f8f9fa}.row[data-v-9a31ab35]{margin-bottom:1rem}.col-md-3 strong[data-v-9a31ab35],.col-md-10 strong[data-v-9a31ab35]{color:#495057}.policy-evidence-list[data-v-9a31ab35]{padding-left:1rem;color:#495057;font-size:.8125rem}.policy-period-muted[data-v-9a31ab35]{color:#6c757d;opacity:.62}.policy-period-muted .badge[data-v-9a31ab35]{opacity:.82}.nav-link[data-v-8dc8097e]{cursor:default}.modal-body[data-v-550ff2f5]{padding:1.5rem}.form-label[data-v-550ff2f5]{font-weight:600;margin-bottom:.5rem}.text-red[data-v-550ff2f5]{color:#d63384}.form-hint[data-v-550ff2f5]{color:#6c757d;font-size:.875rem}.mouse-hover{opacity:0;transition:opacity .15s ease-in-out}.list-group-item:hover .mouse-hover,#resultDockerHubSearch .card:hover .mouse-hover,#resultArtifactHubSearch .card:hover .mouse-hover{opacity:1}.catalog-icon,.catalog-icon-fallback{width:40px;height:40px;object-fit:contain}.catalog-icon-fallback{color:#667085;background-color:#f1f5f9;border:1px solid #dbe3ea}:root{--tblr-font-sans-serif: "Inter Var", -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif}body{font-feature-settings:"cv03","cv04","cv11"}.btn-grid-list{display:grid;grid-template-columns:repeat(2,1fr);grid-column-gap:10px;grid-row-gap:10px} diff --git a/src/main/resources/static/assets/SoftwareCatalogListTest-BfJ6gTX2.js b/src/main/resources/static/assets/SoftwareCatalogListTest-DjCbxOSW.js similarity index 96% rename from src/main/resources/static/assets/SoftwareCatalogListTest-BfJ6gTX2.js rename to src/main/resources/static/assets/SoftwareCatalogListTest-DjCbxOSW.js index 8c3d3234..edc9f85d 100644 --- a/src/main/resources/static/assets/SoftwareCatalogListTest-BfJ6gTX2.js +++ b/src/main/resources/static/assets/SoftwareCatalogListTest-DjCbxOSW.js @@ -1,4 +1,4 @@ -import{c as R,I as B}from"./IconPlus-o3un4-BS.js";import{i as P,x as O,o as U,A as G,I as V}from"./softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-TgRUyQdd.js";import{d as D,c as I,h as l,a as n,b as t,t as v,r as c,w as L,o as M,q as N,i as w,p as T,F as $,f as S,j as k,u as j,l as A}from"./index-DgPLCZcu.js";import{_ as H}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as z}from"./lodash-l7l6TB3A.js";import"./request-D5nUjUnA.js";/** +import{c as R,I as B}from"./IconPlus-0MYkWKdM.js";import{i as P,x as O,o as U,A as G,I as V}from"./softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-DuIt1swN.js";import{d as D,c as I,h as l,a as n,b as t,t as v,r as c,w as L,o as M,q as N,i as w,p as T,F as $,f as S,j as k,u as j,l as A}from"./index-nMoWjTPe.js";import{_ as H}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as z}from"./lodash-CMOUKIpU.js";import"./request-BXz87ydW.js";/** * @license @tabler/icons-vue v3.22.0 - MIT * * This source code is licensed under the MIT license. diff --git a/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-Bnd3_hce.js b/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-By28-D7G.js similarity index 99% rename from src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-Bnd3_hce.js rename to src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-By28-D7G.js index fdf55ca8..d108417b 100644 --- a/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-Bnd3_hce.js +++ b/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-By28-D7G.js @@ -1,4 +1,4 @@ -var vt=Object.defineProperty;var wt=(l,e,t)=>e in l?vt(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t;var b=(l,e,t)=>wt(l,typeof e!="symbol"?e+"":e,t);import{d as Ct,r as Ge,w as je,o as Et,E as yt,s as Rt,a as xt,h as Tt}from"./index-DgPLCZcu.js";class M{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return typeof t<"u"&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class x{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var s=e?t.split(e):[t],n=s.length,r;for(let o=0;od.subject===o),a>-1?t[r]=i[a].copy:(h=Object.assign(Array.isArray(o)?[]:{},o),i.unshift({subject:o,copy:h}),t[r]=this.deepClone(o,h,i)))}return t}}let kt=class Ke extends M{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return typeof e=="string"?(e=document.querySelector(e),e||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):e===!0&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t?!0:t.parentNode?this._checkContainerIsParent(e,t.parentNode):!1}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,s=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let n=x.elOffset(this.container);i-=n.left,s-=n.top}return{x:i,y:s}}elementPositionCoords(e,t="right"){var i=x.elOffset(e),s,n,r;switch(this.container!==document.body&&(s=x.elOffset(this.container),i.left-=s.left,i.top-=s.top),t){case"right":n=i.left+e.offsetWidth,r=i.top-1;break;case"bottom":n=i.left,r=i.top+e.offsetHeight;break;case"left":n=i.left,r=i.top-1;break;case"top":n=i.left,r=i.top;break;case"center":n=i.left+e.offsetWidth/2,r=i.top+e.offsetHeight/2;break}return{x:n,y:r,offset:i}}show(e,t){var i,s,n,r,o;return this.destroyed||this.table.destroyed?this:(e instanceof HTMLElement?(n=e,o=this.elementPositionCoords(e,t),r=o.offset,i=o.x,s=o.y):typeof e=="number"?(r={top:0,left:0},i=e,s=t):(o=this.containerEventCoords(e),i=o.x,s=o.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(i,s,n,r,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",a=>{a.stopPropagation()}),this)}_fitToScreen(e,t,i,s,n){var r=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",i?this.element.style.right=this.container.offsetWidth-s.left+"px":this.element.style.right=this.container.offsetWidth-e+"px",this.reversedX=!0);let o=Math.max(this.container.offsetHeight,r?this.container.scrollHeight:0);if(t+this.element.offsetHeight>o)if(i)switch(n){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.height=o+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=e),this}_escapeCheck(e){e.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new Ke(this.table,e,this),this.childPopup}};class w extends M{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){typeof this.table[e]>"u"?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler&&(i=this.table.rowManager.displayPipeline.findIndex(s=>s.handler===this._handler),i>-1&&(t=i)),e&&(t=t+e),this._handler)return t>-1?this.table.rowManager.getDisplayRows(t):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new kt(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var Mt={rownum:function(l,e,t,i,s,n){return n.getPosition()}};const K=class K extends w{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(s=>{var n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1)),r;e.definition[n]&&(r=this.lookupAccessor(e.definition[n]),r&&(t=!0,i[n]={accessor:r,params:e.definition[n+"Params"]||{}}))}),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":K.accessors[e]?t=K.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),s=e.getComponent(),n=x.deepClone(e.data||{});return this.table.columnManager.traverse(function(r){var o,a,h,d;r.modules.accessor&&(a=r.modules.accessor[i]||r.modules.accessor.accessor||!1,a&&(o=r.getFieldValue(n),o!="undefined"&&(d=r.getComponent(),h=typeof a.params=="function"?a.params(o,n,t,d,s):a.params,r.setFieldValue(n,a.accessor(o,n,t,h,d,s)))))}),n}};b(K,"moduleName","accessor"),b(K,"accessors",Mt);let ce=K;var Lt={method:"GET"};function fe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(fe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(fe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}function St(l){var e=fe(l),t=[];return e.forEach(function(i){t.push(encodeURIComponent(i.key)+"="+encodeURIComponent(i.value))}),t.join("&")}function qe(l,e,t){return l&&t&&Object.keys(t).length&&(!e.method||e.method.toLowerCase()=="get")&&(e.method="get",l+=(l.includes("?")?"&":"?")+St(t)),l}function Dt(l,e,t){var i;return new Promise((s,n)=>{if(l=this.urlGenerator.call(this.table,l,e,t),e.method.toUpperCase()!="GET")if(i=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],i){for(var r in i.headers)e.headers||(e.headers={}),typeof e.headers[r]>"u"&&(e.headers[r]=i.headers[r]);e.body=i.body.call(this,l,e,t)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);l?(typeof e.headers>"u"&&(e.headers={}),typeof e.headers.Accept>"u"&&(e.headers.Accept="application/json"),typeof e.headers["X-Requested-With"]>"u"&&(e.headers["X-Requested-With"]="XMLHttpRequest"),typeof e.mode>"u"&&(e.mode="cors"),e.mode=="cors"?(typeof e.headers.Origin>"u"&&(e.headers.Origin=window.location.origin),typeof e.credentials>"u"&&(e.credentials="same-origin")):typeof e.credentials>"u"&&(e.credentials="include"),fetch(l,e).then(o=>{o.ok?o.json().then(a=>{s(a)}).catch(a=>{n(a),console.warn("Ajax Load Error - Invalid JSON returned",a)}):(console.error("Ajax Load Error - Connection Error: "+o.status,o.statusText),n(o))}).catch(o=>{console.error("Ajax Load Error - Connection Error: ",o),n(o)})):(console.warn("Ajax Load Error - No URL Set"),s([]))})}function pe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(pe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(pe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}var zt={json:{headers:{"Content-Type":"application/json"},body:function(l,e,t){return JSON.stringify(t)}},form:{headers:{},body:function(l,e,t){var i=pe(t),s=new FormData;return i.forEach(function(n){s.append(n.key,n.value)}),s}}};const F=class F extends w{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=F.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||F.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||F.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var n=this.table.options.ajaxParams;return n&&(typeof n=="function"&&(n=n.call(this.table)),s=Object.assign(Object.assign({},n),s)),s}requestDataCheck(e,t,i,s){return!!(!e&&this.url||typeof e=="string")}requestData(e,t,i,s,n){var r;return!n&&this.requestDataCheck(e)?(e&&this.setUrl(e),r=this.generateConfig(i),this.sendRequest(this.url,t,r)):n}setDefaultConfig(e={}){this.config=Object.assign({},F.defaultConfig),typeof e=="string"?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return typeof e=="string"?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return this.table.options.ajaxRequesting.call(this.table,e,t)!==!1?this.loaderPromise(e,i,t).then(s=>(this.table.options.ajaxResponse&&(s=this.table.options.ajaxResponse.call(this.table,e,t,s)),s)):Promise.reject()}};b(F,"moduleName","ajax"),b(F,"defaultConfig",Lt),b(F,"defaultURLGenerator",qe),b(F,"defaultLoaderPromise",Dt),b(F,"contentTypeFormatters",zt);let me=F;var Ht={replace:function(l){return this.table.setData(l)},update:function(l){return this.table.updateOrAddData(l)},insert:function(l){return this.table.addData(l)}},Ft={table:function(l){var e=[],t=!0,i=this.table.columnManager.columns,s=[],n=[];return l=l.split(` +var vt=Object.defineProperty;var wt=(l,e,t)=>e in l?vt(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t;var b=(l,e,t)=>wt(l,typeof e!="symbol"?e+"":e,t);import{d as Ct,r as Ge,w as je,o as Et,E as yt,s as Rt,a as xt,h as Tt}from"./index-nMoWjTPe.js";class M{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return typeof t<"u"&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class x{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var s=e?t.split(e):[t],n=s.length,r;for(let o=0;od.subject===o),a>-1?t[r]=i[a].copy:(h=Object.assign(Array.isArray(o)?[]:{},o),i.unshift({subject:o,copy:h}),t[r]=this.deepClone(o,h,i)))}return t}}let kt=class Ke extends M{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return typeof e=="string"?(e=document.querySelector(e),e||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):e===!0&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t?!0:t.parentNode?this._checkContainerIsParent(e,t.parentNode):!1}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,s=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let n=x.elOffset(this.container);i-=n.left,s-=n.top}return{x:i,y:s}}elementPositionCoords(e,t="right"){var i=x.elOffset(e),s,n,r;switch(this.container!==document.body&&(s=x.elOffset(this.container),i.left-=s.left,i.top-=s.top),t){case"right":n=i.left+e.offsetWidth,r=i.top-1;break;case"bottom":n=i.left,r=i.top+e.offsetHeight;break;case"left":n=i.left,r=i.top-1;break;case"top":n=i.left,r=i.top;break;case"center":n=i.left+e.offsetWidth/2,r=i.top+e.offsetHeight/2;break}return{x:n,y:r,offset:i}}show(e,t){var i,s,n,r,o;return this.destroyed||this.table.destroyed?this:(e instanceof HTMLElement?(n=e,o=this.elementPositionCoords(e,t),r=o.offset,i=o.x,s=o.y):typeof e=="number"?(r={top:0,left:0},i=e,s=t):(o=this.containerEventCoords(e),i=o.x,s=o.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(i,s,n,r,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",a=>{a.stopPropagation()}),this)}_fitToScreen(e,t,i,s,n){var r=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",i?this.element.style.right=this.container.offsetWidth-s.left+"px":this.element.style.right=this.container.offsetWidth-e+"px",this.reversedX=!0);let o=Math.max(this.container.offsetHeight,r?this.container.scrollHeight:0);if(t+this.element.offsetHeight>o)if(i)switch(n){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.height=o+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=e),this}_escapeCheck(e){e.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new Ke(this.table,e,this),this.childPopup}};class w extends M{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){typeof this.table[e]>"u"?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler&&(i=this.table.rowManager.displayPipeline.findIndex(s=>s.handler===this._handler),i>-1&&(t=i)),e&&(t=t+e),this._handler)return t>-1?this.table.rowManager.getDisplayRows(t):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new kt(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var Mt={rownum:function(l,e,t,i,s,n){return n.getPosition()}};const K=class K extends w{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(s=>{var n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1)),r;e.definition[n]&&(r=this.lookupAccessor(e.definition[n]),r&&(t=!0,i[n]={accessor:r,params:e.definition[n+"Params"]||{}}))}),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":K.accessors[e]?t=K.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),s=e.getComponent(),n=x.deepClone(e.data||{});return this.table.columnManager.traverse(function(r){var o,a,h,d;r.modules.accessor&&(a=r.modules.accessor[i]||r.modules.accessor.accessor||!1,a&&(o=r.getFieldValue(n),o!="undefined"&&(d=r.getComponent(),h=typeof a.params=="function"?a.params(o,n,t,d,s):a.params,r.setFieldValue(n,a.accessor(o,n,t,h,d,s)))))}),n}};b(K,"moduleName","accessor"),b(K,"accessors",Mt);let ce=K;var Lt={method:"GET"};function fe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(fe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(fe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}function St(l){var e=fe(l),t=[];return e.forEach(function(i){t.push(encodeURIComponent(i.key)+"="+encodeURIComponent(i.value))}),t.join("&")}function qe(l,e,t){return l&&t&&Object.keys(t).length&&(!e.method||e.method.toLowerCase()=="get")&&(e.method="get",l+=(l.includes("?")?"&":"?")+St(t)),l}function Dt(l,e,t){var i;return new Promise((s,n)=>{if(l=this.urlGenerator.call(this.table,l,e,t),e.method.toUpperCase()!="GET")if(i=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],i){for(var r in i.headers)e.headers||(e.headers={}),typeof e.headers[r]>"u"&&(e.headers[r]=i.headers[r]);e.body=i.body.call(this,l,e,t)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);l?(typeof e.headers>"u"&&(e.headers={}),typeof e.headers.Accept>"u"&&(e.headers.Accept="application/json"),typeof e.headers["X-Requested-With"]>"u"&&(e.headers["X-Requested-With"]="XMLHttpRequest"),typeof e.mode>"u"&&(e.mode="cors"),e.mode=="cors"?(typeof e.headers.Origin>"u"&&(e.headers.Origin=window.location.origin),typeof e.credentials>"u"&&(e.credentials="same-origin")):typeof e.credentials>"u"&&(e.credentials="include"),fetch(l,e).then(o=>{o.ok?o.json().then(a=>{s(a)}).catch(a=>{n(a),console.warn("Ajax Load Error - Invalid JSON returned",a)}):(console.error("Ajax Load Error - Connection Error: "+o.status,o.statusText),n(o))}).catch(o=>{console.error("Ajax Load Error - Connection Error: ",o),n(o)})):(console.warn("Ajax Load Error - No URL Set"),s([]))})}function pe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(pe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(pe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}var zt={json:{headers:{"Content-Type":"application/json"},body:function(l,e,t){return JSON.stringify(t)}},form:{headers:{},body:function(l,e,t){var i=pe(t),s=new FormData;return i.forEach(function(n){s.append(n.key,n.value)}),s}}};const F=class F extends w{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=F.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||F.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||F.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var n=this.table.options.ajaxParams;return n&&(typeof n=="function"&&(n=n.call(this.table)),s=Object.assign(Object.assign({},n),s)),s}requestDataCheck(e,t,i,s){return!!(!e&&this.url||typeof e=="string")}requestData(e,t,i,s,n){var r;return!n&&this.requestDataCheck(e)?(e&&this.setUrl(e),r=this.generateConfig(i),this.sendRequest(this.url,t,r)):n}setDefaultConfig(e={}){this.config=Object.assign({},F.defaultConfig),typeof e=="string"?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return typeof e=="string"?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return this.table.options.ajaxRequesting.call(this.table,e,t)!==!1?this.loaderPromise(e,i,t).then(s=>(this.table.options.ajaxResponse&&(s=this.table.options.ajaxResponse.call(this.table,e,t,s)),s)):Promise.reject()}};b(F,"moduleName","ajax"),b(F,"defaultConfig",Lt),b(F,"defaultURLGenerator",qe),b(F,"defaultLoaderPromise",Dt),b(F,"contentTypeFormatters",zt);let me=F;var Ht={replace:function(l){return this.table.setData(l)},update:function(l){return this.table.updateOrAddData(l)},insert:function(l){return this.table.addData(l)}},Ft={table:function(l){var e=[],t=!0,i=this.table.columnManager.columns,s=[],n=[];return l=l.split(` `),l.forEach(function(r){e.push(r.split(" "))}),e.length&&!(e.length===1&&e[0].length<2)?(e[0].forEach(function(r){var o=i.find(function(a){return r&&a.definition.title&&r.trim()&&a.definition.title.trim()===r.trim()});o?s.push(o):t=!1}),t||(t=!0,s=[],e[0].forEach(function(r){var o=i.find(function(a){return r&&a.field&&r.trim()&&a.field.trim()===r.trim()});o?s.push(o):t=!1}),t||(s=this.table.columnManager.columnsByIndex)),t&&e.shift(),e.forEach(function(r){var o={};r.forEach(function(a,h){s[h]&&(o[s[h].field]=a)}),n.push(o)}),n):!1}},Pt={copyToClipboard:["ctrl + 67","meta + 67"]},Ot={copyToClipboard:function(l){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},At={keybindings:{bindings:Pt,actions:Ot}};const _=class _ extends w{constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,(this.mode===!0||this.mode==="copy")&&this.table.element.addEventListener("copy",e=>{var t,i,s;this.blocked||(e.preventDefault(),this.customSelection?(t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t))):(s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),i=this.table.modules.export.generateHTMLTable(s),t=i?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset())}),(this.mode===!0||this.mode==="paste")&&this.table.element.addEventListener("paste",e=>{this.paste(e)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach(i=>{var s=[];i.columns.forEach(n=>{var r="";if(n)if(i.type==="group"&&(n.value=n.component.getKey()),n.value===null)r="";else switch(typeof n.value){case"object":r=JSON.stringify(n.value);break;case"undefined":r="";break;default:r=n.value}s.push(r)}),t.push(s.join(" "))}),t.join(` `)}copy(e,t){var i,s;this.blocked=!1,this.customSelection=!1,(this.mode===!0||this.mode==="copy")&&(this.rowRange=e||this.table.options.clipboardCopyRowRange,typeof window.getSelection<"u"&&typeof document.createRange<"u"?(e=document.createRange(),e.selectNodeContents(this.table.element),i=window.getSelection(),i.toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):typeof document.selection<"u"&&typeof document.body.createTextRange<"u"&&(s=document.body.createTextRange(),s.moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=_.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e;break}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=_.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e;break}}paste(e){var t,i,s;this.checkPasteOrigin(e)&&(t=this.getPasteData(e),i=this.pasteParser.call(this,t),i?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach(i=>{t.push(this.table.modules.mutator.transformRow(i,"clipboard"))}):t=e,t}checkPasteOrigin(e){var t=!0,i=this.confirm("clipboard-paste",[e]);return(i||!["DIV","SPAN"].includes(e.target.tagName))&&(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}};b(_,"moduleName","clipboard"),b(_,"moduleExtensions",At),b(_,"pasteActions",Ht),b(_,"pasteParsers",Ft);let ge=_;class _t{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}_getSelf(){return this._row}}class Ye{constructor(e){return this._cell=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._cell.table.componentFunctionBinder.handle("cell",t._cell,i)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(e){return this._cell.row.getData(e)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){typeof t>"u"&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class ne extends M{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.column.isRowHeader&&this.element.classList.add("tabulator-row-header")}_configureCell(){var e=this.element,t=this.column.getField(),i={top:"flex-start",bottom:"flex-end",middle:"center"},s={left:"flex-start",right:"flex-end",center:"center"};if(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems=i[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent=s[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass){var n=this.column.definition.cssClass.split(" ");n.forEach(r=>{e.classList.add(r)})}this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(e=this.chain("cell-format",this,null,()=>this.element.innerHTML=this.value),typeof e){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",e!=null&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){var s=this.setValueProcessData(e,t,i);s&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var s=!1;return(this.value!==e||i)&&(s=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),s&&this.dispatch("cell-value-changed",this),s}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new Ye(this)),this.component}}class $e{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._column.table.componentFunctionBinder.handle("column",t._column,i)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach(function(e){e.show()}):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach(function(e){e.hide()}):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach(function(t){e.push(t.getComponent())}),e}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(e,t){return this._column.table.columnManager.scrollToColumn(this._column,e,t)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return e?e.getComponent():!1}getPrevColumn(){var e=this._column.prevColumn();return e?e.getComponent():!1}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return e===!0?t=this._column.reinitializeWidth(!0):t=this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}var Qe={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};const W=class W extends M{constructor(e,t,i){super(t.table),this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.isGroup=!1,this.isRowHeader=i,this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach((s,n)=>{var r=new W(s,this);this.attachColumn(r)}),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize()}createElement(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.isRowHeader&&e.classList.add("tabulator-row-header"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end";break}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)typeof this.definition[t]>"u"&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(W.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach(e=>{W.defaultOptionList.indexOf(e)===-1&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)})}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach(function(e){e.reRegisterPosition()}):this.registerColumnPosition(this)}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),e.headerVertical==="flip"&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;if(this.dispatch("column-layout",this),typeof e.visible<"u"&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass){var t=e.cssClass.split(" ");t.forEach(i=>{this.element.classList.add(i)})}e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.headerWordWrap&&t.classList.add("tabulator-col-title-wrap"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",s=>{s.stopPropagation(),i.focus()}),i.addEventListener("mousedown",s=>{s.stopPropagation()}),i.addEventListener("change",()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())}),t.appendChild(i),e.field?this.langBind("columns|"+e.field,s=>{i.value=s||e.title||" "}):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,s=>{this._formatColumnHeaderTitle(t,s||e.title||" ")}):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,()=>t);switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){var e=this.definition.cssClass.split(" ");e.forEach(t=>{this.element.classList.add(t)})}this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t=e,i=this.fieldStructure,s=i.length,n;for(let r=0;r{t.push(i),t=t.concat(i.getColumns(!0))}):t=this.columns,t}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(e){var t=[];return this.isGroup&&e&&(this.columns.forEach(function(i){t.push(i.getDefinition(!0))}),this.definition.columns=t),this.definition}checkColumnVisibility(){var e=!1;this.columns.forEach(function(t){t.visible&&(e=!0)}),e?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(e,t){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.show()}),!this.isGroup&&this.width===null&&this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(e,t){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.hide()}),this.dispatch("column-hide",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var e=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}),this.contentElement.style.maxWidth=e-1+"px",this.table.initialized&&(this.element.style.width=e+"px"),this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(e){var t=this.columns.indexOf(e);t>-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(t){t.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this),this.subscribedExternal("columnWidth")&&this.dispatchExternal("columnWidth",this.getComponent())}checkCellHeights(){var e=[];this.cells.forEach(function(t){t.row.heightInitialized&&(t.row.getElement().offsetParent!==null?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)}),e.forEach(function(t){t.calcHeight()}),e.forEach(function(t){t.setCellHeight()})}getWidth(){var e=0;return this.isGroup?this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}):e=this.width,e}getLeftOffset(){var e=this.element.offsetLeft;return this.parent.isGroup&&(e+=this.parent.getLeftOffset()),e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(t){t.setMinWidth()})}setMaxWidth(e){this.minWidth&&e{this.isGroup&&this.columns.forEach(function(s){s.delete()}),this.dispatch("column-delete",this);var i=this.cells.length;for(let s=0;s-1?this._nextVisibleColumn(e+1):!1}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1?this._prevVisibleColumn(e-1):!1}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,typeof this.definition.width<"u"&&!e&&this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach(s=>{s.clearWidth()}));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach(s=>{var n=s.getWidth();n>t&&(t=n)}),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then(i=>(t.field==this.field&&(this.field=!1),this.delete().then(()=>i.getComponent()))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new $e(this)),this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof W?this.parent.getComponent():!1}};b(W,"defaultOptionList",Qe);let U=W;class oe{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(e,t){return this._row.table.rowManager.scrollToRow(this._row,e,t)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e&&e.getComponent()}getPrevRow(){var e=this._row.prevRow();return e&&e.getComponent()}}class S extends M{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e,t){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,t),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,t)}rendered(){this.cells.forEach(e=>{e.cellRendered()})}reinitializeHeight(){this.heightInitialized=!1,this.element&&this.element.offsetParent!==null&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&this.element.offsetParent!==null&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t=0,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(i=this.calcMinHeight(),t=this.calcMaxHeight(),e?this.height=Math.max(t,i):this.height=this.manualHeight?this.height:Math.max(t,i)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var e=0;return this.cells.forEach(function(t){var i=t.getHeight();i>e&&(e=i)}),e}setCellHeight(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach(function(e){e.clearHeight()})}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight,this.subscribedExternal("rowHeight")&&this.dispatchExternal("rowHeight",this.getComponent()))}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var t=this.element&&x.elVisible(this.element),i={},s;return new Promise((n,r)=>{typeof e=="string"&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(i=Object.assign(i,this.data),i=Object.assign(i,e)),s=this.chain("row-data-changing",[this,i,e],null,e);for(let o in s)this.data[o]=s[o];this.dispatch("row-data-save-after",this);for(let o in e)this.table.columnManager.getColumnsByFieldRoot(o).forEach(h=>{let d=this.getCell(h.getField());if(d){let u=h.getFieldValue(s);d.getValue()!==u&&(d.setValueProcessData(u),t&&d.cellRendered())}});t?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,t,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n()})}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){var t=!1;return e=this.table.columnManager.findColumn(e),!this.initialized&&this.cells.length===0&&this.generateCells(),t=this.cells.find(function(i){return i.column===e}),t}getCellIndex(e){return this.cells.findIndex(function(t){return t===e})}findCell(e){return this.cells.find(t=>t.element===e)}getCells(){return!this.initialized&&this.cells.length===0&&this.generateCells(),this.cells}nextRow(){var e=this.table.rowManager.nextDisplayRow(this,!0);return e||!1}prevRow(){var e=this.table.rowManager.prevDisplayRow(this,!0);return e||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t{t(this.position)}))}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new oe(this)),this.component}}var Bt={avg:function(l,e,t){var i=0,s=typeof t.precision<"u"?t.precision:2;return l.length&&(i=l.reduce(function(n,r){return Number(n)+Number(r)}),i=i/l.length,i=s!==!1?i.toFixed(s):i),parseFloat(i).toString()},max:function(l,e,t){var i=null,s=typeof t.precision<"u"?t.precision:!1;return l.forEach(function(n){n=Number(n),(n>i||i===null)&&(i=n)}),i!==null?s!==!1?i.toFixed(s):i:""},min:function(l,e,t){var i=null,s=typeof t.precision<"u"?t.precision:!1;return l.forEach(function(n){n=Number(n),(n(l||s===0)&&l.indexOf(s)===n);return i.length}};const B=class B extends w{constructor(e){super(e),this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-calcs-holder"),e}initialize(){this.genColumn=new U({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(e){this.recalc(this.table.rowManager.activeRows),e&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(e,t){return this.topRow&&t.unshift(this.topRow),this.botRow&&t.push(this.botRow),t}rowsUpdated(e){this.table.options.groupBy?this.recalcRowGroup(e):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(e){(e.column.definition.topCalc||e.column.definition.bottomCalc)&&(this.table.options.groupBy?((this.table.options.columnCalcs=="table"||this.table.options.columnCalcs=="both")&&this.recalcActiveRows(),this.table.options.columnCalcs!="table"&&this.recalcRowGroup(e.row)):this.recalcActiveRows())}initializeColumnCheck(e){(e.definition.topCalc||e.definition.bottomCalc)&&this.initializeColumn(e)}initializeColumn(e){var t=e.definition,i={topCalcParams:t.topCalcParams||{},botCalcParams:t.bottomCalcParams||{}};if(t.topCalc){switch(typeof t.topCalc){case"string":B.calculations[t.topCalc]?i.topCalc=B.calculations[t.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.topCalc);break;case"function":i.topCalc=t.topCalc;break}i.topCalc&&(e.modules.columnCalcs=i,this.topCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeTopRow())}if(t.bottomCalc){switch(typeof t.bottomCalc){case"string":B.calculations[t.bottomCalc]?i.botCalc=B.calculations[t.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.bottomCalc);break;case"function":i.botCalc=t.bottomCalc;break}i.botCalc&&(e.modules.columnCalcs=i,this.botCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var e=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),e=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),e=!0),e&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){var e=document.createDocumentFragment();this.topInitialized||(e.appendChild(document.createElement("br")),e.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(e,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(e){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=e)}recalc(e){var t,i;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(t=this.rowsToData(e),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),i=this.generateRow("top",t),this.topRow=i;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(i.getElement()),i.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),i=this.generateRow("bottom",t),this.botRow=i;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(i.getElement()),i.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(e){this.recalcGroup(this.table.modules.groupRows.getRowGroup(e))}recalcAll(){if((this.topCalcs.length||this.botCalcs.length)&&(this.table.options.columnCalcs!=="group"&&this.recalcActiveRows(),this.table.options.groupBy&&this.table.options.columnCalcs!=="table")){var e=this.table.modules.groupRows.getChildGroups();e.forEach(t=>{this.recalcGroup(t)})}}recalcGroup(e){var t,i;this.blockCheck()||e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[],i=this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs,s=this.table.modules.dataTree;return e.forEach(n=>{var r;t.push(n.getData()),i&&((r=n.modules.dataTree)!=null&&r.open)&&this.rowsToData(s.getFilteredTreeChildren(n)).forEach(o=>{t.push(n)})}),t}generateRow(e,t){var i=this.generateRowData(e,t),s;return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),s=new S(i,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),s.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),s.component=!1,s.getComponent=()=>(s.component||(s.component=new _t(s)),s.component),s.generateCells=()=>{var n=[];this.table.columnManager.columnsByIndex.forEach(r=>{this.genColumn.setField(r.getField()),this.genColumn.hozAlign=r.hozAlign,r.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(r.definition[e+"CalcFormatter"]),params:r.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=r.definition.cssClass;var o=new ne(this.genColumn,s);o.getElement(),o.column=r,o.setWidth(),r.cells.push(o),n.push(o),r.visible||o.hide()}),s.cells=n},s}generateRowData(e,t){var i={},s=e=="top"?this.topCalcs:this.botCalcs,n=e=="top"?"topCalc":"botCalc",r,o;return s.forEach(function(a){var h=[];a.modules.columnCalcs&&a.modules.columnCalcs[n]&&(t.forEach(function(d){h.push(a.getFieldValue(d))}),o=n+"Params",r=typeof a.modules.columnCalcs[o]=="function"?a.modules.columnCalcs[o](h,t):a.modules.columnCalcs[o],a.setFieldValue(i,a.modules.columnCalcs[n](h,t,r)))}),i}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={},t;return this.table.options.groupBy&&this.table.modExists("groupRows")?(t=this.table.modules.groupRows.getGroups(!0),t.forEach(i=>{e[i.getKey()]=this.getGroupResults(i)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),s={},n={};return i.forEach(r=>{s[r.getKey()]=this.getGroupResults(r)}),n={top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:s},n}adjustForScrollbar(e){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=e+"px":this.botElement.style.paddingRight=e+"px")}};b(B,"moduleName","columnCalcs"),b(B,"calculations",Bt);let be=B;class Ze extends w{constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),t.dataTreeBranchElement?t.dataTreeBranchElement===!0?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):typeof t.dataTreeBranchElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement:(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch-empty")),t.dataTreeCollapseElement?typeof t.dataTreeCollapseElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="
"),t.dataTreeExpandElement?typeof t.dataTreeExpandElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(i,s){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(i,s){return t.dataTreeStartExpanded[s]};break}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){var t;e&&(t=this.table.rowManager.getRows(),t.forEach(i=>{this.reinitializeRowChildren(i)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||(e?e.field:!1)}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach(t=>{e=e.concat(this.getTreeChildren(t,!1,!0))}),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){var t=e.column.getField();t===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),s=i||!i&&typeof t=="object"&&t!==null;!s&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!s&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:s?e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0):!1,controlEl:e.modules.dataTree&&s?e.modules.dataTree.controlEl:!1,branchEl:e.modules.dataTree&&s?e.modules.dataTree.branchEl:!1,parent:e.modules.dataTree?e.modules.dataTree.parent:!1,children:s}}reinitializeRowChildren(e){var t=this.getTreeChildren(e,!1,!0);t.forEach(function(i){i.reinitialize(!0)})}layoutRow(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],i=t.getElement(),s=e.modules.dataTree;s.branchEl&&(s.branchEl.parentNode&&s.branchEl.parentNode.removeChild(s.branchEl),s.branchEl=!1),s.controlEl&&(s.controlEl.parentNode&&s.controlEl.parentNode.removeChild(s.controlEl),s.controlEl=!1),this.generateControlElement(e,i),e.getElement().classList.add("tabulator-tree-level-"+s.index),s.index&&(this.branchEl?(s.branchEl=this.branchEl.cloneNode(!0),i.insertBefore(s.branchEl,i.firstChild),this.table.rtl?s.branchEl.style.marginRight=(s.branchEl.offsetWidth+s.branchEl.style.marginLeft)*(s.index-1)+s.index*this.indent+"px":s.branchEl.style.marginLeft=(s.branchEl.offsetWidth+s.branchEl.style.marginRight)*(s.index-1)+s.index*this.indent+"px"):this.table.rtl?i.style.paddingRight=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-right"))+s.index*this.indent+"px":i.style.paddingLeft=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-left"))+s.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,s=i.controlEl;t=t||e.getCells()[0].getElement(),i.children!==!1&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",n=>{n.stopPropagation(),this.collapseRow(e)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",n=>{n.stopPropagation(),this.expandRow(e)})),i.controlEl.addEventListener("mousedown",n=>{n.stopPropagation()}),s&&s.parentNode===t?s.parentNode.replaceChild(i.controlEl,s):t.insertBefore(i.controlEl,t.firstChild))}getRows(e){var t=[];return e.forEach((i,s)=>{var n,r;t.push(i),i instanceof S&&(i.create(),n=i.modules.dataTree,!n.index&&n.children!==!1&&(r=this.getChildren(i,!1,!0),r.forEach(o=>{o.create(),t.push(o)})))}),t}getChildren(e,t,i){var s=e.modules.dataTree,n=[],r=[];return s.children!==!1&&(s.open||t)&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?n=this.table.modules.filter.filter(s.children):n=s.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(n,i),n.forEach(o=>{r.push(o);var a=this.getChildren(o,!1,!0);a.forEach(h=>{r.push(h)})})),r}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(s=>{var n=new S(s||{},this.table.rowManager);n.create(),n.modules.dataTree.index=e.modules.dataTree.index+1,n.modules.dataTree.parent=e,n.modules.dataTree.children&&(n.modules.dataTree.open=this.startOpen(n.getComponent(),n.modules.dataTree.index)),t.push(n)}),t}expandRow(e,t){var i=e.modules.dataTree;i.children!==!1&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return e.modules.dataTree.parent?e.modules.dataTree.parent.getComponent():!1}getTreeParentRoot(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[],s;return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?s=this.table.modules.filter.filter(t.children):s=t.children,s.forEach(n=>{n instanceof S&&i.push(n)})),i}rowDelete(e){var t=e.modules.dataTree.parent,i;t&&(i=this.findChildIndex(e,t),i!==!1&&t.data[this.field].splice(i,1),t.data[this.field].length||delete t.data[this.field],this.initializeRow(t),this.layoutRow(t)),this.refreshData(!0)}addTreeChildRow(e,t,i,s){var n=!1;typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),typeof s<"u"&&(n=this.findChildIndex(s,e),n!==!1&&e.data[this.field].splice(i?n:n+1,0,t)),n===!1&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return typeof e=="object"?e instanceof S?i=e.data:e instanceof oe?i=e._getSelf().data:typeof HTMLElement<"u"&&e instanceof HTMLElement?t.modules.dataTree&&(i=t.modules.dataTree.children.find(s=>s instanceof S?s.element===e:!1),i&&(i=i.data)):e===null&&(i=!1):typeof e>"u"?i=!1:i=t.data[this.field].find(s=>s.data[this.table.options.index]==e),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),i==-1&&(i=!1)),i}getTreeChildren(e,t,i){var s=e.modules.dataTree,n=[];return s&&s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),s.children.forEach(r=>{r instanceof S&&(n.push(t?r.getComponent():r),i&&this.getTreeChildren(r,t,i).forEach(o=>{n.push(o)}))})),n}getChildField(){return this.field}redrawNeeded(e){return(this.field?typeof e[this.field]<"u":!1)||(this.elementField?typeof e[this.elementField]<"u":!1)}}b(Ze,"moduleName","dataTree");function Vt(l,e={},t){var i=e.delimiter?e.delimiter:",",s=[],n=[];l.forEach(r=>{var o=[];switch(r.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":r.columns.forEach((a,h)=>{a&&a.depth===1&&(n[h]=typeof a.value>"u"||a.value===null?"":'"'+String(a.value).split('"').join('""')+'"')});break;case"row":r.columns.forEach(a=>{if(a){switch(typeof a.value){case"object":a.value=a.value!==null?JSON.stringify(a.value):"";break;case"undefined":a.value="";break}o.push('"'+String(a.value).split('"').join('""')+'"')}}),s.push(o.join(i));break}}),n.length&&s.unshift(n.join(i)),s=s.join(` `),e.bom&&(s="\uFEFF"+s),t(s,"text/csv")}function It(l,e,t){var i=[];l.forEach(s=>{var n={};switch(s.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":s.columns.forEach(r=>{r&&(n[r.component.getTitleDownload()||r.component.getField()]=r.value)}),i.push(n);break}}),i=JSON.stringify(i,null," "),t(i,"application/json")}function Nt(l,e={},t){var i=[],s=[],n={},r=e.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},o=e.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},a=e.jsPDF||{},h=e.title?e.title:"";a.orientation||(a.orientation=e.orientation||"landscape"),a.unit||(a.unit="pt"),l.forEach(c=>{switch(c.type){case"header":i.push(d(c));break;case"group":s.push(d(c,r));break;case"calc":s.push(d(c,o));break;case"row":s.push(d(c));break}});function d(c,f){var g=[];return c.columns.forEach(p=>{var v;if(p){switch(typeof p.value){case"object":p.value=p.value!==null?JSON.stringify(p.value):"";break;case"undefined":p.value="";break}v={content:p.value,colSpan:p.width,rowSpan:p.height},f&&(v.styles=f),g.push(v)}}),g}var u=new jspdf.jsPDF(a);e.autoTable&&(typeof e.autoTable=="function"?n=e.autoTable(u)||{}:n=e.autoTable),h&&(n.didDrawPage=function(c){u.text(h,40,30)}),n.head=i,n.body=s,u.autoTable(n),e.documentProcessing&&e.documentProcessing(u),t(u.output("arraybuffer"),"application/pdf")}function Wt(l,e,t){var i=this,s=e.sheetName||"Sheet1",n=XLSX.utils.book_new(),r=new M(this),o="compress"in e?e.compress:!0,a=e.writeOptions||{bookType:"xlsx",bookSST:!0,compression:o},h;a.type="binary",n.SheetNames=[],n.Sheets={};function d(){var f=[],g=[],p={},v={s:{c:0,r:0},e:{c:l[0]?l[0].columns.reduce((m,C)=>m+(C&&C.width?C.width:1),0):0,r:l.length}};return l.forEach((m,C)=>{var T=[];m.columns.forEach(function(y,k){y?(T.push(!(y.value instanceof Date)&&typeof y.value=="object"?JSON.stringify(y.value):y.value),(y.width>1||y.height>-1)&&(y.height>1||y.width>1)&&g.push({s:{r:C,c:k},e:{r:C+y.height-1,c:k+y.width-1}})):T.push("")}),f.push(T)}),XLSX.utils.sheet_add_aoa(p,f),p["!ref"]=XLSX.utils.encode_range(v),g.length&&(p["!merges"]=g),p}if(e.sheetOnly){t(d());return}if(e.sheets)for(var u in e.sheets)e.sheets[u]===!0?(n.SheetNames.push(u),n.Sheets[u]=d()):(n.SheetNames.push(u),r.commsSend(e.sheets[u],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:i.active,intercept:function(f){n.Sheets[u]=f}}));else n.SheetNames.push(s),n.Sheets[s]=d();e.documentProcessing&&(n=e.documentProcessing(n));function c(f){for(var g=new ArrayBuffer(f.length),p=new Uint8Array(g),v=0;v!=f.length;++v)p[v]=f.charCodeAt(v)&255;return g}h=XLSX.write(n,a),t(c(h),"application/octet-stream")}function Gt(l,e,t){this.modExists("export",!0)&&t(this.modules.export.generateHTMLTable(l),"text/html")}function jt(l,e,t){const i=[];l.forEach(s=>{const n={};switch(s.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":s.columns.forEach(r=>{r&&(n[r.component.getTitleDownload()||r.component.getField()]=r.value)}),i.push(JSON.stringify(n));break}}),t(i.join(` diff --git a/src/main/resources/static/assets/YamlGenerate-DLhPsACL.js b/src/main/resources/static/assets/YamlGenerate-Wt35UcvC.js similarity index 99% rename from src/main/resources/static/assets/YamlGenerate-DLhPsACL.js rename to src/main/resources/static/assets/YamlGenerate-Wt35UcvC.js index 579deb10..af421640 100644 --- a/src/main/resources/static/assets/YamlGenerate-DLhPsACL.js +++ b/src/main/resources/static/assets/YamlGenerate-Wt35UcvC.js @@ -1 +1 @@ -import{d as B,c as A,w as I,r as f,h as n,a,b as e,t as F,u as O,o as G,e as c,g as m,F as D,f as j,j as W,n as K,i as N,k as X}from"./index-DgPLCZcu.js";import{s as J}from"./request-D5nUjUnA.js";import{_ as Q}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Z=P=>J.post("/manifest/v1/generator/yaml/pod",P),ee=P=>J.post("/manifest/v1/generator/yaml/service",P),te=P=>J.post("/manifest/v1/generator/yaml/hpa",P),le=P=>J.post("/manifest/v1/generator/yaml/deployments",P),oe=P=>J.post("/manifest/v1/generator/yaml/configmap",P),se={class:"modal",id:"modal-pod",tabindex:"-1"},ne={class:"modal-dialog modal-lg",role:"document"},ae={class:"modal-content"},re={class:"modal-header"},ie={class:"modal-title"},de={class:"modal-body"},ue={class:"card"},ce={class:"card-body"},me=B({__name:"podModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{$.value&&await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",se,[e("div",ne,[e("div",ae,[e("div",re,[e("h5",ie,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",de,[e("div",ue,[e("div",ce,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),pe={class:"tab-pane active show",id:"tabs-pod"},ve={class:"card"},be={class:"card-body"},he={class:"mb-3"},ye={class:"mb-3"},fe={class:"mb-3"},ge=["onUpdate:modelValue"],_e=["onUpdate:modelValue"],we={class:"btn-list"},ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},$e=["onClick"],xe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ce={class:"card mt-4"},Ue={class:"card-body"},Me={class:"mb-3"},Ve={class:"btn-list"},Pe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},qe=["onClick"],Se={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},De={class:"row",style:{width:"68% !important"}},je={class:"col mt-4"},ze=["onUpdate:modelValue"],He={class:"col mt-4"},Le=["onUpdate:modelValue"],Be={class:"mb-3"},Re=["onUpdate:modelValue"],Ne=["onUpdate:modelValue"],Fe={class:"btn-list"},Ae=["onClick"],Ee={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Te=["onClick"],Ye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Oe={class:"mb-3"},Ge={class:"btn-list"},Ie=["onClick"],Ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Je=["onClick"],Qe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},We={class:"row",style:{width:"68% !important"}},Xe={class:"col mt-4"},Ze=["onUpdate:modelValue"],et={class:"col mt-4"},tt=["onUpdate:modelValue"],lt={class:"row",style:{width:"68% !important"}},ot={class:"col mt-4"},st=["onUpdate:modelValue"],nt={class:"col mt-4"},at=["onUpdate:modelValue"],rt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},it={class:"mb-3"},dt={class:"row",style:{width:"68% !important"}},ut={class:"col mt-4"},ct=["onUpdate:modelValue"],mt={class:"col mt-4"},pt=["onUpdate:modelValue"],vt={class:"row",style:{width:"68% !important"}},bt={class:"col mt-4"},ht=["onUpdate:modelValue"],yt={class:"col mt-4"},ft=["onUpdate:modelValue"],gt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},_t={class:"mb-3"},wt={class:"mt-4"},kt={class:"btn-list justify-content-end mt-4"},$t=B({__name:"podForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f(""),V=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const i of p.value)if(!i.name||i.name.trim()===""||!i.image||i.image.trim()==="")return!1;return!0});G(async()=>{await L()});const L=()=>{$.value="Pod",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value={containers:[],restartPolicy:""},p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter pod name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=i,w.value.metadata=l.value,r.value.containers=p.value,w.value.spec=r.value;const{data:t}=await Z(w.value);M.value=t},E=()=>{_.value.push({key:"",value:""})},T=i=>{_.value.length!==1&&_.value.splice(i,1)},H=()=>{p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},u=i=>{p.value.length!==1&&p.value.splice(i,1)},o=i=>{p.value[i].env.push({name:"",value:""})},U=(i,t)=>{p.value[i].env.length!==1&&p.value[i].env.splice(t,1)},x=i=>{p.value[i].ports.push({name:"",containerPort:"",hostPort:"",protocol:""})},k=(i,t)=>{p.value[i].ports.length!==1&&p.value[i].ports.splice(t,1)};return(i,t)=>(n(),a("div",pe,[e("div",ve,[t[9]||(t[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",be,[e("div",he,[t[4]||(t[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[0]||(t[0]=s=>l.value.name=s),placeholder:"pod-01"},null,512),[[m,l.value.name]])]),e("div",ye,[t[5]||(t[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[1]||(t[1]=s=>l.value.namespace=s),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",fe,[t[8]||(t[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(s,b)=>(n(),a("div",{class:"generate-form",key:b},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.key=y,placeholder:"key"},null,8,ge),[[m,s.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.value=y,placeholder:"value"},null,8,_e),[[m,s.value]]),e("div",we,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",ke,t[6]||(t[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>T(b)},[(n(),a("svg",xe,t[7]||(t[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,$e)])]))),128))])])]),e("div",Ce,[t[31]||(t[31]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Ue,[(n(!0),a(D,null,j(p.value,(s,b)=>(n(),a("div",{class:"mt-4",key:b},[e("div",Me,[e("div",Ve,[t[12]||(t[12]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Pe,t[10]||(t[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>u(b)},[(n(),a("svg",Se,t[11]||(t[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,qe)]),e("div",De,[e("div",je,[t[13]||(t[13]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.name=y},null,8,ze),[[m,s.name]])]),e("div",He,[t[14]||(t[14]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.image=y},null,8,Le),[[m,s.image]])])])]),e("div",Be,[t[17]||(t[17]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(s.env,(y,Y)=>(n(),a("div",{class:"generate-form",key:Y},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.name=g,placeholder:"key"},null,8,Re),[[m,y.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.value=g,placeholder:"value"},null,8,Ne),[[m,y.value]]),e("div",Fe,[e("button",{class:"btn btn-primary",onClick:g=>o(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ee,t[15]||(t[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ae),e("button",{class:"btn btn-primary",onClick:g=>U(b,Y)},[(n(),a("svg",Ye,t[16]||(t[16]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Te)])]))),128))]),e("div",Oe,[(n(!0),a(D,null,j(s.ports,(y,Y)=>(n(),a("div",{class:"mt-4",key:Y},[e("div",Ge,[t[20]||(t[20]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:g=>x(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ke,t[18]||(t[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ie),e("button",{class:"btn btn-primary",onClick:g=>k(b,Y)},[(n(),a("svg",Qe,t[19]||(t[19]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Je)]),e("div",We,[e("div",Xe,[t[21]||(t[21]=e("label",{class:"form-label"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.name=g},null,8,Ze),[[m,y.name]])]),e("div",et,[t[22]||(t[22]=e("label",{class:"form-label"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.containerPort=g},null,8,tt),[[m,y.containerPort]])])]),e("div",lt,[e("div",ot,[t[23]||(t[23]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.protocol=g},null,8,st),[[m,y.protocol]])]),e("div",nt,[t[24]||(t[24]=e("label",{class:"form-label"},"- Host Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.hostPort=g},null,8,at),[[m,y.hostPort]])])]),s.ports.length>1?(n(),a("div",rt)):W("",!0)]))),128))]),e("div",it,[t[29]||(t[29]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"Resources")],-1)),e("div",dt,[e("div",ut,[t[25]||(t[25]=e("label",{class:"form-label"},"- Limits CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.cpu=y},null,8,ct),[[m,s.resources.limits.cpu]])]),e("div",mt,[t[26]||(t[26]=e("label",{class:"form-label"},"- Limits Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.memory=y},null,8,pt),[[m,s.resources.limits.memory]])])]),e("div",vt,[e("div",bt,[t[27]||(t[27]=e("label",{class:"form-label"},"- Requests CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.cpu=y},null,8,ht),[[m,s.resources.requests.cpu]])]),e("div",yt,[t[28]||(t[28]=e("label",{class:"form-label"},"- Requests Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.memory=y},null,8,ft),[[m,s.resources.requests.memory]])])])]),p.value.length>1?(n(),a("div",gt)):W("",!0)]))),128)),e("div",_t,[e("div",wt,[t[30]||(t[30]=e("label",{class:"form-label"},"- Restart Policy",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":t[2]||(t[2]=s=>r.value.restartPolicy=s)},null,512),[[m,r.value.restartPolicy]])])])])]),e("div",kt,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:t[3]||(t[3]=s=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-pod"},"GENERATE",2)]),N(me,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),xt=Q($t,[["__scopeId","data-v-ebbc4037"]]),Ct={class:"modal",id:"modal-deploy",tabindex:"-1"},Ut={class:"modal-dialog modal-lg",role:"document"},Mt={class:"modal-content"},Vt={class:"modal-header"},Pt={class:"modal-title"},qt={class:"modal-body"},St={class:"card"},Dt={class:"card-body"},jt=B({__name:"deployModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ct,[e("div",Ut,[e("div",Mt,[e("div",Vt,[e("h5",Pt,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",qt,[e("div",St,[e("div",Dt,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),zt={class:"tab-pane",id:"tabs-deployment"},Ht={class:"card"},Lt={class:"card-body"},Bt={class:"mb-3"},Rt={class:"mb-3"},Nt={class:"mb-3"},Ft=["onUpdate:modelValue"],At=["onUpdate:modelValue"],Et={class:"btn-list"},Tt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Yt=["onClick"],Ot={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Gt={class:"card mt-4"},It={class:"card-body"},Kt={class:"mb-3"},Jt={class:"mb-3"},Qt=["onUpdate:modelValue"],Wt=["onUpdate:modelValue"],Xt={class:"btn-list"},Zt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},el=["onClick"],tl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ll={class:"mb-3"},ol=["onUpdate:modelValue"],sl=["onUpdate:modelValue"],nl={class:"btn-list"},al={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},rl=["onClick"],il={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},dl={class:"mb-3"},ul={class:"btn-list"},cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},ml=["onClick"],pl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vl={class:"row",style:{width:"68% !important"}},bl={class:"col mt-4"},hl=["onUpdate:modelValue"],yl={class:"col mt-4"},fl=["onUpdate:modelValue"],gl={class:"mb-3"},_l=["onUpdate:modelValue"],wl={class:"btn-list"},kl=["onClick"],$l={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},xl=["onClick"],Cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ul={class:"mb-3"},Ml=["onUpdate:modelValue"],Vl=["onUpdate:modelValue"],Pl={class:"btn-list"},ql=["onClick"],Sl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Dl=["onClick"],jl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},zl={class:"btn-list justify-content-end mt-4"},Hl=B({__name:"deploymentForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f([]),M=f({}),V=f([]),L=f(""),R=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const g of V.value)if(!g.name||g.name.trim()===""||!g.image||g.image.trim()==="")return!1;return!0});G(async()=>{await E()});const E=()=>{$.value="Deployment",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value={replicas:"",selector:{matchLabels:{}},template:{metadata:{labels:{}},spec:{containers:[]}}},V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},T=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter deployment name.");const v=document.querySelector('input[v-model="metadata.name"]');v==null||v.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const v=document.querySelector('input[v-model="metadata.namespace"]');v==null||v.focus();return}for(let v=0;v(v[q.key]=q.value,v),{}),d=r.value.reduce((v,q)=>(v[q.key]=q.value,v),{}),C=p.value.reduce((v,q)=>(v[q.key]=q.value,v),{});l.value.labels=g,w.value.metadata=l.value,M.value.selector.matchLabels=d,M.value.template.metadata.labels=C,M.value.template.spec.containers=V.value,w.value.spec=M.value,console.log("deployFormData.value : ",w.value);const{data:S}=await le(w.value);L.value=S},H=()=>{_.value.push({key:"",value:""})},u=g=>{_.value.length!==1&&_.value.splice(g,1)},o=()=>{r.value.push({key:"",value:""})},U=g=>{r.value.length!==1&&r.value.splice(g,1)},x=()=>{p.value.push({key:"",value:""})},k=g=>{p.value.length!==1&&p.value.splice(g,1)},i=()=>{V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},t=g=>{V.value.length!==1&&V.value.splice(g,1)},s=g=>{V.value[g].env.push({name:"",value:""})},b=(g,d)=>{V.value[g].env.length!==1&&V.value[g].env.splice(d,1)},y=g=>{V.value[g].ports.push({containerPort:""})},Y=(g,d)=>{V.value[g].ports.length!==1&&V.value[g].ports.splice(d,1)};return(g,d)=>(n(),a("div",zt,[e("div",Ht,[d[9]||(d[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Lt,[e("div",Bt,[d[4]||(d[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[0]||(d[0]=C=>l.value.name=C),placeholder:"deployment-01"},null,512),[[m,l.value.name]])]),e("div",Rt,[d[5]||(d[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[1]||(d[1]=C=>l.value.namespace=C),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Nt,[d[8]||(d[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Ft),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,At),[[m,C.value]]),e("div",Et,[e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Tt,d[6]||(d[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>u(S)},[(n(),a("svg",Ot,d[7]||(d[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Yt)])]))),128))])])]),e("div",Gt,[d[29]||(d[29]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",It,[e("div",Kt,[d[10]||(d[10]=e("label",{class:"form-label"},"- Replicas",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":d[2]||(d[2]=C=>M.value.replicas=C)},null,512),[[m,M.value.replicas]])]),e("div",Jt,[d[13]||(d[13]=e("label",{class:"form-label"},"- Match Labels",-1)),(n(!0),a(D,null,j(r.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Qt),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,Wt),[[m,C.value]]),e("div",Xt,[e("button",{class:"btn btn-primary",onClick:o,style:{"text-align":"center !important"}},[(n(),a("svg",Zt,d[11]||(d[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>U(S)},[(n(),a("svg",tl,d[12]||(d[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,el)])]))),128))]),d[28]||(d[28]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Template")],-1)),e("div",ll,[d[16]||(d[16]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"- Labels")],-1)),(n(!0),a(D,null,j(p.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,ol),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,sl),[[m,C.value]]),e("div",nl,[e("button",{class:"btn btn-primary",onClick:x,style:{"text-align":"center !important"}},[(n(),a("svg",al,d[14]||(d[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>k(S)},[(n(),a("svg",il,d[15]||(d[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,rl)])]))),128))]),(n(!0),a(D,null,j(V.value,(C,S)=>(n(),a("div",{key:S},[e("div",dl,[e("div",ul,[d[19]||(d[19]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:i,style:{"text-align":"center !important"}},[(n(),a("svg",cl,d[17]||(d[17]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>t(S)},[(n(),a("svg",pl,d[18]||(d[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ml)]),e("div",vl,[e("div",bl,[d[20]||(d[20]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.name=v},null,8,hl),[[m,C.name]])]),e("div",yl,[d[21]||(d[21]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.image=v},null,8,fl),[[m,C.image]])])])]),e("div",gl,[d[24]||(d[24]=e("label",{class:"form-label"},"- Port",-1)),(n(!0),a(D,null,j(C.ports,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.containerPort=z,placeholder:"value"},null,8,_l),[[m,v.containerPort]]),e("div",wl,[e("button",{class:"btn btn-primary",onClick:z=>y(S),style:{"text-align":"center !important"}},[(n(),a("svg",$l,d[22]||(d[22]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,kl),e("button",{class:"btn btn-primary",onClick:z=>Y(S,q)},[(n(),a("svg",Cl,d[23]||(d[23]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,xl)])]))),128))]),e("div",Ul,[d[27]||(d[27]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(C.env,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.name=z,placeholder:"key"},null,8,Ml),[[m,v.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.value=z,placeholder:"value"},null,8,Vl),[[m,v.value]]),e("div",Pl,[e("button",{class:"btn btn-primary",onClick:z=>s(S),style:{"text-align":"center !important"}},[(n(),a("svg",Sl,d[25]||(d[25]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ql),e("button",{class:"btn btn-primary",onClick:z=>b(S,q)},[(n(),a("svg",jl,d[26]||(d[26]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Dl)])]))),128))])]))),128))])]),e("div",zl,[e("a",{class:K(["btn btn-primary",{disabled:!R.value}]),onClick:d[3]||(d[3]=C=>R.value?T():null),"data-bs-toggle":"modal","data-bs-target":"#modal-deploy"},"GENERATE",2)]),N(jt,{"yaml-data":L.value,title:$.value},null,8,["yaml-data","title"])]))}}),Ll=Q(Hl,[["__scopeId","data-v-f08d5135"]]),Bl={class:"modal",id:"modal-service",tabindex:"-1"},Rl={class:"modal-dialog modal-lg",role:"document"},Nl={class:"modal-content"},Fl={class:"modal-header"},Al={class:"modal-title"},El={class:"modal-body"},Tl={class:"card"},Yl={class:"card-body"},Ol=B({__name:"servcieModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Bl,[e("div",Rl,[e("div",Nl,[e("div",Fl,[e("h5",Al,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",El,[e("div",Tl,[e("div",Yl,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Gl={class:"tab-pane",id:"tabs-service"},Il={class:"card"},Kl={class:"card-body"},Jl={class:"mb-3"},Ql={class:"mb-3"},Wl={class:"mb-3"},Xl=["onUpdate:modelValue"],Zl=["onUpdate:modelValue"],eo={class:"btn-list"},to={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},lo=["onClick"],oo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},so={class:"card mt-4"},no={class:"card-body"},ao={class:"mb-3"},ro=["onUpdate:modelValue"],io=["onUpdate:modelValue"],uo={class:"btn-list"},co={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},mo=["onClick"],po={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vo={class:"mb-3"},bo={class:"btn-list"},ho={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},yo=["onClick"],fo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},go={class:"row",style:{width:"68% !important"}},_o={class:"col mt-4"},wo=["onUpdate:modelValue"],ko={class:"col mt-4"},$o=["onUpdate:modelValue"],xo={class:"row",style:{width:"68% !important"}},Co={class:"col mt-4"},Uo=["onUpdate:modelValue"],Mo={class:"col mt-4"},Vo=["onUpdate:modelValue"],Po={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},qo={class:"row",style:{width:"68% !important"}},So={class:"col mt-4"},Do={class:"btn-list justify-content-end mt-4"},jo=B({__name:"serviceForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f([]);f("");const V=f(""),L=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const k of M.value)if(!k.port||k.port.trim()===""||!k.targetPort||k.targetPort.trim()==="")return!1;return!0});G(async()=>{await R()});const R=()=>{$.value="Service",l.value={name:"",namespace:"",labels:{}},r.value={selector:{},ports:[],type:""},_.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},E=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter service name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=k,w.value.metadata=l.value;const i=p.value.reduce((s,b)=>(s[b.key]=b.value,s),{});r.value.selector=i,r.value.ports=M.value,w.value.spec=r.value;const{data:t}=await ee(w.value);V.value=t},T=()=>{_.value.push({key:"",value:""})},H=k=>{_.value.length!==1&&_.value.splice(k,1)},u=()=>{p.value.push({key:"",value:""})},o=k=>{p.value.length!==1&&p.value.splice(k,1)},U=()=>{M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},x=k=>{M.value.length!==1&&M.value.splice(k,1)};return(k,i)=>(n(),a("div",Gl,[e("div",Il,[i[9]||(i[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Kl,[e("div",Jl,[i[4]||(i[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[0]||(i[0]=t=>l.value.name=t),placeholder:"name-01"},null,512),[[m,l.value.name]])]),e("div",Ql,[i[5]||(i[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[1]||(i[1]=t=>l.value.namespace=t),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Wl,[i[8]||(i[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,Xl),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,Zl),[[m,t.value]]),e("div",eo,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",to,i[6]||(i[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>H(s)},[(n(),a("svg",oo,i[7]||(i[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,lo)])]))),128))])])]),e("div",so,[i[21]||(i[21]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",no,[e("div",ao,[i[12]||(i[12]=e("label",{class:"form-label"},"- Selector",-1)),(n(!0),a(D,null,j(p.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,ro),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,io),[[m,t.value]]),e("div",uo,[e("button",{class:"btn btn-primary",onClick:u,style:{"text-align":"center !important"}},[(n(),a("svg",co,i[10]||(i[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>o(s)},[(n(),a("svg",po,i[11]||(i[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,mo)])]))),128))]),e("div",vo,[(n(!0),a(D,null,j(M.value,(t,s)=>(n(),a("div",{class:"mt-4",key:s},[e("div",bo,[i[15]||(i[15]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:U,style:{"text-align":"center !important"}},[(n(),a("svg",ho,i[13]||(i[13]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>x(s)},[(n(),a("svg",fo,i[14]||(i[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,yo)]),e("div",go,[e("div",_o,[i[16]||(i[16]=e("label",{class:"form-label required"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.port=b},null,8,wo),[[m,t.port]])]),e("div",ko,[i[17]||(i[17]=e("label",{class:"form-label required"},"- Target Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.targetPort=b},null,8,$o),[[m,t.targetPort]])])]),e("div",xo,[e("div",Co,[i[18]||(i[18]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.protocol=b},null,8,Uo),[[m,t.protocol]])]),e("div",Mo,[i[19]||(i[19]=e("label",{class:"form-label"},"- Node Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.nodePort=b},null,8,Vo),[[m,t.nodePort]])])]),M.value.length>1?(n(),a("div",Po)):W("",!0)]))),128)),e("div",qo,[e("div",So,[i[20]||(i[20]=e("label",{class:"form-label"},"- Type",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":i[2]||(i[2]=t=>r.value.type=t)},null,512),[[m,r.value.type]])])])])])]),e("div",Do,[e("a",{class:K(["btn btn-primary",{disabled:!L.value}]),onClick:i[3]||(i[3]=t=>L.value?E():null),"data-bs-toggle":"modal","data-bs-target":"#modal-service"},"GENERATE",2)]),N(Ol,{"yaml-data":V.value,title:$.value},null,8,["yaml-data","title"])]))}}),zo=Q(jo,[["__scopeId","data-v-b9ba3952"]]),Ho={class:"modal",id:"modal-yaml",tabindex:"-1"},Lo={class:"modal-dialog modal-lg",role:"document"},Bo={class:"modal-content"},Ro={class:"modal-header"},No={class:"modal-title"},Fo={class:"modal-body"},Ao={class:"card"},Eo={class:"card-body"},To=B({__name:"yamlModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ho,[e("div",Lo,[e("div",Bo,[e("div",Ro,[e("h5",No,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",Fo,[e("div",Ao,[e("div",Eo,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Yo={class:"tab-pane",id:"tabs-hpa"},Oo={class:"card"},Go={class:"card-body"},Io={class:"mb-3"},Ko={class:"mb-3"},Jo={class:"mb-3"},Qo=["onUpdate:modelValue"],Wo=["onUpdate:modelValue"],Xo={class:"btn-list"},Zo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},es=["onClick"],ts={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ls={class:"card mt-4"},os={class:"card-body"},ss={class:"row",style:{width:"68% !important"}},ns={class:"col"},as={class:"col"},rs={class:"row",style:{width:"68% !important"}},is={class:"col"},ds={class:"row",style:{width:"68% !important"}},us={class:"col"},cs={class:"row",style:{width:"68% !important"}},ms={class:"col"},ps={class:"row",style:{width:"68% !important"}},vs={class:"col"},bs={class:"btn-list justify-content-end mt-4"},hs=B({__name:"hpaForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f({}),M=f(""),V=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""||!p.value.apiVersion||p.value.apiVersion.trim()===""||!p.value.kind||p.value.kind.trim()===""||!p.value.name||p.value.name.trim()===""||!r.value.minReplicas||r.value.minReplicas.trim()===""||!r.value.maxReplicas||r.value.maxReplicas.trim()===""||!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""));G(async()=>{await L()});const L=()=>{$.value="HPA",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value={scaleTargetRef:{},minReplicas:"",maxReplicas:"",targetCPUUtilizationPercentage:""},p.value={apiVersion:"",kind:"",name:""}},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter HPA name.");const o=document.querySelector('input[v-model="metadata.name"]');o==null||o.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const o=document.querySelector('input[v-model="metadata.namespace"]');o==null||o.focus();return}if(!p.value.apiVersion||p.value.apiVersion.trim()===""){h.error("Please enter API version.");const o=document.querySelector('input[v-model="scaleTargetRef.apiVersion"]');o==null||o.focus();return}if(!p.value.kind||p.value.kind.trim()===""){h.error("Please enter kind.");const o=document.querySelector('input[v-model="scaleTargetRef.kind"]');o==null||o.focus();return}if(!p.value.name||p.value.name.trim()===""){h.error("Please enter target name.");const o=document.querySelector('input[v-model="scaleTargetRef.name"]');o==null||o.focus();return}if(!r.value.minReplicas||r.value.minReplicas.trim()===""){h.error("Please enter min replicas.");const o=document.querySelector('input[v-model="spec.minReplicas"]');o==null||o.focus();return}if(!r.value.maxReplicas||r.value.maxReplicas.trim()===""){h.error("Please enter max replicas.");const o=document.querySelector('input[v-model="spec.maxReplicas"]');o==null||o.focus();return}if(!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""){h.error("Please enter CPU percentage.");const o=document.querySelector('input[v-model="spec.targetCPUUtilizationPercentage"]');o==null||o.focus();return}const H=_.value.reduce((o,U)=>(o[U.key]=U.value,o),{});l.value.labels=H,r.value.scaleTargetRef=p.value,w.value.metadata=l.value,w.value.spec=r.value;const{data:u}=await te(w.value);M.value=u},E=()=>{_.value.push({key:"",value:""})},T=H=>{_.value.length!==1&&_.value.splice(H,1)};return(H,u)=>(n(),a("div",Yo,[e("div",Oo,[u[14]||(u[14]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Go,[e("div",Io,[u[9]||(u[9]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[0]||(u[0]=o=>l.value.name=o),placeholder:"name"},null,512),[[m,l.value.name]])]),e("div",Ko,[u[10]||(u[10]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[1]||(u[1]=o=>l.value.namespace=o),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Jo,[u[13]||(u[13]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(o,U)=>(n(),a("div",{class:"generate-form",key:U},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.key=x,placeholder:"key"},null,8,Qo),[[m,o.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.value=x,placeholder:"value"},null,8,Wo),[[m,o.value]]),e("div",Xo,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",Zo,u[11]||(u[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:x=>T(U)},[(n(),a("svg",ts,u[12]||(u[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,es)])]))),128))])])]),e("div",ls,[u[22]||(u[22]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",os,[u[21]||(u[21]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Scale Target")],-1)),e("div",ss,[e("div",ns,[u[15]||(u[15]=e("label",{class:"form-label required"},"- Api Version",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[2]||(u[2]=o=>p.value.apiVersion=o)},null,512),[[m,p.value.apiVersion]])]),e("div",as,[u[16]||(u[16]=e("label",{class:"form-label required"},"- Kind",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[3]||(u[3]=o=>p.value.kind=o)},null,512),[[m,p.value.kind]])])]),e("div",rs,[e("div",is,[u[17]||(u[17]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[4]||(u[4]=o=>p.value.name=o)},null,512),[[m,p.value.name]])])]),e("div",ds,[e("div",us,[u[18]||(u[18]=e("label",{class:"form-label required"},"- Min Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[5]||(u[5]=o=>r.value.minReplicas=o)},null,512),[[m,r.value.minReplicas]])])]),e("div",cs,[e("div",ms,[u[19]||(u[19]=e("label",{class:"form-label required"},"- Max Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[6]||(u[6]=o=>r.value.maxReplicas=o)},null,512),[[m,r.value.maxReplicas]])])]),e("div",ps,[e("div",vs,[u[20]||(u[20]=e("label",{class:"form-label required"},"- CPU Percentage",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[7]||(u[7]=o=>r.value.targetCPUUtilizationPercentage=o)},null,512),[[m,r.value.targetCPUUtilizationPercentage]])])])])]),e("div",bs,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:u[8]||(u[8]=o=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-yaml"},"GENERATE",2)]),N(To,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),ys=Q(hs,[["__scopeId","data-v-b0620f31"]]),fs={class:"modal",id:"modal-config-map",tabindex:"-1"},gs={class:"modal-dialog modal-lg",role:"document"},_s={class:"modal-content"},ws={class:"modal-header"},ks={class:"modal-title"},$s={class:"modal-body"},xs={class:"card"},Cs={class:"card-body"},Us=B({__name:"configMapModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",fs,[e("div",gs,[e("div",_s,[e("div",ws,[e("h5",ks,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",$s,[e("div",xs,[e("div",Cs,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Ms={class:"tab-pane",id:"tabs-configMap"},Vs={class:"card"},Ps={class:"card-body"},qs={class:"mb-3"},Ss={class:"mb-3"},Ds={class:"mb-3"},js=["onUpdate:modelValue"],zs=["onUpdate:modelValue"],Hs={class:"btn-list"},Ls={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Bs=["onClick"],Rs={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ns={class:"card mt-4"},Fs={class:"card-body"},As={class:"mb-3"},Es=["onUpdate:modelValue"],Ts=["onUpdate:modelValue"],Ys={class:"btn-list"},Os={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Gs=["onClick"],Is={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ks={class:"btn-list justify-content-end mt-4"},Js=B({__name:"configmapForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f(""),M=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""));G(async()=>{await V()});const V=()=>{$.value="ConfigMap",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value.push({key:"",value:""})},L=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter ConfigMap name.");const x=document.querySelector('input[v-model="metadata.name"]');x==null||x.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const x=document.querySelector('input[v-model="metadata.namespace"]');x==null||x.focus();return}const u=_.value.reduce((x,k)=>(x[k.key]=k.value,x),{});l.value.labels=u;const o=r.value.reduce((x,k)=>(x[k.key]=k.value,x),{});w.value.metadata=l.value,w.value.data=o;const{data:U}=await oe(w.value);p.value=U},R=()=>{_.value.push({key:"",value:""})},E=u=>{_.value.length!==1&&_.value.splice(u,1)},T=()=>{r.value.push({key:"",value:""})},H=u=>{r.value.length!==1&&r.value.splice(u,1)};return(u,o)=>(n(),a("div",Ms,[e("div",Vs,[o[8]||(o[8]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Ps,[e("div",qs,[o[3]||(o[3]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[0]||(o[0]=U=>l.value.name=U),placeholder:"configMap-01"},null,512),[[m,l.value.name]])]),e("div",Ss,[o[4]||(o[4]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[1]||(o[1]=U=>l.value.namespace=U),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Ds,[o[7]||(o[7]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,js),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,zs),[[m,U.value]]),e("div",Hs,[e("button",{class:"btn btn-primary",onClick:R,style:{"text-align":"center !important"}},[(n(),a("svg",Ls,o[5]||(o[5]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>E(x)},[(n(),a("svg",Rs,o[6]||(o[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Bs)])]))),128))])])]),e("div",Ns,[o[12]||(o[12]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Fs,[e("div",As,[o[11]||(o[11]=e("label",{class:"form-label"},"- Data",-1)),(n(!0),a(D,null,j(r.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,Es),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,Ts),[[m,U.value]]),e("div",Ys,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",Os,o[9]||(o[9]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>H(x)},[(n(),a("svg",Is,o[10]||(o[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Gs)])]))),128))])])]),e("div",Ks,[e("a",{class:K(["btn btn-primary",{disabled:!M.value}]),onClick:o[2]||(o[2]=U=>M.value?L():null),"data-bs-toggle":"modal","data-bs-target":"#modal-config-map"},"GENERATE",2)]),N(Us,{"yaml-data":p.value,title:$.value},null,8,["yaml-data","title"])]))}}),Qs=Q(Js,[["__scopeId","data-v-e0b005d8"]]),Ws={class:"card w-100",ref:"workflowForm"},Xs={class:"card-body"},Zs={class:"card"},en={class:"card-body"},tn={class:"tab-content"},nn=B({__name:"YamlGenerate",setup(P){return O(),G(async()=>{}),(h,$)=>(n(),a("div",Ws,[$[1]||($[1]=e("div",{class:"card-header"},[e("div",{class:"card-title"},[e("h1",null,"YAML Generator")])],-1)),e("div",Xs,[e("div",Zs,[$[0]||($[0]=X('',1)),e("div",en,[e("div",tn,[N(xt),N(Ll),N(zo),N(ys),N(Qs)])])])])],512))}});export{nn as default}; +import{d as B,c as A,w as I,r as f,h as n,a,b as e,t as F,u as O,o as G,e as c,g as m,F as D,f as j,j as W,n as K,i as N,k as X}from"./index-nMoWjTPe.js";import{s as J}from"./request-BXz87ydW.js";import{_ as Q}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Z=P=>J.post("/manifest/v1/generator/yaml/pod",P),ee=P=>J.post("/manifest/v1/generator/yaml/service",P),te=P=>J.post("/manifest/v1/generator/yaml/hpa",P),le=P=>J.post("/manifest/v1/generator/yaml/deployments",P),oe=P=>J.post("/manifest/v1/generator/yaml/configmap",P),se={class:"modal",id:"modal-pod",tabindex:"-1"},ne={class:"modal-dialog modal-lg",role:"document"},ae={class:"modal-content"},re={class:"modal-header"},ie={class:"modal-title"},de={class:"modal-body"},ue={class:"card"},ce={class:"card-body"},me=B({__name:"podModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{$.value&&await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",se,[e("div",ne,[e("div",ae,[e("div",re,[e("h5",ie,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",de,[e("div",ue,[e("div",ce,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),pe={class:"tab-pane active show",id:"tabs-pod"},ve={class:"card"},be={class:"card-body"},he={class:"mb-3"},ye={class:"mb-3"},fe={class:"mb-3"},ge=["onUpdate:modelValue"],_e=["onUpdate:modelValue"],we={class:"btn-list"},ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},$e=["onClick"],xe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ce={class:"card mt-4"},Ue={class:"card-body"},Me={class:"mb-3"},Ve={class:"btn-list"},Pe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},qe=["onClick"],Se={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},De={class:"row",style:{width:"68% !important"}},je={class:"col mt-4"},ze=["onUpdate:modelValue"],He={class:"col mt-4"},Le=["onUpdate:modelValue"],Be={class:"mb-3"},Re=["onUpdate:modelValue"],Ne=["onUpdate:modelValue"],Fe={class:"btn-list"},Ae=["onClick"],Ee={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Te=["onClick"],Ye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Oe={class:"mb-3"},Ge={class:"btn-list"},Ie=["onClick"],Ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Je=["onClick"],Qe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},We={class:"row",style:{width:"68% !important"}},Xe={class:"col mt-4"},Ze=["onUpdate:modelValue"],et={class:"col mt-4"},tt=["onUpdate:modelValue"],lt={class:"row",style:{width:"68% !important"}},ot={class:"col mt-4"},st=["onUpdate:modelValue"],nt={class:"col mt-4"},at=["onUpdate:modelValue"],rt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},it={class:"mb-3"},dt={class:"row",style:{width:"68% !important"}},ut={class:"col mt-4"},ct=["onUpdate:modelValue"],mt={class:"col mt-4"},pt=["onUpdate:modelValue"],vt={class:"row",style:{width:"68% !important"}},bt={class:"col mt-4"},ht=["onUpdate:modelValue"],yt={class:"col mt-4"},ft=["onUpdate:modelValue"],gt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},_t={class:"mb-3"},wt={class:"mt-4"},kt={class:"btn-list justify-content-end mt-4"},$t=B({__name:"podForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f(""),V=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const i of p.value)if(!i.name||i.name.trim()===""||!i.image||i.image.trim()==="")return!1;return!0});G(async()=>{await L()});const L=()=>{$.value="Pod",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value={containers:[],restartPolicy:""},p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter pod name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=i,w.value.metadata=l.value,r.value.containers=p.value,w.value.spec=r.value;const{data:t}=await Z(w.value);M.value=t},E=()=>{_.value.push({key:"",value:""})},T=i=>{_.value.length!==1&&_.value.splice(i,1)},H=()=>{p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},u=i=>{p.value.length!==1&&p.value.splice(i,1)},o=i=>{p.value[i].env.push({name:"",value:""})},U=(i,t)=>{p.value[i].env.length!==1&&p.value[i].env.splice(t,1)},x=i=>{p.value[i].ports.push({name:"",containerPort:"",hostPort:"",protocol:""})},k=(i,t)=>{p.value[i].ports.length!==1&&p.value[i].ports.splice(t,1)};return(i,t)=>(n(),a("div",pe,[e("div",ve,[t[9]||(t[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",be,[e("div",he,[t[4]||(t[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[0]||(t[0]=s=>l.value.name=s),placeholder:"pod-01"},null,512),[[m,l.value.name]])]),e("div",ye,[t[5]||(t[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[1]||(t[1]=s=>l.value.namespace=s),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",fe,[t[8]||(t[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(s,b)=>(n(),a("div",{class:"generate-form",key:b},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.key=y,placeholder:"key"},null,8,ge),[[m,s.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.value=y,placeholder:"value"},null,8,_e),[[m,s.value]]),e("div",we,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",ke,t[6]||(t[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>T(b)},[(n(),a("svg",xe,t[7]||(t[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,$e)])]))),128))])])]),e("div",Ce,[t[31]||(t[31]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Ue,[(n(!0),a(D,null,j(p.value,(s,b)=>(n(),a("div",{class:"mt-4",key:b},[e("div",Me,[e("div",Ve,[t[12]||(t[12]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Pe,t[10]||(t[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>u(b)},[(n(),a("svg",Se,t[11]||(t[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,qe)]),e("div",De,[e("div",je,[t[13]||(t[13]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.name=y},null,8,ze),[[m,s.name]])]),e("div",He,[t[14]||(t[14]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.image=y},null,8,Le),[[m,s.image]])])])]),e("div",Be,[t[17]||(t[17]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(s.env,(y,Y)=>(n(),a("div",{class:"generate-form",key:Y},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.name=g,placeholder:"key"},null,8,Re),[[m,y.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.value=g,placeholder:"value"},null,8,Ne),[[m,y.value]]),e("div",Fe,[e("button",{class:"btn btn-primary",onClick:g=>o(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ee,t[15]||(t[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ae),e("button",{class:"btn btn-primary",onClick:g=>U(b,Y)},[(n(),a("svg",Ye,t[16]||(t[16]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Te)])]))),128))]),e("div",Oe,[(n(!0),a(D,null,j(s.ports,(y,Y)=>(n(),a("div",{class:"mt-4",key:Y},[e("div",Ge,[t[20]||(t[20]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:g=>x(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ke,t[18]||(t[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ie),e("button",{class:"btn btn-primary",onClick:g=>k(b,Y)},[(n(),a("svg",Qe,t[19]||(t[19]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Je)]),e("div",We,[e("div",Xe,[t[21]||(t[21]=e("label",{class:"form-label"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.name=g},null,8,Ze),[[m,y.name]])]),e("div",et,[t[22]||(t[22]=e("label",{class:"form-label"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.containerPort=g},null,8,tt),[[m,y.containerPort]])])]),e("div",lt,[e("div",ot,[t[23]||(t[23]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.protocol=g},null,8,st),[[m,y.protocol]])]),e("div",nt,[t[24]||(t[24]=e("label",{class:"form-label"},"- Host Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.hostPort=g},null,8,at),[[m,y.hostPort]])])]),s.ports.length>1?(n(),a("div",rt)):W("",!0)]))),128))]),e("div",it,[t[29]||(t[29]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"Resources")],-1)),e("div",dt,[e("div",ut,[t[25]||(t[25]=e("label",{class:"form-label"},"- Limits CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.cpu=y},null,8,ct),[[m,s.resources.limits.cpu]])]),e("div",mt,[t[26]||(t[26]=e("label",{class:"form-label"},"- Limits Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.memory=y},null,8,pt),[[m,s.resources.limits.memory]])])]),e("div",vt,[e("div",bt,[t[27]||(t[27]=e("label",{class:"form-label"},"- Requests CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.cpu=y},null,8,ht),[[m,s.resources.requests.cpu]])]),e("div",yt,[t[28]||(t[28]=e("label",{class:"form-label"},"- Requests Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.memory=y},null,8,ft),[[m,s.resources.requests.memory]])])])]),p.value.length>1?(n(),a("div",gt)):W("",!0)]))),128)),e("div",_t,[e("div",wt,[t[30]||(t[30]=e("label",{class:"form-label"},"- Restart Policy",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":t[2]||(t[2]=s=>r.value.restartPolicy=s)},null,512),[[m,r.value.restartPolicy]])])])])]),e("div",kt,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:t[3]||(t[3]=s=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-pod"},"GENERATE",2)]),N(me,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),xt=Q($t,[["__scopeId","data-v-ebbc4037"]]),Ct={class:"modal",id:"modal-deploy",tabindex:"-1"},Ut={class:"modal-dialog modal-lg",role:"document"},Mt={class:"modal-content"},Vt={class:"modal-header"},Pt={class:"modal-title"},qt={class:"modal-body"},St={class:"card"},Dt={class:"card-body"},jt=B({__name:"deployModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ct,[e("div",Ut,[e("div",Mt,[e("div",Vt,[e("h5",Pt,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",qt,[e("div",St,[e("div",Dt,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),zt={class:"tab-pane",id:"tabs-deployment"},Ht={class:"card"},Lt={class:"card-body"},Bt={class:"mb-3"},Rt={class:"mb-3"},Nt={class:"mb-3"},Ft=["onUpdate:modelValue"],At=["onUpdate:modelValue"],Et={class:"btn-list"},Tt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Yt=["onClick"],Ot={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Gt={class:"card mt-4"},It={class:"card-body"},Kt={class:"mb-3"},Jt={class:"mb-3"},Qt=["onUpdate:modelValue"],Wt=["onUpdate:modelValue"],Xt={class:"btn-list"},Zt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},el=["onClick"],tl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ll={class:"mb-3"},ol=["onUpdate:modelValue"],sl=["onUpdate:modelValue"],nl={class:"btn-list"},al={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},rl=["onClick"],il={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},dl={class:"mb-3"},ul={class:"btn-list"},cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},ml=["onClick"],pl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vl={class:"row",style:{width:"68% !important"}},bl={class:"col mt-4"},hl=["onUpdate:modelValue"],yl={class:"col mt-4"},fl=["onUpdate:modelValue"],gl={class:"mb-3"},_l=["onUpdate:modelValue"],wl={class:"btn-list"},kl=["onClick"],$l={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},xl=["onClick"],Cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ul={class:"mb-3"},Ml=["onUpdate:modelValue"],Vl=["onUpdate:modelValue"],Pl={class:"btn-list"},ql=["onClick"],Sl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Dl=["onClick"],jl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},zl={class:"btn-list justify-content-end mt-4"},Hl=B({__name:"deploymentForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f([]),M=f({}),V=f([]),L=f(""),R=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const g of V.value)if(!g.name||g.name.trim()===""||!g.image||g.image.trim()==="")return!1;return!0});G(async()=>{await E()});const E=()=>{$.value="Deployment",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value={replicas:"",selector:{matchLabels:{}},template:{metadata:{labels:{}},spec:{containers:[]}}},V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},T=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter deployment name.");const v=document.querySelector('input[v-model="metadata.name"]');v==null||v.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const v=document.querySelector('input[v-model="metadata.namespace"]');v==null||v.focus();return}for(let v=0;v(v[q.key]=q.value,v),{}),d=r.value.reduce((v,q)=>(v[q.key]=q.value,v),{}),C=p.value.reduce((v,q)=>(v[q.key]=q.value,v),{});l.value.labels=g,w.value.metadata=l.value,M.value.selector.matchLabels=d,M.value.template.metadata.labels=C,M.value.template.spec.containers=V.value,w.value.spec=M.value,console.log("deployFormData.value : ",w.value);const{data:S}=await le(w.value);L.value=S},H=()=>{_.value.push({key:"",value:""})},u=g=>{_.value.length!==1&&_.value.splice(g,1)},o=()=>{r.value.push({key:"",value:""})},U=g=>{r.value.length!==1&&r.value.splice(g,1)},x=()=>{p.value.push({key:"",value:""})},k=g=>{p.value.length!==1&&p.value.splice(g,1)},i=()=>{V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},t=g=>{V.value.length!==1&&V.value.splice(g,1)},s=g=>{V.value[g].env.push({name:"",value:""})},b=(g,d)=>{V.value[g].env.length!==1&&V.value[g].env.splice(d,1)},y=g=>{V.value[g].ports.push({containerPort:""})},Y=(g,d)=>{V.value[g].ports.length!==1&&V.value[g].ports.splice(d,1)};return(g,d)=>(n(),a("div",zt,[e("div",Ht,[d[9]||(d[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Lt,[e("div",Bt,[d[4]||(d[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[0]||(d[0]=C=>l.value.name=C),placeholder:"deployment-01"},null,512),[[m,l.value.name]])]),e("div",Rt,[d[5]||(d[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[1]||(d[1]=C=>l.value.namespace=C),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Nt,[d[8]||(d[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Ft),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,At),[[m,C.value]]),e("div",Et,[e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Tt,d[6]||(d[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>u(S)},[(n(),a("svg",Ot,d[7]||(d[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Yt)])]))),128))])])]),e("div",Gt,[d[29]||(d[29]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",It,[e("div",Kt,[d[10]||(d[10]=e("label",{class:"form-label"},"- Replicas",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":d[2]||(d[2]=C=>M.value.replicas=C)},null,512),[[m,M.value.replicas]])]),e("div",Jt,[d[13]||(d[13]=e("label",{class:"form-label"},"- Match Labels",-1)),(n(!0),a(D,null,j(r.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Qt),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,Wt),[[m,C.value]]),e("div",Xt,[e("button",{class:"btn btn-primary",onClick:o,style:{"text-align":"center !important"}},[(n(),a("svg",Zt,d[11]||(d[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>U(S)},[(n(),a("svg",tl,d[12]||(d[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,el)])]))),128))]),d[28]||(d[28]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Template")],-1)),e("div",ll,[d[16]||(d[16]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"- Labels")],-1)),(n(!0),a(D,null,j(p.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,ol),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,sl),[[m,C.value]]),e("div",nl,[e("button",{class:"btn btn-primary",onClick:x,style:{"text-align":"center !important"}},[(n(),a("svg",al,d[14]||(d[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>k(S)},[(n(),a("svg",il,d[15]||(d[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,rl)])]))),128))]),(n(!0),a(D,null,j(V.value,(C,S)=>(n(),a("div",{key:S},[e("div",dl,[e("div",ul,[d[19]||(d[19]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:i,style:{"text-align":"center !important"}},[(n(),a("svg",cl,d[17]||(d[17]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>t(S)},[(n(),a("svg",pl,d[18]||(d[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ml)]),e("div",vl,[e("div",bl,[d[20]||(d[20]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.name=v},null,8,hl),[[m,C.name]])]),e("div",yl,[d[21]||(d[21]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.image=v},null,8,fl),[[m,C.image]])])])]),e("div",gl,[d[24]||(d[24]=e("label",{class:"form-label"},"- Port",-1)),(n(!0),a(D,null,j(C.ports,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.containerPort=z,placeholder:"value"},null,8,_l),[[m,v.containerPort]]),e("div",wl,[e("button",{class:"btn btn-primary",onClick:z=>y(S),style:{"text-align":"center !important"}},[(n(),a("svg",$l,d[22]||(d[22]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,kl),e("button",{class:"btn btn-primary",onClick:z=>Y(S,q)},[(n(),a("svg",Cl,d[23]||(d[23]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,xl)])]))),128))]),e("div",Ul,[d[27]||(d[27]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(C.env,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.name=z,placeholder:"key"},null,8,Ml),[[m,v.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.value=z,placeholder:"value"},null,8,Vl),[[m,v.value]]),e("div",Pl,[e("button",{class:"btn btn-primary",onClick:z=>s(S),style:{"text-align":"center !important"}},[(n(),a("svg",Sl,d[25]||(d[25]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ql),e("button",{class:"btn btn-primary",onClick:z=>b(S,q)},[(n(),a("svg",jl,d[26]||(d[26]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Dl)])]))),128))])]))),128))])]),e("div",zl,[e("a",{class:K(["btn btn-primary",{disabled:!R.value}]),onClick:d[3]||(d[3]=C=>R.value?T():null),"data-bs-toggle":"modal","data-bs-target":"#modal-deploy"},"GENERATE",2)]),N(jt,{"yaml-data":L.value,title:$.value},null,8,["yaml-data","title"])]))}}),Ll=Q(Hl,[["__scopeId","data-v-f08d5135"]]),Bl={class:"modal",id:"modal-service",tabindex:"-1"},Rl={class:"modal-dialog modal-lg",role:"document"},Nl={class:"modal-content"},Fl={class:"modal-header"},Al={class:"modal-title"},El={class:"modal-body"},Tl={class:"card"},Yl={class:"card-body"},Ol=B({__name:"servcieModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Bl,[e("div",Rl,[e("div",Nl,[e("div",Fl,[e("h5",Al,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",El,[e("div",Tl,[e("div",Yl,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Gl={class:"tab-pane",id:"tabs-service"},Il={class:"card"},Kl={class:"card-body"},Jl={class:"mb-3"},Ql={class:"mb-3"},Wl={class:"mb-3"},Xl=["onUpdate:modelValue"],Zl=["onUpdate:modelValue"],eo={class:"btn-list"},to={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},lo=["onClick"],oo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},so={class:"card mt-4"},no={class:"card-body"},ao={class:"mb-3"},ro=["onUpdate:modelValue"],io=["onUpdate:modelValue"],uo={class:"btn-list"},co={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},mo=["onClick"],po={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vo={class:"mb-3"},bo={class:"btn-list"},ho={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},yo=["onClick"],fo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},go={class:"row",style:{width:"68% !important"}},_o={class:"col mt-4"},wo=["onUpdate:modelValue"],ko={class:"col mt-4"},$o=["onUpdate:modelValue"],xo={class:"row",style:{width:"68% !important"}},Co={class:"col mt-4"},Uo=["onUpdate:modelValue"],Mo={class:"col mt-4"},Vo=["onUpdate:modelValue"],Po={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},qo={class:"row",style:{width:"68% !important"}},So={class:"col mt-4"},Do={class:"btn-list justify-content-end mt-4"},jo=B({__name:"serviceForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f([]);f("");const V=f(""),L=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const k of M.value)if(!k.port||k.port.trim()===""||!k.targetPort||k.targetPort.trim()==="")return!1;return!0});G(async()=>{await R()});const R=()=>{$.value="Service",l.value={name:"",namespace:"",labels:{}},r.value={selector:{},ports:[],type:""},_.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},E=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter service name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=k,w.value.metadata=l.value;const i=p.value.reduce((s,b)=>(s[b.key]=b.value,s),{});r.value.selector=i,r.value.ports=M.value,w.value.spec=r.value;const{data:t}=await ee(w.value);V.value=t},T=()=>{_.value.push({key:"",value:""})},H=k=>{_.value.length!==1&&_.value.splice(k,1)},u=()=>{p.value.push({key:"",value:""})},o=k=>{p.value.length!==1&&p.value.splice(k,1)},U=()=>{M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},x=k=>{M.value.length!==1&&M.value.splice(k,1)};return(k,i)=>(n(),a("div",Gl,[e("div",Il,[i[9]||(i[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Kl,[e("div",Jl,[i[4]||(i[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[0]||(i[0]=t=>l.value.name=t),placeholder:"name-01"},null,512),[[m,l.value.name]])]),e("div",Ql,[i[5]||(i[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[1]||(i[1]=t=>l.value.namespace=t),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Wl,[i[8]||(i[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,Xl),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,Zl),[[m,t.value]]),e("div",eo,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",to,i[6]||(i[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>H(s)},[(n(),a("svg",oo,i[7]||(i[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,lo)])]))),128))])])]),e("div",so,[i[21]||(i[21]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",no,[e("div",ao,[i[12]||(i[12]=e("label",{class:"form-label"},"- Selector",-1)),(n(!0),a(D,null,j(p.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,ro),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,io),[[m,t.value]]),e("div",uo,[e("button",{class:"btn btn-primary",onClick:u,style:{"text-align":"center !important"}},[(n(),a("svg",co,i[10]||(i[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>o(s)},[(n(),a("svg",po,i[11]||(i[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,mo)])]))),128))]),e("div",vo,[(n(!0),a(D,null,j(M.value,(t,s)=>(n(),a("div",{class:"mt-4",key:s},[e("div",bo,[i[15]||(i[15]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:U,style:{"text-align":"center !important"}},[(n(),a("svg",ho,i[13]||(i[13]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>x(s)},[(n(),a("svg",fo,i[14]||(i[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,yo)]),e("div",go,[e("div",_o,[i[16]||(i[16]=e("label",{class:"form-label required"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.port=b},null,8,wo),[[m,t.port]])]),e("div",ko,[i[17]||(i[17]=e("label",{class:"form-label required"},"- Target Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.targetPort=b},null,8,$o),[[m,t.targetPort]])])]),e("div",xo,[e("div",Co,[i[18]||(i[18]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.protocol=b},null,8,Uo),[[m,t.protocol]])]),e("div",Mo,[i[19]||(i[19]=e("label",{class:"form-label"},"- Node Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.nodePort=b},null,8,Vo),[[m,t.nodePort]])])]),M.value.length>1?(n(),a("div",Po)):W("",!0)]))),128)),e("div",qo,[e("div",So,[i[20]||(i[20]=e("label",{class:"form-label"},"- Type",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":i[2]||(i[2]=t=>r.value.type=t)},null,512),[[m,r.value.type]])])])])])]),e("div",Do,[e("a",{class:K(["btn btn-primary",{disabled:!L.value}]),onClick:i[3]||(i[3]=t=>L.value?E():null),"data-bs-toggle":"modal","data-bs-target":"#modal-service"},"GENERATE",2)]),N(Ol,{"yaml-data":V.value,title:$.value},null,8,["yaml-data","title"])]))}}),zo=Q(jo,[["__scopeId","data-v-b9ba3952"]]),Ho={class:"modal",id:"modal-yaml",tabindex:"-1"},Lo={class:"modal-dialog modal-lg",role:"document"},Bo={class:"modal-content"},Ro={class:"modal-header"},No={class:"modal-title"},Fo={class:"modal-body"},Ao={class:"card"},Eo={class:"card-body"},To=B({__name:"yamlModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ho,[e("div",Lo,[e("div",Bo,[e("div",Ro,[e("h5",No,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",Fo,[e("div",Ao,[e("div",Eo,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Yo={class:"tab-pane",id:"tabs-hpa"},Oo={class:"card"},Go={class:"card-body"},Io={class:"mb-3"},Ko={class:"mb-3"},Jo={class:"mb-3"},Qo=["onUpdate:modelValue"],Wo=["onUpdate:modelValue"],Xo={class:"btn-list"},Zo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},es=["onClick"],ts={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ls={class:"card mt-4"},os={class:"card-body"},ss={class:"row",style:{width:"68% !important"}},ns={class:"col"},as={class:"col"},rs={class:"row",style:{width:"68% !important"}},is={class:"col"},ds={class:"row",style:{width:"68% !important"}},us={class:"col"},cs={class:"row",style:{width:"68% !important"}},ms={class:"col"},ps={class:"row",style:{width:"68% !important"}},vs={class:"col"},bs={class:"btn-list justify-content-end mt-4"},hs=B({__name:"hpaForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f({}),M=f(""),V=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""||!p.value.apiVersion||p.value.apiVersion.trim()===""||!p.value.kind||p.value.kind.trim()===""||!p.value.name||p.value.name.trim()===""||!r.value.minReplicas||r.value.minReplicas.trim()===""||!r.value.maxReplicas||r.value.maxReplicas.trim()===""||!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""));G(async()=>{await L()});const L=()=>{$.value="HPA",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value={scaleTargetRef:{},minReplicas:"",maxReplicas:"",targetCPUUtilizationPercentage:""},p.value={apiVersion:"",kind:"",name:""}},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter HPA name.");const o=document.querySelector('input[v-model="metadata.name"]');o==null||o.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const o=document.querySelector('input[v-model="metadata.namespace"]');o==null||o.focus();return}if(!p.value.apiVersion||p.value.apiVersion.trim()===""){h.error("Please enter API version.");const o=document.querySelector('input[v-model="scaleTargetRef.apiVersion"]');o==null||o.focus();return}if(!p.value.kind||p.value.kind.trim()===""){h.error("Please enter kind.");const o=document.querySelector('input[v-model="scaleTargetRef.kind"]');o==null||o.focus();return}if(!p.value.name||p.value.name.trim()===""){h.error("Please enter target name.");const o=document.querySelector('input[v-model="scaleTargetRef.name"]');o==null||o.focus();return}if(!r.value.minReplicas||r.value.minReplicas.trim()===""){h.error("Please enter min replicas.");const o=document.querySelector('input[v-model="spec.minReplicas"]');o==null||o.focus();return}if(!r.value.maxReplicas||r.value.maxReplicas.trim()===""){h.error("Please enter max replicas.");const o=document.querySelector('input[v-model="spec.maxReplicas"]');o==null||o.focus();return}if(!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""){h.error("Please enter CPU percentage.");const o=document.querySelector('input[v-model="spec.targetCPUUtilizationPercentage"]');o==null||o.focus();return}const H=_.value.reduce((o,U)=>(o[U.key]=U.value,o),{});l.value.labels=H,r.value.scaleTargetRef=p.value,w.value.metadata=l.value,w.value.spec=r.value;const{data:u}=await te(w.value);M.value=u},E=()=>{_.value.push({key:"",value:""})},T=H=>{_.value.length!==1&&_.value.splice(H,1)};return(H,u)=>(n(),a("div",Yo,[e("div",Oo,[u[14]||(u[14]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Go,[e("div",Io,[u[9]||(u[9]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[0]||(u[0]=o=>l.value.name=o),placeholder:"name"},null,512),[[m,l.value.name]])]),e("div",Ko,[u[10]||(u[10]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[1]||(u[1]=o=>l.value.namespace=o),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Jo,[u[13]||(u[13]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(o,U)=>(n(),a("div",{class:"generate-form",key:U},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.key=x,placeholder:"key"},null,8,Qo),[[m,o.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.value=x,placeholder:"value"},null,8,Wo),[[m,o.value]]),e("div",Xo,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",Zo,u[11]||(u[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:x=>T(U)},[(n(),a("svg",ts,u[12]||(u[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,es)])]))),128))])])]),e("div",ls,[u[22]||(u[22]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",os,[u[21]||(u[21]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Scale Target")],-1)),e("div",ss,[e("div",ns,[u[15]||(u[15]=e("label",{class:"form-label required"},"- Api Version",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[2]||(u[2]=o=>p.value.apiVersion=o)},null,512),[[m,p.value.apiVersion]])]),e("div",as,[u[16]||(u[16]=e("label",{class:"form-label required"},"- Kind",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[3]||(u[3]=o=>p.value.kind=o)},null,512),[[m,p.value.kind]])])]),e("div",rs,[e("div",is,[u[17]||(u[17]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[4]||(u[4]=o=>p.value.name=o)},null,512),[[m,p.value.name]])])]),e("div",ds,[e("div",us,[u[18]||(u[18]=e("label",{class:"form-label required"},"- Min Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[5]||(u[5]=o=>r.value.minReplicas=o)},null,512),[[m,r.value.minReplicas]])])]),e("div",cs,[e("div",ms,[u[19]||(u[19]=e("label",{class:"form-label required"},"- Max Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[6]||(u[6]=o=>r.value.maxReplicas=o)},null,512),[[m,r.value.maxReplicas]])])]),e("div",ps,[e("div",vs,[u[20]||(u[20]=e("label",{class:"form-label required"},"- CPU Percentage",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[7]||(u[7]=o=>r.value.targetCPUUtilizationPercentage=o)},null,512),[[m,r.value.targetCPUUtilizationPercentage]])])])])]),e("div",bs,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:u[8]||(u[8]=o=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-yaml"},"GENERATE",2)]),N(To,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),ys=Q(hs,[["__scopeId","data-v-b0620f31"]]),fs={class:"modal",id:"modal-config-map",tabindex:"-1"},gs={class:"modal-dialog modal-lg",role:"document"},_s={class:"modal-content"},ws={class:"modal-header"},ks={class:"modal-title"},$s={class:"modal-body"},xs={class:"card"},Cs={class:"card-body"},Us=B({__name:"configMapModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",fs,[e("div",gs,[e("div",_s,[e("div",ws,[e("h5",ks,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",$s,[e("div",xs,[e("div",Cs,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Ms={class:"tab-pane",id:"tabs-configMap"},Vs={class:"card"},Ps={class:"card-body"},qs={class:"mb-3"},Ss={class:"mb-3"},Ds={class:"mb-3"},js=["onUpdate:modelValue"],zs=["onUpdate:modelValue"],Hs={class:"btn-list"},Ls={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Bs=["onClick"],Rs={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ns={class:"card mt-4"},Fs={class:"card-body"},As={class:"mb-3"},Es=["onUpdate:modelValue"],Ts=["onUpdate:modelValue"],Ys={class:"btn-list"},Os={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Gs=["onClick"],Is={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ks={class:"btn-list justify-content-end mt-4"},Js=B({__name:"configmapForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f(""),M=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""));G(async()=>{await V()});const V=()=>{$.value="ConfigMap",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value.push({key:"",value:""})},L=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter ConfigMap name.");const x=document.querySelector('input[v-model="metadata.name"]');x==null||x.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const x=document.querySelector('input[v-model="metadata.namespace"]');x==null||x.focus();return}const u=_.value.reduce((x,k)=>(x[k.key]=k.value,x),{});l.value.labels=u;const o=r.value.reduce((x,k)=>(x[k.key]=k.value,x),{});w.value.metadata=l.value,w.value.data=o;const{data:U}=await oe(w.value);p.value=U},R=()=>{_.value.push({key:"",value:""})},E=u=>{_.value.length!==1&&_.value.splice(u,1)},T=()=>{r.value.push({key:"",value:""})},H=u=>{r.value.length!==1&&r.value.splice(u,1)};return(u,o)=>(n(),a("div",Ms,[e("div",Vs,[o[8]||(o[8]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Ps,[e("div",qs,[o[3]||(o[3]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[0]||(o[0]=U=>l.value.name=U),placeholder:"configMap-01"},null,512),[[m,l.value.name]])]),e("div",Ss,[o[4]||(o[4]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[1]||(o[1]=U=>l.value.namespace=U),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Ds,[o[7]||(o[7]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,js),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,zs),[[m,U.value]]),e("div",Hs,[e("button",{class:"btn btn-primary",onClick:R,style:{"text-align":"center !important"}},[(n(),a("svg",Ls,o[5]||(o[5]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>E(x)},[(n(),a("svg",Rs,o[6]||(o[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Bs)])]))),128))])])]),e("div",Ns,[o[12]||(o[12]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Fs,[e("div",As,[o[11]||(o[11]=e("label",{class:"form-label"},"- Data",-1)),(n(!0),a(D,null,j(r.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,Es),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,Ts),[[m,U.value]]),e("div",Ys,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",Os,o[9]||(o[9]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>H(x)},[(n(),a("svg",Is,o[10]||(o[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Gs)])]))),128))])])]),e("div",Ks,[e("a",{class:K(["btn btn-primary",{disabled:!M.value}]),onClick:o[2]||(o[2]=U=>M.value?L():null),"data-bs-toggle":"modal","data-bs-target":"#modal-config-map"},"GENERATE",2)]),N(Us,{"yaml-data":p.value,title:$.value},null,8,["yaml-data","title"])]))}}),Qs=Q(Js,[["__scopeId","data-v-e0b005d8"]]),Ws={class:"card w-100",ref:"workflowForm"},Xs={class:"card-body"},Zs={class:"card"},en={class:"card-body"},tn={class:"tab-content"},nn=B({__name:"YamlGenerate",setup(P){return O(),G(async()=>{}),(h,$)=>(n(),a("div",Ws,[$[1]||($[1]=e("div",{class:"card-header"},[e("div",{class:"card-title"},[e("h1",null,"YAML Generator")])],-1)),e("div",Xs,[e("div",Zs,[$[0]||($[0]=X('',1)),e("div",en,[e("div",tn,[N(xt),N(Ll),N(zo),N(ys),N(Qs)])])])])],512))}});export{nn as default}; diff --git a/src/main/resources/static/assets/bootstrap.esm-Cjkb2LR3.js b/src/main/resources/static/assets/bootstrap.esm-LCYmWnCj.js similarity index 99% rename from src/main/resources/static/assets/bootstrap.esm-Cjkb2LR3.js rename to src/main/resources/static/assets/bootstrap.esm-LCYmWnCj.js index 3b98cd2c..16364b4f 100644 --- a/src/main/resources/static/assets/bootstrap.esm-Cjkb2LR3.js +++ b/src/main/resources/static/assets/bootstrap.esm-LCYmWnCj.js @@ -1,4 +1,4 @@ -import{d as Ei,h as Ce,a as Ne,b as Vt,t as Se,m as On,i as Cn,p as Nn,l as Sn}from"./index-DgPLCZcu.js";import{I as Dn}from"./IconPlus-o3un4-BS.js";const vi={class:"page-header page-wrapper"},bi={class:"row align-items-center"},Ai={class:"card-header d-flex",style:{"justify-content":"space-between"}},Ti={class:"card-title"},yi={class:"btn-list"},wi=["data-bs-target"],Sl=Ei({__name:"TableHeader",props:{headerTitle:{},newBtnTitle:{},popupFlag:{type:Boolean},popupTarget:{}},emits:["click-new-btn"],setup(n,{emit:t}){const e=n,s=t,i=()=>{s("click-new-btn")};return(r,o)=>(Ce(),Ne("div",vi,[Vt("div",bi,[Vt("div",Ai,[Vt("h3",Ti,[Vt("strong",null,Se(e.headerTitle),1)]),Vt("div",yi,[e.popupFlag?(Ce(),Ne("a",{key:1,class:"btn btn-outline-primary d-none d-sm-inline-block","data-bs-toggle":"modal","data-bs-target":e.popupTarget,onClick:On(i,["prevent","stop"])},[Cn(Nn(Dn),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),Sn(" "+Se(e.newBtnTitle),1)],8,wi)):(Ce(),Ne("a",{key:0,class:"btn btn-outline-primary d-none d-sm-inline-block",onClick:On(i,["prevent","stop"])},[Cn(Nn(Dn),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),Sn(" "+Se(e.newBtnTitle),1)]))])])])]))}});var L="top",x="bottom",R="right",I="left",pe="auto",It=[L,x,R,I],pt="start",Ot="end",hs="clippingParents",Qe="viewport",At="popper",fs="reference",Ke=It.reduce(function(n,t){return n.concat([t+"-"+pt,t+"-"+Ot])},[]),Ze=[].concat(It,[pe]).reduce(function(n,t){return n.concat([t,t+"-"+pt,t+"-"+Ot])},[]),ps="beforeRead",_s="read",ms="afterRead",gs="beforeMain",Es="main",vs="afterMain",bs="beforeWrite",As="write",Ts="afterWrite",ys=[ps,_s,ms,gs,Es,vs,bs,As,Ts];function z(n){return n?(n.nodeName||"").toLowerCase():null}function k(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function _t(n){var t=k(n).Element;return n instanceof t||n instanceof Element}function V(n){var t=k(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function Je(n){if(typeof ShadowRoot>"u")return!1;var t=k(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function Oi(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var s=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];!V(r)||!z(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(o){var a=i[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function Ci(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(s){var i=t.elements[s],r=t.attributes[s]||{},o=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:e[s]),a=o.reduce(function(l,d){return l[d]="",l},{});!V(i)||!z(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(l){i.removeAttribute(l)}))})}}const tn={name:"applyStyles",enabled:!0,phase:"write",fn:Oi,effect:Ci,requires:["computeStyles"]};function Y(n){return n.split("-")[0]}var ft=Math.max,ue=Math.min,Ct=Math.round;function Ye(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function ws(){return!/^((?!chrome|android).)*safari/i.test(Ye())}function Nt(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var s=n.getBoundingClientRect(),i=1,r=1;t&&V(n)&&(i=n.offsetWidth>0&&Ct(s.width)/n.offsetWidth||1,r=n.offsetHeight>0&&Ct(s.height)/n.offsetHeight||1);var o=_t(n)?k(n):window,a=o.visualViewport,l=!ws()&&e,d=(s.left+(l&&a?a.offsetLeft:0))/i,u=(s.top+(l&&a?a.offsetTop:0))/r,p=s.width/i,_=s.height/r;return{width:p,height:_,top:u,right:d+p,bottom:u+_,left:d,x:d,y:u}}function en(n){var t=Nt(n),e=n.offsetWidth,s=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:s}}function Os(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&Je(e)){var s=t;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function X(n){return k(n).getComputedStyle(n)}function Ni(n){return["table","td","th"].indexOf(z(n))>=0}function st(n){return((_t(n)?n.ownerDocument:n.document)||window.document).documentElement}function _e(n){return z(n)==="html"?n:n.assignedSlot||n.parentNode||(Je(n)?n.host:null)||st(n)}function $n(n){return!V(n)||X(n).position==="fixed"?null:n.offsetParent}function Si(n){var t=/firefox/i.test(Ye()),e=/Trident/i.test(Ye());if(e&&V(n)){var s=X(n);if(s.position==="fixed")return null}var i=_e(n);for(Je(i)&&(i=i.host);V(i)&&["html","body"].indexOf(z(i))<0;){var r=X(i);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return i;i=i.parentNode}return null}function Kt(n){for(var t=k(n),e=$n(n);e&&Ni(e)&&X(e).position==="static";)e=$n(e);return e&&(z(e)==="html"||z(e)==="body"&&X(e).position==="static")?t:e||Si(n)||t}function nn(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Bt(n,t,e){return ft(n,ue(t,e))}function Di(n,t,e){var s=Bt(n,t,e);return s>e?e:s}function Cs(){return{top:0,right:0,bottom:0,left:0}}function Ns(n){return Object.assign({},Cs(),n)}function Ss(n,t){return t.reduce(function(e,s){return e[s]=n,e},{})}var $i=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Ns(typeof t!="number"?t:Ss(t,It))};function Li(n){var t,e=n.state,s=n.name,i=n.options,r=e.elements.arrow,o=e.modifiersData.popperOffsets,a=Y(e.placement),l=nn(a),d=[I,R].indexOf(a)>=0,u=d?"height":"width";if(!(!r||!o)){var p=$i(i.padding,e),_=en(r),f=l==="y"?L:I,A=l==="y"?x:R,m=e.rects.reference[u]+e.rects.reference[l]-o[l]-e.rects.popper[u],E=o[l]-e.rects.reference[l],T=Kt(r),w=T?l==="y"?T.clientHeight||0:T.clientWidth||0:0,O=m/2-E/2,g=p[f],v=w-_[u]-p[A],b=w/2-_[u]/2+O,y=Bt(g,b,v),S=l;e.modifiersData[s]=(t={},t[S]=y,t.centerOffset=y-b,t)}}function Ii(n){var t=n.state,e=n.options,s=e.element,i=s===void 0?"[data-popper-arrow]":s;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Os(t.elements.popper,i)&&(t.elements.arrow=i))}const Ds={name:"arrow",enabled:!0,phase:"main",fn:Li,effect:Ii,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function St(n){return n.split("-")[1]}var Pi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Mi(n,t){var e=n.x,s=n.y,i=t.devicePixelRatio||1;return{x:Ct(e*i)/i||0,y:Ct(s*i)/i||0}}function Ln(n){var t,e=n.popper,s=n.popperRect,i=n.placement,r=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,p=n.isFixed,_=o.x,f=_===void 0?0:_,A=o.y,m=A===void 0?0:A,E=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=E.x,m=E.y;var T=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),O=I,g=L,v=window;if(d){var b=Kt(e),y="clientHeight",S="clientWidth";if(b===k(e)&&(b=st(e),X(b).position!=="static"&&a==="absolute"&&(y="scrollHeight",S="scrollWidth")),b=b,i===L||(i===I||i===R)&&r===Ot){g=x;var N=p&&b===v&&v.visualViewport?v.visualViewport.height:b[y];m-=N-s.height,m*=l?1:-1}if(i===I||(i===L||i===x)&&r===Ot){O=R;var C=p&&b===v&&v.visualViewport?v.visualViewport.width:b[S];f-=C-s.width,f*=l?1:-1}}var D=Object.assign({position:a},d&&Pi),j=u===!0?Mi({x:f,y:m},k(e)):{x:f,y:m};if(f=j.x,m=j.y,l){var $;return Object.assign({},D,($={},$[g]=w?"0":"",$[O]=T?"0":"",$.transform=(v.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",$))}return Object.assign({},D,(t={},t[g]=w?m+"px":"",t[O]=T?f+"px":"",t.transform="",t))}function xi(n){var t=n.state,e=n.options,s=e.gpuAcceleration,i=s===void 0?!0:s,r=e.adaptive,o=r===void 0?!0:r,a=e.roundOffsets,l=a===void 0?!0:a,d={placement:Y(t.placement),variation:St(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ln(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ln(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const sn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:xi,data:{}};var te={passive:!0};function Ri(n){var t=n.state,e=n.instance,s=n.options,i=s.scroll,r=i===void 0?!0:i,o=s.resize,a=o===void 0?!0:o,l=k(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&d.forEach(function(u){u.addEventListener("scroll",e.update,te)}),a&&l.addEventListener("resize",e.update,te),function(){r&&d.forEach(function(u){u.removeEventListener("scroll",e.update,te)}),a&&l.removeEventListener("resize",e.update,te)}}const rn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ri,data:{}};var ki={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(n){return n.replace(/left|right|bottom|top/g,function(t){return ki[t]})}var Vi={start:"end",end:"start"};function In(n){return n.replace(/start|end/g,function(t){return Vi[t]})}function on(n){var t=k(n),e=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:e,scrollTop:s}}function an(n){return Nt(st(n)).left+on(n).scrollLeft}function Hi(n,t){var e=k(n),s=st(n),i=e.visualViewport,r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;var d=ws();(d||!d&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:r,height:o,x:a+an(n),y:l}}function Wi(n){var t,e=st(n),s=on(n),i=(t=n.ownerDocument)==null?void 0:t.body,r=ft(e.scrollWidth,e.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=ft(e.scrollHeight,e.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-s.scrollLeft+an(n),l=-s.scrollTop;return X(i||e).direction==="rtl"&&(a+=ft(e.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function cn(n){var t=X(n),e=t.overflow,s=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+i+s)}function $s(n){return["html","body","#document"].indexOf(z(n))>=0?n.ownerDocument.body:V(n)&&cn(n)?n:$s(_e(n))}function jt(n,t){var e;t===void 0&&(t=[]);var s=$s(n),i=s===((e=n.ownerDocument)==null?void 0:e.body),r=k(s),o=i?[r].concat(r.visualViewport||[],cn(s)?s:[]):s,a=t.concat(o);return i?a:a.concat(jt(_e(o)))}function Ue(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function Bi(n,t){var e=Nt(n,!1,t==="fixed");return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function Pn(n,t,e){return t===Qe?Ue(Hi(n,e)):_t(t)?Bi(t,e):Ue(Wi(st(n)))}function ji(n){var t=jt(_e(n)),e=["absolute","fixed"].indexOf(X(n).position)>=0,s=e&&V(n)?Kt(n):n;return _t(s)?t.filter(function(i){return _t(i)&&Os(i,s)&&z(i)!=="body"}):[]}function Fi(n,t,e,s){var i=t==="clippingParents"?ji(n):[].concat(t),r=[].concat(i,[e]),o=r[0],a=r.reduce(function(l,d){var u=Pn(n,d,s);return l.top=ft(u.top,l.top),l.right=ue(u.right,l.right),l.bottom=ue(u.bottom,l.bottom),l.left=ft(u.left,l.left),l},Pn(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ls(n){var t=n.reference,e=n.element,s=n.placement,i=s?Y(s):null,r=s?St(s):null,o=t.x+t.width/2-e.width/2,a=t.y+t.height/2-e.height/2,l;switch(i){case L:l={x:o,y:t.y-e.height};break;case x:l={x:o,y:t.y+t.height};break;case R:l={x:t.x+t.width,y:a};break;case I:l={x:t.x-e.width,y:a};break;default:l={x:t.x,y:t.y}}var d=i?nn(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(r){case pt:l[d]=l[d]-(t[u]/2-e[u]/2);break;case Ot:l[d]=l[d]+(t[u]/2-e[u]/2);break}}return l}function Dt(n,t){t===void 0&&(t={});var e=t,s=e.placement,i=s===void 0?n.placement:s,r=e.strategy,o=r===void 0?n.strategy:r,a=e.boundary,l=a===void 0?hs:a,d=e.rootBoundary,u=d===void 0?Qe:d,p=e.elementContext,_=p===void 0?At:p,f=e.altBoundary,A=f===void 0?!1:f,m=e.padding,E=m===void 0?0:m,T=Ns(typeof E!="number"?E:Ss(E,It)),w=_===At?fs:At,O=n.rects.popper,g=n.elements[A?w:_],v=Fi(_t(g)?g:g.contextElement||st(n.elements.popper),l,u,o),b=Nt(n.elements.reference),y=Ls({reference:b,element:O,strategy:"absolute",placement:i}),S=Ue(Object.assign({},O,y)),N=_===At?S:b,C={top:v.top-N.top+T.top,bottom:N.bottom-v.bottom+T.bottom,left:v.left-N.left+T.left,right:N.right-v.right+T.right},D=n.modifiersData.offset;if(_===At&&D){var j=D[i];Object.keys(C).forEach(function($){var ot=[R,x].indexOf($)>=0?1:-1,at=[L,x].indexOf($)>=0?"y":"x";C[$]+=j[at]*ot})}return C}function Ki(n,t){t===void 0&&(t={});var e=t,s=e.placement,i=e.boundary,r=e.rootBoundary,o=e.padding,a=e.flipVariations,l=e.allowedAutoPlacements,d=l===void 0?Ze:l,u=St(s),p=u?a?Ke:Ke.filter(function(A){return St(A)===u}):It,_=p.filter(function(A){return d.indexOf(A)>=0});_.length===0&&(_=p);var f=_.reduce(function(A,m){return A[m]=Dt(n,{placement:m,boundary:i,rootBoundary:r,padding:o})[Y(m)],A},{});return Object.keys(f).sort(function(A,m){return f[A]-f[m]})}function Yi(n){if(Y(n)===pe)return[];var t=ae(n);return[In(n),t,In(t)]}function Ui(n){var t=n.state,e=n.options,s=n.name;if(!t.modifiersData[s]._skip){for(var i=e.mainAxis,r=i===void 0?!0:i,o=e.altAxis,a=o===void 0?!0:o,l=e.fallbackPlacements,d=e.padding,u=e.boundary,p=e.rootBoundary,_=e.altBoundary,f=e.flipVariations,A=f===void 0?!0:f,m=e.allowedAutoPlacements,E=t.options.placement,T=Y(E),w=T===E,O=l||(w||!A?[ae(E)]:Yi(E)),g=[E].concat(O).reduce(function(Et,Z){return Et.concat(Y(Z)===pe?Ki(t,{placement:Z,boundary:u,rootBoundary:p,padding:d,flipVariations:A,allowedAutoPlacements:m}):Z)},[]),v=t.rects.reference,b=t.rects.popper,y=new Map,S=!0,N=g[0],C=0;C=0,at=ot?"width":"height",M=Dt(t,{placement:D,boundary:u,rootBoundary:p,altBoundary:_,padding:d}),F=ot?$?R:I:$?x:L;v[at]>b[at]&&(F=ae(F));var qt=ae(F),ct=[];if(r&&ct.push(M[j]<=0),a&&ct.push(M[F]<=0,M[qt]<=0),ct.every(function(Et){return Et})){N=D,S=!1;break}y.set(D,ct)}if(S)for(var Xt=A?3:1,Te=function(Z){var kt=g.find(function(Zt){var lt=y.get(Zt);if(lt)return lt.slice(0,Z).every(function(ye){return ye})});if(kt)return N=kt,"break"},Rt=Xt;Rt>0;Rt--){var Qt=Te(Rt);if(Qt==="break")break}t.placement!==N&&(t.modifiersData[s]._skip=!0,t.placement=N,t.reset=!0)}}const Is={name:"flip",enabled:!0,phase:"main",fn:Ui,requiresIfExists:["offset"],data:{_skip:!1}};function Mn(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function xn(n){return[L,R,x,I].some(function(t){return n[t]>=0})}function zi(n){var t=n.state,e=n.name,s=t.rects.reference,i=t.rects.popper,r=t.modifiersData.preventOverflow,o=Dt(t,{elementContext:"reference"}),a=Dt(t,{altBoundary:!0}),l=Mn(o,s),d=Mn(a,i,r),u=xn(l),p=xn(d);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}const Ps={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zi};function Gi(n,t,e){var s=Y(n),i=[I,L].indexOf(s)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,o=r[0],a=r[1];return o=o||0,a=(a||0)*i,[I,R].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function qi(n){var t=n.state,e=n.options,s=n.name,i=e.offset,r=i===void 0?[0,0]:i,o=Ze.reduce(function(u,p){return u[p]=Gi(p,t.rects,r),u},{}),a=o[t.placement],l=a.x,d=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=d),t.modifiersData[s]=o}const Ms={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qi};function Xi(n){var t=n.state,e=n.name;t.modifiersData[e]=Ls({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const ln={name:"popperOffsets",enabled:!0,phase:"read",fn:Xi,data:{}};function Qi(n){return n==="x"?"y":"x"}function Zi(n){var t=n.state,e=n.options,s=n.name,i=e.mainAxis,r=i===void 0?!0:i,o=e.altAxis,a=o===void 0?!1:o,l=e.boundary,d=e.rootBoundary,u=e.altBoundary,p=e.padding,_=e.tether,f=_===void 0?!0:_,A=e.tetherOffset,m=A===void 0?0:A,E=Dt(t,{boundary:l,rootBoundary:d,padding:p,altBoundary:u}),T=Y(t.placement),w=St(t.placement),O=!w,g=nn(T),v=Qi(g),b=t.modifiersData.popperOffsets,y=t.rects.reference,S=t.rects.popper,N=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,C=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(b){if(r){var $,ot=g==="y"?L:I,at=g==="y"?x:R,M=g==="y"?"height":"width",F=b[g],qt=F+E[ot],ct=F-E[at],Xt=f?-S[M]/2:0,Te=w===pt?y[M]:S[M],Rt=w===pt?-S[M]:-y[M],Qt=t.elements.arrow,Et=f&&Qt?en(Qt):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Cs(),kt=Z[ot],Zt=Z[at],lt=Bt(0,y[M],Et[M]),ye=O?y[M]/2-Xt-lt-kt-C.mainAxis:Te-lt-kt-C.mainAxis,hi=O?-y[M]/2+Xt+lt+Zt+C.mainAxis:Rt+lt+Zt+C.mainAxis,we=t.elements.arrow&&Kt(t.elements.arrow),fi=we?g==="y"?we.clientTop||0:we.clientLeft||0:0,mn=($=D==null?void 0:D[g])!=null?$:0,pi=F+ye-mn-fi,_i=F+hi-mn,gn=Bt(f?ue(qt,pi):qt,F,f?ft(ct,_i):ct);b[g]=gn,j[g]=gn-F}if(a){var En,mi=g==="x"?L:I,gi=g==="x"?x:R,ut=b[v],Jt=v==="y"?"height":"width",vn=ut+E[mi],bn=ut-E[gi],Oe=[L,I].indexOf(T)!==-1,An=(En=D==null?void 0:D[v])!=null?En:0,Tn=Oe?vn:ut-y[Jt]-S[Jt]-An+C.altAxis,yn=Oe?ut+y[Jt]+S[Jt]-An-C.altAxis:bn,wn=f&&Oe?Di(Tn,ut,yn):Bt(f?Tn:vn,ut,f?yn:bn);b[v]=wn,j[v]=wn-ut}t.modifiersData[s]=j}}const xs={name:"preventOverflow",enabled:!0,phase:"main",fn:Zi,requiresIfExists:["offset"]};function Ji(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function tr(n){return n===k(n)||!V(n)?on(n):Ji(n)}function er(n){var t=n.getBoundingClientRect(),e=Ct(t.width)/n.offsetWidth||1,s=Ct(t.height)/n.offsetHeight||1;return e!==1||s!==1}function nr(n,t,e){e===void 0&&(e=!1);var s=V(t),i=V(t)&&er(t),r=st(t),o=Nt(n,i,e),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!e)&&((z(t)!=="body"||cn(r))&&(a=tr(t)),V(t)?(l=Nt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=an(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function sr(n){var t=new Map,e=new Set,s=[];n.forEach(function(r){t.set(r.name,r)});function i(r){e.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!e.has(a)){var l=t.get(a);l&&i(l)}}),s.push(r)}return n.forEach(function(r){e.has(r.name)||i(r)}),s}function ir(n){var t=sr(n);return ys.reduce(function(e,s){return e.concat(t.filter(function(i){return i.phase===s}))},[])}function rr(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function or(n){var t=n.reduce(function(e,s){var i=e[s.name];return e[s.name]=i?Object.assign({},i,s,{options:Object.assign({},i.options,s.options),data:Object.assign({},i.data,s.data)}):s,e},{});return Object.keys(t).map(function(e){return t[e]})}var Rn={placement:"bottom",modifiers:[],strategy:"absolute"};function kn(){for(var n=arguments.length,t=new Array(n),e=0;e{s("click-new-btn")};return(r,o)=>(Ce(),Ne("div",vi,[Vt("div",bi,[Vt("div",Ai,[Vt("h3",Ti,[Vt("strong",null,Se(e.headerTitle),1)]),Vt("div",yi,[e.popupFlag?(Ce(),Ne("a",{key:1,class:"btn btn-outline-primary d-none d-sm-inline-block","data-bs-toggle":"modal","data-bs-target":e.popupTarget,onClick:On(i,["prevent","stop"])},[Cn(Nn(Dn),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),Sn(" "+Se(e.newBtnTitle),1)],8,wi)):(Ce(),Ne("a",{key:0,class:"btn btn-outline-primary d-none d-sm-inline-block",onClick:On(i,["prevent","stop"])},[Cn(Nn(Dn),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),Sn(" "+Se(e.newBtnTitle),1)]))])])])]))}});var L="top",x="bottom",R="right",I="left",pe="auto",It=[L,x,R,I],pt="start",Ot="end",hs="clippingParents",Qe="viewport",At="popper",fs="reference",Ke=It.reduce(function(n,t){return n.concat([t+"-"+pt,t+"-"+Ot])},[]),Ze=[].concat(It,[pe]).reduce(function(n,t){return n.concat([t,t+"-"+pt,t+"-"+Ot])},[]),ps="beforeRead",_s="read",ms="afterRead",gs="beforeMain",Es="main",vs="afterMain",bs="beforeWrite",As="write",Ts="afterWrite",ys=[ps,_s,ms,gs,Es,vs,bs,As,Ts];function z(n){return n?(n.nodeName||"").toLowerCase():null}function k(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function _t(n){var t=k(n).Element;return n instanceof t||n instanceof Element}function V(n){var t=k(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function Je(n){if(typeof ShadowRoot>"u")return!1;var t=k(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function Oi(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var s=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];!V(r)||!z(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(o){var a=i[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function Ci(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(s){var i=t.elements[s],r=t.attributes[s]||{},o=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:e[s]),a=o.reduce(function(l,d){return l[d]="",l},{});!V(i)||!z(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(l){i.removeAttribute(l)}))})}}const tn={name:"applyStyles",enabled:!0,phase:"write",fn:Oi,effect:Ci,requires:["computeStyles"]};function Y(n){return n.split("-")[0]}var ft=Math.max,ue=Math.min,Ct=Math.round;function Ye(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function ws(){return!/^((?!chrome|android).)*safari/i.test(Ye())}function Nt(n,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var s=n.getBoundingClientRect(),i=1,r=1;t&&V(n)&&(i=n.offsetWidth>0&&Ct(s.width)/n.offsetWidth||1,r=n.offsetHeight>0&&Ct(s.height)/n.offsetHeight||1);var o=_t(n)?k(n):window,a=o.visualViewport,l=!ws()&&e,d=(s.left+(l&&a?a.offsetLeft:0))/i,u=(s.top+(l&&a?a.offsetTop:0))/r,p=s.width/i,_=s.height/r;return{width:p,height:_,top:u,right:d+p,bottom:u+_,left:d,x:d,y:u}}function en(n){var t=Nt(n),e=n.offsetWidth,s=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:s}}function Os(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&Je(e)){var s=t;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function X(n){return k(n).getComputedStyle(n)}function Ni(n){return["table","td","th"].indexOf(z(n))>=0}function st(n){return((_t(n)?n.ownerDocument:n.document)||window.document).documentElement}function _e(n){return z(n)==="html"?n:n.assignedSlot||n.parentNode||(Je(n)?n.host:null)||st(n)}function $n(n){return!V(n)||X(n).position==="fixed"?null:n.offsetParent}function Si(n){var t=/firefox/i.test(Ye()),e=/Trident/i.test(Ye());if(e&&V(n)){var s=X(n);if(s.position==="fixed")return null}var i=_e(n);for(Je(i)&&(i=i.host);V(i)&&["html","body"].indexOf(z(i))<0;){var r=X(i);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return i;i=i.parentNode}return null}function Kt(n){for(var t=k(n),e=$n(n);e&&Ni(e)&&X(e).position==="static";)e=$n(e);return e&&(z(e)==="html"||z(e)==="body"&&X(e).position==="static")?t:e||Si(n)||t}function nn(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Bt(n,t,e){return ft(n,ue(t,e))}function Di(n,t,e){var s=Bt(n,t,e);return s>e?e:s}function Cs(){return{top:0,right:0,bottom:0,left:0}}function Ns(n){return Object.assign({},Cs(),n)}function Ss(n,t){return t.reduce(function(e,s){return e[s]=n,e},{})}var $i=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Ns(typeof t!="number"?t:Ss(t,It))};function Li(n){var t,e=n.state,s=n.name,i=n.options,r=e.elements.arrow,o=e.modifiersData.popperOffsets,a=Y(e.placement),l=nn(a),d=[I,R].indexOf(a)>=0,u=d?"height":"width";if(!(!r||!o)){var p=$i(i.padding,e),_=en(r),f=l==="y"?L:I,A=l==="y"?x:R,m=e.rects.reference[u]+e.rects.reference[l]-o[l]-e.rects.popper[u],E=o[l]-e.rects.reference[l],T=Kt(r),w=T?l==="y"?T.clientHeight||0:T.clientWidth||0:0,O=m/2-E/2,g=p[f],v=w-_[u]-p[A],b=w/2-_[u]/2+O,y=Bt(g,b,v),S=l;e.modifiersData[s]=(t={},t[S]=y,t.centerOffset=y-b,t)}}function Ii(n){var t=n.state,e=n.options,s=e.element,i=s===void 0?"[data-popper-arrow]":s;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Os(t.elements.popper,i)&&(t.elements.arrow=i))}const Ds={name:"arrow",enabled:!0,phase:"main",fn:Li,effect:Ii,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function St(n){return n.split("-")[1]}var Pi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Mi(n,t){var e=n.x,s=n.y,i=t.devicePixelRatio||1;return{x:Ct(e*i)/i||0,y:Ct(s*i)/i||0}}function Ln(n){var t,e=n.popper,s=n.popperRect,i=n.placement,r=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,p=n.isFixed,_=o.x,f=_===void 0?0:_,A=o.y,m=A===void 0?0:A,E=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=E.x,m=E.y;var T=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),O=I,g=L,v=window;if(d){var b=Kt(e),y="clientHeight",S="clientWidth";if(b===k(e)&&(b=st(e),X(b).position!=="static"&&a==="absolute"&&(y="scrollHeight",S="scrollWidth")),b=b,i===L||(i===I||i===R)&&r===Ot){g=x;var N=p&&b===v&&v.visualViewport?v.visualViewport.height:b[y];m-=N-s.height,m*=l?1:-1}if(i===I||(i===L||i===x)&&r===Ot){O=R;var C=p&&b===v&&v.visualViewport?v.visualViewport.width:b[S];f-=C-s.width,f*=l?1:-1}}var D=Object.assign({position:a},d&&Pi),j=u===!0?Mi({x:f,y:m},k(e)):{x:f,y:m};if(f=j.x,m=j.y,l){var $;return Object.assign({},D,($={},$[g]=w?"0":"",$[O]=T?"0":"",$.transform=(v.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",$))}return Object.assign({},D,(t={},t[g]=w?m+"px":"",t[O]=T?f+"px":"",t.transform="",t))}function xi(n){var t=n.state,e=n.options,s=e.gpuAcceleration,i=s===void 0?!0:s,r=e.adaptive,o=r===void 0?!0:r,a=e.roundOffsets,l=a===void 0?!0:a,d={placement:Y(t.placement),variation:St(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ln(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ln(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const sn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:xi,data:{}};var te={passive:!0};function Ri(n){var t=n.state,e=n.instance,s=n.options,i=s.scroll,r=i===void 0?!0:i,o=s.resize,a=o===void 0?!0:o,l=k(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&d.forEach(function(u){u.addEventListener("scroll",e.update,te)}),a&&l.addEventListener("resize",e.update,te),function(){r&&d.forEach(function(u){u.removeEventListener("scroll",e.update,te)}),a&&l.removeEventListener("resize",e.update,te)}}const rn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ri,data:{}};var ki={left:"right",right:"left",bottom:"top",top:"bottom"};function ae(n){return n.replace(/left|right|bottom|top/g,function(t){return ki[t]})}var Vi={start:"end",end:"start"};function In(n){return n.replace(/start|end/g,function(t){return Vi[t]})}function on(n){var t=k(n),e=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:e,scrollTop:s}}function an(n){return Nt(st(n)).left+on(n).scrollLeft}function Hi(n,t){var e=k(n),s=st(n),i=e.visualViewport,r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;var d=ws();(d||!d&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:r,height:o,x:a+an(n),y:l}}function Wi(n){var t,e=st(n),s=on(n),i=(t=n.ownerDocument)==null?void 0:t.body,r=ft(e.scrollWidth,e.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=ft(e.scrollHeight,e.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-s.scrollLeft+an(n),l=-s.scrollTop;return X(i||e).direction==="rtl"&&(a+=ft(e.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function cn(n){var t=X(n),e=t.overflow,s=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+i+s)}function $s(n){return["html","body","#document"].indexOf(z(n))>=0?n.ownerDocument.body:V(n)&&cn(n)?n:$s(_e(n))}function jt(n,t){var e;t===void 0&&(t=[]);var s=$s(n),i=s===((e=n.ownerDocument)==null?void 0:e.body),r=k(s),o=i?[r].concat(r.visualViewport||[],cn(s)?s:[]):s,a=t.concat(o);return i?a:a.concat(jt(_e(o)))}function Ue(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function Bi(n,t){var e=Nt(n,!1,t==="fixed");return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function Pn(n,t,e){return t===Qe?Ue(Hi(n,e)):_t(t)?Bi(t,e):Ue(Wi(st(n)))}function ji(n){var t=jt(_e(n)),e=["absolute","fixed"].indexOf(X(n).position)>=0,s=e&&V(n)?Kt(n):n;return _t(s)?t.filter(function(i){return _t(i)&&Os(i,s)&&z(i)!=="body"}):[]}function Fi(n,t,e,s){var i=t==="clippingParents"?ji(n):[].concat(t),r=[].concat(i,[e]),o=r[0],a=r.reduce(function(l,d){var u=Pn(n,d,s);return l.top=ft(u.top,l.top),l.right=ue(u.right,l.right),l.bottom=ue(u.bottom,l.bottom),l.left=ft(u.left,l.left),l},Pn(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ls(n){var t=n.reference,e=n.element,s=n.placement,i=s?Y(s):null,r=s?St(s):null,o=t.x+t.width/2-e.width/2,a=t.y+t.height/2-e.height/2,l;switch(i){case L:l={x:o,y:t.y-e.height};break;case x:l={x:o,y:t.y+t.height};break;case R:l={x:t.x+t.width,y:a};break;case I:l={x:t.x-e.width,y:a};break;default:l={x:t.x,y:t.y}}var d=i?nn(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(r){case pt:l[d]=l[d]-(t[u]/2-e[u]/2);break;case Ot:l[d]=l[d]+(t[u]/2-e[u]/2);break}}return l}function Dt(n,t){t===void 0&&(t={});var e=t,s=e.placement,i=s===void 0?n.placement:s,r=e.strategy,o=r===void 0?n.strategy:r,a=e.boundary,l=a===void 0?hs:a,d=e.rootBoundary,u=d===void 0?Qe:d,p=e.elementContext,_=p===void 0?At:p,f=e.altBoundary,A=f===void 0?!1:f,m=e.padding,E=m===void 0?0:m,T=Ns(typeof E!="number"?E:Ss(E,It)),w=_===At?fs:At,O=n.rects.popper,g=n.elements[A?w:_],v=Fi(_t(g)?g:g.contextElement||st(n.elements.popper),l,u,o),b=Nt(n.elements.reference),y=Ls({reference:b,element:O,strategy:"absolute",placement:i}),S=Ue(Object.assign({},O,y)),N=_===At?S:b,C={top:v.top-N.top+T.top,bottom:N.bottom-v.bottom+T.bottom,left:v.left-N.left+T.left,right:N.right-v.right+T.right},D=n.modifiersData.offset;if(_===At&&D){var j=D[i];Object.keys(C).forEach(function($){var ot=[R,x].indexOf($)>=0?1:-1,at=[L,x].indexOf($)>=0?"y":"x";C[$]+=j[at]*ot})}return C}function Ki(n,t){t===void 0&&(t={});var e=t,s=e.placement,i=e.boundary,r=e.rootBoundary,o=e.padding,a=e.flipVariations,l=e.allowedAutoPlacements,d=l===void 0?Ze:l,u=St(s),p=u?a?Ke:Ke.filter(function(A){return St(A)===u}):It,_=p.filter(function(A){return d.indexOf(A)>=0});_.length===0&&(_=p);var f=_.reduce(function(A,m){return A[m]=Dt(n,{placement:m,boundary:i,rootBoundary:r,padding:o})[Y(m)],A},{});return Object.keys(f).sort(function(A,m){return f[A]-f[m]})}function Yi(n){if(Y(n)===pe)return[];var t=ae(n);return[In(n),t,In(t)]}function Ui(n){var t=n.state,e=n.options,s=n.name;if(!t.modifiersData[s]._skip){for(var i=e.mainAxis,r=i===void 0?!0:i,o=e.altAxis,a=o===void 0?!0:o,l=e.fallbackPlacements,d=e.padding,u=e.boundary,p=e.rootBoundary,_=e.altBoundary,f=e.flipVariations,A=f===void 0?!0:f,m=e.allowedAutoPlacements,E=t.options.placement,T=Y(E),w=T===E,O=l||(w||!A?[ae(E)]:Yi(E)),g=[E].concat(O).reduce(function(Et,Z){return Et.concat(Y(Z)===pe?Ki(t,{placement:Z,boundary:u,rootBoundary:p,padding:d,flipVariations:A,allowedAutoPlacements:m}):Z)},[]),v=t.rects.reference,b=t.rects.popper,y=new Map,S=!0,N=g[0],C=0;C=0,at=ot?"width":"height",M=Dt(t,{placement:D,boundary:u,rootBoundary:p,altBoundary:_,padding:d}),F=ot?$?R:I:$?x:L;v[at]>b[at]&&(F=ae(F));var qt=ae(F),ct=[];if(r&&ct.push(M[j]<=0),a&&ct.push(M[F]<=0,M[qt]<=0),ct.every(function(Et){return Et})){N=D,S=!1;break}y.set(D,ct)}if(S)for(var Xt=A?3:1,Te=function(Z){var kt=g.find(function(Zt){var lt=y.get(Zt);if(lt)return lt.slice(0,Z).every(function(ye){return ye})});if(kt)return N=kt,"break"},Rt=Xt;Rt>0;Rt--){var Qt=Te(Rt);if(Qt==="break")break}t.placement!==N&&(t.modifiersData[s]._skip=!0,t.placement=N,t.reset=!0)}}const Is={name:"flip",enabled:!0,phase:"main",fn:Ui,requiresIfExists:["offset"],data:{_skip:!1}};function Mn(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function xn(n){return[L,R,x,I].some(function(t){return n[t]>=0})}function zi(n){var t=n.state,e=n.name,s=t.rects.reference,i=t.rects.popper,r=t.modifiersData.preventOverflow,o=Dt(t,{elementContext:"reference"}),a=Dt(t,{altBoundary:!0}),l=Mn(o,s),d=Mn(a,i,r),u=xn(l),p=xn(d);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}const Ps={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zi};function Gi(n,t,e){var s=Y(n),i=[I,L].indexOf(s)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,o=r[0],a=r[1];return o=o||0,a=(a||0)*i,[I,R].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function qi(n){var t=n.state,e=n.options,s=n.name,i=e.offset,r=i===void 0?[0,0]:i,o=Ze.reduce(function(u,p){return u[p]=Gi(p,t.rects,r),u},{}),a=o[t.placement],l=a.x,d=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=d),t.modifiersData[s]=o}const Ms={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qi};function Xi(n){var t=n.state,e=n.name;t.modifiersData[e]=Ls({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const ln={name:"popperOffsets",enabled:!0,phase:"read",fn:Xi,data:{}};function Qi(n){return n==="x"?"y":"x"}function Zi(n){var t=n.state,e=n.options,s=n.name,i=e.mainAxis,r=i===void 0?!0:i,o=e.altAxis,a=o===void 0?!1:o,l=e.boundary,d=e.rootBoundary,u=e.altBoundary,p=e.padding,_=e.tether,f=_===void 0?!0:_,A=e.tetherOffset,m=A===void 0?0:A,E=Dt(t,{boundary:l,rootBoundary:d,padding:p,altBoundary:u}),T=Y(t.placement),w=St(t.placement),O=!w,g=nn(T),v=Qi(g),b=t.modifiersData.popperOffsets,y=t.rects.reference,S=t.rects.popper,N=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,C=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(b){if(r){var $,ot=g==="y"?L:I,at=g==="y"?x:R,M=g==="y"?"height":"width",F=b[g],qt=F+E[ot],ct=F-E[at],Xt=f?-S[M]/2:0,Te=w===pt?y[M]:S[M],Rt=w===pt?-S[M]:-y[M],Qt=t.elements.arrow,Et=f&&Qt?en(Qt):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Cs(),kt=Z[ot],Zt=Z[at],lt=Bt(0,y[M],Et[M]),ye=O?y[M]/2-Xt-lt-kt-C.mainAxis:Te-lt-kt-C.mainAxis,hi=O?-y[M]/2+Xt+lt+Zt+C.mainAxis:Rt+lt+Zt+C.mainAxis,we=t.elements.arrow&&Kt(t.elements.arrow),fi=we?g==="y"?we.clientTop||0:we.clientLeft||0:0,mn=($=D==null?void 0:D[g])!=null?$:0,pi=F+ye-mn-fi,_i=F+hi-mn,gn=Bt(f?ue(qt,pi):qt,F,f?ft(ct,_i):ct);b[g]=gn,j[g]=gn-F}if(a){var En,mi=g==="x"?L:I,gi=g==="x"?x:R,ut=b[v],Jt=v==="y"?"height":"width",vn=ut+E[mi],bn=ut-E[gi],Oe=[L,I].indexOf(T)!==-1,An=(En=D==null?void 0:D[v])!=null?En:0,Tn=Oe?vn:ut-y[Jt]-S[Jt]-An+C.altAxis,yn=Oe?ut+y[Jt]+S[Jt]-An-C.altAxis:bn,wn=f&&Oe?Di(Tn,ut,yn):Bt(f?Tn:vn,ut,f?yn:bn);b[v]=wn,j[v]=wn-ut}t.modifiersData[s]=j}}const xs={name:"preventOverflow",enabled:!0,phase:"main",fn:Zi,requiresIfExists:["offset"]};function Ji(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function tr(n){return n===k(n)||!V(n)?on(n):Ji(n)}function er(n){var t=n.getBoundingClientRect(),e=Ct(t.width)/n.offsetWidth||1,s=Ct(t.height)/n.offsetHeight||1;return e!==1||s!==1}function nr(n,t,e){e===void 0&&(e=!1);var s=V(t),i=V(t)&&er(t),r=st(t),o=Nt(n,i,e),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!e)&&((z(t)!=="body"||cn(r))&&(a=tr(t)),V(t)?(l=Nt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=an(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function sr(n){var t=new Map,e=new Set,s=[];n.forEach(function(r){t.set(r.name,r)});function i(r){e.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!e.has(a)){var l=t.get(a);l&&i(l)}}),s.push(r)}return n.forEach(function(r){e.has(r.name)||i(r)}),s}function ir(n){var t=sr(n);return ys.reduce(function(e,s){return e.concat(t.filter(function(i){return i.phase===s}))},[])}function rr(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function or(n){var t=n.reduce(function(e,s){var i=e[s.name];return e[s.name]=i?Object.assign({},i,s,{options:Object.assign({},i.options,s.options),data:Object.assign({},i.data,s.data)}):s,e},{});return Object.keys(t).map(function(e){return t[e]})}var Rn={placement:"bottom",modifiers:[],strategy:"absolute"};function kn(){for(var n=arguments.length,t=new Array(n),e=0;ei.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OssList-CUqe4g5_.js","assets/bootstrap.esm-LCYmWnCj.js","assets/IconPlus-0MYkWKdM.js","assets/Tabulator.vue_vue_type_style_index_0_lang-By28-D7G.js","assets/Tabulator-C0-hRjAn.css","assets/request-BXz87ydW.js","assets/YamlGenerate-Wt35UcvC.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/YamlGenerate-B5_cwrRZ.css","assets/RepositoryList-BkyTcYpV.js","assets/RepositoryList.vue_vue_type_script_setup_true_lang-bf_PvRD5.js","assets/repository-0d7heipW.js","assets/RepositoryDetail-Dsfw98Ui.js","assets/RepositoryDetail.vue_vue_type_script_setup_true_lang-C6606I4v.js","assets/lodash-CMOUKIpU.js","assets/SoftwareCatalog-C-Fozz0b.js","assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-DuIt1swN.js","assets/softwareCatalogForm-7J7U2k9n.css","assets/SoftwareCatalog-y9KAbeCF.css","assets/SoftwareCatalogListTest-DjCbxOSW.js","assets/SoftwareCatalogListTest-Dz0zZeYT.css"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();/** * @vue/shared v3.5.3 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -28,7 +28,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OssList-NTlcIZP `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(i=>s.set(i)),s}static accessor(t){const s=(this[ju]=this[ju]={accessors:{}}).accessors,i=this.prototype;function o(a){const c=ir(a);s[c]||(Pv(i,a),s[c]=!0)}return S.isArray(t)?t.forEach(o):o(t),this}}yt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);S.reduceDescriptors(yt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});S.freezeMethods(yt);function Xo(e,t){const n=this||Nr,s=t||n,i=yt.from(s.headers);let o=s.data;return S.forEach(e,function(c){o=c.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function nh(e){return!!(e&&e.__CANCEL__)}function Ks(e,t,n){de.call(this,e??"canceled",de.ERR_CANCELED,t,n),this.name="CanceledError"}S.inherits(Ks,de,{__CANCEL__:!0});function sh(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new de("Request failed with status code "+n.status,[de.ERR_BAD_REQUEST,de.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Lv(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Iv(e,t){e=e||10;const n=new Array(e),s=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(f){const p=Date.now(),d=s[o];a||(a=p),n[i]=f,s[i]=p;let m=o,b=0;for(;m!==i;)b+=n[m++],m=m%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),p-a{n=d,i=null,o&&(clearTimeout(o),o=null),e.apply(null,p)};return[(...p)=>{const d=Date.now(),m=d-n;m>=s?a(p,d):(i=p,o||(o=setTimeout(()=>{o=null,a(i)},s-m)))},()=>i&&a(i)]}const xi=(e,t,n=3)=>{let s=0;const i=Iv(50,250);return Dv(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,f=a-s,p=i(f),d=a<=c;s=a;const m={loaded:a,total:c,progress:c?a/c:void 0,bytes:f,rate:p||void 0,estimated:p&&c&&d?(c-a)/p:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},Bu=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Hu=e=>(...t)=>S.asap(()=>e(...t)),Nv=bt.hasStandardBrowserEnv?function(){const t=bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent),n=document.createElement("a");let s;function i(o){let a=o;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=i(window.location.href),function(a){const c=S.isString(a)?i(a):a;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}(),kv=bt.hasStandardBrowserEnv?{write(e,t,n,s,i,o){const a=[e+"="+encodeURIComponent(t)];S.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),S.isString(s)&&a.push("path="+s),S.isString(i)&&a.push("domain="+i),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Mv(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function $v(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function rh(e,t){return e&&!Mv(t)?$v(e,t):t}const Vu=e=>e instanceof yt?{...e}:e;function ms(e,t){t=t||{};const n={};function s(p,d,m){return S.isPlainObject(p)&&S.isPlainObject(d)?S.merge.call({caseless:m},p,d):S.isPlainObject(d)?S.merge({},d):S.isArray(d)?d.slice():d}function i(p,d,m){if(S.isUndefined(d)){if(!S.isUndefined(p))return s(void 0,p,m)}else return s(p,d,m)}function o(p,d){if(!S.isUndefined(d))return s(void 0,d)}function a(p,d){if(S.isUndefined(d)){if(!S.isUndefined(p))return s(void 0,p)}else return s(void 0,d)}function c(p,d,m){if(m in t)return s(p,d);if(m in e)return s(void 0,p)}const f={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(p,d)=>i(Vu(p),Vu(d),!0)};return S.forEach(Object.keys(Object.assign({},e,t)),function(d){const m=f[d]||i,b=m(e[d],t[d],d);S.isUndefined(b)&&m!==c||(n[d]=b)}),n}const ih=e=>{const t=ms({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=t;t.headers=a=yt.from(a),t.url=Zd(rh(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(S.isFormData(n)){if(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((f=a.getContentType())!==!1){const[p,...d]=f?f.split(";").map(m=>m.trim()).filter(Boolean):[];a.setContentType([p||"multipart/form-data",...d].join("; "))}}if(bt.hasStandardBrowserEnv&&(s&&S.isFunction(s)&&(s=s(t)),s||s!==!1&&Nv(t.url))){const p=i&&o&&kv.read(o);p&&a.set(i,p)}return t},Fv=typeof XMLHttpRequest<"u",jv=Fv&&function(e){return new Promise(function(n,s){const i=ih(e);let o=i.data;const a=yt.from(i.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:p}=i,d,m,b,w,C;function P(){w&&w(),C&&C(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let R=new XMLHttpRequest;R.open(i.method.toUpperCase(),i.url,!0),R.timeout=i.timeout;function $(){if(!R)return;const B=yt.from("getAllResponseHeaders"in R&&R.getAllResponseHeaders()),Y={data:!c||c==="text"||c==="json"?R.responseText:R.response,status:R.status,statusText:R.statusText,headers:B,config:e,request:R};sh(function(le){n(le),P()},function(le){s(le),P()},Y),R=null}"onloadend"in R?R.onloadend=$:R.onreadystatechange=function(){!R||R.readyState!==4||R.status===0&&!(R.responseURL&&R.responseURL.indexOf("file:")===0)||setTimeout($)},R.onabort=function(){R&&(s(new de("Request aborted",de.ECONNABORTED,e,R)),R=null)},R.onerror=function(){s(new de("Network Error",de.ERR_NETWORK,e,R)),R=null},R.ontimeout=function(){let H=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const Y=i.transitional||eh;i.timeoutErrorMessage&&(H=i.timeoutErrorMessage),s(new de(H,Y.clarifyTimeoutError?de.ETIMEDOUT:de.ECONNABORTED,e,R)),R=null},o===void 0&&a.setContentType(null),"setRequestHeader"in R&&S.forEach(a.toJSON(),function(H,Y){R.setRequestHeader(Y,H)}),S.isUndefined(i.withCredentials)||(R.withCredentials=!!i.withCredentials),c&&c!=="json"&&(R.responseType=i.responseType),p&&([b,C]=xi(p,!0),R.addEventListener("progress",b)),f&&R.upload&&([m,w]=xi(f),R.upload.addEventListener("progress",m),R.upload.addEventListener("loadend",w)),(i.cancelToken||i.signal)&&(d=B=>{R&&(s(!B||B.type?new Ks(null,e,R):B),R.abort(),R=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const N=Lv(i.url);if(N&&bt.protocols.indexOf(N)===-1){s(new de("Unsupported protocol "+N+":",de.ERR_BAD_REQUEST,e));return}R.send(o||null)})},Bv=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,i;const o=function(p){if(!i){i=!0,c();const d=p instanceof Error?p:this.reason;s.abort(d instanceof de?d:new Ks(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,o(new de(`timeout ${t} of ms exceeded`,de.ETIMEDOUT))},t);const c=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(o):p.removeEventListener("abort",o)}),e=null)};e.forEach(p=>p.addEventListener("abort",o));const{signal:f}=s;return f.unsubscribe=()=>S.asap(c),f}},Hv=function*(e,t){let n=e.byteLength;if(!t||n{const i=Vv(e,t);let o=0,a,c=f=>{a||(a=!0,s&&s(f))};return new ReadableStream({async pull(f){try{const{done:p,value:d}=await i.next();if(p){c(),f.close();return}let m=d.byteLength;if(n){let b=o+=m;n(b)}f.enqueue(new Uint8Array(d))}catch(p){throw c(p),p}},cancel(f){return c(f),i.return()}},{highWaterMark:2})},Qi=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",oh=Qi&&typeof ReadableStream=="function",Wv=Qi&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ah=(e,...t)=>{try{return!!e(...t)}catch{return!1}},qv=oh&&ah(()=>{let e=!1;const t=new Request(bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Wu=64*1024,ba=oh&&ah(()=>S.isReadableStream(new Response("").body)),Ri={stream:ba&&(e=>e.body)};Qi&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ri[t]&&(Ri[t]=S.isFunction(e[t])?n=>n[t]():(n,s)=>{throw new de(`Response type '${t}' is not supported`,de.ERR_NOT_SUPPORT,s)})})})(new Response);const zv=async e=>{if(e==null)return 0;if(S.isBlob(e))return e.size;if(S.isSpecCompliantForm(e))return(await new Request(bt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(S.isArrayBufferView(e)||S.isArrayBuffer(e))return e.byteLength;if(S.isURLSearchParams(e)&&(e=e+""),S.isString(e))return(await Wv(e)).byteLength},Kv=async(e,t)=>{const n=S.toFiniteNumber(e.getContentLength());return n??zv(t)},Gv=Qi&&(async e=>{let{url:t,method:n,data:s,signal:i,cancelToken:o,timeout:a,onDownloadProgress:c,onUploadProgress:f,responseType:p,headers:d,withCredentials:m="same-origin",fetchOptions:b}=ih(e);p=p?(p+"").toLowerCase():"text";let w=Bv([i,o&&o.toAbortSignal()],a),C;const P=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let R;try{if(f&&qv&&n!=="get"&&n!=="head"&&(R=await Kv(d,s))!==0){let Y=new Request(t,{method:"POST",body:s,duplex:"half"}),ge;if(S.isFormData(s)&&(ge=Y.headers.get("content-type"))&&d.setContentType(ge),Y.body){const[le,te]=Bu(R,xi(Hu(f)));s=Uu(Y.body,Wu,le,te)}}S.isString(m)||(m=m?"include":"omit");const $="credentials"in Request.prototype;C=new Request(t,{...b,signal:w,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:s,duplex:"half",credentials:$?m:void 0});let N=await fetch(C);const B=ba&&(p==="stream"||p==="response");if(ba&&(c||B&&P)){const Y={};["status","statusText","headers"].forEach(W=>{Y[W]=N[W]});const ge=S.toFiniteNumber(N.headers.get("content-length")),[le,te]=c&&Bu(ge,xi(Hu(c),!0))||[];N=new Response(Uu(N.body,Wu,le,()=>{te&&te(),P&&P()}),Y)}p=p||"text";let H=await Ri[S.findKey(Ri,p)||"text"](N,e);return!B&&P&&P(),await new Promise((Y,ge)=>{sh(Y,ge,{data:H,headers:yt.from(N.headers),status:N.status,statusText:N.statusText,config:e,request:C})})}catch($){throw P&&P(),$&&$.name==="TypeError"&&/fetch/i.test($.message)?Object.assign(new de("Network Error",de.ERR_NETWORK,e,C),{cause:$.cause||$}):de.from($,$&&$.code,e,C)}}),ya={http:cv,xhr:jv,fetch:Gv};S.forEach(ya,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const qu=e=>`- ${e}`,Jv=e=>S.isFunction(e)||e===null||e===!1,lh={getAdapter:e=>{e=S.isArray(e)?e:[e];const{length:t}=e;let n,s;const i={};for(let o=0;o`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since : `+o.map(qu).join(` `):" "+qu(o[0]):"as no adapter specified";throw new de("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:ya};function Qo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ks(null,e)}function zu(e){return Qo(e),e.headers=yt.from(e.headers),e.data=Xo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),lh.getAdapter(e.adapter||Nr.adapter)(e).then(function(s){return Qo(e),s.data=Xo.call(e,e.transformResponse,s),s.headers=yt.from(s.headers),s},function(s){return nh(s)||(Qo(e),s&&s.response&&(s.response.data=Xo.call(e,e.transformResponse,s.response),s.response.headers=yt.from(s.response.headers))),Promise.reject(s)})}const ch="1.7.7",Qa={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Qa[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ku={};Qa.transitional=function(t,n,s){function i(o,a){return"[Axios v"+ch+"] Transitional option '"+o+"'"+a+(s?". "+s:"")}return(o,a,c)=>{if(t===!1)throw new de(i(a," has been removed"+(n?" in "+n:"")),de.ERR_DEPRECATED);return n&&!Ku[a]&&(Ku[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,c):!0}};function Xv(e,t,n){if(typeof e!="object")throw new de("options must be an object",de.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let i=s.length;for(;i-- >0;){const o=s[i],a=t[o];if(a){const c=e[o],f=c===void 0||a(c,o,e);if(f!==!0)throw new de("option "+o+" must be "+f,de.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new de("Unknown option "+o,de.ERR_BAD_OPTION)}}const va={assertOptions:Xv,validators:Qa},Ln=va.validators;class fs{constructor(t){this.defaults=t,this.interceptors={request:new Fu,response:new Fu}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=` -`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ms(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:o}=n;s!==void 0&&va.assertOptions(s,{silentJSONParsing:Ln.transitional(Ln.boolean),forcedJSONParsing:Ln.transitional(Ln.boolean),clarifyTimeoutError:Ln.transitional(Ln.boolean)},!1),i!=null&&(S.isFunction(i)?n.paramsSerializer={serialize:i}:va.assertOptions(i,{encode:Ln.function,serialize:Ln.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&S.merge(o.common,o[n.method]);o&&S.forEach(["delete","get","head","post","put","patch","common"],C=>{delete o[C]}),n.headers=yt.concat(a,o);const c=[];let f=!0;this.interceptors.request.forEach(function(P){typeof P.runWhen=="function"&&P.runWhen(n)===!1||(f=f&&P.synchronous,c.unshift(P.fulfilled,P.rejected))});const p=[];this.interceptors.response.forEach(function(P){p.push(P.fulfilled,P.rejected)});let d,m=0,b;if(!f){const C=[zu.bind(this),void 0];for(C.unshift.apply(C,c),C.push.apply(C,p),b=C.length,d=Promise.resolve(n);m{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{s.subscribe(c),o=c}).then(i);return a.cancel=function(){s.unsubscribe(o)},a},t(function(o,a,c){s.reason||(s.reason=new Ks(o,a,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ya(function(i){t=i}),cancel:t}}}function Qv(e){return function(n){return e.apply(null,n)}}function Yv(e){return S.isObject(e)&&e.isAxiosError===!0}const wa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wa).forEach(([e,t])=>{wa[t]=e});function uh(e){const t=new fs(e),n=Hd(fs.prototype.request,t);return S.extend(n,fs.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return uh(ms(e,i))},n}const Ke=uh(Nr);Ke.Axios=fs;Ke.CanceledError=Ks;Ke.CancelToken=Ya;Ke.isCancel=nh;Ke.VERSION=ch;Ke.toFormData=Xi;Ke.AxiosError=de;Ke.Cancel=Ke.CanceledError;Ke.all=function(t){return Promise.all(t)};Ke.spread=Qv;Ke.isAxiosError=Yv;Ke.mergeConfig=ms;Ke.AxiosHeaders=yt;Ke.formToJSON=e=>th(S.isHTMLForm(e)?new FormData(e):e);Ke.getAdapter=lh.getAdapter;Ke.HttpStatusCode=wa;Ke.default=Ke;const Zv="modulepreload",ew=function(e){return"/"+e},Gu={},is=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(c=>{if(c=ew(c),c in Gu)return;Gu[c]=!0;const f=c.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const d=document.createElement("link");if(d.rel=f?"stylesheet":Zv,f||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),f)return new Promise((m,b)=>{d.addEventListener("load",m),d.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}return i.then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})},fh=wy({history:Xb(),routes:[{path:"/",name:"home",redirect:"/web/softwareCatalog"},{path:"/web",name:"rootOssList",component:()=>is(()=>import("./OssList-NTlcIZPq.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/web/oss/list",name:"ossList",component:()=>is(()=>import("./OssList-NTlcIZPq.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/web/generate/yaml",name:"yamlGenerate",component:()=>is(()=>import("./YamlGenerate-DLhPsACL.js"),__vite__mapDeps([6,5,7,8]))},{path:"/web/repository/list",name:"repositoryList",component:()=>is(()=>import("./RepositoryList-DckCTsFf.js"),__vite__mapDeps([9,10,1,2,3,4,11,5]))},{path:"/web/repository/detail/:repositoryName",name:"repositoryDetail",component:()=>is(()=>import("./RepositoryDetail-BoKUt-pP.js"),__vite__mapDeps([12,13,11,5,14,3,4]))},{path:"/web/softwareCatalog",name:"softwareCatalog",component:()=>is(()=>import("./SoftwareCatalog-DhjERr2d.js"),__vite__mapDeps([15,2,16,14,5,7,17,3,4,10,1,11,13,18]))},{path:"/web/softwareCatalog/list/test",name:"softwareCatalogListTest",component:()=>is(()=>import("./SoftwareCatalogListTest-BfJ6gTX2.js"),__vite__mapDeps([19,2,16,14,5,7,17,20]))}]}),tw=yb("user",{state:()=>({accessToken:"",workspaceInfo:{id:"",name:"",description:"",created_at:"",updated_at:""},projectInfo:{id:"",ns_id:"",mci_id:"",cluster_id:"",name:"",description:"",created_at:"",updated_at:""},operationId:""}),actions:{setUser(e){this.accessToken=e.accessToken,this.workspaceInfo=e.workspaceInfo,this.projectInfo=e.projectInfo,this.operationId=e.operationId},getNsId(){return this.projectInfo.ns_id},clearUser(){this.accessToken=null,this.workspaceInfo=null,this.projectInfo=null,this.operationId=null}}});fh.beforeEach(async(e,t,n)=>{window.addEventListener("message",async function(s){let i;console.log("## event.data.accessToken ### : ",s.data.accessToken),s.data.accessToken===void 0||s.data.accessToken==="undefined"?(console.log("## event.data.accessToken is undefined ### : "),i={accessToken:"accesstokenExample",workspaceInfo:{id:"8b2df1f9-b937-4861-b5ce-855a41c346bc",name:"workspace2",description:"workspace2 desc",created_at:"2024-06-18T00:10:16.192337Z",updated_at:"2024-06-18T00:10:16.192337Z"},projectInfo:{id:"1e88f4ea-d052-4314-80a4-9ac3f6691feb",ns_id:"ns01",mci_id:"mci01",cluster_id:"cluster01",name:"ns01",description:"ns01 desc",created_at:"2024-06-18T00:28:57.094105Z",updated_at:"2024-06-18T00:28:57.094105Z"},operationId:"op1"}):(console.log("## event.data.accessToken is not undefined ### : "),i=s.data);try{console.log("## data ### : ",i),tw().setUser(i)}catch(o){console.error("Error in processing message:",o)}}),n()});const nw=e=>{const t=e==null?void 0:e.trim();if(!t)return window.location.origin;try{const n=new URL(t),s=new Set(["localhost","127.0.0.1","::1"]);if(s.has(n.hostname)&&!s.has(window.location.hostname))return window.location.origin}catch{return t}return t!=null&&t.startsWith("http://")&&window.location.protocol==="https:"?window.location.origin:t},u0=e=>e?/^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(e)||e.startsWith("data:")?e:`${window.location.origin}${e.startsWith("/")?"":"/"}${e}`:"";var sw=Object.defineProperty,Ju=Object.getOwnPropertySymbols,rw=Object.prototype.hasOwnProperty,iw=Object.prototype.propertyIsEnumerable,Xu=(e,t,n)=>t in e?sw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dh=(e,t)=>{for(var n in t||(t={}))rw.call(t,n)&&Xu(e,n,t[n]);if(Ju)for(var n of Ju(t))iw.call(t,n)&&Xu(e,n,t[n]);return e},Yi=e=>typeof e=="function",Zi=e=>typeof e=="string",hh=e=>Zi(e)&&e.trim().length>0,ow=e=>typeof e=="number",ls=e=>typeof e>"u",Sr=e=>typeof e=="object"&&e!==null,aw=e=>cn(e,"tag")&&hh(e.tag),ph=e=>window.TouchEvent&&e instanceof TouchEvent,mh=e=>cn(e,"component")&&gh(e.component),lw=e=>Yi(e)||Sr(e),gh=e=>!ls(e)&&(Zi(e)||lw(e)||mh(e)),Qu=e=>Sr(e)&&["height","width","right","left","top","bottom"].every(t=>ow(e[t])),cn=(e,t)=>(Sr(e)||Yi(e))&&t in e,cw=(e=>()=>e++)(0);function Yo(e){return ph(e)?e.targetTouches[0].clientX:e.clientX}function Yu(e){return ph(e)?e.targetTouches[0].clientY:e.clientY}var uw=e=>{ls(e.remove)?e.parentNode&&e.parentNode.removeChild(e):e.remove()},kr=e=>mh(e)?kr(e.component):aw(e)?fn({render(){return e}}):typeof e=="string"?e:Ee(Fn(e)),fw=e=>{if(typeof e=="string")return e;const t=cn(e,"props")&&Sr(e.props)?e.props:{},n=cn(e,"listeners")&&Sr(e.listeners)?e.listeners:{};return{component:kr(e),props:t,listeners:n}},dw=()=>typeof window<"u",Za=class{constructor(){this.allHandlers={}}getHandlers(e){return this.allHandlers[e]||[]}on(e,t){const n=this.getHandlers(e);n.push(t),this.allHandlers[e]=n}off(e,t){const n=this.getHandlers(e);n.splice(n.indexOf(t)>>>0,1)}emit(e,t){this.getHandlers(e).forEach(s=>s(t))}},hw=e=>["on","off","emit"].every(t=>cn(e,t)&&Yi(e[t])),St;(function(e){e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.DEFAULT="default"})(St||(St={}));var Pi;(function(e){e.TOP_LEFT="top-left",e.TOP_CENTER="top-center",e.TOP_RIGHT="top-right",e.BOTTOM_LEFT="bottom-left",e.BOTTOM_CENTER="bottom-center",e.BOTTOM_RIGHT="bottom-right"})(Pi||(Pi={}));var At;(function(e){e.ADD="add",e.DISMISS="dismiss",e.UPDATE="update",e.CLEAR="clear",e.UPDATE_DEFAULTS="update_defaults"})(At||(At={}));var qt="Vue-Toastification",Ut={type:{type:String,default:St.DEFAULT},classNames:{type:[String,Array],default:()=>[]},trueBoolean:{type:Boolean,default:!0}},_h={type:Ut.type,customIcon:{type:[String,Boolean,Object,Function],default:!0}},bi={component:{type:[String,Object,Function,Boolean],default:"button"},classNames:Ut.classNames,showOnHover:{type:Boolean,default:!1},ariaLabel:{type:String,default:"close"}},Ea={timeout:{type:[Number,Boolean],default:5e3},hideProgressBar:{type:Boolean,default:!1},isRunning:{type:Boolean,default:!1}},bh={transition:{type:[Object,String],default:`${qt}__bounce`}},pw={position:{type:String,default:Pi.TOP_RIGHT},draggable:Ut.trueBoolean,draggablePercent:{type:Number,default:.6},pauseOnFocusLoss:Ut.trueBoolean,pauseOnHover:Ut.trueBoolean,closeOnClick:Ut.trueBoolean,timeout:Ea.timeout,hideProgressBar:Ea.hideProgressBar,toastClassName:Ut.classNames,bodyClassName:Ut.classNames,icon:_h.customIcon,closeButton:bi.component,closeButtonClassName:bi.classNames,showCloseButtonOnHover:bi.showOnHover,accessibility:{type:Object,default:()=>({toastRole:"alert",closeButtonLabel:"close"})},rtl:{type:Boolean,default:!1},eventBus:{type:Object,required:!1,default:()=>new Za}},mw={id:{type:[String,Number],required:!0,default:0},type:Ut.type,content:{type:[String,Object,Function],required:!0,default:""},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0}},gw={container:{type:[Object,Function],default:()=>document.body},newestOnTop:Ut.trueBoolean,maxToasts:{type:Number,default:20},transition:bh.transition,toastDefaults:Object,filterBeforeCreate:{type:Function,default:e=>e},filterToasts:{type:Function,default:e=>e},containerClassName:Ut.classNames,onMounted:Function,shareAppContext:[Boolean,Object]},En={CORE_TOAST:pw,TOAST:mw,CONTAINER:gw,PROGRESS_BAR:Ea,ICON:_h,TRANSITION:bh,CLOSE_BUTTON:bi},yh=fn({name:"VtProgressBar",props:En.PROGRESS_BAR,data(){return{hasClass:!0}},computed:{style(){return{animationDuration:`${this.timeout}ms`,animationPlayState:this.isRunning?"running":"paused",opacity:this.hideProgressBar?0:1}},cpClass(){return this.hasClass?`${qt}__progress-bar`:""}},watch:{timeout(){this.hasClass=!1,this.$nextTick(()=>this.hasClass=!0)}},mounted(){this.$el.addEventListener("animationend",this.animationEnded)},beforeUnmount(){this.$el.removeEventListener("animationend",this.animationEnded)},methods:{animationEnded(){this.$emit("close-toast")}}});function _w(e,t){return Ve(),Wt("div",{style:Or(e.style),class:Bn(e.cpClass)},null,6)}yh.render=_w;var bw=yh,vh=fn({name:"VtCloseButton",props:En.CLOSE_BUTTON,computed:{buttonComponent(){return this.component!==!1?kr(this.component):"button"},classes(){const e=[`${qt}__close-button`];return this.showOnHover&&e.push("show-on-hover"),e.concat(this.classNames)}}}),yw=Bi(" × ");function vw(e,t){return Ve(),jt(Va(e.buttonComponent),Hi({"aria-label":e.ariaLabel,class:e.classes},e.$attrs),{default:Lr(()=>[yw]),_:1},16,["aria-label","class"])}vh.render=vw;var ww=vh,wh={},Ew={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"check-circle",class:"svg-inline--fa fa-check-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Cw=_s("path",{fill:"currentColor",d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},null,-1),Tw=[Cw];function Sw(e,t){return Ve(),Wt("svg",Ew,Tw)}wh.render=Sw;var Aw=wh,Eh={},Ow={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"info-circle",class:"svg-inline--fa fa-info-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},xw=_s("path",{fill:"currentColor",d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},null,-1),Rw=[xw];function Pw(e,t){return Ve(),Wt("svg",Ow,Rw)}Eh.render=Pw;var Zu=Eh,Ch={},Lw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-circle",class:"svg-inline--fa fa-exclamation-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Iw=_s("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),Dw=[Iw];function Nw(e,t){return Ve(),Wt("svg",Lw,Dw)}Ch.render=Nw;var kw=Ch,Th={},Mw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-triangle",class:"svg-inline--fa fa-exclamation-triangle fa-w-18",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},$w=_s("path",{fill:"currentColor",d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),Fw=[$w];function jw(e,t){return Ve(),Wt("svg",Mw,Fw)}Th.render=jw;var Bw=Th,Sh=fn({name:"VtIcon",props:En.ICON,computed:{customIconChildren(){return cn(this.customIcon,"iconChildren")?this.trimValue(this.customIcon.iconChildren):""},customIconClass(){return Zi(this.customIcon)?this.trimValue(this.customIcon):cn(this.customIcon,"iconClass")?this.trimValue(this.customIcon.iconClass):""},customIconTag(){return cn(this.customIcon,"iconTag")?this.trimValue(this.customIcon.iconTag,"i"):"i"},hasCustomIcon(){return this.customIconClass.length>0},component(){return this.hasCustomIcon?this.customIconTag:gh(this.customIcon)?kr(this.customIcon):this.iconTypeComponent},iconTypeComponent(){return{[St.DEFAULT]:Zu,[St.INFO]:Zu,[St.SUCCESS]:Aw,[St.ERROR]:Bw,[St.WARNING]:kw}[this.type]},iconClasses(){const e=[`${qt}__icon`];return this.hasCustomIcon?e.concat(this.customIconClass):e}},methods:{trimValue(e,t=""){return hh(e)?e.trim():t}}});function Hw(e,t){return Ve(),jt(Va(e.component),{class:Bn(e.iconClasses)},{default:Lr(()=>[Bi(xa(e.customIconChildren),1)]),_:1},8,["class"])}Sh.render=Hw;var Vw=Sh,Ah=fn({name:"VtToast",components:{ProgressBar:bw,CloseButton:ww,Icon:Vw},inheritAttrs:!1,props:Object.assign({},En.CORE_TOAST,En.TOAST),data(){return{isRunning:!0,disableTransitions:!1,beingDragged:!1,dragStart:0,dragPos:{x:0,y:0},dragRect:{}}},computed:{classes(){const e=[`${qt}__toast`,`${qt}__toast--${this.type}`,`${this.position}`].concat(this.toastClassName);return this.disableTransitions&&e.push("disable-transition"),this.rtl&&e.push(`${qt}__toast--rtl`),e},bodyClasses(){return[`${qt}__toast-${Zi(this.content)?"body":"component-body"}`].concat(this.bodyClassName)},draggableStyle(){return this.dragStart===this.dragPos.x?{}:this.beingDragged?{transform:`translateX(${this.dragDelta}px)`,opacity:1-Math.abs(this.dragDelta/this.removalDistance)}:{transition:"transform 0.2s, opacity 0.2s",transform:"translateX(0)",opacity:1}},dragDelta(){return this.beingDragged?this.dragPos.x-this.dragStart:0},removalDistance(){return Qu(this.dragRect)?(this.dragRect.right-this.dragRect.left)*this.draggablePercent:0}},mounted(){this.draggable&&this.draggableSetup(),this.pauseOnFocusLoss&&this.focusSetup()},beforeUnmount(){this.draggable&&this.draggableCleanup(),this.pauseOnFocusLoss&&this.focusCleanup()},methods:{hasProp:cn,getVueComponentFromObj:kr,closeToast(){this.eventBus.emit(At.DISMISS,this.id)},clickHandler(){this.onClick&&this.onClick(this.closeToast),this.closeOnClick&&(!this.beingDragged||this.dragStart===this.dragPos.x)&&this.closeToast()},timeoutHandler(){this.closeToast()},hoverPause(){this.pauseOnHover&&(this.isRunning=!1)},hoverPlay(){this.pauseOnHover&&(this.isRunning=!0)},focusPause(){this.isRunning=!1},focusPlay(){this.isRunning=!0},focusSetup(){addEventListener("blur",this.focusPause),addEventListener("focus",this.focusPlay)},focusCleanup(){removeEventListener("blur",this.focusPause),removeEventListener("focus",this.focusPlay)},draggableSetup(){const e=this.$el;e.addEventListener("touchstart",this.onDragStart,{passive:!0}),e.addEventListener("mousedown",this.onDragStart),addEventListener("touchmove",this.onDragMove,{passive:!1}),addEventListener("mousemove",this.onDragMove),addEventListener("touchend",this.onDragEnd),addEventListener("mouseup",this.onDragEnd)},draggableCleanup(){const e=this.$el;e.removeEventListener("touchstart",this.onDragStart),e.removeEventListener("mousedown",this.onDragStart),removeEventListener("touchmove",this.onDragMove),removeEventListener("mousemove",this.onDragMove),removeEventListener("touchend",this.onDragEnd),removeEventListener("mouseup",this.onDragEnd)},onDragStart(e){this.beingDragged=!0,this.dragPos={x:Yo(e),y:Yu(e)},this.dragStart=Yo(e),this.dragRect=this.$el.getBoundingClientRect()},onDragMove(e){this.beingDragged&&(e.preventDefault(),this.isRunning&&(this.isRunning=!1),this.dragPos={x:Yo(e),y:Yu(e)})},onDragEnd(){this.beingDragged&&(Math.abs(this.dragDelta)>=this.removalDistance?(this.disableTransitions=!0,this.$nextTick(()=>this.closeToast())):setTimeout(()=>{this.beingDragged=!1,Qu(this.dragRect)&&this.pauseOnHover&&this.dragRect.bottom>=this.dragPos.y&&this.dragPos.y>=this.dragRect.top&&this.dragRect.left<=this.dragPos.x&&this.dragPos.x<=this.dragRect.right?this.isRunning=!1:this.isRunning=!0}))}}}),Uw=["role"];function Ww(e,t){const n=cr("Icon"),s=cr("CloseButton"),i=cr("ProgressBar");return Ve(),Wt("div",{class:Bn(e.classes),style:Or(e.draggableStyle),onClick:t[0]||(t[0]=(...o)=>e.clickHandler&&e.clickHandler(...o)),onMouseenter:t[1]||(t[1]=(...o)=>e.hoverPause&&e.hoverPause(...o)),onMouseleave:t[2]||(t[2]=(...o)=>e.hoverPlay&&e.hoverPlay(...o))},[e.icon?(Ve(),jt(n,{key:0,"custom-icon":e.icon,type:e.type},null,8,["custom-icon","type"])):Bo("v-if",!0),_s("div",{role:e.accessibility.toastRole||"alert",class:Bn(e.bodyClasses)},[typeof e.content=="string"?(Ve(),Wt(tt,{key:0},[Bi(xa(e.content),1)],2112)):(Ve(),jt(Va(e.getVueComponentFromObj(e.content)),Hi({key:1,"toast-id":e.id},e.hasProp(e.content,"props")?e.content.props:{},Bg(e.hasProp(e.content,"listeners")?e.content.listeners:{}),{onCloseToast:e.closeToast}),null,16,["toast-id","onCloseToast"]))],10,Uw),e.closeButton?(Ve(),jt(s,{key:1,component:e.closeButton,"class-names":e.closeButtonClassName,"show-on-hover":e.showCloseButtonOnHover,"aria-label":e.accessibility.closeButtonLabel,onClick:ab(e.closeToast,["stop"])},null,8,["component","class-names","show-on-hover","aria-label","onClick"])):Bo("v-if",!0),e.timeout?(Ve(),jt(i,{key:2,"is-running":e.isRunning,"hide-progress-bar":e.hideProgressBar,timeout:e.timeout,onCloseToast:e.timeoutHandler},null,8,["is-running","hide-progress-bar","timeout","onCloseToast"])):Bo("v-if",!0)],38)}Ah.render=Ww;var qw=Ah,Oh=fn({name:"VtTransition",props:En.TRANSITION,emits:["leave"],methods:{hasProp:cn,leave(e){e instanceof HTMLElement&&(e.style.left=e.offsetLeft+"px",e.style.top=e.offsetTop+"px",e.style.width=getComputedStyle(e).width,e.style.position="absolute")}}});function zw(e,t){return Ve(),jt(Z_,{tag:"div","enter-active-class":e.transition.enter?e.transition.enter:`${e.transition}-enter-active`,"move-class":e.transition.move?e.transition.move:`${e.transition}-move`,"leave-active-class":e.transition.leave?e.transition.leave:`${e.transition}-leave-active`,onLeave:e.leave},{default:Lr(()=>[jg(e.$slots,"default")]),_:3},8,["enter-active-class","move-class","leave-active-class","onLeave"])}Oh.render=zw;var Kw=Oh,xh=fn({name:"VueToastification",devtools:{hide:!0},components:{Toast:qw,VtTransition:Kw},props:Object.assign({},En.CORE_TOAST,En.CONTAINER,En.TRANSITION),data(){return{count:0,positions:Object.values(Pi),toasts:{},defaults:{}}},computed:{toastArray(){return Object.values(this.toasts)},filteredToasts(){return this.defaults.filterToasts(this.toastArray)}},beforeMount(){const e=this.eventBus;e.on(At.ADD,this.addToast),e.on(At.CLEAR,this.clearToasts),e.on(At.DISMISS,this.dismissToast),e.on(At.UPDATE,this.updateToast),e.on(At.UPDATE_DEFAULTS,this.updateDefaults),this.defaults=this.$props},mounted(){this.setup(this.container)},methods:{async setup(e){Yi(e)&&(e=await e()),uw(this.$el),e.appendChild(this.$el)},setToast(e){ls(e.id)||(this.toasts[e.id]=e)},addToast(e){e.content=fw(e.content);const t=Object.assign({},this.defaults,e.type&&this.defaults.toastDefaults&&this.defaults.toastDefaults[e.type],e),n=this.defaults.filterBeforeCreate(t,this.toastArray);n&&this.setToast(n)},dismissToast(e){const t=this.toasts[e];!ls(t)&&!ls(t.onClose)&&t.onClose(),delete this.toasts[e]},clearToasts(){Object.keys(this.toasts).forEach(e=>{this.dismissToast(e)})},getPositionToasts(e){const t=this.filteredToasts.filter(n=>n.position===e).slice(0,this.defaults.maxToasts);return this.defaults.newestOnTop?t.reverse():t},updateDefaults(e){ls(e.container)||this.setup(e.container),this.defaults=Object.assign({},this.defaults,e)},updateToast({id:e,options:t,create:n}){this.toasts[e]?(t.timeout&&t.timeout===this.toasts[e].timeout&&t.timeout++,this.setToast(Object.assign({},this.toasts[e],t))):n&&this.addToast(Object.assign({},{id:e},t))},getClasses(e){return[`${qt}__container`,e].concat(this.defaults.containerClassName)}}});function Gw(e,t){const n=cr("Toast"),s=cr("VtTransition");return Ve(),Wt("div",null,[(Ve(!0),Wt(tt,null,jc(e.positions,i=>(Ve(),Wt("div",{key:i},[nt(s,{transition:e.defaults.transition,class:Bn(e.getClasses(i))},{default:Lr(()=>[(Ve(!0),Wt(tt,null,jc(e.getPositionToasts(i),o=>(Ve(),jt(n,Hi({key:o.id},o),null,16))),128))]),_:2},1032,["transition","class"])]))),128))])}xh.render=Gw;var Jw=xh,ef=(e={},t=!0)=>{const n=e.eventBus=e.eventBus||new Za;t&&Pr(()=>{const o=Td(Jw,dh({},e)),a=o.mount(document.createElement("div")),c=e.onMounted;if(ls(c)||c(a,o),e.shareAppContext){const f=e.shareAppContext;f===!0?console.warn(`[${qt}] App to share context with was not provided.`):(o._context.components=f._context.components,o._context.directives=f._context.directives,o._context.mixins=f._context.mixins,o._context.provides=f._context.provides,o.config.globalProperties=f.config.globalProperties)}});const s=(o,a)=>{const c=Object.assign({},{id:cw(),type:St.DEFAULT},a,{content:o});return n.emit(At.ADD,c),c.id};s.clear=()=>n.emit(At.CLEAR,void 0),s.updateDefaults=o=>{n.emit(At.UPDATE_DEFAULTS,o)},s.dismiss=o=>{n.emit(At.DISMISS,o)};function i(o,{content:a,options:c},f=!1){const p=Object.assign({},c,{content:a});n.emit(At.UPDATE,{id:o,options:p,create:f})}return s.update=i,s.success=(o,a)=>s(o,Object.assign({},a,{type:St.SUCCESS})),s.info=(o,a)=>s(o,Object.assign({},a,{type:St.INFO})),s.error=(o,a)=>s(o,Object.assign({},a,{type:St.ERROR})),s.warning=(o,a)=>s(o,Object.assign({},a,{type:St.WARNING})),s},Xw=()=>{const e=()=>console.warn(`[${qt}] This plugin does not support SSR!`);return new Proxy(e,{get(){return e}})};function Rh(e){return dw()?hw(e)?ef({eventBus:e},!1):ef(e,!0):Xw()}var Ph=Symbol("VueToastification"),Lh=new Za,Qw=(e,t)=>{(t==null?void 0:t.shareAppContext)===!0&&(t.shareAppContext=e);const n=Rh(dh({eventBus:Lh},t));e.provide(Ph,n)},f0=e=>{const t=dd()?xt(Ph,void 0):void 0;return t||Rh(Lh)},Yw=Qw,Zw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function d0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var e0={exports:{}};/*! +`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ms(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:o}=n;s!==void 0&&va.assertOptions(s,{silentJSONParsing:Ln.transitional(Ln.boolean),forcedJSONParsing:Ln.transitional(Ln.boolean),clarifyTimeoutError:Ln.transitional(Ln.boolean)},!1),i!=null&&(S.isFunction(i)?n.paramsSerializer={serialize:i}:va.assertOptions(i,{encode:Ln.function,serialize:Ln.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&S.merge(o.common,o[n.method]);o&&S.forEach(["delete","get","head","post","put","patch","common"],C=>{delete o[C]}),n.headers=yt.concat(a,o);const c=[];let f=!0;this.interceptors.request.forEach(function(P){typeof P.runWhen=="function"&&P.runWhen(n)===!1||(f=f&&P.synchronous,c.unshift(P.fulfilled,P.rejected))});const p=[];this.interceptors.response.forEach(function(P){p.push(P.fulfilled,P.rejected)});let d,m=0,b;if(!f){const C=[zu.bind(this),void 0];for(C.unshift.apply(C,c),C.push.apply(C,p),b=C.length,d=Promise.resolve(n);m{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{s.subscribe(c),o=c}).then(i);return a.cancel=function(){s.unsubscribe(o)},a},t(function(o,a,c){s.reason||(s.reason=new Ks(o,a,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ya(function(i){t=i}),cancel:t}}}function Qv(e){return function(n){return e.apply(null,n)}}function Yv(e){return S.isObject(e)&&e.isAxiosError===!0}const wa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wa).forEach(([e,t])=>{wa[t]=e});function uh(e){const t=new fs(e),n=Hd(fs.prototype.request,t);return S.extend(n,fs.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return uh(ms(e,i))},n}const Ke=uh(Nr);Ke.Axios=fs;Ke.CanceledError=Ks;Ke.CancelToken=Ya;Ke.isCancel=nh;Ke.VERSION=ch;Ke.toFormData=Xi;Ke.AxiosError=de;Ke.Cancel=Ke.CanceledError;Ke.all=function(t){return Promise.all(t)};Ke.spread=Qv;Ke.isAxiosError=Yv;Ke.mergeConfig=ms;Ke.AxiosHeaders=yt;Ke.formToJSON=e=>th(S.isHTMLForm(e)?new FormData(e):e);Ke.getAdapter=lh.getAdapter;Ke.HttpStatusCode=wa;Ke.default=Ke;const Zv="modulepreload",ew=function(e){return"/"+e},Gu={},is=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(c=>{if(c=ew(c),c in Gu)return;Gu[c]=!0;const f=c.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const d=document.createElement("link");if(d.rel=f?"stylesheet":Zv,f||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),f)return new Promise((m,b)=>{d.addEventListener("load",m),d.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}return i.then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})},fh=wy({history:Xb(),routes:[{path:"/",name:"home",redirect:"/web/softwareCatalog"},{path:"/web",name:"rootOssList",component:()=>is(()=>import("./OssList-CUqe4g5_.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/web/oss/list",name:"ossList",component:()=>is(()=>import("./OssList-CUqe4g5_.js"),__vite__mapDeps([0,1,2,3,4,5]))},{path:"/web/generate/yaml",name:"yamlGenerate",component:()=>is(()=>import("./YamlGenerate-Wt35UcvC.js"),__vite__mapDeps([6,5,7,8]))},{path:"/web/repository/list",name:"repositoryList",component:()=>is(()=>import("./RepositoryList-BkyTcYpV.js"),__vite__mapDeps([9,10,1,2,3,4,11,5]))},{path:"/web/repository/detail/:repositoryName",name:"repositoryDetail",component:()=>is(()=>import("./RepositoryDetail-Dsfw98Ui.js"),__vite__mapDeps([12,13,11,5,14,3,4]))},{path:"/web/softwareCatalog",name:"softwareCatalog",component:()=>is(()=>import("./SoftwareCatalog-C-Fozz0b.js"),__vite__mapDeps([15,2,16,14,5,7,17,3,4,10,1,11,13,18]))},{path:"/web/softwareCatalog/list/test",name:"softwareCatalogListTest",component:()=>is(()=>import("./SoftwareCatalogListTest-DjCbxOSW.js"),__vite__mapDeps([19,2,16,14,5,7,17,20]))}]}),tw=yb("user",{state:()=>({accessToken:"",workspaceInfo:{id:"",name:"",description:"",created_at:"",updated_at:""},projectInfo:{id:"",ns_id:"",mci_id:"",cluster_id:"",name:"",description:"",created_at:"",updated_at:""},operationId:""}),actions:{setUser(e){this.accessToken=e.accessToken,this.workspaceInfo=e.workspaceInfo,this.projectInfo=e.projectInfo,this.operationId=e.operationId},getNsId(){return this.projectInfo.ns_id},clearUser(){this.accessToken=null,this.workspaceInfo=null,this.projectInfo=null,this.operationId=null}}});fh.beforeEach(async(e,t,n)=>{window.addEventListener("message",async function(s){let i;console.log("## event.data.accessToken ### : ",s.data.accessToken),s.data.accessToken===void 0||s.data.accessToken==="undefined"?(console.log("## event.data.accessToken is undefined ### : "),i={accessToken:"accesstokenExample",workspaceInfo:{id:"8b2df1f9-b937-4861-b5ce-855a41c346bc",name:"workspace2",description:"workspace2 desc",created_at:"2024-06-18T00:10:16.192337Z",updated_at:"2024-06-18T00:10:16.192337Z"},projectInfo:{id:"1e88f4ea-d052-4314-80a4-9ac3f6691feb",ns_id:"ns01",mci_id:"mci01",cluster_id:"cluster01",name:"ns01",description:"ns01 desc",created_at:"2024-06-18T00:28:57.094105Z",updated_at:"2024-06-18T00:28:57.094105Z"},operationId:"op1"}):(console.log("## event.data.accessToken is not undefined ### : "),i=s.data);try{console.log("## data ### : ",i),tw().setUser(i)}catch(o){console.error("Error in processing message:",o)}}),n()});const nw=e=>{const t=e==null?void 0:e.trim();if(!t)return window.location.origin;try{const n=new URL(t),s=new Set(["localhost","127.0.0.1","::1"]);if(s.has(n.hostname)&&!s.has(window.location.hostname))return window.location.origin}catch{return t}return t!=null&&t.startsWith("http://")&&window.location.protocol==="https:"?window.location.origin:t},u0=e=>e?/^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(e)||e.startsWith("data:")?e:`${window.location.origin}${e.startsWith("/")?"":"/"}${e}`:"";var sw=Object.defineProperty,Ju=Object.getOwnPropertySymbols,rw=Object.prototype.hasOwnProperty,iw=Object.prototype.propertyIsEnumerable,Xu=(e,t,n)=>t in e?sw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dh=(e,t)=>{for(var n in t||(t={}))rw.call(t,n)&&Xu(e,n,t[n]);if(Ju)for(var n of Ju(t))iw.call(t,n)&&Xu(e,n,t[n]);return e},Yi=e=>typeof e=="function",Zi=e=>typeof e=="string",hh=e=>Zi(e)&&e.trim().length>0,ow=e=>typeof e=="number",ls=e=>typeof e>"u",Sr=e=>typeof e=="object"&&e!==null,aw=e=>cn(e,"tag")&&hh(e.tag),ph=e=>window.TouchEvent&&e instanceof TouchEvent,mh=e=>cn(e,"component")&&gh(e.component),lw=e=>Yi(e)||Sr(e),gh=e=>!ls(e)&&(Zi(e)||lw(e)||mh(e)),Qu=e=>Sr(e)&&["height","width","right","left","top","bottom"].every(t=>ow(e[t])),cn=(e,t)=>(Sr(e)||Yi(e))&&t in e,cw=(e=>()=>e++)(0);function Yo(e){return ph(e)?e.targetTouches[0].clientX:e.clientX}function Yu(e){return ph(e)?e.targetTouches[0].clientY:e.clientY}var uw=e=>{ls(e.remove)?e.parentNode&&e.parentNode.removeChild(e):e.remove()},kr=e=>mh(e)?kr(e.component):aw(e)?fn({render(){return e}}):typeof e=="string"?e:Ee(Fn(e)),fw=e=>{if(typeof e=="string")return e;const t=cn(e,"props")&&Sr(e.props)?e.props:{},n=cn(e,"listeners")&&Sr(e.listeners)?e.listeners:{};return{component:kr(e),props:t,listeners:n}},dw=()=>typeof window<"u",Za=class{constructor(){this.allHandlers={}}getHandlers(e){return this.allHandlers[e]||[]}on(e,t){const n=this.getHandlers(e);n.push(t),this.allHandlers[e]=n}off(e,t){const n=this.getHandlers(e);n.splice(n.indexOf(t)>>>0,1)}emit(e,t){this.getHandlers(e).forEach(s=>s(t))}},hw=e=>["on","off","emit"].every(t=>cn(e,t)&&Yi(e[t])),St;(function(e){e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.DEFAULT="default"})(St||(St={}));var Pi;(function(e){e.TOP_LEFT="top-left",e.TOP_CENTER="top-center",e.TOP_RIGHT="top-right",e.BOTTOM_LEFT="bottom-left",e.BOTTOM_CENTER="bottom-center",e.BOTTOM_RIGHT="bottom-right"})(Pi||(Pi={}));var At;(function(e){e.ADD="add",e.DISMISS="dismiss",e.UPDATE="update",e.CLEAR="clear",e.UPDATE_DEFAULTS="update_defaults"})(At||(At={}));var qt="Vue-Toastification",Ut={type:{type:String,default:St.DEFAULT},classNames:{type:[String,Array],default:()=>[]},trueBoolean:{type:Boolean,default:!0}},_h={type:Ut.type,customIcon:{type:[String,Boolean,Object,Function],default:!0}},bi={component:{type:[String,Object,Function,Boolean],default:"button"},classNames:Ut.classNames,showOnHover:{type:Boolean,default:!1},ariaLabel:{type:String,default:"close"}},Ea={timeout:{type:[Number,Boolean],default:5e3},hideProgressBar:{type:Boolean,default:!1},isRunning:{type:Boolean,default:!1}},bh={transition:{type:[Object,String],default:`${qt}__bounce`}},pw={position:{type:String,default:Pi.TOP_RIGHT},draggable:Ut.trueBoolean,draggablePercent:{type:Number,default:.6},pauseOnFocusLoss:Ut.trueBoolean,pauseOnHover:Ut.trueBoolean,closeOnClick:Ut.trueBoolean,timeout:Ea.timeout,hideProgressBar:Ea.hideProgressBar,toastClassName:Ut.classNames,bodyClassName:Ut.classNames,icon:_h.customIcon,closeButton:bi.component,closeButtonClassName:bi.classNames,showCloseButtonOnHover:bi.showOnHover,accessibility:{type:Object,default:()=>({toastRole:"alert",closeButtonLabel:"close"})},rtl:{type:Boolean,default:!1},eventBus:{type:Object,required:!1,default:()=>new Za}},mw={id:{type:[String,Number],required:!0,default:0},type:Ut.type,content:{type:[String,Object,Function],required:!0,default:""},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0}},gw={container:{type:[Object,Function],default:()=>document.body},newestOnTop:Ut.trueBoolean,maxToasts:{type:Number,default:20},transition:bh.transition,toastDefaults:Object,filterBeforeCreate:{type:Function,default:e=>e},filterToasts:{type:Function,default:e=>e},containerClassName:Ut.classNames,onMounted:Function,shareAppContext:[Boolean,Object]},En={CORE_TOAST:pw,TOAST:mw,CONTAINER:gw,PROGRESS_BAR:Ea,ICON:_h,TRANSITION:bh,CLOSE_BUTTON:bi},yh=fn({name:"VtProgressBar",props:En.PROGRESS_BAR,data(){return{hasClass:!0}},computed:{style(){return{animationDuration:`${this.timeout}ms`,animationPlayState:this.isRunning?"running":"paused",opacity:this.hideProgressBar?0:1}},cpClass(){return this.hasClass?`${qt}__progress-bar`:""}},watch:{timeout(){this.hasClass=!1,this.$nextTick(()=>this.hasClass=!0)}},mounted(){this.$el.addEventListener("animationend",this.animationEnded)},beforeUnmount(){this.$el.removeEventListener("animationend",this.animationEnded)},methods:{animationEnded(){this.$emit("close-toast")}}});function _w(e,t){return Ve(),Wt("div",{style:Or(e.style),class:Bn(e.cpClass)},null,6)}yh.render=_w;var bw=yh,vh=fn({name:"VtCloseButton",props:En.CLOSE_BUTTON,computed:{buttonComponent(){return this.component!==!1?kr(this.component):"button"},classes(){const e=[`${qt}__close-button`];return this.showOnHover&&e.push("show-on-hover"),e.concat(this.classNames)}}}),yw=Bi(" × ");function vw(e,t){return Ve(),jt(Va(e.buttonComponent),Hi({"aria-label":e.ariaLabel,class:e.classes},e.$attrs),{default:Lr(()=>[yw]),_:1},16,["aria-label","class"])}vh.render=vw;var ww=vh,wh={},Ew={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"check-circle",class:"svg-inline--fa fa-check-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Cw=_s("path",{fill:"currentColor",d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},null,-1),Tw=[Cw];function Sw(e,t){return Ve(),Wt("svg",Ew,Tw)}wh.render=Sw;var Aw=wh,Eh={},Ow={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"info-circle",class:"svg-inline--fa fa-info-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},xw=_s("path",{fill:"currentColor",d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},null,-1),Rw=[xw];function Pw(e,t){return Ve(),Wt("svg",Ow,Rw)}Eh.render=Pw;var Zu=Eh,Ch={},Lw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-circle",class:"svg-inline--fa fa-exclamation-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Iw=_s("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),Dw=[Iw];function Nw(e,t){return Ve(),Wt("svg",Lw,Dw)}Ch.render=Nw;var kw=Ch,Th={},Mw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-triangle",class:"svg-inline--fa fa-exclamation-triangle fa-w-18",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},$w=_s("path",{fill:"currentColor",d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),Fw=[$w];function jw(e,t){return Ve(),Wt("svg",Mw,Fw)}Th.render=jw;var Bw=Th,Sh=fn({name:"VtIcon",props:En.ICON,computed:{customIconChildren(){return cn(this.customIcon,"iconChildren")?this.trimValue(this.customIcon.iconChildren):""},customIconClass(){return Zi(this.customIcon)?this.trimValue(this.customIcon):cn(this.customIcon,"iconClass")?this.trimValue(this.customIcon.iconClass):""},customIconTag(){return cn(this.customIcon,"iconTag")?this.trimValue(this.customIcon.iconTag,"i"):"i"},hasCustomIcon(){return this.customIconClass.length>0},component(){return this.hasCustomIcon?this.customIconTag:gh(this.customIcon)?kr(this.customIcon):this.iconTypeComponent},iconTypeComponent(){return{[St.DEFAULT]:Zu,[St.INFO]:Zu,[St.SUCCESS]:Aw,[St.ERROR]:Bw,[St.WARNING]:kw}[this.type]},iconClasses(){const e=[`${qt}__icon`];return this.hasCustomIcon?e.concat(this.customIconClass):e}},methods:{trimValue(e,t=""){return hh(e)?e.trim():t}}});function Hw(e,t){return Ve(),jt(Va(e.component),{class:Bn(e.iconClasses)},{default:Lr(()=>[Bi(xa(e.customIconChildren),1)]),_:1},8,["class"])}Sh.render=Hw;var Vw=Sh,Ah=fn({name:"VtToast",components:{ProgressBar:bw,CloseButton:ww,Icon:Vw},inheritAttrs:!1,props:Object.assign({},En.CORE_TOAST,En.TOAST),data(){return{isRunning:!0,disableTransitions:!1,beingDragged:!1,dragStart:0,dragPos:{x:0,y:0},dragRect:{}}},computed:{classes(){const e=[`${qt}__toast`,`${qt}__toast--${this.type}`,`${this.position}`].concat(this.toastClassName);return this.disableTransitions&&e.push("disable-transition"),this.rtl&&e.push(`${qt}__toast--rtl`),e},bodyClasses(){return[`${qt}__toast-${Zi(this.content)?"body":"component-body"}`].concat(this.bodyClassName)},draggableStyle(){return this.dragStart===this.dragPos.x?{}:this.beingDragged?{transform:`translateX(${this.dragDelta}px)`,opacity:1-Math.abs(this.dragDelta/this.removalDistance)}:{transition:"transform 0.2s, opacity 0.2s",transform:"translateX(0)",opacity:1}},dragDelta(){return this.beingDragged?this.dragPos.x-this.dragStart:0},removalDistance(){return Qu(this.dragRect)?(this.dragRect.right-this.dragRect.left)*this.draggablePercent:0}},mounted(){this.draggable&&this.draggableSetup(),this.pauseOnFocusLoss&&this.focusSetup()},beforeUnmount(){this.draggable&&this.draggableCleanup(),this.pauseOnFocusLoss&&this.focusCleanup()},methods:{hasProp:cn,getVueComponentFromObj:kr,closeToast(){this.eventBus.emit(At.DISMISS,this.id)},clickHandler(){this.onClick&&this.onClick(this.closeToast),this.closeOnClick&&(!this.beingDragged||this.dragStart===this.dragPos.x)&&this.closeToast()},timeoutHandler(){this.closeToast()},hoverPause(){this.pauseOnHover&&(this.isRunning=!1)},hoverPlay(){this.pauseOnHover&&(this.isRunning=!0)},focusPause(){this.isRunning=!1},focusPlay(){this.isRunning=!0},focusSetup(){addEventListener("blur",this.focusPause),addEventListener("focus",this.focusPlay)},focusCleanup(){removeEventListener("blur",this.focusPause),removeEventListener("focus",this.focusPlay)},draggableSetup(){const e=this.$el;e.addEventListener("touchstart",this.onDragStart,{passive:!0}),e.addEventListener("mousedown",this.onDragStart),addEventListener("touchmove",this.onDragMove,{passive:!1}),addEventListener("mousemove",this.onDragMove),addEventListener("touchend",this.onDragEnd),addEventListener("mouseup",this.onDragEnd)},draggableCleanup(){const e=this.$el;e.removeEventListener("touchstart",this.onDragStart),e.removeEventListener("mousedown",this.onDragStart),removeEventListener("touchmove",this.onDragMove),removeEventListener("mousemove",this.onDragMove),removeEventListener("touchend",this.onDragEnd),removeEventListener("mouseup",this.onDragEnd)},onDragStart(e){this.beingDragged=!0,this.dragPos={x:Yo(e),y:Yu(e)},this.dragStart=Yo(e),this.dragRect=this.$el.getBoundingClientRect()},onDragMove(e){this.beingDragged&&(e.preventDefault(),this.isRunning&&(this.isRunning=!1),this.dragPos={x:Yo(e),y:Yu(e)})},onDragEnd(){this.beingDragged&&(Math.abs(this.dragDelta)>=this.removalDistance?(this.disableTransitions=!0,this.$nextTick(()=>this.closeToast())):setTimeout(()=>{this.beingDragged=!1,Qu(this.dragRect)&&this.pauseOnHover&&this.dragRect.bottom>=this.dragPos.y&&this.dragPos.y>=this.dragRect.top&&this.dragRect.left<=this.dragPos.x&&this.dragPos.x<=this.dragRect.right?this.isRunning=!1:this.isRunning=!0}))}}}),Uw=["role"];function Ww(e,t){const n=cr("Icon"),s=cr("CloseButton"),i=cr("ProgressBar");return Ve(),Wt("div",{class:Bn(e.classes),style:Or(e.draggableStyle),onClick:t[0]||(t[0]=(...o)=>e.clickHandler&&e.clickHandler(...o)),onMouseenter:t[1]||(t[1]=(...o)=>e.hoverPause&&e.hoverPause(...o)),onMouseleave:t[2]||(t[2]=(...o)=>e.hoverPlay&&e.hoverPlay(...o))},[e.icon?(Ve(),jt(n,{key:0,"custom-icon":e.icon,type:e.type},null,8,["custom-icon","type"])):Bo("v-if",!0),_s("div",{role:e.accessibility.toastRole||"alert",class:Bn(e.bodyClasses)},[typeof e.content=="string"?(Ve(),Wt(tt,{key:0},[Bi(xa(e.content),1)],2112)):(Ve(),jt(Va(e.getVueComponentFromObj(e.content)),Hi({key:1,"toast-id":e.id},e.hasProp(e.content,"props")?e.content.props:{},Bg(e.hasProp(e.content,"listeners")?e.content.listeners:{}),{onCloseToast:e.closeToast}),null,16,["toast-id","onCloseToast"]))],10,Uw),e.closeButton?(Ve(),jt(s,{key:1,component:e.closeButton,"class-names":e.closeButtonClassName,"show-on-hover":e.showCloseButtonOnHover,"aria-label":e.accessibility.closeButtonLabel,onClick:ab(e.closeToast,["stop"])},null,8,["component","class-names","show-on-hover","aria-label","onClick"])):Bo("v-if",!0),e.timeout?(Ve(),jt(i,{key:2,"is-running":e.isRunning,"hide-progress-bar":e.hideProgressBar,timeout:e.timeout,onCloseToast:e.timeoutHandler},null,8,["is-running","hide-progress-bar","timeout","onCloseToast"])):Bo("v-if",!0)],38)}Ah.render=Ww;var qw=Ah,Oh=fn({name:"VtTransition",props:En.TRANSITION,emits:["leave"],methods:{hasProp:cn,leave(e){e instanceof HTMLElement&&(e.style.left=e.offsetLeft+"px",e.style.top=e.offsetTop+"px",e.style.width=getComputedStyle(e).width,e.style.position="absolute")}}});function zw(e,t){return Ve(),jt(Z_,{tag:"div","enter-active-class":e.transition.enter?e.transition.enter:`${e.transition}-enter-active`,"move-class":e.transition.move?e.transition.move:`${e.transition}-move`,"leave-active-class":e.transition.leave?e.transition.leave:`${e.transition}-leave-active`,onLeave:e.leave},{default:Lr(()=>[jg(e.$slots,"default")]),_:3},8,["enter-active-class","move-class","leave-active-class","onLeave"])}Oh.render=zw;var Kw=Oh,xh=fn({name:"VueToastification",devtools:{hide:!0},components:{Toast:qw,VtTransition:Kw},props:Object.assign({},En.CORE_TOAST,En.CONTAINER,En.TRANSITION),data(){return{count:0,positions:Object.values(Pi),toasts:{},defaults:{}}},computed:{toastArray(){return Object.values(this.toasts)},filteredToasts(){return this.defaults.filterToasts(this.toastArray)}},beforeMount(){const e=this.eventBus;e.on(At.ADD,this.addToast),e.on(At.CLEAR,this.clearToasts),e.on(At.DISMISS,this.dismissToast),e.on(At.UPDATE,this.updateToast),e.on(At.UPDATE_DEFAULTS,this.updateDefaults),this.defaults=this.$props},mounted(){this.setup(this.container)},methods:{async setup(e){Yi(e)&&(e=await e()),uw(this.$el),e.appendChild(this.$el)},setToast(e){ls(e.id)||(this.toasts[e.id]=e)},addToast(e){e.content=fw(e.content);const t=Object.assign({},this.defaults,e.type&&this.defaults.toastDefaults&&this.defaults.toastDefaults[e.type],e),n=this.defaults.filterBeforeCreate(t,this.toastArray);n&&this.setToast(n)},dismissToast(e){const t=this.toasts[e];!ls(t)&&!ls(t.onClose)&&t.onClose(),delete this.toasts[e]},clearToasts(){Object.keys(this.toasts).forEach(e=>{this.dismissToast(e)})},getPositionToasts(e){const t=this.filteredToasts.filter(n=>n.position===e).slice(0,this.defaults.maxToasts);return this.defaults.newestOnTop?t.reverse():t},updateDefaults(e){ls(e.container)||this.setup(e.container),this.defaults=Object.assign({},this.defaults,e)},updateToast({id:e,options:t,create:n}){this.toasts[e]?(t.timeout&&t.timeout===this.toasts[e].timeout&&t.timeout++,this.setToast(Object.assign({},this.toasts[e],t))):n&&this.addToast(Object.assign({},{id:e},t))},getClasses(e){return[`${qt}__container`,e].concat(this.defaults.containerClassName)}}});function Gw(e,t){const n=cr("Toast"),s=cr("VtTransition");return Ve(),Wt("div",null,[(Ve(!0),Wt(tt,null,jc(e.positions,i=>(Ve(),Wt("div",{key:i},[nt(s,{transition:e.defaults.transition,class:Bn(e.getClasses(i))},{default:Lr(()=>[(Ve(!0),Wt(tt,null,jc(e.getPositionToasts(i),o=>(Ve(),jt(n,Hi({key:o.id},o),null,16))),128))]),_:2},1032,["transition","class"])]))),128))])}xh.render=Gw;var Jw=xh,ef=(e={},t=!0)=>{const n=e.eventBus=e.eventBus||new Za;t&&Pr(()=>{const o=Td(Jw,dh({},e)),a=o.mount(document.createElement("div")),c=e.onMounted;if(ls(c)||c(a,o),e.shareAppContext){const f=e.shareAppContext;f===!0?console.warn(`[${qt}] App to share context with was not provided.`):(o._context.components=f._context.components,o._context.directives=f._context.directives,o._context.mixins=f._context.mixins,o._context.provides=f._context.provides,o.config.globalProperties=f.config.globalProperties)}});const s=(o,a)=>{const c=Object.assign({},{id:cw(),type:St.DEFAULT},a,{content:o});return n.emit(At.ADD,c),c.id};s.clear=()=>n.emit(At.CLEAR,void 0),s.updateDefaults=o=>{n.emit(At.UPDATE_DEFAULTS,o)},s.dismiss=o=>{n.emit(At.DISMISS,o)};function i(o,{content:a,options:c},f=!1){const p=Object.assign({},c,{content:a});n.emit(At.UPDATE,{id:o,options:p,create:f})}return s.update=i,s.success=(o,a)=>s(o,Object.assign({},a,{type:St.SUCCESS})),s.info=(o,a)=>s(o,Object.assign({},a,{type:St.INFO})),s.error=(o,a)=>s(o,Object.assign({},a,{type:St.ERROR})),s.warning=(o,a)=>s(o,Object.assign({},a,{type:St.WARNING})),s},Xw=()=>{const e=()=>console.warn(`[${qt}] This plugin does not support SSR!`);return new Proxy(e,{get(){return e}})};function Rh(e){return dw()?hw(e)?ef({eventBus:e},!1):ef(e,!0):Xw()}var Ph=Symbol("VueToastification"),Lh=new Za,Qw=(e,t)=>{(t==null?void 0:t.shareAppContext)===!0&&(t.shareAppContext=e);const n=Rh(dh({eventBus:Lh},t));e.provide(Ph,n)},f0=e=>{const t=dd()?xt(Ph,void 0):void 0;return t||Rh(Lh)},Yw=Qw,Zw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function d0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var e0={exports:{}};/*! * Bootstrap v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) diff --git a/src/main/resources/static/assets/lodash-l7l6TB3A.js b/src/main/resources/static/assets/lodash-CMOUKIpU.js similarity index 99% rename from src/main/resources/static/assets/lodash-l7l6TB3A.js rename to src/main/resources/static/assets/lodash-CMOUKIpU.js index bd45ee55..101cf909 100644 --- a/src/main/resources/static/assets/lodash-l7l6TB3A.js +++ b/src/main/resources/static/assets/lodash-CMOUKIpU.js @@ -1,4 +1,4 @@ -import{M as jt,N as rp}from"./index-DgPLCZcu.js";var Je={exports:{}};/** +import{M as jt,N as rp}from"./index-nMoWjTPe.js";var Je={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors diff --git a/src/main/resources/static/assets/repository-DPypbfWU.js b/src/main/resources/static/assets/repository-0d7heipW.js similarity index 89% rename from src/main/resources/static/assets/repository-DPypbfWU.js rename to src/main/resources/static/assets/repository-0d7heipW.js index 55cbe7f3..cedfa9ab 100644 --- a/src/main/resources/static/assets/repository-DPypbfWU.js +++ b/src/main/resources/static/assets/repository-0d7heipW.js @@ -1 +1 @@ -import{s}from"./request-D5nUjUnA.js";const n=e=>s.get(`/oss/v1/repositories/${e}/list`);function i(e,t){return s.delete(`/oss/v1/repositories/${e}/delete/${t}`)}function p(e,t){return s.post(`/oss/v1/repositories/${e}/create`,t)}const a=(e,t)=>s.get(`/oss/v1/repositories/${e}/detail/${t}`),u=(e,t)=>s.put(`/oss/v1/repositories/${e}/update`,t);function c(e,t){return s.delete(`/oss/v1/components/${e}/delete/${t}`)}const $=(e,t)=>s.get(`/oss/v1/components/${e}/list/${t}`),d=(e,t,o)=>s.post(`/oss/v1/components/${e}/create/${t}`,o);export{n as a,c as b,d as c,i as d,$ as e,a as g,p as r,u}; +import{s}from"./request-BXz87ydW.js";const n=e=>s.get(`/oss/v1/repositories/${e}/list`);function i(e,t){return s.delete(`/oss/v1/repositories/${e}/delete/${t}`)}function p(e,t){return s.post(`/oss/v1/repositories/${e}/create`,t)}const a=(e,t)=>s.get(`/oss/v1/repositories/${e}/detail/${t}`),u=(e,t)=>s.put(`/oss/v1/repositories/${e}/update`,t);function c(e,t){return s.delete(`/oss/v1/components/${e}/delete/${t}`)}const $=(e,t)=>s.get(`/oss/v1/components/${e}/list/${t}`),d=(e,t,o)=>s.post(`/oss/v1/components/${e}/create/${t}`,o);export{n as a,c as b,d as c,i as d,$ as e,a as g,p as r,u}; diff --git a/src/main/resources/static/assets/request-D5nUjUnA.js b/src/main/resources/static/assets/request-BXz87ydW.js similarity index 88% rename from src/main/resources/static/assets/request-D5nUjUnA.js rename to src/main/resources/static/assets/request-BXz87ydW.js index bbb87280..52e632fa 100644 --- a/src/main/resources/static/assets/request-D5nUjUnA.js +++ b/src/main/resources/static/assets/request-BXz87ydW.js @@ -1 +1 @@ -import{J as n,u as a,K as r}from"./index-DgPLCZcu.js";const i=n("http://127.0.0.1:18084"),t=a(),o=r.create({baseURL:i,timeout:3e5});o.interceptors.request.use(e=>e,e=>(console.log("error ---------- ",e),Promise.reject(e)));o.interceptors.response.use(e=>{const s=e.data;return s.code===200?s:(t.error(s.detail),Promise.reject(new Error(s.message||"Error")))},e=>{console.log("ApiService.Response -> fail",e);const s=e.response;return console.log(e.response),(s==null?void 0:s.status)===404&&t.error("API Call Fail :: Code 404"),r.isCancel(e),Promise.reject(e)});export{o as s}; +import{J as n,u as a,K as r}from"./index-nMoWjTPe.js";const i=n("http://127.0.0.1:18084"),t=a(),o=r.create({baseURL:i,timeout:3e5});o.interceptors.request.use(e=>e,e=>(console.log("error ---------- ",e),Promise.reject(e)));o.interceptors.response.use(e=>{const s=e.data;return s.code===200?s:(t.error(s.detail),Promise.reject(new Error(s.message||"Error")))},e=>{console.log("ApiService.Response -> fail",e);const s=e.response;return console.log(e.response),(s==null?void 0:s.status)===404&&t.error("API Call Fail :: Code 404"),r.isCancel(e),Promise.reject(e)});export{o as s}; diff --git a/src/main/resources/static/assets/softwareCatalogForm-BVdBVBiW.css b/src/main/resources/static/assets/softwareCatalogForm-7J7U2k9n.css similarity index 60% rename from src/main/resources/static/assets/softwareCatalogForm-BVdBVBiW.css rename to src/main/resources/static/assets/softwareCatalogForm-7J7U2k9n.css index ca0770eb..80c39ffe 100644 --- a/src/main/resources/static/assets/softwareCatalogForm-BVdBVBiW.css +++ b/src/main/resources/static/assets/softwareCatalogForm-7J7U2k9n.css @@ -1 +1 @@ -.w-80-per[data-v-6594bb78]{width:80%!important}.w-90-per[data-v-6594bb78]{width:90%!important}.input-form[data-v-f2edc4ae]{width:100%!important;display:flex;gap:10px;margin-bottom:10px}.w-50-per[data-v-f2edc4ae]{width:50%!important}.w-80-per[data-v-f2edc4ae]{width:80%!important}.w-90-per[data-v-f2edc4ae]{width:90%!important} +.w-80-per[data-v-6481d580]{width:80%!important}.w-90-per[data-v-6481d580]{width:90%!important}.input-form[data-v-f2edc4ae]{width:100%!important;display:flex;gap:10px;margin-bottom:10px}.w-50-per[data-v-f2edc4ae]{width:50%!important}.w-80-per[data-v-f2edc4ae]{width:80%!important}.w-90-per[data-v-f2edc4ae]{width:90%!important} diff --git a/src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-DuIt1swN.js b/src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-DuIt1swN.js new file mode 100644 index 00000000..23aad00d --- /dev/null +++ b/src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-DuIt1swN.js @@ -0,0 +1,6 @@ +import{c as el}from"./IconPlus-0MYkWKdM.js";import{J as ll,K as al,d as tl,u as sl,C as nl,c as h,r as v,w as se,o as ol,a as n,b as a,t as b,j as g,e as i,v as V,F as U,f as M,y as Ie,g as w,n as Ee,z as X,l as me,h as o}from"./index-nMoWjTPe.js";import{_ as $}from"./lodash-CMOUKIpU.js";import{s as u}from"./request-BXz87ydW.js";import{_ as il}from"./_plugin-vue_export-helper-DlAUqK2U.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var ct=el("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);const ul=()=>u.get("/cbtumblebug/ns"),xe=s=>u.get(`/cbtumblebug/ns/${s}/infra`),rl=s=>u.get(`/cbtumblebug/ns/${s.nsId}/infra/${s.mciId}`),cl=s=>u.get(`/cbtumblebug/ns/${s}/k8scluster`),dl=ll("http://127.0.0.1:18084").replace(/\/$/,""),vl=[90,30,7],pl=s=>{const p=String((s==null?void 0:s.detail)||"");return p.includes("No static resource")&&p.includes("/policy-recommendation/analyze")},ml=s=>u.get(`/catalog/software?name=${s}`),dt=s=>u.get(`/catalog/software/${s}`),vt=s=>u.get(`/search/dockerhub/${s}`),pt=s=>u.get(`/search/artifacthub/${s}`),fl=s=>u.post("/applications/vm/deploy",s),Ve=s=>u.post("/applications/action",s),bl=s=>u.post("/applications/k8s/deploy",s),gl=s=>u.post("/applications/k8s/object-storage/smoke-check",s),yl=s=>u.get(`/applications/k8s/storage-classes?namespace=${s.namespace}&clusterName=${s.clusterName}`),hl=s=>u.get(`/applications/vm/check?namespace=${s.namespace}&mciId=${s.mciName}&vmId=${s.vmName}&catalogId=${s.catalogId}`),kl=s=>u.get(`/applications/k8s/check?namespace=${s.namespace}&clusterName=${s.clusterName}&catalogId=${s.catalogId}`),mt=s=>u.get(`/ape/log/${s}`);function ft(s){return u.post("/catalog/software",s)}function bt(s){return u.put(`/catalog/software/${s.id}`,s)}function gt(s){return u.delete(`/catalog/software/${s}`)}function yt(){return u.get("/api/applications/status/groups")}function ht(s){return u.get(`/api/applications/integrated/catalog/${s}`)}function kt(s){return u.post("/catalog/application/category",s)}function Ct(s){return u.post("/catalog/application/package",s)}function St(s){const p={target:s.target,applicationName:s.packageName};return u.post("/catalog/application/package/version",p)}function wt(s){return u.get(`/search/dockerhub/tag/${s.path}`)}function It(s){return u.get(`/search/artifacthub/version/${s.kind}/${s.repository}/${s.packageName}`)}function Et(s){return u.post("/catalog/docker/register",s)}function xt(s){return u.post("/catalog/helm/register",s)}function Vt(s){return u.post("/catalog/rating/overall",s)}function Ut(s){return u.get(`/api/applications/integrated/deployment/${s}`)}function Cl(s,p=14){return u.post(`/api/applications/${s}/operation-profile/analyze?days=${p}`)}async function At(s){var p;try{const k=(await al.post(`${dl}/api/applications/${s}/policy-recommendation/analyze`)).data;return(k==null?void 0:k.code)===200?k:pl(k)?Ue(s):Promise.reject(new Error((k==null?void 0:k.detail)||(k==null?void 0:k.message)||"Failed to analyze policy recommendation"))}catch(A){return((p=A==null?void 0:A.response)==null?void 0:p.status)===404?Ue(s):Promise.reject(A)}}async function Ue(s){const p=[];for(const A of vl){const k=await Cl(s,A);p.push(k.data)}return{code:200,data:p,detail:null,message:"OK"}}function Pt(s,p){const A=p?`?days=${p}`:"";return u.get(`/api/applications/${s}/operation-profile${A}`)}function Nt(s){return u.get(`/api/applications/${s}/policy-recommendation`)}function Rt(s){return u.get(`/catalog/selectbox/options?type=${s}`)}const Sl={class:"modal fade",id:"install-form",tabindex:"-1"},wl={class:"modal-dialog modal-lg",role:"document"},Il={class:"modal-content"},El={class:"modal-header"},xl={class:"modal-title"},Vl={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},Ul={class:"mb-3"},Al={key:0,class:"text-muted"},Pl={key:1,class:"text-muted"},Nl=["value"],Rl={class:"mb-3"},Ml={key:0,class:"text-muted"},Ll={key:1,class:"text-muted"},jl=["value"],Tl={value:"selectNsId"},$l={class:"mb-3"},_l={key:0,class:"text-muted"},Kl={key:1,class:"text-muted"},Ol=["disabled"],zl=["value"],Hl={class:"mb-3"},Fl=["disabled"],Bl=["value"],Dl={key:0,class:"mt-2",style:{display:"flex",gap:"10px","flex-wrap":"wrap"}},ql=["onClick"],Gl={class:"mb-3"},Wl={style:{display:"flex",gap:"10px"}},Yl={class:"form-check"},Zl={class:"form-check"},Jl={class:"mb-3"},Xl=["value"],Ql={class:"mb-3"},ea={key:0,class:"mb-3"},la={class:"mb-3"},aa={key:0,class:"text-muted"},ta={key:1,class:"text-muted"},sa=["value"],na={value:"selectNsId"},oa={class:"mb-3"},ia={key:0,class:"text-muted"},ua={key:1,class:"text-muted"},ra=["disabled"],ca=["value"],da={class:"mb-3"},va=["value"],pa={key:0,class:"mb-3"},ma={key:1,class:"mb-3"},fa={key:2,class:"mb-3"},ba=["disabled"],ga={value:"",disabled:""},ya=["value"],ha={key:0,class:"text-danger mt-1 mb-0"},ka={key:3,class:"mb-3"},Ca={class:"mb-2"},Sa={class:"form-check"},wa={key:0,class:"d-flex justify-content-between"},Ia={key:4,class:"mb-3"},Ea={class:"mb-2"},xa={class:"form-check"},Va={key:5,class:"mb-3"},Ua={class:"mb-2"},Aa={class:"form-check"},Pa={key:0},Na={class:"mb-2"},Ra={class:"mb-2"},Ma={class:"mb-2"},La={key:6,class:"mb-3"},ja={class:"mb-2"},Ta={class:"form-check"},$a=["disabled"],_a={key:0},Ka={class:"d-flex justify-content-between"},Oa={class:"w-50 me-2"},za=["value"],Ha={class:"mt-2 mb-2"},Fa=["placeholder"],Ba={class:"d-flex justify-content-between"},Da={class:"w-50 me-2"},qa=["placeholder"],Ga={class:"w-50 ms-2"},Wa={class:"d-flex justify-content-between mt-2"},Ya={class:"w-50 me-2"},Za={class:"w-50 ms-2"},Ja={class:"d-flex gap-4 mt-3"},Xa={class:"form-check"},Qa={class:"mb-0 ps-3"},et={class:"modal-footer d-flex justify-content-between"},lt=["disabled"],at=["disabled"],tt=["disabled"],st=tl({__name:"applicationInstallationForm",props:{nsId:{},title:{}},setup(s){const p=sl(),A=nl(),k=s,d=h(()=>k.title),fe=v([]),_=v([]),Q=v([]),H=v([]),F=v([]),q=v([]),m=v(""),r=v(""),N=v(""),R=v(""),C=v([]),I=v("Standalone"),y=v({}),ee=v(!1),S=v({}),c=v({}),P=v(null),Z=v(!1),B=v("GENERAL_PURPOSE"),K=v([]),L=v(""),G=v(!1),W=v(!1),J=v([]),E=v(""),j=v(""),T=v(""),O=v(!0);se(m,async t=>{$.isEmpty(r.value)||(t==="VM"?(N.value="",R.value="",C.value=[],H.value=[],F.value=[],await oe()):t==="K8S"&&(E.value="",await ie()),j.value="",D())}),se(c,()=>{P.value=null},{deep:!0}),se(L,()=>{D()}),se(I,()=>{I.value==="Standalone"?(C.value=[],H.value=[...F.value]):I.value==="Clustering"&&(C.value=[],H.value=[...F.value])}),ol(async()=>{document.getElementById("install-form").addEventListener("show.bs.modal",async()=>{await ne(),await Pe()})});const ne=async()=>{m.value="VM",r.value="",N.value="",R.value="",C.value=[],F.value=[],I.value="Standalone",y.value={hpaEnabled:!1,hpaMinReplicas:1,hpaMaxReplicas:10,hpaCpuUtilization:60,hpaMemoryUtilization:80},ee.value=!1,S.value={ingressEnabled:!1,ingressHost:"",ingressPath:"/",ingressClass:"nginx",ingressTlsEnabled:!1,ingressTlsSecret:""},c.value=te(),P.value=null,Z.value=!1,K.value=[],L.value="",G.value=!1,W.value=!1,B.value="GENERAL_PURPOSE",T.value="",Ne(),Re(),await Me()},Ae=t=>{let e=(t||"").trim();if(!e)return e;e=e.replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,"");const l=e.lastIndexOf("@");l>=0&&(e=e.slice(l+1));const f=e.search(/[/?#]/);f>=0&&(e=e.slice(0,f));const x=e.indexOf(":");return x>=0&&e.indexOf(":",x+1)<0&&(e=e.slice(0,x)),e.trim().toLowerCase()},Pe=async()=>{await ml("").then(({data:t})=>{q.value=t})},Ne=()=>{fe.value=[{key:"VM",value:"VM"},{key:"k8s",value:"K8S"}]},Re=()=>{d.value==="Application Uninstallation"?O.value=!1:O.value=!0},Me=async()=>{await ul().then(async({data:t})=>{if(console.log("## data ### : ",t),_.value=t,_.value.length>0)if(!$.isEmpty(k.nsId))r.value=k.nsId;else if($.isEmpty(A.getNsId()))r.value=_.value[0].name;else{const e=A.getNsId();_.value.find(f=>f.name===e)?r.value=e:r.value=_.value[0].name}$.isEmpty(r.value)||(m.value==="VM"?await oe():m.value==="K8S"&&await ie())})},oe=async()=>{console.log(await xe(r.value)),await xe(r.value).then(async({data:t})=>{Q.value=t,Q.value.length>0?(N.value=Q.value[0].name,await be()):N.value=""})},be=async()=>{const t={nsId:r.value,mciId:N.value};await rl(t).then(({data:e})=>{F.value=e.node,H.value=F.value.filter(l=>!C.value.includes(l.id)),R.value=""})},ie=async()=>{await cl(r.value).then(({data:t})=>{J.value=t,J.value.length>0?E.value=J.value[0].name:E.value="",c.value=te(),P.value=null}),await ge()},ge=async()=>{if(K.value=[],L.value="",W.value=!1,!(m.value!=="K8S"||$.isEmpty(r.value)||$.isEmpty(E.value))){G.value=!0;try{const{data:t}=await yl({namespace:r.value,clusterName:E.value});K.value=Array.isArray(t)?t:[],L.value=Le(K.value)}catch{W.value=!0,L.value=""}finally{G.value=!1}}},Le=t=>{var l;const e=t.find(f=>f.defaultClass);return(e==null?void 0:e.name)||((l=t[0])==null?void 0:l.name)||""},ue=async()=>{C.value=[],await oe(),D()},je=async()=>{C.value=[],await be(),D()},Te=async()=>{await ie(),D()},D=()=>{d.value==="Application Installation"?O.value=!0:d.value==="Application Uninstallation"&&(O.value=!1)},$e=()=>{if(R.value!==""){if(I.value==="Standalone")C.value=[R.value];else if(I.value==="Clustering"&&!C.value.includes(R.value)){C.value.push(R.value);const t=H.value.findIndex(e=>e.id===R.value);t!==-1&&H.value.splice(t,1)}R.value="",D()}},_e=t=>{const e=C.value[t];if(C.value.splice(t,1),I.value==="Clustering"){const l=F.value.find(f=>f.id===e);l&&H.value.push(l)}D()},Ke=async()=>{let t={};if(m.value==="VM"){j.value.split(",").map(l=>l.toLowerCase().trim());let e={};if(d.value=="Application Installation"){const l=I.value==="Clustering"?`${j.value}-cluster`:`${j.value}-standalone`,f=T.value===""?void 0:Number(T.value);e={namespace:r.value,mciId:N.value,vmIds:C.value,clusterName:l,catalogId:z.value,servicePort:f,username:"admin",deploymentType:m.value,vmDeploymentMode:I.value.toUpperCase(),resourceType:B.value},t=await fl(e)}else t=await Ve(e);t.data?p.success("SUCCESS"):p.error("FAIL")}else if(m.value==="K8S"){if(!Ce())return;j.value.split(",").map(x=>x.toLowerCase().trim());const e=T.value===""?void 0:Number(T.value),l=Ze();let f={namespace:r.value,clusterName:E.value,catalogId:z.value,servicePort:e,username:"",deploymentType:m.value,hpaEnabled:y.value.hpaEnabled,minReplicas:y.value.hpaMinReplicas,maxReplicas:y.value.hpaMaxReplicas,cpuThreshold:y.value.hpaCpuUtilization,memoryThreshold:y.value.hpaMemoryUtilization,workloadRebalancingEnabled:ee.value,resourceType:B.value,ingressEnabled:S.value.ingressEnabled,ingressHost:Ae(S.value.ingressHost),ingressPath:S.value.ingressPath,ingressClass:S.value.ingressClass,ingressTlsEnabled:S.value.ingressTlsEnabled,ingressTlsSecret:S.value.ingressTlsSecret,additionalConfig:l};d.value=="Application Installation"?t=await bl(f):t=await Ve(f),t.data?p.success("SUCCESS"):p.error("FAIL")}},Oe=async()=>{if(m.value!=="VM"&&m.value!=="K8S"){p.error("Please Select Infra");return}if(!Ce())return;const t=await ze();let e=!0;if(t==null){p.error("Please select all items");return}else if(t===!1){let l="";m.value==="VM"?l="VM":m.value==="K8S"&&(l="CLUSTER");const f="Your selected "+l+" has lower specifications than recommended. Would you like to continue with the installation?";e=confirm(f)}e&&(p.success("Please click RUN"),O.value=!1)},ze=async()=>{let t=!1;if(m.value==="VM"){if(r.value===""||N.value===""||C.value.length===0||z.value===0)return null;{const e={namespace:r.value,mciName:N.value,vmName:C.value[0],catalogId:z.value};await hl(e).then(({data:l})=>{t=l})}}else if(m.value==="K8S"){if(r.value===""||E.value===""||z.value===0)return null;const e={namespace:r.value,clusterName:E.value,catalogId:z.value};await kl(e).then(({data:l})=>{t=l})}return t},z=v(0),re=h(()=>q.value.find(t=>t.id===z.value)),le=h(()=>{var e;const t=J.value.find(l=>l.id===E.value||l.name===E.value);return((e=t==null?void 0:t.connectionConfig)==null?void 0:e.providerName)||(t==null?void 0:t.connectionName)||""}),He=h(()=>{var t,e;return String(((e=(t=re.value)==null?void 0:t.helmChart)==null?void 0:e.chartName)||"").toLowerCase()}),ce=h(()=>He.value==="loki"),Y=h(()=>m.value==="K8S"&&ce.value),Fe=h(()=>m.value==="K8S"&&d.value==="Application Installation"&&(Y.value||K.value.length>0||W.value)),Be=h(()=>G.value||K.value.length<=1),De=h(()=>G.value?"Loading StorageClasses...":W.value?"Failed to load StorageClasses":K.value.length===0?"No StorageClass found":"Select StorageClass"),ae=h(()=>Y.value?G.value?"StorageClass list is loading.":W.value?"StorageClass list could not be loaded.":K.value.length===0?"Loki requires a StorageClass, but none was found.":$.isEmpty(L.value)?"Loki requires a StorageClass.":"":""),qe=h(()=>pe(le.value)?"Optional: https://s3.ap-northeast-2.amazonaws.com":"https://object-storage.example.com"),Ge=h(()=>pe(le.value)?"ap-northeast-2":"region from object storage service"),de=h(()=>{var t;return m.value!=="K8S"||!((t=re.value)!=null&&t.helmChart)?!1:ce.value||Ye(re.value)}),ve=h(()=>m.value==="K8S"&&de.value&&c.value.enabled),ye=h(()=>{var t;return!ve.value||((t=P.value)==null?void 0:t.success)===!0}),We=h(()=>O.value||!ye.value||Y.value&&!$.isEmpty(ae.value));function te(t=le.value,e=he.value){const l=pe(t);return{enabled:!!e,backendType:"s3",endpoint:"",region:"",bucket:"",accessKey:"",secretKey:"",forcePathStyle:!l}}function pe(t){return String(t||"").toLowerCase().includes("aws")}const he=h(()=>m.value==="K8S"&&ce.value);function Ye(t){return(t.catalogRefs||[]).some(l=>{const f=String(l.refType||"").toUpperCase();return String(l.refValue||"").toLowerCase()==="object-storage"&&(f==="CAPABILITY"||f==="TAG")})}function ke(){return{enabled:c.value.enabled,backendType:c.value.backendType,endpoint:c.value.endpoint,region:c.value.region,bucket:c.value.bucket,accessKey:c.value.accessKey,secretKey:c.value.secretKey,forcePathStyle:c.value.forcePathStyle,insecure:Je(c.value.endpoint)}}function Ze(){const t={};return $.isEmpty(L.value)||(t.storageClass=L.value),de.value&&c.value.enabled&&(t.objectStorage=ke()),Object.keys(t).length>0?t:void 0}function Ce(){if(!Y.value)return!0;const t=ae.value;return $.isEmpty(t)?!0:(p.error(t),!1)}function Je(t){return String(t||"").trim().toLowerCase().startsWith("http://")}const Xe=async(t=!0)=>{if(!ve.value)return!0;Z.value=!0,P.value=null;const e={namespace:r.value,clusterName:E.value,catalogId:z.value,objectStorage:ke()};try{const{data:l}=await gl(e);return P.value=l,l!=null&&l.success?(t&&p.success("Object Storage check succeeded"),!0):(t&&p.error("Object Storage check failed"),!1)}catch{return t&&p.error("Object Storage check failed"),!1}finally{Z.value=!1}},Se=h(()=>m.value==="VM"?q.value.filter(t=>t.packageInfo):m.value==="K8S"?q.value.filter(t=>t.helmChart):q.value),we=()=>{d.value==="Application Installation"&&(O.value=!0),q.value.forEach(t=>{if(j.value===t.name){z.value=t.id,T.value=t.defaultPort?String(t.defaultPort):"",y.value={hpaEnabled:!!t.hpaEnabled,hpaMinReplicas:t.minReplicas||1,hpaMaxReplicas:t.maxReplicas||10,hpaCpuUtilization:t.cpuThreshold||60,hpaMemoryUtilization:t.memoryThreshold||80},S.value={ingressEnabled:!!t.ingressEnabled,ingressHost:t.ingressHost||"",ingressPath:t.ingressPath||"/",ingressClass:t.ingressClass||"nginx",ingressTlsEnabled:!!t.ingressTlsEnabled,ingressTlsSecret:t.ingressTlsSecret||""},c.value=te(),P.value=null;return}})},Qe=async()=>{d.value==="Application Installation"&&(O.value=!0),c.value=te(),P.value=null,await ge()};return(t,e)=>(o(),n("div",Sl,[a("div",wl,[a("div",Il,[a("div",El,[a("h5",xl,b(d.value),1),a("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close",onClick:ne})]),a("div",Vl,[a("div",Ul,[e[35]||(e[35]=a("label",{class:"form-label"},"Target Infra",-1)),d.value=="Application Installation"?(o(),n("p",Al," Select the Infra what is the Infra will be installed ")):d.value=="Application Uninstallation"?(o(),n("p",Pl," Select the Infra what is the Infra will be uninstalled ")):g("",!0),i(a("select",{class:"form-select",id:"infra","onUpdate:modelValue":e[0]||(e[0]=l=>m.value=l)},[(o(!0),n(U,null,M(fe.value,l=>(o(),n("option",{value:l.value,key:l.value},b(l.value),9,Nl))),128))],512),[[V,m.value]])]),m.value=="VM"?(o(),n(U,{key:0},[a("div",Rl,[e[36]||(e[36]=a("label",{class:"form-label"},"Namespace",-1)),d.value=="Application Installation"?(o(),n("p",Ml," Select the namespace where the application will be installed")):d.value=="Application Uninstallation"?(o(),n("p",Ll," Select the namespace where the application will be uninstalled")):g("",!0),_.value.length>0?i((o(),n("select",{key:2,class:"form-select",id:"namesapce","onUpdate:modelValue":e[1]||(e[1]=l=>r.value=l),onChange:ue},[(o(!0),n(U,null,M(_.value,l=>(o(),n("option",{value:l.name,key:l.name},b(l.name),9,jl))),128))],544)),[[V,r.value]]):i((o(),n("select",{key:3,class:"form-select",id:"namesapce","onUpdate:modelValue":e[2]||(e[2]=l=>r.value=l),onChange:ue},[a("option",Tl,b(r.value),1)],544)),[[V,r.value]])]),a("div",$l,[e[37]||(e[37]=a("label",{class:"form-label"},"MCI Name",-1)),d.value=="Application Installation"?(o(),n("p",_l," Select the multi-cloud infrastructure information where the application will be deployed")):d.value=="Application Uninstallation"?(o(),n("p",Kl," Remove the application and associated resources from the multi-cloud infrastructure")):g("",!0),i(a("select",{class:"form-select",id:"mci-name",disabled:r.value=="","onUpdate:modelValue":e[3]||(e[3]=l=>N.value=l),onChange:je},[(o(!0),n(U,null,M(Q.value,l=>(o(),n("option",{value:l.id,key:l.name},b(l.name),9,zl))),128))],40,Ol),[[V,N.value]])]),a("div",Hl,[e[39]||(e[39]=a("label",{class:"form-label"},"VM Name",-1)),e[40]||(e[40]=a("p",{class:"text-muted"}," Select the virtual machine (VM) within the chosen multi-cloud infrastructure where the application will be deployed",-1)),i(a("select",{class:"form-select",id:"mci-name",disabled:N.value=="","onUpdate:modelValue":e[4]||(e[4]=l=>R.value=l),onChange:$e},[e[38]||(e[38]=a("option",{value:""},"Select VM",-1)),(o(!0),n(U,null,M(H.value,l=>(o(),n("option",{value:l.id,key:l.name},b(l.name),9,Bl))),128))],40,Fl),[[V,R.value]]),C.value.length>0?(o(),n("div",Dl,[(o(!0),n(U,null,M(C.value,(l,f)=>(o(),n("label",{key:f,class:"form-check-label",style:{border:"1px solid #000",padding:"5px","border-radius":"5px",cursor:"pointer"}},[me(b(l)+" ",1),a("span",{onClick:x=>_e(f),style:{"margin-left":"5px","font-weight":"bold"}},"X",8,ql)]))),128))])):g("",!0)]),a("div",Gl,[e[43]||(e[43]=a("label",{class:"form-label"},"Deployment Type",-1)),e[44]||(e[44]=a("p",{class:"text-muted"},"Select the deployment type",-1)),a("div",Wl,[a("div",Yl,[i(a("input",{class:"form-check-input",type:"radio",id:"Standalone","onUpdate:modelValue":e[5]||(e[5]=l=>I.value=l),value:"Standalone"},null,512),[[Ie,I.value]]),e[41]||(e[41]=a("label",{class:"form-check-label",for:"Standalone"},"Standalone",-1))]),a("div",Zl,[i(a("input",{class:"form-check-input",type:"radio",id:"Clustering","onUpdate:modelValue":e[6]||(e[6]=l=>I.value=l),value:"Clustering"},null,512),[[Ie,I.value]]),e[42]||(e[42]=a("label",{class:"form-check-label",for:"Clustering"},"Clustering",-1))])])]),a("div",Jl,[e[45]||(e[45]=a("label",{class:"form-label"},"Application",-1)),e[46]||(e[46]=a("p",{class:"text-muted"},"Select the application",-1)),i(a("select",{class:"form-select","onUpdate:modelValue":e[7]||(e[7]=l=>j.value=l),onChange:we},[(o(!0),n(U,null,M(Se.value,(l,f)=>{var x;return o(),n("option",{key:f,value:l.name}," ["+b(l.name)+"] "+b(((x=l.packageInfo)==null?void 0:x.packageVersion)||"latest"),9,Xl)}),128))],544),[[V,j.value]])]),a("div",Ql,[e[47]||(e[47]=a("label",{class:"form-label"},"Port",-1)),e[48]||(e[48]=a("p",{class:"text-muted"},"Please enter a port accessible from the outside",-1)),i(a("input",{type:"number",class:"form-control",placeholder:"8080","onUpdate:modelValue":e[8]||(e[8]=l=>T.value=l)},null,512),[[w,T.value]])]),d.value=="Application Installation"?(o(),n("div",ea,[e[50]||(e[50]=a("label",{class:"form-label"},"Resource Type",-1)),i(a("select",{class:"form-select","onUpdate:modelValue":e[9]||(e[9]=l=>B.value=l)},e[49]||(e[49]=[a("option",{value:"GENERAL_PURPOSE"},"General Purpose",-1),a("option",{value:"CPU_INTENSIVE"},"CPU Intensive",-1),a("option",{value:"MEMORY_INTENSIVE"},"Memory Intensive",-1)]),512),[[V,B.value]])])):g("",!0)],64)):m.value=="K8S"?(o(),n(U,{key:1},[a("div",la,[e[51]||(e[51]=a("label",{class:"form-label"},"Namespace",-1)),d.value=="Application Installation"?(o(),n("p",aa,"Select the namespace where the application will be installed")):d.value=="Application Uninstallation"?(o(),n("p",ta,"Select the namespace where the application will be uninstalled")):g("",!0),_.value.length>0?i((o(),n("select",{key:2,class:"form-select",id:"namesapce","onUpdate:modelValue":e[10]||(e[10]=l=>r.value=l),onChange:Te},[(o(!0),n(U,null,M(_.value,l=>(o(),n("option",{value:l.name,key:l.name},b(l.name),9,sa))),128))],544)),[[V,r.value]]):i((o(),n("select",{key:3,class:"form-select",id:"namesapce","onUpdate:modelValue":e[11]||(e[11]=l=>r.value=l),onChange:ue},[a("option",na,b(r.value),1)],544)),[[V,r.value]])]),a("div",oa,[e[52]||(e[52]=a("label",{class:"form-label"},"ClusterName",-1)),d.value=="Application Installation"?(o(),n("p",ia,"Select the name of the cluster where the application will be deployed")):d.value=="Application Uninstallation"?(o(),n("p",ua,"Remove the application and associated resources from the multi-cloud infrastructure")):g("",!0),i(a("select",{class:"form-select",id:"mci-name",disabled:r.value=="","onUpdate:modelValue":e[12]||(e[12]=l=>E.value=l),onChange:Qe},[(o(!0),n(U,null,M(J.value,l=>(o(),n("option",{value:l.id,key:l.name},b(l.name),9,ca))),128))],40,ra),[[V,E.value]])]),a("div",da,[e[53]||(e[53]=a("label",{class:"form-label"},"Helm chart",-1)),e[54]||(e[54]=a("p",{class:"text-muted"},"Select the application",-1)),i(a("select",{class:"form-select","onUpdate:modelValue":e[13]||(e[13]=l=>j.value=l),onChange:we},[(o(!0),n(U,null,M(Se.value,(l,f)=>{var x;return o(),n("option",{key:f,value:l.name}," ["+b(l.name)+"] "+b(((x=l.helmChart)==null?void 0:x.chartVersion)||"latest"),9,va)}),128))],544),[[V,j.value]])]),d.value=="Application Installation"?(o(),n("div",pa,[e[55]||(e[55]=a("label",{class:"form-label"},"Port",-1)),e[56]||(e[56]=a("p",{class:"text-muted"},"Please enter a service port for the Kubernetes service",-1)),i(a("input",{type:"number",class:"form-control",placeholder:"80","onUpdate:modelValue":e[14]||(e[14]=l=>T.value=l)},null,512),[[w,T.value]])])):g("",!0),d.value=="Application Installation"?(o(),n("div",ma,[e[58]||(e[58]=a("label",{class:"form-label"},"Resource Type",-1)),i(a("select",{class:"form-select","onUpdate:modelValue":e[15]||(e[15]=l=>B.value=l)},e[57]||(e[57]=[a("option",{value:"GENERAL_PURPOSE"},"General Purpose",-1),a("option",{value:"CPU_INTENSIVE"},"CPU Intensive",-1),a("option",{value:"MEMORY_INTENSIVE"},"Memory Intensive",-1)]),512),[[V,B.value]])])):g("",!0),d.value=="Application Installation"&&Fe.value?(o(),n("div",fa,[a("label",{class:Ee(["form-label",{required:Y.value}])},"Storage Class",2),i(a("select",{class:"form-select","onUpdate:modelValue":e[16]||(e[16]=l=>L.value=l),disabled:Be.value},[a("option",ga,b(De.value),1),(o(!0),n(U,null,M(K.value,l=>(o(),n("option",{key:l.name,value:l.name},b(l.name)+b(l.defaultClass?" (default)":""),9,ya))),128))],8,ba),[[V,L.value]]),Y.value&&ae.value?(o(),n("p",ha,b(ae.value),1)):g("",!0)])):g("",!0),d.value=="Application Installation"?(o(),n("div",ka,[e[66]||(e[66]=a("label",{class:"form-label"},"HPA Configuration",-1)),a("div",Ca,[a("div",Sa,[i(a("input",{class:"form-check-input",type:"checkbox",id:"hpaEnabled","onUpdate:modelValue":e[17]||(e[17]=l=>y.value.hpaEnabled=l)},null,512),[[X,y.value.hpaEnabled]]),e[59]||(e[59]=a("label",{class:"form-check-label",for:"hpaEnabled"}," Enable HPA (Horizontal Pod Autoscaler) ",-1))])]),y.value.hpaEnabled?(o(),n("div",wa,[a("div",null,[e[60]||(e[60]=a("label",{class:"form-label required"}," minReplicas ",-1)),i(a("input",{type:"number",class:"form-control w-90-per",placeholder:"1","onUpdate:modelValue":e[18]||(e[18]=l=>y.value.hpaMinReplicas=l)},null,512),[[w,y.value.hpaMinReplicas]])]),a("div",null,[e[61]||(e[61]=a("label",{class:"form-label required"}," maxReplicas ",-1)),i(a("input",{type:"number",class:"form-control w-90-per",placeholder:"10","onUpdate:modelValue":e[19]||(e[19]=l=>y.value.hpaMaxReplicas=l)},null,512),[[w,y.value.hpaMaxReplicas]])]),a("div",null,[e[62]||(e[62]=a("label",{class:"form-check-label mb-2"}," CPU (%) ",-1)),i(a("input",{type:"number",class:"form-control w-80-per d-inline",placeholder:"60","onUpdate:modelValue":e[20]||(e[20]=l=>y.value.hpaCpuUtilization=l)},null,512),[[w,y.value.hpaCpuUtilization]]),e[63]||(e[63]=me(" % "))]),a("div",null,[e[64]||(e[64]=a("label",{class:"form-check-label mb-2"}," MEMORY (%) ",-1)),i(a("input",{type:"number",class:"form-control w-80-per d-inline",placeholder:"80","onUpdate:modelValue":e[21]||(e[21]=l=>y.value.hpaMemoryUtilization=l)},null,512),[[w,y.value.hpaMemoryUtilization]]),e[65]||(e[65]=me(" % "))])])):g("",!0)])):g("",!0),d.value=="Application Installation"?(o(),n("div",Ia,[e[68]||(e[68]=a("label",{class:"form-label"},"Workload Rebalancing",-1)),a("div",Ea,[a("div",xa,[i(a("input",{class:"form-check-input",type:"checkbox",id:"workloadRebalancingEnabled","onUpdate:modelValue":e[22]||(e[22]=l=>ee.value=l)},null,512),[[X,ee.value]]),e[67]||(e[67]=a("label",{class:"form-check-label",for:"workloadRebalancingEnabled"}," Enable Workload Rebalancing ",-1))])])])):g("",!0),d.value=="Application Installation"?(o(),n("div",Va,[e[73]||(e[73]=a("label",{class:"form-label"},"Ingress Configuration",-1)),a("div",Ua,[a("div",Aa,[i(a("input",{class:"form-check-input",type:"checkbox",id:"ingressEnabled","onUpdate:modelValue":e[23]||(e[23]=l=>S.value.ingressEnabled=l)},null,512),[[X,S.value.ingressEnabled]]),e[69]||(e[69]=a("label",{class:"form-check-label",for:"ingressEnabled"}," Enable Ingress ",-1))])]),S.value.ingressEnabled?(o(),n("div",Pa,[a("div",Na,[e[70]||(e[70]=a("label",{class:"form-label"},"Host",-1)),i(a("input",{type:"text",class:"form-control",placeholder:"example.com","onUpdate:modelValue":e[24]||(e[24]=l=>S.value.ingressHost=l)},null,512),[[w,S.value.ingressHost]])]),a("div",Ra,[e[71]||(e[71]=a("label",{class:"form-label"},"Path",-1)),i(a("input",{type:"text",class:"form-control",placeholder:"/","onUpdate:modelValue":e[25]||(e[25]=l=>S.value.ingressPath=l)},null,512),[[w,S.value.ingressPath]])]),a("div",Ma,[e[72]||(e[72]=a("label",{class:"form-label"},"Ingress Class",-1)),i(a("input",{type:"text",class:"form-control",placeholder:"nginx","onUpdate:modelValue":e[26]||(e[26]=l=>S.value.ingressClass=l),disabled:""},null,512),[[w,S.value.ingressClass]])])])):g("",!0)])):g("",!0),d.value=="Application Installation"&&de.value?(o(),n("div",La,[e[83]||(e[83]=a("label",{class:"form-label"},"Object Storage Configuration",-1)),a("div",ja,[a("div",Ta,[i(a("input",{class:"form-check-input",type:"checkbox",id:"objectStorageEnabled","onUpdate:modelValue":e[27]||(e[27]=l=>c.value.enabled=l),disabled:he.value},null,8,$a),[[X,c.value.enabled]]),e[74]||(e[74]=a("label",{class:"form-check-label",for:"objectStorageEnabled"}," Enable Object Storage ",-1))])]),c.value.enabled?(o(),n("div",_a,[a("div",Ka,[a("div",Oa,[e[75]||(e[75]=a("label",{class:"form-label"},"Target CSP",-1)),a("input",{type:"text",class:"form-control",value:le.value||"-",disabled:""},null,8,za)]),e[76]||(e[76]=a("div",{class:"w-50 ms-2"},[a("label",{class:"form-label"},"Storage API"),a("input",{type:"text",class:"form-control",value:"S3-compatible",disabled:""})],-1))]),a("div",Ha,[e[77]||(e[77]=a("label",{class:"form-label"},"S3-compatible Endpoint",-1)),i(a("input",{type:"text",class:"form-control",placeholder:qe.value,"onUpdate:modelValue":e[28]||(e[28]=l=>c.value.endpoint=l)},null,8,Fa),[[w,c.value.endpoint]])]),a("div",Ba,[a("div",Da,[e[78]||(e[78]=a("label",{class:"form-label"},"Region",-1)),i(a("input",{type:"text",class:"form-control",placeholder:Ge.value,"onUpdate:modelValue":e[29]||(e[29]=l=>c.value.region=l)},null,8,qa),[[w,c.value.region]])]),a("div",Ga,[e[79]||(e[79]=a("label",{class:"form-label"},"Bucket Name",-1)),i(a("input",{type:"text",class:"form-control",placeholder:"object-storage-bucket","onUpdate:modelValue":e[30]||(e[30]=l=>c.value.bucket=l)},null,512),[[w,c.value.bucket]])])]),a("div",Wa,[a("div",Ya,[e[80]||(e[80]=a("label",{class:"form-label"},"Access Key ID",-1)),i(a("input",{type:"password",class:"form-control",placeholder:"access key id","onUpdate:modelValue":e[31]||(e[31]=l=>c.value.accessKey=l),autocomplete:"off"},null,512),[[w,c.value.accessKey]])]),a("div",Za,[e[81]||(e[81]=a("label",{class:"form-label"},"Secret Access Key",-1)),i(a("input",{type:"password",class:"form-control",placeholder:"secret access key","onUpdate:modelValue":e[32]||(e[32]=l=>c.value.secretKey=l),autocomplete:"off"},null,512),[[w,c.value.secretKey]])])]),a("div",Ja,[a("div",Xa,[i(a("input",{class:"form-check-input",type:"checkbox",id:"forcePathStyle","onUpdate:modelValue":e[33]||(e[33]=l=>c.value.forcePathStyle=l)},null,512),[[X,c.value.forcePathStyle]]),e[82]||(e[82]=a("label",{class:"form-check-label",for:"forcePathStyle",title:"On: endpoint/bucket/object. Off: bucket.endpoint/object."},"Use path-style URL",-1))])]),P.value?(o(),n("div",{key:0,class:Ee(["alert mt-3",P.value.success?"alert-success":"alert-danger"])},[a("div",null,b(P.value.success?"Object Storage: SUCCESS":"Object Storage: FAILED"),1),a("ul",Qa,[(o(!0),n(U,null,M(P.value.checks,l=>(o(),n("li",{key:l.name},b(l.name)+" - "+b(l.success?"OK":"FAIL"),1))),128))])],2)):g("",!0)])):g("",!0)])):g("",!0)],64)):g("",!0)]),a("div",et,[a("a",{class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:ne}," Cancel "),a("div",null,[d.value=="Application Installation"&&ve.value?(o(),n("button",{key:0,class:"btn btn-outline-danger ms-auto me-1",onClick:e[34]||(e[34]=l=>Xe()),disabled:Z.value||ye.value,title:"Writes, reads, and deletes a temporary object in the selected bucket."},b(Z.value?"Checking...":"Storage Check"),9,lt)):g("",!0),d.value=="Application Installation"?(o(),n("button",{key:1,class:"btn btn-danger ms-auto me-1",onClick:Oe,disabled:!O.value}," Spec Check ",8,at)):g("",!0),a("button",{class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:Ke,disabled:We.value}," Deploy ",8,tt)])])])])]))}}),Mt=il(st,[["__scopeId","data-v-6481d580"]]);export{Mt as A,ct as I,Ut as a,Pt as b,Nt as c,At as d,yt as e,kt as f,Rt as g,ft as h,dt as i,Ct as j,St as k,gt as l,wt as m,It as n,ml as o,vt as p,pt as q,Ve as r,Vt as s,Et as t,bt as u,xt as v,ht as w,mt as x}; diff --git a/src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-TgRUyQdd.js b/src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-TgRUyQdd.js deleted file mode 100644 index c0be8c6c..00000000 --- a/src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-TgRUyQdd.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as Qe}from"./IconPlus-o3un4-BS.js";import{J as el,K as ll,d as al,u as tl,C as sl,c as h,r as v,w as ae,o as nl,a as n,b as a,t as b,j as g,e as u,v as V,F as U,f as L,y as we,g as w,n as Ie,z as te,l as pe,h as o}from"./index-DgPLCZcu.js";import{_ as $}from"./lodash-l7l6TB3A.js";import{s as i}from"./request-D5nUjUnA.js";import{_ as ol}from"./_plugin-vue_export-helper-DlAUqK2U.js";/** - * @license @tabler/icons-vue v3.22.0 - MIT - * - * This source code is licensed under the MIT license. - * See the LICENSE file in the root directory of this source tree. - */var ot=Qe("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);const il=()=>i.get("/cbtumblebug/ns"),Ee=s=>i.get(`/cbtumblebug/ns/${s}/infra`),ul=s=>i.get(`/cbtumblebug/ns/${s.nsId}/infra/${s.mciId}`),rl=s=>i.get(`/cbtumblebug/ns/${s}/k8scluster`),cl=el("http://127.0.0.1:18084").replace(/\/$/,""),dl=[90,30,7],vl=s=>{const p=String((s==null?void 0:s.detail)||"");return p.includes("No static resource")&&p.includes("/policy-recommendation/analyze")},pl=s=>i.get(`/catalog/software?name=${s}`),it=s=>i.get(`/catalog/software/${s}`),ut=s=>i.get(`/search/dockerhub/${s}`),rt=s=>i.get(`/search/artifacthub/${s}`),ml=s=>i.post("/applications/vm/deploy",s),xe=s=>i.post("/applications/action",s),fl=s=>i.post("/applications/k8s/deploy",s),bl=s=>i.post("/applications/k8s/object-storage/smoke-check",s),gl=s=>i.get(`/applications/k8s/storage-classes?namespace=${s.namespace}&clusterName=${s.clusterName}`),yl=s=>i.get(`/applications/vm/check?namespace=${s.namespace}&mciId=${s.mciName}&vmId=${s.vmName}&catalogId=${s.catalogId}`),hl=s=>i.get(`/applications/k8s/check?namespace=${s.namespace}&clusterName=${s.clusterName}&catalogId=${s.catalogId}`),ct=s=>i.get(`/ape/log/${s}`);function dt(s){return i.post("/catalog/software",s)}function vt(s){return i.put(`/catalog/software/${s.id}`,s)}function pt(s){return i.delete(`/catalog/software/${s}`)}function mt(){return i.get("/api/applications/status/groups")}function ft(s){return i.get(`/api/applications/integrated/catalog/${s}`)}function bt(s){return i.post("/catalog/application/category",s)}function gt(s){return i.post("/catalog/application/package",s)}function yt(s){const p={target:s.target,applicationName:s.packageName};return i.post("/catalog/application/package/version",p)}function ht(s){return i.get(`/search/dockerhub/tag/${s.path}`)}function kt(s){return i.get(`/search/artifacthub/version/${s.kind}/${s.repository}/${s.packageName}`)}function Ct(s){return i.post("/catalog/docker/register",s)}function St(s){return i.post("/catalog/helm/register",s)}function wt(s){return i.post("/catalog/rating/overall",s)}function It(s){return i.get(`/api/applications/integrated/deployment/${s}`)}function kl(s,p=14){return i.post(`/api/applications/${s}/operation-profile/analyze?days=${p}`)}async function Et(s){var p;try{const k=(await ll.post(`${cl}/api/applications/${s}/policy-recommendation/analyze`)).data;return(k==null?void 0:k.code)===200?k:vl(k)?Ve(s):Promise.reject(new Error((k==null?void 0:k.detail)||(k==null?void 0:k.message)||"Failed to analyze policy recommendation"))}catch(A){return((p=A==null?void 0:A.response)==null?void 0:p.status)===404?Ve(s):Promise.reject(A)}}async function Ve(s){const p=[];for(const A of dl){const k=await kl(s,A);p.push(k.data)}return{code:200,data:p,detail:null,message:"OK"}}function xt(s,p){const A=p?`?days=${p}`:"";return i.get(`/api/applications/${s}/operation-profile${A}`)}function Vt(s){return i.get(`/api/applications/${s}/policy-recommendation`)}function Ut(s){return i.get(`/catalog/selectbox/options?type=${s}`)}const Cl={class:"modal fade",id:"install-form",tabindex:"-1"},Sl={class:"modal-dialog modal-lg",role:"document"},wl={class:"modal-content"},Il={class:"modal-header"},El={class:"modal-title"},xl={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},Vl={class:"mb-3"},Ul={key:0,class:"text-muted"},Al={key:1,class:"text-muted"},Pl=["value"],Nl={class:"mb-3"},Ml={key:0,class:"text-muted"},Ll={key:1,class:"text-muted"},Rl=["value"],jl={value:"selectNsId"},Tl={class:"mb-3"},$l={key:0,class:"text-muted"},_l={key:1,class:"text-muted"},Kl=["disabled"],Ol=["value"],zl={class:"mb-3"},Hl=["disabled"],Fl=["value"],Bl={key:0,class:"mt-2",style:{display:"flex",gap:"10px","flex-wrap":"wrap"}},Dl=["onClick"],ql={class:"mb-3"},Gl={style:{display:"flex",gap:"10px"}},Yl={class:"form-check"},Wl={class:"form-check"},Zl={class:"mb-3"},Jl=["value"],Xl={class:"mb-3"},Ql={key:0,class:"mb-3"},ea={class:"mb-3"},la={key:0,class:"text-muted"},aa={key:1,class:"text-muted"},ta=["value"],sa={value:"selectNsId"},na={class:"mb-3"},oa={key:0,class:"text-muted"},ia={key:1,class:"text-muted"},ua=["disabled"],ra=["value"],ca={class:"mb-3"},da=["value"],va={key:0,class:"mb-3"},pa={key:1,class:"mb-3"},ma={key:2,class:"mb-3"},fa=["disabled"],ba={value:"",disabled:""},ga=["value"],ya={key:0,class:"text-danger mt-1 mb-0"},ha={key:3,class:"mb-3"},ka={class:"mb-2"},Ca={class:"form-check"},Sa={key:0,class:"d-flex justify-content-between"},wa={key:4,class:"mb-3"},Ia={class:"mb-2"},Ea={class:"form-check"},xa={key:0},Va={class:"mb-2"},Ua={class:"mb-2"},Aa={class:"mb-2"},Pa={key:5,class:"mb-3"},Na={class:"mb-2"},Ma={class:"form-check"},La=["disabled"],Ra={key:0},ja={class:"d-flex justify-content-between"},Ta={class:"w-50 me-2"},$a=["value"],_a={class:"mt-2 mb-2"},Ka=["placeholder"],Oa={class:"d-flex justify-content-between"},za={class:"w-50 me-2"},Ha=["placeholder"],Fa={class:"w-50 ms-2"},Ba={class:"d-flex justify-content-between mt-2"},Da={class:"w-50 me-2"},qa={class:"w-50 ms-2"},Ga={class:"d-flex gap-4 mt-3"},Ya={class:"form-check"},Wa={class:"mb-0 ps-3"},Za={class:"modal-footer d-flex justify-content-between"},Ja=["disabled"],Xa=["disabled"],Qa=["disabled"],et=al({__name:"applicationInstallationForm",props:{nsId:{},title:{}},setup(s){const p=tl(),A=sl(),k=s,d=h(()=>k.title),me=v([]),_=v([]),X=v([]),H=v([]),F=v([]),q=v([]),m=v(""),r=v(""),N=v(""),M=v(""),C=v([]),I=v("Standalone"),y=v({}),S=v({}),c=v({}),P=v(null),Z=v(!1),B=v("GENERAL_PURPOSE"),K=v([]),R=v(""),G=v(!1),Y=v(!1),J=v([]),E=v(""),j=v(""),T=v(""),O=v(!0);ae(m,async t=>{$.isEmpty(r.value)||(t==="VM"?(N.value="",M.value="",C.value=[],H.value=[],F.value=[],await ne()):t==="K8S"&&(E.value="",await oe()),j.value="",D())}),ae(c,()=>{P.value=null},{deep:!0}),ae(R,()=>{D()}),ae(I,()=>{I.value==="Standalone"?(C.value=[],H.value=[...F.value]):I.value==="Clustering"&&(C.value=[],H.value=[...F.value])}),nl(async()=>{document.getElementById("install-form").addEventListener("show.bs.modal",async()=>{await se(),await Ae()})});const se=async()=>{m.value="VM",r.value="",N.value="",M.value="",C.value=[],F.value=[],I.value="Standalone",y.value={hpaEnabled:!1,hpaMinReplicas:1,hpaMaxReplicas:10,hpaCpuUtilization:60,hpaMemoryUtilization:80},S.value={ingressEnabled:!1,ingressHost:"",ingressPath:"/",ingressClass:"nginx",ingressTlsEnabled:!1,ingressTlsSecret:""},c.value=le(),P.value=null,Z.value=!1,K.value=[],R.value="",G.value=!1,Y.value=!1,B.value="GENERAL_PURPOSE",T.value="",Pe(),Ne(),await Me()},Ue=t=>{let e=(t||"").trim();if(!e)return e;e=e.replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,"");const l=e.lastIndexOf("@");l>=0&&(e=e.slice(l+1));const f=e.search(/[/?#]/);f>=0&&(e=e.slice(0,f));const x=e.indexOf(":");return x>=0&&e.indexOf(":",x+1)<0&&(e=e.slice(0,x)),e.trim().toLowerCase()},Ae=async()=>{await pl("").then(({data:t})=>{q.value=t})},Pe=()=>{me.value=[{key:"VM",value:"VM"},{key:"k8s",value:"K8S"}]},Ne=()=>{d.value==="Application Uninstallation"?O.value=!1:O.value=!0},Me=async()=>{await il().then(async({data:t})=>{if(console.log("## data ### : ",t),_.value=t,_.value.length>0)if(!$.isEmpty(k.nsId))r.value=k.nsId;else if($.isEmpty(A.getNsId()))r.value=_.value[0].name;else{const e=A.getNsId();_.value.find(f=>f.name===e)?r.value=e:r.value=_.value[0].name}$.isEmpty(r.value)||(m.value==="VM"?await ne():m.value==="K8S"&&await oe())})},ne=async()=>{console.log(await Ee(r.value)),await Ee(r.value).then(async({data:t})=>{X.value=t,X.value.length>0?(N.value=X.value[0].name,await fe()):N.value=""})},fe=async()=>{const t={nsId:r.value,mciId:N.value};await ul(t).then(({data:e})=>{F.value=e.node,H.value=F.value.filter(l=>!C.value.includes(l.id)),M.value=""})},oe=async()=>{await rl(r.value).then(({data:t})=>{J.value=t,J.value.length>0?E.value=J.value[0].name:E.value="",c.value=le(),P.value=null}),await be()},be=async()=>{if(K.value=[],R.value="",Y.value=!1,!(m.value!=="K8S"||$.isEmpty(r.value)||$.isEmpty(E.value))){G.value=!0;try{const{data:t}=await gl({namespace:r.value,clusterName:E.value});K.value=Array.isArray(t)?t:[],R.value=Le(K.value)}catch{Y.value=!0,R.value=""}finally{G.value=!1}}},Le=t=>{var l;const e=t.find(f=>f.defaultClass);return(e==null?void 0:e.name)||((l=t[0])==null?void 0:l.name)||""},ie=async()=>{C.value=[],await ne(),D()},Re=async()=>{C.value=[],await fe(),D()},je=async()=>{await oe(),D()},D=()=>{d.value==="Application Installation"?O.value=!0:d.value==="Application Uninstallation"&&(O.value=!1)},Te=()=>{if(M.value!==""){if(I.value==="Standalone")C.value=[M.value];else if(I.value==="Clustering"&&!C.value.includes(M.value)){C.value.push(M.value);const t=H.value.findIndex(e=>e.id===M.value);t!==-1&&H.value.splice(t,1)}M.value="",D()}},$e=t=>{const e=C.value[t];if(C.value.splice(t,1),I.value==="Clustering"){const l=F.value.find(f=>f.id===e);l&&H.value.push(l)}D()},_e=async()=>{let t={};if(m.value==="VM"){j.value.split(",").map(l=>l.toLowerCase().trim());let e={};if(d.value=="Application Installation"){const l=I.value==="Clustering"?`${j.value}-cluster`:`${j.value}-standalone`,f=T.value===""?void 0:Number(T.value);e={namespace:r.value,mciId:N.value,vmIds:C.value,clusterName:l,catalogId:z.value,servicePort:f,username:"admin",deploymentType:m.value,vmDeploymentMode:I.value.toUpperCase(),resourceType:B.value},t=await ml(e)}else t=await xe(e);t.data?p.success("SUCCESS"):p.error("FAIL")}else if(m.value==="K8S"){if(!ke())return;j.value.split(",").map(x=>x.toLowerCase().trim());const e=T.value===""?void 0:Number(T.value),l=We();let f={namespace:r.value,clusterName:E.value,catalogId:z.value,servicePort:e,username:"",deploymentType:m.value,hpaEnabled:y.value.hpaEnabled,minReplicas:y.value.hpaMinReplicas,maxReplicas:y.value.hpaMaxReplicas,cpuThreshold:y.value.hpaCpuUtilization,memoryThreshold:y.value.hpaMemoryUtilization,resourceType:B.value,ingressEnabled:S.value.ingressEnabled,ingressHost:Ue(S.value.ingressHost),ingressPath:S.value.ingressPath,ingressClass:S.value.ingressClass,ingressTlsEnabled:S.value.ingressTlsEnabled,ingressTlsSecret:S.value.ingressTlsSecret,additionalConfig:l};d.value=="Application Installation"?t=await fl(f):t=await xe(f),t.data?p.success("SUCCESS"):p.error("FAIL")}},Ke=async()=>{if(m.value!=="VM"&&m.value!=="K8S"){p.error("Please Select Infra");return}if(!ke())return;const t=await Oe();let e=!0;if(t==null){p.error("Please select all items");return}else if(t===!1){let l="";m.value==="VM"?l="VM":m.value==="K8S"&&(l="CLUSTER");const f="Your selected "+l+" has lower specifications than recommended. Would you like to continue with the installation?";e=confirm(f)}e&&(p.success("Please click RUN"),O.value=!1)},Oe=async()=>{let t=!1;if(m.value==="VM"){if(r.value===""||N.value===""||C.value.length===0||z.value===0)return null;{const e={namespace:r.value,mciName:N.value,vmName:C.value[0],catalogId:z.value};await yl(e).then(({data:l})=>{t=l})}}else if(m.value==="K8S"){if(r.value===""||E.value===""||z.value===0)return null;const e={namespace:r.value,clusterName:E.value,catalogId:z.value};await hl(e).then(({data:l})=>{t=l})}return t},z=v(0),ue=h(()=>q.value.find(t=>t.id===z.value)),Q=h(()=>{var e;const t=J.value.find(l=>l.id===E.value||l.name===E.value);return((e=t==null?void 0:t.connectionConfig)==null?void 0:e.providerName)||(t==null?void 0:t.connectionName)||""}),ze=h(()=>{var t,e;return String(((e=(t=ue.value)==null?void 0:t.helmChart)==null?void 0:e.chartName)||"").toLowerCase()}),re=h(()=>ze.value==="loki"),W=h(()=>m.value==="K8S"&&re.value),He=h(()=>m.value==="K8S"&&d.value==="Application Installation"&&(W.value||K.value.length>0||Y.value)),Fe=h(()=>G.value||K.value.length<=1),Be=h(()=>G.value?"Loading StorageClasses...":Y.value?"Failed to load StorageClasses":K.value.length===0?"No StorageClass found":"Select StorageClass"),ee=h(()=>W.value?G.value?"StorageClass list is loading.":Y.value?"StorageClass list could not be loaded.":K.value.length===0?"Loki requires a StorageClass, but none was found.":$.isEmpty(R.value)?"Loki requires a StorageClass.":"":""),De=h(()=>ve(Q.value)?"Optional: https://s3.ap-northeast-2.amazonaws.com":"https://object-storage.example.com"),qe=h(()=>ve(Q.value)?"ap-northeast-2":"region from object storage service"),ce=h(()=>{var t;return m.value!=="K8S"||!((t=ue.value)!=null&&t.helmChart)?!1:re.value||Ye(ue.value)}),de=h(()=>m.value==="K8S"&&ce.value&&c.value.enabled),ge=h(()=>{var t;return!de.value||((t=P.value)==null?void 0:t.success)===!0}),Ge=h(()=>O.value||!ge.value||W.value&&!$.isEmpty(ee.value));function le(t=Q.value,e=ye.value){const l=ve(t);return{enabled:!!e,backendType:"s3",endpoint:"",region:"",bucket:"",accessKey:"",secretKey:"",forcePathStyle:!l}}function ve(t){return String(t||"").toLowerCase().includes("aws")}const ye=h(()=>m.value==="K8S"&&re.value);function Ye(t){return(t.catalogRefs||[]).some(l=>{const f=String(l.refType||"").toUpperCase();return String(l.refValue||"").toLowerCase()==="object-storage"&&(f==="CAPABILITY"||f==="TAG")})}function he(){return{enabled:c.value.enabled,backendType:c.value.backendType,endpoint:c.value.endpoint,region:c.value.region,bucket:c.value.bucket,accessKey:c.value.accessKey,secretKey:c.value.secretKey,forcePathStyle:c.value.forcePathStyle,insecure:Ze(c.value.endpoint)}}function We(){const t={};return $.isEmpty(R.value)||(t.storageClass=R.value),ce.value&&c.value.enabled&&(t.objectStorage=he()),Object.keys(t).length>0?t:void 0}function ke(){if(!W.value)return!0;const t=ee.value;return $.isEmpty(t)?!0:(p.error(t),!1)}function Ze(t){return String(t||"").trim().toLowerCase().startsWith("http://")}const Je=async(t=!0)=>{if(!de.value)return!0;Z.value=!0,P.value=null;const e={namespace:r.value,clusterName:E.value,catalogId:z.value,objectStorage:he()};try{const{data:l}=await bl(e);return P.value=l,l!=null&&l.success?(t&&p.success("Object Storage check succeeded"),!0):(t&&p.error("Object Storage check failed"),!1)}catch{return t&&p.error("Object Storage check failed"),!1}finally{Z.value=!1}},Ce=h(()=>m.value==="VM"?q.value.filter(t=>t.packageInfo):m.value==="K8S"?q.value.filter(t=>t.helmChart):q.value),Se=()=>{d.value==="Application Installation"&&(O.value=!0),q.value.forEach(t=>{if(j.value===t.name){z.value=t.id,T.value=t.defaultPort?String(t.defaultPort):"",y.value={hpaEnabled:!!t.hpaEnabled,hpaMinReplicas:t.minReplicas||1,hpaMaxReplicas:t.maxReplicas||10,hpaCpuUtilization:t.cpuThreshold||60,hpaMemoryUtilization:t.memoryThreshold||80},S.value={ingressEnabled:!!t.ingressEnabled,ingressHost:t.ingressHost||"",ingressPath:t.ingressPath||"/",ingressClass:t.ingressClass||"nginx",ingressTlsEnabled:!!t.ingressTlsEnabled,ingressTlsSecret:t.ingressTlsSecret||""},c.value=le(),P.value=null;return}})},Xe=async()=>{d.value==="Application Installation"&&(O.value=!0),c.value=le(),P.value=null,await be()};return(t,e)=>(o(),n("div",Cl,[a("div",Sl,[a("div",wl,[a("div",Il,[a("h5",El,b(d.value),1),a("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close",onClick:se})]),a("div",xl,[a("div",Vl,[e[34]||(e[34]=a("label",{class:"form-label"},"Target Infra",-1)),d.value=="Application Installation"?(o(),n("p",Ul," Select the Infra what is the Infra will be installed ")):d.value=="Application Uninstallation"?(o(),n("p",Al," Select the Infra what is the Infra will be uninstalled ")):g("",!0),u(a("select",{class:"form-select",id:"infra","onUpdate:modelValue":e[0]||(e[0]=l=>m.value=l)},[(o(!0),n(U,null,L(me.value,l=>(o(),n("option",{value:l.value,key:l.value},b(l.value),9,Pl))),128))],512),[[V,m.value]])]),m.value=="VM"?(o(),n(U,{key:0},[a("div",Nl,[e[35]||(e[35]=a("label",{class:"form-label"},"Namespace",-1)),d.value=="Application Installation"?(o(),n("p",Ml," Select the namespace where the application will be installed")):d.value=="Application Uninstallation"?(o(),n("p",Ll," Select the namespace where the application will be uninstalled")):g("",!0),_.value.length>0?u((o(),n("select",{key:2,class:"form-select",id:"namesapce","onUpdate:modelValue":e[1]||(e[1]=l=>r.value=l),onChange:ie},[(o(!0),n(U,null,L(_.value,l=>(o(),n("option",{value:l.name,key:l.name},b(l.name),9,Rl))),128))],544)),[[V,r.value]]):u((o(),n("select",{key:3,class:"form-select",id:"namesapce","onUpdate:modelValue":e[2]||(e[2]=l=>r.value=l),onChange:ie},[a("option",jl,b(r.value),1)],544)),[[V,r.value]])]),a("div",Tl,[e[36]||(e[36]=a("label",{class:"form-label"},"MCI Name",-1)),d.value=="Application Installation"?(o(),n("p",$l," Select the multi-cloud infrastructure information where the application will be deployed")):d.value=="Application Uninstallation"?(o(),n("p",_l," Remove the application and associated resources from the multi-cloud infrastructure")):g("",!0),u(a("select",{class:"form-select",id:"mci-name",disabled:r.value=="","onUpdate:modelValue":e[3]||(e[3]=l=>N.value=l),onChange:Re},[(o(!0),n(U,null,L(X.value,l=>(o(),n("option",{value:l.id,key:l.name},b(l.name),9,Ol))),128))],40,Kl),[[V,N.value]])]),a("div",zl,[e[38]||(e[38]=a("label",{class:"form-label"},"VM Name",-1)),e[39]||(e[39]=a("p",{class:"text-muted"}," Select the virtual machine (VM) within the chosen multi-cloud infrastructure where the application will be deployed",-1)),u(a("select",{class:"form-select",id:"mci-name",disabled:N.value=="","onUpdate:modelValue":e[4]||(e[4]=l=>M.value=l),onChange:Te},[e[37]||(e[37]=a("option",{value:""},"Select VM",-1)),(o(!0),n(U,null,L(H.value,l=>(o(),n("option",{value:l.id,key:l.name},b(l.name),9,Fl))),128))],40,Hl),[[V,M.value]]),C.value.length>0?(o(),n("div",Bl,[(o(!0),n(U,null,L(C.value,(l,f)=>(o(),n("label",{key:f,class:"form-check-label",style:{border:"1px solid #000",padding:"5px","border-radius":"5px",cursor:"pointer"}},[pe(b(l)+" ",1),a("span",{onClick:x=>$e(f),style:{"margin-left":"5px","font-weight":"bold"}},"X",8,Dl)]))),128))])):g("",!0)]),a("div",ql,[e[42]||(e[42]=a("label",{class:"form-label"},"Deployment Type",-1)),e[43]||(e[43]=a("p",{class:"text-muted"},"Select the deployment type",-1)),a("div",Gl,[a("div",Yl,[u(a("input",{class:"form-check-input",type:"radio",id:"Standalone","onUpdate:modelValue":e[5]||(e[5]=l=>I.value=l),value:"Standalone"},null,512),[[we,I.value]]),e[40]||(e[40]=a("label",{class:"form-check-label",for:"Standalone"},"Standalone",-1))]),a("div",Wl,[u(a("input",{class:"form-check-input",type:"radio",id:"Clustering","onUpdate:modelValue":e[6]||(e[6]=l=>I.value=l),value:"Clustering"},null,512),[[we,I.value]]),e[41]||(e[41]=a("label",{class:"form-check-label",for:"Clustering"},"Clustering",-1))])])]),a("div",Zl,[e[44]||(e[44]=a("label",{class:"form-label"},"Application",-1)),e[45]||(e[45]=a("p",{class:"text-muted"},"Select the application",-1)),u(a("select",{class:"form-select","onUpdate:modelValue":e[7]||(e[7]=l=>j.value=l),onChange:Se},[(o(!0),n(U,null,L(Ce.value,(l,f)=>{var x;return o(),n("option",{key:f,value:l.name}," ["+b(l.name)+"] "+b(((x=l.packageInfo)==null?void 0:x.packageVersion)||"latest"),9,Jl)}),128))],544),[[V,j.value]])]),a("div",Xl,[e[46]||(e[46]=a("label",{class:"form-label"},"Port",-1)),e[47]||(e[47]=a("p",{class:"text-muted"},"Please enter a port accessible from the outside",-1)),u(a("input",{type:"number",class:"form-control",placeholder:"8080","onUpdate:modelValue":e[8]||(e[8]=l=>T.value=l)},null,512),[[w,T.value]])]),d.value=="Application Installation"?(o(),n("div",Ql,[e[49]||(e[49]=a("label",{class:"form-label"},"Resource Type",-1)),u(a("select",{class:"form-select","onUpdate:modelValue":e[9]||(e[9]=l=>B.value=l)},e[48]||(e[48]=[a("option",{value:"GENERAL_PURPOSE"},"General Purpose",-1),a("option",{value:"CPU_INTENSIVE"},"CPU Intensive",-1),a("option",{value:"MEMORY_INTENSIVE"},"Memory Intensive",-1)]),512),[[V,B.value]])])):g("",!0)],64)):m.value=="K8S"?(o(),n(U,{key:1},[a("div",ea,[e[50]||(e[50]=a("label",{class:"form-label"},"Namespace",-1)),d.value=="Application Installation"?(o(),n("p",la,"Select the namespace where the application will be installed")):d.value=="Application Uninstallation"?(o(),n("p",aa,"Select the namespace where the application will be uninstalled")):g("",!0),_.value.length>0?u((o(),n("select",{key:2,class:"form-select",id:"namesapce","onUpdate:modelValue":e[10]||(e[10]=l=>r.value=l),onChange:je},[(o(!0),n(U,null,L(_.value,l=>(o(),n("option",{value:l.name,key:l.name},b(l.name),9,ta))),128))],544)),[[V,r.value]]):u((o(),n("select",{key:3,class:"form-select",id:"namesapce","onUpdate:modelValue":e[11]||(e[11]=l=>r.value=l),onChange:ie},[a("option",sa,b(r.value),1)],544)),[[V,r.value]])]),a("div",na,[e[51]||(e[51]=a("label",{class:"form-label"},"ClusterName",-1)),d.value=="Application Installation"?(o(),n("p",oa,"Select the name of the cluster where the application will be deployed")):d.value=="Application Uninstallation"?(o(),n("p",ia,"Remove the application and associated resources from the multi-cloud infrastructure")):g("",!0),u(a("select",{class:"form-select",id:"mci-name",disabled:r.value=="","onUpdate:modelValue":e[12]||(e[12]=l=>E.value=l),onChange:Xe},[(o(!0),n(U,null,L(J.value,l=>(o(),n("option",{value:l.id,key:l.name},b(l.name),9,ra))),128))],40,ua),[[V,E.value]])]),a("div",ca,[e[52]||(e[52]=a("label",{class:"form-label"},"Helm chart",-1)),e[53]||(e[53]=a("p",{class:"text-muted"},"Select the application",-1)),u(a("select",{class:"form-select","onUpdate:modelValue":e[13]||(e[13]=l=>j.value=l),onChange:Se},[(o(!0),n(U,null,L(Ce.value,(l,f)=>{var x;return o(),n("option",{key:f,value:l.name}," ["+b(l.name)+"] "+b(((x=l.helmChart)==null?void 0:x.chartVersion)||"latest"),9,da)}),128))],544),[[V,j.value]])]),d.value=="Application Installation"?(o(),n("div",va,[e[54]||(e[54]=a("label",{class:"form-label"},"Port",-1)),e[55]||(e[55]=a("p",{class:"text-muted"},"Please enter a service port for the Kubernetes service",-1)),u(a("input",{type:"number",class:"form-control",placeholder:"80","onUpdate:modelValue":e[14]||(e[14]=l=>T.value=l)},null,512),[[w,T.value]])])):g("",!0),d.value=="Application Installation"?(o(),n("div",pa,[e[57]||(e[57]=a("label",{class:"form-label"},"Resource Type",-1)),u(a("select",{class:"form-select","onUpdate:modelValue":e[15]||(e[15]=l=>B.value=l)},e[56]||(e[56]=[a("option",{value:"GENERAL_PURPOSE"},"General Purpose",-1),a("option",{value:"CPU_INTENSIVE"},"CPU Intensive",-1),a("option",{value:"MEMORY_INTENSIVE"},"Memory Intensive",-1)]),512),[[V,B.value]])])):g("",!0),d.value=="Application Installation"&&He.value?(o(),n("div",ma,[a("label",{class:Ie(["form-label",{required:W.value}])},"Storage Class",2),u(a("select",{class:"form-select","onUpdate:modelValue":e[16]||(e[16]=l=>R.value=l),disabled:Fe.value},[a("option",ba,b(Be.value),1),(o(!0),n(U,null,L(K.value,l=>(o(),n("option",{key:l.name,value:l.name},b(l.name)+b(l.defaultClass?" (default)":""),9,ga))),128))],8,fa),[[V,R.value]]),W.value&&ee.value?(o(),n("p",ya,b(ee.value),1)):g("",!0)])):g("",!0),d.value=="Application Installation"?(o(),n("div",ha,[e[65]||(e[65]=a("label",{class:"form-label"},"HPA Configuration",-1)),a("div",ka,[a("div",Ca,[u(a("input",{class:"form-check-input",type:"checkbox",id:"hpaEnabled","onUpdate:modelValue":e[17]||(e[17]=l=>y.value.hpaEnabled=l)},null,512),[[te,y.value.hpaEnabled]]),e[58]||(e[58]=a("label",{class:"form-check-label",for:"hpaEnabled"}," Enable HPA (Horizontal Pod Autoscaler) ",-1))])]),y.value.hpaEnabled?(o(),n("div",Sa,[a("div",null,[e[59]||(e[59]=a("label",{class:"form-label required"}," minReplicas ",-1)),u(a("input",{type:"number",class:"form-control w-90-per",placeholder:"1","onUpdate:modelValue":e[18]||(e[18]=l=>y.value.hpaMinReplicas=l)},null,512),[[w,y.value.hpaMinReplicas]])]),a("div",null,[e[60]||(e[60]=a("label",{class:"form-label required"}," maxReplicas ",-1)),u(a("input",{type:"number",class:"form-control w-90-per",placeholder:"10","onUpdate:modelValue":e[19]||(e[19]=l=>y.value.hpaMaxReplicas=l)},null,512),[[w,y.value.hpaMaxReplicas]])]),a("div",null,[e[61]||(e[61]=a("label",{class:"form-check-label mb-2"}," CPU (%) ",-1)),u(a("input",{type:"number",class:"form-control w-80-per d-inline",placeholder:"60","onUpdate:modelValue":e[20]||(e[20]=l=>y.value.hpaCpuUtilization=l)},null,512),[[w,y.value.hpaCpuUtilization]]),e[62]||(e[62]=pe(" % "))]),a("div",null,[e[63]||(e[63]=a("label",{class:"form-check-label mb-2"}," MEMORY (%) ",-1)),u(a("input",{type:"number",class:"form-control w-80-per d-inline",placeholder:"80","onUpdate:modelValue":e[21]||(e[21]=l=>y.value.hpaMemoryUtilization=l)},null,512),[[w,y.value.hpaMemoryUtilization]]),e[64]||(e[64]=pe(" % "))])])):g("",!0)])):g("",!0),d.value=="Application Installation"?(o(),n("div",wa,[e[70]||(e[70]=a("label",{class:"form-label"},"Ingress Configuration",-1)),a("div",Ia,[a("div",Ea,[u(a("input",{class:"form-check-input",type:"checkbox",id:"ingressEnabled","onUpdate:modelValue":e[22]||(e[22]=l=>S.value.ingressEnabled=l)},null,512),[[te,S.value.ingressEnabled]]),e[66]||(e[66]=a("label",{class:"form-check-label",for:"ingressEnabled"}," Enable Ingress ",-1))])]),S.value.ingressEnabled?(o(),n("div",xa,[a("div",Va,[e[67]||(e[67]=a("label",{class:"form-label"},"Host",-1)),u(a("input",{type:"text",class:"form-control",placeholder:"example.com","onUpdate:modelValue":e[23]||(e[23]=l=>S.value.ingressHost=l)},null,512),[[w,S.value.ingressHost]])]),a("div",Ua,[e[68]||(e[68]=a("label",{class:"form-label"},"Path",-1)),u(a("input",{type:"text",class:"form-control",placeholder:"/","onUpdate:modelValue":e[24]||(e[24]=l=>S.value.ingressPath=l)},null,512),[[w,S.value.ingressPath]])]),a("div",Aa,[e[69]||(e[69]=a("label",{class:"form-label"},"Ingress Class",-1)),u(a("input",{type:"text",class:"form-control",placeholder:"nginx","onUpdate:modelValue":e[25]||(e[25]=l=>S.value.ingressClass=l),disabled:""},null,512),[[w,S.value.ingressClass]])])])):g("",!0)])):g("",!0),d.value=="Application Installation"&&ce.value?(o(),n("div",Pa,[e[80]||(e[80]=a("label",{class:"form-label"},"Object Storage Configuration",-1)),a("div",Na,[a("div",Ma,[u(a("input",{class:"form-check-input",type:"checkbox",id:"objectStorageEnabled","onUpdate:modelValue":e[26]||(e[26]=l=>c.value.enabled=l),disabled:ye.value},null,8,La),[[te,c.value.enabled]]),e[71]||(e[71]=a("label",{class:"form-check-label",for:"objectStorageEnabled"}," Enable Object Storage ",-1))])]),c.value.enabled?(o(),n("div",Ra,[a("div",ja,[a("div",Ta,[e[72]||(e[72]=a("label",{class:"form-label"},"Target CSP",-1)),a("input",{type:"text",class:"form-control",value:Q.value||"-",disabled:""},null,8,$a)]),e[73]||(e[73]=a("div",{class:"w-50 ms-2"},[a("label",{class:"form-label"},"Storage API"),a("input",{type:"text",class:"form-control",value:"S3-compatible",disabled:""})],-1))]),a("div",_a,[e[74]||(e[74]=a("label",{class:"form-label"},"S3-compatible Endpoint",-1)),u(a("input",{type:"text",class:"form-control",placeholder:De.value,"onUpdate:modelValue":e[27]||(e[27]=l=>c.value.endpoint=l)},null,8,Ka),[[w,c.value.endpoint]])]),a("div",Oa,[a("div",za,[e[75]||(e[75]=a("label",{class:"form-label"},"Region",-1)),u(a("input",{type:"text",class:"form-control",placeholder:qe.value,"onUpdate:modelValue":e[28]||(e[28]=l=>c.value.region=l)},null,8,Ha),[[w,c.value.region]])]),a("div",Fa,[e[76]||(e[76]=a("label",{class:"form-label"},"Bucket Name",-1)),u(a("input",{type:"text",class:"form-control",placeholder:"object-storage-bucket","onUpdate:modelValue":e[29]||(e[29]=l=>c.value.bucket=l)},null,512),[[w,c.value.bucket]])])]),a("div",Ba,[a("div",Da,[e[77]||(e[77]=a("label",{class:"form-label"},"Access Key ID",-1)),u(a("input",{type:"password",class:"form-control",placeholder:"access key id","onUpdate:modelValue":e[30]||(e[30]=l=>c.value.accessKey=l),autocomplete:"off"},null,512),[[w,c.value.accessKey]])]),a("div",qa,[e[78]||(e[78]=a("label",{class:"form-label"},"Secret Access Key",-1)),u(a("input",{type:"password",class:"form-control",placeholder:"secret access key","onUpdate:modelValue":e[31]||(e[31]=l=>c.value.secretKey=l),autocomplete:"off"},null,512),[[w,c.value.secretKey]])])]),a("div",Ga,[a("div",Ya,[u(a("input",{class:"form-check-input",type:"checkbox",id:"forcePathStyle","onUpdate:modelValue":e[32]||(e[32]=l=>c.value.forcePathStyle=l)},null,512),[[te,c.value.forcePathStyle]]),e[79]||(e[79]=a("label",{class:"form-check-label",for:"forcePathStyle",title:"On: endpoint/bucket/object. Off: bucket.endpoint/object."},"Use path-style URL",-1))])]),P.value?(o(),n("div",{key:0,class:Ie(["alert mt-3",P.value.success?"alert-success":"alert-danger"])},[a("div",null,b(P.value.success?"Object Storage: SUCCESS":"Object Storage: FAILED"),1),a("ul",Wa,[(o(!0),n(U,null,L(P.value.checks,l=>(o(),n("li",{key:l.name},b(l.name)+" - "+b(l.success?"OK":"FAIL"),1))),128))])],2)):g("",!0)])):g("",!0)])):g("",!0)],64)):g("",!0)]),a("div",Za,[a("a",{class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:se}," Cancel "),a("div",null,[d.value=="Application Installation"&&de.value?(o(),n("button",{key:0,class:"btn btn-outline-danger ms-auto me-1",onClick:e[33]||(e[33]=l=>Je()),disabled:Z.value||ge.value,title:"Writes, reads, and deletes a temporary object in the selected bucket."},b(Z.value?"Checking...":"Storage Check"),9,Ja)):g("",!0),d.value=="Application Installation"?(o(),n("button",{key:1,class:"btn btn-danger ms-auto me-1",onClick:Ke,disabled:!O.value}," Spec Check ",8,Xa)):g("",!0),a("button",{class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:_e,disabled:Ge.value}," Deploy ",8,Qa)])])])])]))}}),At=ol(et,[["__scopeId","data-v-6594bb78"]]);export{At as A,ot as I,It as a,xt as b,Vt as c,Et as d,mt as e,bt as f,Ut as g,dt as h,it as i,gt as j,yt as k,pt as l,ht as m,kt as n,pl as o,ut as p,rt as q,xe as r,wt as s,Ct as t,vt as u,St as v,ft as w,ct as x}; diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index d0ea0ae0..a4ef39cf 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -5,7 +5,7 @@ App - + From 37c7a9d2d27db5b5b933e1a0ac4a1cc0b513d9dd Mon Sep 17 00:00:00 2001 From: jmin Date: Sun, 14 Jun 2026 21:49:01 +0900 Subject: [PATCH 6/6] Support Tumblebug K8s auth and Rclone deployment --- .../applicationInstallationForm.vue | 17 +-- .../cbtumblebug/api/CbtumblebugRestApi.java | 42 +++++++ .../config/AwsKubeConfigProvider.java | 28 +---- .../config/GcpKubeConfigProvider.java | 22 +--- .../config/KubeConfigProviderFactory.java | 26 +--- .../kubernetes/config/KubeconfigResolver.java | 111 ++++++++++++++++++ .../config/KubernetesClientFactory.java | 12 +- .../kubernetes/service/HelmChartService.java | 78 ++++++++++-- .../service/KubernetesDeployService.java | 11 +- src/main/resources/application-local.yaml | 39 ++++++ src/main/resources/application.yaml | 5 - src/main/resources/import.sql | 23 ++-- ...nPlus-0MYkWKdM.js => IconPlus-DSGNl2n-.js} | 2 +- ...ssList-CUqe4g5_.js => OssList-Cshnqjym.js} | 2 +- .../assets/RepositoryDetail-C-HflYxV.js | 1 + .../assets/RepositoryDetail-Dsfw98Ui.js | 1 - ...e_type_script_setup_true_lang-BeRAe75J.js} | 2 +- .../static/assets/RepositoryList-BkyTcYpV.js | 1 - .../static/assets/RepositoryList-DbejlMQ4.js | 1 + ...e_type_script_setup_true_lang-De9FAPa7.js} | 2 +- ...-Fozz0b.js => SoftwareCatalog-C_qYfL50.js} | 2 +- ...js => SoftwareCatalogListTest-ek2RB0zr.js} | 2 +- ...e_vue_type_style_index_0_lang-DicuGnRr.js} | 2 +- ...e-Wt35UcvC.js => YamlGenerate-BwVaS-Ks.js} | 2 +- ...-LCYmWnCj.js => bootstrap.esm-B0L675-L.js} | 2 +- .../{index-nMoWjTPe.js => index-BrBdH8Ja.js} | 4 +- ...{lodash-CMOUKIpU.js => lodash-Ckz77png.js} | 2 +- ...ory-0d7heipW.js => repository-CtVP2sS0.js} | 2 +- ...equest-BXz87ydW.js => request-aRA9bZgg.js} | 2 +- ...n.css => softwareCatalogForm-BpU3DtUw.css} | 2 +- ...e_index_0_scoped_f2edc4ae_lang-B-4aYvvX.js | 6 + ...e_index_0_scoped_f2edc4ae_lang-DuIt1swN.js | 6 - src/main/resources/static/index.html | 2 +- 33 files changed, 318 insertions(+), 144 deletions(-) create mode 100644 src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubeconfigResolver.java create mode 100644 src/main/resources/application-local.yaml rename src/main/resources/static/assets/{IconPlus-0MYkWKdM.js => IconPlus-DSGNl2n-.js} (96%) rename src/main/resources/static/assets/{OssList-CUqe4g5_.js => OssList-Cshnqjym.js} (96%) create mode 100644 src/main/resources/static/assets/RepositoryDetail-C-HflYxV.js delete mode 100644 src/main/resources/static/assets/RepositoryDetail-Dsfw98Ui.js rename src/main/resources/static/assets/{RepositoryDetail.vue_vue_type_script_setup_true_lang-C6606I4v.js => RepositoryDetail.vue_vue_type_script_setup_true_lang-BeRAe75J.js} (96%) delete mode 100644 src/main/resources/static/assets/RepositoryList-BkyTcYpV.js create mode 100644 src/main/resources/static/assets/RepositoryList-DbejlMQ4.js rename src/main/resources/static/assets/{RepositoryList.vue_vue_type_script_setup_true_lang-bf_PvRD5.js => RepositoryList.vue_vue_type_script_setup_true_lang-De9FAPa7.js} (96%) rename src/main/resources/static/assets/{SoftwareCatalog-C-Fozz0b.js => SoftwareCatalog-C_qYfL50.js} (99%) rename src/main/resources/static/assets/{SoftwareCatalogListTest-DjCbxOSW.js => SoftwareCatalogListTest-ek2RB0zr.js} (96%) rename src/main/resources/static/assets/{Tabulator.vue_vue_type_style_index_0_lang-By28-D7G.js => Tabulator.vue_vue_type_style_index_0_lang-DicuGnRr.js} (99%) rename src/main/resources/static/assets/{YamlGenerate-Wt35UcvC.js => YamlGenerate-BwVaS-Ks.js} (99%) rename src/main/resources/static/assets/{bootstrap.esm-LCYmWnCj.js => bootstrap.esm-B0L675-L.js} (99%) rename src/main/resources/static/assets/{index-nMoWjTPe.js => index-BrBdH8Ja.js} (99%) rename src/main/resources/static/assets/{lodash-CMOUKIpU.js => lodash-Ckz77png.js} (99%) rename src/main/resources/static/assets/{repository-0d7heipW.js => repository-CtVP2sS0.js} (89%) rename src/main/resources/static/assets/{request-BXz87ydW.js => request-aRA9bZgg.js} (88%) rename src/main/resources/static/assets/{softwareCatalogForm-7J7U2k9n.css => softwareCatalogForm-BpU3DtUw.css} (60%) create mode 100644 src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-B-4aYvvX.js delete mode 100644 src/main/resources/static/assets/softwareCatalogForm.vue_vue_type_style_index_0_scoped_f2edc4ae_lang-DuIt1swN.js diff --git a/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue b/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue index 4cc634fe..a8bc5d03 100644 --- a/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue +++ b/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue @@ -82,17 +82,17 @@
- +
- +

- Select the multi-cloud infrastructure information where the application will be deployed

+ Select the infra ID where the application will be deployed

- Remove the application and associated resources from the multi-cloud infrastructure

+ Remove the application and associated resources from the infra

@@ -827,7 +828,7 @@ const _getMciName = async () => { await getMciInfo(selectNsId.value).then(async ({ data }) => { mciList.value = data; if(mciList.value.length > 0) { - selectMci.value = mciList.value[0].name; + selectMci.value = mciList.value[0].id || mciList.value[0].name; await _getVmName(); } else { selectMci.value = ""; diff --git a/src/main/java/kr/co/mcmp/ape/cbtumblebug/api/CbtumblebugRestApi.java b/src/main/java/kr/co/mcmp/ape/cbtumblebug/api/CbtumblebugRestApi.java index 64b7235c..fe0c722c 100644 --- a/src/main/java/kr/co/mcmp/ape/cbtumblebug/api/CbtumblebugRestApi.java +++ b/src/main/java/kr/co/mcmp/ape/cbtumblebug/api/CbtumblebugRestApi.java @@ -298,6 +298,48 @@ public K8sClusterDto getK8sClusterByName(String namespace, String clusterName) { }); } + public String getK8sClusterKubeconfig(String namespace, String clusterName) { + log.info("Fetching K8s Cluster kubeconfig by name: {} in namespace: {}", clusterName, namespace); + return executeWithConnectionCheck("getK8sClusterKubeconfig", () -> { + String apiUrl = createApiUrl(String.format("/tumblebug/ns/%s/k8sCluster/%s/kubeconfig", namespace, clusterName)); + HttpHeaders headers = createCommonHeaders(); + ResponseEntity response = restClient.request( + apiUrl, + headers, + null, + HttpMethod.GET, + new ParameterizedTypeReference() { + }); + JsonNode body = response.getBody(); + String kubeconfig = body != null ? body.path("kubeconfig").asText(null) : null; + if (kubeconfig == null || kubeconfig.trim().isEmpty()) { + throw new CbtumblebugException("Tumblebug kubeconfig response is empty"); + } + return kubeconfig; + }); + } + + public String getK8sClusterToken(String namespace, String clusterName) { + log.info("Fetching K8s Cluster token by name: {} in namespace: {}", clusterName, namespace); + return executeWithConnectionCheck("getK8sClusterToken", () -> { + String apiUrl = createApiUrl(String.format("/tumblebug/ns/%s/k8sCluster/%s/token", namespace, clusterName)); + HttpHeaders headers = createCommonHeaders(); + ResponseEntity response = restClient.request( + apiUrl, + headers, + null, + HttpMethod.GET, + new ParameterizedTypeReference() { + }); + JsonNode body = response.getBody(); + String token = body != null ? body.path("execCredential").path("status").path("token").asText(null) : null; + if (token == null || token.trim().isEmpty()) { + throw new CbtumblebugException("Tumblebug token response is empty"); + } + return token; + }); + } + public MciDto getMciByMciId(String nsId, String mciId) { log.info("Fetching MCI by mciId: {}", mciId); return executeWithConnectionCheck("getMciByMciId", () -> { diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/AwsKubeConfigProvider.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/AwsKubeConfigProvider.java index 35bad5da..92a5e96e 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/AwsKubeConfigProvider.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/AwsKubeConfigProvider.java @@ -2,34 +2,14 @@ import io.fabric8.kubernetes.client.Config; import kr.co.mcmp.ape.cbtumblebug.dto.K8sClusterDto; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.net.URI; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.List; - @Component public class AwsKubeConfigProvider implements KubeConfigProvider { - @Value("${spider.url}") - private String spiderUrl; - - @Value("${spider.port}") - private String spiderPort; - - @Value("${spider.checkhost}") - private List spiderChekdHosts; - - @Override public Config buildConfig(K8sClusterDto dto) { - String yaml = dto.getAccessInfo().getKubeconfig(); - Config cfg = Config.fromKubeconfig(KubeConfigProviderFactory.replaceUrlHostByPort(yaml, spiderPort, spiderChekdHosts, spiderUrl)); + Config cfg = Config.fromKubeconfig(getOriginalKubeconfigYaml(dto)); cfg.setTrustCerts(true); cfg.setConnectionTimeout(30_000); cfg.setRequestTimeout(30_000); @@ -48,15 +28,15 @@ public String getOriginalKubeconfigYaml(K8sClusterDto dto) { } if (dto.getAccessInfo() == null) { - throw new IllegalStateException("AccessInfo is null for Azure cluster: " + dto.getName()); + throw new IllegalStateException("AccessInfo is null for AWS cluster: " + dto.getName()); } String kubeconfig = dto.getAccessInfo().getKubeconfig(); if (kubeconfig == null || kubeconfig.trim().isEmpty()) { - throw new IllegalStateException("Kubeconfig is null or empty for Azure cluster: " + dto.getName()); + throw new IllegalStateException("Kubeconfig is null or empty for AWS cluster: " + dto.getName()); } - return KubeConfigProviderFactory.replaceUrlHostByPort(kubeconfig, spiderPort, spiderChekdHosts, spiderUrl); + return kubeconfig; } } diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/GcpKubeConfigProvider.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/GcpKubeConfigProvider.java index abb28d48..0816e9d6 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/GcpKubeConfigProvider.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/GcpKubeConfigProvider.java @@ -2,28 +2,14 @@ import io.fabric8.kubernetes.client.Config; import kr.co.mcmp.ape.cbtumblebug.dto.K8sClusterDto; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import java.util.List; - @Component public class GcpKubeConfigProvider implements KubeConfigProvider { - @Value("${spider.url}") - private String spiderUrl; - - @Value("${spider.port}") - private String spiderPort; - - @Value("${spider.checkhost}") - private List spiderChekdHosts; - - @Override public Config buildConfig(K8sClusterDto dto) { - String yaml = dto.getAccessInfo().getKubeconfig(); - Config cfg = Config.fromKubeconfig(KubeConfigProviderFactory.replaceUrlHostByPort(yaml, spiderPort, spiderChekdHosts, spiderUrl)); + Config cfg = Config.fromKubeconfig(getOriginalKubeconfigYaml(dto)); cfg.setTrustCerts(true); cfg.setConnectionTimeout(30_000); cfg.setRequestTimeout(30_000); @@ -42,15 +28,15 @@ public String getOriginalKubeconfigYaml(K8sClusterDto dto) { } if (dto.getAccessInfo() == null) { - throw new IllegalStateException("AccessInfo is null for Azure cluster: " + dto.getName()); + throw new IllegalStateException("AccessInfo is null for GCP cluster: " + dto.getName()); } String kubeconfig = dto.getAccessInfo().getKubeconfig(); if (kubeconfig == null || kubeconfig.trim().isEmpty()) { - throw new IllegalStateException("Kubeconfig is null or empty for Azure cluster: " + dto.getName()); + throw new IllegalStateException("Kubeconfig is null or empty for GCP cluster: " + dto.getName()); } - return KubeConfigProviderFactory.replaceUrlHostByPort(kubeconfig, spiderPort, spiderChekdHosts, spiderUrl); + return kubeconfig; } } diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubeConfigProviderFactory.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubeConfigProviderFactory.java index a3a7d4ea..bc3f6be3 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubeConfigProviderFactory.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubeConfigProviderFactory.java @@ -1,8 +1,6 @@ package kr.co.mcmp.softwarecatalog.kubernetes.config; import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import org.springframework.stereotype.Component; @@ -21,30 +19,8 @@ public KubeConfigProvider getProvider(String providerName) { .orElseThrow(() -> new IllegalArgumentException("Unsupported CSP: " + providerName)); } - public static String replaceUrlHostByPort(String text, String checkPort, List checkHost, String newHost) { - String urlRegex = "(?https?)://(?[^:/\\s]+)(:(?\\d+))?(?/[^\\s]*)?"; - Pattern pattern = Pattern.compile(urlRegex); - Matcher matcher = pattern.matcher(text); - - StringBuffer resultBuffer = new StringBuffer(); - while (matcher.find()) { - String host = matcher.group("host").toLowerCase(); - String port = matcher.group("port"); - if (port != null && port.equals(checkPort) && checkHost.contains(host)) { - String protocol = matcher.group("protocol"); - String filePart = matcher.group("filePart") != null ? matcher.group("filePart") : ""; - matcher.appendReplacement(resultBuffer, Matcher.quoteReplacement(protocol + "://" + newHost + ":" + checkPort + filePart)); - } else { - matcher.appendReplacement(resultBuffer, matcher.group(0)); - } - } - matcher.appendTail(resultBuffer); - - return resultBuffer.toString(); - } - public static String replaceUnnecessaryQuote(String text) { return text.replaceAll("'\"|\"'", "\""); } -} \ No newline at end of file +} diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubeconfigResolver.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubeconfigResolver.java new file mode 100644 index 00000000..dbac5405 --- /dev/null +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubeconfigResolver.java @@ -0,0 +1,111 @@ +package kr.co.mcmp.softwarecatalog.kubernetes.config; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; +import org.yaml.snakeyaml.DumperOptions; +import org.yaml.snakeyaml.Yaml; + +import io.fabric8.kubernetes.client.Config; +import kr.co.mcmp.ape.cbtumblebug.api.CbtumblebugRestApi; +import kr.co.mcmp.ape.cbtumblebug.dto.K8sClusterDto; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +@Component +@Slf4j +@RequiredArgsConstructor +public class KubeconfigResolver { + + private final CbtumblebugRestApi cbtumblebugRestApi; + private final KubeConfigProviderFactory providerFactory; + + public Config buildConfig(String namespace, String clusterName) { + String kubeconfigYaml = getKubeconfigYaml(namespace, clusterName); + Config config = Config.fromKubeconfig(kubeconfigYaml); + config.setTrustCerts(true); + config.setConnectionTimeout(30_000); + config.setRequestTimeout(30_000); + return config; + } + + public String getKubeconfigYaml(String namespace, String clusterName) { + K8sClusterDto clusterDto = cbtumblebugRestApi.getK8sClusterByName(namespace, clusterName); + if (clusterDto == null) { + throw new IllegalStateException("K8s cluster not found: " + clusterName); + } + + String providerName = getProviderName(clusterDto); + KubeConfigProvider provider = providerFactory.getProvider(providerName); + + if (!usesTumblebugNativeAuth(providerName)) { + return provider.getOriginalKubeconfigYaml(clusterDto); + } + + String kubeconfigYaml = cbtumblebugRestApi.getK8sClusterKubeconfig(namespace, clusterName); + String token = cbtumblebugRestApi.getK8sClusterToken(namespace, clusterName); + return injectToken(kubeconfigYaml, token); + } + + private String getProviderName(K8sClusterDto clusterDto) { + if (clusterDto.getConnectionConfig() == null + || StringUtils.isBlank(clusterDto.getConnectionConfig().getProviderName())) { + throw new IllegalStateException("ProviderName is empty for K8s cluster: " + clusterDto.getName()); + } + return clusterDto.getConnectionConfig().getProviderName(); + } + + private boolean usesTumblebugNativeAuth(String providerName) { + return StringUtils.equalsIgnoreCase(providerName, "aws") + || StringUtils.equalsIgnoreCase(providerName, "gcp"); + } + + @SuppressWarnings("unchecked") + private String injectToken(String kubeconfigYaml, String token) { + if (StringUtils.isBlank(token)) { + return kubeconfigYaml; + } + + Yaml yaml = new Yaml(); + Object loaded = yaml.load(kubeconfigYaml); + if (!(loaded instanceof Map rootMap)) { + return kubeconfigYaml; + } + + Map root = (Map) rootMap; + Object usersObject = root.get("users"); + if (!(usersObject instanceof List users)) { + return kubeconfigYaml; + } + + boolean updated = false; + for (Object userObject : users) { + if (!(userObject instanceof Map userEntryMap)) { + continue; + } + + Map userEntry = (Map) userEntryMap; + Object userConfigObject = userEntry.get("user"); + if (!(userConfigObject instanceof Map userConfigMap)) { + continue; + } + + Map userConfig = (Map) userConfigMap; + userConfig.remove("exec"); + userConfig.put("token", token); + updated = true; + } + + if (!updated) { + log.warn("No kubeconfig users were updated with Tumblebug token"); + return kubeconfigYaml; + } + + DumperOptions options = new DumperOptions(); + options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); + options.setPrettyFlow(true); + return new Yaml(options).dump(root); + } +} diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubernetesClientFactory.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubernetesClientFactory.java index 690ef060..b68d85ea 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubernetesClientFactory.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/config/KubernetesClientFactory.java @@ -2,9 +2,6 @@ import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.KubernetesClientBuilder; -import kr.co.mcmp.ape.cbtumblebug.api.CbtumblebugRestApi; -import kr.co.mcmp.ape.cbtumblebug.dto.K8sClusterDto; -import kr.co.mcmp.softwarecatalog.kubernetes.config.KubeConfigProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -13,17 +10,12 @@ @Slf4j @RequiredArgsConstructor public class KubernetesClientFactory { - private final CbtumblebugRestApi api; - private final KubeConfigProviderFactory providerFactory; + private final KubeconfigResolver kubeconfigResolver; public KubernetesClient getClient(String namespace, String clusterName) { try { - K8sClusterDto dto = api.getK8sClusterByName(namespace, clusterName); - String providerName = dto.getConnectionConfig().getProviderName(); - KubeConfigProvider provider = providerFactory.getProvider(providerName); - KubernetesClient client = new KubernetesClientBuilder() - .withConfig(provider.buildConfig(dto)) + .withConfig(kubeconfigResolver.buildConfig(namespace, clusterName)) .build(); diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java index 8ee4937f..c33c0cc3 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java @@ -20,8 +20,7 @@ import kr.co.mcmp.ape.cbtumblebug.dto.K8sClusterDto; import kr.co.mcmp.softwarecatalog.CatalogRepository; import kr.co.mcmp.softwarecatalog.SoftwareCatalog; -import kr.co.mcmp.softwarecatalog.kubernetes.config.KubeConfigProviderFactory; -import kr.co.mcmp.softwarecatalog.kubernetes.config.KubeConfigProvider; +import kr.co.mcmp.softwarecatalog.kubernetes.config.KubeconfigResolver; import kr.co.mcmp.softwarecatalog.kubernetes.util.ReleaseNameGenerator; import kr.co.mcmp.softwarecatalog.application.dto.DeploymentConfigDTO; import lombok.RequiredArgsConstructor; @@ -46,7 +45,7 @@ public class HelmChartService { private static final String HELM_WAIT_TIMEOUT = "10m"; private final CbtumblebugRestApi cbtumblebugRestApi; - private final KubeConfigProviderFactory providerFactory; + private final KubeconfigResolver kubeconfigResolver; private final ReleaseNameGenerator releaseNameGenerator; private final CatalogRepository catalogRepository; private final KubernetesStorageClassService kubernetesStorageClassService; @@ -69,10 +68,9 @@ public Release deployHelmChart(KubernetesClient client, String namespace, Softwa try { // 1. 클러스터 정보 조회 K8sClusterDto clusterDto = cbtumblebugRestApi.getK8sClusterByName(namespace, clusterName); + String kubeconfigYaml = kubeconfigResolver.getKubeconfigYaml(namespace, clusterName); // 2. Kubeconfig YAML 생성 - String kubeconfigYaml = providerFactory.getProvider(clusterDto.getConnectionConfig().getProviderName()) - .getOriginalKubeconfigYaml(clusterDto); // 3. 임시 kubeconfig 파일 생성 tempKubeconfigPath = createTempKubeconfigFile(kubeconfigYaml); @@ -229,6 +227,10 @@ public Release deployHelmChart(KubernetesClient client, String namespace, Softwa } // Helm CLI로 설치 실행 + if (isRcloneChart(helmChart)) { + applyRcloneGuiDefaults(values, catalog.getDefaultPort()); + } + runHelmInstallCli(releaseName, chartRef, namespace, helmChart.getChartVersion(), tempKubeconfigPath, values); // 간단한 Release 스텁 반환 - null 반환으로 변경 @@ -280,8 +282,7 @@ public Release deployHelmChartWithRequest(KubernetesClient client, String namesp // 2. kubeconfig 파일 생성 String providerName = clusterDto.getConnectionConfig().getProviderName(); - KubeConfigProvider provider = providerFactory.getProvider(providerName); - String kubeconfigYaml = provider.getOriginalKubeconfigYaml(clusterDto); + String kubeconfigYaml = kubeconfigResolver.getKubeconfigYaml(namespace, clusterName); tempKubeconfigPath = Files.createTempFile("kubeconfig-", ".yaml"); Files.write(tempKubeconfigPath, kubeconfigYaml.getBytes()); @@ -378,6 +379,10 @@ public Release deployHelmChartWithRequest(KubernetesClient client, String namesp values.put("serviceAccount.create", "false"); values.put("serviceAccount.name", "default"); + if (isRcloneChart(helmChart)) { + applyRcloneGuiDefaults(values, config.getServicePort()); + } + applyObjectStorageValues(catalog, request, providerName, helmChart.getChartName(), objectStorageValues); if (!objectStorageValues.isEmpty()) { tempObjectStorageValuesPath = createTempValuesFile(objectStorageValues); @@ -568,9 +573,7 @@ public String getKubeconfigForCluster(String namespace, String clusterName) thro } // Provider별 kubeconfig 생성 - String providerName = clusterDto.getConnectionConfig().getProviderName(); - KubeConfigProvider provider = providerFactory.getProvider(providerName); - return provider.getOriginalKubeconfigYaml(clusterDto); + return kubeconfigResolver.getKubeconfigYaml(namespace, clusterName); } public String findLatestReleaseNameForChart(String namespace, String clusterName, String chartName) { @@ -936,6 +939,61 @@ private boolean isIngressControllerReady(KubernetesClient client, String namespa } } + private boolean isRcloneChart(HelmChart helmChart) { + return helmChart != null && StringUtils.equalsIgnoreCase(helmChart.getChartName(), "rclone"); + } + + private void applyRcloneGuiDefaults(Map values, Integer servicePort) { + String port = String.valueOf(servicePort != null ? servicePort : 5572); + boolean ingressEnabled = Boolean.parseBoolean(values.getOrDefault("ingress.enabled", "false")); + String ingressHost = values.get("ingress.hosts[0]"); + String ingressPath = values.getOrDefault("ingress.path", "/"); + String ingressClassName = values.getOrDefault("ingress.ingressClassName", + values.getOrDefault("ingress.className", "nginx")); + boolean ingressTlsEnabled = Boolean.parseBoolean(values.getOrDefault("ingress.tls.enabled", "false")); + String ingressTlsSecretName = values.get("ingress.tls.secretName"); + + values.remove("persistence.enabled"); + values.remove("persistence.storageClass"); + values.remove("persistence.size"); + values.remove("persistence.accessMode"); + values.remove("service.type"); + values.remove("service.port"); + values.remove("ingress.enabled"); + values.remove("ingress.host"); + values.remove("ingress.hosts[0]"); + values.remove("ingress.path"); + values.remove("ingress.ingressClassName"); + values.remove("ingress.className"); + values.remove("ingress.tls.enabled"); + values.remove("ingress.tls.secretName"); + + values.put("persistence.config.enabled", "false"); + values.put("service.main.enabled", "true"); + values.put("service.main.type", "ClusterIP"); + values.put("service.main.ports.http.enabled", "true"); + values.put("service.main.ports.http.primary", "true"); + values.put("service.main.ports.http.port", port); + values.put("probes.liveness.enabled", "false"); + values.put("probes.readiness.enabled", "false"); + values.put("probes.startup.enabled", "false"); + + if (ingressEnabled && StringUtils.isNotBlank(ingressHost)) { + values.put("ingress.main.enabled", "true"); + values.put("ingress.main.ingressClassName", ingressClassName); + values.put("ingress.main.hosts[0].host", ingressHost); + values.put("ingress.main.hosts[0].paths[0].path", StringUtils.defaultIfBlank(ingressPath, "/")); + values.put("ingress.main.hosts[0].paths[0].pathType", "Prefix"); + + if (ingressTlsEnabled && StringUtils.isNotBlank(ingressTlsSecretName)) { + values.put("ingress.main.tls[0].secretName", ingressTlsSecretName); + values.put("ingress.main.tls[0].hosts[0]", ingressHost); + } + } else { + values.put("ingress.main.enabled", "false"); + } + } + private void applyObjectStorageValues(SoftwareCatalog catalog, kr.co.mcmp.softwarecatalog.application.dto.DeploymentRequest request, String providerName, diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployService.java index 93d3c24d..864a20cf 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployService.java @@ -25,9 +25,7 @@ import kr.co.mcmp.softwarecatalog.service.SoftwareSourceService; import kr.co.mcmp.softwarecatalog.application.model.HelmChart; import kr.co.mcmp.softwarecatalog.application.model.PackageInfo; -import kr.co.mcmp.ape.cbtumblebug.api.CbtumblebugRestApi; -import kr.co.mcmp.softwarecatalog.kubernetes.config.KubeConfigProviderFactory; -import kr.co.mcmp.ape.cbtumblebug.dto.K8sClusterDto; +import kr.co.mcmp.softwarecatalog.kubernetes.config.KubeconfigResolver; import lombok.RequiredArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,8 +42,7 @@ public class KubernetesDeployService { private final ApplicationStatusRepository applicationStatusRepository; private final DeploymentHistoryRepository deploymentHistoryRepository; private final SoftwareSourceService softwareSourceService; - private final CbtumblebugRestApi cbtumblebugRestApi; - private final KubeConfigProviderFactory providerFactory; + private final KubeconfigResolver kubeconfigResolver; /** * 입력 파라미터 검증 공통 메서드 @@ -76,9 +73,7 @@ private void validateHelmChart(SoftwareCatalog catalog) { */ private String getKubeconfigYaml(String namespace, String clusterName) { try { - K8sClusterDto clusterDto = cbtumblebugRestApi.getK8sClusterByName(namespace, clusterName); - return providerFactory.getProvider(clusterDto.getConnectionConfig().getProviderName()) - .getOriginalKubeconfigYaml(clusterDto); + return kubeconfigResolver.getKubeconfigYaml(namespace, clusterName); } catch (Exception e) { log.error("kubeconfig 획득 중 오류 발생: {}", e.getMessage(), e); throw new RuntimeException("kubeconfig 획득 실패", e); diff --git a/src/main/resources/application-local.yaml b/src/main/resources/application-local.yaml new file mode 100644 index 00000000..721c5b9b --- /dev/null +++ b/src/main/resources/application-local.yaml @@ -0,0 +1,39 @@ +# ===================================================================== +# Local profile for AM archiving verification +# Activate with: --spring.profiles.active=local +# +# Purpose: +# - Boot the application against the dev PostgreSQL/Tumblebug servers +# - Auto-create the new archiving tables (ddl-auto: update) +# - Keep local deployment tests from running background schedulers +# - Surface Hibernate DDL and our package logs for visual verification +# +# Notes: +# - All connection endpoints inherit defaults from application.yaml +# (PostgreSQL/Tumblebug/Spider on 210.217.178.130) +# - Override only what is useful for local boot-time verification +# - Set APP_SCHEDULING_ENABLED=true only when intentionally testing schedulers locally +# ===================================================================== + +app: + scheduling: + enabled: false + +spring: + jpa: + hibernate: + ddl-auto: update + properties: + hibernate: + show_sql: true + format_sql: true + use_sql_comments: true + +logging: + level: + root: INFO + org.hibernate.SQL: DEBUG + org.hibernate.orm.jdbc.bind: TRACE + kr.co.mcmp.softwarecatalog.application.service.impl.DailyAggregationScheduler: DEBUG + kr.co.mcmp.softwarecatalog.docker.service.DockerMonitoringService: DEBUG + kr.co.mcmp.softwarecatalog.kubernetes.service.KubernetesMonitoringService: DEBUG diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index efa3320e..b0cdb40a 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -63,11 +63,6 @@ cbtumblebug: id: ${TUMBLEBUG_ID:default} pass: ${TUMBLEBUG_PASSWORD:default} -spider: - url: ${SPIDER_URL:210.217.178.130} - port: ${SPIDER_PORT:1024} - checkhost: localhost,127.0.0.1,0.0.0.0 - nexus: url: ${NEXUS_URL:210.217.178.130} port: ${NEXUS_PORT:8081} diff --git a/src/main/resources/import.sql b/src/main/resources/import.sql index 05404716..aa706284 100644 --- a/src/main/resources/import.sql +++ b/src/main/resources/import.sql @@ -13,7 +13,7 @@ INSERT INTO SOFTWARE_CATALOG (TITLE, DESCRIPTION, SUMMARY, CATEGORY, LOGO_URL_LA ('Grafana', 'Grafana is an open-source platform for monitoring and observability.', 'Monitoring and visualization platform', 'Monitoring & Observability', 'https://desktop.docker.com/extensions/grafana_docker-desktop-extension/storage_googleapis_com/grafanalabs-integration-logos/grafana_icon.svg', 'https://desktop.docker.com/extensions/grafana_docker-desktop-extension/storage_googleapis_com/grafanalabs-integration-logos/grafana_icon.svg', 0.1, 0.2, 0.1, 0.2, 1, 2, 80.0, 80.0, 1, 3, true, 3000, true, 'grafana.example.com', '/', 'nginx', true, 'grafana-tls', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), ('Prometheus', 'Prometheus is an open-source systems monitoring and alerting toolkit.', 'Monitoring and alerting toolkit', 'Integration & Delivery,Monitoring & Observability,Security', 'https://www.gravatar.com/avatar/31cea69afa424609b2d83621b4d47f1d?s=80&r=g&d=mm', 'https://www.gravatar.com/avatar/31cea69afa424609b2d83621b4d47f1d?s=80&r=g&d=mm', 2, 4, 2, 4, 1, 2, 80.0, 80.0, 1, 3, true, 9090, true, 'prometheus.example.com', '/', 'nginx', true, 'prometheus-tls', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), ('Elasticsearch', 'Elasticsearch is a distributed, RESTful search and analytics engine capable of solving a growing number of use cases.', 'Distributed search and analytics engine', 'Databases & Storage', 'https://www.gravatar.com/avatar/dd9d954997353b37b4c2684f478192d3?s=120&r=g&d=404', 'https://www.gravatar.com/avatar/dd9d954997353b37b4c2684f478192d3?s=120&r=g&d=404', 2, 4, 2, 8, 2, 4, 80.0, 80.0, 1, 5, true, 9200, true, 'elasticsearch.example.com', '/', 'nginx', true, 'elasticsearch-tls', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP), -('Loki', 'Grafana Loki is a horizontally scalable, highly available log aggregation system designed to store and query logs efficiently.', 'Log aggregation system for Kubernetes', 'Monitoring & Observability', 'https://raw.githubusercontent.com/grafana/loki/main/docs/sources/logo_and_name.png', 'https://raw.githubusercontent.com/grafana/loki/main/docs/sources/logo_and_name.png', 1, 2, 2, 4, 10, 20, 80.0, 80.0, 1, 3, false, 3100, false, NULL, NULL, NULL, false, NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); +('Rclone GUI', 'Rclone is a lightweight file transfer and cloud storage management tool with a web GUI for S3-compatible object storage operations.', 'Cloud/object storage file management tool', 'Databases & Storage', 'https://raw.githubusercontent.com/rclone/rclone/master/graphics/logo/svg/logo_symbol_color.svg', 'https://raw.githubusercontent.com/rclone/rclone/master/graphics/logo/svg/logo_symbol_color.svg', 0.05, 0.1, 0.125, 0.25, 0, 1, 80.0, 80.0, 1, 1, false, 5572, true, 'rclone.example.com', '/', 'nginx', false, NULL, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); -- 2. PACKAGE_INFO 테이블 데이터 삽입 (DockerHub 기반) INSERT INTO PACKAGE_INFO (CATALOG_ID, PACKAGE_TYPE, PACKAGE_NAME, PACKAGE_VERSION, REPOSITORY_URL, DOCKER_IMAGE_ID, DOCKER_PUBLISHER, DOCKER_CREATED_AT, DOCKER_UPDATED_AT, DOCKER_SHORT_DESCRIPTION, DOCKER_SOURCE, ARCHITECTURES, CATEGORIES, IS_ARCHIVED, IS_AUTOMATED, IS_OFFICIAL, LAST_PULLED_AT, OPERATING_SYSTEMS, PULL_COUNT, STAR_COUNT) VALUES @@ -31,7 +31,7 @@ INSERT INTO PACKAGE_INFO (CATALOG_ID, PACKAGE_TYPE, PACKAGE_NAME, PACKAGE_VERSIO INSERT INTO HELM_CHART (CATALOG_ID, CATEGORY, CHART_NAME, CHART_VERSION, CHART_REPOSITORY_URL, VALUES_FILE, HAS_VALUES_SCHEMA, REPOSITORY_NAME, REPOSITORY_OFFICIAL, REPOSITORY_DISPLAY_NAME, IMAGE_REPOSITORY) VALUES (7, 'Monitoring & Observability', 'grafana', '7.3.0', 'https://grafana.github.io/helm-charts', 'https://artifacthub.io/packages/helm/grafana/grafana/values.yaml', true, 'grafana', true, 'Grafana', 'grafana/grafana'), (8, 'Monitoring & Observability', 'prometheus', '25.8.0', 'https://prometheus-community.github.io/helm-charts', 'https://artifacthub.io/packages/helm/prometheus-community/prometheus/values.yaml', true, 'prometheus-community', true, 'Prometheus Community', 'bitnami/prometheus'), -(10, 'Monitoring & Observability', 'loki', '17.1.6', 'https://grafana-community.github.io/helm-charts', 'https://artifacthub.io/packages/helm/grafana-community/loki/values.yaml', true, 'grafana-community', true, 'Grafana Community', 'grafana/loki'); +(10, 'Databases & Storage', 'rclone', '1.0.1', 'https://jacobcolvin.com/helm-charts', 'https://artifacthub.io/packages/helm/jacobcolvin/rclone/values.yaml', false, 'jacobcolvin', false, 'Jacob Colvin''s Helm Charts', 'rclone/rclone'); -- 4. SOFTWARE_SOURCE_MAPPING 테이블 데이터 삽입 (서브쿼리 없이 직접 ID 사용) -- Grafana - DockerHub + ArtifactHub 둘 다 지원 @@ -172,17 +172,16 @@ INSERT INTO SOFTWARE_CATALOG_REF(CATALOG_ID, REF_IDX, REF_VALUE, REF_DESC, REF_T (9, 9, 'helm_application_install', '', 'workflow'), (9, 10, 'helm_application_uninstall', '', 'workflow'); --- Loki +-- Rclone GUI INSERT INTO SOFTWARE_CATALOG_REF(CATALOG_ID, REF_IDX, REF_VALUE, REF_DESC, REF_TYPE) VALUES -(10, 0, 'https://grafana.com/oss/loki/', '', 'HOMEPAGE'), -(10, 1, 'logging', '', 'TAG'), -(10, 2, 'observability', '', 'TAG'), -(10, 3, 'kubernetes', '', 'TAG'), -(10, 4, 'object-storage', '', 'TAG'), -(10, 5, 'oss', '', 'TAG'), -(10, 6, 'object-storage', 'Supports deploy-time Object Storage configuration', 'CAPABILITY'), -(10, 7, 'helm_application_install', '', 'workflow'), -(10, 8, 'helm_application_uninstall', '', 'workflow'); +(10, 0, 'https://rclone.org/', '', 'HOMEPAGE'), +(10, 1, 's3', '', 'TAG'), +(10, 2, 's3-compatible', '', 'TAG'), +(10, 3, 'file-transfer', '', 'TAG'), +(10, 4, 'artifacthub-community', '', 'TAG'), +(10, 5, 'helm_application_install', '', 'workflow'), +(10, 6, 'helm_application_uninstall', '', 'workflow'); + -- 6. OSS_TYPE 테이블 데이터 삽입 INSERT INTO oss_type (oss_type_idx, oss_type_name, oss_type_desc) VALUES diff --git a/src/main/resources/static/assets/IconPlus-0MYkWKdM.js b/src/main/resources/static/assets/IconPlus-DSGNl2n-.js similarity index 96% rename from src/main/resources/static/assets/IconPlus-0MYkWKdM.js rename to src/main/resources/static/assets/IconPlus-DSGNl2n-.js index e5857699..b5846362 100644 --- a/src/main/resources/static/assets/IconPlus-0MYkWKdM.js +++ b/src/main/resources/static/assets/IconPlus-DSGNl2n-.js @@ -1,4 +1,4 @@ -import{L as l}from"./index-nMoWjTPe.js";/** +import{L as l}from"./index-BrBdH8Ja.js";/** * @license @tabler/icons-vue v3.22.0 - MIT * * This source code is licensed under the MIT license. diff --git a/src/main/resources/static/assets/OssList-CUqe4g5_.js b/src/main/resources/static/assets/OssList-Cshnqjym.js similarity index 96% rename from src/main/resources/static/assets/OssList-CUqe4g5_.js rename to src/main/resources/static/assets/OssList-Cshnqjym.js index 0df058b1..00a1c53b 100644 --- a/src/main/resources/static/assets/OssList-CUqe4g5_.js +++ b/src/main/resources/static/assets/OssList-Cshnqjym.js @@ -1,4 +1,4 @@ -import{M as q,_ as M}from"./bootstrap.esm-LCYmWnCj.js";import{_ as G}from"./Tabulator.vue_vue_type_style_index_0_lang-By28-D7G.js";import{s as f}from"./request-BXz87ydW.js";import{d as I,r as d,u as T,c as W,w as N,o as L,a as p,b as e,t as U,e as O,v as j,F as z,f as H,g as x,h as b,i as _}from"./index-nMoWjTPe.js";import"./IconPlus-0MYkWKdM.js";const J=()=>f.get("/ossType/list"),K=()=>f.get("/ossType/filter/list"),Q=()=>f.get("/oss/list");function X(l){return f.get(`/oss/duplicate?ossName=${l.ossName}&ossUrl=${l.ossUrl}&ossUsername=${l.ossUsername}`)}function Y(l){return f.post("/oss/connection-check",l)}function Z(l){return f.get("/oss/"+l)}function ss(l){return f.post("/oss",l)}function es(l){return f.patch(`/oss/${l.ossIdx}`,l)}function ts(l){return f.delete(`/oss/${l}`)}const os={class:"modal-dialog modal-xl",role:"document"},as={class:"modal-content"},ls={class:"modal-body text-left py-4"},ns={class:"mb-5"},rs={class:"mb-3"},is={class:"grid gap-0 column-gap-3"},ds=["value"],cs={class:"row mb-3"},us={class:"grid gap-0 column-gap-3"},ms={class:"mb-3"},vs={class:"mb-3"},ps={class:"row"},bs={class:"col"},fs={class:"col"},ys={class:"col mt-4 row"},gs={key:1,class:"btn btn-success col",style:{"margin-right":"3px"}},ws={key:3,class:"btn btn-success col"},Ss={class:"modal-footer"},Os=I({__name:"ossForm",props:{mode:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=d(),c=d(),o=T(),r=l,g=k,i=W(()=>r.ossIdx);N(i,async()=>{await y()}),N(()=>r.mode,async()=>{await v(r.mode)}),L(async()=>{m.value&&(c.value=new q(m.value)),await v("init"),await y()});const t=d({}),y=async()=>{if(r.mode==="new")t.value.ossTypeIdx=0,t.value.ossName="",t.value.ossDesc="",t.value.ossUrl="",t.value.ossUsername="",t.value.ossPassword="",u.value=!1,S.value=!1;else{const{data:a}=await Z(r.ossIdx);t.value=a,t.value.ossPassword=B(t.value.ossPassword),u.value=!0,S.value=!0}},C=d([]),v=async a=>{try{if(a==="new"||a==="init"){const{data:s}=await K();C.value=s}else{const{data:s}=await J();C.value=s}}catch(s){console.log(s)}},w=()=>{t.value.ossPassword="",S.value=!1},u=d(!1),h=async()=>{const a={ossName:t.value.ossName,ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername},{data:s}=await X(a);s?o.error("The name is already in use."):(o.success("The name is available."),u.value=!0)},S=d(!1),$=async()=>{const a={ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername,ossPassword:P(t.value.ossPassword),ossTypeIdx:t.value.ossTypeIdx},{data:s}=await Y(a);s?(o.success("The OSS is available."),S.value=!0):o.error("The OSS is unavailable.")},F=()=>{u.value=!1},D=()=>{S.value=!1},E=async()=>{if(!t.value.ossTypeIdx||t.value.ossTypeIdx===0){o.error("Please select OSS Type.");return}if(!t.value.ossName){o.error("Please enter OSS Name.");return}if(!t.value.ossDesc){o.error("Please enter OSS Description.");return}if(!t.value.ossUrl){o.error("Please enter URL.");return}if(!t.value.ossUsername){o.error("Please enter OSS ID.");return}if(!t.value.ossPassword){o.error("Please enter OSS Password.");return}if(!u.value){o.error("Please perform duplicate check.");return}if(!S.value){o.error("Please perform connection check.");return}t.value.ossPassword=P(t.value.ossPassword);let a=!1;r.mode==="new"?a=await R():a=await A(),a&&(g("get-oss-list"),y(),console.log(c.value),c.value&&(c.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const s=document.querySelector(".modal-backdrop");s==null||s.remove()},150)))},R=async()=>{try{const{data:a}=await ss(t.value);return a?(o.success("Regist SUCCESS."),!0):(o.error("Regist FAIL."),!1)}catch{return o.error("Regist FAIL."),!1}},A=async()=>{try{const{data:a}=await es(t.value);return a?(o.success("Update SUCCESS."),!0):(o.error("Update FAIL."),!1)}catch{return o.error("Update FAIL."),!1}},P=a=>btoa(a),B=a=>atob(a);return(a,s)=>(b(),p("div",{class:"modal fade",id:"ossForm",tabindex:"-1",ref_key:"modalElement",ref:m},[e("div",os,[e("div",as,[s[15]||(s[15]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),e("div",ls,[e("h3",ns,U(r.mode==="new"?"New":"Edit")+" OSS ",1),e("div",null,[e("div",rs,[s[9]||(s[9]=e("label",{class:"form-label required"},"OSS Type",-1)),e("div",is,[O(e("select",{"onUpdate:modelValue":s[0]||(s[0]=n=>t.value.ossTypeIdx=n),class:"form-select p-2 g-col-12"},[s[8]||(s[8]=e("option",{value:0},"Select OSS Type",-1)),(b(!0),p(z,null,H(C.value,(n,V)=>(b(),p("option",{value:n.ossTypeIdx,key:V},U(n.ossTypeName),9,ds))),128))],512),[[j,t.value.ossTypeIdx]])])]),e("div",cs,[s[10]||(s[10]=e("label",{class:"form-label required"},"OSS Name",-1)),e("div",us,[O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Name","onUpdate:modelValue":s[1]||(s[1]=n=>t.value.ossName=n),onChange:F},null,544),[[x,t.value.ossName]])])]),e("div",ms,[s[11]||(s[11]=e("label",{class:"form-label required"},"OSS Description",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Description","onUpdate:modelValue":s[2]||(s[2]=n=>t.value.ossDesc=n)},null,512),[[x,t.value.ossDesc]])]),e("div",vs,[s[12]||(s[12]=e("label",{class:"form-label required"},"URL",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the Server URL","onUpdate:modelValue":s[3]||(s[3]=n=>t.value.ossUrl=n),onFocus:D},null,544),[[x,t.value.ossUrl]])]),e("div",ps,[e("div",bs,[s[13]||(s[13]=e("label",{class:"form-label required"},"OSS ID",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the OSS ID","onUpdate:modelValue":s[4]||(s[4]=n=>t.value.ossUsername=n),onFocus:D},null,544),[[x,t.value.ossUsername]])]),e("div",fs,[s[14]||(s[14]=e("label",{class:"form-label required"},"OSS PW",-1)),O(e("input",{type:"password",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Password","onUpdate:modelValue":s[5]||(s[5]=n=>t.value.ossPassword=n),onClick:w,onFocus:D},null,544),[[x,t.value.ossPassword]])]),e("div",ys,[u.value?(b(),p("button",gs,"Duplicate Check")):(b(),p("button",{key:0,class:"btn btn-primary col",onClick:h,style:{"margin-right":"3px"}},"Duplicate Check")),S.value?(b(),p("button",ws,"Connection Check")):(b(),p("button",{key:2,class:"btn btn-primary col",onClick:$},"Connection Check"))])])])]),e("div",Ss,[e("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:s[6]||(s[6]=n=>y())}," Cancel "),e("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:s[7]||(s[7]=n=>E())},U(r.mode==="new"?"Regist":"Edit"),513)])])])],512))}}),ks={class:"modal fade",id:"deleteOss",tabindex:"-1"},Cs={class:"modal-dialog modal-lg",role:"document"},xs={class:"modal-content"},_s={class:"modal-body text-left py-4"},Us={class:"modal-footer"},hs=I({__name:"deleteOss",props:{ossName:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=T(),c=l,o=k,r=async()=>{const{data:g}=await ts(c.ossIdx);g?m.success("Deleted successfully."):m.error("Failed to delete."),o("get-oss-list")};return(g,i)=>(b(),p("div",ks,[e("div",Cs,[e("div",xs,[i[3]||(i[3]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),i[4]||(i[4]=e("div",{class:"modal-status bg-danger"},null,-1)),e("div",_s,[i[1]||(i[1]=e("h3",{class:"mb-5"}," Delete OSS ",-1)),e("h4",null,"Are you sure you want to delete "+U(c.ossName)+"?",1)]),e("div",Us,[i[2]||(i[2]=e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:i[0]||(i[0]=t=>r())}," Delete ")])])])]))}}),Ds={class:"card card-flush w-100"},Is={ref:"table-responsive"},Fs=I({__name:"OssList",setup(l){const k=T(),m=d([]),c=d([]);L(async()=>{i(),await o()});const o=async()=>{try{const{data:v}=await Q();m.value=v}catch(v){console.log(v),k.error("데이터를 가져올 수 없습니다.")}},r=d(0),g=d(""),i=()=>{c.value=[{title:"OSS Name",field:"ossName",width:400},{title:"OSS Desc",field:"ossDesc",width:500},{title:"URL",field:"ossUrl",width:600},{title:"Action",width:400,formatter:t,cellClick:function(v,w){const u=v.target,h=u==null?void 0:u.getAttribute("id");r.value=w.getRow().getData().ossIdx,h==="edit-btn"?y.value="edit":g.value=w.getRow().getData().ossName}}]},t=()=>` +import{M as q,_ as M}from"./bootstrap.esm-B0L675-L.js";import{_ as G}from"./Tabulator.vue_vue_type_style_index_0_lang-DicuGnRr.js";import{s as f}from"./request-aRA9bZgg.js";import{d as I,r as d,u as T,c as W,w as N,o as L,a as p,b as e,t as U,e as O,v as j,F as z,f as H,g as x,h as b,i as _}from"./index-BrBdH8Ja.js";import"./IconPlus-DSGNl2n-.js";const J=()=>f.get("/ossType/list"),K=()=>f.get("/ossType/filter/list"),Q=()=>f.get("/oss/list");function X(l){return f.get(`/oss/duplicate?ossName=${l.ossName}&ossUrl=${l.ossUrl}&ossUsername=${l.ossUsername}`)}function Y(l){return f.post("/oss/connection-check",l)}function Z(l){return f.get("/oss/"+l)}function ss(l){return f.post("/oss",l)}function es(l){return f.patch(`/oss/${l.ossIdx}`,l)}function ts(l){return f.delete(`/oss/${l}`)}const os={class:"modal-dialog modal-xl",role:"document"},as={class:"modal-content"},ls={class:"modal-body text-left py-4"},ns={class:"mb-5"},rs={class:"mb-3"},is={class:"grid gap-0 column-gap-3"},ds=["value"],cs={class:"row mb-3"},us={class:"grid gap-0 column-gap-3"},ms={class:"mb-3"},vs={class:"mb-3"},ps={class:"row"},bs={class:"col"},fs={class:"col"},ys={class:"col mt-4 row"},gs={key:1,class:"btn btn-success col",style:{"margin-right":"3px"}},ws={key:3,class:"btn btn-success col"},Ss={class:"modal-footer"},Os=I({__name:"ossForm",props:{mode:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=d(),c=d(),o=T(),r=l,g=k,i=W(()=>r.ossIdx);N(i,async()=>{await y()}),N(()=>r.mode,async()=>{await v(r.mode)}),L(async()=>{m.value&&(c.value=new q(m.value)),await v("init"),await y()});const t=d({}),y=async()=>{if(r.mode==="new")t.value.ossTypeIdx=0,t.value.ossName="",t.value.ossDesc="",t.value.ossUrl="",t.value.ossUsername="",t.value.ossPassword="",u.value=!1,S.value=!1;else{const{data:a}=await Z(r.ossIdx);t.value=a,t.value.ossPassword=B(t.value.ossPassword),u.value=!0,S.value=!0}},C=d([]),v=async a=>{try{if(a==="new"||a==="init"){const{data:s}=await K();C.value=s}else{const{data:s}=await J();C.value=s}}catch(s){console.log(s)}},w=()=>{t.value.ossPassword="",S.value=!1},u=d(!1),h=async()=>{const a={ossName:t.value.ossName,ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername},{data:s}=await X(a);s?o.error("The name is already in use."):(o.success("The name is available."),u.value=!0)},S=d(!1),$=async()=>{const a={ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername,ossPassword:P(t.value.ossPassword),ossTypeIdx:t.value.ossTypeIdx},{data:s}=await Y(a);s?(o.success("The OSS is available."),S.value=!0):o.error("The OSS is unavailable.")},F=()=>{u.value=!1},D=()=>{S.value=!1},E=async()=>{if(!t.value.ossTypeIdx||t.value.ossTypeIdx===0){o.error("Please select OSS Type.");return}if(!t.value.ossName){o.error("Please enter OSS Name.");return}if(!t.value.ossDesc){o.error("Please enter OSS Description.");return}if(!t.value.ossUrl){o.error("Please enter URL.");return}if(!t.value.ossUsername){o.error("Please enter OSS ID.");return}if(!t.value.ossPassword){o.error("Please enter OSS Password.");return}if(!u.value){o.error("Please perform duplicate check.");return}if(!S.value){o.error("Please perform connection check.");return}t.value.ossPassword=P(t.value.ossPassword);let a=!1;r.mode==="new"?a=await R():a=await A(),a&&(g("get-oss-list"),y(),console.log(c.value),c.value&&(c.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const s=document.querySelector(".modal-backdrop");s==null||s.remove()},150)))},R=async()=>{try{const{data:a}=await ss(t.value);return a?(o.success("Regist SUCCESS."),!0):(o.error("Regist FAIL."),!1)}catch{return o.error("Regist FAIL."),!1}},A=async()=>{try{const{data:a}=await es(t.value);return a?(o.success("Update SUCCESS."),!0):(o.error("Update FAIL."),!1)}catch{return o.error("Update FAIL."),!1}},P=a=>btoa(a),B=a=>atob(a);return(a,s)=>(b(),p("div",{class:"modal fade",id:"ossForm",tabindex:"-1",ref_key:"modalElement",ref:m},[e("div",os,[e("div",as,[s[15]||(s[15]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),e("div",ls,[e("h3",ns,U(r.mode==="new"?"New":"Edit")+" OSS ",1),e("div",null,[e("div",rs,[s[9]||(s[9]=e("label",{class:"form-label required"},"OSS Type",-1)),e("div",is,[O(e("select",{"onUpdate:modelValue":s[0]||(s[0]=n=>t.value.ossTypeIdx=n),class:"form-select p-2 g-col-12"},[s[8]||(s[8]=e("option",{value:0},"Select OSS Type",-1)),(b(!0),p(z,null,H(C.value,(n,V)=>(b(),p("option",{value:n.ossTypeIdx,key:V},U(n.ossTypeName),9,ds))),128))],512),[[j,t.value.ossTypeIdx]])])]),e("div",cs,[s[10]||(s[10]=e("label",{class:"form-label required"},"OSS Name",-1)),e("div",us,[O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Name","onUpdate:modelValue":s[1]||(s[1]=n=>t.value.ossName=n),onChange:F},null,544),[[x,t.value.ossName]])])]),e("div",ms,[s[11]||(s[11]=e("label",{class:"form-label required"},"OSS Description",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Description","onUpdate:modelValue":s[2]||(s[2]=n=>t.value.ossDesc=n)},null,512),[[x,t.value.ossDesc]])]),e("div",vs,[s[12]||(s[12]=e("label",{class:"form-label required"},"URL",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the Server URL","onUpdate:modelValue":s[3]||(s[3]=n=>t.value.ossUrl=n),onFocus:D},null,544),[[x,t.value.ossUrl]])]),e("div",ps,[e("div",bs,[s[13]||(s[13]=e("label",{class:"form-label required"},"OSS ID",-1)),O(e("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the OSS ID","onUpdate:modelValue":s[4]||(s[4]=n=>t.value.ossUsername=n),onFocus:D},null,544),[[x,t.value.ossUsername]])]),e("div",fs,[s[14]||(s[14]=e("label",{class:"form-label required"},"OSS PW",-1)),O(e("input",{type:"password",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Password","onUpdate:modelValue":s[5]||(s[5]=n=>t.value.ossPassword=n),onClick:w,onFocus:D},null,544),[[x,t.value.ossPassword]])]),e("div",ys,[u.value?(b(),p("button",gs,"Duplicate Check")):(b(),p("button",{key:0,class:"btn btn-primary col",onClick:h,style:{"margin-right":"3px"}},"Duplicate Check")),S.value?(b(),p("button",ws,"Connection Check")):(b(),p("button",{key:2,class:"btn btn-primary col",onClick:$},"Connection Check"))])])])]),e("div",Ss,[e("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:s[6]||(s[6]=n=>y())}," Cancel "),e("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:s[7]||(s[7]=n=>E())},U(r.mode==="new"?"Regist":"Edit"),513)])])])],512))}}),ks={class:"modal fade",id:"deleteOss",tabindex:"-1"},Cs={class:"modal-dialog modal-lg",role:"document"},xs={class:"modal-content"},_s={class:"modal-body text-left py-4"},Us={class:"modal-footer"},hs=I({__name:"deleteOss",props:{ossName:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:k}){const m=T(),c=l,o=k,r=async()=>{const{data:g}=await ts(c.ossIdx);g?m.success("Deleted successfully."):m.error("Failed to delete."),o("get-oss-list")};return(g,i)=>(b(),p("div",ks,[e("div",Cs,[e("div",xs,[i[3]||(i[3]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),i[4]||(i[4]=e("div",{class:"modal-status bg-danger"},null,-1)),e("div",_s,[i[1]||(i[1]=e("h3",{class:"mb-5"}," Delete OSS ",-1)),e("h4",null,"Are you sure you want to delete "+U(c.ossName)+"?",1)]),e("div",Us,[i[2]||(i[2]=e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:i[0]||(i[0]=t=>r())}," Delete ")])])])]))}}),Ds={class:"card card-flush w-100"},Is={ref:"table-responsive"},Fs=I({__name:"OssList",setup(l){const k=T(),m=d([]),c=d([]);L(async()=>{i(),await o()});const o=async()=>{try{const{data:v}=await Q();m.value=v}catch(v){console.log(v),k.error("데이터를 가져올 수 없습니다.")}},r=d(0),g=d(""),i=()=>{c.value=[{title:"OSS Name",field:"ossName",width:400},{title:"OSS Desc",field:"ossDesc",width:500},{title:"URL",field:"ossUrl",width:600},{title:"Action",width:400,formatter:t,cellClick:function(v,w){const u=v.target,h=u==null?void 0:u.getAttribute("id");r.value=w.getRow().getData().ossIdx,h==="edit-btn"?y.value="edit":g.value=w.getRow().getData().ossName}}]},t=()=>`