From 16f879f4912246f3afaf684c6f17987ecf107f7d Mon Sep 17 00:00:00 2001 From: Jibon Date: Tue, 14 Mar 2023 17:49:34 +0100 Subject: [PATCH] feat: ingress --- package.json | 2 +- protocol | 2 +- src/assets/locales/en/translation.json | 9 + src/components/header/room-settings/index.tsx | 35 +++- .../header/room-settings/ingress.tsx | 160 +++++++++++++++++ .../proto/plugnmeet_breakout_room_pb.ts | 18 +- src/helpers/proto/plugnmeet_common_api_pb.ts | 36 ++-- src/helpers/proto/plugnmeet_datamessage_pb.ts | 8 +- src/helpers/proto/plugnmeet_ingress_pb.ts | 170 ++++++++++++++++++ src/helpers/proto/plugnmeet_polls_pb.ts | 20 +-- src/helpers/proto/plugnmeet_recorder_pb.ts | 16 +- src/helpers/proto/plugnmeet_recording_pb.ts | 4 +- src/login.html | 3 + src/store/slices/interfaces/session.ts | 8 + src/store/slices/sessionSlice.ts | 3 + 15 files changed, 434 insertions(+), 60 deletions(-) create mode 100644 src/components/header/room-settings/ingress.tsx create mode 100644 src/helpers/proto/plugnmeet_ingress_pb.ts diff --git a/package.json b/package.json index cdf7cf68..c5e58935 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "format-check": "prettier --check \"./src/**/*.{ts,tsx,scss}\" && eslint --quiet --ext .tsx,.ts src/", "lint-staged": "lint-staged", "prepare": "husky install", - "proto": "protoc --es_opt=target=ts,import_extension=.ts --plugin=protoc-gen-es=./node_modules/.bin/protoc-gen-es --es_out=./src/helpers/proto --proto_path=./protocol/proto_files plugnmeet_datamessage.proto plugnmeet_recorder.proto plugnmeet_recording.proto plugnmeet_breakout_room.proto plugnmeet_polls.proto plugnmeet_common_api.proto" + "proto": "protoc --es_opt=target=ts,import_extension=.ts --plugin=protoc-gen-es=./node_modules/.bin/protoc-gen-es --es_out=./src/helpers/proto --proto_path=./protocol/proto_files plugnmeet_datamessage.proto plugnmeet_recorder.proto plugnmeet_recording.proto plugnmeet_breakout_room.proto plugnmeet_polls.proto plugnmeet_common_api.proto plugnmeet_ingress.proto" }, "dependencies": { "@bufbuild/protobuf": "1.1.0", diff --git a/protocol b/protocol index 9069061b..797a2201 160000 --- a/protocol +++ b/protocol @@ -1 +1 @@ -Subproject commit 9069061b9f26b2511a2549b7eb67e6a30d2fa702 +Subproject commit 797a22014e0ec060310a9a8bb8eaf958d3cc4a22 diff --git a/src/assets/locales/en/translation.json b/src/assets/locales/en/translation.json index 5c9fd1f1..d6c6180b 100644 --- a/src/assets/locales/en/translation.json +++ b/src/assets/locales/en/translation.json @@ -67,6 +67,7 @@ "title": "Settings", "data-savings": "Data savings", "notifications": "Notifications", + "ingress": "Ingress", "show-webcams": "Show webcams", "show-screen-share": "Show Screen share", "allow-audio-notification": "Allow audio notification", @@ -363,5 +364,13 @@ "meeting-id-des": "Meeting's origin ID", "user-role": "User role", "user-role-des": "User's current role. Either admin or participant" + }, + "ingress-features": { + "join-as-name": "Join as name", + "feature-not-allow": "Feature not allow", + "join-as-name-required": "Join as name required", + "gen-link": "Generate link", + "rtmp-url": "RTMP Host/URL", + "rtmp-key": "RTMP key/secret" } } diff --git a/src/components/header/room-settings/index.tsx b/src/components/header/room-settings/index.tsx index 64bb4393..4972e72e 100644 --- a/src/components/header/room-settings/index.tsx +++ b/src/components/header/room-settings/index.tsx @@ -1,4 +1,4 @@ -import React, { Fragment, useState } from 'react'; +import React, { Fragment, useEffect, useState } from 'react'; import { createSelector } from '@reduxjs/toolkit'; import { Transition, Dialog, Tab } from '@headlessui/react'; import { useTranslation } from 'react-i18next'; @@ -13,6 +13,7 @@ import { updateShowRoomSettingsModal } from '../../../store/slices/roomSettingsS import DataSavings from './dataSavings'; import Notification from './notification'; import ApplicationSettings from './application'; +import Ingress from './ingress'; declare const PNM_VERSION: string; @@ -20,18 +21,21 @@ const isShowRoomSettingsModalSelector = createSelector( (state: RootState) => state.roomSettings.isShowRoomSettingsModal, (isShowRoomSettingsModal) => isShowRoomSettingsModal, ); + const RoomSettings = () => { const dispatch = useAppDispatch(); const { t } = useTranslation(); - const serverVersion = store.getState().session.serverVersion; - const copyright_conf = - store.getState().session.currentRoom?.metadata?.copyright_conf; + const s = store.getState(); + const serverVersion = s.session.serverVersion; + const copyright_conf = s.session.currentRoom?.metadata?.copyright_conf; + const ingressFeatures = + s.session.currentRoom?.metadata?.room_features.ingress_features; const isShowRoomSettingsModal = useAppSelector( isShowRoomSettingsModalSelector, ); - const [categories] = useState({ + const [categories, setCategories] = useState({ 'header.room-settings.application': [ { id: 1, @@ -40,18 +44,35 @@ const RoomSettings = () => { ], 'header.room-settings.data-savings': [ { - id: 1, + id: 2, elm: , }, ], 'header.room-settings.notifications': [ { - id: 1, + id: 3, elm: , }, ], }); + useEffect(() => { + if ( + s.session?.currentUser?.metadata?.is_admin && + ingressFeatures?.is_allow + ) { + categories['header.room-settings.ingress'] = [ + { + id: 4, + elm: , + }, + ]; + } + + setCategories(categories); + //eslint-disable-next-line + }, []); + const closeModal = () => { dispatch(updateShowRoomSettingsModal(false)); }; diff --git a/src/components/header/room-settings/ingress.tsx b/src/components/header/room-settings/ingress.tsx new file mode 100644 index 00000000..3e8fc41f --- /dev/null +++ b/src/components/header/room-settings/ingress.tsx @@ -0,0 +1,160 @@ +import React, { useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { toast } from 'react-toastify'; +import { isEmpty } from 'lodash'; + +import { IIngressFeatures } from '../../../store/slices/interfaces/session'; +import { + CreateIngressReq, + CreateIngressRes, + IngressInput, +} from '../../../helpers/proto/plugnmeet_ingress_pb'; +import { RootState, store, useAppSelector } from '../../../store'; +import sendAPIRequest from '../../../helpers/api/plugNmeetAPI'; +import { createSelector } from '@reduxjs/toolkit'; + +interface IngressProps { + features: IIngressFeatures; +} + +const ingressFeaturesSelector = createSelector( + (state: RootState) => + state.session.currentRoom?.metadata?.room_features.ingress_features, + (ingress_features) => ingress_features, +); + +const Ingress = () => { + const { t } = useTranslation(); + const [name, setName] = useState('broadcaster'); + const [errorMsg, setErrorMsg] = useState(null); + const session = store.getState().session; + const ingressFeatures = useAppSelector(ingressFeaturesSelector); + + const onSubmit = async (e) => { + e.preventDefault(); + setErrorMsg(null); + + if (!ingressFeatures?.is_allow) { + setErrorMsg(t('ingress-features.feature-not-allow')); + return; + } + let participantName = name; + + if (isEmpty(participantName)) { + participantName = 'broadcaster'; + } + + const body = new CreateIngressReq({ + inputType: IngressInput.RTMP_INPUT, + participantName: participantName, + roomId: session.currentRoom.room_id, + }); + + const r = await sendAPIRequest( + 'ingress/create', + body.toBinary(), + false, + 'application/protobuf', + 'arraybuffer', + ); + const res = CreateIngressRes.fromBinary(new Uint8Array(r)); + if (!res.status) { + toast(t(res.msg), { + type: 'error', + isLoading: false, + autoClose: 1000, + }); + } + }; + + const renderFrom = () => { + return ( + <> +
onSubmit(e)}> +
+ + setName(e.currentTarget.value)} + className="mt-1 px-4 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm rounded-md h-10 border border-solid border-black/50 dark:border-darkText bg-transparent dark:text-darkText" + /> + {errorMsg ? ( +
+ {errorMsg} +
+ ) : null} +
+
+ +
+
+ + ); + }; + + const render = () => { + return ( + <> +
+
+ + +
+
+
+
+ + +
+
+ + ); + }; + + return ( +
+ {isEmpty(ingressFeatures?.url) && isEmpty(ingressFeatures?.stream_key) + ? renderFrom() + : render()} +
+ ); +}; + +export default Ingress; diff --git a/src/helpers/proto/plugnmeet_breakout_room_pb.ts b/src/helpers/proto/plugnmeet_breakout_room_pb.ts index 4a4719f4..f9c507a9 100644 --- a/src/helpers/proto/plugnmeet_breakout_room_pb.ts +++ b/src/helpers/proto/plugnmeet_breakout_room_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.0.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v1.1.0 with parameter "target=ts,import_extension=.ts" // @generated from file plugnmeet_breakout_room.proto (package plugnmeet, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -47,7 +47,7 @@ export class CreateBreakoutRoomsReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.CreateBreakoutRoomsReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -142,7 +142,7 @@ export class BreakoutRoom extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.BreakoutRoom'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -212,7 +212,7 @@ export class BreakoutRoomUser extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.BreakoutRoomUser'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -273,7 +273,7 @@ export class IncreaseBreakoutRoomDurationReq extends Message [ { @@ -343,7 +343,7 @@ export class BroadcastBreakoutRoomMsgReq extends Message [ { no: 1, name: 'msg', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -417,7 +417,7 @@ export class JoinBreakoutRoomReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.JoinBreakoutRoomReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { @@ -479,7 +479,7 @@ export class EndBreakoutRoomReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.EndBreakoutRoomReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { @@ -560,7 +560,7 @@ export class BreakoutRoomRes extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.BreakoutRoomRes'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'status', kind: 'scalar', T: 8 /* ScalarType.BOOL */ }, diff --git a/src/helpers/proto/plugnmeet_common_api_pb.ts b/src/helpers/proto/plugnmeet_common_api_pb.ts index 17be6e48..6f7282b3 100644 --- a/src/helpers/proto/plugnmeet_common_api_pb.ts +++ b/src/helpers/proto/plugnmeet_common_api_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.0.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v1.1.0 with parameter "target=ts,import_extension=.ts" // @generated from file plugnmeet_common_api.proto (package plugnmeet, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -101,7 +101,7 @@ export class CommonResponse extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.CommonResponse'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'status', kind: 'scalar', T: 8 /* ScalarType.BOOL */ }, @@ -151,7 +151,7 @@ export class VerifyTokenReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.VerifyTokenReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { @@ -226,7 +226,7 @@ export class VerifyTokenRes extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.VerifyTokenRes'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'status', kind: 'scalar', T: 8 /* ScalarType.BOOL */ }, @@ -322,7 +322,7 @@ export class MuteUnMuteTrackReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.MuteUnMuteTrackReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'sid', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -401,7 +401,7 @@ export class RemoveParticipantReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.RemoveParticipantReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'sid', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -494,7 +494,7 @@ export class DataMessageReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.DataMessageReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -567,7 +567,7 @@ export class RoomEndAPIReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.RoomEndAPIReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -626,7 +626,7 @@ export class ChangeVisibilityRes extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.ChangeVisibilityRes'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -704,7 +704,7 @@ export class SwitchPresenterReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.SwitchPresenterReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { @@ -786,7 +786,7 @@ export class ExternalMediaPlayerReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.ExternalMediaPlayerReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { @@ -877,7 +877,7 @@ export class ExternalDisplayLinkReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.ExternalDisplayLinkReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { @@ -961,7 +961,7 @@ export class CreateEtherpadSessionRes extends Message proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.CreateEtherpadSessionRes'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'status', kind: 'scalar', T: 8 /* ScalarType.BOOL */ }, @@ -1041,7 +1041,7 @@ export class CleanEtherpadReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.CleanEtherpadReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -1097,7 +1097,7 @@ export class ChangeEtherpadStatusReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.ChangeEtherpadStatusReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -1158,7 +1158,7 @@ export class ApproveWaitingUsersReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.ApproveWaitingUsersReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -1219,7 +1219,7 @@ export class UpdateWaitingRoomMessageReq extends Message [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -1303,7 +1303,7 @@ export class UpdateUserLockSettingsReq extends Message [ { no: 1, name: 'room_sid', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, diff --git a/src/helpers/proto/plugnmeet_datamessage_pb.ts b/src/helpers/proto/plugnmeet_datamessage_pb.ts index 9a96c10a..f975e796 100644 --- a/src/helpers/proto/plugnmeet_datamessage_pb.ts +++ b/src/helpers/proto/plugnmeet_datamessage_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.0.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v1.1.0 with parameter "target=ts,import_extension=.ts" // @generated from file plugnmeet_datamessage.proto (package plugnmeet, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -230,7 +230,7 @@ export class DataMessage extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.DataMessage'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'type', kind: 'enum', T: proto3.getEnumType(DataMsgType) }, @@ -321,7 +321,7 @@ export class DataMsgBody extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.DataMsgBody'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { @@ -408,7 +408,7 @@ export class DataMsgReqFrom extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.DataMsgReqFrom'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'sid', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, diff --git a/src/helpers/proto/plugnmeet_ingress_pb.ts b/src/helpers/proto/plugnmeet_ingress_pb.ts new file mode 100644 index 00000000..c6889a31 --- /dev/null +++ b/src/helpers/proto/plugnmeet_ingress_pb.ts @@ -0,0 +1,170 @@ +// @generated by protoc-gen-es v1.1.0 with parameter "target=ts,import_extension=.ts" +// @generated from file plugnmeet_ingress.proto (package plugnmeet, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from '@bufbuild/protobuf'; +import { Message, proto3 } from '@bufbuild/protobuf'; + +/** + * @generated from enum plugnmeet.IngressInput + */ +export enum IngressInput { + /** + * FILE_INPUT = 1; + * SRT_INPUT = 2; + * URL_INPUT = 3; + * + * @generated from enum value: RTMP_INPUT = 0; + */ + RTMP_INPUT = 0, +} +// Retrieve enum metadata with: proto3.getEnumType(IngressInput) +proto3.util.setEnumType(IngressInput, 'plugnmeet.IngressInput', [ + { no: 0, name: 'RTMP_INPUT' }, +]); + +/** + * @generated from message plugnmeet.CreateIngressReq + */ +export class CreateIngressReq extends Message { + /** + * @generated from field: plugnmeet.IngressInput input_type = 1; + */ + inputType = IngressInput.RTMP_INPUT; + + /** + * @generated from field: string participant_name = 2; + */ + participantName = ''; + + /** + * @generated from field: string room_id = 3; + */ + roomId = ''; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = 'plugnmeet.CreateIngressReq'; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: 'input_type', + kind: 'enum', + T: proto3.getEnumType(IngressInput), + }, + { + no: 2, + name: 'participant_name', + kind: 'scalar', + T: 9 /* ScalarType.STRING */, + }, + { no: 3, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): CreateIngressReq { + return new CreateIngressReq().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): CreateIngressReq { + return new CreateIngressReq().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): CreateIngressReq { + return new CreateIngressReq().fromJsonString(jsonString, options); + } + + static equals( + a: CreateIngressReq | PlainMessage | undefined, + b: CreateIngressReq | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateIngressReq, a, b); + } +} + +/** + * @generated from message plugnmeet.CreateIngressRes + */ +export class CreateIngressRes extends Message { + /** + * @generated from field: bool status = 1; + */ + status = false; + + /** + * @generated from field: string msg = 2; + */ + msg = ''; + + /** + * @generated from field: string url = 3; + */ + url = ''; + + /** + * @generated from field: string stream_key = 4; + */ + streamKey = ''; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = 'plugnmeet.CreateIngressRes'; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: 'status', kind: 'scalar', T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: 'msg', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 3, name: 'url', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + { no: 4, name: 'stream_key', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): CreateIngressRes { + return new CreateIngressRes().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): CreateIngressRes { + return new CreateIngressRes().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): CreateIngressRes { + return new CreateIngressRes().fromJsonString(jsonString, options); + } + + static equals( + a: CreateIngressRes | PlainMessage | undefined, + b: CreateIngressRes | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateIngressRes, a, b); + } +} diff --git a/src/helpers/proto/plugnmeet_polls_pb.ts b/src/helpers/proto/plugnmeet_polls_pb.ts index 522c1aca..551634ec 100644 --- a/src/helpers/proto/plugnmeet_polls_pb.ts +++ b/src/helpers/proto/plugnmeet_polls_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.0.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v1.1.0 with parameter "target=ts,import_extension=.ts" // @generated from file plugnmeet_polls.proto (package plugnmeet, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -47,7 +47,7 @@ export class CreatePollReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.CreatePollReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -111,7 +111,7 @@ export class CreatePollOptions extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.CreatePollOptions'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'id', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ }, @@ -196,7 +196,7 @@ export class PollInfo extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.PollInfo'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -278,7 +278,7 @@ export class SubmitPollResponseReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.SubmitPollResponseReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -346,7 +346,7 @@ export class ClosePollReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.ClosePollReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -407,7 +407,7 @@ export class PollResponsesResultOptions extends Message [ { no: 1, name: 'id', kind: 'scalar', T: 4 /* ScalarType.UINT64 */ }, @@ -474,7 +474,7 @@ export class PollResponsesResult extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.PollResponsesResult'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'question', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -541,7 +541,7 @@ export class PollsStats extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.PollsStats'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { @@ -651,7 +651,7 @@ export class PollResponse extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.PollResponse'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'status', kind: 'scalar', T: 8 /* ScalarType.BOOL */ }, diff --git a/src/helpers/proto/plugnmeet_recorder_pb.ts b/src/helpers/proto/plugnmeet_recorder_pb.ts index cd591d32..6759f33a 100644 --- a/src/helpers/proto/plugnmeet_recorder_pb.ts +++ b/src/helpers/proto/plugnmeet_recorder_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.0.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v1.1.0 with parameter "target=ts,import_extension=.ts" // @generated from file plugnmeet_recorder.proto (package plugnmeet, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -138,7 +138,7 @@ export class PlugNmeetToRecorder extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.PlugNmeetToRecorder'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'from', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -265,7 +265,7 @@ export class RecorderToPlugNmeet extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.RecorderToPlugNmeet'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'from', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -353,7 +353,7 @@ export class FromParentToChild extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.FromParentToChild'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { @@ -440,7 +440,7 @@ export class FromChildToParent extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.FromChildToParent'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { @@ -559,7 +559,7 @@ export class StartRecorderChildArgs extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.StartRecorderChildArgs'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'room_id', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -683,7 +683,7 @@ export class PlugNmeetInfo extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.PlugNmeetInfo'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'host', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, @@ -746,7 +746,7 @@ export class CopyToPath extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.CopyToPath'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: 'main_path', kind: 'scalar', T: 9 /* ScalarType.STRING */ }, diff --git a/src/helpers/proto/plugnmeet_recording_pb.ts b/src/helpers/proto/plugnmeet_recording_pb.ts index 4af618c0..08d68aae 100644 --- a/src/helpers/proto/plugnmeet_recording_pb.ts +++ b/src/helpers/proto/plugnmeet_recording_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.0.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v1.1.0 with parameter "target=ts,import_extension=.ts" // @generated from file plugnmeet_recording.proto (package plugnmeet, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -43,7 +43,7 @@ export class RecordingReq extends Message { proto3.util.initPartial(data, this); } - static readonly runtime = proto3; + static readonly runtime: typeof proto3 = proto3; static readonly typeName = 'plugnmeet.RecordingReq'; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { diff --git a/src/login.html b/src/login.html index 6a0010e2..b2add23e 100644 --- a/src/login.html +++ b/src/login.html @@ -166,6 +166,9 @@
Quick Login
}, display_external_link_features: { is_allow: true, + }, + ingress_features: { + is_allow: true, } }, // default_lock_settings: { diff --git a/src/store/slices/interfaces/session.ts b/src/store/slices/interfaces/session.ts index 4ae0311c..0007cce1 100644 --- a/src/store/slices/interfaces/session.ts +++ b/src/store/slices/interfaces/session.ts @@ -74,6 +74,7 @@ interface IRoomFeatures { waiting_room_features: IWaitingRoomFeatures; breakout_room_features: IBreakoutRoomFeatures; display_external_link_features: IDisplayExternalLinkFeatures; + ingress_features: IIngressFeatures; } export interface IRecordingFeatures { @@ -160,3 +161,10 @@ export interface ICopyright_conf { display: boolean; text: string; } + +export interface IIngressFeatures { + is_allow: boolean; + input_type?: number; + url?: string; + stream_key?: string; +} diff --git a/src/store/slices/sessionSlice.ts b/src/store/slices/sessionSlice.ts index 9465be3c..258baea7 100644 --- a/src/store/slices/sessionSlice.ts +++ b/src/store/slices/sessionSlice.ts @@ -82,6 +82,9 @@ const initialState: ISession = { is_allow: true, is_active: false, }, + ingress_features: { + is_allow: false, + }, }, copyright_conf: { display: true,