feat: 添加通知功能自定义telegram域名功能

This commit is contained in:
Baobhan Sith
2025-05-11 13:02:09 +08:00
parent 598df938bf
commit d7bee11383
34 changed files with 121 additions and 71 deletions
@@ -22,7 +22,7 @@ export const useAppearanceStore = defineStore('appearance', () => {
// --- State ---
const isLoading = ref(false);
const error = ref<string | null>(null);
const isStyleCustomizerVisible = ref(false); // 新增:控制样式编辑器可见性
const isStyleCustomizerVisible = ref(false); // 控制样式编辑器可见性
// Appearance Settings State
const appearanceSettings = ref<Partial<AppearanceSettings>>({}); // 从 API 获取的原始设置
+8 -8
View File
@@ -8,7 +8,7 @@ interface UserInfo {
id: number;
username: string;
isTwoFactorEnabled?: boolean; // 后端 /status 接口会返回这个
language?: 'en' | 'zh'; // 新增:用户偏好语言
language?: 'en' | 'zh'; // 用户偏好语言
}
// Passkey Information Interface
@@ -23,7 +23,7 @@ interface PasskeyInfo {
// Add other relevant fields from your backend response
}
// 新增:登录请求的载荷接口
// 登录请求的载荷接口
interface LoginPayload {
username: string;
password: string;
@@ -56,12 +56,12 @@ interface AuthState {
isLoading: boolean;
error: string | null;
loginRequires2FA: boolean; // 新增状态:标记登录是否需要 2FA
// 新增:存储 IP 黑名单数据 (虽然 actions 在这里,但 state 结构保持)
// 存储 IP 黑名单数据 (虽然 actions 在这里,但 state 结构保持)
ipBlacklist: {
entries: any[]; // TODO: Define a proper type for blacklist entries
total: number;
};
needsSetup: boolean; // 新增:是否需要初始设置
needsSetup: boolean; // 是否需要初始设置
publicCaptchaConfig: PublicCaptchaConfig | null; // NEW: Public CAPTCHA config
passkeys: PasskeyInfo[] | null; // NEW: Store for user's passkeys
passkeysLoading: boolean; // NEW: Loading state for passkeys
@@ -87,11 +87,11 @@ export const useAuthStore = defineStore('auth', {
loggedInUser: (state) => state.user?.username,
},
actions: {
// 新增:清除错误状态
// 清除错误状态
clearError() {
this.error = null;
},
// 新增:设置错误状态
// 设置错误状态
setError(errorMessage: string) {
this.error = errorMessage;
},
@@ -196,7 +196,7 @@ export const useAuthStore = defineStore('auth', {
}
},
// 新增:检查并更新认证状态 Action
// 检查并更新认证状态 Action
async checkAuthStatus() {
this.isLoading = true;
try {
@@ -306,7 +306,7 @@ export const useAuthStore = defineStore('auth', {
}
},
// 新增:检查是否需要初始设置
// 检查是否需要初始设置
async checkSetupStatus() {
// 不需要设置 isLoading,这个检查应该在后台快速完成
try {
@@ -31,7 +31,7 @@ import * as editorActions from './session/actions/editorActions';
import * as sftpManagerActions from './session/actions/sftpManagerActions';
import * as modalActions from './session/actions/modalActions';
import * as commandInputActions from './session/actions/commandInputActions';
import * as sshSuspendActions from './session/actions/sshSuspendActions'; // 新增:导入 SSH 挂起 Actions
import * as sshSuspendActions from './session/actions/sshSuspendActions'; // 导入 SSH 挂起 Actions
// 导入需要的类型 (例如 FileInfo 可能会在参数中使用)
import type { FileInfo } from './fileEditor.store';
@@ -13,7 +13,7 @@ import { createWebSocketConnectionManager } from '../../../composables/useWebSoc
import { createSshTerminalManager, type SshTerminalDependencies } from '../../../composables/useSshTerminal';
import { createStatusMonitorManager, type StatusMonitorDependencies } from '../../../composables/useStatusMonitor';
import { createDockerManager, type DockerManagerDependencies } from '../../../composables/useDockerManager';
import { registerSshSuspendHandlers } from './sshSuspendActions'; // 新增:导入 SSH 挂起处理器注册函数
import { registerSshSuspendHandlers } from './sshSuspendActions'; // 导入 SSH 挂起处理器注册函数
// getOrCreateSftpManager 将在 sftpManagerActions.ts 中定义,并在主 store 中协调
// --- 辅助函数 (特定于此模块的 actions) ---
@@ -28,7 +28,7 @@ export const openNewSession = (
connectionsStore: ReturnType<typeof useConnectionsStore>;
t: ReturnType<typeof useI18n>['t'];
},
existingSessionId?: string // 新增:可选的预定义会话 ID
existingSessionId?: string // 可选的预定义会话 ID
) => {
const { connectionsStore, t } = dependencies;
let connInfo: ConnectionInfo | undefined;
@@ -609,7 +609,7 @@ export const useSettingsStore = defineStore('settings', () => {
}
console.log('[SettingsStore] CAPTCHA 设置更新成功。');
// --- 新增:强制 authStore 重新获取配置 ---
// --- 强制 authStore 重新获取配置 ---
console.log('[SettingsStore] Triggering authStore to refetch CAPTCHA config...');
authStore.publicCaptchaConfig = null; // 重置 authStore 的状态以允许重新获取
await authStore.fetchCaptchaConfig(); // 让 authStore 立即获取最新的配置