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
afb85855
Commit
afb85855
authored
Apr 26, 2022
by
El Mghazli Yacine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
table OK
parent
eb68baaa
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
83 deletions
+42
-83
common/utils/websrv/frontend/src/app/components/commands/commands.component.html
...ntend/src/app/components/commands/commands.component.html
+14
-6
common/utils/websrv/frontend/src/app/components/commands/commands.component.ts
...rontend/src/app/components/commands/commands.component.ts
+14
-5
common/utils/websrv/frontend/src/app/controls/entry.control.ts
...n/utils/websrv/frontend/src/app/controls/entry.control.ts
+14
-0
common/utils/websrv/frontend/src/app/controls/row.control.ts
common/utils/websrv/frontend/src/app/controls/row.control.ts
+0
-72
No files found.
common/utils/websrv/frontend/src/app/components/commands/commands.component.html
View file @
afb85855
...
...
@@ -64,12 +64,20 @@
</div>
</mat-header-cell>
<mat-cell
*matCellDef=
"let row; dataIndex as rowIndex"
>
<mat-form-field
[ngSwitch]=
"col.type"
>
<mat-slide-toggle
*ngSwitchCase=
"IOptionType.boolean"
[formControl]=
"row.booleanFC"
[checked]=
"row.isEnabledFC.value"
[disabled]=
"!col.modifiable"
></mat-slide-toggle>
<input
*ngSwitchCase=
"IOptionType.string"
matInput
[formControl]=
"row.stringFC"
[disabled]=
"!col.modifiable"
/>
<div
*ngIf=
"col.type === IOptionType.boolean; then toggle else default"
></div>
<ng-template
#toggle
>
<mat-slide-toggle
[formControl]=
"row[colIndex]"
[checked]=
"row[colIndex].value"
[disabled]=
"!col.modifiable"
>
</mat-slide-toggle>
</ng-template>
<ng-template
#default
>
<mat-form-field>
<input
matInput
[formControl]=
"row[colIndex]"
[disabled]=
"!col.modifiable"
/>
</mat-form-field>
</ng-template>
</mat-cell>
</div>
...
...
common/utils/websrv/frontend/src/app/components/commands/commands.component.ts
View file @
afb85855
...
...
@@ -3,9 +3,9 @@ import { Observable } from 'rxjs/internal/Observable';
import
{
of
}
from
'
rxjs/internal/observable/of
'
;
import
{
map
}
from
'
rxjs/internal/operators/map
'
;
import
{
mergeMap
}
from
'
rxjs/internal/operators/mergeMap
'
;
import
{
CommandsApi
,
IArgType
,
IColumn
,
ITable
}
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
{
RowCtrl
}
from
'
src/app/controls/row
.control
'
;
import
{
EntryFC
}
from
'
src/app/controls/entry
.control
'
;
import
{
VarCtrl
}
from
'
src/app/controls/var.control
'
;
import
{
DialogService
}
from
'
src/app/services/dialog.service
'
;
import
{
LoadingService
}
from
'
src/app/services/loading.service
'
;
...
...
@@ -35,7 +35,7 @@ export class CommandsComponent {
//table columns
displayedColumns
:
string
[]
=
[]
rows$
:
Observable
<
RowCtrl
[]
>
=
new
Observable
<
RowCtrl
[]
>
()
rows$
:
Observable
<
EntryFC
[][]
>
=
new
Observable
<
EntryFC
[]
[]
>
()
columns
:
IColumn
[]
=
[]
constructor
(
...
...
@@ -103,8 +103,17 @@ export class CommandsComponent {
map
(
resp
=>
{
this
.
columns
=
resp
.
table
!
.
columns
this
.
displayedColumns
=
this
.
columns
.
map
(
col
=>
col
.
name
)
let
rows
:
RowCtrl
[]
=
[]
resp
.
table
?.
rows
.
map
(
row
=>
this
.
columns
.
map
(
col
=>
rows
.
push
(
new
RowCtrl
(
row
,
col
.
type
))))
let
rows
=
[];
for
(
let
i
=
0
;
i
<
resp
.
table
!
.
rows
.
length
;
i
++
)
{
let
row
:
EntryFC
[]
=
[]
for
(
let
j
=
0
;
j
<
this
.
columns
.
length
;
j
++
)
{
row
[
j
]
=
new
EntryFC
(
resp
.
table
!
.
rows
[
i
][
j
],
this
.
columns
[
j
].
type
)
}
rows
[
i
]
=
row
}
return
rows
})
);
...
...
common/utils/websrv/frontend/src/app/controls/entry.control.ts
0 → 100644
View file @
afb85855
import
{
FormControl
}
from
'
@angular/forms
'
;
import
{
IArgType
}
from
'
../api/commands.api
'
;
export
class
EntryFC
extends
FormControl
{
type
:
IArgType
constructor
(
entry
:
string
,
type
:
IArgType
)
{
super
(
entry
);
this
.
type
=
type
}
}
common/utils/websrv/frontend/src/app/controls/row.control.ts
deleted
100644 → 0
View file @
eb68baaa
import
{
FormControl
,
FormGroup
}
from
'
@angular/forms
'
;
import
{
IArgType
,
IRow
}
from
'
../api/commands.api
'
;
export
class
RowCtrl
extends
FormGroup
{
type
:
IArgType
constructor
(
irow
:
IRow
,
type
:
IArgType
)
{
super
({});
this
.
type
=
type
this
.
addControl
(
type
,
new
FormControl
(
irow
));
}
api
()
{
switch
(
this
.
type
)
{
case
IArgType
.
boolean
:
return
this
.
boolFC
.
value
?
"
true
"
:
"
false
"
;
// case IArgType.list:
// return this.listFC.value as string;
case
IArgType
.
number
:
return
this
.
numberFC
.
value
as
string
;
// case IArgType.range:
// return this.rangeFC.value as string;
case
IArgType
.
string
:
return
this
.
stringFC
.
value
}
}
get
boolFC
()
{
return
this
.
get
(
IArgType
.
boolean
)
as
FormControl
;
}
set
boolFC
(
control
:
FormControl
)
{
this
.
setControl
(
IArgType
.
boolean
,
control
);
}
get
listFC
()
{
return
this
.
get
(
IArgType
.
list
)
as
FormControl
;
}
set
listFC
(
control
:
FormControl
)
{
this
.
setControl
(
IArgType
.
list
,
control
);
}
get
numberFC
()
{
return
this
.
get
(
IArgType
.
number
)
as
FormControl
;
}
set
numberFC
(
control
:
FormControl
)
{
this
.
setControl
(
IArgType
.
number
,
control
);
}
get
rangeFC
()
{
return
this
.
get
(
IArgType
.
range
)
as
FormControl
;
}
set
rangeFC
(
control
:
FormControl
)
{
this
.
setControl
(
IArgType
.
range
,
control
);
}
get
stringFC
()
{
return
this
.
get
(
IArgType
.
string
)
as
FormControl
;
}
set
stringFC
(
control
:
FormControl
)
{
this
.
setControl
(
IArgType
.
string
,
control
);
}
}
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