# Web Management Interface ๐Ÿ“ฑ

Access management interface: http://localhost:9005 (opens new window)

# ๐Ÿ” Request Monitoring

# Real-time Request List

All intercepted requests are displayed in real-time with support for sorting and searching.

Request List Details

Column Description Function
ID Unique request identifier Click to view details
Code HTTP status code ๐ŸŸข 2xx ๐ŸŸก 3xx ๐Ÿ”ด 4xx/5xx
Type Response content type JSON, HTML, images, etc.
Method HTTP request method GET, POST, PUT, DELETE
API Request path Supports search filtering

# Quick Operations

  • ๐Ÿ” Search & Filter - Quickly find by path, status code, method
  • ๐Ÿ“Š Sort - Click column headers to sort by any column
  • ๐Ÿ”„ Auto Refresh - New requests display in real-time

# ๐Ÿ”ฌ Request Details

# Core Features

# ๐Ÿ”„ Replay

Replay Feature

One-click error reproduction: Re-send requests with identical parameters.

Use Cases:

  • ๐Ÿ› Quickly reproduce bugs without re-login
  • ๐Ÿงช Test API stability
  • ๐Ÿ”„ Verify fix effectiveness

# ๐Ÿ“ธ Capture

Capture Feature

Quick documentation: One-click capture of current page state.

Suitable for:

  • ๐Ÿ“ Bug report attachments
  • ๐Ÿ“Š Interface state recording
  • ๐Ÿค Sharing issues with team

# ๐Ÿ“– Swagger Integration

Swagger Integration

Auto-linked documentation: Automatically displays corresponding Swagger debug interface after OpenAPI configuration.

Core Advantages:

  • ๐Ÿ”‘ Automatically carries latest token, no manual login needed
  • ๐Ÿ“‹ View complete interface definitions and parameter descriptions
  • ๐Ÿงช Test interfaces directly in documentation

# ๐Ÿ“œ History

History

Parameter comparison tool: View all request history for the same interface.

Column Description
Code HTTP status code
Req Request body size (query + body)
Res Response body size

Usage Tips:

  • ๐Ÿ” Quickly locate anomalies by request/response size
  • ๐Ÿ“Š Compare parameter differences between requests
  • ๐Ÿงญ Sort by size to quickly find problematic requests
๐Ÿ’ก Common Issues

Q: Page not updated after replay?
A: Replay generates new request records, check latest results in History.

Q: Capture feature not working?
A: May fail with excessive page content or iframes, recommend using professional screenshot tools.

Q: Swagger button not showing?
A: Check if OpenAPI configuration is correct and current interface exists in documentation.

# ๐Ÿ“‹ Request Response Details

Complete HTTP communication display:

Request Section:

  • ๐ŸŒ Request Line - Method, URL, query parameters
  • ๐Ÿ“„ Request Headers - Complete Headers information
  • ๐Ÿ“ฆ Request Body - POST/PUT data content

Response Section:

  • โœ… Status Line - Status code, status message
  • ๐Ÿ“‹ Response Headers - Server returned Headers
  • ๐Ÿ“„ Response Body - Actual returned data content
View Request Details

Request Details Interface

๐Ÿ’ก JSON Preview Tip

Ensure response header Content-Type is application/json for proper preview. Recommend backend using res.json() instead of res.send().

# โš™๏ธ Interface Management

# ๐ŸŽ›๏ธ Interface Control Panel

Interface Edit Interface

Visual management of all interfaces with WebAPI online editing support.

If there are no real interfaces yet, you can use this feature to create interfaces|documentation for frontend-backend reference. It describes request addresses, methods, parameter positions, types, responses, and can generate interfaces for frontend calls.

Interfaces created here are called webApi interfaces, which merge with interfaces written in config.api. Duplicates are overridden by the latter.

MockM converts filled field names, example values, types into corresponding response data, supporting MockJS syntax.

Conversion Rules
  • Field name: The name of the field, can use MockJS generation rules.
  • Example value: Example value for the field, supports MockJS syntax, like @cname for random Chinese names.

Quick Operations:

  • โž• New Interface - Click + button in table header
  • ๐Ÿ”„ Batch Toggle - One-click disable/enable all WebAPI
  • โš™๏ธ Individual Control - Control single interface enable status

# โœ๏ธ Online Interface Editor

# ๐ŸŽฏ Edit Mode Selection

# ๐Ÿ“Š Table Mode - Quick Structured Data Building

Table Edit Mode

Use Cases: Structured data, API prototype design

Core Features:

  • ๐Ÿ“ Field Definition - Field name, example value, type settings
  • ๐ŸŽฒ Data Generation - Supports MockJS syntax
  • ๐Ÿ“‹ Real-time Preview - Immediate view of generated effects
  • ๐Ÿ”ง Response Header Settings - Custom HTTP Headers

Supported Field Types:

Type Description Example
string String "username"
number Number 123, 3.14
boolean Boolean true, false
object Object Nested field structure
array Array Array object collection
eval JS Code Date.now(), Mock.mock('@name')

Enhanced MockJS Support:

  • ๐ŸŽญ Placeholders - Like @name (name), @email (email)
  • ๐Ÿ”ข Quantity Control - Like name|2-5 (2-5 characters)
  • ๐Ÿ“Š Rule Generation - Like list|10-20 (10-20 data items)

Shortcuts:

  • Ctrl+S - Save interface
  • Ctrl+E - Switch to code mode

# ๐Ÿ’ป Code Mode - Complete Custom Logic

Code Edit Mode

Use Cases: Complex business logic, conditional responses

Global tool Object:

{
  libObj: {
    mockjs,    // MockJS instance
    axios      // HTTP request library
  },
  wrapApiData,  // Unified data wrapper function
  listToData,   // Table data conversion function
  cur          // Current interface information
}

Practical Example:

(req, res) => {
  const { wrapApiData, listToData, cur, libObj: { mockjs } } = tool
  
  // Get request parameters
  const { body, query, params } = req
  
  // Return different data based on parameters
  if (query.type === 'error') {
    return res.status(500).json({ error: 'Simulated error' })
  }
  
  // Use table data
  const { table, example } = cur.responses['200']
  const tableData = listToData(table, example).data
  
  // Combine return data
  const data = {
    user: mockjs.mock('@name'),
    timestamp: Date.now(),
    request: { body, query, params },
    tableData
  }
  
  // Set custom response headers
  res.set({ 'X-Custom-Header': 'MockM Generated' })
  
  // Return unified format data
  res.json(wrapApiData({ data, code: 200 }))
}

# ๐Ÿ“œ History Mode - Reuse Real Data

History Data Mode

Use Cases:

  • ๐Ÿ”„ Reproduce Issues - Use response data from specific requests
  • ๐Ÿงช A/B Testing - Fix a successful response
  • ๐Ÿ“Š Data Consistency - Ensure stable test environment data

Operation Method: Input historical request ID, the interface will always return the complete response (including Headers) of the specified request.

# ๐Ÿš€ Batch Operations

# ๐Ÿ“ Text Import - Quick Field Structure Creation

Double-click table add button, enter structured text in popup:

User Information
- Name
- Email  
- Avatar
- Profile
  - Age
  - Birthday
  - Phone
- Address Info
  - Province
  - City
  - Detailed Address

Smart Features:

  • ๐Ÿ”„ Auto Translation - Chinese field names auto-generate English key names
  • ๐ŸŽฏ Type Inference - Smart type inference based on field names
  • ๐ŸŽฒ Mock Generation - Auto-match appropriate MockJS rules

Batch Add Demo

Hierarchy Support:

  • Use - or space indentation for sub-levels
  • Support multi-level nested structures
  • Auto-generate object and array types

๐Ÿ’ก Pro Tips

Table Mode vs Code Mode Selection:

  • ๐Ÿ“Š Table Mode - Suitable for quick prototypes, clearly structured APIs
  • ๐Ÿ’ป Code Mode - Suitable for complex logic, dynamic responses, conditional judgments
  • ๐Ÿ“œ History Mode - Suitable for reproducing issues, fixed test data

Best Practices:

  1. Use table mode for quick scaffolding of new interfaces
  2. Switch to code mode when logic judgment is needed
  3. Temporarily use history mode when debugging issues

Save Methods:

  • Ctrl+S - Shortcut save
  • Click Action โ†’ Save - Menu save
  • Auto-save prompt - Shows save status after modifications
Last Updated: 7/25/2025, 5:52:54 AM