@viasoftbr/shared-ui 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/RemoteModule.d.ts +8 -0
- package/dist/components/display/Accordion.d.ts +8 -0
- package/dist/components/display/Section.d.ts +19 -0
- package/dist/components/display/Skeleton.d.ts +21 -0
- package/dist/components/display/index.d.ts +4 -0
- package/dist/components/encoder/DvB.d.ts +53 -0
- package/dist/components/encoder/Livecast.d.ts +37 -0
- package/dist/components/encoder/ViewLog.d.ts +5 -0
- package/dist/components/encoder/index.d.ts +4 -0
- package/dist/components/general/Copy2Clipboard.d.ts +4 -0
- package/dist/components/general/GridSelectionModal.d.ts +24 -0
- package/dist/components/general/Modal.d.ts +17 -0
- package/dist/components/general/Validation.d.ts +6 -0
- package/dist/components/general/index.d.ts +5 -0
- package/dist/components/groups/AudioGroup.d.ts +26 -0
- package/dist/components/groups/FilterGroup.d.ts +3 -0
- package/dist/components/groups/Middleware/Auth.d.ts +14 -0
- package/dist/components/groups/Middleware/Channels.d.ts +26 -0
- package/dist/components/groups/Middleware/MOS.d.ts +24 -0
- package/dist/components/groups/Middleware/Service.d.ts +16 -0
- package/dist/components/groups/Middleware/index.d.ts +5 -0
- package/dist/components/groups/PreviewGroup.d.ts +3 -0
- package/dist/components/groups/ProtocolGroup.d.ts +10 -0
- package/dist/components/groups/VideoGroup.d.ts +3 -0
- package/dist/components/groups/index.d.ts +7 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/input/CheckboxField.d.ts +9 -0
- package/dist/components/input/ColorField.d.ts +9 -0
- package/dist/components/input/DatePicker.d.ts +12 -0
- package/dist/components/input/EditInPlaceField.d.ts +7 -0
- package/dist/components/input/InputField.d.ts +15 -0
- package/dist/components/input/Protocol.d.ts +10 -0
- package/dist/components/input/RangeField.d.ts +13 -0
- package/dist/components/input/SelectField.d.ts +13 -0
- package/dist/components/input/SliderField.d.ts +15 -0
- package/dist/components/input/SwitchField.d.ts +11 -0
- package/dist/components/input/index.d.ts +11 -0
- package/dist/components/main/Footer.d.ts +2 -0
- package/dist/components/main/Header.d.ts +7 -0
- package/dist/components/main/PageHeader.d.ts +14 -0
- package/dist/components/main/SaveDiscard.d.ts +13 -0
- package/dist/components/main/Sidebar.d.ts +10 -0
- package/dist/components/main/index.d.ts +6 -0
- package/dist/components/network/AddNetwork.d.ts +6 -0
- package/dist/components/network/InterfacesTable.d.ts +19 -0
- package/dist/components/network/InterfacesTimeseries.d.ts +21 -0
- package/dist/components/network/index.d.ts +4 -0
- package/dist/components/network/validators.d.ts +7 -0
- package/dist/components/system/RequireAuth.d.ts +8 -0
- package/dist/components/system/Wizard.d.ts +6 -0
- package/dist/components/system/index.d.ts +3 -0
- package/dist/components/xcoder/Fflog.d.ts +5 -0
- package/dist/components/xcoder/LiveLog.d.ts +5 -0
- package/dist/components/xcoder/Metrics.d.ts +8 -0
- package/dist/components/xcoder/Panel.d.ts +6 -0
- package/dist/components/xcoder/Preview.d.ts +11 -0
- package/dist/components/xcoder/StreamControl.d.ts +5 -0
- package/dist/components/xcoder/VUMeter.d.ts +8 -0
- package/dist/components/xcoder/VideoPlayer.d.ts +13 -0
- package/dist/components/xcoder/index.d.ts +8 -0
- package/dist/components.js +182 -117
- package/dist/context/AuthContext.d.ts +17 -0
- package/dist/context/ThemeContext.d.ts +11 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context.js +25 -9
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useApi.d.ts +1 -0
- package/dist/hooks/useAvailableSubservices.d.ts +13 -0
- package/dist/hooks/useSettings.d.ts +45 -0
- package/dist/hooks.js +25 -9
- package/dist/i18n.d.ts +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +55897 -0
- package/dist/services/api.d.ts +23 -0
- package/dist/services/auth.d.ts +15 -0
- package/dist/services/discovery.d.ts +12 -0
- package/dist/services/hostConfig.d.ts +20 -0
- package/dist/services/index.d.ts +9 -0
- package/dist/services/loadRemoteModule.d.ts +9 -0
- package/dist/services/metadataLoader.d.ts +9 -0
- package/dist/services/registry.d.ts +42 -0
- package/dist/services/users.d.ts +18 -0
- package/dist/services/wizard.d.ts +3 -0
- package/dist/services.js +61 -26
- package/dist/types/alarm.d.ts +21 -0
- package/dist/types/auth.d.ts +18 -0
- package/dist/types/group.d.ts +32 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/module.d.ts +13 -0
- package/dist/types/plugin.types.d.ts +30 -0
- package/dist/types/protocol.d.ts +12 -0
- package/dist/types/websocket.d.ts +27 -0
- package/dist/types/wizard.d.ts +12 -0
- package/package.json +17 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ProtocolSettings } from '../types/protocol';
|
|
2
|
+
export declare const api: import("axios").AxiosInstance;
|
|
3
|
+
export declare const authApi: import("axios").AxiosInstance;
|
|
4
|
+
export declare function getAccessToken(): string | null;
|
|
5
|
+
export declare function setAccessToken(token: string | null): void;
|
|
6
|
+
export declare function getRefreshToken(): string | null;
|
|
7
|
+
export declare function setRefreshToken(token: string | null): void;
|
|
8
|
+
export declare function clearTokens(): void;
|
|
9
|
+
export declare const fetchApi: {
|
|
10
|
+
getJson: <T>(path: string, params?: Record<string, any>, headers?: Record<string, string>) => Promise<T>;
|
|
11
|
+
getText: (path: string, params?: Record<string, any>, headers?: Record<string, string>) => Promise<string>;
|
|
12
|
+
getVoid: (path: string, params?: Record<string, any>, headers?: Record<string, string>) => Promise<void>;
|
|
13
|
+
postJson: <T>(path: string, payload?: any, headers?: Record<string, string>) => Promise<T>;
|
|
14
|
+
patchJson: <T>(path: string, payload?: any, headers?: Record<string, string>) => Promise<T>;
|
|
15
|
+
putJson: <T>(path: string, payload?: any, headers?: Record<string, string>) => Promise<T>;
|
|
16
|
+
deleteJson: <T>(path: string, headers?: Record<string, string>) => Promise<T>;
|
|
17
|
+
deleteVoid: (path: string, headers?: Record<string, string>) => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
export declare const serverOrigin: string;
|
|
20
|
+
export declare function buildWsUrl(path?: string): string;
|
|
21
|
+
export declare function encodeFfurl(settings: ProtocolSettings): Promise<string>;
|
|
22
|
+
export declare function decodeFfurl(ffurl: string): Promise<ProtocolSettings>;
|
|
23
|
+
export declare function subscribeToWebsocket(url: string, onMessage: (data: any) => void): () => void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { User } from '../types';
|
|
2
|
+
interface LoginResponse {
|
|
3
|
+
accessToken: string;
|
|
4
|
+
refreshToken: string;
|
|
5
|
+
user: User;
|
|
6
|
+
}
|
|
7
|
+
export declare const authService: {
|
|
8
|
+
login: (username: string, password: string) => Promise<LoginResponse>;
|
|
9
|
+
refresh: () => Promise<{
|
|
10
|
+
accessToken: string;
|
|
11
|
+
refreshToken: string;
|
|
12
|
+
}>;
|
|
13
|
+
logout: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discovery helpers for service availability.
|
|
3
|
+
* Calls the backend endpoint that lists available subservices.
|
|
4
|
+
*/
|
|
5
|
+
export declare const discoveryService: {
|
|
6
|
+
/**
|
|
7
|
+
* GET /services/available (authenticated)
|
|
8
|
+
* Returns whatever the backend provides about available services/subservices.
|
|
9
|
+
*/
|
|
10
|
+
available: () => Promise<any>;
|
|
11
|
+
};
|
|
12
|
+
export default discoveryService;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface HostStaticRoute {
|
|
2
|
+
path: string;
|
|
3
|
+
pageId?: string;
|
|
4
|
+
public?: boolean;
|
|
5
|
+
level?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface HostConfig {
|
|
8
|
+
version?: string;
|
|
9
|
+
pluginsManifestUrl?: string;
|
|
10
|
+
defaultRoute?: string;
|
|
11
|
+
staticRoutes?: HostStaticRoute[];
|
|
12
|
+
features?: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
declare class HostConfigLoader {
|
|
15
|
+
private cache?;
|
|
16
|
+
loadHostConfig(url?: string): Promise<HostConfig>;
|
|
17
|
+
clearCache(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare const hostConfigLoader: HostConfigLoader;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './api';
|
|
2
|
+
export * from './auth';
|
|
3
|
+
export * from './loadRemoteModule';
|
|
4
|
+
export * from './metadataLoader';
|
|
5
|
+
export * from './registry';
|
|
6
|
+
export * from './hostConfig';
|
|
7
|
+
export * from './users';
|
|
8
|
+
export * from './wizard';
|
|
9
|
+
export * from './discovery';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
declare global {
|
|
3
|
+
var __federation_shared__: Record<string, Record<string, unknown>>;
|
|
4
|
+
}
|
|
5
|
+
export declare function loadRemoteModule(config: {
|
|
6
|
+
scope: string;
|
|
7
|
+
url: string;
|
|
8
|
+
module: string;
|
|
9
|
+
}): Promise<ComponentType>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PageMetadata } from "../types/plugin.types";
|
|
2
|
+
export declare class MetadataLoader {
|
|
3
|
+
private metadataCache;
|
|
4
|
+
loadMetadata(metadataUrl: string): Promise<PageMetadata[]>;
|
|
5
|
+
loadFromDirectory(directoryUrl: string): Promise<PageMetadata[]>;
|
|
6
|
+
clearCache(): void;
|
|
7
|
+
getCachedMetadata(metadataUrl: string): PageMetadata[] | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare const metadataLoader: MetadataLoader;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export type RouteLevel = 'readonly' | 'operator' | 'admin' | 'public';
|
|
3
|
+
export interface RouteConfig {
|
|
4
|
+
path: string;
|
|
5
|
+
componentName?: string;
|
|
6
|
+
pageId?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
level?: RouteLevel;
|
|
9
|
+
}
|
|
10
|
+
export interface PageConfig {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
path: string;
|
|
14
|
+
component: React.ComponentType<any>;
|
|
15
|
+
icon?: React.ComponentType<any> | React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export interface PluginRegistry {
|
|
18
|
+
registerComponent(name: string, component: React.ComponentType): void;
|
|
19
|
+
getComponent(name: string): React.ComponentType | undefined;
|
|
20
|
+
registerService<T = any>(name: string, service: T): void;
|
|
21
|
+
getService<T = any>(name: string): T | undefined;
|
|
22
|
+
registerRoute(route: RouteConfig): void;
|
|
23
|
+
getRoutes(): RouteConfig[];
|
|
24
|
+
registerPage(page: PageConfig): void;
|
|
25
|
+
getPages(): PageConfig[];
|
|
26
|
+
}
|
|
27
|
+
declare class PluginRegistryImpl implements PluginRegistry {
|
|
28
|
+
private components;
|
|
29
|
+
private services;
|
|
30
|
+
private routes;
|
|
31
|
+
private pages;
|
|
32
|
+
registerComponent(name: string, component: React.ComponentType): void;
|
|
33
|
+
getComponent(name: string): React.ComponentType<{}> | undefined;
|
|
34
|
+
registerService<T = any>(name: string, service: T): void;
|
|
35
|
+
getService<T = any>(name: string): T | undefined;
|
|
36
|
+
registerRoute(route: RouteConfig): void;
|
|
37
|
+
getRoutes(): RouteConfig[];
|
|
38
|
+
registerPage(page: PageConfig): void;
|
|
39
|
+
getPages(): PageConfig[];
|
|
40
|
+
}
|
|
41
|
+
export declare const registry: PluginRegistryImpl;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Role, User } from '../types';
|
|
2
|
+
export declare const userService: {
|
|
3
|
+
list: () => Promise<User[]>;
|
|
4
|
+
getById: (id: string) => Promise<User>;
|
|
5
|
+
create: (payload: {
|
|
6
|
+
name?: string;
|
|
7
|
+
username: string;
|
|
8
|
+
password: string;
|
|
9
|
+
role?: Role;
|
|
10
|
+
}) => Promise<User>;
|
|
11
|
+
update: (id: string, payload: Partial<{
|
|
12
|
+
name: string;
|
|
13
|
+
username: string;
|
|
14
|
+
password: string;
|
|
15
|
+
role: Role;
|
|
16
|
+
}>) => Promise<User>;
|
|
17
|
+
delete: (id: string) => Promise<void>;
|
|
18
|
+
};
|
package/dist/services.js
CHANGED
|
@@ -2640,19 +2640,36 @@ var {
|
|
|
2640
2640
|
} = axios_default;
|
|
2641
2641
|
|
|
2642
2642
|
// src/services/api.ts
|
|
2643
|
-
var
|
|
2644
|
-
if (
|
|
2645
|
-
return
|
|
2643
|
+
var normalizeOrigin = (raw) => {
|
|
2644
|
+
if (!raw)
|
|
2645
|
+
return "";
|
|
2646
|
+
if (/^https?:\/\//i.test(raw) || /^wss?:\/\//i.test(raw))
|
|
2647
|
+
return raw.replace(/\/$/, "");
|
|
2648
|
+
return `http://${raw.replace(/\/$/, "")}`;
|
|
2649
|
+
};
|
|
2650
|
+
var getApiOrigin = () => {
|
|
2651
|
+
try {
|
|
2652
|
+
if (typeof import.meta !== "undefined" && import.meta.env?.VITE_API_BASE_URL) {
|
|
2653
|
+
return normalizeOrigin(import.meta.env.VITE_API_BASE_URL);
|
|
2654
|
+
}
|
|
2655
|
+
} catch (e) {
|
|
2646
2656
|
}
|
|
2647
|
-
|
|
2657
|
+
if (typeof window !== "undefined") {
|
|
2658
|
+
const win = window;
|
|
2659
|
+
if (win.__VIASOFT_API_BASE_URL)
|
|
2660
|
+
return normalizeOrigin(win.__VIASOFT_API_BASE_URL);
|
|
2661
|
+
if (window.location && window.location.origin)
|
|
2662
|
+
return window.location.origin.replace(/\/$/, "");
|
|
2663
|
+
}
|
|
2664
|
+
return "http://localhost:3000";
|
|
2648
2665
|
};
|
|
2649
|
-
var
|
|
2666
|
+
var apiOrigin = getApiOrigin();
|
|
2650
2667
|
var api = axios_default.create({
|
|
2651
|
-
baseURL:
|
|
2668
|
+
baseURL: apiOrigin,
|
|
2652
2669
|
timeout: 1e4
|
|
2653
2670
|
});
|
|
2654
2671
|
var authApi = axios_default.create({
|
|
2655
|
-
baseURL:
|
|
2672
|
+
baseURL: apiOrigin,
|
|
2656
2673
|
timeout: 1e4
|
|
2657
2674
|
});
|
|
2658
2675
|
function getAccessToken() {
|
|
@@ -2816,7 +2833,7 @@ var fetchApi = {
|
|
|
2816
2833
|
}
|
|
2817
2834
|
}
|
|
2818
2835
|
};
|
|
2819
|
-
var serverOrigin =
|
|
2836
|
+
var serverOrigin = apiOrigin;
|
|
2820
2837
|
function buildWsUrl(path = "/") {
|
|
2821
2838
|
try {
|
|
2822
2839
|
const origin2 = new URL(serverOrigin);
|
|
@@ -2826,8 +2843,9 @@ function buildWsUrl(path = "/") {
|
|
|
2826
2843
|
origin2.pathname = path;
|
|
2827
2844
|
return origin2.toString();
|
|
2828
2845
|
} catch (e) {
|
|
2829
|
-
const proto =
|
|
2830
|
-
|
|
2846
|
+
const proto = apiOrigin.startsWith("https") ? "wss" : "ws";
|
|
2847
|
+
const host = apiOrigin.replace(/^https?:\/\//, "").replace(/\/$/, "");
|
|
2848
|
+
return `${proto}://${host}${path.startsWith("/") ? path : "/" + path}`;
|
|
2831
2849
|
}
|
|
2832
2850
|
}
|
|
2833
2851
|
async function encodeFfurl(settings) {
|
|
@@ -2893,7 +2911,6 @@ var authService = {
|
|
|
2893
2911
|
// src/services/loadRemoteModule.ts
|
|
2894
2912
|
import * as React from "react";
|
|
2895
2913
|
import * as ReactDOM from "react-dom";
|
|
2896
|
-
var loadedContainers = /* @__PURE__ */ new Map();
|
|
2897
2914
|
var sharedScopeInitialized = false;
|
|
2898
2915
|
function getSharedScope() {
|
|
2899
2916
|
if (!globalThis.__federation_shared__) {
|
|
@@ -2920,28 +2937,46 @@ function getSharedScope() {
|
|
|
2920
2937
|
}
|
|
2921
2938
|
return globalThis.__federation_shared__;
|
|
2922
2939
|
}
|
|
2940
|
+
var loadedContainers = /* @__PURE__ */ new Map();
|
|
2941
|
+
var initializedContainers = /* @__PURE__ */ new Set();
|
|
2923
2942
|
async function loadContainer(url) {
|
|
2924
2943
|
if (loadedContainers.has(url)) {
|
|
2925
|
-
|
|
2926
|
-
if (cached)
|
|
2927
|
-
return cached;
|
|
2944
|
+
return loadedContainers.get(url);
|
|
2928
2945
|
}
|
|
2929
|
-
const
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2946
|
+
const loadPromise = (async () => {
|
|
2947
|
+
try {
|
|
2948
|
+
const container = await import(
|
|
2949
|
+
/* @vite-ignore */
|
|
2950
|
+
url
|
|
2951
|
+
);
|
|
2952
|
+
if (container.init && !initializedContainers.has(url)) {
|
|
2953
|
+
await container.init(getSharedScope());
|
|
2954
|
+
initializedContainers.add(url);
|
|
2955
|
+
}
|
|
2956
|
+
return container;
|
|
2957
|
+
} catch (error) {
|
|
2958
|
+
loadedContainers.delete(url);
|
|
2959
|
+
initializedContainers.delete(url);
|
|
2960
|
+
throw error;
|
|
2961
|
+
}
|
|
2962
|
+
})();
|
|
2963
|
+
loadedContainers.set(url, loadPromise);
|
|
2964
|
+
return loadPromise;
|
|
2935
2965
|
}
|
|
2936
2966
|
async function loadRemoteModule(config) {
|
|
2937
2967
|
const container = await loadContainer(config.url);
|
|
2938
|
-
if (!container || typeof container.
|
|
2939
|
-
throw new Error(`Container inv\xE1lido: ${config.scope}`);
|
|
2968
|
+
if (!container || typeof container.get !== "function") {
|
|
2969
|
+
throw new Error(`Container inv\xE1lido ou sem m\xE9todo get: ${config.scope}`);
|
|
2970
|
+
}
|
|
2971
|
+
if (typeof container.dynamicLoadingCss === "function") {
|
|
2972
|
+
try {
|
|
2973
|
+
await container.dynamicLoadingCss([]);
|
|
2974
|
+
} catch (err) {
|
|
2975
|
+
console.warn(`Aviso: Falha ao carregar CSS global do remote ${config.scope}`, err);
|
|
2976
|
+
}
|
|
2940
2977
|
}
|
|
2941
|
-
const shareScope = getSharedScope();
|
|
2942
|
-
container.init(shareScope);
|
|
2943
2978
|
const factory2 = await container.get(config.module);
|
|
2944
|
-
const moduleExports = factory2();
|
|
2979
|
+
const moduleExports = await factory2();
|
|
2945
2980
|
if (moduleExports && typeof moduleExports === "object" && "default" in moduleExports) {
|
|
2946
2981
|
return moduleExports.default;
|
|
2947
2982
|
}
|
|
@@ -2975,7 +3010,7 @@ var MetadataLoader = class {
|
|
|
2975
3010
|
);
|
|
2976
3011
|
}
|
|
2977
3012
|
metadata.forEach((page, index) => {
|
|
2978
|
-
if (!page.id || !page.name || !page.path || !page.
|
|
3013
|
+
if (!page.id || !page.name || !page.path || !page.url) {
|
|
2979
3014
|
throw new Error(
|
|
2980
3015
|
`Invalid page metadata at index ${index}: missing required fields`
|
|
2981
3016
|
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type AlarmType = "critical" | "warning";
|
|
2
|
+
export interface Alarm {
|
|
3
|
+
status: AlarmType;
|
|
4
|
+
code: string;
|
|
5
|
+
details: string;
|
|
6
|
+
alias: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface GetAlarmsResponse {
|
|
10
|
+
alarms: Alarm[];
|
|
11
|
+
}
|
|
12
|
+
export type AlarmAction = "activate" | "deactivate";
|
|
13
|
+
export interface ManageAlarmRequest {
|
|
14
|
+
code: string;
|
|
15
|
+
action: AlarmAction;
|
|
16
|
+
}
|
|
17
|
+
export interface ManageAlarmResponse {
|
|
18
|
+
message: string;
|
|
19
|
+
code: string;
|
|
20
|
+
action: AlarmAction;
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare enum Role {
|
|
2
|
+
Admin = "admin",
|
|
3
|
+
Operator = "operator",
|
|
4
|
+
SuperAdmin = "superadmin",
|
|
5
|
+
ReadOnly = "readonly"
|
|
6
|
+
}
|
|
7
|
+
export interface JwtPayload {
|
|
8
|
+
sub: string;
|
|
9
|
+
exp: number;
|
|
10
|
+
iat: number;
|
|
11
|
+
roles: Role[];
|
|
12
|
+
}
|
|
13
|
+
export interface User {
|
|
14
|
+
id: string;
|
|
15
|
+
username: string;
|
|
16
|
+
role: Role;
|
|
17
|
+
name?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
interface GroupProps {
|
|
2
|
+
expanded: boolean;
|
|
3
|
+
onToggle: (section: string) => void;
|
|
4
|
+
available?: string[];
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
title?: string;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface AudioProps {
|
|
10
|
+
audioSource: 'SDI' | 'USB';
|
|
11
|
+
audioCodec: 'aac' | 'he_aac' | 'he_aac_v2';
|
|
12
|
+
audioBitrate: string;
|
|
13
|
+
audioSampleRate: "24kHz" | "48kHz" | "96kHz" | "192kHz";
|
|
14
|
+
audioChannels: "stero" | "monol" | "monor";
|
|
15
|
+
}
|
|
16
|
+
interface FilterProps {
|
|
17
|
+
inputVideoFilter: string;
|
|
18
|
+
resizeVideo: string;
|
|
19
|
+
videoFps: string;
|
|
20
|
+
}
|
|
21
|
+
interface PreviewProps {
|
|
22
|
+
enablePreviewWeb: boolean;
|
|
23
|
+
enablePreviewLcd: string;
|
|
24
|
+
enablePreviewHdmi: string;
|
|
25
|
+
}
|
|
26
|
+
interface VideoProps {
|
|
27
|
+
videoConnection: string;
|
|
28
|
+
noLockedMode: 'black' | 'colorbar';
|
|
29
|
+
videoFormat: string;
|
|
30
|
+
videoCodec: 'mpeg2' | 'h264' | 'hevc' | 'hevc_qsv';
|
|
31
|
+
videoBitrate: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface PageMetadata {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
path: string;
|
|
6
|
+
url: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
group?: string;
|
|
9
|
+
version?: string;
|
|
10
|
+
author?: string;
|
|
11
|
+
dependencies?: string[];
|
|
12
|
+
componentName?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface DynamicPageComponent {
|
|
15
|
+
default: React.ComponentType<Record<string, unknown>>;
|
|
16
|
+
metadata?: Partial<PageMetadata>;
|
|
17
|
+
}
|
|
18
|
+
export interface PageRegistry {
|
|
19
|
+
[pageId: string]: {
|
|
20
|
+
metadata: PageMetadata;
|
|
21
|
+
component: React.ComponentType<Record<string, unknown>>;
|
|
22
|
+
loaded: boolean;
|
|
23
|
+
loadPromise?: Promise<DynamicPageComponent>;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface PluginLoader {
|
|
27
|
+
loadPlugin(metadata: PageMetadata): Promise<DynamicPageComponent>;
|
|
28
|
+
getLoadedPlugins(): PageRegistry;
|
|
29
|
+
unloadPlugin(pageId: string): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface XcoderService {
|
|
2
|
+
status: "idle" | "stoped" | "waiting_signal" | "running";
|
|
3
|
+
mode: "input" | "output";
|
|
4
|
+
sdiFormat: string;
|
|
5
|
+
log: string;
|
|
6
|
+
decklinkEvents: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SystemInfo {
|
|
10
|
+
uptime: number;
|
|
11
|
+
loadAverage: number[];
|
|
12
|
+
memoryTotal: number;
|
|
13
|
+
memoryFree: number;
|
|
14
|
+
memoryUsed: number;
|
|
15
|
+
swapTotal: number;
|
|
16
|
+
swapFree: number;
|
|
17
|
+
swapUsed: number;
|
|
18
|
+
dmesg: string;
|
|
19
|
+
cpuTemperature: number;
|
|
20
|
+
cpuClockSpeed: number;
|
|
21
|
+
}
|
|
22
|
+
export interface WebSocketData {
|
|
23
|
+
services: {
|
|
24
|
+
[key: string]: XcoderService;
|
|
25
|
+
};
|
|
26
|
+
system: SystemInfo;
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viasoftbr/shared-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Shared frontend utilities, components and i18n for Viasoft plugins and micro-frontends",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,6 +10,22 @@
|
|
|
10
10
|
"import": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts"
|
|
12
12
|
},
|
|
13
|
+
"./index": {
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./context": {
|
|
18
|
+
"import": "./dist/context.js",
|
|
19
|
+
"types": "./dist/context.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./components": {
|
|
22
|
+
"import": "./dist/components.js",
|
|
23
|
+
"types": "./dist/components.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./types": {
|
|
26
|
+
"import": "./dist/types.js",
|
|
27
|
+
"types": "./dist/types.d.ts"
|
|
28
|
+
},
|
|
13
29
|
"./i18n": {
|
|
14
30
|
"import": "./dist/i18n.js",
|
|
15
31
|
"types": "./dist/i18n.d.ts"
|