mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
settings + stats.
This commit is contained in:
+190
-67
@@ -76,6 +76,37 @@ export interface RoomEntry {
|
||||
*/
|
||||
created?: string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface RoomMember
|
||||
*/
|
||||
export interface RoomMember {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof RoomMember
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof RoomMember
|
||||
*/
|
||||
displayname?: string;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof RoomMember
|
||||
*/
|
||||
admin?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof RoomMember
|
||||
*/
|
||||
muted?: boolean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@@ -161,6 +192,31 @@ export interface RoomSettings {
|
||||
*/
|
||||
audio_pipeline?: string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface RoomStats
|
||||
*/
|
||||
export interface RoomStats {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof RoomStats
|
||||
*/
|
||||
connections?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof RoomStats
|
||||
*/
|
||||
host?: string;
|
||||
/**
|
||||
*
|
||||
* @type {Array<RoomMember>}
|
||||
* @memberof RoomStats
|
||||
*/
|
||||
members?: Array<RoomMember>;
|
||||
}
|
||||
|
||||
/**
|
||||
* RoomsApi - axios parameter creator
|
||||
@@ -202,40 +258,6 @@ export const RoomsApiAxiosParamCreator = function (configuration?: Configuration
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get room settings
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
roomGet: async (roomId: string, options: any = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'roomId' is not null or undefined
|
||||
assertParamExists('roomGet', 'roomId', roomId)
|
||||
const localVarPath = `/api/rooms/{roomId}`
|
||||
.replace(`{${"roomId"}}`, encodeURIComponent(String(roomId)));
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Remove room
|
||||
@@ -295,6 +317,40 @@ export const RoomsApiAxiosParamCreator = function (configuration?: Configuration
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get room settings
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
roomSettings: async (roomId: string, options: any = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'roomId' is not null or undefined
|
||||
assertParamExists('roomSettings', 'roomId', roomId)
|
||||
const localVarPath = `/api/rooms/{roomId}/settings`
|
||||
.replace(`{${"roomId"}}`, encodeURIComponent(String(roomId)));
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
@@ -329,6 +385,40 @@ export const RoomsApiAxiosParamCreator = function (configuration?: Configuration
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get room statistics
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
roomStats: async (roomId: string, options: any = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'roomId' is not null or undefined
|
||||
assertParamExists('roomStats', 'roomId', roomId)
|
||||
const localVarPath = `/api/rooms/{roomId}/stats`
|
||||
.replace(`{${"roomId"}}`, encodeURIComponent(String(roomId)));
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
|
||||
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
@@ -423,17 +513,6 @@ export const RoomsApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.roomCreate(roomSettings, options);
|
||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get room settings
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async roomGet(roomId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RoomSettings>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.roomGet(roomId, options);
|
||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Remove room
|
||||
@@ -456,6 +535,17 @@ export const RoomsApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.roomRestart(roomId, options);
|
||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get room settings
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async roomSettings(roomId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RoomSettings>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.roomSettings(roomId, options);
|
||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Start room
|
||||
@@ -467,6 +557,17 @@ export const RoomsApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.roomStart(roomId, options);
|
||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get room statistics
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async roomStats(roomId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RoomStats>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.roomStats(roomId, options);
|
||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Stop room
|
||||
@@ -508,16 +609,6 @@ export const RoomsApiFactory = function (configuration?: Configuration, basePath
|
||||
roomCreate(roomSettings?: RoomSettings, options?: any): AxiosPromise<RoomEntry> {
|
||||
return localVarFp.roomCreate(roomSettings, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get room settings
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
roomGet(roomId: string, options?: any): AxiosPromise<RoomSettings> {
|
||||
return localVarFp.roomGet(roomId, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Remove room
|
||||
@@ -538,6 +629,16 @@ export const RoomsApiFactory = function (configuration?: Configuration, basePath
|
||||
roomRestart(roomId: string, options?: any): AxiosPromise<void> {
|
||||
return localVarFp.roomRestart(roomId, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get room settings
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
roomSettings(roomId: string, options?: any): AxiosPromise<RoomSettings> {
|
||||
return localVarFp.roomSettings(roomId, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Start room
|
||||
@@ -548,6 +649,16 @@ export const RoomsApiFactory = function (configuration?: Configuration, basePath
|
||||
roomStart(roomId: string, options?: any): AxiosPromise<void> {
|
||||
return localVarFp.roomStart(roomId, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Get room statistics
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
roomStats(roomId: string, options?: any): AxiosPromise<RoomStats> {
|
||||
return localVarFp.roomStats(roomId, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Stop room
|
||||
@@ -589,18 +700,6 @@ export class RoomsApi extends BaseAPI {
|
||||
return RoomsApiFp(this.configuration).roomCreate(roomSettings, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Get room settings
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof RoomsApi
|
||||
*/
|
||||
public roomGet(roomId: string, options?: any) {
|
||||
return RoomsApiFp(this.configuration).roomGet(roomId, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Remove room
|
||||
@@ -625,6 +724,18 @@ export class RoomsApi extends BaseAPI {
|
||||
return RoomsApiFp(this.configuration).roomRestart(roomId, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Get room settings
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof RoomsApi
|
||||
*/
|
||||
public roomSettings(roomId: string, options?: any) {
|
||||
return RoomsApiFp(this.configuration).roomSettings(roomId, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Start room
|
||||
@@ -637,6 +748,18 @@ export class RoomsApi extends BaseAPI {
|
||||
return RoomsApiFp(this.configuration).roomStart(roomId, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Get room statistics
|
||||
* @param {string} roomId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof RoomsApi
|
||||
*/
|
||||
public roomStats(roomId: string, options?: any) {
|
||||
return RoomsApiFp(this.configuration).roomStats(roomId, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Stop room
|
||||
|
||||
@@ -105,7 +105,7 @@ export default class RoomInfo extends Vue {
|
||||
this.loading = true
|
||||
|
||||
try {
|
||||
this.settings = await this.$store.dispatch('ROOMS_GET', roomId)
|
||||
this.settings = await this.$store.dispatch('ROOMS_SETTINGS', roomId)
|
||||
} catch(e) {
|
||||
if (e.response) {
|
||||
this.$swal({
|
||||
|
||||
@@ -4,6 +4,7 @@ import Vuex, { ActionContext } from 'vuex'
|
||||
import {
|
||||
RoomEntry,
|
||||
RoomSettings,
|
||||
RoomStats,
|
||||
RoomsApi,
|
||||
Configuration,
|
||||
} from '@/api/index'
|
||||
@@ -50,14 +51,18 @@ export default new Vuex.Store({
|
||||
commit('ROOMS_ADD', res.data);
|
||||
return res.data
|
||||
},
|
||||
async ROOMS_GET(_: ActionContext<State, State>, roomId: string): Promise<RoomSettings> {
|
||||
const res = await api.roomGet(roomId)
|
||||
return res.data
|
||||
},
|
||||
async ROOMS_REMOVE({ commit }: ActionContext<State, State>, roomId: string) {
|
||||
await api.roomRemove(roomId)
|
||||
commit('ROOMS_DEL', roomId);
|
||||
},
|
||||
async ROOMS_SETTINGS(_: ActionContext<State, State>, roomId: string): Promise<RoomSettings> {
|
||||
const res = await api.roomSettings(roomId)
|
||||
return res.data
|
||||
},
|
||||
async ROOMS_STATS(_: ActionContext<State, State>, roomId: string): Promise<RoomStats> {
|
||||
const res = await api.roomStats(roomId)
|
||||
return res.data
|
||||
},
|
||||
async ROOMS_START({ commit }: ActionContext<State, State>, roomId: string) {
|
||||
await api.roomStart(roomId)
|
||||
commit('ROOMS_PUT', {
|
||||
|
||||
Reference in New Issue
Block a user