mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 03:01:16 +00:00
refactor: remove redundant monitor files
This commit is contained in:
parent
8f237b1089
commit
2022308e21
@ -1,5 +1,4 @@
|
|||||||
export * from './get-public-path';
|
export * from './get-public-path';
|
||||||
export * from './monitor';
|
|
||||||
export * from './obx';
|
export * from './obx';
|
||||||
export * from './request';
|
export * from './request';
|
||||||
export * from './focus-tracker';
|
export * from './focus-tracker';
|
||||||
|
|||||||
@ -1,42 +0,0 @@
|
|||||||
export class Monitor {
|
|
||||||
fn = (params: any) => {
|
|
||||||
const { AES = {} } = window as any;
|
|
||||||
if (typeof AES.log === 'function') {
|
|
||||||
const { p1 = '', p2 = '', p3 = '', p4 = 'OTHER', ...rest } = params || {};
|
|
||||||
AES.log('event', {
|
|
||||||
p1,
|
|
||||||
p2,
|
|
||||||
p3,
|
|
||||||
p4,
|
|
||||||
...rest,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
register(fn: () => any) {
|
|
||||||
if (typeof fn === 'function') {
|
|
||||||
this.fn = fn;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
log(params: any) {
|
|
||||||
if (typeof this.fn === 'function') {
|
|
||||||
this.fn(params);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setConfig(key: string | object, value?: string): void {
|
|
||||||
const { AES = {} } = window as any;
|
|
||||||
if (typeof AES?.setConfig !== 'function') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (typeof key === 'string' && value) {
|
|
||||||
AES.setConfig(key, value);
|
|
||||||
} else if (typeof key === 'object') {
|
|
||||||
AES.setConfig(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const monitor = new Monitor();
|
|
||||||
export { monitor };
|
|
||||||
Loading…
x
Reference in New Issue
Block a user