Răsfoiți Sursa

恢复渠道优先级可设置为负数

CaIon 2 ani în urmă
părinte
comite
3c52a0991f
2 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 3 3
      controller/relay-utils.go
  2. 1 1
      web/src/components/ChannelsTable.js

+ 3 - 3
controller/relay-utils.go

@@ -194,12 +194,12 @@ func countTokenMessages(messages []Message, model string) (int, error) {
 }
 
 func countTokenInput(input any, model string) int {
-	switch input.(type) {
+	switch v := input.(type) {
 	case string:
-		return countTokenText(input.(string), model)
+		return countTokenText(v, model)
 	case []string:
 		text := ""
-		for _, s := range input.([]string) {
+		for _, s := range v {
 			text += s
 		}
 		return countTokenText(text, model)

+ 1 - 1
web/src/components/ChannelsTable.js

@@ -168,7 +168,7 @@ const ChannelsTable = () => {
                                 manageChannel(record.id, 'priority', record, value);
                             }}
                             defaultValue={record.priority}
-                            min={0}
+                            min={-999}
                         />
                     </div>
                 );