fix: 修复NapCat发布门禁阻断
This commit is contained in:
parent
a02f6a4250
commit
98e694d8e9
@ -1,4 +1,4 @@
|
||||
ARG NAPCAT_BASE_IMAGE=mlikiowa/napcat-docker:latest
|
||||
ARG NAPCAT_BASE_IMAGE=
|
||||
FROM ${NAPCAT_BASE_IMAGE}
|
||||
|
||||
USER root
|
||||
|
||||
@ -28,8 +28,8 @@ import type {
|
||||
QqbotAccountAbilityType,
|
||||
QqbotAccountListItem,
|
||||
QqbotConnectionRole,
|
||||
QqbotNapcatContainerStatus,
|
||||
QqbotNapcatWebuiStatus,
|
||||
QqbotRuntimeContainerStatus,
|
||||
} from '../../contract/qqbot.types';
|
||||
|
||||
const INSECURE_ACCOUNT_SECRET_VALUES = new Set([
|
||||
@ -668,7 +668,7 @@ export class QqbotAccountService {
|
||||
*/
|
||||
private toPersistedContainerStatus(
|
||||
napcat?: null | QqbotAccountListItem['napcat'],
|
||||
): QqbotNapcatContainerStatus {
|
||||
): QqbotRuntimeContainerStatus {
|
||||
if (napcat?.containerStatus) return napcat.containerStatus;
|
||||
if (napcat?.containerOnline) return 'running';
|
||||
return 'unknown';
|
||||
|
||||
@ -72,13 +72,15 @@ export type QqbotMessageDirection = 'inbound' | 'outbound';
|
||||
|
||||
export type QqbotMessageType = 'channel' | 'group' | 'private';
|
||||
|
||||
export type QqbotNapcatContainerStatus =
|
||||
export type QqbotRuntimeContainerStatus =
|
||||
| 'creating'
|
||||
| 'error'
|
||||
| 'running'
|
||||
| 'stopped'
|
||||
| 'unknown';
|
||||
|
||||
export type QqbotNapcatContainerStatus = QqbotRuntimeContainerStatus;
|
||||
|
||||
export type QqbotAccountNapcatBindStatus = 'bound' | 'disabled' | 'pending';
|
||||
|
||||
export type QqbotNapcatWebuiStatus = 'offline' | 'online' | 'unknown';
|
||||
@ -106,7 +108,7 @@ export type QqbotAccountNapcatRuntimeInfo = {
|
||||
containerId?: string;
|
||||
containerName?: string;
|
||||
containerOnline?: boolean;
|
||||
containerStatus?: QqbotNapcatContainerStatus;
|
||||
containerStatus?: QqbotRuntimeContainerStatus;
|
||||
profileStatus?: 'drift' | 'failed' | 'ok' | 'unknown';
|
||||
recoveryState?: 'idle' | 'password' | 'quick' | 'suspended';
|
||||
riskMode?: 'cooldown' | 'manual_only' | 'normal';
|
||||
|
||||
@ -10,9 +10,9 @@ import type {
|
||||
QqbotConnectionMode,
|
||||
QqbotConnectionRole,
|
||||
QqbotConnectionStatus,
|
||||
QqbotNapcatContainerStatus,
|
||||
QqbotNapcatRuntimeLoginStatus,
|
||||
QqbotNapcatWebuiStatus,
|
||||
QqbotRuntimeContainerStatus,
|
||||
} from '../../../contract/qqbot.types';
|
||||
|
||||
@Entity('qqbot_account')
|
||||
@ -48,7 +48,7 @@ export class QqbotAccount {
|
||||
oneBotStatus: QqbotConnectionStatus;
|
||||
|
||||
@Column({ default: 'unknown', length: 32, name: 'container_status' })
|
||||
containerStatus: QqbotNapcatContainerStatus;
|
||||
containerStatus: QqbotRuntimeContainerStatus;
|
||||
|
||||
@Column({ default: 'unknown', length: 32, name: 'webui_status' })
|
||||
webuiStatus: QqbotNapcatWebuiStatus;
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
KtDateTimeColumn,
|
||||
KtUpdateDateColumn,
|
||||
} from '@/common';
|
||||
import type { QqbotNapcatContainerStatus } from '@/modules/qqbot/core/contract/qqbot.types';
|
||||
import type { QqbotRuntimeContainerStatus } from '@/modules/qqbot/core/contract/qqbot.types';
|
||||
|
||||
@Entity('napcat_container')
|
||||
@Index('uk_napcat_container_name', ['name'], { unique: true })
|
||||
@ -47,7 +47,7 @@ export class NapcatContainer {
|
||||
reverseWsUrl: string;
|
||||
|
||||
@Column({ default: 'creating', length: 32 })
|
||||
status: QqbotNapcatContainerStatus;
|
||||
status: QqbotRuntimeContainerStatus;
|
||||
|
||||
@KtDateTimeColumn({
|
||||
default: null,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user