mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
Merge branch 'next' into develop
This commit is contained in:
commit
a89c17f2a0
@ -104,6 +104,7 @@ export class Application {
|
||||
maintained = false;
|
||||
maintaining = false;
|
||||
error = null;
|
||||
hasLoadError = false;
|
||||
|
||||
private wsAuthorized = false;
|
||||
|
||||
@ -302,6 +303,7 @@ export class Application {
|
||||
await this.loadWebSocket();
|
||||
await this.pm.load();
|
||||
} catch (error) {
|
||||
this.hasLoadError = true;
|
||||
if (this.ws.enabled) {
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(() => resolve(null), 1000);
|
||||
@ -342,16 +344,21 @@ export class Application {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.type === 'notification') {
|
||||
this.notification[data.payload?.type || 'info']({ message: data.payload?.message });
|
||||
return;
|
||||
}
|
||||
const maintaining = data.type === 'maintaining' && data.payload.code !== 'APP_RUNNING';
|
||||
|
||||
const maintaining = data.type === 'maintaining' && data.payload.code !== 'APP_RUNNING';
|
||||
if (maintaining) {
|
||||
this.setMaintaining(true);
|
||||
this.error = data.payload;
|
||||
} else {
|
||||
if (this.hasLoadError) {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
this.setMaintaining(false);
|
||||
this.maintained = true;
|
||||
this.error = null;
|
||||
|
@ -187,31 +187,31 @@ export class WSServer extends EventEmitter {
|
||||
AppSupervisor.getInstance().bootStrapApp(handleAppName);
|
||||
}
|
||||
|
||||
const appStatus = AppSupervisor.getInstance().getAppStatus(handleAppName, 'initializing');
|
||||
// const appStatus = AppSupervisor.getInstance().getAppStatus(handleAppName, 'initializing');
|
||||
|
||||
if (appStatus === 'not_found') {
|
||||
this.sendMessageToConnection(client, {
|
||||
type: 'maintaining',
|
||||
payload: getPayloadByErrorCode('APP_NOT_FOUND', { appName: handleAppName }),
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if (appStatus === 'not_found') {
|
||||
// this.sendMessageToConnection(client, {
|
||||
// type: 'maintaining',
|
||||
// payload: getPayloadByErrorCode('APP_NOT_FOUND', { appName: handleAppName }),
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (appStatus === 'initializing') {
|
||||
this.sendMessageToConnection(client, {
|
||||
type: 'maintaining',
|
||||
payload: getPayloadByErrorCode('APP_INITIALIZING', { appName: handleAppName }),
|
||||
});
|
||||
// if (appStatus === 'initializing') {
|
||||
// this.sendMessageToConnection(client, {
|
||||
// type: 'maintaining',
|
||||
// payload: getPayloadByErrorCode('APP_INITIALIZING', { appName: handleAppName }),
|
||||
// });
|
||||
|
||||
return;
|
||||
}
|
||||
// return;
|
||||
// }
|
||||
|
||||
const app = await AppSupervisor.getInstance().getApp(handleAppName);
|
||||
|
||||
this.sendMessageToConnection(client, {
|
||||
type: 'maintaining',
|
||||
payload: getPayloadByErrorCode(appStatus, { app }),
|
||||
});
|
||||
// const app = await AppSupervisor.getInstance().getApp(handleAppName);
|
||||
//
|
||||
// this.sendMessageToConnection(client, {
|
||||
// type: 'maintaining',
|
||||
// payload: getPayloadByErrorCode(appStatus, { app }),
|
||||
// });
|
||||
}
|
||||
|
||||
removeConnection(id: string) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user