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
a3b05f0b
Commit
a3b05f0b
authored
Apr 26, 2022
by
El Mghazli Yacine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confirm button ok
parent
61dab4c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
11 deletions
+16
-11
common/utils/websrv/frontend/src/app/components/commands/commands.component.ts
...rontend/src/app/components/commands/commands.component.ts
+6
-5
common/utils/websrv/frontend/src/app/components/confirm/confirm.component.html
...rontend/src/app/components/confirm/confirm.component.html
+1
-2
common/utils/websrv/frontend/src/app/components/confirm/confirm.component.ts
.../frontend/src/app/components/confirm/confirm.component.ts
+5
-4
common/utils/websrv/frontend/src/app/controls/cmd.control.ts
common/utils/websrv/frontend/src/app/controls/cmd.control.ts
+4
-0
No files found.
common/utils/websrv/frontend/src/app/components/commands/commands.component.ts
View file @
a3b05f0b
...
@@ -3,6 +3,7 @@ import { Observable } from 'rxjs/internal/Observable';
...
@@ -3,6 +3,7 @@ import { Observable } from 'rxjs/internal/Observable';
import
{
of
}
from
'
rxjs/internal/observable/of
'
;
import
{
of
}
from
'
rxjs/internal/observable/of
'
;
import
{
map
}
from
'
rxjs/internal/operators/map
'
;
import
{
map
}
from
'
rxjs/internal/operators/map
'
;
import
{
mergeMap
}
from
'
rxjs/internal/operators/mergeMap
'
;
import
{
mergeMap
}
from
'
rxjs/internal/operators/mergeMap
'
;
import
{
filter
}
from
'
rxjs/operators
'
;
import
{
CommandsApi
,
IArgType
,
IColumn
}
from
'
src/app/api/commands.api
'
;
import
{
CommandsApi
,
IArgType
,
IColumn
}
from
'
src/app/api/commands.api
'
;
import
{
CmdCtrl
}
from
'
src/app/controls/cmd.control
'
;
import
{
CmdCtrl
}
from
'
src/app/controls/cmd.control
'
;
import
{
EntryFC
}
from
'
src/app/controls/entry.control
'
;
import
{
EntryFC
}
from
'
src/app/controls/entry.control
'
;
...
@@ -90,12 +91,12 @@ export class CommandsComponent {
...
@@ -90,12 +91,12 @@ export class CommandsComponent {
onCmdSubmit
(
control
:
CmdCtrl
)
{
onCmdSubmit
(
control
:
CmdCtrl
)
{
// const obs = control.confirm ? this.dialogService.openConfirmDialog(control.confirm) : of(null)
const
obs
=
control
.
confirm
?
this
.
dialogService
.
openConfirmDialog
(
control
.
confirm
).
pipe
(
filter
(
confirmed
=>
confirmed
))
:
of
(
null
)
// this.rows$ = obs.pipe(
this
.
rows$
=
obs
.
pipe
(
// mergeMap(() => this.commandsApi.runCommand$(control.api(), `${this.selectedModule!.nameFC.value}`)),
mergeMap
(()
=>
this
.
commandsApi
.
runCommand$
(
control
.
api
(),
`
${
this
.
selectedModule
!
.
nameFC
.
value
}
`
)),
this
.
rows$
=
this
.
commandsApi
.
runCommand$
(
control
.
api
(),
`
${
this
.
selectedModule
!
.
nameFC
.
value
}
`
).
pipe
(
mergeMap
(
resp
=>
{
mergeMap
(
resp
=>
{
if
(
resp
.
display
[
0
])
return
this
.
dialogService
.
openRespDialog
(
resp
,
'
cmd
'
+
control
.
nameFC
.
value
+
'
response:
'
)
if
(
resp
.
display
[
0
])
return
this
.
dialogService
.
openRespDialog
(
resp
,
'
cmd
'
+
control
.
nameFC
.
value
+
'
response:
'
)
else
return
of
(
resp
)
else
return
of
(
resp
)
...
...
common/utils/websrv/frontend/src/app/components/confirm/confirm.component.html
View file @
a3b05f0b
<h1>
Really ?
</h1>
<h3>
{{ data.title }}
</h3>
<div
fxLayoutGap=
"10px"
mat-dialog-actions
fxLayout=
"row"
fxLayoutAlign=
"center start"
>
<div
fxLayoutGap=
"10px"
mat-dialog-actions
fxLayout=
"row"
fxLayoutAlign=
"center start"
>
<button
mat-button
[mat-dialog-close]=
"true"
cdkFocusInitial
>
Ok
</button>
<button
mat-button
[mat-dialog-close]=
"true"
cdkFocusInitial
>
Ok
</button>
<button
mat-button
(click)=
"onNoClick()"
>
Cancel
</button>
<button
mat-button
(click)=
"onNoClick()"
>
Cancel
</button>
...
...
common/utils/websrv/frontend/src/app/components/confirm/confirm.component.ts
View file @
a3b05f0b
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/naming-convention */
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
,
Inject
}
from
'
@angular/core
'
;
import
{
MatDialogRef
}
from
'
@angular/material/dialog
'
;
import
{
MatDialogRef
,
MAT_DIALOG_DATA
}
from
'
@angular/material/dialog
'
;
@
Component
({
@
Component
({
selector
:
'
app-confirm
'
,
selector
:
'
app-confirm
'
,
...
@@ -10,8 +10,9 @@ import { MatDialogRef } from '@angular/material/dialog';
...
@@ -10,8 +10,9 @@ import { MatDialogRef } from '@angular/material/dialog';
export
class
ConfirmDialogComponent
{
export
class
ConfirmDialogComponent
{
constructor
(
constructor
(
public
dialogRef
:
MatDialogRef
<
void
>
public
dialogRef
:
MatDialogRef
<
void
>
,
)
{
}
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
)
{
}
onNoClick
()
{
onNoClick
()
{
this
.
dialogRef
.
close
();
this
.
dialogRef
.
close
();
...
...
common/utils/websrv/frontend/src/app/controls/cmd.control.ts
View file @
a3b05f0b
...
@@ -3,14 +3,18 @@ import { ICommand } from '../api/commands.api';
...
@@ -3,14 +3,18 @@ import { ICommand } from '../api/commands.api';
const
enum
CmdFCN
{
const
enum
CmdFCN
{
name
=
'
name
'
,
name
=
'
name
'
,
confirm
=
'
confirm
'
}
}
export
class
CmdCtrl
extends
FormGroup
{
export
class
CmdCtrl
extends
FormGroup
{
confirm
?:
string
constructor
(
cmd
:
ICommand
)
{
constructor
(
cmd
:
ICommand
)
{
super
({});
super
({});
this
.
addControl
(
CmdFCN
.
name
,
new
FormControl
(
cmd
.
name
));
this
.
addControl
(
CmdFCN
.
name
,
new
FormControl
(
cmd
.
name
));
this
.
confirm
=
cmd
.
confirm
}
}
api
()
{
api
()
{
...
...
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