diff --git a/frontend/src/api/api.ts b/frontend/src/api/api.ts index 2a9813be..fb4e6d16 100644 --- a/frontend/src/api/api.ts +++ b/frontend/src/api/api.ts @@ -14,14 +14,14 @@ import type { Configuration } from './configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; import type { RequestArgs } from './base'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; /** * @@ -34,13 +34,13 @@ export interface ANInformation { * @type {string} * @memberof ANInformation */ - 'IPAddress'?: string; + 'IPAddress': string; /** * * @type {number} * @memberof ANInformation */ - 'TEID'?: number; + 'TEID': number; } /** * @@ -91,19 +91,19 @@ export interface Arp { * @type {number} * @memberof Arp */ - 'priorityLevel'?: number; + 'priorityLevel': number; /** * * @type {string} * @memberof Arp */ - 'preemptCap'?: string; + 'preemptCap': string; /** * * @type {string} * @memberof Arp */ - 'preemptVuln'?: string; + 'preemptVuln': string; } /** * @@ -116,19 +116,19 @@ export interface AuthenticationSubscription { * @type {string} * @memberof AuthenticationSubscription */ - 'authenticationMethod'?: string; + 'authenticationMethod': string; /** * * @type {PermanentKey} * @memberof AuthenticationSubscription */ - 'permanentKey'?: PermanentKey; + 'permanentKey': PermanentKey; /** * * @type {string} * @memberof AuthenticationSubscription */ - 'sequenceNumber'?: string; + 'sequenceNumber': string; /** * * @type {string} @@ -148,6 +148,61 @@ export interface AuthenticationSubscription { */ 'opc'?: Opc; } +/** + * + * @export + * @interface ChargingData + */ +export interface ChargingData { + /** + * + * @type {string} + * @memberof ChargingData + */ + 'snssai'?: string; + /** + * + * @type {string} + * @memberof ChargingData + */ + 'dnn': string; + /** + * + * @type {number} + * @memberof ChargingData + */ + 'qosRef'?: number; + /** + * + * @type {string} + * @memberof ChargingData + */ + 'filter': string; + /** + * + * @type {string} + * @memberof ChargingData + */ + 'chargingMethod'?: string; + /** + * + * @type {string} + * @memberof ChargingData + */ + 'quota'?: string; + /** + * + * @type {string} + * @memberof ChargingData + */ + 'unitCost'?: string; + /** + * + * @type {string} + * @memberof ChargingData + */ + 'ueId'?: string; +} /** * * @export @@ -159,7 +214,7 @@ export interface DefaultSingleNssais { * @type {Array} * @memberof DefaultSingleNssais */ - 'defaultSingleNssais'?: Array; + 'defaultSingleNssais': Array; /** * * @type {Array} @@ -178,7 +233,7 @@ export interface Dnn { * @type {string} * @memberof Dnn */ - 'dnn'?: string; + 'dnn': string; } /** * @@ -191,13 +246,13 @@ export interface DnnConfiguration { * @type {PduSessionTypes} * @memberof DnnConfiguration */ - 'pduSessionTypes'?: PduSessionTypes; + 'pduSessionTypes': PduSessionTypes; /** * * @type {SscModes} * @memberof DnnConfiguration */ - 'sscModes'?: SscModes; + 'sscModes': SscModes; /** * * @type {Model5gQosProfile} @@ -210,6 +265,12 @@ export interface DnnConfiguration { * @memberof DnnConfiguration */ 'sessionAmbr'?: SessionAmbr; + /** + * + * @type {Array} + * @memberof DnnConfiguration + */ + 'staticIpAddress'?: Array; /** * * @type {UpSecurity} @@ -217,6 +278,67 @@ export interface DnnConfiguration { */ 'upSecurity'?: UpSecurity; } +/** + * + * @export + * @interface FlowChargingRecord + */ +export interface FlowChargingRecord { + /** + * + * @type {string} + * @memberof FlowChargingRecord + */ + 'Supi': string; + /** + * + * @type {string} + * @memberof FlowChargingRecord + */ + 'Snssai': string; + /** + * + * @type {string} + * @memberof FlowChargingRecord + */ + 'Dnn': string; + /** + * + * @type {string} + * @memberof FlowChargingRecord + */ + 'Filter': string; + /** + * + * @type {string} + * @memberof FlowChargingRecord + */ + 'QuotaLeft': string; + /** + * + * @type {string} + * @memberof FlowChargingRecord + */ + 'Usage': string; + /** + * + * @type {string} + * @memberof FlowChargingRecord + */ + 'TotalVol': string; + /** + * + * @type {string} + * @memberof FlowChargingRecord + */ + 'UlVol': string; + /** + * + * @type {string} + * @memberof FlowChargingRecord + */ + 'DlVol': string; +} /** * * @export @@ -254,6 +376,31 @@ export interface FlowRules { */ 'qosRef'?: number; } +/** + * + * @export + * @interface IpAddress + */ +export interface IpAddress { + /** + * + * @type {string} + * @memberof IpAddress + */ + 'ipv4Addr'?: string; + /** + * + * @type {string} + * @memberof IpAddress + */ + 'ipv6Addr'?: string; + /** + * + * @type {string} + * @memberof IpAddress + */ + 'ipv6Prefix'?: string; +} /** * * @export @@ -309,19 +456,19 @@ export interface MilenageOp { * @type {string} * @memberof MilenageOp */ - 'opValue'?: string; + 'opValue': string; /** * * @type {number} * @memberof MilenageOp */ - 'encryptionKey'?: number; + 'encryptionKey': number; /** * * @type {number} * @memberof MilenageOp */ - 'encryptionAlgorithm'?: number; + 'encryptionAlgorithm': number; } /** * @@ -334,13 +481,13 @@ export interface Model5gQosProfile { * @type {number} * @memberof Model5gQosProfile */ - '5qi'?: number; + '5qi': number; /** * * @type {Arp} * @memberof Model5gQosProfile */ - 'arp'?: Arp; + 'arp': Arp; /** * * @type {number} @@ -359,7 +506,7 @@ export interface Nssai { * @type {number} * @memberof Nssai */ - 'sst'?: number; + 'sst': number; /** * * @type {string} @@ -378,19 +525,19 @@ export interface Opc { * @type {string} * @memberof Opc */ - 'opcValue'?: string; + 'opcValue': string; /** * * @type {number} * @memberof Opc */ - 'encryptionKey'?: number; + 'encryptionKey': number; /** * * @type {number} * @memberof Opc */ - 'encryptionAlgorithm'?: number; + 'encryptionAlgorithm': number; } /** * @@ -403,31 +550,31 @@ export interface PduSession { * @type {string} * @memberof PduSession */ - 'Dnn'?: string; + 'Dnn': string; /** * * @type {string} * @memberof PduSession */ - 'PduSessionId'?: string; + 'PduSessionId': string; /** * * @type {string} * @memberof PduSession */ - 'Sd'?: string; + 'Sd': string; /** * * @type {string} * @memberof PduSession */ - 'SmContextRef'?: string; + 'SmContextRef': string; /** * * @type {string} * @memberof PduSession */ - 'Sst'?: string; + 'Sst': string; } /** * @@ -440,13 +587,13 @@ export interface PduSessionInfo { * @type {string} * @memberof PduSessionInfo */ - 'AnType'?: string; + 'AnType': string; /** * * @type {string} * @memberof PduSessionInfo */ - 'Dnn'?: string; + 'Dnn': string; /** * * @type {string} @@ -458,13 +605,13 @@ export interface PduSessionInfo { * @type {string} * @memberof PduSessionInfo */ - 'PDUAddress'?: string; + 'PDUAddress': string; /** * * @type {string} * @memberof PduSessionInfo */ - 'PDUSessionID'?: string; + 'PDUSessionID': string; /** * * @type {string} @@ -476,37 +623,37 @@ export interface PduSessionInfo { * @type {string} * @memberof PduSessionInfo */ - 'Sd'?: string; + 'Sd': string; /** * * @type {SessionRule} * @memberof PduSessionInfo */ - 'SessionRule'?: SessionRule; + 'SessionRule': SessionRule; /** * * @type {string} * @memberof PduSessionInfo */ - 'Sst'?: string; + 'Sst': string; /** * * @type {string} * @memberof PduSessionInfo */ - 'Supi'?: string; + 'Supi': string; /** * * @type {Tunnel} * @memberof PduSessionInfo */ - 'Tunnel'?: Tunnel; + 'Tunnel': Tunnel; /** * * @type {string} * @memberof PduSessionInfo */ - 'UpCnxState'?: string; + 'UpCnxState': string; } /** * @@ -519,7 +666,7 @@ export interface PduSessionTypes { * @type {string} * @memberof PduSessionTypes */ - 'defaultSessionType'?: string; + 'defaultSessionType': string; /** * * @type {Array} @@ -538,19 +685,19 @@ export interface PermanentKey { * @type {string} * @memberof PermanentKey */ - 'permanentKeyValue'?: string; + 'permanentKeyValue': string; /** * * @type {number} * @memberof PermanentKey */ - 'encryptionKey'?: number; + 'encryptionKey': number; /** * * @type {number} * @memberof PermanentKey */ - 'encryptionAlgorithm'?: number; + 'encryptionAlgorithm': number; } /** * @@ -563,25 +710,25 @@ export interface QosFlows { * @type {string} * @memberof QosFlows */ - 'snssai'?: string; + 'snssai': string; /** * * @type {string} * @memberof QosFlows */ - 'dnn'?: string; + 'dnn': string; /** * * @type {number} * @memberof QosFlows */ - 'qosRef'?: number; + 'qosRef': number; /** * * @type {number} * @memberof QosFlows */ - '5qi'?: number; + '5qi': number; /** * * @type {string} @@ -618,13 +765,13 @@ export interface SessionAmbr { * @type {string} * @memberof SessionAmbr */ - 'uplink'?: string; + 'uplink': string; /** * * @type {string} * @memberof SessionAmbr */ - 'downlink'?: string; + 'downlink': string; } /** * @@ -637,7 +784,7 @@ export interface SessionManagementSubscriptionData { * @type {Nssai} * @memberof SessionManagementSubscriptionData */ - 'singleNssai'?: Nssai; + 'singleNssai': Nssai; /** * * @type {{ [key: string]: DnnConfiguration; }} @@ -656,7 +803,7 @@ export interface SessionRule { * @type {string} * @memberof SessionRule */ - 'sessRuleId'?: string; + 'sessRuleId': string; } /** * @@ -669,7 +816,7 @@ export interface SmPolicyData { * @type {{ [key: string]: SmPolicySnssai; }} * @memberof SmPolicyData */ - 'smPolicySnssaiData'?: { [key: string]: SmPolicySnssai; }; + 'smPolicySnssaiData': { [key: string]: SmPolicySnssai; }; } /** * @@ -682,7 +829,7 @@ export interface SmPolicySnssai { * @type {Nssai} * @memberof SmPolicySnssai */ - 'snssai'?: Nssai; + 'snssai': Nssai; /** * * @type {{ [key: string]: Dnn; }} @@ -714,7 +861,7 @@ export interface SscModes { * @type {string} * @memberof SscModes */ - 'defaultSscMode'?: string; + 'defaultSscMode': string; /** * * @type {Array} @@ -733,7 +880,7 @@ export interface SubscribedSnssaiInfo { * @type {Array} * @memberof SubscribedSnssaiInfo */ - 'dnnInfos'?: Array; + 'dnnInfos': Array; } /** * @@ -746,13 +893,13 @@ export interface SubscribedUeAmbr { * @type {string} * @memberof SubscribedUeAmbr */ - 'uplink'?: string; + 'uplink': string; /** * * @type {string} * @memberof SubscribedUeAmbr */ - 'downlink'?: string; + 'downlink': string; } /** * @@ -765,13 +912,19 @@ export interface Subscriber { * @type {string} * @memberof Subscriber */ - 'plmnID'?: string; + 'plmnID': string; /** * * @type {string} * @memberof Subscriber */ - 'ueId'?: string; + 'ueId': string; + /** + * + * @type {string} + * @memberof Subscriber + */ + 'gpsi': string; } /** * @@ -790,67 +943,67 @@ export interface Subscription { * @type {string} * @memberof Subscription */ - 'plmnID'?: string; + 'plmnID': string; /** * * @type {string} * @memberof Subscription */ - 'ueId'?: string; + 'ueId': string; /** * * @type {AuthenticationSubscription} * @memberof Subscription */ - 'AuthenticationSubscription'?: AuthenticationSubscription; + 'AuthenticationSubscription': AuthenticationSubscription; /** * * @type {AccessAndMobilitySubscriptionData} * @memberof Subscription */ - 'AccessAndMobilitySubscriptionData'?: AccessAndMobilitySubscriptionData; + 'AccessAndMobilitySubscriptionData': AccessAndMobilitySubscriptionData; /** * * @type {Array} * @memberof Subscription */ - 'SessionManagementSubscriptionData'?: Array; + 'SessionManagementSubscriptionData': Array; /** * * @type {SmfSelectionSubscriptionData} * @memberof Subscription */ - 'SmfSelectionSubscriptionData'?: SmfSelectionSubscriptionData; + 'SmfSelectionSubscriptionData': SmfSelectionSubscriptionData; /** * * @type {AmPolicyData} * @memberof Subscription */ - 'AmPolicyData'?: AmPolicyData; + 'AmPolicyData': AmPolicyData; /** * * @type {SmPolicyData} * @memberof Subscription */ - 'SmPolicyData'?: SmPolicyData; + 'SmPolicyData': SmPolicyData; /** * * @type {Array} * @memberof Subscription */ - 'FlowRules'?: Array; + 'FlowRules': Array; /** * * @type {Array} * @memberof Subscription */ - 'QosFlows'?: Array; + 'QosFlows': Array; /** * * @type {Array} * @memberof Subscription */ - 'ChargingDatas'?: Array; + 'ChargingDatas': Array; } /** * @@ -869,127 +1022,11 @@ export interface Tenant { * @type {string} * @memberof Tenant */ - 'tenantName'?: string; + 'tenantName': string; } /** * * @export - * @interface ChargingData - */ - export interface ChargingData { - /** - * - * @type {string} - * @memberof Tenant - */ - 'snssai'?: string; - /** - * - * @type {string} - * @memberof ChargingData - */ - 'dnn'?: string; - /** - * - * @type {number} - * @memberof ChargingData - */ - 'qosRef'?: number; - /** - * - * @type {string} - * @memberof ChargingData - */ - 'filter'?: string; - /** - * - * @type {string} - * @memberof ChargingData - */ - 'chargingMethod'?: string; - /** - * - * @type {string} - * @memberof ChargingData - */ - 'quota'?: string; - /** - * - * @type {string} - * @memberof ChargingData - */ - 'unitCost'?: string; - /** - * - * @type {string} - * @memberof ChargingData - */ - 'ueId'?:string; -} -/** - * - * @export - * @interface FlowChargingRecord - */ -export interface FlowChargingRecord { - /** - * - * @type {string} - * @memberof flowChargingRecord - */ - 'Supi'?: string; - /** - * - * @type {string} - * @memberof flowChargingRecord - */ - 'Snssai'?: string; - /** - * - * @type {string} - * @memberof flowChargingRecord - */ - 'Dnn'?: string; - /** - * - * @type {string} - * @memberof flowChargingRecord - */ - 'Filter'?: string; - /** - * - * @type {string} - * @memberof flowChargingRecord - */ - 'QuotaLeft'?: string; - /** - * - * @type {string} - * @memberof flowChargingRecord - */ - 'Usage'?: string; - /** - * - * @type {string} - * @memberof flowChargingRecord - */ - 'TotalVol'?: string; - /** - * - * @type {string} - * @memberof flowChargingRecord - */ - 'UlVol'?: string; - /** - * - * @type {string} - * @memberof flowChargingRecord - */ - 'DlVol'?: string; -} -/** - * - * @export * @interface Tunnel */ export interface Tunnel { @@ -998,19 +1035,19 @@ export interface Tunnel { * @type {ANInformation} * @memberof Tunnel */ - 'ANInformation'?: ANInformation; + 'ANInformation': ANInformation; /** - * - * @type {string} + * github.com/free5gc/smf/internal/context/datapath.go:DataPathPool + * @type {any} * @memberof Tunnel */ - 'DataPathPool'?: string; + 'DataPathPool': any; /** - * - * @type {string} + * github.com/free5gc/util/idgenerator/idgenerator.go:IDGenerator + * @type {any} * @memberof Tunnel */ - 'PathIDGenerator'?: string; + 'PathIDGenerator': any; } /** * @@ -1023,49 +1060,49 @@ export interface UeContext { * @type {string} * @memberof UeContext */ - 'AccessType'?: string; + 'AccessType': string; /** * * @type {string} * @memberof UeContext */ - 'CmState'?: string; + 'CmState': string; /** * * @type {string} * @memberof UeContext */ - 'Guti'?: string; + 'Guti': string; /** * * @type {string} * @memberof UeContext */ - 'Mcc'?: string; + 'Mcc': string; /** * * @type {string} * @memberof UeContext */ - 'Mnc'?: string; + 'Mnc': string; /** * * @type {Array} * @memberof UeContext */ - 'PduSessions'?: Array; + 'PduSessions': Array; /** * * @type {string} * @memberof UeContext */ - 'Supi'?: string; + 'Supi': string; /** * * @type {string} * @memberof UeContext */ - 'Tac'?: string; + 'Tac': string; } /** * @@ -1078,13 +1115,13 @@ export interface UpSecurity { * @type {string} * @memberof UpSecurity */ - 'upIntegr'?: string; + 'upIntegr': string; /** * * @type {string} * @memberof UpSecurity */ - 'upConfid'?: string; + 'upConfid': string; } /** * @@ -1109,13 +1146,13 @@ export interface User { * @type {string} * @memberof User */ - 'email'?: string; + 'email': string; /** * * @type {string} * @memberof User */ - 'encryptedPassword'?: string; + 'encryptedPassword': string; } /** @@ -1132,7 +1169,7 @@ export const WebconsoleApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSubscriberGet: async (limit?: number, page?: number, options: AxiosRequestConfig = {}): Promise => { + apiSubscriberGet: async (limit?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/api/subscriber`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1182,9 +1219,11 @@ export const WebconsoleApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSubscriberGet(limit?: number, page?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async apiSubscriberGet(limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.apiSubscriberGet(limit, page, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['WebconsoleApi.apiSubscriberGet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; @@ -1226,9 +1265,10 @@ export class WebconsoleApi extends BaseAPI { * @throws {RequiredError} * @memberof WebconsoleApi */ - public apiSubscriberGet(limit?: number, page?: number, options?: AxiosRequestConfig) { + public apiSubscriberGet(limit?: number, page?: number, options?: RawAxiosRequestConfig) { return WebconsoleApiFp(this.configuration).apiSubscriberGet(limit, page, options).then((request) => request(this.axios, this.basePath)); } } + diff --git a/frontend/src/api/base.ts b/frontend/src/api/base.ts index cf6e7334..92b863a0 100644 --- a/frontend/src/api/base.ts +++ b/frontend/src/api/base.ts @@ -16,7 +16,7 @@ import type { Configuration } from './configuration'; // Some imports not used depending on template conditions // @ts-ignore -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; export const BASE_PATH = "http://localhost:5000".replace(/\/+$/, ""); @@ -39,7 +39,7 @@ export const COLLECTION_FORMATS = { */ export interface RequestArgs { url: string; - options: AxiosRequestConfig; + options: RawAxiosRequestConfig; } /** @@ -53,7 +53,7 @@ export class BaseAPI { constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { if (configuration) { this.configuration = configuration; - this.basePath = configuration.basePath || this.basePath; + this.basePath = configuration.basePath ?? basePath; } } }; @@ -70,3 +70,17 @@ export class RequiredError extends Error { this.name = "RequiredError" } } + +interface ServerMap { + [key: string]: { + url: string, + description: string, + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = { +} diff --git a/frontend/src/api/common.ts b/frontend/src/api/common.ts index 047c1947..c7d39008 100644 --- a/frontend/src/api/common.ts +++ b/frontend/src/api/common.ts @@ -144,7 +144,7 @@ export const toPathString = function (url: URL) { */ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; return axios.request(axiosRequestArgs); }; } diff --git a/frontend/src/api/configuration.ts b/frontend/src/api/configuration.ts index fdedaebe..e5e5a228 100644 --- a/frontend/src/api/configuration.ts +++ b/frontend/src/api/configuration.ts @@ -19,6 +19,7 @@ export interface ConfigurationParameters { password?: string; accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); basePath?: string; + serverIndex?: number; baseOptions?: any; formDataCtor?: new () => any; } @@ -58,6 +59,13 @@ export class Configuration { * @memberof Configuration */ basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; /** * base options for axios calls * @@ -80,6 +88,7 @@ export class Configuration { this.password = param.password; this.accessToken = param.accessToken; this.basePath = param.basePath; + this.serverIndex = param.serverIndex; this.baseOptions = param.baseOptions; this.formDataCtor = param.formDataCtor; } diff --git a/frontend/src/pages/ChangePassword.tsx b/frontend/src/pages/ChangePassword.tsx index efd5bb77..3b24d3b8 100644 --- a/frontend/src/pages/ChangePassword.tsx +++ b/frontend/src/pages/ChangePassword.tsx @@ -57,7 +57,7 @@ export default function ChangePassword() { return; } const newUser: User = { - email: user?.username, + email: user?.username ?? "", encryptedPassword: password.password, }; axios.post("/api/change-password", newUser).then((res) => { diff --git a/frontend/src/pages/SubscriberCreate.tsx b/frontend/src/pages/SubscriberCreate.tsx index 780d7985..c51bb697 100644 --- a/frontend/src/pages/SubscriberCreate.tsx +++ b/frontend/src/pages/SubscriberCreate.tsx @@ -51,6 +51,8 @@ export default function SubscriberCreate() { authenticationManagementField: "8000", permanentKey: { permanentKeyValue: "8baf473f2f8fd09487cccbd7097c6862", + encryptionKey: 0, + encryptionAlgorithm: 0, }, milenage: { op: { @@ -61,6 +63,8 @@ export default function SubscriberCreate() { }, opc: { opcValue: "8e27b6af0e692e750f32667a3b14605d", + encryptionKey: 0, + encryptionAlgorithm: 0, }, }, AccessAndMobilitySubscriptionData: { @@ -236,6 +240,8 @@ export default function SubscriberCreate() { ChargingDatas: [ { snssai: "01010203", + dnn: "", + filter: "", chargingMethod: "Offline", quota: "100000", unitCost: "1", @@ -251,6 +257,8 @@ export default function SubscriberCreate() { }, { snssai: "01112233", + dnn: "", + filter: "", chargingMethod: "Online", quota: "100000", unitCost: "1", @@ -417,7 +425,9 @@ export default function SubscriberCreate() { setData({ ...data }); } else { data.SessionManagementSubscriptionData.push({ - singleNssai: {}, + singleNssai: { + sst: 1, + }, dnnConfigurations: {}, }); setData({ ...data }); @@ -464,7 +474,10 @@ export default function SubscriberCreate() { }, priorityLevel: 8, }, - sessionAmbr: {}, + sessionAmbr: { + uplink: "", + downlink: "", + }, }; setData({ ...data }); dnnName[index] = ""; @@ -527,7 +540,10 @@ export default function SubscriberCreate() { const onUpSecurity = (dnn: DnnConfiguration | undefined) => { if (dnn !== undefined) { - dnn.upSecurity = {}; + dnn.upSecurity = { + upIntegr: "NOT_NEEDED", + upConfid: "NOT_NEEDED", + }; } setData({ ...data }); }; @@ -726,6 +742,8 @@ export default function SubscriberCreate() { ...data.AuthenticationSubscription, permanentKey: { permanentKeyValue: event.target.value, + encryptionKey: 0, + encryptionAlgorithm: 0, }, }, }); @@ -741,10 +759,14 @@ export default function SubscriberCreate() { milenage: { op: { opValue: opcValue, + encryptionKey: 0, + encryptionAlgorithm: 0, }, }, opc: { opcValue: "", + encryptionKey: 0, + encryptionAlgorithm: 0, }, }, }; @@ -758,10 +780,14 @@ export default function SubscriberCreate() { milenage: { op: { opValue: "", + encryptionKey: 0, + encryptionAlgorithm: 0, }, }, opc: { opcValue: opcValue, + encryptionKey: 0, + encryptionAlgorithm: 0, }, }, }; @@ -783,10 +809,14 @@ export default function SubscriberCreate() { milenage: { op: { opValue: event.target.value, + encryptionKey: 0, + encryptionAlgorithm: 0, }, }, opc: { opcValue: "", + encryptionKey: 0, + encryptionAlgorithm: 0, }, }, }; @@ -799,10 +829,14 @@ export default function SubscriberCreate() { milenage: { op: { opValue: "", + encryptionKey: 0, + encryptionAlgorithm: 0, }, }, opc: { opcValue: event.target.value, + encryptionKey: 0, + encryptionAlgorithm: 0, }, }, }; @@ -831,8 +865,8 @@ export default function SubscriberCreate() { AccessAndMobilitySubscriptionData: { ...data.AccessAndMobilitySubscriptionData, subscribedUeAmbr: { - ...data.AccessAndMobilitySubscriptionData?.subscribedUeAmbr, uplink: event.target.value, + downlink: data.AccessAndMobilitySubscriptionData.subscribedUeAmbr?.downlink ?? "", }, }, }); @@ -846,7 +880,7 @@ export default function SubscriberCreate() { AccessAndMobilitySubscriptionData: { ...data.AccessAndMobilitySubscriptionData, subscribedUeAmbr: { - ...data.AccessAndMobilitySubscriptionData?.subscribedUeAmbr, + uplink: data.AccessAndMobilitySubscriptionData.subscribedUeAmbr?.uplink ?? "", downlink: event.target.value, }, }, @@ -858,7 +892,7 @@ export default function SubscriberCreate() { index: number, ): void => { if (event.target.value === "") { - data.SessionManagementSubscriptionData![index].singleNssai!.sst = undefined; + data.SessionManagementSubscriptionData![index].singleNssai!.sst = 0; } else { data.SessionManagementSubscriptionData![index].singleNssai!.sst! = Number(event.target.value); } @@ -909,7 +943,7 @@ export default function SubscriberCreate() { def.push(nssai); } } - data.AccessAndMobilitySubscriptionData!.nssai!.defaultSingleNssais = def; + data.AccessAndMobilitySubscriptionData!.nssai!.defaultSingleNssais = def ?? []; data.AccessAndMobilitySubscriptionData!.nssai!.singleNssais = single; setData({ ...data }); }; @@ -954,7 +988,7 @@ export default function SubscriberCreate() { if (event.target.value === "") { data.SessionManagementSubscriptionData![index].dnnConfigurations![dnn]["5gQosProfile"]![ "5qi" - ] = undefined; + ] = 8; } else { data.SessionManagementSubscriptionData![index].dnnConfigurations![dnn]["5gQosProfile"]![ "5qi" @@ -1033,7 +1067,7 @@ export default function SubscriberCreate() { data.QosFlows![i].qosRef === qosRef ) { if (event.target.value == "") { - data.QosFlows![i]["5qi"] = undefined; + data.QosFlows![i]["5qi"] = 8; } else { data.QosFlows![i]["5qi"] = Number(event.target.value); } diff --git a/frontend/src/pages/SubscriberRead.tsx b/frontend/src/pages/SubscriberRead.tsx index 097bd226..fbd82b98 100644 --- a/frontend/src/pages/SubscriberRead.tsx +++ b/frontend/src/pages/SubscriberRead.tsx @@ -32,7 +32,7 @@ export default function SubscriberRead() { }>(); const navigation = useNavigate(); - const [data, setData] = useState({}); + const [data, setData] = useState(null); // const [update, setUpdate] = useState(false); function toHex(v: number | undefined): string { @@ -50,7 +50,7 @@ export default function SubscriberRead() { }; const isDefaultNssai = (nssai: Nssai | undefined) => { - if (nssai === undefined) { + if (nssai === undefined || data == null) { return false; } else { for ( @@ -123,9 +123,8 @@ export default function SubscriberRead() { dnn: string, qosRef: number | undefined, ): QosFlows | undefined => { - if (data.QosFlows !== undefined) { - for (let i = 0; i < data.QosFlows?.length; i++) { - const qos = data.QosFlows![i]; + if (data != null) { + for (const qos of data.QosFlows) { if (qos.snssai === sstSd && qos.dnn === dnn && qos.qosRef === qosRef) { return qos; } @@ -135,9 +134,8 @@ export default function SubscriberRead() { const chargingConfig = (dnn: string | undefined, snssai: Nssai, filter: string | undefined) => { const flowKey = toHex(snssai.sst) + snssai.sd; - for (let i = 0; i < data.ChargingDatas!.length; i++) { - const chargingData = data.ChargingDatas![i]; - const isOnlineCharging = data.ChargingDatas![i].chargingMethod === "Online"; + for (const chargingData of data?.ChargingDatas ?? []) { + const isOnlineCharging = chargingData.chargingMethod === "Online"; if ( chargingData.snssai === flowKey && @@ -177,9 +175,9 @@ export default function SubscriberRead() { const flowRule = (dnn: string, snssai: Nssai) => { console.log("in flowRule"); - console.log(data.FlowRules); + console.log(data?.FlowRules); const flowKey = toHex(snssai.sst) + snssai.sd; - if (data.FlowRules !== undefined) { + if (data?.FlowRules !== undefined) { return data.FlowRules.filter((flow) => flow.dnn === dnn && flow.snssai === flowKey).map( (flow) => (
@@ -280,59 +278,59 @@ export default function SubscriberRead() { PLMN ID - {data.plmnID} + {data?.plmnID} SUPI (IMSI) - {imsiValue(data.ueId)} + {imsiValue(data?.ueId)} GPSI (MSISDN) - {msisdnValue(data.AccessAndMobilitySubscriptionData)} + {msisdnValue(data?.AccessAndMobilitySubscriptionData)} Authentication Management Field (AMF) - {data.AuthenticationSubscription?.authenticationManagementField} + {data?.AuthenticationSubscription?.authenticationManagementField} Authentication Method - {data.AuthenticationSubscription?.authenticationMethod} + {data?.AuthenticationSubscription?.authenticationMethod} K - {data.AuthenticationSubscription?.permanentKey?.permanentKeyValue} + {data?.AuthenticationSubscription?.permanentKey?.permanentKeyValue} Operator Code Type - {operationCodeType(data.AuthenticationSubscription)} + {operationCodeType(data?.AuthenticationSubscription)} Operator Code Value - {operationCodeValue(data.AuthenticationSubscription)} + {operationCodeValue(data?.AuthenticationSubscription)} SQN - {data.AuthenticationSubscription?.sequenceNumber} + {data?.AuthenticationSubscription?.sequenceNumber} @@ -344,7 +342,7 @@ export default function SubscriberRead() { Uplink - {data.AccessAndMobilitySubscriptionData?.subscribedUeAmbr?.uplink} + {data?.AccessAndMobilitySubscriptionData?.subscribedUeAmbr?.uplink} @@ -352,13 +350,13 @@ export default function SubscriberRead() { Downlink - {data.AccessAndMobilitySubscriptionData?.subscribedUeAmbr?.downlink} + {data?.AccessAndMobilitySubscriptionData?.subscribedUeAmbr?.downlink} - {data.SessionManagementSubscriptionData?.map((row, index) => ( + {data?.SessionManagementSubscriptionData?.map((row, index) => (

S-NSSAI Configuragtion

diff --git a/frontend/src/pages/TenantCreate.tsx b/frontend/src/pages/TenantCreate.tsx index b87d93c8..c2818b28 100644 --- a/frontend/src/pages/TenantCreate.tsx +++ b/frontend/src/pages/TenantCreate.tsx @@ -10,7 +10,7 @@ import { Button, Grid, TextField, Table, TableBody, TableCell, TableRow } from " export default function TenantCreate() { const navigation = useNavigate(); - const [tenant, setTenant] = useState({}); + const [tenant, setTenant] = useState({tenantName: ""}); const handleCreate = () => { console.log("Create"); diff --git a/frontend/src/pages/TenantUpdate.tsx b/frontend/src/pages/TenantUpdate.tsx index cefa5b42..5c0cb349 100644 --- a/frontend/src/pages/TenantUpdate.tsx +++ b/frontend/src/pages/TenantUpdate.tsx @@ -14,7 +14,7 @@ export default function TenantUpdate() { id: string; }>(); const navigation = useNavigate(); - const [tenant, setTenant] = useState({}); + const [tenant, setTenant] = useState({tenantName: ""}); useEffect(() => { axios.get("/api/tenant/" + id).then((res) => { diff --git a/frontend/src/pages/UserCreate.tsx b/frontend/src/pages/UserCreate.tsx index 9aa3a3ce..e1c49f6a 100644 --- a/frontend/src/pages/UserCreate.tsx +++ b/frontend/src/pages/UserCreate.tsx @@ -27,7 +27,7 @@ export interface Password { export default function UserCreate() { const navigation = useNavigate(); - const [user, setUser] = useState({}); + const [user, setUser] = useState({email: "", encryptedPassword: ""}); const [password, setPassword] = useState({}); diff --git a/frontend/src/pages/UserUpdate.tsx b/frontend/src/pages/UserUpdate.tsx index f12a6073..5d20afcc 100644 --- a/frontend/src/pages/UserUpdate.tsx +++ b/frontend/src/pages/UserUpdate.tsx @@ -32,7 +32,7 @@ export default function UserUpdate() { uid: string; }>(); const navigation = useNavigate(); - const [user, setUser] = useState({}); + const [user, setUser] = useState({email: "", encryptedPassword: ""}); const [password, setPassword] = useState({}); diff --git a/frontend/webconsole.yaml b/frontend/webconsole.yaml index 7912d8db..b6c02fdc 100644 --- a/frontend/webconsole.yaml +++ b/frontend/webconsole.yaml @@ -53,16 +53,30 @@ components: type: integer format: int64 # Subscriber + # github.com/free5gc/webconsole/backend/WebUI/model_subs_list_ie.go:SubsListIE Subscriber: type: object + required: + - plmnID + - ueId + - gpsi properties: plmnID: type: string ueId: type: string + gpsi: + type: string # PduSession + # github.com/free5gc/amf/internal/sbi/producer/oam.go:PduSession PduSession: type: object + required: + - Dnn + - PduSessionId + - Sd + - SmContextRef + - Sst properties: Dnn: type: string @@ -75,8 +89,18 @@ components: Sst: type: string # UeContext + # github.com/free5gc/amf/internal/sbi/producer/oam.go:UEContext UeContext: type: object + required: + - AccessType + - CmState + - Guti + - Mcc + - Mnc + - PduSessions + - Supi + - Tac properties: AccessType: type: string @@ -97,14 +121,21 @@ components: Tac: type: string # SessionRule + # github.com/free5gc/openapi/models/model_session_rule.go:SessionRule SessionRule: type: object + required: + - sessRuleId properties: sessRuleId: type: string # ANInformation + # github.com/free5gc/smf/internal/context/upf.go:UPTunnel/ANInformation ANInformation: type: object + required: + - IPAddress + - TEID properties: IPAddress: type: string @@ -112,18 +143,35 @@ components: type: integer format: int64 # Tunnel + # github.com/free5gc/smf/internal/context/upf.go:UPTunnel Tunnel: type: object + required: + - ANInformation + - DataPathPool + - PathIDGenerator properties: ANInformation: $ref: "#/components/schemas/ANInformation" DataPathPool: - type: string + description: github.com/free5gc/smf/internal/context/datapath.go:DataPathPool PathIDGenerator: - type: string + description: github.com/free5gc/util/idgenerator/idgenerator.go:IDGenerator # PduSessionInfo + # github.com/free5gc/smf/internal/sbi/producer/oam.go:PDUSessionInfo PduSessionInfo: type: object + required: + - AnType + - Dnn + - PDUAddress + - PDUSessionID + - Sd + - SessionRule + - Sst + - Supi + - Tunnel + - UpCnxState properties: AnType: type: string @@ -150,16 +198,23 @@ components: UpCnxState: type: string # Tenant + # github.com/free5gc/webconsole/backend/WebUI/model_tenant_data.go:Tenant Tenant: type: object + required: + - tenantName properties: tenantId: type: string tenantName: type: string # User + # github.com/free5gc/webconsole/backend/WebUI/model_user_data.go:User User: type: object + required: + - email + - encryptedPassword properties: userId: type: string @@ -170,7 +225,12 @@ components: encryptedPassword: type: string # Opc + # github.com/free5gc/openapi/models/model_opc.go:Opc Opc: + required: + - opcValue + - encryptionKey + - encryptionAlgorithm type: object properties: opcValue: @@ -182,8 +242,13 @@ components: type: integer format: int64 # MilenageOp + # github.com/free5gc/openapi/models/model_op.go:Op MilenageOp: type: object + required: + - opValue + - encryptionKey + - encryptionAlgorithm properties: opValue: type: string @@ -194,14 +259,20 @@ components: type: integer format: int64 # Milenage + # github.com/free5gc/openapi/models/model_milenage.go:Milenage Milenage: type: object properties: op: $ref: "#/components/schemas/MilenageOp" # PermanentKey + # github.com/free5gc/openapi/models/model_permanent_key.go:PermanentKey PermanentKey: type: object + required: + - permanentKeyValue + - encryptionKey + - encryptionAlgorithm properties: permanentKeyValue: type: string @@ -212,8 +283,13 @@ components: type: integer format: int64 # AuthenticationSubscription + # github.com/free5gc/openapi/models/model_authentication_subscription.go:AuthenticationSubscription AuthenticationSubscription: type: object + required: + - authenticationMethod + - permanentKey + - sequenceNumber properties: authenticationMethod: type: string @@ -228,16 +304,23 @@ components: opc: $ref: "#/components/schemas/Opc" # SubscribedUeAmbr + # github.com/free5gc/openapi/models/model_ambr_rm.go:AmbrRm SubscribedUeAmbr: type: object + required: + - uplink + - downlink properties: uplink: type: string downlink: type: string # Nssai + # github.com/free5gc/openapi/models/model_snssai.go:Snssai Nssai: type: object + required: + - sst properties: sst: type: integer @@ -245,8 +328,11 @@ components: sd: type: string # DefaultSingleNssais + # github.com/free5gc/openapi/models/model_nssai.go:Nssai DefaultSingleNssais: type: object + required: + - defaultSingleNssais properties: defaultSingleNssais: type: array @@ -257,6 +343,7 @@ components: items: $ref: "#/components/schemas/Nssai" # AccessAndMobilitySubscriptionData + # github.com/free5gc/openapi/models/model_access_and_mobility_subscription_data.go:AccessAndMobilitySubscriptionData AccessAndMobilitySubscriptionData: type: object properties: @@ -269,16 +356,22 @@ components: nssai: $ref: "#/components/schemas/DefaultSingleNssais" # SessionManagementSubscriptionData + # github.com/free5gc/openapi/models/model_session_management_subscription_data.go:SessionManagementSubscriptionData SessionManagementSubscriptionData: type: object + required: + - singleNssai properties: singleNssai: $ref: "#/components/schemas/Nssai" dnnConfigurations: $ref: "#/components/schemas/DnnConfigurations" # PduSessionTypes + # github.com/free5gc/openapi/models/model_pdu_session_types.go:PduSessionTypes PduSessionTypes: type: object + required: + - defaultSessionType properties: defaultSessionType: type: string @@ -287,8 +380,11 @@ components: items: type: string # SscModes + # github.com/free5gc/openapi/models/model_ssc_modes.go:SscModes SscModes: type: object + required: + - defaultSscMode properties: defaultSscMode: type: string @@ -297,8 +393,13 @@ components: items: type: string # Arp + # github.com/free5gc/openapi/models/model_arp.go:Arp Arp: type: object + required: + - priorityLevel + - preemptCap + - preemptVuln properties: priorityLevel: type: integer @@ -308,8 +409,12 @@ components: preemptVuln: type: string # 5gQosProfile + # github.com/free5gc/openapi/models/model_subscribed_default_qos.go:SubscribedDefaultQos 5gQosProfile: type: object + required: + - 5qi + - arp properties: 5qi: type: integer @@ -320,24 +425,47 @@ components: type: integer format: int64 # SessionAmbr + # github.com/free5gc/openapi/models/model_ambr.go:Ambr SessionAmbr: type: object + required: + - uplink + - downlink properties: uplink: type: string downlink: type: string + # IpAddress + # github.com/free5gc/openapi/models/model_ip_address.go:IpAddress + IpAddress: + type: object + properties: + ipv4Addr: + type: string + ipv6Addr: + type: string + ipv6Prefix: + type: string # UpSecurity + # github.com/free5gc/openapi/models/model_up_security.go:UpSecurity UpSecurity: type: object + required: + - upIntegr + - upConfid properties: upIntegr: type: string upConfid: type: string # DnnConfiguration + # github.com/free5gc/openapi/models/model_dnn_configuration.go:DnnConfiguration DnnConfiguration: type: object + required: + - pduSessionTypes + - sscModes properties: pduSessionTypes: $ref: "#/components/schemas/PduSessionTypes" @@ -347,39 +475,54 @@ components: $ref: "#/components/schemas/5gQosProfile" sessionAmbr: $ref: "#/components/schemas/SessionAmbr" + staticIpAddress: + type: array + items: + $ref: '#/components/schemas/IpAddress' upSecurity: $ref: "#/components/schemas/UpSecurity" # DnnConfigurations + # map[string]DnnConfiguration DnnConfigurations: type: object additionalProperties: $ref: "#/components/schemas/DnnConfiguration" # Dnn + # github.com/free5gc/openapi/models/model_dnn_info.go:DnnInfo + # github.com/free5gc/openapi/models/model_sm_policy_dnn_data.go:SmPolicyDnnData Dnn: type: object + required: + - dnn properties: dnn: type: string # SubscribedSnssaiInfo + # github.com/free5gc/openapi/models/model_snssai_info.go:SnssaiInfo SubscribedSnssaiInfo: type: object + required: + - dnnInfos properties: dnnInfos: type: array items: $ref: "#/components/schemas/Dnn" # SubscribedSnssaiInfos + # map[string]SnssaiInfo SubscribedSnssaiInfos: type: object additionalProperties: $ref: "#/components/schemas/SubscribedSnssaiInfo" # SmfSelectionSubscriptionData + # github.com/free5gc/openapi/models/model_smf_selection_subscription_data.go:SmfSelectionSubscriptionData SmfSelectionSubscriptionData: type: object properties: subscribedSnssaiInfos: $ref: "#/components/schemas/SubscribedSnssaiInfos" # AmPolicyData + # github.com/free5gc/openapi/models/model_am_policy_data.go:AmPolicyData AmPolicyData: type: object properties: @@ -388,30 +531,39 @@ components: items: type: string # SmPolicyDnnData + # map[string]SmPolicyDnnData SmPolicyDnnData: type: object additionalProperties: $ref: "#/components/schemas/Dnn" # SmPolicySnssai + # github.com/free5gc/openapi/models/model_sm_policy_snssai_data.go:SmPolicySnssaiData SmPolicySnssai: type: object + required: + - snssai properties: snssai: $ref: "#/components/schemas/Nssai" smPolicyDnnData: $ref: "#/components/schemas/SmPolicyDnnData" # SmPolicySnssaiData + # map[string]SmPolicySnssaiData SmPolicySnssaiData: type: object additionalProperties: $ref: "#/components/schemas/SmPolicySnssai" # SmPolicyData + # github.com/free5gc/openapi/models/model_sm_policy_data.go:SmPolicyData SmPolicyData: type: object + required: + - smPolicySnssaiData properties: smPolicySnssaiData: $ref: "#/components/schemas/SmPolicySnssaiData" # FlowRules + # github.com/free5gc/webconsole/backend/WebUI/model_flow_rule.go:FlowRule FlowRules: type: object properties: @@ -424,17 +576,23 @@ components: type: string dnn: type: string - qfi: + qosRef: type: integer format: int64 + # github.com/free5gc/webconsole/backend/WebUI/model_qos_flow.go:QosFlow QosFlows: type: object + required: + - snssai + - dnn + - qosRef + - 5qi properties: snssai: type: string dnn: type: string - qfi: + qosRef: type: integer format: int64 5qi: @@ -449,8 +607,21 @@ components: gbrDL: type: string # Subscription + # github.com/free5gc/webconsole/backend/WebUI/model_subs_data.go:SubsData Subscription: type: object + required: + - plmnID + - ueId + - AuthenticationSubscription + - AccessAndMobilitySubscriptionData + - SessionManagementSubscriptionData + - SmfSelectionSubscriptionData + - AmPolicyData + - SmPolicyData + - FlowRules + - QosFlows + - ChargingDatas properties: userNumber: type: integer @@ -481,3 +652,63 @@ components: type: array items: $ref: "#/components/schemas/QosFlows" + ChargingDatas: + type: array + items: + $ref: "#/components/schemas/ChargingData" + # github.com/free5gc/webconsole/backend/WebUI/model_charging_data.go:ChargingData + ChargingData: + type: object + required: + - dnn + - filter + properties: + snssai: + type: string + dnn: + type: string + qosRef: + type: integer + format: int64 + filter: + type: string + chargingMethod: + type: string + quota: + type: string + unitCost: + type: string + ueId: + type: string + # github.com/free5gc/webconsole/backend/WebUI/model_rating_group_data_usage.go:RatingGroupDataUsage + FlowChargingRecord: + type: object + required: + - Supi + - Snssai + - Dnn + - Filter + - QuotaLeft + - Usage + - TotalVol + - UlVol + - DlVol + properties: + Supi: + type: string + Snssai: + type: string + Dnn: + type: string + Filter: + type: string + QuotaLeft: + type: string + Usage: + type: string + TotalVol: + type: string + UlVol: + type: string + DlVol: + type: string