File size: 103,386 Bytes
07a2f32 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 | {% extends "base.html" %} {% block title %}配置编辑器 - Gemini Balance{%
endblock %} {% block head_extra_styles %}
<style>
/* config_editor.html specific styles */
/* Animations (already in base.html, but keep fade-in class usage) */
.fade-in {
animation: fadeIn 0.3s ease forwards;
}
/* Modal specific styles (already in base.html) */
.array-container {
max-height: 300px;
overflow-y: auto;
padding: 1rem; /* p-4 consistency */
margin-bottom: 0.5rem; /* mb-2 consistency */
background-color: rgba(255, 255, 255, 0.95) !important; /* light theme */
border: 1px solid rgba(0, 0, 0, 0.12) !important; /* light gray border */
color: #374151 !important; /* gray-700 for light theme */
border-radius: 0.5rem; /* rounded-lg consistency */
}
#API_KEYS_container {
/* Keep specific ID styling if needed */
max-height: 300px;
overflow-y: auto;
}
.config-section {
display: none;
/* theming: new background and border for sections */
background-color: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
border: 1px solid rgba(0, 0, 0, 0.08);
border-radius: 0.75rem; /* rounded-xl */
padding: 1.5rem; /* p-6 */
margin-bottom: 1.5rem; /* mb-6 */
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-lg */
}
.config-section.active {
display: block;
animation: fadeIn 0.3s ease forwards; /* Use base animation */
}
.provider-config {
display: none;
}
.provider-config.active {
display: block;
}
/* Tailwind Toggle Switch Helper CSS */
.toggle-checkbox:checked {
@apply: right-0 border-blue-600; /* theming: changed to blue for light theme */
right: 0;
border-color: #2563eb; /* theming: blue-600 */
}
.toggle-checkbox:checked + .toggle-label {
@apply: bg-blue-600; /* theming: changed to blue for light theme */
background-color: #2563eb; /* theming: blue-600 */
}
.toggle-label {
/* theming: style for unchecked state */
background-color: rgba(156, 163, 175, 0.3); /* gray-400 */
}
/* 统一通知样式为黑色半透明,确保与 keys_status 一致 */
.notification {
background: rgba(0, 0, 0, 0.8) !important;
color: #fff !important;
}
/* Theming for input fields - 修复边框重影问题 */
.form-input-themed {
background-color: rgba(255, 255, 255, 0.95) !important;
border: 1px solid rgba(0, 0, 0, 0.12) !important; /* 为独立输入框提供边框 */
color: #374151 !important; /* gray-700 */
outline: none !important; /* 移除默认outline */
box-shadow: none !important; /* 移除默认box-shadow */
transition: border-color 0.15s ease-in-out !important;
}
.form-input-themed::placeholder {
color: #9ca3af !important; /* gray-400 */
}
.form-input-themed:focus {
border-color: #3b82f6 !important; /* focus时改变边框颜色 */
box-shadow: none !important; /* 移除focus阴影,只保留边框变化 */
outline: none !important; /* 确保没有outline */
}
/* 对于在包装器内的输入框,移除边框 */
.flex.items-center .form-input-themed,
.array-container .form-input-themed {
border: none !important; /* 在包装器内的输入框移除边框 */
}
.flex.items-center .form-input-themed:focus,
.array-container .form-input-themed:focus {
border: none !important; /* 确保focus时也没有边框 */
}
/* Theming for select fields - 改进下拉框样式 */
.form-select-themed {
background-color: rgba(255, 255, 255, 0.95) !important; /* 白色背景 */
border: 1px solid rgba(0, 0, 0, 0.12) !important; /* 灰色边框 */
color: #374151 !important; /* gray-700 文字颜色 */
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important; /* 灰色箭头 */
appearance: none !important;
padding: 0.6rem 2.5rem 0.6rem 0.8rem !important; /* 调整内边距 */
background-repeat: no-repeat !important;
background-position: right 0.6rem center !important;
background-size: 1.5em 1.5em !important;
border-radius: 0.5rem !important; /* 圆角 */
font-weight: 500 !important; /* 半粗体 */
height: auto !important; /* 自动高度 */
box-shadow: none !important; /* 移除阴影 */
cursor: pointer !important;
}
.form-select-themed:focus {
border-color: #3b82f6 !important; /* blue-500 */
box-shadow: none !important; /* 移除focus阴影 */
outline: none !important;
}
.form-select-themed option {
background-color: rgba(
255,
255,
255,
0.98
) !important; /* white background */
color: #374151 !important; /* gray-700 */
padding: 8px !important;
}
/* 日志级别样式 - 浅色主题统一设计 */
#LOG_LEVEL {
font-weight: 600 !important;
}
/* 统一的日志级别选项样式 - 使用浅色主题 */
#LOG_LEVEL option[value="DEBUG"] {
background-color: rgba(255, 255, 255, 0.98) !important; /* 白色背景 */
color: #374151 !important; /* gray-700 深灰色文字 */
}
#LOG_LEVEL option[value="INFO"] {
background-color: rgba(
249,
250,
251,
0.98
) !important; /* gray-50 浅灰背景 */
color: #374151 !important; /* gray-700 深灰色文字 */
}
#LOG_LEVEL option[value="WARNING"] {
background-color: rgba(
243,
244,
246,
0.98
) !important; /* gray-100 稍深灰背景 */
color: #374151 !important; /* gray-700 深灰色文字 */
}
#LOG_LEVEL option[value="ERROR"] {
background-color: rgba(
229,
231,
235,
0.98
) !important; /* gray-200 中灰背景 */
color: #374151 !important; /* gray-700 深灰色文字 */
}
#LOG_LEVEL option[value="CRITICAL"] {
background-color: rgba(
209,
213,
219,
0.98
) !important; /* gray-300 深灰背景 */
color: #374151 !important; /* gray-700 深灰色文字 */
}
/* 思考模型预算映射样式 */
.map-item {
background-color: rgba(60, 40, 130, 0.2) !important;
border-radius: 0.5rem !important;
padding: 0.5rem !important;
border: 1px solid rgba(167, 139, 250, 0.3) !important;
transition: all 0.2s ease-in-out !important;
}
.map-item:hover {
background-color: rgba(60, 40, 130, 0.3) !important;
border-color: rgba(167, 139, 250, 0.5) !important;
}
.map-key-input {
background-color: rgba(255, 255, 255, 0.95) !important;
border: 1px solid rgba(0, 0, 0, 0.12) !important;
color: #374151 !important; /* gray-700 */
font-weight: 500 !important;
border-radius: 0.375rem !important;
}
.map-value-input {
background-color: rgba(255, 255, 255, 0.95) !important;
border: 1px solid rgba(0, 0, 0, 0.12) !important;
color: #374151 !important; /* gray-700 */
font-weight: 600 !important;
border-radius: 0.375rem !important;
box-shadow: none !important;
transition: all 0.2s !important;
}
.map-value-input:focus {
background-color: rgba(255, 255, 255, 1) !important;
border-color: #3b82f6 !important; /* blue-500 */
box-shadow: none !important; /* 移除focus阴影 */
outline: none !important;
}
/* 警告文字样式 */
.warning-text {
color: #f87171 !important; /* red-400 */
font-weight: 600 !important;
background-color: rgba(248, 113, 113, 0.15) !important;
padding: 0.5rem 0.75rem !important;
border-radius: 0.375rem !important;
border-left: 3px solid #ef4444 !important; /* red-500 */
display: flex !important;
align-items: center !important;
margin-top: 0.5rem !important;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}
.warning-text i {
margin-right: 0.5rem !important;
color: #ef4444 !important; /* red-500 */
}
/* 令牌生成按钮样式 */
.generate-btn {
background-color: rgba(59, 130, 246, 0.1) !important; /* blue-500 light */
color: #3b82f6 !important; /* blue-500 */
border: 1px solid rgba(59, 130, 246, 0.3) !important;
border-left: none !important;
transition: all 0.2s ease !important;
}
.generate-btn:hover {
background-color: rgba(
59,
130,
246,
0.2
) !important; /* blue-500 more opaque */
color: #1d4ed8 !important; /* blue-700 */
box-shadow: 0 0 8px rgba(59, 130, 246, 0.3) !important;
}
.generate-btn:focus {
outline: none !important;
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5) !important;
}
/* 导航链接悬停样式 - 优化以避免遮挡内容 */
.nav-link {
transition: all 0.2s ease-in-out;
position: relative;
z-index: 1; /* 确保不会遮挡重要内容 */
}
.nav-link:hover {
background-color: rgba(59, 130, 246, 0.1) !important; /* blue-500 light */
transform: scale(1.02); /* 使用缩放代替向上移动 */
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* 增强阴影效果 */
}
/* 导航按钮容器样式 - 为悬停效果预留空间 */
.nav-buttons-container {
padding-top: 0.5rem; /* 为悬停效果预留上方空间 */
padding-bottom: 0.75rem; /* 为悬停效果预留下方空间 */
}
/* 主导航按钮的优化悬停效果 */
.main-nav-btn:hover {
transform: scale(1.02) !important; /* 使用缩放代替向上移动 */
box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3) !important; /* 蓝色阴影 */
}
/* 操作按钮的优化悬停效果 */
.action-btn {
position: relative;
z-index: 1;
}
.action-btn:hover {
transform: scale(1.02) !important; /* 使用缩放代替向上移动 */
}
.action-btn:hover#saveBtn {
box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4) !important; /* 蓝色阴影 */
}
.action-btn:hover#resetBtn {
box-shadow: 0 8px 20px rgba(107, 114, 128, 0.4) !important; /* 灰色阴影 */
}
/* 刷新按钮样式 - 与监控面板页面保持一致 */
.bg-white.bg-opacity-20 {
background-color: rgba(255, 255, 255, 0.9) !important;
color: #3b82f6 !important; /* blue-500 - 与监控面板一致 */
}
.bg-white.bg-opacity-20:hover {
background-color: rgba(255, 255, 255, 1) !important;
color: #2563eb !important; /* blue-600 - 悬停时稍深 */
}
/* General label and small text theming for light theme */
label {
color: #374151 !important; /* Dark gray for labels in light theme */
font-weight: 600; /* semibold */
}
small {
color: #6b7280 !important; /* Medium gray for small text */
}
/* Override all violet/purple buttons to light blue */
.bg-violet-600,
button.bg-violet-600 {
background-color: #3b82f6 !important; /* blue-500 - light blue */
}
.bg-violet-600:hover,
button.bg-violet-600:hover,
.hover\\:bg-violet-700:hover {
background-color: #2563eb !important; /* blue-600 - darker light blue */
}
/* Override blue buttons to light blue */
.bg-blue-600,
button.bg-blue-600 {
background-color: #3b82f6 !important; /* blue-500 - light blue */
}
.bg-blue-600:hover,
button.bg-blue-600:hover,
.hover\\:bg-blue-700:hover {
background-color: #2563eb !important; /* blue-600 - darker light blue */
}
/* Override red buttons to bright light red */
.bg-red-600,
button.bg-red-600,
.bg-red-700,
button.bg-red-700,
.bg-red-800,
button.bg-red-800 {
background-color: #f87171 !important; /* red-400 - bright light red */
}
.bg-red-600:hover,
button.bg-red-600:hover,
.bg-red-700:hover,
button.bg-red-700:hover,
.bg-red-800:hover,
button.bg-red-800:hover,
.hover\\:bg-red-700:hover,
.hover\\:bg-red-800:hover {
background-color: #ef4444 !important; /* red-500 - darker bright light red */
}
/* Update section headings */
.config-section h2 {
color: #1f2937 !important; /* gray-800 */
border-color: #d1d5db !important; /* gray-300 */
}
.config-section h2 i {
color: #3b82f6 !important; /* blue-500 */
}
/* Update tab button active state - 增强选中态样式,提高优先级 */
button.tab-btn.active {
background-color: #3b82f6 !important; /* blue-500 */
color: #ffffff !important; /* 确保白色文字 */
box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.4),
0 2px 6px -1px rgba(59, 130, 246, 0.2) !important; /* 蓝色阴影 */
transform: translateY(-2px) !important; /* 更明显的上移效果 */
border: 2px solid #2563eb !important; /* blue-600 边框 */
font-weight: 600 !important; /* 加粗字体 */
}
/* Ensure inactive tabs have proper styling - 增强未选中态样式,提高优先级 */
button.tab-btn:not(.active) {
background-color: #f8fafc !important; /* slate-50 更浅的背景 */
color: #64748b !important; /* slate-500 更明显的灰色文字 */
border: 2px solid #e2e8f0 !important; /* slate-200 边框 */
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important; /* 轻微阴影 */
font-weight: 500 !important; /* 中等字体粗细 */
}
button.tab-btn:not(.active):hover {
background-color: #f1f5f9 !important; /* slate-100 */
color: #475569 !important; /* slate-600 更深的文字颜色 */
transform: translateY(-1px) !important;
border-color: #cbd5e1 !important; /* slate-300 */
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}
/* Add transition for smooth state changes - 提高优先级 */
button.tab-btn {
transition: all 0.2s ease-in-out !important;
cursor: pointer !important;
/* 确保基础样式不被Tailwind覆盖 */
padding: 0.5rem 1.25rem !important; /* px-5 py-2 */
border-radius: 9999px !important; /* rounded-full */
font-size: 0.875rem !important; /* text-sm */
font-weight: 500 !important; /* font-medium */
}
/* 额外的高优先级规则确保样式生效 */
.flex.justify-center.mb-6.flex-wrap.gap-2 button.tab-btn.active {
background-color: #3b82f6 !important;
color: #ffffff !important;
border: 2px solid #2563eb !important;
box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.4),
0 2px 6px -1px rgba(59, 130, 246, 0.2) !important;
transform: translateY(-2px) !important;
font-weight: 600 !important;
}
.flex.justify-center.mb-6.flex-wrap.gap-2 button.tab-btn:not(.active) {
background-color: #f8fafc !important;
color: #64748b !important;
border: 2px solid #e2e8f0 !important;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
font-weight: 500 !important;
transform: none !important;
}
/* Fix all modal backgrounds - comprehensive override */
.modal .w-full[style*="background-color: rgba(70, 50, 150"],
.modal .w-full.max-w-lg[style*="background-color: rgba(70, 50, 150"],
.modal .w-full.max-w-md[style*="background-color: rgba(70, 50, 150"] {
background-color: rgba(255, 255, 255, 0.98) !important;
color: #374151 !important; /* gray-700 */
border-color: rgba(0, 0, 0, 0.08) !important;
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}
/* Fix modal titles */
.modal h2.text-gray-800 {
color: #1f2937 !important; /* gray-800 */
font-weight: 600 !important;
}
/* Fix modal close buttons */
.modal .text-gray-300 {
color: #6b7280 !important; /* gray-500 */
}
.modal .text-gray-300:hover {
color: #374151 !important; /* gray-700 */
}
/* Fix modal body text */
.modal p,
.modal label,
.modal span {
color: #374151 !important; /* gray-700 */
}
/* Fix modal textarea and input styling */
.modal textarea,
.modal input {
background-color: rgba(255, 255, 255, 0.95) !important;
color: #374151 !important; /* gray-700 */
border: 1px solid rgba(0, 0, 0, 0.12) !important;
}
.modal textarea:focus,
.modal input:focus {
border-color: #3b82f6 !important; /* blue-500 */
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}
/* Fix modal button styling */
.modal .bg-violet-600,
.modal button.bg-violet-600 {
background-color: #3b82f6 !important; /* blue-500 - light blue */
color: #ffffff !important;
border: 1px solid #2563eb !important; /* blue-600 */
}
.modal .bg-violet-600:hover,
.modal button.bg-violet-600:hover {
background-color: #2563eb !important; /* blue-600 - darker light blue */
transform: translateY(-1px) !important;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}
/* Fix modal blue button styling */
.modal .bg-blue-500,
.modal button.bg-blue-500,
.modal .bg-blue-600,
.modal button.bg-blue-600,
.modal .bg-blue-700,
.modal button.bg-blue-700 {
background-color: #3b82f6 !important; /* blue-500 - light blue */
color: #ffffff !important;
border: 1px solid #2563eb !important; /* blue-600 */
}
.modal .bg-blue-500:hover,
.modal button.bg-blue-500:hover,
.modal .bg-blue-600:hover,
.modal button.bg-blue-600:hover,
.modal .bg-blue-700:hover,
.modal button.bg-blue-700:hover {
background-color: #2563eb !important; /* blue-600 - darker light blue */
transform: translateY(-1px) !important;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}
/* Fix modal cancel/secondary buttons */
.modal .bg-gray-500,
.modal button.bg-gray-500,
.modal .bg-gray-600,
.modal button.bg-gray-600 {
background-color: #e5e7eb !important; /* gray-200 - light gray */
color: #374151 !important; /* gray-700 - dark text for contrast */
border: 1px solid #d1d5db !important; /* gray-300 */
}
.modal .bg-gray-500:hover,
.modal button.bg-gray-500:hover,
.modal .bg-gray-600:hover,
.modal button.bg-gray-600:hover {
background-color: #d1d5db !important; /* gray-300 - darker light gray */
color: #374151 !important; /* gray-700 - dark text for contrast */
transform: translateY(-1px) !important;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}
/* Fix modal red/danger buttons */
.modal .bg-red-500,
.modal button.bg-red-500,
.modal .bg-red-600,
.modal button.bg-red-600,
.modal .bg-red-700,
.modal button.bg-red-700 {
background-color: #f87171 !important; /* red-400 - bright light red */
color: #ffffff !important;
border: 1px solid #ef4444 !important; /* red-500 */
}
.modal .bg-red-500:hover,
.modal button.bg-red-500:hover,
.modal .bg-red-600:hover,
.modal button.bg-red-600:hover,
.modal .bg-red-700:hover,
.modal button.bg-red-700:hover {
background-color: #ef4444 !important; /* red-500 - darker bright light red */
transform: translateY(-1px) !important;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}
/* Fix all container backgrounds with purple */
[style*="background-color: rgba(255, 255, 255, 0.05)"],
[style*="background-color: rgba(80, 60, 160"],
[style*="background-color: rgba(70, 50, 150"],
[style*="background-color: rgba(60, 40, 130"],
[style*="background-color: rgba(120, 100, 200"] {
background-color: rgba(255, 255, 255, 0.95) !important;
border-color: rgba(0, 0, 0, 0.08) !important;
color: #374151 !important;
}
/* Fix map item styling */
.map-item {
background-color: rgba(249, 250, 251, 0.8) !important; /* gray-50 */
border: 1px solid rgba(0, 0, 0, 0.08) !important;
color: #374151 !important;
}
.map-item:hover {
background-color: rgba(243, 244, 246, 1) !important; /* gray-100 */
border-color: rgba(0, 0, 0, 0.12) !important;
}
/* Update model helper buttons */
.model-helper-trigger-btn {
color: #3b82f6 !important; /* blue-500 */
background-color: rgba(59, 130, 246, 0.1) !important;
}
.model-helper-trigger-btn:hover {
background-color: rgba(59, 130, 246, 0.2) !important;
color: #1d4ed8 !important; /* blue-700 */
}
/* Comprehensive button text color fixes */
.bg-blue-500,
.bg-blue-600,
.bg-blue-700,
.bg-red-500,
.bg-red-600,
.bg-red-700,
.bg-red-800,
.bg-green-500,
.bg-green-600,
.bg-green-700,
.bg-sky-500,
.bg-sky-600,
.bg-sky-700,
.bg-purple-500,
.bg-purple-600,
.bg-purple-700,
.bg-violet-500,
.bg-violet-600,
.bg-violet-700 {
color: #ffffff !important;
}
/* Ensure button children inherit white text */
.bg-blue-500 *,
.bg-blue-600 *,
.bg-blue-700 *,
.bg-red-500 *,
.bg-red-600 *,
.bg-red-700 *,
.bg-red-800 *,
.bg-green-500 *,
.bg-green-600 *,
.bg-green-700 *,
.bg-sky-500 *,
.bg-sky-600 *,
.bg-sky-700 *,
.bg-purple-500 *,
.bg-purple-600 *,
.bg-purple-700 *,
.bg-violet-500 *,
.bg-violet-600 *,
.bg-violet-700 * {
color: inherit !important;
}
/* Fix page title gradient - comprehensive override */
h1.text-transparent,
.text-transparent.bg-clip-text,
.bg-gradient-to-r.from-violet-400.to-pink-400 {
background: none !important;
color: #1f2937 !important; /* gray-800 - consistent with other pages */
-webkit-background-clip: unset !important;
background-clip: unset !important;
text-shadow: none !important;
font-weight: 800 !important; /* font-extrabold */
}
/* Fix all gradient buttons to use solid blue */
.bg-gradient-to-r.from-violet-500.to-pink-500,
.bg-gradient-to-r.from-gray-600.to-gray-700 {
background: none !important;
}
/* Ensure all violet/purple colors are converted to blue theme */
.text-violet-300,
.text-violet-400,
.text-violet-100 {
color: #3b82f6 !important; /* blue-500 */
}
.border-violet-300,
.border-violet-400 {
border-color: rgba(
59,
130,
246,
0.3
) !important; /* blue-500 with opacity */
}
.hover\\:text-violet-400:hover,
.hover\\:text-violet-100:hover {
color: #2563eb !important; /* blue-600 */
}
.hover\\:bg-violet-700:hover {
background-color: #2563eb !important; /* blue-600 */
}
/* Fix focus states for form elements */
.focus-within\\:border-violet-400:focus-within,
.focus-within\\:ring-violet-400:focus-within {
border-color: #3b82f6 !important; /* blue-500 */
box-shadow: none !important; /* 移除focus阴影 */
}
/* Fix focus-within border color for auth token wrapper */
.focus-within\\:border-blue-500:focus-within {
border-color: #3b82f6 !important; /* blue-500 */
}
/* More specific selector for auth token wrapper */
div.flex.items-center.flex-grow.border.rounded-md.focus-within\\:border-blue-500:focus-within {
border-color: #3b82f6 !important; /* blue-500 */
}
/* Even more specific selector targeting the exact auth token wrapper */
.mb-6
.flex.items-center
div.flex.items-center.flex-grow.border.rounded-md:focus-within {
border-color: #3b82f6 !important; /* blue-500 */
}
/* Fix primary color focus states - convert purple to blue */
.focus\\:border-primary-500:focus,
.focus\\:border-primary-600:focus {
border-color: #3b82f6 !important; /* blue-500 */
}
.focus\\:ring-primary-200:focus,
.focus\\:ring-primary-300:focus {
--tw-ring-color: rgba(
59,
130,
246,
0.2
) !important; /* blue-500 with opacity */
}
/* Fix select element styling */
.form-select-themed {
background-color: rgba(255, 255, 255, 0.95) !important;
border: 1px solid rgba(0, 0, 0, 0.12) !important;
color: #374151 !important; /* gray-700 */
outline: none !important;
box-shadow: none !important;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}
.form-select-themed:focus {
border-color: #3b82f6 !important; /* blue-500 */
box-shadow: none !important; /* 移除focus阴影 */
outline: none !important;
}
/* Override any remaining primary colors */
.text-primary-600,
.text-primary-500 {
color: #3b82f6 !important; /* blue-500 */
}
.bg-primary-600,
.bg-primary-500 {
background-color: #3b82f6 !important; /* blue-500 */
}
.bg-primary-700:hover,
.hover\\:bg-primary-700:hover {
background-color: #2563eb !important; /* blue-600 */
}
/* Fix dynamic input wrapper focus states - convert violet to blue */
.focus-within\\:border-violet-400:focus-within,
.focus-within\\:ring-violet-400:focus-within {
border-color: #3b82f6 !important; /* blue-500 */
box-shadow: none !important; /* 移除focus阴影 */
}
/* Ensure all array input wrappers use blue theme */
.array-container .flex.items-center.flex-grow.rounded-md {
border-color: rgba(0, 0, 0, 0.12) !important;
}
.array-container .flex.items-center.flex-grow.rounded-md:focus-within {
border-color: #3b82f6 !important; /* blue-500 */
box-shadow: none !important; /* 移除focus阴影 */
}
</style>
{% endblock %} {% block content %}
<div class="container max-w-6xl mx-auto px-4">
<div
class="rounded-2xl shadow-xl p-6 md:p-8"
style="
background-color: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border: 1px solid rgba(0, 0, 0, 0.08);
"
>
<button
class="absolute top-6 right-6 bg-white bg-opacity-20 hover:bg-opacity-30 rounded-full w-8 h-8 flex items-center justify-center text-primary-600 transition-all duration-300"
onclick="refreshPage(this)"
title="手动刷新"
>
<i class="fas fa-sync-alt"></i>
</button>
<h1 class="text-3xl font-extrabold text-center text-gray-800 mb-4">
<img
src="/static/icons/logo.png"
alt="Gemini Balance Logo"
class="h-9 inline-block align-middle mr-2"
/>
Gemini Balance - 配置编辑
</h1>
<!-- Navigation Tabs -->
<div
class="nav-buttons-container flex justify-center mb-8 overflow-x-auto gap-2"
>
<a
href="/config"
class="main-nav-btn whitespace-nowrap flex items-center justify-center gap-2 px-6 py-3 font-medium rounded-lg shadow-md hover:shadow-lg transition-all duration-200"
style="background-color: #3b82f6 !important; color: #ffffff !important"
>
<i class="fas fa-cog"></i> 配置编辑
</a>
<a
href="/keys"
class="nav-link whitespace-nowrap flex items-center justify-center gap-2 px-6 py-3 font-medium rounded-lg text-gray-700 hover:text-gray-900 transition-all duration-200"
style="background-color: rgba(229, 231, 235, 0.8)"
>
<i class="fas fa-tachometer-alt"></i> 监控面板
</a>
<a
href="/logs"
class="nav-link whitespace-nowrap flex items-center justify-center gap-2 px-6 py-3 font-medium rounded-lg text-gray-700 hover:text-gray-900 transition-all duration-200"
style="background-color: rgba(229, 231, 235, 0.8)"
>
<i class="fas fa-exclamation-triangle"></i> 错误日志
</a>
</div>
<!-- Config Tabs -->
<div class="flex justify-center mb-6 flex-wrap gap-2">
<button
class="tab-btn active px-5 py-2 rounded-full font-medium text-sm transition-all duration-200"
data-tab="api"
style="
background-color: #3b82f6 !important;
color: #ffffff !important;
border: 2px solid #2563eb !important;
box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.4),
0 2px 6px -1px rgba(59, 130, 246, 0.2) !important;
transform: translateY(-2px) !important;
font-weight: 600 !important;
"
>
API配置
</button>
<button
class="tab-btn px-5 py-2 rounded-full font-medium text-sm transition-all duration-200"
data-tab="model"
style="
background-color: #f8fafc !important;
color: #64748b !important;
border: 2px solid #e2e8f0 !important;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
font-weight: 500 !important;
"
>
模型配置
</button>
<button
class="tab-btn px-5 py-2 rounded-full font-medium text-sm transition-all duration-200"
data-tab="tts"
style="
background-color: #f8fafc !important;
color: #64748b !important;
border: 2px solid #e2e8f0 !important;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
font-weight: 500 !important;
"
>
TTS 配置
</button>
<button
class="tab-btn px-5 py-2 rounded-full font-medium text-sm transition-all duration-200"
data-tab="image"
style="
background-color: #f8fafc !important;
color: #64748b !important;
border: 2px solid #e2e8f0 !important;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
font-weight: 500 !important;
"
>
图像生成
</button>
<button
class="tab-btn px-5 py-2 rounded-full font-medium text-sm transition-all duration-200"
data-tab="stream"
style="
background-color: #f8fafc !important;
color: #64748b !important;
border: 2px solid #e2e8f0 !important;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
font-weight: 500 !important;
"
>
流式输出
</button>
<button
class="tab-btn px-5 py-2 rounded-full font-medium text-sm transition-all duration-200"
data-tab="scheduler"
style="
background-color: #f8fafc !important;
color: #64748b !important;
border: 2px solid #e2e8f0 !important;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
font-weight: 500 !important;
"
>
定时任务
</button>
<button
class="tab-btn px-5 py-2 rounded-full font-medium text-sm transition-all duration-200"
data-tab="logging"
style="
background-color: #f8fafc !important;
color: #64748b !important;
border: 2px solid #e2e8f0 !important;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
font-weight: 500 !important;
"
>
日志配置
</button>
</div>
<!-- Save Status Banner (Removed - using notification component now) -->
<!-- Configuration Form -->
<form id="configForm" class="mt-6">
<!-- API 相关配置 -->
<div class="config-section active" id="api-section">
<h2
class="text-xl font-bold mb-6 pb-3 border-b flex items-center gap-2 text-gray-800 border-gray-300"
>
<i class="fas fa-key text-blue-500"></i> API相关配置
</h2>
<!-- API密钥列表 -->
<div class="mb-6">
<label for="API_KEYS" class="block font-semibold mb-2 text-gray-800"
>API密钥列表</label
>
<div class="mb-2">
<input
type="search"
id="apiKeySearchInput"
placeholder="搜索密钥..."
class="w-full px-4 py-2 rounded-lg form-input-themed"
/>
</div>
<div class="array-container" id="API_KEYS_container">
<!-- 数组项将在这里动态添加 -->
</div>
<!-- API密钥分页控件 -->
<div id="apiKeyPagination" class="flex items-center justify-between mt-2 mb-2" style="display: none;">
<div class="flex items-center gap-2">
<button
type="button"
id="apiKeyPrevBtn"
class="px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 cursor-pointer"
>
<i class="fas fa-chevron-left"></i> 上一页
</button>
<span id="apiKeyPageInfo" class="text-sm text-gray-600">第 1 页,共 1 页</span>
<button
type="button"
id="apiKeyNextBtn"
class="px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 cursor-pointer"
>
下一页 <i class="fas fa-chevron-right"></i>
</button>
</div>
<div class="text-xs text-gray-500">
每页显示 20 个密钥
</div>
</div>
<div class="flex justify-end gap-2">
<button
type="button"
class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
id="bulkDeleteApiKeyBtn"
>
<i class="fas fa-trash-alt"></i> 删除密钥
</button>
<button
type="button"
class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
id="addApiKeyBtn"
>
<i class="fas fa-plus"></i> 添加密钥
</button>
</div>
<small class="text-gray-500 mt-1 block"
>Gemini API密钥列表,每行一个</small
>
</div>
<!-- 允许的令牌列表 -->
<div class="mb-6">
<label
for="ALLOWED_TOKENS"
class="block font-semibold mb-2 text-gray-800"
>允许的令牌列表</label
>
<div class="array-container" id="ALLOWED_TOKENS_container">
<!-- 数组项将在这里动态添加 -->
</div>
<div class="flex justify-end">
<button
type="button"
class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
onclick="addArrayItem('ALLOWED_TOKENS')"
>
<i class="fas fa-plus"></i> 添加令牌
</button>
</div>
<small class="text-gray-500 mt-1 block">允许访问API的令牌列表</small>
</div>
<!-- 认证令牌 -->
<div class="mb-6">
<label for="AUTH_TOKEN" class="block font-semibold mb-2 text-gray-800"
>认证令牌</label
>
<div class="flex items-center">
<div
class="flex items-center flex-grow border rounded-md focus-within:border-blue-500"
style="border-color: rgba(0, 0, 0, 0.12)"
>
<input
type="text"
id="AUTH_TOKEN"
name="AUTH_TOKEN"
placeholder="默认使用ALLOWED_TOKENS中的第一个"
class="array-input flex-grow px-3 py-2 rounded-l-md sensitive-input form-input-themed"
/>
<button
type="button"
id="generateAuthTokenBtn"
class="generate-btn px-2 py-2 text-gray-400 hover:text-blue-500 focus:outline-none rounded-r-md hover:bg-gray-600 transition-colors"
title="生成随机令牌"
style="background-color: rgba(59, 130, 246, 0.1)"
>
<i class="fas fa-dice"></i>
</button>
</div>
</div>
<small class="text-gray-500 mt-1 block">用于API认证的令牌</small>
</div>
<!-- API基础URL -->
<div class="mb-6">
<label for="BASE_URL" class="block font-semibold mb-2 text-gray-700"
>API基础URL</label
>
<input
type="text"
id="BASE_URL"
name="BASE_URL"
placeholder="https://generativelanguage.googleapis.com/v1beta"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block">Gemini API的基础URL</small>
</div>
<!-- 自定义Headers -->
<div class="mb-6">
<label
for="CUSTOM_HEADERS"
class="block font-semibold mb-2 text-gray-700"
>自定义Headers</label
>
<div
class="bg-white rounded-lg border border-gray-200 p-4 mb-2 space-y-3"
id="CUSTOM_HEADERS_container"
style="
background-color: rgba(255, 255, 255, 0.95);
border: 1px solid rgba(0, 0, 0, 0.12);
color: #374151;
"
>
<!-- 键值对将在这里动态添加 -->
<div class="text-gray-500 text-sm italic">
添加自定义请求头,例如 X-Api-Key: your-key
</div>
</div>
<div class="flex justify-end">
<button
type="button"
class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
id="addCustomHeaderBtn"
>
<i class="fas fa-plus"></i> 添加Header
</button>
</div>
<small class="text-gray-500 mt-1 block"
>在这里添加的键值对将被添加到所有出站API请求的Header中。</small
>
</div>
<!-- Vertex Express API密钥列表 -->
<div class="mb-6">
<label
for="VERTEX_API_KEYS"
class="block font-semibold mb-2 text-gray-700"
>Vertex Express API密钥列表</label
>
<div class="array-container" id="VERTEX_API_KEYS_container">
<!-- 数组项将在这里动态添加 -->
</div>
<div class="flex justify-end gap-2">
<button
type="button"
class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
id="bulkDeleteVertexApiKeyBtn"
>
<i class="fas fa-trash-alt"></i> 删除Vertex密钥
</button>
<button
type="button"
class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
id="addVertexApiKeyBtn"
>
<i class="fas fa-plus"></i> 添加Vertex密钥
</button>
</div>
<small class="text-gray-500 mt-1 block"
>Vertex AI Platform API密钥列表。点击按钮可批量添加或删除。</small
>
</div>
<!-- Vertex Express API基础URL -->
<div class="mb-6">
<label
for="VERTEX_EXPRESS_BASE_URL"
class="block font-semibold mb-2 text-gray-700"
>Vertex Express API基础URL</label
>
<input
type="text"
id="VERTEX_EXPRESS_BASE_URL"
name="VERTEX_EXPRESS_BASE_URL"
placeholder="https://aiplatform.googleapis.com/v1beta1/publishers/google/models"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block"
>Vertex Express API的基础URL</small
>
</div>
<!-- 智能路由配置 -->
<div class="mb-6">
<div class="flex items-center justify-between">
<label
for="URL_NORMALIZATION_ENABLED"
class="font-semibold text-gray-700"
>启用智能路由映射</label
>
<div
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
>
<input
type="checkbox"
name="URL_NORMALIZATION_ENABLED"
id="URL_NORMALIZATION_ENABLED"
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
/>
<label
for="URL_NORMALIZATION_ENABLED"
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
></label>
</div>
</div>
<small class="text-gray-500 mt-1 block">
自动客户端请求的url拼接为正确格式(仅保证正常聊天,出现问题请关闭)
</small>
</div>
<!-- 最大失败次数 -->
<div class="mb-6">
<label
for="MAX_FAILURES"
class="block font-semibold mb-2 text-gray-700"
>最大失败次数</label
>
<input
type="number"
id="MAX_FAILURES"
name="MAX_FAILURES"
min="1"
max="100"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block"
>API密钥失败后标记为无效的次数</small
>
</div>
<!-- 请求超时时间 -->
<div class="mb-6">
<label for="TIME_OUT" class="block font-semibold mb-2 text-gray-700"
>请求超时时间(秒)</label
>
<input
type="number"
id="TIME_OUT"
name="TIME_OUT"
min="1"
max="600"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block">API请求的超时时间</small>
</div>
<!-- 最大重试次数 -->
<div class="mb-6">
<label
for="MAX_RETRIES"
class="block font-semibold mb-2 text-gray-700"
>最大重试次数</label
>
<input
type="number"
id="MAX_RETRIES"
name="MAX_RETRIES"
min="0"
max="10"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block"
>API请求失败后的最大重试次数</small
>
</div>
<!-- 代理服务器列表 -->
<div class="mb-6">
<label for="PROXIES" class="block font-semibold mb-2 text-gray-700"
>代理服务器列表</label
>
<div class="array-container" id="PROXIES_container">
<!-- 代理项将在这里动态添加 -->
</div>
<div class="flex justify-end gap-2">
<button
type="button"
class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
id="bulkDeleteProxyBtn"
>
<i class="fas fa-trash-alt"></i> 删除代理
</button>
<button
type="button"
class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
id="checkAllProxiesBtn"
>
<i class="fas fa-globe"></i> 检测所有代理
</button>
<button
type="button"
class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
id="addProxyBtn"
>
<i class="fas fa-plus"></i> 添加代理
</button>
</div>
<small class="text-gray-500 mt-1 block"
>代理服务器列表,支持 http 和 socks5 格式,例如:
http://user:pass@host:port 或
socks5://host:port。点击按钮可批量添加或删除。</small
>
</div>
<!-- 代理使用策略 -->
<div class="mb-6">
<div class="flex items-center justify-between">
<label
for="PROXIES_USE_CONSISTENCY_HASH_BY_API_KEY"
class="font-semibold text-gray-700"
>是否开启固定代理策略</label
>
<div
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
>
<input
type="checkbox"
name="PROXIES_USE_CONSISTENCY_HASH_BY_API_KEY"
id="PROXIES_USE_CONSISTENCY_HASH_BY_API_KEY"
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
/>
<label
for="PROXIES_USE_CONSISTENCY_HASH_BY_API_KEY"
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
></label>
</div>
</div>
<small class="text-gray-500 mt-1 block"
>开启后,对于每一个API_KEY将根据算法从代理列表中选取同一个代理IP,防止一个API_KEY同时被多个IP访问,也同时防止了一个IP访问了过多的API_KEY。</small
>
</div>
</div>
<!-- 模型相关配置 -->
<div class="config-section" id="model-section">
<h2
class="text-xl font-bold mb-6 pb-3 border-b flex items-center gap-2 text-gray-800 border-violet-300 border-opacity-30"
>
<i class="fas fa-robot text-violet-400"></i> 模型相关配置
</h2>
<!-- 测试模型 -->
<div class="mb-6">
<label for="TEST_MODEL" class="block font-semibold mb-2 text-gray-700"
>测试模型</label
>
<div class="flex items-center gap-2">
<input
type="text"
id="TEST_MODEL"
name="TEST_MODEL"
placeholder="gemini-1.5-flash"
class="flex-grow px-4 py-3 rounded-lg form-input-themed"
/>
<button
type="button"
title="选择模型"
class="model-helper-trigger-btn p-2 rounded-md text-violet-300 hover:bg-violet-700 transition-colors"
data-target-input-id="TEST_MODEL"
>
<i class="fas fa-list-ul"></i>
</button>
</div>
<small class="text-gray-500 mt-1 block">用于测试API密钥的模型</small>
</div>
<!-- 图像模型列表 -->
<div class="mb-6">
<label
for="IMAGE_MODELS"
class="block font-semibold mb-2 text-gray-700"
>图像模型列表</label
>
<div class="array-container" id="IMAGE_MODELS_container">
<!-- 数组项将在这里动态添加 -->
</div>
<div class="flex justify-end gap-2 mt-2">
<button
type="button"
title="从列表选择模型添加到下方"
class="model-helper-trigger-btn p-2 rounded-md text-violet-300 hover:bg-violet-700 transition-colors"
data-target-array-key="IMAGE_MODELS"
>
<i class="fas fa-list-ul"></i>
</button>
<button
type="button"
class="bg-violet-600 hover:bg-violet-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
onclick="addArrayItem('IMAGE_MODELS')"
>
<i class="fas fa-plus"></i> 添加模型
</button>
</div>
<small class="text-gray-500 mt-1 block">支持图像处理的模型列表</small>
</div>
<!-- 搜索模型列表 -->
<div class="mb-6">
<label
for="SEARCH_MODELS"
class="block font-semibold mb-2 text-gray-700"
>搜索模型列表</label
>
<div class="array-container" id="SEARCH_MODELS_container">
<!-- 数组项将在这里动态添加 -->
</div>
<div class="flex justify-end gap-2 mt-2">
<button
type="button"
title="从列表选择模型添加到下方"
class="model-helper-trigger-btn p-2 rounded-md text-violet-300 hover:bg-violet-700 transition-colors"
data-target-array-key="SEARCH_MODELS"
>
<i class="fas fa-list-ul"></i>
</button>
<button
type="button"
class="bg-violet-600 hover:bg-violet-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
onclick="addArrayItem('SEARCH_MODELS')"
>
<i class="fas fa-plus"></i> 添加模型
</button>
</div>
<small class="text-gray-500 mt-1 block">支持搜索功能的模型列表</small>
</div>
<!-- 过滤模型列表 -->
<div class="mb-6">
<label
for="FILTERED_MODELS"
class="block font-semibold mb-2 text-gray-700"
>过滤模型列表</label
>
<div class="array-container" id="FILTERED_MODELS_container">
<!-- 数组项将在这里动态添加 -->
</div>
<div class="flex justify-end gap-2 mt-2">
<button
type="button"
title="从列表选择模型添加到下方"
class="model-helper-trigger-btn p-2 rounded-md text-violet-300 hover:bg-violet-700 transition-colors"
data-target-array-key="FILTERED_MODELS"
>
<i class="fas fa-list-ul"></i>
</button>
<button
type="button"
class="bg-violet-600 hover:bg-violet-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
onclick="addArrayItem('FILTERED_MODELS')"
>
<i class="fas fa-plus"></i> 添加模型
</button>
</div>
<small class="text-gray-500 mt-1 block">需要过滤的模型列表</small>
</div>
<!-- 启用代码执行工具 -->
<div class="mb-6 flex items-center justify-between">
<label
for="TOOLS_CODE_EXECUTION_ENABLED"
class="font-semibold text-gray-700"
>启用代码执行工具</label
>
<div
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
>
<input
type="checkbox"
name="TOOLS_CODE_EXECUTION_ENABLED"
id="TOOLS_CODE_EXECUTION_ENABLED"
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
/>
<label
for="TOOLS_CODE_EXECUTION_ENABLED"
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
></label>
</div>
</div>
<!-- 启用网址上下文 -->
<div class="mb-6 flex items-center justify-between">
<label for="URL_CONTEXT_ENABLED" class="font-semibold text-gray-700"
>启用网址上下文</label
>
<div
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
>
<input
type="checkbox"
name="URL_CONTEXT_ENABLED"
id="URL_CONTEXT_ENABLED"
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
/>
<label
for="URL_CONTEXT_ENABLED"
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
></label>
</div>
</div>
<!-- 网址上下文模型列表 -->
<div class="mb-6">
<label
for="URL_CONTEXT_MODELS"
class="block font-semibold mb-2 text-gray-700"
>网址上下文模型列表</label
>
<div class="array-container" id="URL_CONTEXT_MODELS_container">
<!-- 数组项将在这里动态添加 -->
</div>
<div class="flex justify-end gap-2 mt-2">
<button
type="button"
title="从列表选择模型添加到下方"
class="model-helper-trigger-btn p-2 rounded-md text-violet-300 hover:bg-violet-700 transition-colors"
data-target-array-key="URL_CONTEXT_MODELS"
>
<i class="fas fa-list-ul"></i>
</button>
<button
type="button"
class="bg-violet-600 hover:bg-violet-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
onclick="addArrayItem('URL_CONTEXT_MODELS')"
>
<i class="fas fa-plus"></i> 添加模型
</button>
</div>
<small class="text-gray-500 mt-1 block"
>支持网址上下文功能的模型列表</small
>
</div>
<!-- 显示搜索链接 -->
<div class="mb-6 flex items-center justify-between">
<label for="SHOW_SEARCH_LINK" class="font-semibold text-gray-700"
>显示搜索链接</label
>
<div
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
>
<input
type="checkbox"
name="SHOW_SEARCH_LINK"
id="SHOW_SEARCH_LINK"
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
/>
<label
for="SHOW_SEARCH_LINK"
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
></label>
</div>
</div>
<!-- 显示思考过程 -->
<div class="mb-6 flex items-center justify-between">
<label for="SHOW_THINKING_PROCESS" class="font-semibold text-gray-700"
>显示思考过程</label
>
<div
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
>
<input
type="checkbox"
name="SHOW_THINKING_PROCESS"
id="SHOW_THINKING_PROCESS"
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
/>
<label
for="SHOW_THINKING_PROCESS"
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
></label>
</div>
</div>
<!-- 思考模型列表 -->
<div class="mb-6">
<label
for="THINKING_MODELS"
class="block font-semibold mb-2 text-gray-700"
>思考模型列表</label
>
<div class="array-container" id="THINKING_MODELS_container">
<!-- 数组项将在这里动态添加 -->
</div>
<div class="flex justify-end gap-2 mt-2">
<button
type="button"
title="从列表选择模型添加到下方"
class="model-helper-trigger-btn p-2 rounded-md text-violet-300 hover:bg-violet-700 transition-colors"
data-target-array-key="THINKING_MODELS"
>
<i class="fas fa-list-ul"></i>
</button>
<button
type="button"
class="bg-violet-600 hover:bg-violet-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
onclick="addArrayItem('THINKING_MODELS')"
>
<i class="fas fa-plus"></i> 添加模型
</button>
</div>
<small class="text-gray-500 mt-1 block"
>用于"思考过程"的模型列表</small
>
</div>
<!-- 思考模型预算映射 -->
<div class="mb-6">
<label
for="THINKING_BUDGET_MAP"
class="block font-semibold mb-2 text-gray-700"
>思考模型预算映射</label
>
<div
class="bg-white rounded-lg border border-gray-200 p-4 mb-2 space-y-3"
id="THINKING_BUDGET_MAP_container"
style="
background-color: rgba(255, 255, 255, 0.95);
border: 1px solid rgba(0, 0, 0, 0.12);
color: #374151;
"
>
<!-- 键值对将在这里动态添加 -->
<div class="text-gray-500 text-sm italic">
请先在上方添加思考模型,然后在此处配置预算。
</div>
</div>
<!-- 移除添加预算映射按钮 -->
<!-- <div class="flex justify-end">
<button type="button" class="bg-primary-600 hover:bg-primary-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2" id="addBudgetMapItemBtn">
<i class="fas fa-plus"></i> 添加预算映射
</button>
</div> -->
<small class="text-gray-500 mt-1 block"
>为每个思考模型设置预算(-1为auto,最大值
32767),此项与上方模型列表自动关联。</small
>
</div>
<!-- 安全设置 -->
<div class="mb-6">
<label
for="SAFETY_SETTINGS"
class="block font-semibold mb-2 text-gray-700"
>安全设置 (Safety Settings)</label
>
<div
class="bg-white rounded-lg border border-gray-200 p-4 mb-2 space-y-3"
id="SAFETY_SETTINGS_container"
style="
background-color: rgba(255, 255, 255, 0.95);
border: 1px solid rgba(0, 0, 0, 0.12);
color: #374151;
"
>
<!-- 安全设置项将在这里动态添加 -->
<div class="text-gray-500 text-sm italic">
定义模型的安全过滤阈值。
</div>
</div>
<div class="flex justify-end">
<button
type="button"
class="bg-violet-600 hover:bg-violet-700 text-white px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2"
id="addSafetySettingBtn"
>
<i class="fas fa-plus"></i> 添加安全设置
</button>
</div>
<small class="text-gray-500 mt-1 block"
>配置模型的安全过滤级别,例如 HARM_CATEGORY_HARASSMENT:
BLOCK_NONE。</small
>
<div class="warning-text">
<i class="fas fa-exclamation-triangle"></i>
<span
>建议设置成OFF,其他值会影响输出速度,非必要不要随便改动。</span
>
</div>
</div>
</div>
<!-- TTS配置 -->
<div class="config-section" id="tts-section">
<h2
class="text-xl font-bold mb-6 pb-3 border-b flex items-center gap-2 text-gray-800 border-violet-300 border-opacity-30"
>
<i class="fas fa-volume-up text-violet-400"></i> TTS 相关配置
</h2>
<!-- TTS 模型 -->
<div class="mb-6">
<label for="TTS_MODEL" class="block font-semibold mb-2 text-gray-700"
>TTS 模型</label
>
<select
id="TTS_MODEL"
name="TTS_MODEL"
class="w-full px-4 py-3 rounded-lg form-select-themed"
>
<option value="gemini-2.5-flash-preview-tts">
gemini-2.5-flash-preview-tts
</option>
<option value="gemini-2.5-pro-preview-tts">
gemini-2.5-pro-preview-tts
</option>
</select>
<small class="text-gray-500 mt-1 block">用于TTS的模型</small>
</div>
<!-- TTS 语音名称 -->
<div class="mb-6">
<label
for="TTS_VOICE_NAME"
class="block font-semibold mb-2 text-gray-700"
>TTS 语音名称</label
>
<select
id="TTS_VOICE_NAME"
name="TTS_VOICE_NAME"
class="w-full px-4 py-3 rounded-lg form-select-themed"
>
<option value="Zephyr">Zephyr (明亮)</option>
<option value="Puck">Puck (欢快)</option>
<option value="Charon">Charon (信息丰富)</option>
<option value="Kore">Kore (坚定)</option>
<option value="Fenrir">Fenrir (易激动)</option>
<option value="Leda">Leda (年轻)</option>
<option value="Orus">Orus (坚定)</option>
<option value="Aoede">Aoede (轻松)</option>
<option value="Callirrhoe">Callirrhoe (随和)</option>
<option value="Autonoe">Autonoe (明亮)</option>
<option value="Enceladus">Enceladus (呼吸感)</option>
<option value="Iapetus">Iapetus (清晰)</option>
<option value="Umbriel">Umbriel (随和)</option>
<option value="Algieba">Algieba (平滑)</option>
<option value="Despina">Despina (平滑)</option>
<option value="Erinome">Erinome (清晰)</option>
<option value="Algenib">Algenib (沙哑)</option>
<option value="Rasalgethi">Rasalgethi (信息丰富)</option>
<option value="Laomedeia">Laomedeia (欢快)</option>
<option value="Achernar">Achernar (轻柔)</option>
<option value="Alnilam">Alnilam (坚定)</option>
<option value="Schedar">Schedar (平稳)</option>
<option value="Gacrux">Gacrux (成熟)</option>
<option value="Pulcherrima">Pulcherrima (向前)</option>
<option value="Achird">Achird (友好)</option>
<option value="Zubenelgenubi">Zubenelgenubi (休闲)</option>
<option value="Vindemiatrix">Vindemiatrix (温柔)</option>
<option value="Sadachbia">Sadachbia (活泼)</option>
<option value="Sadaltager">Sadaltager (博学)</option>
<option value="Sulafat">Sulafat (温暖)</option>
</select>
<small class="text-gray-500 mt-1 block"
>TTS 的语音名称,控制风格、语调、口音和节奏</small
>
</div>
<!-- TTS 语速 -->
<div class="mb-6">
<label for="TTS_SPEED" class="block font-semibold mb-2 text-gray-700"
>TTS 语速</label
>
<select
id="TTS_SPEED"
name="TTS_SPEED"
class="w-full px-4 py-3 rounded-lg form-select-themed"
>
<option value="slow">慢</option>
<option value="normal">正常</option>
<option value="fast">快</option>
</select>
<small class="text-gray-500 mt-1 block">选择 TTS 的语速</small>
</div>
</div>
<!-- 图像生成相关配置 -->
<div class="config-section" id="image-section">
<h2
class="text-xl font-bold mb-6 pb-3 border-b flex items-center gap-2 text-gray-800 border-violet-300 border-opacity-30"
>
<i class="fas fa-image text-violet-400"></i> 图像生成配置
</h2>
<!-- 付费API密钥 -->
<div class="mb-6">
<label for="PAID_KEY" class="block font-semibold mb-2 text-gray-700"
>付费API密钥</label
>
<input
type="text"
id="PAID_KEY"
name="PAID_KEY"
placeholder="AIzaSyxxxxxxxxxxxxxxxxxxx"
class="w-full px-4 py-3 rounded-lg sensitive-input form-input-themed"
/>
<small class="text-gray-500 mt-1 block"
>用于图像生成的付费API密钥</small
>
</div>
<!-- 图像生成模型 -->
<div class="mb-6">
<label
for="CREATE_IMAGE_MODEL"
class="block font-semibold mb-2 text-gray-700"
>图像生成模型</label
>
<div class="flex items-center gap-2">
<input
type="text"
id="CREATE_IMAGE_MODEL"
name="CREATE_IMAGE_MODEL"
placeholder="imagen-3.0-generate-002"
class="flex-grow px-4 py-3 rounded-lg form-input-themed"
/>
<button
type="button"
title="选择模型"
class="model-helper-trigger-btn p-2 rounded-md text-violet-300 hover:bg-violet-700 transition-colors"
data-target-input-id="CREATE_IMAGE_MODEL"
>
<i class="fas fa-list-ul"></i>
</button>
</div>
<small class="text-gray-500 mt-1 block">用于图像生成的模型</small>
</div>
<!-- 上传提供商 -->
<div class="mb-6">
<label
for="UPLOAD_PROVIDER"
class="block font-semibold mb-2 text-gray-700"
>上传提供商</label
>
<select
id="UPLOAD_PROVIDER"
name="UPLOAD_PROVIDER"
class="w-full px-4 py-3 rounded-lg form-select-themed"
>
<option value="smms" selected>SM.MS</option>
<option value="picgo">PicGo</option>
<option value="cloudflare_imgbed">Cloudflare</option>
</select>
<small class="text-gray-500 mt-1 block">图片上传服务提供商</small>
</div>
<!-- SM.MS密钥 -->
<div class="mb-6 provider-config active" data-provider="smms">
<label
for="SMMS_SECRET_TOKEN"
class="block font-semibold mb-2 text-gray-700"
>SM.MS密钥</label
>
<input
type="text"
id="SMMS_SECRET_TOKEN"
name="SMMS_SECRET_TOKEN"
placeholder="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
class="w-full px-4 py-3 rounded-lg sensitive-input form-input-themed"
/>
<small class="text-gray-500 mt-1 block">SM.MS图床的密钥</small>
</div>
<!-- PicGo API URL -->
<div class="mb-6 provider-config" data-provider="picgo">
<label
for="PICGO_API_URL"
class="block font-semibold mb-2 text-gray-700"
>PicGo API地址</label
>
<input
type="text"
id="PICGO_API_URL"
name="PICGO_API_URL"
placeholder="https://www.picgo.net/api/1/upload"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block">PicGo服务器的API地址,默认为 https://www.picgo.net/api/1/upload</small>
</div>
<!-- PicGo API密钥 -->
<div class="mb-6 provider-config" data-provider="picgo">
<label
for="PICGO_API_KEY"
class="block font-semibold mb-2 text-gray-700"
>PicGo API密钥</label
>
<input
type="text"
id="PICGO_API_KEY"
name="PICGO_API_KEY"
placeholder="xxxx"
class="w-full px-4 py-3 rounded-lg sensitive-input form-input-themed"
/>
<small class="text-gray-500 mt-1 block">PicGo的API密钥</small>
</div>
<!-- Cloudflare图床URL -->
<div class="mb-6 provider-config" data-provider="cloudflare_imgbed">
<label
for="CLOUDFLARE_IMGBED_URL"
class="block font-semibold mb-2 text-gray-700"
>Cloudflare图床URL</label
>
<input
type="text"
id="CLOUDFLARE_IMGBED_URL"
name="CLOUDFLARE_IMGBED_URL"
placeholder="https://xxxxxxx.pages.dev/upload"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block">Cloudflare图床的URL</small>
</div>
<!-- Cloudflare认证码 -->
<div class="mb-6 provider-config" data-provider="cloudflare_imgbed">
<label
for="CLOUDFLARE_IMGBED_AUTH_CODE"
class="block font-semibold mb-2 text-gray-700"
>Cloudflare认证码</label
>
<input
type="text"
id="CLOUDFLARE_IMGBED_AUTH_CODE"
name="CLOUDFLARE_IMGBED_AUTH_CODE"
placeholder="xxxxxxxxx"
class="w-full px-4 py-3 rounded-lg sensitive-input form-input-themed"
/>
<small class="text-gray-500 mt-1 block">Cloudflare图床的认证码</small>
</div>
<!-- Cloudflare上传文件夹 -->
<div class="mb-6 provider-config" data-provider="cloudflare_imgbed">
<label
for="CLOUDFLARE_IMGBED_UPLOAD_FOLDER"
class="block font-semibold mb-2 text-gray-700"
>Cloudflare上传文件夹</label
>
<input
type="text"
id="CLOUDFLARE_IMGBED_UPLOAD_FOLDER"
name="CLOUDFLARE_IMGBED_UPLOAD_FOLDER"
placeholder=""
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block"
>Cloudflare图床的上传文件夹路径(可选)</small
>
</div>
</div>
<!-- 流式输出优化配置 -->
<div class="config-section" id="stream-section">
<h2
class="text-xl font-bold mb-6 pb-3 border-b flex items-center gap-2 text-gray-800 border-violet-300 border-opacity-30"
>
<i class="fas fa-stream text-violet-400"></i> 流式输出相关配置
</h2>
<!-- 启用流式输出优化 -->
<div class="mb-6 flex items-center justify-between">
<label
for="STREAM_OPTIMIZER_ENABLED"
class="font-semibold text-gray-700"
>启用流式输出优化</label
>
<div
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
>
<input
type="checkbox"
name="STREAM_OPTIMIZER_ENABLED"
id="STREAM_OPTIMIZER_ENABLED"
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
/>
<label
for="STREAM_OPTIMIZER_ENABLED"
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
></label>
</div>
</div>
<!-- 最小延迟 -->
<div class="mb-6">
<label
for="STREAM_MIN_DELAY"
class="block font-semibold mb-2 text-gray-700"
>最小延迟(秒)</label
>
<input
type="number"
id="STREAM_MIN_DELAY"
name="STREAM_MIN_DELAY"
min="0"
max="1"
step="0.001"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block">流式输出的最小延迟时间</small>
</div>
<!-- 最大延迟 -->
<div class="mb-6">
<label
for="STREAM_MAX_DELAY"
class="block font-semibold mb-2 text-gray-700"
>最大延迟(秒)</label
>
<input
type="number"
id="STREAM_MAX_DELAY"
name="STREAM_MAX_DELAY"
min="0"
max="1"
step="0.001"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block">流式输出的最大延迟时间</small>
</div>
<!-- 短文本阈值 -->
<div class="mb-6">
<label
for="STREAM_SHORT_TEXT_THRESHOLD"
class="block font-semibold mb-2 text-gray-700"
>短文本阈值</label
>
<input
type="number"
id="STREAM_SHORT_TEXT_THRESHOLD"
name="STREAM_SHORT_TEXT_THRESHOLD"
min="1"
max="100"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block">短文本的字符阈值</small>
</div>
<!-- 长文本阈值 -->
<div class="mb-6">
<label
for="STREAM_LONG_TEXT_THRESHOLD"
class="block font-semibold mb-2 text-gray-700"
>长文本阈值</label
>
<input
type="number"
id="STREAM_LONG_TEXT_THRESHOLD"
name="STREAM_LONG_TEXT_THRESHOLD"
min="1"
max="1000"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block">长文本的字符阈值</small>
</div>
<!-- 分块大小 -->
<div class="mb-6">
<label
for="STREAM_CHUNK_SIZE"
class="block font-semibold mb-2 text-gray-700"
>分块大小</label
>
<input
type="number"
id="STREAM_CHUNK_SIZE"
name="STREAM_CHUNK_SIZE"
min="1"
max="100"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block">流式输出的分块大小</small>
</div>
<!-- Fake Streaming Configuration -->
<h3
class="text-lg font-semibold mb-4 pt-4 border-t border-violet-300 border-opacity-20 text-gray-200"
>
<i class="fas fa-ghost text-violet-400"></i> 假流式配置 (Fake
Streaming)
</h3>
<!-- 启用假流式输出 -->
<div class="mb-6 flex items-center justify-between">
<label for="FAKE_STREAM_ENABLED" class="font-semibold text-gray-700"
>启用假流式输出</label
>
<div
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
>
<input
type="checkbox"
name="FAKE_STREAM_ENABLED"
id="FAKE_STREAM_ENABLED"
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
/>
<label
for="FAKE_STREAM_ENABLED"
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
></label>
</div>
</div>
<small class="text-gray-500 mt-1 block mb-4"
>当启用时,将调用非流式接口,并在等待响应期间发送空数据以维持连接。</small
>
<!-- 假流式发送空数据的间隔时间 -->
<div class="mb-6">
<label
for="FAKE_STREAM_EMPTY_DATA_INTERVAL_SECONDS"
class="block font-semibold mb-2 text-gray-700"
>假流式空数据发送间隔(秒)</label
>
<input
type="number"
id="FAKE_STREAM_EMPTY_DATA_INTERVAL_SECONDS"
name="FAKE_STREAM_EMPTY_DATA_INTERVAL_SECONDS"
min="1"
max="60"
step="1"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block"
>在启用假流式输出时,向客户端发送空数据以维持连接状态的时间间隔(建议
3-10 秒)。</small
>
</div>
</div>
<!-- 定时任务配置 -->
<div class="config-section" id="scheduler-section">
<h2
class="text-xl font-bold mb-6 pb-3 border-b flex items-center gap-2 text-gray-800 border-violet-300 border-opacity-30"
>
<i class="fas fa-clock text-violet-400"></i> 定时任务配置
</h2>
<!-- 检查间隔 -->
<div class="mb-6">
<label
for="CHECK_INTERVAL_HOURS"
class="block font-semibold mb-2 text-gray-700"
>检查间隔(小时)</label
>
<input
type="number"
id="CHECK_INTERVAL_HOURS"
name="CHECK_INTERVAL_HOURS"
min="1"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block"
>定时检查密钥状态的间隔时间(单位:小时)</small
>
</div>
<!-- 时区 -->
<div class="mb-6">
<label for="TIMEZONE" class="block font-semibold mb-2 text-gray-700"
>时区</label
>
<input
type="text"
id="TIMEZONE"
name="TIMEZONE"
placeholder="例如: Asia/Shanghai"
class="w-full px-4 py-3 rounded-lg form-input-themed"
/>
<small class="text-gray-500 mt-1 block"
>定时任务使用的时区,格式如 "Asia/Shanghai" 或 "UTC"</small
>
</div>
</div>
<!-- 日志配置 -->
<div class="config-section" id="logging-section">
<h2
class="text-xl font-bold mb-6 pb-3 border-b flex items-center gap-2 text-gray-800 border-violet-300 border-opacity-30"
>
<i class="fas fa-file-alt text-violet-400"></i> 日志配置
</h2>
<!-- 日志级别 -->
<div class="mb-6">
<label for="LOG_LEVEL" class="block font-semibold mb-2 text-gray-700"
>日志级别</label
>
<select
id="LOG_LEVEL"
name="LOG_LEVEL"
class="w-full px-4 py-3 rounded-lg form-select-themed"
>
<option value="DEBUG">DEBUG</option>
<option value="INFO">INFO</option>
<option value="WARNING">WARNING</option>
<option value="ERROR">ERROR</option>
<option value="CRITICAL">CRITICAL</option>
</select>
<small class="text-gray-500 mt-1 block"
>设置应用程序的日志记录详细程度</small
>
</div>
<!-- 自动删除错误日志 -->
<div class="mb-6">
<div class="flex items-center justify-between">
<label
for="AUTO_DELETE_ERROR_LOGS_ENABLED"
class="font-semibold text-gray-700"
>是否开启自动删除错误日志</label
>
<div
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
>
<input
type="checkbox"
name="AUTO_DELETE_ERROR_LOGS_ENABLED"
id="AUTO_DELETE_ERROR_LOGS_ENABLED"
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
/>
<label
for="AUTO_DELETE_ERROR_LOGS_ENABLED"
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
></label>
</div>
</div>
<small class="text-gray-500 mt-1 block"
>开启后,将自动删除指定天数前的错误日志。</small
>
</div>
<!-- 自动删除日志天数 -->
<div class="mb-6">
<label
for="AUTO_DELETE_ERROR_LOGS_DAYS"
class="block font-semibold mb-2 text-gray-700"
>自动删除多少天前的错误日志</label
>
<select
id="AUTO_DELETE_ERROR_LOGS_DAYS"
name="AUTO_DELETE_ERROR_LOGS_DAYS"
class="w-full px-4 py-3 rounded-lg form-select-themed"
>
<option value="1">1 天</option>
<option value="7">7 天</option>
<option value="30">30 天</option>
</select>
<small class="text-gray-500 mt-1 block"
>选择自动删除错误日志的天数。</small
>
</div>
<!-- 自动删除请求日志 -->
<div class="mb-6">
<div class="flex items-center justify-between">
<label
for="AUTO_DELETE_REQUEST_LOGS_ENABLED"
class="font-semibold text-gray-700"
>是否开启自动删除请求日志</label
>
<div
class="relative inline-block w-10 mr-2 align-middle select-none transition duration-200 ease-in"
>
<input
type="checkbox"
name="AUTO_DELETE_REQUEST_LOGS_ENABLED"
id="AUTO_DELETE_REQUEST_LOGS_ENABLED"
class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"
/>
<label
for="AUTO_DELETE_REQUEST_LOGS_ENABLED"
class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"
></label>
</div>
</div>
<small class="text-gray-500 mt-1 block"
>开启后,将自动删除指定天数前的请求日志。</small
>
</div>
<!-- 自动删除请求日志天数 -->
<div class="mb-6">
<label
for="AUTO_DELETE_REQUEST_LOGS_DAYS"
class="block font-semibold mb-2 text-gray-700"
>自动删除多少天前的请求日志</label
>
<select
id="AUTO_DELETE_REQUEST_LOGS_DAYS"
name="AUTO_DELETE_REQUEST_LOGS_DAYS"
class="w-full px-4 py-3 rounded-lg form-select-themed"
>
<option value="1">1 天</option>
<option value="7">7 天</option>
<option value="30">30 天</option>
</select>
<small class="text-gray-500 mt-1 block"
>选择自动删除请求日志的天数。</small
>
</div>
</div>
<!-- Action Buttons -->
<div
class="flex flex-col md:flex-row justify-center gap-4 mt-8 pt-4 pb-2"
>
<button
type="button"
id="saveBtn"
class="action-btn text-white px-8 py-3 rounded-xl font-semibold transition-all duration-300 hover:shadow-lg flex items-center justify-center gap-2"
style="
background-color: #3b82f6 !important;
color: #ffffff !important;
"
>
<i class="fas fa-save"></i> 保存配置
</button>
<button
type="button"
id="resetBtn"
class="action-btn bg-gradient-to-r from-gray-600 to-gray-700 text-white px-8 py-3 rounded-xl font-semibold transition-all duration-300 hover:shadow-lg flex items-center justify-center gap-2"
style="
background-color: #6b7280 !important;
color: #ffffff !important;
"
>
<i class="fas fa-undo"></i> 重置配置
</button>
</div>
</form>
</div>
</div>
<!-- Scroll buttons are now in base.html -->
<div class="scroll-buttons">
<button class="scroll-button" onclick="scrollToTop()" title="回到顶部">
<i class="fas fa-chevron-up"></i>
</button>
<button class="scroll-button" onclick="scrollToBottom()" title="滚动到底部">
<i class="fas fa-chevron-down"></i>
</button>
</div>
<!-- Notification component is now in base.html -->
<div id="notification" class="notification"></div>
<!-- Footer is now in base.html -->
<!-- API Key Add Modal -->
<div id="apiKeyModal" class="modal">
<div
class="w-full max-w-lg mx-auto rounded-2xl shadow-2xl overflow-hidden animate-fade-in"
style="
background-color: rgba(255, 255, 255, 0.98);
color: #374151;
border: 1px solid rgba(0, 0, 0, 0.12);
"
>
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-bold text-gray-800">批量添加 API 密钥</h2>
<button
id="closeApiKeyModalBtn"
class="text-gray-300 hover:text-gray-800 text-xl"
>
×
</button>
</div>
<p class="text-gray-300 mb-4">
每行粘贴一个或多个密钥,将自动提取有效密钥并去重。
</p>
<textarea
id="apiKeyBulkInput"
rows="10"
placeholder="在此处粘贴 API 密钥..."
class="w-full px-4 py-3 rounded-lg font-mono text-sm form-input-themed"
></textarea>
<div class="flex justify-end gap-3 mt-6">
<button
type="button"
id="confirmAddApiKeyBtn"
class="bg-violet-600 hover:bg-violet-700 text-white px-6 py-2 rounded-lg font-medium transition"
>
确认添加
</button>
<button
type="button"
id="cancelAddApiKeyBtn"
class="bg-gray-500 bg-opacity-50 hover:bg-opacity-70 text-gray-200 px-6 py-2 rounded-lg font-medium transition"
>
取消
</button>
</div>
</div>
</div>
</div>
<!-- Bulk Delete API Key Modal -->
<div id="bulkDeleteApiKeyModal" class="modal">
<div
class="w-full max-w-lg mx-auto rounded-2xl shadow-2xl overflow-hidden animate-fade-in"
style="
background-color: rgba(255, 255, 255, 0.98);
color: #374151;
border: 1px solid rgba(0, 0, 0, 0.12);
"
>
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-bold text-gray-800">批量删除 API 密钥</h2>
<button
id="closeBulkDeleteModalBtn"
class="text-gray-300 hover:text-gray-800 text-xl"
>
×
</button>
</div>
<p class="text-gray-300 mb-4">
每行粘贴一个或多个密钥,将自动提取有效密钥并从列表中删除。
</p>
<textarea
id="bulkDeleteApiKeyInput"
rows="10"
placeholder="在此处粘贴要删除的 API 密钥..."
class="w-full px-4 py-3 rounded-lg font-mono text-sm form-input-themed"
></textarea>
<div class="flex justify-end gap-3 mt-6">
<button
type="button"
id="confirmBulkDeleteApiKeyBtn"
class="bg-red-600 hover:bg-red-700 text-white px-6 py-2 rounded-lg font-medium transition"
>
确认删除
</button>
<button
type="button"
id="cancelBulkDeleteApiKeyBtn"
class="bg-gray-500 bg-opacity-50 hover:bg-opacity-70 text-gray-200 px-6 py-2 rounded-lg font-medium transition"
>
取消
</button>
</div>
</div>
</div>
</div>
<!-- Proxy Add Modal -->
<div id="proxyModal" class="modal">
<div
class="w-full max-w-lg mx-auto rounded-2xl shadow-2xl overflow-hidden animate-fade-in"
style="
background-color: rgba(255, 255, 255, 0.98);
color: #374151;
border: 1px solid rgba(0, 0, 0, 0.12);
"
>
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-bold text-gray-800">批量添加代理服务器</h2>
<button
id="closeProxyModalBtn"
class="text-gray-300 hover:text-gray-800 text-xl"
>
×
</button>
</div>
<p class="text-gray-300 mb-4">
每行粘贴一个或多个代理地址,将自动提取有效地址并去重。
</p>
<textarea
id="proxyBulkInput"
rows="10"
placeholder="在此处粘贴代理地址 (例如 http://user:pass@host:port 或 socks5://host:port)..."
class="w-full px-4 py-3 rounded-lg font-mono text-sm form-input-themed"
></textarea>
<div class="flex justify-end gap-3 mt-6">
<button
type="button"
id="confirmAddProxyBtn"
class="bg-violet-600 hover:bg-violet-700 text-white px-6 py-2 rounded-lg font-medium transition"
>
确认添加
</button>
<button
type="button"
id="cancelAddProxyBtn"
class="bg-gray-500 bg-opacity-50 hover:bg-opacity-70 text-gray-200 px-6 py-2 rounded-lg font-medium transition"
>
取消
</button>
</div>
</div>
</div>
</div>
<!-- Bulk Delete Proxy Modal -->
<div id="bulkDeleteProxyModal" class="modal">
<div
class="w-full max-w-lg mx-auto rounded-2xl shadow-2xl overflow-hidden animate-fade-in"
style="
background-color: rgba(255, 255, 255, 0.98);
color: #374151;
border: 1px solid rgba(0, 0, 0, 0.12);
"
>
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-bold text-gray-800">批量删除代理服务器</h2>
<button
id="closeBulkDeleteProxyModalBtn"
class="text-gray-300 hover:text-gray-800 text-xl"
>
×
</button>
</div>
<p class="text-gray-300 mb-4">
每行粘贴一个或多个代理地址,将自动提取有效地址并从列表中删除。
</p>
<textarea
id="bulkDeleteProxyInput"
rows="10"
placeholder="在此处粘贴要删除的代理地址..."
class="w-full px-4 py-3 rounded-lg font-mono text-sm form-input-themed"
></textarea>
<div class="flex justify-end gap-3 mt-6">
<button
type="button"
id="confirmBulkDeleteProxyBtn"
class="bg-red-600 hover:bg-red-700 text-white px-6 py-2 rounded-lg font-medium transition"
>
确认删除
</button>
<button
type="button"
id="cancelBulkDeleteProxyBtn"
class="bg-gray-500 bg-opacity-50 hover:bg-opacity-70 text-gray-200 px-6 py-2 rounded-lg font-medium transition"
>
取消
</button>
</div>
</div>
</div>
</div>
<!-- Reset Confirmation Modal -->
<div id="resetConfirmModal" class="modal">
<div
class="w-full max-w-md mx-auto rounded-2xl shadow-2xl overflow-hidden animate-fade-in"
style="
background-color: rgba(255, 255, 255, 0.98);
color: #374151;
border: 1px solid rgba(0, 0, 0, 0.12);
"
>
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-bold text-gray-800">确认重置配置</h2>
<button
id="closeResetModalBtn"
class="text-gray-300 hover:text-gray-800 text-xl"
>
×
</button>
</div>
<p class="text-gray-300 mb-6">
确定要重置所有配置吗?<br />这将恢复到默认值,此操作不可撤销。
</p>
<div class="flex justify-end gap-3">
<button
type="button"
id="confirmResetBtn"
class="bg-red-500 hover:bg-red-600 text-white px-6 py-2 rounded-lg font-medium transition"
>
确认重置
</button>
<button
type="button"
id="cancelResetBtn"
class="bg-violet-600 hover:bg-violet-700 text-white px-6 py-2 rounded-lg font-medium transition"
>
取消
</button>
</div>
</div>
</div>
</div>
<!-- Vertex Express API Key Add Modal -->
<div id="vertexApiKeyModal" class="modal">
<div
class="w-full max-w-lg mx-auto rounded-2xl shadow-2xl overflow-hidden animate-fade-in"
style="
background-color: rgba(255, 255, 255, 0.98);
color: #374151;
border: 1px solid rgba(0, 0, 0, 0.12);
"
>
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-bold text-gray-800">
批量添加 Vertex Express API 密钥
</h2>
<button
id="closeVertexApiKeyModalBtn"
class="text-gray-300 hover:text-gray-800 text-xl"
>
×
</button>
</div>
<p class="text-gray-300 mb-4">
每行粘贴一个或多个密钥,将自动提取有效密钥 (格式: AQ.开头,共53位)
并去重。
</p>
<textarea
id="vertexApiKeyBulkInput"
rows="10"
placeholder="在此处粘贴 Vertex Express API 密钥..."
class="w-full px-4 py-3 rounded-lg font-mono text-sm form-input-themed"
></textarea>
<div class="flex justify-end gap-3 mt-6">
<button
type="button"
id="confirmAddVertexApiKeyBtn"
class="bg-violet-600 hover:bg-violet-700 text-white px-6 py-2 rounded-lg font-medium transition"
>
确认添加
</button>
<button
type="button"
id="cancelAddVertexApiKeyBtn"
class="bg-gray-500 bg-opacity-50 hover:bg-opacity-70 text-gray-200 px-6 py-2 rounded-lg font-medium transition"
>
取消
</button>
</div>
</div>
</div>
</div>
<!-- Bulk Delete Vertex Express API Key Modal -->
<div id="bulkDeleteVertexApiKeyModal" class="modal">
<div
class="w-full max-w-lg mx-auto rounded-2xl shadow-2xl overflow-hidden animate-fade-in"
style="
background-color: rgba(255, 255, 255, 0.98);
color: #374151;
border: 1px solid rgba(0, 0, 0, 0.12);
"
>
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-bold text-gray-800">
批量删除 Vertex Express API 密钥
</h2>
<button
id="closeBulkDeleteVertexModalBtn"
class="text-gray-300 hover:text-gray-800 text-xl"
>
×
</button>
</div>
<p class="text-gray-300 mb-4">
每行粘贴一个或多个密钥,将自动提取有效密钥并从列表中删除。
</p>
<textarea
id="bulkDeleteVertexApiKeyInput"
rows="10"
placeholder="在此处粘贴要删除的 Vertex Express API 密钥..."
class="w-full px-4 py-3 rounded-lg font-mono text-sm form-input-themed"
></textarea>
<div class="flex justify-end gap-3 mt-6">
<button
type="button"
id="confirmBulkDeleteVertexApiKeyBtn"
class="bg-red-600 hover:bg-red-700 text-white px-6 py-2 rounded-lg font-medium transition"
>
确认删除
</button>
<button
type="button"
id="cancelBulkDeleteVertexApiKeyBtn"
class="bg-gray-500 bg-opacity-50 hover:bg-opacity-70 text-gray-200 px-6 py-2 rounded-lg font-medium transition"
>
取消
</button>
</div>
</div>
</div>
</div>
<!-- Proxy Check Results Modal -->
<div id="proxyCheckModal" class="modal">
<div
class="w-full max-w-4xl mx-auto rounded-2xl shadow-2xl overflow-hidden animate-fade-in"
style="
background-color: rgba(255, 255, 255, 0.98);
color: #374151;
border: 1px solid rgba(0, 0, 0, 0.12);
"
>
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-bold text-gray-800">代理检测结果</h2>
<button
id="closeProxyCheckModalBtn"
class="text-gray-300 hover:text-gray-800 text-xl"
>
×
</button>
</div>
<!-- 检测状态和进度 -->
<div id="proxyCheckProgress" class="mb-4 hidden">
<div class="flex items-center gap-2 mb-2">
<div class="w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"></div>
<span class="text-sm text-gray-600">检测中...</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2">
<div id="progressBar" class="bg-blue-500 h-2 rounded-full transition-all duration-300" style="width: 0%"></div>
</div>
<div class="text-xs text-gray-500 mt-1">
<span id="progressText">准备开始检测...</span>
</div>
</div>
<!-- 检测结果概览 -->
<div id="proxyCheckSummary" class="mb-4 hidden">
<div class="grid grid-cols-3 gap-4 text-center">
<div class="bg-green-50 border border-green-200 rounded-lg p-3">
<div class="text-2xl font-bold text-green-600" id="availableCount">0</div>
<div class="text-sm text-green-700">可用</div>
</div>
<div class="bg-red-50 border border-red-200 rounded-lg p-3">
<div class="text-2xl font-bold text-red-600" id="unavailableCount">0</div>
<div class="text-sm text-red-700">不可用</div>
</div>
<div class="bg-blue-50 border border-blue-200 rounded-lg p-3">
<div class="text-2xl font-bold text-blue-600" id="totalCount">0</div>
<div class="text-sm text-blue-700">总数</div>
</div>
</div>
</div>
<!-- 检测结果列表 -->
<div id="proxyCheckResults" class="space-y-2" style="max-height: 400px; overflow-y: auto;">
<!-- 检测结果将在这里动态添加 -->
</div>
<div class="flex justify-end gap-3 mt-6">
<button
type="button"
id="retryFailedProxiesBtn"
class="bg-orange-600 hover:bg-orange-700 text-white px-6 py-2 rounded-lg font-medium transition hidden"
>
重试失败的代理
</button>
<button
type="button"
id="closeProxyCheckBtn"
class="bg-gray-500 bg-opacity-50 hover:bg-opacity-70 text-gray-200 px-6 py-2 rounded-lg font-medium transition"
>
关闭
</button>
</div>
</div>
</div>
</div>
<!-- Model Helper Modal -->
<div id="modelHelperModal" class="modal">
<div
class="w-full max-w-lg mx-auto rounded-2xl shadow-2xl overflow-hidden animate-fade-in"
style="
background-color: rgba(255, 255, 255, 0.98);
color: #374151;
border: 1px solid rgba(0, 0, 0, 0.12);
"
>
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h2 id="modelHelperTitle" class="text-xl font-bold text-gray-800">
选择模型
</h2>
<button
id="closeModelHelperModalBtn"
class="text-gray-300 hover:text-gray-800 text-xl"
>
×
</button>
</div>
<input
type="text"
id="modelHelperSearchInput"
placeholder="搜索模型..."
class="w-full px-4 py-3 mb-4 rounded-lg font-mono text-sm form-input-themed"
/>
<div
id="modelHelperListContainer"
class="array-container"
style="max-height: 300px; overflow-y: auto"
>
<!-- Model items will be populated here -->
<p class="text-gray-400 text-sm italic">正在加载模型列表...</p>
</div>
<div class="flex justify-end gap-3 mt-6">
<button
type="button"
id="cancelModelHelperBtn"
class="bg-gray-500 bg-opacity-50 hover:bg-opacity-70 text-gray-200 px-6 py-2 rounded-lg font-medium transition"
>
关闭
</button>
</div>
</div>
</div>
</div>
{% endblock %} {% block body_scripts %}
<script src="/static/js/config_editor.js"></script>
<!-- 增强下拉框样式和交互性 -->
<script>
document.addEventListener("DOMContentLoaded", function () {
// 增强所有下拉框的交互性
const selects = document.querySelectorAll(".form-select-themed");
selects.forEach((select) => {
// 添加选择事件来应用选中效果
select.addEventListener("change", function () {
this.classList.add("selected");
// 设置微小的动画效果
this.style.transition = "all 0.2s ease";
this.style.transform = "scale(1.02)";
setTimeout(() => {
this.style.transform = "scale(1)";
}, 200);
});
// 添加焦点事件
select.addEventListener("focus", function () {
this.style.boxShadow = "0 0 0 3px rgba(216, 180, 254, 0.5)";
});
// 根据是否有选中值添加选中样式
if (select.value && select.value !== "") {
select.classList.add("selected");
}
});
// 美化日志级别选择的显示 - 浅色主题版本
const logLevelSelect = document.getElementById("LOG_LEVEL");
if (logLevelSelect) {
// 给不同日志级别添加统一的浅色主题样式
const updateLogLevelStyle = () => {
const value = logLevelSelect.value;
// 统一使用浅色主题样式,通过轻微的边框变化来区分级别
switch (value) {
case "DEBUG":
logLevelSelect.style.borderColor = "#3b82f6"; // blue-500 主题色
logLevelSelect.style.color = "#374151"; // gray-700 深灰文字
break;
case "INFO":
logLevelSelect.style.borderColor = "#3b82f6"; // blue-500 主题色
logLevelSelect.style.color = "#374151"; // gray-700 深灰文字
break;
case "WARNING":
logLevelSelect.style.borderColor = "#6b7280"; // gray-500 中性灰
logLevelSelect.style.color = "#374151"; // gray-700 深灰文字
break;
case "ERROR":
logLevelSelect.style.borderColor = "#6b7280"; // gray-500 中性灰
logLevelSelect.style.color = "#374151"; // gray-700 深灰文字
break;
case "CRITICAL":
logLevelSelect.style.borderColor = "#4b5563"; // gray-600 稍深灰
logLevelSelect.style.color = "#374151"; // gray-700 深灰文字
break;
default:
logLevelSelect.style.borderColor = "rgba(0, 0, 0, 0.12)"; // 默认边框
logLevelSelect.style.color = "#374151"; // gray-700 深灰文字
}
};
// 初始化和变更时更新样式
updateLogLevelStyle();
logLevelSelect.addEventListener("change", updateLogLevelStyle);
}
// 增强预算映射项交互
const budgetInputs = document.querySelectorAll(".map-value-input");
budgetInputs.forEach((input) => {
// 添加焦点和悬停效果
input.addEventListener("focus", function () {
const parentItem = this.closest(".map-item");
if (parentItem) {
parentItem.style.backgroundColor =
"rgba(243, 244, 246, 1)"; /* gray-100 */
parentItem.style.borderColor =
"rgba(59, 130, 246, 0.5)"; /* blue-500 */
}
});
input.addEventListener("blur", function () {
const parentItem = this.closest(".map-item");
if (parentItem) {
parentItem.style.backgroundColor = "";
parentItem.style.borderColor = "";
}
});
// 输入限制为正整数且不超过最大值
input.addEventListener("input", function () {
let val = this.value.replace(/[^0-9]/g, "");
if (val !== "") {
val = parseInt(val, 10);
if (val > 32767) val = 32767;
}
this.value = val;
// 添加微小动画反馈
this.style.transform = "scale(1.05)";
setTimeout(() => {
this.style.transform = "scale(1)";
}, 150);
});
});
});
</script>
{% endblock %}
|