mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-08-18 03:57:06 +08:00
Enhance README and UI components with improved user guidance and account identifier masking
- Updated README.md to provide clearer project information, features, and quick start instructions. - Added a function to mask the user's account identifier in CursorAccountCard.vue for enhanced privacy. - Adjusted localization files to remove outdated entries and improve clarity across multiple languages. - Refactored MainLayout.vue to streamline author information handling and improve user experience.
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"fmt"
|
||||
"hash/fnv"
|
||||
"io"
|
||||
"math"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"sort"
|
||||
@@ -438,7 +437,6 @@ func (s *ProxyService) TestModelAdapter(adapter serverconfig.ModelAdapterConfig)
|
||||
AdapterID: normalized.ID,
|
||||
RequestHash: requestHash,
|
||||
Status: string(ModelAdapterTestStatusRunning),
|
||||
SummaryText: "测试中...",
|
||||
TestedAt: time.Now().UTC().Format(time.RFC3339Nano),
|
||||
}
|
||||
s.storeAndEmitModelAdapterTestResult(running)
|
||||
@@ -516,7 +514,6 @@ func (s *ProxyService) runModelAdapterTest(adapter serverconfig.ModelAdapterConf
|
||||
TestedAt: time.Now().UTC().Format(time.RFC3339Nano),
|
||||
RawResponse: strings.TrimSpace(metrics.rawResponse),
|
||||
}
|
||||
result.SummaryText = buildModelAdapterTestSummaryText(result)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
@@ -747,13 +744,6 @@ func buildErroredModelAdapterTestResult(adapterID string, requestHash string, er
|
||||
}
|
||||
}
|
||||
|
||||
func buildModelAdapterTestSummaryText(result ModelAdapterTestResult) string {
|
||||
if strings.TrimSpace(result.Status) != string(ModelAdapterTestStatusSuccess) {
|
||||
return firstNonEmptyTrimmed(result.SummaryText, "测试失败")
|
||||
}
|
||||
return fmt.Sprintf("%d t/s | 首字 %s", int(math.Round(maxFloat64(result.TokensPerSecond, 0))), formatModelAdapterTestDuration(result.FirstTextTokenMS))
|
||||
}
|
||||
|
||||
func buildModelAdapterHTTPStatusError(prefix string, resp *http.Response) error {
|
||||
if resp == nil {
|
||||
return fmt.Errorf("%s response is nil", strings.TrimSpace(prefix))
|
||||
@@ -849,17 +839,6 @@ func buildModelAdapterTestErrorSummary(err error) string {
|
||||
}
|
||||
}
|
||||
|
||||
func formatModelAdapterTestDuration(durationMS int64) string {
|
||||
if durationMS < 1000 {
|
||||
if durationMS < 0 {
|
||||
durationMS = 0
|
||||
}
|
||||
return fmt.Sprintf("%d ms", durationMS)
|
||||
}
|
||||
seconds := float64(durationMS) / 1000
|
||||
return fmt.Sprintf("%.1f s", seconds)
|
||||
}
|
||||
|
||||
func estimateBenchmarkTextTokens(text string) int64 {
|
||||
trimmed := strings.TrimSpace(text)
|
||||
if trimmed == "" {
|
||||
@@ -1056,13 +1035,6 @@ func normalizeModelAdapterTestInt(value int) int {
|
||||
return value
|
||||
}
|
||||
|
||||
func maxFloat64(value float64, fallback float64) float64 {
|
||||
if value < fallback {
|
||||
return fallback
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
func firstNonEmptyTrimmed(values ...string) string {
|
||||
for _, value := range values {
|
||||
trimmed := strings.TrimSpace(value)
|
||||
|
||||
Reference in New Issue
Block a user