[PR #101] [CLOSED] feat: add per-account excluded_models & priority UI to auth file editor #102

Closed
opened 2026-02-27 16:42:33 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/router-for-me/Cli-Proxy-API-Management-Center/pull/101
Author: @RGBadmin
Created: 2/11/2026
Status: Closed

Base: mainHead: feat/per-account-excluded-models-and-priority-ui


📝 Commits (2)

  • 94296ce feat: add per-account excluded_models and priority UI to auth file editor
  • 63219a1 refactor: simplify excluded_models serialization and state handler per review

📊 Changes

1 file changed (+62 additions, -3 deletions)

View changed files

📝 src/pages/AuthFilesPage.tsx (+62 -3)

📄 Description

PR: Add Per-Account excluded_models and priority to Auth File Editor

Summary

This PR adds two new per-account configuration fields to the prefix/proxy_url editor modal in the Auth Files management page:

  1. Excluded Models (excluded_models) — A textarea allowing users to specify model names (one per line) that should be excluded from this specific auth file.
  2. Priority (priority) — A numeric input for setting the priority of the auth file (higher value = higher priority, default: 0).

Changes

File Modified

  • src/pages/AuthFilesPage.tsx

What Changed

1. PrefixProxyEditorState Interface

Added two new fields:

  • excludedModels: string — newline-separated model names for UI binding
  • priority: string — priority number as string for input binding

2. State Initialization (openPrefixProxyEditor)

  • Empty state now initializes excludedModels: '' and priority: ''
  • JSON parsing extracts excluded_models (array → newline-joined string) and priority (number → string)

3. JSON Serialization (prefixProxyUpdatedText useMemo)

  • Builds excluded_models array from newline-separated textarea value; omits field when empty
  • Builds priority as integer from string input; omits field when empty
  • Added excludedModels and priority to the useMemo dependency array

4. Change Handler (handlePrefixProxyChange)

Extended type signature to accept 'excludedModels' | 'priority' in addition to existing fields.

5. Modal UI

Added after the existing prefix/proxy_url inputs:

  • A <textarea> for entering excluded model names (one per line), using existing styles.prefixProxyTextarea CSS class
  • An <Input type="number"> for setting priority

Behavior

Field Empty Value Populated Value
excluded_models Omitted from JSON Serialized as string[]
priority Omitted from JSON Serialized as number (integer)

Labels

  • English hardcoded strings (i18n-ready for future localization)
  • No new CSS classes needed (reuses existing prefixProxyFields, prefixProxyLabel, prefixProxyTextarea styles)

Testing Checklist

  • Empty excluded_models → field omitted from saved JSON
  • Populated excluded_models → saved as ["model-a", "model-b"]
  • Empty priority → field omitted from saved JSON
  • Populated priority → saved as integer (e.g., 5)
  • Existing JSON fields preserved after save
  • Dirty detection works correctly with new fields
  • Fields properly disabled when not connected / saving / invalid JSON

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/router-for-me/Cli-Proxy-API-Management-Center/pull/101 **Author:** [@RGBadmin](https://github.com/RGBadmin) **Created:** 2/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/per-account-excluded-models-and-priority-ui` --- ### 📝 Commits (2) - [`94296ce`](https://github.com/router-for-me/Cli-Proxy-API-Management-Center/commit/94296ced137e0ef1c96a74c9799ed78d8b02ad12) feat: add per-account excluded_models and priority UI to auth file editor - [`63219a1`](https://github.com/router-for-me/Cli-Proxy-API-Management-Center/commit/63219a1b1c19e04b59ea928aa87b5fc299fe659c) refactor: simplify excluded_models serialization and state handler per review ### 📊 Changes **1 file changed** (+62 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/pages/AuthFilesPage.tsx` (+62 -3) </details> ### 📄 Description # PR: Add Per-Account `excluded_models` and `priority` to Auth File Editor ## Summary This PR adds two new per-account configuration fields to the prefix/proxy_url editor modal in the Auth Files management page: 1. **Excluded Models** (`excluded_models`) — A textarea allowing users to specify model names (one per line) that should be excluded from this specific auth file. 2. **Priority** (`priority`) — A numeric input for setting the priority of the auth file (higher value = higher priority, default: 0). ## Changes ### File Modified - `src/pages/AuthFilesPage.tsx` ### What Changed #### 1. `PrefixProxyEditorState` Interface Added two new fields: - `excludedModels: string` — newline-separated model names for UI binding - `priority: string` — priority number as string for input binding #### 2. State Initialization (`openPrefixProxyEditor`) - Empty state now initializes `excludedModels: ''` and `priority: ''` - JSON parsing extracts `excluded_models` (array → newline-joined string) and `priority` (number → string) #### 3. JSON Serialization (`prefixProxyUpdatedText` useMemo) - Builds `excluded_models` array from newline-separated textarea value; omits field when empty - Builds `priority` as integer from string input; omits field when empty - Added `excludedModels` and `priority` to the useMemo dependency array #### 4. Change Handler (`handlePrefixProxyChange`) Extended type signature to accept `'excludedModels' | 'priority'` in addition to existing fields. #### 5. Modal UI Added after the existing prefix/proxy_url inputs: - A `<textarea>` for entering excluded model names (one per line), using existing `styles.prefixProxyTextarea` CSS class - An `<Input type="number">` for setting priority ## Behavior | Field | Empty Value | Populated Value | |-------|------------|-----------------| | `excluded_models` | Omitted from JSON | Serialized as `string[]` | | `priority` | Omitted from JSON | Serialized as `number` (integer) | ## Labels - English hardcoded strings (i18n-ready for future localization) - No new CSS classes needed (reuses existing `prefixProxyFields`, `prefixProxyLabel`, `prefixProxyTextarea` styles) ## Testing Checklist - [ ] Empty `excluded_models` → field omitted from saved JSON - [ ] Populated `excluded_models` → saved as `["model-a", "model-b"]` - [ ] Empty `priority` → field omitted from saved JSON - [ ] Populated `priority` → saved as integer (e.g., `5`) - [ ] Existing JSON fields preserved after save - [ ] Dirty detection works correctly with new fields - [ ] Fields properly disabled when not connected / saving / invalid JSON --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem closed this issue 2026-02-27 16:42:34 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Cli-Proxy-API-Management-Center#102
No description provided.