mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
添加依赖管理
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
export class Dependence {
|
||||
timestamp?: string;
|
||||
created?: number;
|
||||
_id?: string;
|
||||
status?: DependenceStatus;
|
||||
type?: DependenceTypes;
|
||||
name?: number;
|
||||
log?: string[];
|
||||
remark?: string;
|
||||
|
||||
constructor(options: Dependence) {
|
||||
this._id = options._id;
|
||||
this.created = options.created || new Date().valueOf();
|
||||
this.status = options.status || DependenceStatus.installing;
|
||||
this.type = options.type || DependenceTypes.nodejs;
|
||||
this.timestamp = new Date().toString();
|
||||
this.name = options.name;
|
||||
this.log = options.log || [];
|
||||
this.remark = options.remark || '';
|
||||
}
|
||||
}
|
||||
|
||||
export enum DependenceStatus {
|
||||
'installing',
|
||||
'installed',
|
||||
'installFailed',
|
||||
}
|
||||
|
||||
export enum DependenceTypes {
|
||||
'nodejs',
|
||||
'python3',
|
||||
'linux',
|
||||
}
|
||||
|
||||
export enum InstallDependenceCommandTypes {
|
||||
'pnpm install -g',
|
||||
'pip3 install',
|
||||
'apk add --no-cache',
|
||||
}
|
||||
|
||||
export enum unInstallDependenceCommandTypes {
|
||||
'pnpm uninstall -g',
|
||||
'pip3 uninstall',
|
||||
'apk del',
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
export class SockMessage {
|
||||
message?: string;
|
||||
type?: SockMessageType;
|
||||
references?: string[];
|
||||
|
||||
constructor(options: SockMessage) {
|
||||
this.type = options.type;
|
||||
this.message = options.message;
|
||||
this.references = options.references;
|
||||
}
|
||||
}
|
||||
|
||||
export type SockMessageType =
|
||||
| 'ping'
|
||||
| 'installDependence'
|
||||
| 'updateSystemVersion';
|
||||
Reference in New Issue
Block a user