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
8c355a08
Commit
8c355a08
authored
Mar 17, 2022
by
El Mghazli Yacine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api first test
parent
fc3319c9
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
148 deletions
+65
-148
.vscode/launch.json
.vscode/launch.json
+1
-14
common/utils/websrv/frontend/.eslintrc.json
common/utils/websrv/frontend/.eslintrc.json
+1
-1
common/utils/websrv/frontend/.gitlab-ci.yml
common/utils/websrv/frontend/.gitlab-ci.yml
+1
-77
common/utils/websrv/frontend/Dockerfile
common/utils/websrv/frontend/Dockerfile
+0
-8
common/utils/websrv/frontend/src/app/api/commands.api.ts
common/utils/websrv/frontend/src/app/api/commands.api.ts
+2
-0
common/utils/websrv/frontend/src/app/components/commands/commands.component.html
...ntend/src/app/components/commands/commands.component.html
+18
-12
common/utils/websrv/frontend/src/app/components/commands/commands.component.ts
...rontend/src/app/components/commands/commands.component.ts
+42
-27
common/utils/websrv/frontend/src/app/components/nav/nav.component.html
...websrv/frontend/src/app/components/nav/nav.component.html
+0
-7
common/utils/websrv/frontend/src/app/controls/infos.control.ts
...n/utils/websrv/frontend/src/app/controls/infos.control.ts
+0
-2
No files found.
.vscode/launch.json
View file @
8c355a08
...
@@ -33,20 +33,7 @@
...
@@ -33,20 +33,7 @@
"type"
:
"chrome"
,
"type"
:
"chrome"
,
"request"
:
"launch"
,
"request"
:
"launch"
,
"url"
:
"http://localhost:4200"
,
"url"
:
"http://localhost:4200"
,
"webRoot"
:
"${workspaceFolder}"
"webRoot"
:
"${workspaceFolder}/common/utils/websrv/frontend"
},
{
"name"
:
"Launch Firefox (4200 ng serve)"
,
"type"
:
"firefox"
,
"request"
:
"launch"
,
"reAttach"
:
true
,
"url"
:
"http://localhost:4200"
,
"pathMappings"
:
[
{
"url"
:
"webpack:///src"
,
"path"
:
"${workspaceFolder}/src"
}
]
},
},
{
{
"name"
:
"Launch Chrome (localhost)"
,
"name"
:
"Launch Chrome (localhost)"
,
...
...
common/utils/websrv/frontend/.eslintrc.json
View file @
8c355a08
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
],
],
"parserOptions"
:
{
"parserOptions"
:
{
"project"
:
[
"project"
:
[
"
.
/tsconfig.json"
"
common/utils/websrv/frontend
/tsconfig.json"
],
],
"createDefaultProgram"
:
true
"createDefaultProgram"
:
true
},
},
...
...
common/utils/websrv/frontend/.gitlab-ci.yml
View file @
8c355a08
stages
:
stages
:
-
install
-
install
-
build
-
build
-
publish
-
deploy
variables
:
variables
:
TRION_CLI_VERSION
:
12.2.4
TRION_CLI_VERSION
:
12.2.4
.install
:
cache
:
key
:
files
:
-
package-lock.json
paths
:
-
.npm
-
node_modules
policy
:
pull
only
:
-
master
-
dev
#
#
#jobs
#jobs
#
#
install
:
install
:
stage
:
install
stage
:
install
extends
:
.install
image
:
trion/ng-cli:${TRION_CLI_VERSION}
image
:
trion/ng-cli:${TRION_CLI_VERSION}
script
:
script
:
-
npm ci
-
npm ci
cache
:
policy
:
pull-push
only
:
only
:
changes
:
changes
:
-
package-lock.json
-
package-lock.json
...
@@ -46,62 +28,4 @@ build:
...
@@ -46,62 +28,4 @@ build:
artifacts
:
artifacts
:
expire_in
:
1 day
expire_in
:
1 day
paths
:
paths
:
-
dist/lsd-ngx
-
dist/softmodem-ngx
on-gitlab
:
stage
:
publish
dependencies
:
-
build
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
before_script
:
-
mkdir -p /kaniko/.docker
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script
:
-
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile Dockerfile --destination $CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:latest
only
:
-
dev
-
master
on-heroku
:
stage
:
publish
dependencies
:
-
build
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
before_script
:
-
mkdir -p /kaniko/.docker
-
echo "{\"auths\":{\"registry.heroku.com\":{\"username\":\"_\",\"password\":\"$HEROKU_API_KEY\"}}}" > /kaniko/.docker/config.json
script
:
-
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile Dockerfile --destination registry.heroku.com/$HEROKU_APP_NAME/web
only
:
-
dev
herokuapp
:
stage
:
deploy
image
:
node:lts-alpine
before_script
:
-
apk update && apk add curl bash
-
rm -rf /var/cache/apk/*
-
curl https://cli-assets.heroku.com/install.sh | sh
script
:
-
heroku container:release web --app $HEROKU_APP_NAME
environment
:
name
:
heroku-dev
url
:
https://lsdngx.herokuapp.com
only
:
-
dev
on-gke
:
stage
:
deploy
image
:
alpine/k8s:1.20.7
script
:
-
kubectl config use-context lsd5/k8s:gke-agent
-
kubectl apply -f k8s/manifest.yaml --namespace=$NAMESPACE
environment
:
name
:
gke-master
url
:
https://lsd.nutridata.io
only
:
-
master
common/utils/websrv/frontend/Dockerfile
deleted
100644 → 0
View file @
fc3319c9
FROM
nginx:alpine
COPY
dist/softmodem-ngx /usr/share/nginx/html/
COPY
nginx.conf /etc/nginx/conf.d/default.conf
# sed replace $PORT by $PORT at runtime (on heroku with the correct port)
CMD
sed -i -e 's/$PORT/'"$PORT"'/g' /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'
common/utils/websrv/frontend/src/app/api/commands.api.ts
View file @
8c355a08
...
@@ -21,6 +21,8 @@ export class CommandsApi {
...
@@ -21,6 +21,8 @@ export class CommandsApi {
constructor
(
private
httpClient
:
HttpClient
)
{
}
constructor
(
private
httpClient
:
HttpClient
)
{
}
public
readInfos$
=
()
=>
this
.
httpClient
.
get
<
IInfos
>
(
environment
.
backend
+
route
);
public
readInfos$
=
()
=>
this
.
httpClient
.
get
<
IInfos
>
(
environment
.
backend
+
route
);
public
runCommand$
=
(
cmdName
:
string
)
=>
this
.
httpClient
.
post
<
string
>
(
environment
.
backend
+
route
,
cmdName
);
}
}
...
...
common/utils/websrv/frontend/src/app/components/commands/commands.component.html
View file @
8c355a08
<
!-- <div *ngIf="infos$ | async as infos"> --
>
<
div
*ngIf=
"infos$ | async as infos"
>
<h1
mat-dialog-title
>
Status
</h1>
<h1
mat-dialog-title
>
Status
</h1>
<p>
config_file: {{ infos.display_status.config_file }}
</p>
<p>
config_file: {{ infos.display_status.config_file }}
</p>
<p>
executable_function: {{ infos.display_status.executable_function }}
</p>
<p>
executable_function: {{ infos.display_status.executable_function }}
</p>
<h1
mat-dialog-title
>
Commands
</h1>
<h1
mat-dialog-title
>
Commands
</h1>
<mat-form-field>
<div
fxLaypout=
"row"
>
<mat-form-field>
<mat-label>
Command
</mat-label>
<mat-label>
Command
</mat-label>
<mat-select
[formControl]=
"selectedCmd?.value"
[value]=
"selectedCm
d?.value"
>
<mat-select
[formControl]=
"selected"
[value]=
"selecte
d?.value"
>
<mat-option
*ngFor=
"let control of infos.cmdsFA.controls"
[value]=
"control.value"
>
{{ control.value }}
<mat-option
*ngFor=
"let control of infos.cmdsFA.controls"
[value]=
"control.value"
>
{{ control.value }}
</mat-option>
</mat-option>
</mat-select>
</mat-select>
</mat-form-field>
</mat-form-field>
\ No newline at end of file
<button
mat-raised-button
color=
"primary"
[disabled]=
"!selected"
(click)=
"onSubmit()"
>
submit
</button>
</div>
</div>
\ No newline at end of file
common/utils/websrv/frontend/src/app/components/commands/commands.component.ts
View file @
8c355a08
/* eslint-disable @typescript-eslint/member-ordering */
import
{
Component
}
from
'
@angular/core
'
;
/* eslint-disable no-shadow */
/* eslint-disable eqeqeq */
/* eslint-disable @typescript-eslint/naming-convention */
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
FormControl
}
from
'
@angular/forms
'
;
import
{
FormControl
}
from
'
@angular/forms
'
;
import
{
Observable
}
from
'
rxjs/internal/Observable
'
;
import
{
map
}
from
'
rxjs/internal/operators/map
'
;
import
{
CommandsApi
}
from
'
src/app/api/commands.api
'
;
import
{
CommandsApi
}
from
'
src/app/api/commands.api
'
;
import
{
InfosCtrl
}
from
'
src/app/controls/infos.control
'
;
import
{
InfosCtrl
}
from
'
src/app/controls/infos.control
'
;
import
{
LoadingService
}
from
'
src/app/services/loading.service
'
;
import
{
LoadingService
}
from
'
src/app/services/loading.service
'
;
...
@@ -16,33 +14,50 @@ import { LoadingService } from 'src/app/services/loading.service';
...
@@ -16,33 +14,50 @@ import { LoadingService } from 'src/app/services/loading.service';
})
})
export
class
CommandsComponent
{
export
class
CommandsComponent
{
//
infos$: Observable<InfosCtrl>
infos$
:
Observable
<
InfosCtrl
>
infos
:
InfosCtrl
//
infos: InfosCtrl
selected
Cmd
?:
FormControl
selected
=
new
FormControl
()
constructor
(
constructor
(
public
commandsApi
:
CommandsApi
,
public
commandsApi
:
CommandsApi
,
public
loadingService
:
LoadingService
,
public
loadingService
:
LoadingService
,
)
{
)
{
// this.infos$ = this.commandsApi.readInfos$().pipe(
this
.
infos$
=
this
.
commandsApi
.
readInfos$
().
pipe
(
// map((doc) => new InfosCtrl(doc)),
map
((
doc
)
=>
new
InfosCtrl
(
doc
)),
// );
);
this
.
infos
=
new
InfosCtrl
({
// this.infos = new InfosCtrl({
display_status
:
{
// display_status: {
config_file
:
'
../../../ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
'
,
// config_file: '../../../ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf',
executable_function
:
"
gnb
"
// executable_function: "gnb"
},
// },
menu_cmds
:
[
// menu_cmds: [
"
telnet
"
,
// "telnet",
"
softmodem
"
,
// "softmodem",
"
loader
"
,
// "loader",
"
measur
"
,
// "measur",
"
rfsimu
"
// "rfsimu"
]
// ]
})
// })
// console.log(JSON.stringify(this.infos, null, 2))
// const BODY_JSON = {
// "display_status": {
// "config_file": '../../../ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf',
// "executable_function": "gnb"
// },
// "menu_cmds": [
// "telnet",
// "softmodem",
// "loader",
// "measur",
// "rfsimu"
// ]
// }
}
onSubmit
()
{
this
.
commandsApi
.
runCommand$
(
this
.
selected
.
value
).
subscribe
();
}
}
}
}
common/utils/websrv/frontend/src/app/components/nav/nav.component.html
View file @
8c355a08
...
@@ -24,13 +24,6 @@
...
@@ -24,13 +24,6 @@
<ng-container
*ngIf=
"loadingService.isLoading$ | async; then loading; else not_loading"
>
<ng-container
*ngIf=
"loadingService.isLoading$ | async; then loading; else not_loading"
>
</ng-container>
</ng-container>
</div>
</div>
<div
#notAuthenticated
>
<button
mat-raised-button
color=
"primary"
>
login
</button>
</div>
</mat-toolbar-row>
</mat-toolbar-row>
</mat-toolbar>
</mat-toolbar>
...
...
common/utils/websrv/frontend/src/app/controls/infos.control.ts
View file @
8c355a08
/* eslint-disable no-shadow */
import
{
FormArray
,
FormControl
,
FormGroup
}
from
'
@angular/forms
'
;
import
{
FormArray
,
FormControl
,
FormGroup
}
from
'
@angular/forms
'
;
import
{
IInfos
,
IStatus
}
from
'
../api/commands.api
'
;
import
{
IInfos
,
IStatus
}
from
'
../api/commands.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