Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
a3b64c4a
Commit
a3b64c4a
authored
Apr 04, 2022
by
El Mghazli Yacine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APIv2.2
parent
564bcde6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
17 deletions
+14
-17
common/utils/websrv/frontend/src/app/api/commands.api.ts
common/utils/websrv/frontend/src/app/api/commands.api.ts
+1
-3
common/utils/websrv/frontend/src/app/components/commands/commands.component.html
...ntend/src/app/components/commands/commands.component.html
+3
-3
common/utils/websrv/frontend/src/app/components/commands/commands.component.ts
...rontend/src/app/components/commands/commands.component.ts
+10
-11
No files found.
common/utils/websrv/frontend/src/app/api/commands.api.ts
View file @
a3b64c4a
...
...
@@ -37,8 +37,6 @@ export class CommandsApi {
public
readModuleCommands$
=
(
moduleName
:
string
)
=>
this
.
httpClient
.
get
<
ICommand
[]
>
(
environment
.
backend
+
route
+
'
/commands/
'
+
moduleName
);
public
runCommand$
=
(
command
:
ICommand
)
=>
this
.
httpClient
.
post
<
string
>
(
environment
.
backend
+
route
+
'
/run/
'
,
command
);
public
setVariable$
=
(
variable
:
IVariable
)
=>
this
.
httpClient
.
post
<
string
>
(
environment
.
backend
+
route
+
'
/set/
'
,
variable
);
public
runCommand$
=
(
moduleName
:
string
,
variable
:
IVariable
)
=>
this
.
httpClient
.
post
<
string
>
(
environment
.
backend
+
route
+
'
/commands/
'
+
moduleName
,
variable
);
}
common/utils/websrv/frontend/src/app/components/commands/commands.component.html
View file @
a3b64c4a
...
...
@@ -16,7 +16,7 @@
<mat-form-field>
<mat-label>
Command
</mat-label>
<mat-select
[formControl]=
"selectedCmd!.nameFC"
[value]=
"selectedCmd!.nameFC.value"
(selectionChange)=
"onCmdSelect(
selectedCmd!
)"
>
(selectionChange)=
"onCmdSelect()"
>
<mat-option
*ngFor=
"let cmd of cmds"
[value]=
"cmd"
>
{{ cmd.nameFC.value }}
</mat-option>
</mat-select>
...
...
@@ -41,7 +41,7 @@
<mat-form-field>
<mat-label>
Command
</mat-label>
<mat-select
[formControl]=
"selectedSubCmd!.nameFC"
[value]=
"selectedSubCmd!.nameFC.value"
(selectionChange)=
"onSubCmdSelect(
selectedSubCmd!
)"
>
(selectionChange)=
"onSubCmdSelect()"
>
<mat-option
*ngFor=
"let cmd of subcmds"
[value]=
"cmd"
>
{{ cmd.nameFC.value }}
</mat-option>
</mat-select>
...
...
@@ -55,7 +55,7 @@
<input
input
matInput
[formControl]=
"variable.valueFC"
/>
</mat-form-field>
<button
mat-raised-button
color=
"primary"
[disabled]=
"!variable.modifiableFC.value"
(click)=
"onVarSubmit(variable)"
>
(click)=
"on
Sub
VarSubmit(variable)"
>
submit
</button>
</div>
...
...
common/utils/websrv/frontend/src/app/components/commands/commands.component.ts
View file @
a3b64c4a
...
...
@@ -43,31 +43,30 @@ export class CommandsComponent {
);
}
onCmdSubmit
(
control
:
CmdCtrl
)
{
this
.
commandsApi
.
runCommand$
(
control
.
api
()).
subscribe
();
}
onCmdSelect
(
control
:
CmdCtrl
)
{
this
.
subcmds$
=
this
.
commandsApi
.
readModuleCommands$
(
control
.
nameFC
.
value
).
pipe
(
onCmdSelect
()
{
this
.
subcmds$
=
this
.
commandsApi
.
readModuleCommands$
(
`
${
this
.
selectedCmd
?.
nameFC
.
value
}
`
).
pipe
(
map
(
cmds
=>
cmds
.
map
(
cmd
=>
new
CmdCtrl
(
cmd
))),
// tap(cmds => [this.selectedSubCmd] = cmds)
)
this
.
subvars$
=
this
.
commandsApi
.
readModuleVariables$
(
control
.
nameFC
.
value
).
pipe
(
this
.
subvars$
=
this
.
commandsApi
.
readModuleVariables$
(
`
${
this
.
selectedCmd
?.
nameFC
.
value
}
`
).
pipe
(
map
(
vars
=>
vars
.
map
(
v
=>
new
VarCtrl
(
v
))),
// tap(vars => [this.selectedSubVar] = vars)
)
}
onSubCmdSelect
(
control
:
CmdCtrl
)
{
this
.
args$
=
this
.
commandsApi
.
readModuleVariables$
(
control
.
nameFC
.
value
).
pipe
(
onSubCmdSelect
()
{
this
.
args$
=
this
.
commandsApi
.
readModuleVariables$
(
`
${
this
.
selectedCmd
?.
nameFC
.
value
}
/
${
this
.
selectedSubCmd
?.
nameFC
.
value
}
`
).
pipe
(
map
(
vars
=>
vars
.
map
(
v
=>
new
VarCtrl
(
v
))),
// tap(vars => [this.selectedSubVar] = vars)
)
}
onVarSubmit
(
control
:
VarCtrl
)
{
control
.
nameFC
=
new
FormControl
(
`
${
this
.
selectedCmd
?.
nameFC
.
value
}
${
this
.
selectedSubCmd
?.
nameFC
.
value
}
${
control
.
nameFC
.
value
}
`
.
trim
())
this
.
commandsApi
.
setVariable$
(
control
.
api
()).
subscribe
();
this
.
commandsApi
.
runCommand$
(
`
${
this
.
selectedCmd
?.
nameFC
.
value
}
/
${
control
.
nameFC
.
value
}
`
,
control
.
valueFC
.
value
).
subscribe
();
}
onSubVarSubmit
(
control
:
VarCtrl
)
{
this
.
commandsApi
.
runCommand$
(
`
${
this
.
selectedCmd
?.
nameFC
.
value
}
/
${
this
.
selectedSubCmd
?.
nameFC
.
value
}
/
${
control
.
nameFC
.
value
}
`
,
control
.
valueFC
.
value
).
subscribe
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment