feat: add ops ai workspace dock control
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
import { API_BASE_URL } from "@plane/constants";
|
||||
import { APIService } from "@/services/api.service";
|
||||
|
||||
export type TAIWorkspaceExecutorStatus = "unknown" | "online" | "offline" | "checking" | "error";
|
||||
|
||||
export type TAIWorkspaceExecutor = {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
connectionMode: "hub" | "direct";
|
||||
pairingCode?: string | null;
|
||||
model?: string | null;
|
||||
accountLabel?: string | null;
|
||||
status: TAIWorkspaceExecutorStatus;
|
||||
lastSeenAt?: string | null;
|
||||
updatedAt?: string | null;
|
||||
};
|
||||
|
||||
export type TAIWorkspaceExecutorListResponse = {
|
||||
ok: boolean;
|
||||
selectedExecutorId?: string | null;
|
||||
executors: TAIWorkspaceExecutor[];
|
||||
};
|
||||
|
||||
export class WorkspaceAIWorkspaceService extends APIService {
|
||||
constructor() {
|
||||
super(API_BASE_URL);
|
||||
}
|
||||
|
||||
async listExecutors(workspaceSlug: string): Promise<TAIWorkspaceExecutorListResponse> {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/ai-workspace/executors/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data ?? error;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user