This is an automated email from the ASF dual-hosted git repository. marat pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-karavan.git
commit a407a1a9cc6ad81526dd313e57c719fd014f56c9 Author: Marat Gubaidullin <[email protected]> AuthorDate: Fri Feb 27 16:32:27 2026 -0500 Front-end Models for 4.18.0 --- .../main/webui/src/karavan/models/AccessModels.ts | 16 +++++++ .../main/webui/src/karavan/models/ProjectModels.ts | 49 ++++++++++++++-------- .../main/webui/src/karavan/models/SearchModels.ts | 17 ++++++++ .../main/webui/src/karavan/models/ServiceModels.ts | 11 ----- .../main/webui/src/karavan/models/SystemModels.ts | 17 ++++++++ 5 files changed, 81 insertions(+), 29 deletions(-) diff --git a/karavan-app/src/main/webui/src/karavan/models/AccessModels.ts b/karavan-app/src/main/webui/src/karavan/models/AccessModels.ts index b96460bf..f633a328 100644 --- a/karavan-app/src/main/webui/src/karavan/models/AccessModels.ts +++ b/karavan-app/src/main/webui/src/karavan/models/AccessModels.ts @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ export class AccessUser { username: string = ''; firstName: string = ''; diff --git a/karavan-app/src/main/webui/src/karavan/models/ProjectModels.ts b/karavan-app/src/main/webui/src/karavan/models/ProjectModels.ts index 5ed841eb..269f7d45 100644 --- a/karavan-app/src/main/webui/src/karavan/models/ProjectModels.ts +++ b/karavan-app/src/main/webui/src/karavan/models/ProjectModels.ts @@ -15,9 +15,6 @@ * limitations under the License. */ - -import {ASYNCAPI_FILE_NAME_JSON, ASYNCAPI_FILE_NAME_YAML} from "@karavan-core/contants"; - export type FileOperation = | "create" | "select" @@ -37,7 +34,17 @@ export const DOCKER_STACK = "docker-stack.yaml"; export const KUBERNETES_YAML = "kubernetes.yaml"; export const APPLICATION_PROPERTIES = 'application.properties'; export const BUILD_SH = 'build.sh'; -export const BUILD_IN_FILES = [APPLICATION_PROPERTIES, DOCKER_COMPOSE, DOCKER_STACK, KUBERNETES_YAML, ASYNCAPI_FILE_NAME_JSON, ASYNCAPI_FILE_NAME_YAML, BUILD_SH]; +export const BUILD_DOCKER_COMPOSE = 'builder.' + DOCKER_COMPOSE; +export const BUILD_DOCKER_STACK = 'builder.' + DOCKER_STACK; +export const BUILD_IN_FILES = [ + APPLICATION_PROPERTIES, + DOCKER_COMPOSE, + DOCKER_STACK, + KUBERNETES_YAML, + BUILD_SH, + BUILD_DOCKER_COMPOSE, + BUILD_DOCKER_STACK +]; export class AppConfig { title: string = ''; @@ -59,8 +66,6 @@ export enum ProjectType { configuration = 'configuration', documentation = 'documentation', services = 'services', - shared = 'shared', - cache = 'cache', integration = 'integration', } @@ -69,17 +74,21 @@ export const BUILD_IN_PROJECTS: string[] = [ ProjectType.templates.toString(), ProjectType.configuration.toString(), ProjectType.services.toString(), - ProjectType.shared.toString(), ProjectType.documentation.toString() ]; export const RESERVED_WORDS: string[] = [...BUILD_IN_PROJECTS, 'karavan']; +export interface ProjectCommited { + projectId: string; + lastCommit: string; + lastCommitTimestamp: number; +} + export class Project { projectId: string = ''; name: string = ''; - lastCommit: string = ''; - lastCommitTimestamp: number = 0; + lastUpdate: number = 0; type: string = ProjectType.integration; public constructor(projectId: string, name: string, lastCommit: string, type: string); @@ -91,9 +100,8 @@ export class Project { } else { this.projectId = args[0]; this.name = args[1]; - this.lastCommit = args[2]; - this.lastCommitTimestamp = args[3]; - this.type = args[4]; + this.lastUpdate = args[2]; + this.type = args[3]; return; } } @@ -108,7 +116,7 @@ export class DeploymentStatus { replicas: number = 0; readyReplicas: number = 0; unavailableReplicas: number = 0; - type: 'devmode' | 'devservice' | 'packaged' | 'internal' | 'build' | 'unknown' = 'unknown'; + type: 'devmode' | 'packaged' | 'internal' | 'build' | 'unknown' = 'unknown'; } export class ServiceStatus { @@ -128,7 +136,7 @@ export class ContainerPort { type: string = ''; } -export type ContainerType = 'devmode' | 'devservice' | 'packaged' | 'internal' | 'build' | 'unknown'; +export type ContainerType = 'devmode' | 'packaged' | 'internal' | 'build' | 'unknown'; export class ContainerStatus { containerName: string = ''; @@ -196,6 +204,15 @@ export class ProjectFile { } } +export interface ProjectFileCommited { + name: string; + projectId: string; + code: string; + commitTime: number; + syncDate: number; +} + + export class ProjectFileType { name: string = ''; title: string = ''; @@ -224,8 +241,6 @@ export const ProjectFileTypes: ProjectFileType[] = [ new ProjectFileType("PROPERTIES", "Properties", "properties"), new ProjectFileType("JSON", "JSON", "json"), new ProjectFileType("OPENAPI", "OpenAPI", "json"), - new ProjectFileType("ASYNCAPI", "AsyncAPI", "yaml"), - new ProjectFileType("ASYNCAPI", "AsyncAPI", "json"), new ProjectFileType("YAML", "YAML", "yaml"), new ProjectFileType("DOCKER", "Docker Compose", "yaml"), new ProjectFileType("SH", "Script", "sh"), @@ -241,8 +256,6 @@ export function getProjectFileTypeByName(fileName: string): ProjectFileType[] { if (fileName.endsWith(".camel.yaml")) return ProjectFileTypes.filter(p => p.name === "INTEGRATION") if (fileName.endsWith(".kamelet.yaml")) return ProjectFileTypes.filter(p => p.name === "KAMELET") if (fileName === "openapi.json") return ProjectFileTypes.filter(p => p.name === "OPENAPI") - if (fileName === "asyncapi.json") return ProjectFileTypes.filter(p => p.name === "ASYNCAPI") - if (fileName === "asyncapi.yaml") return ProjectFileTypes.filter(p => p.name === "ASYNCAPI") if (fileName.endsWith(".json")) return ProjectFileTypes.filter(p => p.name === "JSON") if (fileName.endsWith(".yaml")) return ProjectFileTypes.filter(p => p.name === "YAML") if (fileName.endsWith(".yml")) return ProjectFileTypes.filter(p => p.name === "YAML") diff --git a/karavan-app/src/main/webui/src/karavan/models/SearchModels.ts b/karavan-app/src/main/webui/src/karavan/models/SearchModels.ts index 9ed9f384..7d320b71 100644 --- a/karavan-app/src/main/webui/src/karavan/models/SearchModels.ts +++ b/karavan-app/src/main/webui/src/karavan/models/SearchModels.ts @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export class SearchResult { projectId: string = ''; files: string[] = []; diff --git a/karavan-app/src/main/webui/src/karavan/models/ServiceModels.ts b/karavan-app/src/main/webui/src/karavan/models/ServiceModels.ts index ba6428d5..6578e17e 100644 --- a/karavan-app/src/main/webui/src/karavan/models/ServiceModels.ts +++ b/karavan-app/src/main/webui/src/karavan/models/ServiceModels.ts @@ -68,14 +68,3 @@ export class ServicesYaml { return result; } } - -export class DevService { - name: string = ''; - image: string = ''; - environments: any = {}; - ports: string [] = []; - - public constructor(init?: Partial<DevService>) { - Object.assign(this, init); - } -} \ No newline at end of file diff --git a/karavan-app/src/main/webui/src/karavan/models/SystemModels.ts b/karavan-app/src/main/webui/src/karavan/models/SystemModels.ts index 326efbf2..a4d1d12a 100644 --- a/karavan-app/src/main/webui/src/karavan/models/SystemModels.ts +++ b/karavan-app/src/main/webui/src/karavan/models/SystemModels.ts @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + export class KubernetesSecret { name: string = ''; data: any = {}
