Implementation:Infiniflow Ragflow Common Constants
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Configuration |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Concrete application-wide shared constants registry including file icon mappings, language codes, date formats, and UI configuration values for the RAGFlow frontend.
Description
The constants/common.ts module defines shared constants used across the application: file extension to icon type mappings, supported language codes, date format strings, pagination defaults, maximum upload sizes, and other UI configuration values.
Usage
Import specific constants when implementing file display, date formatting, pagination, or any feature that needs application-wide configuration values.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/constants/common.ts
- Lines: 1-192
Signature
export const fileIconMap: Record<string, string>;
export const Languages: { label: string; value: string }[];
export const PageSize: number;
export const MaxUploadSize: number;
Import
import { fileIconMap, Languages, PageSize } from '@/constants/common';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | Module-level constants; no inputs |
Outputs
| Name | Type | Description |
|---|---|---|
| fileIconMap | Record | File extension to icon type mapping |
| Languages | array | Supported language options |
| PageSize | number | Default pagination page size |
Usage Examples
import { fileIconMap, PageSize } from '@/constants/common';
const iconType = fileIconMap['pdf']; // 'file-pdf'
const defaultPageSize = PageSize; // 30