diference
This commit is contained in:
parent
7063e93c75
commit
e748debd2f
5 changed files with 34 additions and 12 deletions
|
@ -11,22 +11,23 @@ import { ITopicModel } from "../../topics/topic_database_model";
|
||||||
import { ExecInstanceTwinsProcessService } from "../services/exec_instance_twins_process_service";
|
import { ExecInstanceTwinsProcessService } from "../services/exec_instance_twins_process_service";
|
||||||
|
|
||||||
export interface Topics {
|
export interface Topics {
|
||||||
topics: ITopicModel[];
|
topics: ITopicModel[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export class ExecInstanceScenario extends CallbackStrategyWithIdQuery {
|
export class ExecInstanceScenario extends CallbackStrategyWithIdQuery {
|
||||||
idValidationExpression: CoreValidation = new MongoIdValidation();
|
idValidationExpression: CoreValidation = new MongoIdValidation();
|
||||||
call = async (id: string): ResponseBase =>
|
call = async (id: string): ResponseBase =>
|
||||||
(
|
(
|
||||||
await new ReadByIdDataBaseModelUseCase<IDigitalTwinsInstanceModel>(DigitalTwinsInstanceDatabaseModel).call(id)
|
await new ReadByIdDataBaseModelUseCase<IDigitalTwinsInstanceModel>(DigitalTwinsInstanceDatabaseModel).call(id)
|
||||||
).map((document) =>
|
).map(
|
||||||
new ExecProcessUseCase().call(
|
(document) => (
|
||||||
document.instancePath,
|
console.log(JSON.stringify(document)),
|
||||||
`python3 $GET_INTERFACES --path ${document.instancePath}`,
|
new ExecProcessUseCase().call(
|
||||||
"",
|
document.instancePath,
|
||||||
new ExecInstanceTwinsProcessService(document.instancePath, document)
|
`python3 $GET_INTERFACES --path ${document.instancePath} --package ${JSON.stringify(document)}`,
|
||||||
|
"",
|
||||||
|
new ExecInstanceTwinsProcessService(document.instancePath, document)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,12 @@ export const DigitalTwinsInstanceSchema = new Schema({
|
||||||
instancePath: {
|
instancePath: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
package: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
executable: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
formBuilder: {
|
formBuilder: {
|
||||||
type: Schema.Types.Mixed,
|
type: Schema.Types.Mixed,
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,12 +8,18 @@ export const DigitalTwinsTemplateSchema = new Schema({
|
||||||
entity: String,
|
entity: String,
|
||||||
description: String,
|
description: String,
|
||||||
command: String,
|
command: String,
|
||||||
|
package: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
executable: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
interfaces: {
|
interfaces: {
|
||||||
cmd: String,
|
cmd: String,
|
||||||
},
|
},
|
||||||
formBuilder:{
|
formBuilder: {
|
||||||
type: Schema.Types.Mixed,
|
type: Schema.Types.Mixed,
|
||||||
}
|
},
|
||||||
}).plugin(require("mongoose-autopopulate"));
|
}).plugin(require("mongoose-autopopulate"));
|
||||||
|
|
||||||
export const digitalTwinsTemplateSchema = "digital_twins_templates";
|
export const digitalTwinsTemplateSchema = "digital_twins_templates";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ValidationModel } from "../../core/model/validation_model";
|
import { ValidationModel } from "../../core/model/validation_model";
|
||||||
import { Type } from "class-transformer";
|
import { Type } from "class-transformer";
|
||||||
import { IsEnum, IsString } from "class-validator";
|
import { IsEnum, IsNotEmpty, IsString } from "class-validator";
|
||||||
import { FormBuilderValidationModel } from "../dataset/dataset_model";
|
import { FormBuilderValidationModel } from "../dataset/dataset_model";
|
||||||
|
|
||||||
export enum DigitalTwinsTypes {
|
export enum DigitalTwinsTypes {
|
||||||
|
@ -25,6 +25,12 @@ export class DigitalTwinsModel extends ValidationModel {
|
||||||
command: string;
|
command: string;
|
||||||
@Type(() => Interfaces)
|
@Type(() => Interfaces)
|
||||||
interfaces: Interfaces;
|
interfaces: Interfaces;
|
||||||
|
@IsNotEmpty()
|
||||||
|
@IsString()
|
||||||
|
package: string;
|
||||||
|
@IsNotEmpty()
|
||||||
|
@IsString()
|
||||||
|
executable: string;
|
||||||
formBuilder = FormBuilderValidationModel.empty();
|
formBuilder = FormBuilderValidationModel.empty();
|
||||||
static empty() {
|
static empty() {
|
||||||
return new DigitalTwinsModel();
|
return new DigitalTwinsModel();
|
||||||
|
|
|
@ -106,6 +106,9 @@ export const DigitalTwinsScreen = observer(() => {
|
||||||
<CoreInput onChange={(text) => store.updateForm({ description: text })} label={"Описание"} />
|
<CoreInput onChange={(text) => store.updateForm({ description: text })} label={"Описание"} />
|
||||||
<CoreInput onChange={(text) => store.updateForm({ command: text })} label={"Команда"} />
|
<CoreInput onChange={(text) => store.updateForm({ command: text })} label={"Команда"} />
|
||||||
<CoreInput onChange={(text) => store.updateForm({ interfaces: { cmd: text } })} label={"Cmd"} />
|
<CoreInput onChange={(text) => store.updateForm({ interfaces: { cmd: text } })} label={"Cmd"} />
|
||||||
|
<CoreInput onChange={(text) => store.updateForm({ executable: text })} label={"executable"} />
|
||||||
|
<CoreInput onChange={(text) => store.updateForm({ package: text })} label={"package"} />
|
||||||
|
|
||||||
<CoreInput
|
<CoreInput
|
||||||
label="FormBuilder Result"
|
label="FormBuilder Result"
|
||||||
onChange={(text) => (store.viewModel.formBuilder.result = text)}
|
onChange={(text) => (store.viewModel.formBuilder.result = text)}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue