Commit 9a0dd7c1 authored by Robert Schmidt's avatar Robert Schmidt

Update for webserver; cleanup in CMakeLists.txt

- Add oai header to typescript and html sources, add support to commands
  requiring two parameters, add more helpfiles
- Fix help bug (html comments not removed from tooltips)
- Fix backend build problem and 2 warnings
- Correctly initialize variables in nr_phy_scope.c
- Use add_subdirectory for websrv cmake build
- correctly link to asn1_lte_rrc and asn1_nr_rrc
- fix bug: correctly recognize npm packet
- only configure targets if explicitly asked for by users
- use add_subdirectory
- Use add_subdirectory for telnet cmake build
- Minor cleanup in build_oai
- Move softscope build in dedicated CMakeLists, and comment out
  DEBUG_MAC_INTERFACE option (not found in code)
- Make DEBUG_ASN1 a cmake only option ( no C macro) as it's not used as
  a C macro in the code, and develop align
parent ffecf830
This diff is collapsed.
...@@ -55,14 +55,7 @@ CMAKE_BUILD_TYPE="RelWithDebInfo" ...@@ -55,14 +55,7 @@ CMAKE_BUILD_TYPE="RelWithDebInfo"
CMAKE_CMD="$CMAKE" CMAKE_CMD="$CMAKE"
BUILD_ECLIPSE=0 BUILD_ECLIPSE=0
NR="False" NR="False"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope ldpc_cuda ldpc_t1" OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope ldpc_cuda ldpc_t1 websrv"
ulfiusdep=$(basename ./`find /usr/lib* -name libulfius.so`)
jssondep=$(basename ./`find /usr/lib* -name libjansson.so`)
if [ "$ulfiusdep" == "libulfius.so" -a "$jssondep" == "libjansson.so" ] ; then
OPTIONAL_LIBRARIES+=" websrv"
else
echo_warning " websrv optional build not included in build-lib option as dependencies requirements not met "
fi
RU=0 RU=0
CMAKE_C_FLAGS=() CMAKE_C_FLAGS=()
CMAKE_CXX_FLAGS=() CMAKE_CXX_FLAGS=()
...@@ -85,7 +78,7 @@ Options: ...@@ -85,7 +78,7 @@ Options:
-d | --build-dir -d | --build-dir
Sets build directory (will be <oai-root>/cmake_targets/<build-dir>/build) Sets build directory (will be <oai-root>/cmake_targets/<build-dir>/build)
-I | --install-external-packages -I | --install-external-packages
Installs required packages such as LibXML, asn1.1 compiler, freediameter, ... Installs required packages such as LibXML, asn1.1 compiler, ...
This option will require root password This option will require root password
--install-optional-packages --install-optional-packages
Install useful but not mandatory packages such as valgrind Install useful but not mandatory packages such as valgrind
...@@ -392,16 +385,16 @@ function main() { ...@@ -392,16 +385,16 @@ function main() {
if [ "$alib" = "$oklib" ] ; then if [ "$alib" = "$oklib" ] ; then
BUILD_OPTLIB="$BUILD_OPTLIB $alib" BUILD_OPTLIB="$BUILD_OPTLIB $alib"
echo_info "Enabling build of lib${alib}.so" echo_info "Enabling build of lib${alib}.so"
fi fi
done done
done done
if [ "${BUILD_OPTLIB## }" != "$2" ] ; then if [ "${BUILD_OPTLIB## }" != "$2" ] ; then
echo_fatal "Unknown optional library in $2, valid libraries are $OPTIONAL_LIBRARIES" echo_fatal "Unknown optional library in $2, valid libraries are $OPTIONAL_LIBRARIES"
fi fi
fi fi
for oklib in $BUILD_OPTLIB ; do for oklib in $BUILD_OPTLIB ; do
CMAKE_CMD="$CMAKE_CMD -DENABLE_${oklib^^}=ON" CMAKE_CMD="$CMAKE_CMD -DENABLE_${oklib^^}=ON"
done done
shift 2;; shift 2;;
--noavx512) --noavx512)
CMAKE_CMD="$CMAKE_CMD -DAVX512=OFF" CMAKE_CMD="$CMAKE_CMD -DAVX512=OFF"
...@@ -476,8 +469,6 @@ function main() { ...@@ -476,8 +469,6 @@ function main() {
# Setting and printing OAI envs, we should check here # # Setting and printing OAI envs, we should check here #
####################################################### #######################################################
echo_info "2. Setting the OAI PATHS ..."
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
# for conf files copy in this bash script # for conf files copy in this bash script
...@@ -554,8 +545,6 @@ function main() { ...@@ -554,8 +545,6 @@ function main() {
SKIP_SHARED_LIB_FLAG="True" SKIP_SHARED_LIB_FLAG="True"
fi fi
echo_info "3. building the compilation directives ..."
DIR=$OPENAIR_DIR/cmake_targets DIR=$OPENAIR_DIR/cmake_targets
[ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build [ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build
...@@ -658,27 +647,9 @@ function main() { ...@@ -658,27 +647,9 @@ function main() {
if [ ! -z "$BUILD_OPTLIB" ] ; then if [ ! -z "$BUILD_OPTLIB" ] ; then
for oklib in $BUILD_OPTLIB ; do for oklib in $BUILD_OPTLIB ; do
compilations $BUILD_DIR $oklib compilations $BUILD_DIR $oklib
if [ "$oklib" == "websrv" ] ; then
BUILD_WEBSRVFRONT=1
echo_info "Build of websrv frontend enabled"
fi
done done
fi fi
############################################
# Optional targets (others than libraries) #
############################################
if [ "$BUILD_WEBSRVFRONT" = "1" ] ; then
npmv=`command npm -v`
npms=$?
nodev=`command node -v`
nodes=$?
if [ "$npms" == "0" -a "$nodes" == "0" ] ; then
compilations $BUILD_DIR websrvfront
else
echo_warning "build of websrv front-end skipped, dependencies not met : " $npmv " " $nodev
fi
fi
#################################################### ####################################################
# Build RF device and transport protocol libraries # # Build RF device and transport protocol libraries #
#################################################### ####################################################
...@@ -767,7 +738,6 @@ function main() { ...@@ -767,7 +738,6 @@ function main() {
# Auto-tests # # Auto-tests #
############## ##############
if [ "$OAI_TEST" = "1" ] ; then if [ "$OAI_TEST" = "1" ] ; then
echo_info "10. Running OAI pre commit tests (pre-ci) ..."
echo_error "These scripts ASSUME that user is in /etc/sudoers and can execute commands without PASSWORD prompt" echo_error "These scripts ASSUME that user is in /etc/sudoers and can execute commands without PASSWORD prompt"
echo_error "Add the following lines in /etc/sudoers file to make your __user_name__ sudo without password prompt" echo_error "Add the following lines in /etc/sudoers file to make your __user_name__ sudo without password prompt"
echo_error " __your_user_name__ ALL = (ALL:ALL) NOPASSWD: ALL" echo_error " __your_user_name__ ALL = (ALL:ALL) NOPASSWD: ALL"
...@@ -787,7 +757,6 @@ function main() { ...@@ -787,7 +757,6 @@ function main() {
fi fi
wait wait
else else
echo_info "10. Bypassing the Tests ..."
echo_success "BUILD SHOULD BE SUCCESSFUL" echo_success "BUILD SHOULD BE SUCCESSFUL"
fi fi
......
...@@ -11,7 +11,7 @@ macro(add_option name val helpstr) ...@@ -11,7 +11,7 @@ macro(add_option name val helpstr)
add_definitions("-D${name}=${value}") add_definitions("-D${name}=${value}")
endmacro(add_option) endmacro(add_option)
macro(add_boolean_option name val helpstr) macro(add_boolean_option name val helpstr adddef)
if(DEFINED ${name}) if(DEFINED ${name})
set(value ${${name}}) set(value ${${name}})
else(DEFINED ${name}) else(DEFINED ${name})
...@@ -19,9 +19,9 @@ macro(add_boolean_option name val helpstr) ...@@ -19,9 +19,9 @@ macro(add_boolean_option name val helpstr)
endif() endif()
set(${name} ${value} CACHE STRING "${helpstr}") set(${name} ${value} CACHE STRING "${helpstr}")
set_property(CACHE ${name} PROPERTY TYPE BOOL) set_property(CACHE ${name} PROPERTY TYPE BOOL)
if (${value}) if (${value} AND ${adddef})
add_definitions("-D${name}") add_definitions("-D${name}")
endif (${value}) endif (${value} AND ${adddef})
endmacro(add_boolean_option) endmacro(add_boolean_option)
macro(add_integer_option name val helpstr) macro(add_integer_option name val helpstr)
......
add_subdirectory(ds) add_subdirectory(ds)
add_boolean_option(ENABLE_TELNETSRV OFF "Whether to build telnet support in modems" OFF)
if(ENABLE_TELNETSRV)
add_subdirectory(telnetsrv)
endif()
add_boolean_option(ENABLE_WEBSRV OFF "Whether to build the webserver" OFF)
if(ENABLE_WEBSRV)
add_subdirectory(websrv)
endif()
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#! \file common/utils/telnetsrv/CMakelists.txt
#* \brief: build rules and checks for web server shared libraries
#* \author Francois TABURET
#* \date 2023
#* \version 1.0
#* \company NOKIA BellLabs France
#* \email: francois.taburet@nokia-bell-labs.com
#* \note
#* \warning
#*/
add_library(telnetsrv MODULE
telnetsrv.c
telnetsrv_proccmd.c
telnetsrv_loader.c
telnetsrv_measurements.c
)
target_link_libraries(telnetsrv PRIVATE history)
target_link_libraries(telnetsrv PRIVATE asn1_nr_rrc asn1_lte_rrc)
message(STATUS "Add enb specific telnet functions in libtelnetsrv_enb.so")
add_library(telnetsrv_enb MODULE
telnetsrv_enb_measurements.c
telnetsrv_enb_phycmd.c
)
add_dependencies(telnetsrv telnetsrv_enb)
target_link_libraries(telnetsrv_enb PRIVATE asn1_nr_rrc asn1_lte_rrc)
message(STATUS "No specific telnet functions for gnb")
message(STATUS "No specific telnet functions for 4Gue")
message(STATUS "Add 5Gue specific telnet functions in libtelnetsrv_5Gue.so")
add_library(telnetsrv_5Gue MODULE telnetsrv_5Gue_measurements.c)
add_dependencies(telnetsrv telnetsrv_5Gue)
target_link_libraries(telnetsrv_5Gue PRIVATE asn1_nr_rrc asn1_lte_rrc)
# all libraries should be written to root build dir
set_target_properties(telnetsrv telnetsrv_enb telnetsrv_5Gue
PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../../..
)
set(TELNETROOT ${OPENAIR_DIR}/common/utils/telnetsrv )
set(TELNETSRV_SOURCE
${TELNETROOT}/telnetsrv.c
${TELNETROOT}/telnetsrv_proccmd.c
${TELNETROOT}/telnetsrv_loader.c
${TELNETROOT}/telnetsrv_measurements.c
)
add_library(telnetsrv MODULE ${TELNETSRV_SOURCE} )
target_link_libraries(telnetsrv PRIVATE history ncurses form )
target_link_libraries(telnetsrv PRIVATE asn1_nr_rrc asn1_lte_rrc)
foreach(TELNETLIB enb gnb 4Gue 5Gue)
set(TELNETLIB_SRCS "")
foreach(TELNETLIB_ASRC measurements phycmd)
set(TELNETLIB_SRC ${OPENAIR_DIR}/common/utils/telnetsrv/telnetsrv_${TELNETLIB}_${TELNETLIB_ASRC}.c)
if (EXISTS ${TELNETLIB_SRC})
set( TELNETLIB_SRCS "${TELNETLIB_SRC};${TELNETLIB_SRCS}")
endif()
endforeach()
if(NOT "${TELNETLIB_SRCS}" STREQUAL "")
message("Add ${TELNETLIB} specific telnet functions in libtelnetsrv_${TELNETLIB}.so")
add_library(telnetsrv_${TELNETLIB} MODULE ${TELNETLIB_SRCS} )
add_dependencies(telnetsrv telnetsrv_${TELNETLIB})
target_link_libraries(telnetsrv_${TELNETLIB} PRIVATE asn1_nr_rrc asn1_lte_rrc)
install(TARGETS telnetsrv_${TELNETLIB} DESTINATION bin)
else()
message("No specific telnet functions for ${TELNETLIB}")
endif()
endforeach()
install(TARGETS telnetsrv DESTINATION bin)
if (EXISTS "${OPENAIR_CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE}/ran_build/build")
install(TARGETS telnetsrv DESTINATION ${OPENAIR_CMAKE}/ran_build/build)
endif (EXISTS "${OPENAIR_CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE}/ran_build/build")
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#! \file common/utils/websrv/CMakelists.txt
#* \brief: build rules and checks for web server shared libraries
#* \author Francois TABURET
#* \date 2023
#* \version 1.0
#* \company NOKIA BellLabs France
#* \email: francois.taburet@nokia-bell-labs.com
#* \note
#* \warning
#*/
find_library(ULFIUS NAMES "libulfius.so" REQUIRED)
if (NOT ULFIUS)
message(FATAL_ERROR "ulfius library (https://github.com/babelouest/ulfius) not found, install libulfius-dev (ubuntu) if you need to build websrv back-end")
else()
message(STATUS "found libulfius for websrv")
endif()
find_library(JSON NAMES "libjansson.so" REQUIRED)
if (NOT JSON)
message(FATAL_ERROR "libjansson not found, install libjansson-dev for ubuntu, jansson-devel for fedora if you need to build websrv back-end")
else()
message(STATUS "found libjansson for websrv")
endif()
find_program(NPM NAMES npm REQUIRED)
if (NOT NPM)
message(FATAL_ERROR "npm is not installed, frontend can't be built. Possibly install npm, package is available for ubuntu and fedora")
else()
message(STATUS "found npm for websrv")
endif()
# build the backend ( the embedded web server)
message(STATUS "Configuring webserver backend")
add_library(websrv MODULE
websrv.c
websrv_websockets.c
websrv_scope.c
websrv_noforms.c
websrv_scope.c
websrv_utils.c
../../../openair1/PHY/TOOLS/nr_phy_scope.c
)
target_link_libraries(websrv PRIVATE asn1_lte_rrc asn1_nr_rrc)
target_link_libraries(websrv PRIVATE ulfius jansson)
target_compile_definitions(websrv PUBLIC WEBSRVSCOPE)
# put websrv into build root and not under build/common/utils/websrv/
set_target_properties(websrv PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../../..)
# build the frontend ( loaded from web server by browsers)
add_custom_target(
websrvfront_installjsdep
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/frontend
COMMAND npm install
DEPENDS frontend/package-lock.json
)
message(STATUS "Configuring webserver frontend")
add_custom_target(
websrvfront
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/frontend
COMMAND npm run build
#COMMAND npm run builddev
DEPENDS websrvfront_installjsdep
)
add_dependencies(websrv websrvfront)
# copy frontend files to a websrv subdirectory of where oai copy all built files
add_custom_command(TARGET websrvfront
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/frontend/dist/softmodem-ngx ${OPENAIR_BIN_DIR}/../websrv
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/helpfiles ${OPENAIR_BIN_DIR}/../websrv/helpfiles
COMMENT "Moving frontend files to:\n ${OPENAIR_BIN_DIR}/../websrv \n " )
This diff is collapsed.
...@@ -22,11 +22,14 @@ ...@@ -22,11 +22,14 @@
"@angular/platform-browser-dynamic": "^14.1.0", "@angular/platform-browser-dynamic": "^14.1.0",
"@angular/router": "^14.1.0", "@angular/router": "^14.1.0",
"chart.js": "^3.8.2", "chart.js": "^3.8.2",
"loader-utils": "^3.2.1",
"moment": "^2.29.3", "moment": "^2.29.3",
"ng2-charts": "^4.0.0", "ng2-charts": "^4.0.0",
"rxjs": "^6.6.6", "rxjs": "^6.6.6",
"tslib": "^2.0.0", "tslib": "^2.0.0",
"zone.js": "^0.11.4" "zone.js": "^0.11.4",
"json5": "^2.2.2",
"tsconfig-paths": "^4.0.0"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/architect": "^0.1401.0", "@angular-devkit/architect": "^0.1401.0",
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/api/commands.api.ts
* \brief: implementation of web interface frontend for oai
* \api's definitions for the commands module, which provides web interface to telnet server commands
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {HttpClient} from "@angular/common/http"; import {HttpClient} from "@angular/common/http";
import {Injectable} from "@angular/core"; import {Injectable} from "@angular/core";
import {environment} from "src/environments/environment"; import {environment} from "src/environments/environment";
export interface IInfo { import {route, IArgType, IInfo} from "src/commondefs";
name: string;
value: string;
type: IArgType;
modifiable: boolean; // set command ?
}
export interface IModule { export interface IModule {
name: string; name: string;
} }
...@@ -28,17 +54,6 @@ export enum ILogOutput { ...@@ -28,17 +54,6 @@ export enum ILogOutput {
file = "/tmp/<component>.log", file = "/tmp/<component>.log",
} }
export enum IArgType {
boolean = "boolean",
list = "list",
loglvl = "loglvl",
range = "range",
number = "number",
string = "string",
configfile = "configfile",
simuTypes = "simuTypes",
}
export enum ICommandOptions { export enum ICommandOptions {
update = "update", // result can be updated, triggers update button on result page when set update = "update", // result can be updated, triggers update button on result page when set
help = "help" // help tooltip available on command buttons help = "help" // help tooltip available on command buttons
...@@ -54,8 +69,8 @@ export interface IVariable { ...@@ -54,8 +69,8 @@ export interface IVariable {
export interface ICommand { export interface ICommand {
name: string; name: string;
confirm?: string; confirm?: string;
question?: IQuestion; question?: IQuestion[];
param?: IVariable; param?: IVariable[];
options?: ICommandOptions[]; options?: ICommandOptions[];
} }
export interface ITable { export interface ITable {
...@@ -86,7 +101,6 @@ export interface IRow { ...@@ -86,7 +101,6 @@ export interface IRow {
param?: IVariable // to transmit the initial command parameter, ex: the channel model index when modify a channel model param?: IVariable // to transmit the initial command parameter, ex: the channel model index when modify a channel model
} }
export const route = "oaisoftmodem/";
@Injectable({ @Injectable({
providedIn : "root", providedIn : "root",
...@@ -96,10 +110,6 @@ export class CommandsApi { ...@@ -96,10 +110,6 @@ export class CommandsApi {
{ {
} }
public readInfos$ = () => this.httpClient.get<IInfo[]>(environment.backend + route + "variables/");
public setInfo$ = (info: IInfo) => this.httpClient.post<IResp>(environment.backend + route + "variables/", info);
public readModules$ = () => this.httpClient.get<IModule[]>(environment.backend + route + "commands/"); public readModules$ = () => this.httpClient.get<IModule[]>(environment.backend + route + "commands/");
public readVariables$ = (moduleName: string) => this.httpClient.get<IInfo[]>(environment.backend + route + moduleName + "/variables/"); public readVariables$ = (moduleName: string) => this.httpClient.get<IInfo[]>(environment.backend + route + moduleName + "/variables/");
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/api/help.api.ts
* \brief: implementation of web interface frontend for oai
* \api's definitions for the help module, which can be used to provides help text via tooltips
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {HttpClient} from "@angular/common/http"; import {HttpClient} from "@angular/common/http";
import {Injectable} from "@angular/core"; import {Injectable} from "@angular/core";
import {Observable} from "rxjs"; import {Observable} from "rxjs";
import {map} from "rxjs/operators"; import {map} from "rxjs/operators";
import {environment} from "src/environments/environment"; import {environment} from "src/environments/environment";
import {route} from "src/commondefs";
export interface HelpRequest { export interface HelpRequest {
module: string; module: string;
...@@ -13,7 +46,7 @@ export interface HelpRequest { ...@@ -13,7 +46,7 @@ export interface HelpRequest {
export interface HelpResp { export interface HelpResp {
text: string; text: string;
} }
const hlproute = "oaisoftmodem/helpfiles/"; const hlproute = route + "/helpfiles/";
@Injectable({ @Injectable({
providedIn : "root", providedIn : "root",
...@@ -28,9 +61,10 @@ export class HelpApi { ...@@ -28,9 +61,10 @@ export class HelpApi {
public getHelpText(module: string, command: string, object: string): Observable<string> public getHelpText(module: string, command: string, object: string): Observable<string>
{ {
return this.getHelp$({module : module, command : command.replace(" ", "_"), object : object.replace(" ", "_")}) return this.getHelp$({module : module, command : command.replace(" ", "_"), object : object.replace(" ", "_")})
.pipe(map( .pipe(map(
(response => { return (response.status == 201) ? response.body!.text : ""; }), (response => { return (response.status == 201) ? response.body!.text.replace(/<!--(?:.|\n)*?-->/gm, '') : ""; }),
)); // pipe )); // pipe
} }
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/api/info.api.ts
* \brief: implementation of web interface frontend for oai
* \api's definitions for the info module, which provides global info about the connected oai modem
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {HttpClient} from "@angular/common/http";
import {Injectable} from "@angular/core";
import {environment} from "src/environments/environment";
import {route, IInfo} from "src/commondefs";
@Injectable({
providedIn : "root",
})
export class InfoApi {
constructor(private httpClient: HttpClient)
{
}
public readInfos$ = () => this.httpClient.get<IInfo[]>(environment.backend + route + "info/");
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/scope/scope.api.ts
* \brief: implementation of web interface frontend for oai
* \api's definitions for the scope module, which provides a web interface to the oai soft scope
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {HttpClient} from "@angular/common/http"; import {HttpClient} from "@angular/common/http";
import {Injectable} from "@angular/core"; import {Injectable} from "@angular/core";
import {environment} from "src/environments/environment"; import {environment} from "src/environments/environment";
import {route} from "src/commondefs";
export enum IScopeGraphType { export enum IScopeGraphType {
IQs = "IQs", IQs = "IQs",
...@@ -33,7 +66,7 @@ export interface ISigDesc { ...@@ -33,7 +66,7 @@ export interface ISigDesc {
antenna_id: number; antenna_id: number;
} }
const route = "oaisoftmodem/scopectrl/"; const scoperoute = route + "/scopectrl/";
@Injectable({ @Injectable({
providedIn : "root", providedIn : "root",
...@@ -43,7 +76,7 @@ export class ScopeApi { ...@@ -43,7 +76,7 @@ export class ScopeApi {
{ {
} }
public getScopeInfos$ = () => this.httpClient.get<IScopeDesc>(environment.backend + route); public getScopeInfos$ = () => this.httpClient.get<IScopeDesc>(environment.backend + scoperoute);
public setScopeParams$ = (cmd: IScopeCmd) => this.httpClient.post(environment.backend + route, cmd, {observe : "response"}); public setScopeParams$ = (cmd: IScopeCmd) => this.httpClient.post(environment.backend + scoperoute, cmd, {observe : "response"});
} }
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/app-routing-module.ts
* \brief: implementation of web interface frontend for oai
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {NgModule} from "@angular/core"; import {NgModule} from "@angular/core";
import {RouterModule, Routes} from "@angular/router"; import {RouterModule, Routes} from "@angular/router";
......
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/app.component.html
* \brief: implementation of web interface frontend for oai
* \this is the frontend initial web page source code
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
-->
<mat-tab-group backgroundColor="primary" color="accent"> <mat-tab-group backgroundColor="primary" color="accent">
<mat-tab label="Info">
<app-info></app-info>
</mat-tab>
<mat-tab label="Commands"> <mat-tab label="Commands">
<app-commands></app-commands> <app-commands></app-commands>
</mat-tab> </mat-tab>
<mat-tab label={{scopelabel}} disabled={{!isscopeavailable}}> <mat-tab label={{scopelabel}} disabled={{!isscopeavailable}}>
<app-scope (ScopeEnabled)="onScopeEnabled($event)"></app-scope> <app-scope (ScopeEnabled)="onScopeEnabled($event)"></app-scope>
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/app.module.ts
* \brief: implementation of web interface frontend for oai
* \all components, (externals or devlopped for oai) used by the application are imported from here
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {DragDropModule} from "@angular/cdk/drag-drop"; import {DragDropModule} from "@angular/cdk/drag-drop";
import {HttpClientModule} from "@angular/common/http"; import {HttpClientModule} from "@angular/common/http";
import {NgModule} from "@angular/core"; import {NgModule} from "@angular/core";
...@@ -25,19 +57,20 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; ...@@ -25,19 +57,20 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {NgChartsModule} from "ng2-charts"; import {NgChartsModule} from "ng2-charts";
import {CommandsApi} from "./api/commands.api"; import {CommandsApi} from "./api/commands.api";
import {ScopeApi} from "./api/scope.api"; import {ScopeApi} from "./api/scope.api";
import {InfoApi} from "./api/info.api";
import {AppRoutingModule} from "./app-routing.module"; import {AppRoutingModule} from "./app-routing.module";
import {AppComponent} from "./app.component"; import {AppComponent} from "./app.component";
import {InfoComponent} from "./components/info/info.component";
import {CommandsComponent} from "./components/commands/commands.component"; import {CommandsComponent} from "./components/commands/commands.component";
import {ConfirmDialogComponent} from "./components/confirm/confirm.component"; import {ConfirmDialogComponent} from "./components/confirm/confirm.component";
import {DialogComponent} from "./components/dialog/dialog.component"; import {DialogComponent} from "./components/dialog/dialog.component";
import {QuestionDialogComponent} from "./components/question/question.component"; import {QuestionDialogComponent} from "./components/question/question.component";
import {ScopeComponent} from "./components/scope/scope.component"; import {ScopeComponent} from "./components/scope/scope.component";
import {InterceptorProviders} from "./interceptors/interceptors"; import {InterceptorProviders} from "./interceptors/interceptors";
import {LoadingService} from "./services/loading.service";
import {WebSocketService} from "./services/websocket.service"; import {WebSocketService} from "./services/websocket.service";
@NgModule({ @NgModule({
declarations : [ AppComponent, CommandsComponent, ConfirmDialogComponent, QuestionDialogComponent, DialogComponent, ScopeComponent ], declarations : [ AppComponent, CommandsComponent, InfoComponent, ConfirmDialogComponent, QuestionDialogComponent, DialogComponent, ScopeComponent ],
imports : [ imports : [
BrowserModule, AppRoutingModule, FormsModule, ReactiveFormsModule, BrowserAnimationsModule, HttpClientModule, MatButtonModule, FlexLayoutModule, MatDialogModule, DragDropModule, BrowserModule, AppRoutingModule, FormsModule, ReactiveFormsModule, BrowserAnimationsModule, HttpClientModule, MatButtonModule, FlexLayoutModule, MatDialogModule, DragDropModule,
MatSliderModule, MatFormFieldModule, MatInputModule, MatChipsModule, MatProgressSpinnerModule, MatToolbarModule, MatTableModule, MatListModule, MatSelectModule, MatSnackBarModule, MatSliderModule, MatFormFieldModule, MatInputModule, MatChipsModule, MatProgressSpinnerModule, MatToolbarModule, MatTableModule, MatListModule, MatSelectModule, MatSnackBarModule,
...@@ -45,10 +78,10 @@ import {WebSocketService} from "./services/websocket.service"; ...@@ -45,10 +78,10 @@ import {WebSocketService} from "./services/websocket.service";
], ],
providers : [ providers : [
// services // services
LoadingService,
WebSocketService, WebSocketService,
// api // api
CommandsApi, CommandsApi,
InfoApi,
ScopeApi, ScopeApi,
// interceptors // interceptors
InterceptorProviders, InterceptorProviders,
......
<div class="grid-container" > <!--
<mat-grid-list cols="2" rowHeight="15vh" > /*
<mat-grid-tile [colspan]="1" [rowspan]="2" > * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
<mat-card class="dashboard-card"> * contributor license agreements. See the NOTICE file distributed with
<mat-card-header > * this work for additional information regarding copyright ownership.
<mat-card-title>Connection info</mat-card-title> * The OpenAirInterface Software Alliance licenses this file to You under
</mat-card-header> * the OAI Public License, Version 1.1 (the "License"); you may not use this file
<mat-card-content class="dashboard-card-content"> * except in compliance with the License.
<div *ngIf="infos$ | async as infos"> * You may obtain a copy of the License at
<div class="spaceddiv" *ngFor="let info of infos"> *
<mat-form-field class="scrollablefield" > * http://www.openairinterface.org/?page_id=698
<mat-label>{{ info.nameFC.value }}</mat-label> *
<input matInput [formControl]="info.valueFC" [readonly]="!info.modifiableFC.value" /> * Unless required by applicable law or agreed to in writing, software
</mat-form-field> * distributed under the License is distributed on an "AS IS" BASIS,
<button mat-raised-button color="primary" [disabled]="!info.modifiableFC.value" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
(click)="onInfoSubmit(info)"> * See the License for the specific language governing permissions and
{{ info.btnTxtFC }} * limitations under the License.
</button> *-------------------------------------------------------------------------------
</div> * For more information about the OpenAirInterface (OAI) Software Alliance:
</div> * contact@openairinterface.org
</mat-card-content> */
</mat-card>
</mat-grid-tile>
<mat-grid-tile [colspan]="1" [rowspan]="2"> /*! \file common/utils/websrv/frontend/src/app/components/commands/commands.component.html
* \brief: implementation of web interface frontend for oai
* \commands web interface implementation (works with commands.component.ts)
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
-->
<div class="grid-container" >
<mat-grid-list cols="2" rowHeight="12vh" >
<mat-grid-tile [colspan]="2" [rowspan]="2">
<mat-card class="dashboard-card"> <mat-card class="dashboard-card">
<mat-card-header> <mat-card-header>
<mat-card-title>Softmodem commands</mat-card-title> <mat-card-title>Softmodem commands</mat-card-title>
...@@ -49,7 +61,7 @@ ...@@ -49,7 +61,7 @@
</mat-card> </mat-card>
</mat-grid-tile> </mat-grid-tile>
<mat-grid-tile *ngIf="vars$ | async as vars" [colspan]="1" [rowspan]="4"> <mat-grid-tile *ngIf="vars$ | async as vars" [colspan]="1" [rowspan]="8">
<mat-card *ngIf="vars.length" class="dashboard-card"> <mat-card *ngIf="vars.length" class="dashboard-card">
<mat-card-header> <mat-card-header>
<mat-card-title>{{ selectedModule!.name }} variables</mat-card-title> <mat-card-title>{{ selectedModule!.name }} variables</mat-card-title>
...@@ -69,10 +81,10 @@ ...@@ -69,10 +81,10 @@
</mat-card> </mat-card>
</mat-grid-tile> </mat-grid-tile>
<mat-grid-tile *ngIf="(rows$ | async)?.length" [colspan]="1" [rowspan]="4"> <mat-grid-tile *ngIf="(rows$ | async)?.length" [colspan]="1" [rowspan]="8">
<mat-card class="dashboard-card"> <mat-card class="dashboard-card">
<mat-card-header> <mat-card-header>
<mat-card-title>{{ selectedModule!.name }} {{ selectedCmd!.name }} {{ selectedCmd!.param?.value}}</mat-card-title> <mat-card-title>{{ selectedModule!.name }} {{ selectedCmd!.name }} {{ title_ptext }}</mat-card-title>
</mat-card-header> </mat-card-header>
<mat-card-content class="dashboard-card-content"> <mat-card-content class="dashboard-card-content">
<div > <div >
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/components/commands/commands.component.ts
* \brief: implementation of web interface frontend for oai
* \commands web interface implementation (works with commands.component.html)
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {Component} from "@angular/core"; import {Component} from "@angular/core";
import {route, IArgType, IInfo} from "src/commondefs";
import {ViewEncapsulation} from "@angular/core"; import {ViewEncapsulation} from "@angular/core";
import {UntypedFormArray} from "@angular/forms"; import {UntypedFormArray} from "@angular/forms";
import {BehaviorSubject, forkJoin, Observable, of, timer} from "rxjs"; import {BehaviorSubject, forkJoin, Observable, of, timer} from "rxjs";
import {filter, map, switchMap, tap} from "rxjs/operators"; import {filter, map, switchMap, tap} from "rxjs/operators";
import {CommandsApi, IArgType, IColumn, ICommand, ICommandOptions, IInfo, ILogLvl, IParam, IRow} from "src/app/api/commands.api"; import {CommandsApi, IColumn, ICommand, ICommandOptions, ILogLvl, IParam, IRow} from "src/app/api/commands.api";
import {HelpApi, HelpRequest, HelpResp} from "src/app/api/help.api"; import {HelpApi, HelpRequest, HelpResp} from "src/app/api/help.api";
import {CmdCtrl} from "src/app/controls/cmd.control"; import {CmdCtrl} from "src/app/controls/cmd.control";
import {InfoCtrl} from "src/app/controls/info.control";
import {ModuleCtrl} from "src/app/controls/module.control"; import {ModuleCtrl} from "src/app/controls/module.control";
import {RowCtrl} from "src/app/controls/row.control"; import {RowCtrl} from "src/app/controls/row.control";
import {VarCtrl} from "src/app/controls/var.control"; import {VarCtrl} from "src/app/controls/var.control";
...@@ -29,7 +61,7 @@ const PREDEF_CMD = "show predef" ...@@ -29,7 +61,7 @@ const PREDEF_CMD = "show predef"
logLvlValues = Object.values(ILogLvl); logLvlValues = Object.values(ILogLvl);
// softmodem // softmodem
infos$: Observable<VarCtrl[]>;
modules$: Observable<ModuleCtrl[]>; modules$: Observable<ModuleCtrl[]>;
// module // module
...@@ -42,7 +74,8 @@ const PREDEF_CMD = "show predef" ...@@ -42,7 +74,8 @@ const PREDEF_CMD = "show predef"
displayedColumns: string[] = []; displayedColumns: string[] = [];
rows$: BehaviorSubject<RowCtrl[]> = new BehaviorSubject<RowCtrl[]>([]); rows$: BehaviorSubject<RowCtrl[]> = new BehaviorSubject<RowCtrl[]>([]);
columns: IColumn[] = []; columns: IColumn[] = [];
title_ptext: string =""; //used for possibly add a riminder of command parameters in the result page
constructor( constructor(
public commandsApi: CommandsApi, public commandsApi: CommandsApi,
public helpApi: HelpApi, public helpApi: HelpApi,
...@@ -52,8 +85,6 @@ const PREDEF_CMD = "show predef" ...@@ -52,8 +85,6 @@ const PREDEF_CMD = "show predef"
) )
{ {
this.infos$ = this.commandsApi.readInfos$().pipe(map((infos) => infos.map(info => new InfoCtrl(info))));
this.modules$ = this.commandsApi.readModules$().pipe( this.modules$ = this.commandsApi.readModules$().pipe(
map(imodules => imodules.map(imodule => new ModuleCtrl(imodule))), filter(controls => controls.length > 0), tap(controls => this.onModuleSelect(controls[0]))); map(imodules => imodules.map(imodule => new ModuleCtrl(imodule))), filter(controls => controls.length > 0), tap(controls => this.onModuleSelect(controls[0])));
} }
...@@ -71,22 +102,13 @@ const PREDEF_CMD = "show predef" ...@@ -71,22 +102,13 @@ const PREDEF_CMD = "show predef"
// ); // );
// } // }
onInfoSubmit(control: InfoCtrl)
{
let info: IInfo = control.api();
if (info.type === IArgType.configfile) {
this.downloadService.getFile(info.value)
} else {
this.commandsApi.setInfo$(info).subscribe();
}
}
onModuleSelect(module: ModuleCtrl) onModuleSelect(module: ModuleCtrl)
{ {
this.selectedModule = module this.selectedModule = module
this.selectedCmd = undefined this.selectedCmd = undefined
this.title_ptext="";
this.cmds$ = this.commandsApi.readCommands$(module.name).pipe( this.cmds$ = this.commandsApi.readCommands$(module.name).pipe(
map(icmds => icmds.map(icmd => new CmdCtrl(icmd))), map(icmds => icmds.map(icmd => new CmdCtrl(icmd))),
map(cmds => { map(cmds => {
...@@ -134,8 +156,14 @@ const PREDEF_CMD = "show predef" ...@@ -134,8 +156,14 @@ const PREDEF_CMD = "show predef"
private execCmd$(control: CmdCtrl) private execCmd$(control: CmdCtrl)
{ {
let cmd = control!.api(); let cmd = control!.api();
if (this.selectedCmd!.param) if (this.selectedCmd!.param) {
this.selectedCmd!.param!.value = cmd.param!.value; this.selectedCmd!.param![0].value = cmd.param![0].value;
this.title_ptext = cmd.param![0].value;
if( this.selectedCmd!.param!.length > 1) {
this.selectedCmd!.param![1].value = cmd.param![1].value;
this.title_ptext = this.title_ptext + " " + cmd.param![1].value;
}
}
this.commandsApi.runCommand$(cmd, this.selectedModule!.name) this.commandsApi.runCommand$(cmd, this.selectedModule!.name)
.subscribe( .subscribe(
resp => { resp => {
...@@ -153,14 +181,7 @@ const PREDEF_CMD = "show predef" ...@@ -153,14 +181,7 @@ const PREDEF_CMD = "show predef"
// possibly load help.. // possibly load help..
for (let i = 0; i < this.columns.length; i = i + 1) { for (let i = 0; i < this.columns.length; i = i + 1) {
if (this.columns[i].help) { if (this.columns[i].help) {
this.helpApi.getHelp$({module : this.selectedModule!.name, command : control!.api().name.replace(" ", "_"), object : this.columns[i].name.replace(" ", "_")}) this.helpApi.getHelpText(this.selectedModule!.name,control!.api().name,this.columns[i].name).subscribe(resp => { this.hlp_cc[i] = resp; }, err => { this.hlp_cc[i] = ""; });
.subscribe(
response => {
if (response.status == 201)
this.hlp_cc[i] = response.body!.text;
},
err => { this.hlp_cc[i] = ""; },
);
} else { } else {
this.hlp_cc[i] = ""; this.hlp_cc[i] = "";
} }
...@@ -201,7 +222,7 @@ const PREDEF_CMD = "show predef" ...@@ -201,7 +222,7 @@ const PREDEF_CMD = "show predef"
onParamSubmit(control: RowCtrl) onParamSubmit(control: RowCtrl)
{ {
if (this.selectedCmd!.param) if (this.selectedCmd!.param)
control.set_cmdparam(this.selectedCmd!.param); control.set_cmdparam(this.selectedCmd!.param[0]);
this.commandsApi.setCmdParams$(control.api(), this.selectedModule!.name).subscribe(() => this.execCmd$(new CmdCtrl(this.selectedCmd!))); this.commandsApi.setCmdParams$(control.api(), this.selectedModule!.name).subscribe(() => this.execCmd$(new CmdCtrl(this.selectedCmd!)));
} }
} }
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/components/info/info.component.html
* \brief: implementation of web interface frontend for oai
* \info component web interface implementation (works with info.component.ts)
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
-->
<div class="grid-container" >
<mat-grid-list cols="1" rowHeight="15vh" >
<mat-grid-tile [colspan]="1" [rowspan]="6" >
<mat-card class="dashboard-card">
<mat-card-header >
<mat-card-title>Connection info</mat-card-title>
</mat-card-header>
<mat-card-content class="dashboard-card-content">
<div *ngIf="infos$ | async as infos">
<div class="infodiv" *ngFor="let info of infos">
<mat-form-field class="scrollablefield" >
<mat-label>{{ info.nameFC.value }}</mat-label>
<input matInput [formControl]="info.valueFC" [readonly]="!info.modifiableFC.value" />
</mat-form-field>
<button mat-raised-button color="primary" (click)="onInfoSubmit(info)" *ngIf="info.modifiableFC.value" >
{{ info.btnTxtFC }}
</button>
</div>
</div>
</mat-card-content>
</mat-card>
</mat-grid-tile>
</mat-grid-list>
</div>
.infodiv {
height: 45px;
width: 80vw;
display: flex;
justify-content: space-between;
margin: 0 auto;
padding: 10px 0;
}
.mat-card {
height: 95%;
overflow-y: auto;
overflow-x: scroll;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/components/info/info.component.ts
* \brief: implementation of web interface frontend for oai
* \info component web interface implementation (works with info.component.html)
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {Component} from "@angular/core";
import {IArgType, IInfo} from "src/commondefs";
import {ViewEncapsulation} from "@angular/core";
import {UntypedFormArray} from "@angular/forms";
import {Observable} from "rxjs";
import {filter, map, switchMap, tap} from "rxjs/operators";
import {InfoApi} from "src/app/api/info.api";
import {InfoCtrl} from "src/app/controls/info.control";
import {ModuleCtrl} from "src/app/controls/module.control";
import {VarCtrl} from "src/app/controls/var.control";
import {DialogService} from "src/app/services/dialog.service";
import {DownloadService} from "src/app/services/download.service";
@Component({
selector : "app-info",
templateUrl : "./info.component.html",
styleUrls : [ "./info.component.scss" ],
encapsulation : ViewEncapsulation.None,
}) export class InfoComponent {
infos$: Observable<VarCtrl[]>;
constructor(
public infoApi: InfoApi,
public downloadService: DownloadService,
)
{
this.infos$ = this.infoApi.readInfos$().pipe(map((infos) => infos.map(info => new InfoCtrl(info))));
}
onInfoSubmit(control: InfoCtrl)
{
let info: IInfo = control.api();
if (info.type === IArgType.configfile) {
this.downloadService.getFile(info.value)
}
}
}
<h3>{{ data.title }}</h3> <!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/components/question/question.component.html
* \brief: implementation of web interface frontend for oai
* \utility component used to allow entering parameters before sending a request to the backend
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
-->
<h3>{{ data.control.cmdname }} command parameters</h3>
<div mat-dialog-content > <div mat-dialog-content >
<mat-form-field appearance="fill"> <div>
<label for="answer">{{data.control.question?.display}}</label> <mat-form-field>
<label for="answer">{{data.control.question![0].display}}</label>
<input id="answer" type="text" style="width:10vw" [formControl]="data.control.answerFC"> <input id="answer" type="text" style="width:10vw" [formControl]="data.control.answerFC">
</mat-form-field> </mat-form-field>
</div>
<div *ngIf="data.control.question!.length > 1" >
<mat-form-field>
<label for="answerb">{{data.control.question![1].display}}</label>
<input id="answerb" type="text" style="width:10vw" [formControl]="data.control.answerbFC">
</mat-form-field>
</div>
</div> </div>
<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> <font size="-1" color="#888888"><div [innerHTML]="hlp_question"></div></font>
</div>
<div fxLayoutGap=" 20px" mat-dialog-actions fxLayout="row" fxLayoutAlign="center start">
<button mat-button [mat-dialog-close]="true" cdkFocusInitial >Ok</button>
<button mat-button [mat-dialog-close]="false">Cancel</button> <button mat-button [mat-dialog-close]="false">Cancel</button>
</div> </div>
/* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable @typescript-eslint/naming-convention */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/components/question/question.component.ts
* \brief: implementation of web interface frontend for oai
* \utility component used to allow entering parameters before sending a request to the backend
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {Component, Inject} from "@angular/core"; import {Component, Inject} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
import {CmdCtrl} from "src/app/controls/cmd.control"; import {CmdCtrl} from "src/app/controls/cmd.control";
import {HelpApi, HelpRequest, HelpResp} from "src/app/api/help.api";
export interface QuestionDialogData { export interface QuestionDialogData {
title: string; title: string;
control: CmdCtrl; control: CmdCtrl;
} }
@Component({selector : "app-question", templateUrl : "./question.component.html", styleUrls : [ "./question.component.css" ]}) @Component({selector : "app-question", templateUrl : "./question.component.html", styleUrls : [ "./question.component.css" ]})
export class QuestionDialogComponent { export class QuestionDialogComponent {
hlp_question: string = "";
constructor( constructor(
public dialogRef: MatDialogRef<QuestionDialogComponent>, public dialogRef: MatDialogRef<QuestionDialogComponent>,
public helpApi: HelpApi,
@Inject(MAT_DIALOG_DATA) public data: QuestionDialogData, @Inject(MAT_DIALOG_DATA) public data: QuestionDialogData,
) )
{ {
this.helpApi.getHelpText("question", data.control.cmdname, "input").subscribe( response => { this.hlp_question = response;})
} }
onNoClick() onNoClick()
{ {
this.dialogRef.close(); this.dialogRef.close();
......
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/components/scope/scope.component.html
* \brief: implementation of web interface frontend for oai
* \scope component web interface implementation (works with scope.component.ts)
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
-->
<div class="grid-container"> <div class="grid-container">
<mat-grid-list cols="11" rowHeight="100px"> <mat-grid-list cols="11" rowHeight="100px">
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/components/scope/scope.component.ts
* \brief: implementation of web interface frontend for oai
* \scope component web interface implementation (works with scope.component.html)
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {Component, EventEmitter, OnDestroy, OnInit, Output, QueryList, ViewChildren} from "@angular/core"; import {Component, EventEmitter, OnDestroy, OnInit, Output, QueryList, ViewChildren} from "@angular/core";
import {Chart, ChartConfiguration} from "chart.js"; import {Chart, ChartConfiguration} from "chart.js";
import {BaseChartDirective} from "ng2-charts"; import {BaseChartDirective} from "ng2-charts";
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/controls/cmd.control.ts
* \brief: implementation of web interface frontend for oai
* \implement a command for commands component
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {UntypedFormArray, UntypedFormControl, UntypedFormGroup} from "@angular/forms"; import {UntypedFormArray, UntypedFormControl, UntypedFormGroup} from "@angular/forms";
import {Subscription} from "rxjs"; import {Subscription} from "rxjs";
import {Observable} from "rxjs/internal/Observable"; import {Observable} from "rxjs/internal/Observable";
import {ICommand, ICommandOptions, IQuestion} from "src/app/api/commands.api"; import {ICommand, ICommandOptions, IQuestion, IVariable} from "src/app/api/commands.api";
import {HelpApi, HelpRequest, HelpResp} from "src/app/api/help.api"; import {HelpApi, HelpRequest, HelpResp} from "src/app/api/help.api";
const enum CmdFCN { const enum CmdFCN {
name = "name", name = "name",
vars = "variables", vars = "variables",
confirm = "confirm", confirm = "confirm",
answer = "answer" answer = "answer",
answerb = "answerb"
} }
export class CmdCtrl extends UntypedFormGroup { export class CmdCtrl extends UntypedFormGroup {
confirm?: string; confirm?: string;
question?: IQuestion; question?: IQuestion[];
cmdname: string; cmdname: string;
options?: ICommandOptions[]; options?: ICommandOptions[];
public ResUpdTimer?: Observable<number>; public ResUpdTimer?: Observable<number>;
...@@ -27,26 +61,40 @@ export class CmdCtrl extends UntypedFormGroup { ...@@ -27,26 +61,40 @@ export class CmdCtrl extends UntypedFormGroup {
this.addControl(CmdFCN.name, new UntypedFormControl(cmd.name)); this.addControl(CmdFCN.name, new UntypedFormControl(cmd.name));
this.addControl(CmdFCN.answer, new UntypedFormControl("")); this.addControl(CmdFCN.answer, new UntypedFormControl(""));
this.addControl(CmdFCN.answerb, new UntypedFormControl(""));
this.addControl(CmdFCN.vars, new UntypedFormArray([])); this.addControl(CmdFCN.vars, new UntypedFormArray([]));
this.confirm = cmd.confirm; this.confirm = cmd.confirm;
this.question = cmd.question; this.question = cmd.question;
this.cmdname = cmd.name; this.cmdname = cmd.name;
this.options = cmd.options; this.options = cmd.options;
this.updbtnname = "Start update" this.updbtnname = "Start update";
} }
api() api()
{ {
const doc: ICommand = { const doc: ICommand = {
name : this.nameFC.value, name : this.nameFC.value,
param : this.question ? {name : this.question!.pname, value : this.answerFC.value, type : this.question!.type, modifiable : false} : undefined, param : this.question ? this.setParams() : undefined,
// param : this.question ? {name : this.question!.pname, value : this.answerFC.value, type : this.question!.type, modifiable : false} : undefined,
options : this.options options : this.options
}; };
return doc; return doc;
} }
setParams ()
{
var vars : IVariable[]=new Array();
for (let i = 0; i < this.question!.length; i++) {
vars.push({name:this.question![i].pname,
value:(i==0)?this.answerFC.value:this.answerbFC.value,
type:this.question![i].type,
modifiable:false })
}
return vars;
}
isResUpdatable(): boolean isResUpdatable(): boolean
{ {
if (this.options) { if (this.options) {
...@@ -88,6 +136,11 @@ export class CmdCtrl extends UntypedFormGroup { ...@@ -88,6 +136,11 @@ export class CmdCtrl extends UntypedFormGroup {
{ {
return this.get(CmdFCN.answer) as UntypedFormControl; return this.get(CmdFCN.answer) as UntypedFormControl;
} }
get answerbFC()
{
return this.get(CmdFCN.answerb) as UntypedFormControl;
}
get varsFA() get varsFA()
{ {
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/controls/info.control.ts
* \brief: implementation of web interface frontend for oai
* \implement one info item for info component
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {UntypedFormControl, UntypedFormGroup} from "@angular/forms"; import {UntypedFormControl, UntypedFormGroup} from "@angular/forms";
import {IInfo} from "../api/commands.api"; import {IArgType, IInfo} from "src/commondefs";
import {IArgType} from "../api/commands.api";
const enum InfosFCN { const enum InfosFCN {
name = "name", name = "name",
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/controls/module.control.ts
* \brief: implementation of web interface frontend for oai
* \implement one module item for commands component
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {UntypedFormArray, UntypedFormGroup} from "@angular/forms"; import {UntypedFormArray, UntypedFormGroup} from "@angular/forms";
import {IModule} from "../api/commands.api"; import {IModule} from "../api/commands.api";
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/controls/param.control.ts
* \brief: implementation of web interface frontend for oai
* \implement one parameter in a result row for commands component
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {UntypedFormControl, UntypedFormGroup} from "@angular/forms"; import {UntypedFormControl, UntypedFormGroup} from "@angular/forms";
import {IArgType, IColumn, IParam} from "../api/commands.api"; import {IArgType, IInfo} from "src/commondefs";
import { IParam, IColumn,} from "../api/commands.api";
enum ParamFCN { enum ParamFCN {
value = "value", value = "value",
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/controls/row.control.ts
* \brief: implementation of web interface frontend for oai
* \implement one row results for commands component
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {FormControl, UntypedFormArray, UntypedFormGroup} from "@angular/forms"; import {FormControl, UntypedFormArray, UntypedFormGroup} from "@angular/forms";
import {IArgType} from "src/commondefs";
import {IArgType, IParam, IRow, IVariable} from "../api/commands.api"; import {IParam, IRow, IVariable} from "../api/commands.api";
import {ParamCtrl} from "./param.control"; import {ParamCtrl} from "./param.control";
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/controls/var.control.ts
* \brief: implementation of web interface frontend for oai
* \implement one variable item for commands componen
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {UntypedFormControl, UntypedFormGroup} from "@angular/forms"; import {UntypedFormControl, UntypedFormGroup} from "@angular/forms";
import {IInfo} from "../api/commands.api"; import {IArgType, IInfo} from "src/commondefs";
import {IArgType} from "../api/commands.api";
const enum VariablesFCN { const enum VariablesFCN {
name = "name", name = "name",
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/interceptors/error.interceptor.ts
* \brief: implementation of web interface frontend for oai
* \utility to intercept error response from backend and possibly dispay an error to user
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse} from "@angular/common/http"; import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse} from "@angular/common/http";
import {Injectable} from "@angular/core"; import {Injectable} from "@angular/core";
import {Observable, throwError} from "rxjs"; import {Observable, throwError} from "rxjs";
...@@ -52,7 +84,7 @@ export class ErrorInterceptor implements HttpInterceptor { ...@@ -52,7 +84,7 @@ export class ErrorInterceptor implements HttpInterceptor {
// The response body may contain clues as to what went wrong // The response body may contain clues as to what went wrong
message = JSON.stringify(error.error); message = JSON.stringify(error.error);
} }
this.dialogService.openErrorDialog(prefix + " " + error.status, message); this.dialogService.openErrorDialog(prefix + " " + request.url, "http status: " + error.status + " " + message);
return throwError(error); return throwError(error);
}), }),
); );
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/services/download.service.ts
* \brief: implementation of web interface frontend for oai
* \utility to download a file from backend
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {HttpClient} from "@angular/common/http"; import {HttpClient} from "@angular/common/http";
import {HttpHeaders} from "@angular/common/http"; import {HttpHeaders} from "@angular/common/http";
import {HttpParams} from "@angular/common/http"; import {HttpParams} from "@angular/common/http";
import {Injectable} from "@angular/core"; import {Injectable} from "@angular/core";
import {route} from "src/app/api/commands.api"; import {route} from "src/commondefs";
import {environment} from "src/environments/environment"; import {environment} from "src/environments/environment";
@Injectable({ @Injectable({
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/app/services/websocket.service.ts
* \brief: implementation of web interface frontend for oai
* \utility implementing a web interface with the backend
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {Injectable} from "@angular/core"; import {Injectable} from "@angular/core";
import {webSocket, WebSocketSubject} from "rxjs/webSocket"; import {webSocket, WebSocketSubject} from "rxjs/webSocket";
import {environment} from "src/environments/environment"; import {environment} from "src/environments/environment";
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/commondefs.ts
* \brief: implementation of web interface frontend for oai
* \definitions of constants, enums and interfaces common to the whole frontend
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
export enum IArgType {
boolean = "boolean",
list = "list",
loglvl = "loglvl",
range = "range",
number = "number",
string = "string",
configfile = "configfile",
simuTypes = "simuTypes",
}
export interface IInfo {
name: string;
value: string;
type: IArgType;
modifiable: boolean; // set command ?
}
export const route = "oaisoftmodem/";
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/frontend/src/main.ts
* \brief: implementation of web interface frontend for oai
* \this is the frontend application main source but interesting things atarts in the app.module import
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note
* \warning
*/
import {enableProdMode} from "@angular/core"; import {enableProdMode} from "@angular/core";
import {platformBrowserDynamic} from "@angular/platform-browser-dynamic"; import {platformBrowserDynamic} from "@angular/platform-browser-dynamic";
......
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/cmd_channelmod_show_channelid.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
This option asks for a model id and lists the parameters of this model. Some parameters can be then modified This option asks for a model id and lists the parameters of this model. Some parameters can be then modified
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/cmd_channelmod_show_current.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
When a oai component, as the rf simulator, instanciates a channel model, the instanciation is added in the list of current models. The id of the instanciation is used when using the "show channelid" option. When a oai component, as the rf simulator, instanciates a channel model, the instanciation is added in the list of current models. The id of the instanciation is used when using the "show channelid" option.
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/cmd_channelmod_show_predef.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
Predefined channel model are a set of modelisation algorithm's, identified by a name, available in oai code. Predefined channel model are a set of modelisation algorithm's, identified by a name, available in oai code.
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/question_setdistance_input.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags can be used in this help files as it is rendered in a div (tooltips don't work well in dialogs)
* \warning
*/
-->
<ol>
<li><bold>model name:</bold> rfsimu_channel_&lt;enB|ue&gt;_&lt;connection id&gt;. For example model applied to the first UE connected to a gNB is "rfsimu_channel_ue0"</li>
<li><bold>distance:</bold> expressed in meters</li>
</ol>
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/question_show_channelid_input.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags can be used in this help files as it is rendered in a div (tooltips don't work well in dialogs)
* \warning
*/
-->
channel index: channel model index in the channel modelisation module, it is printed when listing all defined models using the "show current" button.
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/rfsimu_show_models_algorithm.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
Available channel modelisation algorithm's can be listed using the "channelmod"/"show predef" command. A more convenient mechanism to select this will be implemented in a next version. Available channel modelisation algorithm's can be listed using the "channelmod"/"show predef" command. A more convenient mechanism to select this will be implemented in a next version.
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/rfsimu_show_models_model_index.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
The model index can be used to modify a model parameter, using the "channelmod"/"show channelid" commands The model index can be used to modify a model parameter, using the "channelmod"/"show channelid" commands
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/rfsimu_show_models_model_name.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
Models parameters are defined in the oai configuration file under the section "channelmod.<channel list>". <channel list> describes the parameters for each <model name>. Several <channel list> can be defined, the loaded list is defined by the "channelmod.modellist" parameter. Model names are defined by the channel modelisation "user": for example the model "rfsmu_channel_ue0" is applied by the gNB rfsimulator on the signal received from ue0, the first connecet UE. Models parameters are defined in the oai configuration file under the section "channelmod.<channel list>". <channel list> describes the parameters for each <model name>. Several <channel list> can be defined, the loaded list is defined by the "channelmod.modellist" parameter. Model names are defined by the channel modelisation "user": for example the model "rfsmu_channel_ue0" is applied by the gNB rfsimulator on the signal received from ue0, the first connecet UE.
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/rfsimu_show_models_module_owner.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
When the rfsimulator is effectively using a channel model to modify a received signal he becomes the owner of that model. When the rfsimulator is effectively using a channel model to modify a received signal he becomes the owner of that model.
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/scope_control_dataack.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
when enabled, back-end will stop sending data when too much data have not been acknowledge by the frontend. Currently the back-end limits to 200 the number of data messages waitting for ack. when enabled, back-end will stop sending data when too much data have not been acknowledge by the frontend. Currently the back-end limits to 200 the number of data messages waitting for ack.
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/softmodem_show_threadsched_nice.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
Nice value, relevant for other and batch scheduling can be changed via the "oai priority" field Nice value, relevant for other and batch scheduling can be changed via the "oai priority" field
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/softmodem_show_threadsched_sched_oai_priority.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
the oai priority field is used to provide the linux scheduling mode, priority and nice value in a single field. the oai priority field is used to provide the linux scheduling mode, priority and nice value in a single field.
Priority value is mapped to linux scheduling mode, priority and nice as listed below: Priority value is mapped to linux scheduling mode, priority and nice as listed below:
-101 to -199: real time, Round-Robin 1 to 99 -101 to -199: real time, Round-Robin 1 to 99
......
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/softmodem_show_threadsched_priority.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
Linux priority field, relevant for real-time scheduling mode (Round-Robin or fifo) can be modified using the "oai priority" field Linux priority field, relevant for real-time scheduling mode (Round-Robin or fifo) can be modified using the "oai priority" field
<!--
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/websrv/helpfiles/softmodem_show_threadsched_sched_policy.html
* \brief: implementation of web interface frontend for oai
* \help file loaded at run time using the help api's
* \author: Yacine El Mghazli, Francois TABURET
* \date 2022
* \version 0.1
* \company NOKIA BellLabs France
* \email: yacine.el_mghazli@nokia-bell-labs.com francois.taburet@nokia-bell-labs.com
* \note: html tags cannot be used in this help files as it is rendered in a tooltips
* \warning
*/
-->
scheduling policy can be modified using the "oai priority" field. scheduling policy can be modified using the "oai priority" field.
...@@ -253,7 +253,7 @@ int websrv_callback_set_moduleparams(const struct _u_request *request, struct _u ...@@ -253,7 +253,7 @@ int websrv_callback_set_moduleparams(const struct _u_request *request, struct _u
} // for *cmd } // for *cmd
} // json_unpack_ex(jsbody OK } // json_unpack_ex(jsbody OK
} // user_data } // user_data
} // sbody } // jsbody not null
websrv_printf_end(httpstatus, websrvparams.dbglvl); websrv_printf_end(httpstatus, websrvparams.dbglvl);
return U_CALLBACK_COMPLETE; return U_CALLBACK_COMPLETE;
} }
...@@ -432,40 +432,62 @@ int websrv_callback_set_softmodemvar(const struct _u_request *request, struct _u ...@@ -432,40 +432,62 @@ int websrv_callback_set_softmodemvar(const struct _u_request *request, struct _u
int websrv_processwebfunc(struct _u_response *response, cmdparser_t *modulestruct, telnetshell_cmddef_t *cmd, json_t *jparams) int websrv_processwebfunc(struct _u_response *response, cmdparser_t *modulestruct, telnetshell_cmddef_t *cmd, json_t *jparams)
{ {
LOG_I(UTIL, "[websrv] : executing command %s %s\n", modulestruct->module, cmd->cmdname); LOG_I(UTIL, "[websrv] : executing command %s %s\n", modulestruct->module, cmd->cmdname);
if ((cmd->cmdflags & TELNETSRV_CMDFLAG_NEEDPARAM) && jparams == NULL) {
LOG_W(UTIL, "No parameters sent by frontend for %s %s\n", modulestruct->module, cmd->cmdname);
return 500;
}
int http_status = 200; int http_status = 200;
char *pname[2], *pvalue[2];
size_t np =0;
if (jparams != NULL) {
int b[2];
char *ptype[2];
json_error_t jerror;
np = json_array_size(jparams);
int jrt;
switch(np) {
case 1:
jrt=json_unpack_ex(jparams, &jerror, 0, "[{s:s,s:s,s:s,s,b}]", "name", &pname[0], "value", &pvalue[0], "type", &ptype[0], "modifiable", &b);
break;
case 2:
jrt=json_unpack_ex(jparams, &jerror, 0, "[{s:s,s:s,s:s,s,b},{s:s,s:s,s:s,s,b}]",
"name", &pname[0], "value", &pvalue[0], "type", &ptype[0], "modifiable", &b[0],
"name", &pname[1], "value", &pvalue[1], "type", &ptype[1], "modifiable", &b[1]);
break;
default:
http_status=500;
break;
// json_unpack_ex(jparams, &jerror, 0, "[{s:s,s:s,s:s,s,b}]", "name", &pname, "value", &pvalue, "type", &ptype, "modifiable", &b);
}
if (jrt <0 || http_status != 200) {
LOG_I(UTIL, "[websrv], couldn't unpack jparams, module %s, command %s: %s\n", modulestruct->module, cmd->cmdname, jerror.text);
websrv_printjson((char *)__FUNCTION__, jparams, websrvparams.dbglvl);
return 500;
}
}
if (cmd->cmdflags & TELNETSRV_CMDFLAG_GETWEBTBLDATA) { if (cmd->cmdflags & TELNETSRV_CMDFLAG_GETWEBTBLDATA) {
webdatadef_t wdata; webdatadef_t wdata;
memset(&wdata, 0, sizeof(wdata)); memset(&wdata, 0, sizeof(wdata));
if (cmd->cmdflags & TELNETSRV_CMDFLAG_NEEDPARAM) { wdata.numlines = 1;
if (jparams == NULL) { for (int i=0; i<np; i++) {
LOG_W(UTIL, "No parameters sent by frontend for %s %s\n", modulestruct->module, cmd->cmdname); snprintf(wdata.columns[i].coltitle, sizeof(wdata.columns[i].coltitle) - 1, "%s", pname[i]);
} else { wdata.numcols = np;
int b; wdata.lines[0].val[i] = pvalue[i];
char *pname, *pvalue, *ptype;
json_error_t jerror;
json_unpack_ex(jparams, &jerror, 0, "{s:s,s:s,s:s,s,b}", "name", &pname, "value", &pvalue, "type", &ptype, "modifiable", &b);
if (pvalue == NULL || pname == NULL || ptype == NULL) {
LOG_I(UTIL, "[websrv], couldn't unpack jparams, module %s, command %s: %s\n", modulestruct->module, cmd->cmdname, jerror.text);
websrv_printjson((char *)__FUNCTION__, jparams, websrvparams.dbglvl);
http_status = 500;
} else {
snprintf(wdata.columns[0].coltitle, sizeof(wdata.columns[0].coltitle) - 1, "%s", pname);
wdata.numcols = 1;
wdata.lines[0].val[0] = pvalue;
wdata.numlines = 1;
}
}
} }
cmd->webfunc_getdata(cmd->cmdname, websrvparams.dbglvl, (webdatadef_t *)&wdata, NULL); cmd->webfunc_getdata(cmd->cmdname, websrvparams.dbglvl, (webdatadef_t *)&wdata, NULL);
websrv_gettbldata_response(response, &wdata, modulestruct->module, cmd->cmdname); websrv_gettbldata_response(response, &wdata, modulestruct->module, cmd->cmdname);
} else { } else {
char *sptr = index(cmd->cmdname, ' '); char *sptr = index(cmd->cmdname, ' ');
char cmdbuff[TELNET_CMD_MAXSIZE*3]; //cmd + 2 parameters
snprintf(cmdbuff,sizeof(cmdbuff)-1, "%s%s%s %s",(sptr == NULL) ? "" : sptr,(sptr == NULL) ? "" : " ",(np>0) ? pvalue[0] : "",(np>1) ? pvalue[1] : "");
if (cmd->qptr != NULL) { if (cmd->qptr != NULL) {
websrv_printf_start(response, 16384, true); websrv_printf_start(response, 16384, true);
telnet_pushcmd(cmd, (sptr == NULL) ? cmd->cmdname : sptr, websrv_async_printf); telnet_pushcmd(cmd, cmdbuff, websrv_async_printf);
} else { } else {
websrv_printf_start(response, 16384, false); websrv_printf_start(response, 16384, false);
cmd->cmdfunc((sptr == NULL) ? cmd->cmdname : sptr, websrvparams.dbglvl, websrv_printf); cmd->cmdfunc(cmdbuff, websrvparams.dbglvl, websrv_printf);
} }
websrv_printf_end(http_status, websrvparams.dbglvl); websrv_printf_end(http_status, websrvparams.dbglvl);
} }
...@@ -598,21 +620,35 @@ int websrv_callback_get_softmodemcmd(const struct _u_request *request, struct _u ...@@ -598,21 +620,35 @@ int websrv_callback_get_softmodemcmd(const struct _u_request *request, struct _u
snprintf(confstr, sizeof(confstr), "Confirm %s ?", modulestruct->cmd[j].cmdname); snprintf(confstr, sizeof(confstr), "Confirm %s ?", modulestruct->cmd[j].cmdname);
acmd = json_pack("{s:s,s:s}", "name", modulestruct->cmd[j].cmdname, "confirm", confstr); acmd = json_pack("{s:s,s:s}", "name", modulestruct->cmd[j].cmdname, "confirm", confstr);
} else if (modulestruct->cmd[j].cmdflags & TELNETSRV_CMDFLAG_NEEDPARAM) { } else if (modulestruct->cmd[j].cmdflags & TELNETSRV_CMDFLAG_NEEDPARAM) {
char *pname = NULL; char *question[] = {NULL,NULL};
char *question = NULL;
char *helpcp = NULL; char *helpcp = NULL;
json_t *jQ1=NULL, *jQ2=NULL;
json_t *jQs = json_array();
if (modulestruct->cmd[j].helpstr != NULL) { if (modulestruct->cmd[j].helpstr != NULL) {
char *tokptr;
helpcp = strdup(modulestruct->cmd[j].helpstr); helpcp = strdup(modulestruct->cmd[j].helpstr);
question = strtok_r(helpcp, "<[", &tokptr); int ns=sscanf(helpcp,"<%m[^<>]> <%m[^<>]>",&question[0],&question[1]);
pname = (question != NULL) ? strtok_r(helpcp, ">]", &tokptr) : NULL; if (ns == 0) {
LOG_W(UTIL, "[websrv] Cannot find parameters for command %s %s\n", modulestruct->module, modulestruct->cmd[j].cmdname);
continue;
}
jQ1=json_pack("{s:s,s:s,s:s}", "display",question[0], "pname", "P0", "type", "string");
json_array_append_new(jQs, jQ1);
if (ns >1) {
jQ2=json_pack("{s:s,s:s,s:s}","display", (question[1] == NULL) ? "" : question[1], "pname", "P1" , "type", "string");
json_array_append_new(jQs, jQ2);
}
} }
acmd = json_pack( acmd = json_pack("{s:s,s:o}", "name", modulestruct->cmd[j].cmdname, "question", jQs);
"{s:s,s:{s:s,s:s,s:s}}", "name", modulestruct->cmd[j].cmdname, "question", "display", (question == NULL) ? "" : question, "pname", (pname == NULL) ? "Px" : pname, "type", "string");
free(helpcp); free(helpcp);
free(question[0]);
free(question[1]);
} else { } else {
acmd = json_pack("{s:s}", "name", modulestruct->cmd[j].cmdname); acmd = json_pack("{s:s}", "name", modulestruct->cmd[j].cmdname);
} }
if ( acmd == NULL) {
LOG_W(UTIL, "[websrv] interface for command %s %s cannot be built\n", modulestruct->module, modulestruct->cmd[j].cmdname);
continue;
}
json_t *jopts = json_array(); json_t *jopts = json_array();
if (modulestruct->cmd[j].cmdflags & TELNETSRV_CMDFLAG_AUTOUPDATE) { if (modulestruct->cmd[j].cmdflags & TELNETSRV_CMDFLAG_AUTOUPDATE) {
json_array_append_new(jopts, json_string("update")); json_array_append_new(jopts, json_string("update"));
...@@ -806,7 +842,6 @@ void *websrv_autoinit() ...@@ -806,7 +842,6 @@ void *websrv_autoinit()
websrvparams.instance.max_post_body_size = 1024; websrvparams.instance.max_post_body_size = 1024;
// 1: build the first page, when receiving the "oaisoftmodem" url // 1: build the first page, when receiving the "oaisoftmodem" url
// ulfius_add_endpoint_by_val(&(websrvparams.instance), "GET", "oaisoftmodem", "variables", 0, &websrv_callback_get_softmodemstatus, NULL);
ulfius_add_endpoint_by_val(&(websrvparams.instance), "GET", "oaisoftmodem", "commands", 1, &websrv_callback_get_softmodemmodules, NULL); ulfius_add_endpoint_by_val(&(websrvparams.instance), "GET", "oaisoftmodem", "commands", 1, &websrv_callback_get_softmodemmodules, NULL);
// 2 default_endpoint declaration, it tries to open the file with the url name as specified in the request.It looks for the file // 2 default_endpoint declaration, it tries to open the file with the url name as specified in the request.It looks for the file
...@@ -817,7 +852,7 @@ void *websrv_autoinit() ...@@ -817,7 +852,7 @@ void *websrv_autoinit()
websrv_callback_get_softmodemstatus, websrv_callback_okset_softmodem_cmdvar, websrv_callback_set_softmodemvar}; websrv_callback_get_softmodemstatus, websrv_callback_okset_softmodem_cmdvar, websrv_callback_set_softmodemvar};
char *http_methods[3] = {"GET", "OPTIONS", "POST"}; char *http_methods[3] = {"GET", "OPTIONS", "POST"};
websrv_add_endpoint(http_methods, 3, "oaisoftmodem", "variables", callback_functions_var, NULL); websrv_add_endpoint(http_methods, 3, "oaisoftmodem", "info", callback_functions_var, NULL);
for (int i = 0; telnetparams->CmdParsers[i].cmd != NULL; i++) { for (int i = 0; telnetparams->CmdParsers[i].cmd != NULL; i++) {
register_module_endpoints(&(telnetparams->CmdParsers[i])); register_module_endpoints(&(telnetparams->CmdParsers[i]));
......
if ( "${OPENAIR_CMAKE}" STREQUAL "")
message( FATAL_ERROR "oai Environment variables not set")
endif ( "${OPENAIR_CMAKE}" STREQUAL "")
set(WEBSRVROOT ${OPENAIR_DIR}/common/utils/websrv )
set (WBACK TRUE)
set (WFRONT TRUE)
# websrv dependencies
unset(ULFIUS)
unset(ULFIUS CACHE)
find_library(ULFIUS NAMES "libulfius.so" NO_CACHE)
if ("${ULFIUS}" STREQUAL "ULFIUS-NOTFOUND")
message( WARNING "ulfius library (https://github.com/babelouest/ulfius) not found, install libulfius-dev (ubuntu) if you need to build websrv back-end")
set (WBACK FALSE)
endif("${ULFIUS}" STREQUAL "ULFIUS-NOTFOUND")
unset(JSON)
unset(JSON CACHE)
find_library(JSON NAMES "libjansson.so" NO_CACHE )
if ("${JSON}" STREQUAL "ULFIUS-NOTFOUND")
message( WARNING "libjansson not found, install libjansson-dev for ubuntu, jansson-devel for fedora if you need to build websrv back-end")
set (WBACK FALSE)
endif("${JSON}" STREQUAL "ULFIUS-NOTFOUND")
unset(NPM)
unset(NPM CACHE)
find_program(NPM NAMES npm NO_CACHE)
if ("${NPM}" STREQUAL "ULFIUS-NOTFOUND")
message( WARNING " npm is not installed, frontend won't be built. Possibly install npm, package is available for ubuntu and fedora")
endif("${NPM}" STREQUAL "ULFIUS-NOTFOUND")
if ( ${WBACK} )
message (STATUS "websrv backend can be built")
else ( ${WBACK} )
message (STATUS "websrv backend build skipped, dependencies not found")
endif ( ${WBACK} )
if ( ${WFRONT} )
message (STATUS "websrv frontend can be built")
else( ${WFRONT} )
message (STATUS "websrv frontend build skipped, dependencies not found")
endif ( ${WFRONT} )
# build the backend ( the embedded web server)
set(WEBSRV_SOURCE
${WEBSRVROOT}/websrv.c ${WEBSRVROOT}/websrv_websockets.c
${WEBSRVROOT}/websrv_scope.c ${WEBSRVROOT}/websrv_noforms.c
${WEBSRVROOT}/websrv_scope.c ${WEBSRVROOT}/websrv_utils.c
${OPENAIR_DIR}/openair1/PHY/TOOLS/nr_phy_scope.c
)
add_library(websrv MODULE ${WEBSRV_SOURCE} )
target_link_libraries(websrv PRIVATE ulfius jansson)
target_compile_definitions(websrv PUBLIC WEBSRVSCOPE)
# build the frontend ( loaded from web server by browsers)
add_custom_target (
websrvfront_installjsdep
WORKING_DIRECTORY ${WEBSRVROOT}/frontend
COMMAND npm install
DEPENDS ${WEBSRVROOT}/frontend/package-lock.json
)
add_custom_target (
websrvfront
WORKING_DIRECTORY ${WEBSRVROOT}/frontend
COMMAND npm run build
#COMMAND npm run builddev
DEPENDS websrvfront_installjsdep
)
#install built files, required at exec time
if ( ${WBACK} )
install(TARGETS websrv DESTINATION bin)
endif ( ${WBACK} )
if ( ${WFRONT} )
if (EXISTS "${OPENAIR_CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE}/ran_build/build")
add_custom_command(TARGET websrvfront
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${WEBSRVROOT}/frontend/dist/softmodem-ngx ${OPENAIR_CMAKE}/ran_build/build/websrv
COMMAND ${CMAKE_COMMAND} -E copy_directory ${WEBSRVROOT}/frontend/dist/softmodem-ngx ${OPENAIR_TARGETS}/bin/websrv
COMMAND ${CMAKE_COMMAND} -E copy_directory ${WEBSRVROOT}/helpfiles ${OPENAIR_CMAKE}/ran_build/build/websrv/helpfiles
COMMAND ${CMAKE_COMMAND} -E copy_directory ${WEBSRVROOT}/helpfiles ${OPENAIR_TARGETS}/bin/websrv/helpfiles
COMMENT "Moving frontend files to:\n ${OPENAIR_CMAKE}/ran_build/build/websrv\n ${OPENAIR_TARGETS}/bin/websrv" )
endif (EXISTS "${OPENAIR_CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE}/ran_build/build")
endif ( ${WFRONT} )
...@@ -1609,7 +1609,7 @@ __attribute__((unused)) static int fl_vmode; ...@@ -1609,7 +1609,7 @@ __attribute__((unused)) static int fl_vmode;
#define fl_get_form_vclass(a) fl_vmode #define fl_get_form_vclass(a) fl_vmode
#define fl_get_gc() fl_state[fl_vmode].gc[0] #define fl_get_gc() fl_state[fl_vmode].gc[0]
__attribute__((unused)) static FL_State fl_state[]; //__attribute__((unused)) static FL_State fl_state[];
__attribute__((unused)) static char *fl_ul_magic_char; __attribute__((unused)) static char *fl_ul_magic_char;
......
add_boolean_option(GENERATE_DOXYGEN False "Generate source code doc using doxygen") add_boolean_option(GENERATE_DOXYGEN False "Generate source code doc using doxygen" OFF)
if(GENERATE_DOXYGEN) if(GENERATE_DOXYGEN)
find_package(Doxygen REQUIRED) find_package(Doxygen REQUIRED)
......
add_subdirectory(PHY)
add_boolean_option(ENABLE_UESCOPE OFF "Whether to build the lte uescope" OFF)
add_boolean_option(ENABLE_ENBSCOPE OFF "Whether to build the lte enbcope" OFF)
add_boolean_option(ENABLE_NRSCOPE OFF "Whether to build the 5G scope" OFF)
if(ENABLE_UESCOPE OR ENABLE_ENBSCOPE OR ENABLE_NRSCOPE)
add_subdirectory(TOOLS)
endif()
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#! \file openair1/PHY/TOOLS/CMakelists.txt
#* \brief: build rules and checks for softscope shared libraries
#* \author Francois TABURET
#* \date 2023
#* \version 1.0
#* \company NOKIA BellLabs France
#* \email: francois.taburet@nokia-bell-labs.com
#* \note
#* \warning
#*/
include_directories ("/usr/include/X11")
add_library(xforms_common OBJECT
lte_phy_scope.c
../../../executables/stats.c)
target_link_libraries(xforms_common PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc)
add_library(enbscope MODULE lte_enb_scope.c $<TARGET_OBJECTS:xforms_common>)
target_link_libraries(enbscope PUBLIC forms PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc)
add_library(uescope MODULE lte_ue_scope.c $<TARGET_OBJECTS:xforms_common>)
target_link_libraries(uescope PUBLIC forms PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc)
add_library(nrscope MODULE nr_phy_scope.c)
target_link_libraries(nrscope PUBLIC forms PRIVATE asn1_nr_rrc PRIVATE asn1_lte_rrc)
# all libraries should be written to root build dir (default creates the same hierarchie under build as existing for sources)
set_target_properties(enbscope uescope nrscope
PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../../..
)
...@@ -531,7 +531,7 @@ static void puschLLR (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { ...@@ -531,7 +531,7 @@ static void puschLLR (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) {
p->gNB->pusch_vars[ue] && p->gNB->pusch_vars[ue] &&
p->gNB->pusch_vars[ue]->llr ) { p->gNB->pusch_vars[ue]->llr ) {
int16_t *pusch_llr = (int16_t *)p->gNB->pusch_vars[ue]->llr; int16_t *pusch_llr = (int16_t *)p->gNB->pusch_vars[ue]->llr;
float *llr, *bit; float *llr=NULL, *bit=NULL;
int nx = coded_bits_per_codeword; int nx = coded_bits_per_codeword;
#ifdef WEBSRVSCOPE #ifdef WEBSRVSCOPE
nx = websrv_cpllrbuff_tomsg(graph, pusch_llr, coded_bits_per_codeword, ue, 0, 0); nx = websrv_cpllrbuff_tomsg(graph, pusch_llr, coded_bits_per_codeword, ue, 0, 0);
...@@ -562,7 +562,7 @@ static void puschIQ (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { ...@@ -562,7 +562,7 @@ static void puschIQ (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) {
p->gNB->pusch_vars[ue]->rxdataF_comp && p->gNB->pusch_vars[ue]->rxdataF_comp &&
p->gNB->pusch_vars[ue]->rxdataF_comp[0] ) { p->gNB->pusch_vars[ue]->rxdataF_comp[0] ) {
scopeSample_t *pusch_comp = (scopeSample_t *)p->gNB->pusch_vars[ue]->rxdataF_comp[0]; scopeSample_t *pusch_comp = (scopeSample_t *)p->gNB->pusch_vars[ue]->rxdataF_comp[0];
float *I, *Q; float *I=NULL, *Q=NULL;
#ifdef WEBSRVSCOPE #ifdef WEBSRVSCOPE
newsz = websrv_cpiqbuff_tomsg(graph, pusch_comp, sz, 0, 0); newsz = websrv_cpiqbuff_tomsg(graph, pusch_comp, sz, 0, 0);
#else #else
...@@ -846,7 +846,7 @@ static void uePbchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_ ...@@ -846,7 +846,7 @@ static void uePbchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_
//const int antennas=data[pbchLlr]->colSz; //const int antennas=data[pbchLlr]->colSz;
// We take the first antenna only for now // We take the first antenna only for now
int16_t *llrs = (int16_t *) (data[pbchLlr]+1); int16_t *llrs = (int16_t *) (data[pbchLlr]+1);
float *llr_pbch, *bit_pbch; float *llr_pbch=NULL, *bit_pbch=NULL;
int nx = sz; int nx = sz;
#ifdef WEBSRVSCOPE #ifdef WEBSRVSCOPE
nx = websrv_cpllrbuff_tomsg(graph, llrs, sz, UE_id, 0, 0); nx = websrv_cpllrbuff_tomsg(graph, llrs, sz, UE_id, 0, 0);
...@@ -868,7 +868,7 @@ static void uePbchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_U ...@@ -868,7 +868,7 @@ static void uePbchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_U
scopeSample_t *pbch_comp = (scopeSample_t *) (data[pbchRxdataF_comp]+1); scopeSample_t *pbch_comp = (scopeSample_t *) (data[pbchRxdataF_comp]+1);
const int sz=data[pbchRxdataF_comp]->lineSz; const int sz=data[pbchRxdataF_comp]->lineSz;
int newsz = sz; int newsz = sz;
float *I, *Q; float *I=NULL, *Q=NULL;
#ifdef WEBSRVSCOPE #ifdef WEBSRVSCOPE
newsz = websrv_cpiqbuff_tomsg(graph, pbch_comp, sz, 0, 0); newsz = websrv_cpiqbuff_tomsg(graph, pbch_comp, sz, 0, 0);
#else #else
...@@ -891,7 +891,7 @@ static void uePcchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_ ...@@ -891,7 +891,7 @@ static void uePcchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_
//int num_re = 4*273*12; // 12*frame_parms->N_RB_DL*num_pdcch_symbols //int num_re = 4*273*12; // 12*frame_parms->N_RB_DL*num_pdcch_symbols
//int Qm = 2; //int Qm = 2;
const int sz=data[pdcchLlr]->lineSz; const int sz=data[pdcchLlr]->lineSz;
float *llr, *bit; float *llr=NULL, *bit=NULL;
int nx = sz; int nx = sz;
int16_t *pdcch_llr = (int16_t *)(data[pdcchLlr]+1); int16_t *pdcch_llr = (int16_t *)(data[pdcchLlr]+1);
...@@ -915,7 +915,7 @@ static void uePcchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_U ...@@ -915,7 +915,7 @@ static void uePcchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_U
int newsz = sz; int newsz = sz;
//const int antennas=data[pdcchRxdataF_comp]->colSz; //const int antennas=data[pdcchRxdataF_comp]->colSz;
// We take the first antenna only for now // We take the first antenna only for now
float *I, *Q; float *I=NULL, *Q=NULL;
scopeSample_t *pdcch_comp = (scopeSample_t *) (data[pdcchRxdataF_comp]+1); scopeSample_t *pdcch_comp = (scopeSample_t *) (data[pdcchRxdataF_comp]+1);
#ifdef WEBSRVSCOPE #ifdef WEBSRVSCOPE
newsz = websrv_cpiqbuff_tomsg(graph, pdcch_comp, sz, 0, 0); newsz = websrv_cpiqbuff_tomsg(graph, pdcch_comp, sz, 0, 0);
...@@ -935,7 +935,7 @@ static void uePdschLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR ...@@ -935,7 +935,7 @@ static void uePdschLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR
return; return;
const int sz = data[pdschLlr]->lineSz; const int sz = data[pdschLlr]->lineSz;
float *llr, *bit; float *llr=NULL, *bit=NULL;
int nx = sz; int nx = sz;
int16_t *pdsch_llr = (int16_t *)(data[pdschLlr]+1); int16_t *pdsch_llr = (int16_t *)(data[pdschLlr]+1);
...@@ -959,7 +959,7 @@ static void uePdschIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_ ...@@ -959,7 +959,7 @@ static void uePdschIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_
const int sz=data[pdschRxdataF_comp]->lineSz; const int sz=data[pdschRxdataF_comp]->lineSz;
int nz = sz; int nz = sz;
float *I, *Q; float *I=NULL, *Q=NULL;
scopeSample_t *pdsch_comp = (scopeSample_t *) (data[pdschRxdataF_comp]+1); scopeSample_t *pdsch_comp = (scopeSample_t *) (data[pdschRxdataF_comp]+1);
#ifdef WEBSRVSCOPE #ifdef WEBSRVSCOPE
nz += websrv_cpiqbuff_tomsg(graph, pdsch_comp, sz, 0, 0); nz += websrv_cpiqbuff_tomsg(graph, pdsch_comp, sz, 0, 0);
......
...@@ -54,7 +54,7 @@ int get_modchannel_index(char *buf, int debug, void *vdata, telnet_printfunc_t p ...@@ -54,7 +54,7 @@ int get_modchannel_index(char *buf, int debug, void *vdata, telnet_printfunc_t p
int get_channel_params(char *buf, int debug, void *tdata, telnet_printfunc_t prnt); int get_channel_params(char *buf, int debug, void *tdata, telnet_printfunc_t prnt);
int get_currentchannels_type(char *buf, int debug, void *vdata, telnet_printfunc_t prnt); int get_currentchannels_type(char *buf, int debug, void *vdata, telnet_printfunc_t prnt);
#define HELP_WEBIF_MODIFCHAN_STRING "Current channel index? <chanidx>" #define HELP_WEBIF_MODIFCHAN_STRING "<channel index>"
static telnetshell_cmddef_t channelmod_cmdarray[] = { static telnetshell_cmddef_t channelmod_cmdarray[] = {
{"help", "", channelmod_print_help, {NULL}, 0, NULL}, {"help", "", channelmod_print_help, {NULL}, 0, NULL},
{"show", "<predef,current>", channelmod_show_cmd, {NULL}, TELNETSRV_CMDFLAG_TELNETONLY, NULL}, {"show", "<predef,current>", channelmod_show_cmd, {NULL}, TELNETSRV_CMDFLAG_TELNETONLY, NULL},
......
...@@ -96,7 +96,7 @@ static int rfsimu_vtime_cmd(char *buff, int debug, telnet_printfunc_t prnt, void ...@@ -96,7 +96,7 @@ static int rfsimu_vtime_cmd(char *buff, int debug, telnet_printfunc_t prnt, void
static telnetshell_cmddef_t rfsimu_cmdarray[] = { static telnetshell_cmddef_t rfsimu_cmdarray[] = {
{"show models", "", (cmdfunc_t)rfsimu_setchanmod_cmd, {(webfunc_t)getset_currentchannels_type}, TELNETSRV_CMDFLAG_WEBSRVONLY | TELNETSRV_CMDFLAG_GETWEBTBLDATA, NULL}, {"show models", "", (cmdfunc_t)rfsimu_setchanmod_cmd, {(webfunc_t)getset_currentchannels_type}, TELNETSRV_CMDFLAG_WEBSRVONLY | TELNETSRV_CMDFLAG_GETWEBTBLDATA, NULL},
{"setmodel", "<model name> <model type>", (cmdfunc_t)rfsimu_setchanmod_cmd, {NULL}, TELNETSRV_CMDFLAG_PUSHINTPOOLQ | TELNETSRV_CMDFLAG_TELNETONLY, NULL}, {"setmodel", "<model name> <model type>", (cmdfunc_t)rfsimu_setchanmod_cmd, {NULL}, TELNETSRV_CMDFLAG_PUSHINTPOOLQ | TELNETSRV_CMDFLAG_TELNETONLY, NULL},
{"setdistance", "<model name> <distance>", (cmdfunc_t)rfsimu_setdistance_cmd, {NULL}, TELNETSRV_CMDFLAG_PUSHINTPOOLQ}, {"setdistance", "<model name> <distance>", (cmdfunc_t)rfsimu_setdistance_cmd, {NULL}, TELNETSRV_CMDFLAG_PUSHINTPOOLQ | TELNETSRV_CMDFLAG_NEEDPARAM },
{"getdistance", "<model name>", (cmdfunc_t)rfsimu_getdistance_cmd, {NULL}, TELNETSRV_CMDFLAG_PUSHINTPOOLQ}, {"getdistance", "<model name>", (cmdfunc_t)rfsimu_getdistance_cmd, {NULL}, TELNETSRV_CMDFLAG_PUSHINTPOOLQ},
{"vtime", "", (cmdfunc_t)rfsimu_vtime_cmd, {NULL}, TELNETSRV_CMDFLAG_PUSHINTPOOLQ | TELNETSRV_CMDFLAG_AUTOUPDATE}, {"vtime", "", (cmdfunc_t)rfsimu_vtime_cmd, {NULL}, TELNETSRV_CMDFLAG_PUSHINTPOOLQ | TELNETSRV_CMDFLAG_AUTOUPDATE},
{"", "", NULL}, {"", "", NULL},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment