Compare commits

..
Author SHA1 Message Date
guoyuqi b3fefb5dca fix: alert config log text 2026-10-14 19:18:27 +08:00
guoyuqi 434be32b63 fix: container list search 2026-10-14 17:55:52 +08:00
guoyuqi 8c9f95f0c9 fix: container list search 2026-10-14 16:41:12 +08:00
51 changed files with 552 additions and 212 deletions
+22 -36
View File
@@ -2,6 +2,7 @@ package forwarding
import (
"context"
"encoding/json"
"errors"
"fmt"
"os"
@@ -173,19 +174,14 @@ func LoadDockerIPv4BridgePorts() (map[string]bool, error) {
if err != nil {
return nil, err
}
command := cmd.NewCommandMgr(cmd.WithContext(ctx), cmd.WithTimeout(5*time.Second))
bridges, err := command.RunWithOptionalSudoAndStdout("ip", "-o", "link", "show", "type", "bridge")
output, err := cmd.NewCommandMgr(cmd.WithContext(ctx), cmd.WithTimeout(5*time.Second)).RunWithOptionalSudoAndStdout("ip", "-details", "-json", "link", "show")
if err != nil {
return nil, err
}
ports, err := command.RunWithOptionalSudoAndStdout("ip", "-o", "link", "show", "type", "veth")
if err != nil {
return nil, err
}
return dockerIPv4BridgePorts(networks, bridges, ports)
return dockerIPv4BridgePorts(networks, output)
}
func dockerIPv4BridgePorts(networks []network.Summary, bridgeOutput, portOutput string) (map[string]bool, error) {
func dockerIPv4BridgePorts(networks []network.Summary, linkJSON string) (map[string]bool, error) {
bridges := make(map[string]bool)
for _, item := range networks {
if item.Driver != "bridge" || item.EnableIPv6 || item.ConfigOnly {
@@ -203,36 +199,26 @@ func dockerIPv4BridgePorts(networks []network.Summary, bridgeOutput, portOutput
bridges[name] = true
}
}
var links []struct {
Name string `json:"ifname"`
Master string `json:"master"`
LinkInfo struct {
Kind string `json:"info_kind"`
} `json:"linkinfo"`
}
if err := json.Unmarshal([]byte(linkJSON), &links); err != nil {
return nil, err
}
confirmedBridges := make(map[string]bool)
for _, link := range links {
if link.LinkInfo.Kind == "bridge" && bridges[link.Name] {
confirmedBridges[link.Name] = true
}
}
ports := make(map[string]bool)
for index, output := range []string{bridgeOutput, portOutput} {
for _, line := range strings.Split(output, "\n") {
header, _, _ := strings.Cut(line, "\\")
fields := strings.Fields(header)
if len(fields) == 0 {
continue
}
if len(fields) < 3 || !strings.HasSuffix(fields[0], ":") || !strings.HasSuffix(fields[1], ":") {
return nil, fmt.Errorf("invalid network link entry: %q", line)
}
if _, err := strconv.Atoi(strings.TrimSuffix(fields[0], ":")); err != nil {
return nil, fmt.Errorf("invalid network link entry: %q", line)
}
name, _, _ := strings.Cut(strings.TrimSuffix(fields[1], ":"), "@")
if index == 0 {
if bridges[name] {
confirmedBridges[name] = true
}
continue
}
for i := 3; i+1 < len(fields); i++ {
if fields[i] == "master" {
if confirmedBridges[fields[i+1]] {
ports[name] = true
}
break
}
}
for _, link := range links {
if link.LinkInfo.Kind == "veth" && confirmedBridges[link.Master] {
ports[link.Name] = true
}
}
return ports, nil
+188 -35
View File
@@ -45,7 +45,7 @@
"vue-clipboard3": "^2.0.0",
"vue-codemirror": "^6.1.1",
"vue-demi": "^0.14.6",
"vue-i18n": "^11.4.14",
"vue-i18n": "^11.4.4",
"vue-router": "^5.3.1"
},
"devDependencies": {
@@ -126,6 +126,7 @@
"integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.29.7",
"@babel/generator": "^7.29.7",
@@ -1013,6 +1014,7 @@
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1029,6 +1031,7 @@
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1045,6 +1048,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1061,6 +1065,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1077,6 +1082,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1093,6 +1099,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1109,6 +1116,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1125,6 +1133,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1141,6 +1150,7 @@
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1157,6 +1167,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1173,6 +1184,7 @@
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1189,6 +1201,7 @@
"cpu": [
"loong64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1205,6 +1218,7 @@
"cpu": [
"mips64el"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1221,6 +1235,7 @@
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1237,6 +1252,7 @@
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1253,6 +1269,7 @@
"cpu": [
"s390x"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1269,6 +1286,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1285,6 +1303,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1301,6 +1320,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1317,6 +1337,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1333,6 +1354,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1349,6 +1371,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1365,6 +1388,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1381,6 +1405,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1397,6 +1422,7 @@
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1413,6 +1439,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -1657,14 +1684,14 @@
}
},
"node_modules/@intlify/core-base": {
"version": "11.4.14",
"resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-11.4.14.tgz",
"integrity": "sha512-Lox+qRGBLnEYfNz4iajqKpw1zuvSAWl4PtzEk654bEM+0NT1GBy9AbOecxzSh7krsyqn9mGKhgmvtuyBsqS6oQ==",
"version": "11.4.4",
"resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-11.4.4.tgz",
"integrity": "sha512-w/vItlylrAmhebkIbVl5YY8XMCtj8Mb2g70ttxktMYuf5AuRahgEHL2iLgLIsZBIbTSgs4hkUo7ucCL0uTJvOg==",
"license": "MIT",
"dependencies": {
"@intlify/devtools-types": "11.4.14",
"@intlify/message-compiler": "11.4.14",
"@intlify/shared": "11.4.14"
"@intlify/devtools-types": "11.4.4",
"@intlify/message-compiler": "11.4.4",
"@intlify/shared": "11.4.4"
},
"engines": {
"node": ">= 22"
@@ -1674,13 +1701,13 @@
}
},
"node_modules/@intlify/devtools-types": {
"version": "11.4.14",
"resolved": "https://registry.npmjs.org/@intlify/devtools-types/-/devtools-types-11.4.14.tgz",
"integrity": "sha512-EQHRYveQg6yHQ51kePfsFyaW2WW+0hk3FdVxSpLDyuKtqFtsRFoyQR2QzASZPmY767ujs9ipuxc2DiGJARkuiQ==",
"version": "11.4.4",
"resolved": "https://registry.npmjs.org/@intlify/devtools-types/-/devtools-types-11.4.4.tgz",
"integrity": "sha512-PcBLmGmDQsTSVV911P8upzpcLJO1CNVYi/IH6bGnLR2nA+0L963+kXN1ZrisTEnbtw2ewN6HMMSldqzjronA0Q==",
"license": "MIT",
"dependencies": {
"@intlify/core-base": "11.4.14",
"@intlify/shared": "11.4.14"
"@intlify/core-base": "11.4.4",
"@intlify/shared": "11.4.4"
},
"engines": {
"node": ">= 22"
@@ -1690,12 +1717,12 @@
}
},
"node_modules/@intlify/message-compiler": {
"version": "11.4.14",
"resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-11.4.14.tgz",
"integrity": "sha512-y79GatHfMhN672Vooxw0v6mgX/vclFHggO1ENL6aH/QubLXiV529WXu/+FhVUbYF+HLTeDDkQpmnpfvSJddBCg==",
"version": "11.4.4",
"resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-11.4.4.tgz",
"integrity": "sha512-vn0OAV9pYkJlPPmgnsSm5eAG3mL0+9C/oaded2JY9jmxBbhmUXT3TcAUY8WRgLY9Hte7lkUJKpXrVlYjMXBD2w==",
"license": "MIT",
"dependencies": {
"@intlify/shared": "11.4.14",
"@intlify/shared": "11.4.4",
"source-map-js": "^1.0.2"
},
"engines": {
@@ -1706,9 +1733,9 @@
}
},
"node_modules/@intlify/shared": {
"version": "11.4.14",
"resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-11.4.14.tgz",
"integrity": "sha512-f8zSlPs4+Yd9za3CPQfW9OHxAJBOeRQzB/hhOhkbGA7hlqWk0W0bUtSV/LmyrGNwdl8JriBnFtJqZyF140bjGg==",
"version": "11.4.4",
"resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-11.4.4.tgz",
"integrity": "sha512-QRUCHqda1U6aR14FR0vvXD4+4gj6+fm0AhAozvSuRCw0fCvrmCugWpgiR4xH2NI6s8am6N9p5OhirplsX8ZS3g==",
"license": "MIT",
"engines": {
"node": ">= 22"
@@ -1746,6 +1773,18 @@
"node": ">=6.0.0"
}
},
"node_modules/@jridgewell/source-map": {
"version": "0.3.11",
"resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz",
"integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@jridgewell/gen-mapping": "^0.3.5",
"@jridgewell/trace-mapping": "^0.3.25"
}
},
"node_modules/@jridgewell/sourcemap-codec": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
@@ -1974,6 +2013,7 @@
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.6.0.tgz",
"integrity": "sha512-7FNeNl8NCE7aINx7WXiKQrPYZWC/hvrTsmk6zmxbI7LTXE7hVek/n8AfVgpe2y82zl3w0HvCHN0bVKMBoJcC0w==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"optional": true,
@@ -2012,6 +2052,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2032,6 +2073,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2052,6 +2094,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2072,6 +2115,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2092,6 +2136,7 @@
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2112,6 +2157,7 @@
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2132,6 +2178,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2152,6 +2199,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2172,6 +2220,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2192,6 +2241,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2212,6 +2262,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2232,6 +2283,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2276,6 +2328,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2292,6 +2345,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2308,6 +2362,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2324,6 +2379,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2340,6 +2396,7 @@
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2356,6 +2413,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2372,6 +2430,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2388,6 +2447,7 @@
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2404,6 +2464,7 @@
"cpu": [
"s390x"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2420,6 +2481,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2436,6 +2498,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2452,6 +2515,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2468,6 +2532,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2484,6 +2549,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -2877,6 +2943,7 @@
"resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.12.tgz",
"integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"@types/lodash": "*"
}
@@ -2908,8 +2975,9 @@
"version": "26.6.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.3.tgz",
"integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==",
"devOptional": true,
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"undici-types": "~8.9.0"
}
@@ -2990,6 +3058,7 @@
"integrity": "sha512-aTtmZjp/x3gsGHkDs04/1I8kNogBJkpQaeGaN0PfiG43NzDEmW2n+OP5im9wfsvyX0yP1UZWBrAGtDBfH9jEVw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.71.2",
"@typescript-eslint/types": "8.71.2",
@@ -3649,6 +3718,7 @@
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz",
"integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==",
"license": "MIT",
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -3905,6 +3975,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.11.26",
"caniuse-lite": "^1.0.30001812",
@@ -3923,7 +3994,7 @@
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
"devOptional": true,
"dev": true,
"license": "MIT"
},
"node_modules/bundle-name": {
@@ -4166,6 +4237,7 @@
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.2.tgz",
"integrity": "sha512-VhydHotNW5w1UGK0Qj96BwSk/Zqbp9WbnyK2W/eVMv4QyF41INRGpjUhFJY7/uDNuudSc33a/PKr4iDqRduvHw==",
"license": "MIT",
"peer": true,
"dependencies": {
"@codemirror/autocomplete": "^6.0.0",
"@codemirror/commands": "^6.0.0",
@@ -5198,6 +5270,7 @@
"devOptional": true,
"hasInstallScript": true,
"license": "MIT",
"peer": true,
"bin": {
"esbuild": "bin/esbuild"
},
@@ -5259,6 +5332,7 @@
"integrity": "sha512-nuKKvN+oIBO0koN7Tm7dlkmnkc21mtt0QJLwAKzjLq14y6lRTdVG36MZHJ8eQHwdJMwZbQNMlPOYedMq/oVJvQ==",
"dev": true,
"license": "MIT",
"peer": true,
"workspaces": [
"packages/*"
],
@@ -5318,6 +5392,7 @@
"integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==",
"dev": true,
"license": "MIT",
"peer": true,
"bin": {
"eslint-config-prettier": "bin/cli.js"
},
@@ -5750,6 +5825,7 @@
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"optional": true,
@@ -6229,7 +6305,7 @@
"version": "5.1.9",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.9.tgz",
"integrity": "sha512-m8nVez3rwrgmWxtLMt1ZYXB2Lv7OKYn/disyxAlSDYAlKSlFoPPfIAmAM/M5xqL4m4C/wAPw7S2/CNaUii1Hxg==",
"devOptional": true,
"dev": true,
"license": "MIT"
},
"node_modules/imurmurhash": {
@@ -6302,7 +6378,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"devOptional": true,
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
@@ -6312,7 +6388,7 @@
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"devOptional": true,
"dev": true,
"license": "MIT",
"dependencies": {
"is-extglob": "^2.1.1"
@@ -6432,7 +6508,7 @@
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz",
"integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==",
"devOptional": true,
"dev": true,
"license": "MIT",
"bin": {
"jiti": "lib/jiti-cli.mjs"
@@ -7007,13 +7083,15 @@
"version": "4.18.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
"license": "MIT"
"license": "MIT",
"peer": true
},
"node_modules/lodash-es": {
"version": "4.18.1",
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz",
"integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==",
"license": "MIT"
"license": "MIT",
"peer": true
},
"node_modules/lodash-unified": {
"version": "1.0.3",
@@ -7095,6 +7173,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"argparse": "^2.0.1",
"entities": "^4.5.0",
@@ -7543,6 +7622,7 @@
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz",
"integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==",
"dev": true,
"license": "MIT",
"optional": true
},
@@ -7805,6 +7885,7 @@
"resolved": "https://registry.npmjs.org/pinia/-/pinia-3.0.4.tgz",
"integrity": "sha512-l7pqLUFTI/+ESXn6k3nu30ZIzW5E2WZF/LaHJEpoq6ElcLD+wduZoB2kBN19du6K/4FDpPMazY2wJr+IndBtQw==",
"license": "MIT",
"peer": true,
"dependencies": {
"@vue/devtools-api": "^7.7.7"
},
@@ -7885,6 +7966,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"nanoid": "^3.3.20",
"picocolors": "^1.1.1",
@@ -7996,6 +8078,7 @@
"integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==",
"dev": true,
"license": "MIT",
"peer": true,
"bin": {
"prettier": "bin/prettier.cjs"
},
@@ -8347,6 +8430,7 @@
"integrity": "sha512-rn9wpmxplLf7NLNyCk9FyWh3FM43DbY8jOzCdEPzH7uflhTftRbCEpqi6Ly2osgoU8OwObtmavMbWLaWy4LX7A==",
"devOptional": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@oxc-project/types": "=0.143.0",
"@rolldown/pluginutils": "^1.0.0"
@@ -8443,8 +8527,9 @@
"version": "1.105.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.105.0.tgz",
"integrity": "sha512-4EjSuRTyG8M4yRXXY1PT9OUV5zz23xBxJkbIAprohKHqf6HOU4MCpE3U3vAC+iO1gxobBjESNbcj8rYAQZWnyA==",
"devOptional": true,
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"chokidar": "^5.0.0",
"immutable": "^5.1.5",
@@ -8627,6 +8712,29 @@
"node": ">=0.10.0"
}
},
"node_modules/source-map-support": {
"version": "0.5.21",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
"integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
}
},
"node_modules/source-map-support/node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"license": "BSD-3-Clause",
"optional": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/spdx-correct": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz",
@@ -8961,6 +9069,34 @@
"url": "https://opencollective.com/webpack"
}
},
"node_modules/terser": {
"version": "5.44.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz",
"integrity": "sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==",
"dev": true,
"license": "BSD-2-Clause",
"optional": true,
"dependencies": {
"@jridgewell/source-map": "^0.3.3",
"acorn": "^8.15.0",
"commander": "^2.20.0",
"source-map-support": "~0.5.20"
},
"bin": {
"terser": "bin/terser"
},
"engines": {
"node": ">=10"
}
},
"node_modules/terser/node_modules/commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true,
"license": "MIT",
"optional": true
},
"node_modules/text-extensions": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz",
@@ -9092,6 +9228,7 @@
"integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
"devOptional": true,
"license": "Apache-2.0",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -9130,7 +9267,7 @@
"version": "8.9.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
"integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
"devOptional": true,
"dev": true,
"license": "MIT"
},
"node_modules/unimport": {
@@ -9457,6 +9594,7 @@
"integrity": "sha512-pn+CFpM0lwDeKwmOq1ZaBK/9sjorZcgqxki6MbY/jPEVd9vichIlmlD4HmQ5wdP5EgqQCFRaACBxMC7uEGc6lQ==",
"devOptional": true,
"license": "MIT",
"peer": true,
"dependencies": {
"lightningcss": "^1.33.0",
"picomatch": "^4.0.5",
@@ -9721,6 +9859,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -9741,6 +9880,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -9761,6 +9901,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -9781,6 +9922,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -9801,6 +9943,7 @@
"cpu": [
"arm"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -9821,6 +9964,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -9841,6 +9985,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -9861,6 +10006,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -9881,6 +10027,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -9901,6 +10048,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -9921,6 +10069,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -9946,6 +10095,7 @@
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.43.tgz",
"integrity": "sha512-o5qZoksdnjIKvW1srZ3ab7pcDNYAerBjRe54D0LBLfRdCYFrSgBHVXokMas35czQc0//lmx4/tuY4ZNQ+Rf2Ng==",
"license": "MIT",
"peer": true,
"dependencies": {
"@vue/compiler-dom": "3.5.43",
"@vue/compiler-sfc": "3.5.43",
@@ -9999,6 +10149,7 @@
"integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==",
"hasInstallScript": true,
"license": "MIT",
"peer": true,
"bin": {
"vue-demi-fix": "bin/vue-demi-fix.js",
"vue-demi-switch": "bin/vue-demi-switch.js"
@@ -10025,6 +10176,7 @@
"integrity": "sha512-Gk6gRDj0n/fkRa3C3l0bBheoBckUq/Rs0F/TvMWIS6nzzx67amAViMe9CkNgsP2tXyQONvGiHQESHwFtZ3aYDA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"debug": "^4.4.0",
"eslint-scope": "^8.2.0 || ^9.0.0",
@@ -10057,14 +10209,14 @@
}
},
"node_modules/vue-i18n": {
"version": "11.4.14",
"resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-11.4.14.tgz",
"integrity": "sha512-oRFZtQjRDRQtfxu7tFlsZlnCa5gPkg/KX89kJDKdC9bz4GIYgo3cAMaD0XFeUx/WHuKoVbDMRTIo9Hvg67HnPw==",
"version": "11.4.4",
"resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-11.4.4.tgz",
"integrity": "sha512-gIbXVSFQV4jcSJxfwdZ5zSZmZ+12CnX0K3vBkRSd6Zn+HSzCp+QwUgPwpD/uN0oKNKI9RzlUXPKVedEuMgNG0A==",
"license": "MIT",
"dependencies": {
"@intlify/core-base": "11.4.14",
"@intlify/devtools-types": "11.4.14",
"@intlify/shared": "11.4.14",
"@intlify/core-base": "11.4.4",
"@intlify/devtools-types": "11.4.4",
"@intlify/shared": "11.4.4",
"@vue/devtools-api": "^6.5.0"
},
"engines": {
@@ -10360,6 +10512,7 @@
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz",
"integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==",
"dev": true,
"license": "ISC",
"optional": true,
"bin": {
+1 -1
View File
@@ -56,7 +56,7 @@
"vue-clipboard3": "^2.0.0",
"vue-codemirror": "^6.1.1",
"vue-demi": "^0.14.6",
"vue-i18n": "^11.4.14",
"vue-i18n": "^11.4.4",
"vue-router": "^5.3.1"
},
"devDependencies": {
@@ -1,24 +0,0 @@
import { storeToRefs } from 'pinia';
import { onActivated, onDeactivated } from 'vue';
import GlobalStore from '@/store/modules/global';
import { bindSearchReset, type SearchFields } from '@/utils/search-reset';
interface SearchResetOptions {
scope?: () => string | number | undefined;
onRevisit: () => unknown;
}
export const useSearchReset = (fields: SearchFields, options: SearchResetOptions) => {
const { currentNode } = storeToRefs(GlobalStore());
const reset = bindSearchReset(options.scope ? [currentNode, options.scope] : [currentNode], fields);
let deactivated = false;
onDeactivated(() => {
deactivated = true;
});
onActivated(() => {
if (!deactivated) return;
deactivated = false;
reset();
return options.onRevisit();
});
};
+2 -3
View File
@@ -1,5 +1,4 @@
import { bindSearchReset } from '@/utils/search-reset';
import router from '@/routers/router';
import { bindSearchState } from '@/utils/search-reset';
import { useGlobalStore } from '@/composables/useGlobalStore';
import { defineStore } from 'pinia';
import { ref, reactive, toRef } from 'vue';
@@ -50,7 +49,7 @@ export const ProcessStore = defineStore('ProcessStore', () => {
});
const { currentNode } = useGlobalStore();
bindSearchReset([() => router.currentRoute.value.path, currentNode], {
bindSearchState(() => JSON.stringify([currentNode.value, 'host/process', '']), {
pid: toRef(psSearch, 'pid'),
name: toRef(psSearch, 'name'),
username: toRef(psSearch, 'username'),
+118 -7
View File
@@ -1,12 +1,123 @@
import { watch, type Ref, type WatchSource } from 'vue';
import { storeToRefs } from 'pinia';
import { onActivated, onDeactivated, onScopeDispose, watch, type Ref } from 'vue';
import GlobalStore from '@/store/modules/global';
export type SearchFields = Record<string, Ref<string | number | undefined>>;
type SearchValues = Record<string, string | number | undefined>;
export const bindSearchReset = (sources: WatchSource[], fields: SearchFields) => {
const defaults = Object.values(fields).map((field) => ({ field, value: field.value }));
const reset = () => {
for (const { field, value } of defaults) field.value = value;
/** Shared by normal page visits and edit-return visits; navigation never evicts a query. */
export const createSearchStateStorage = (storage: () => Storage = () => localStorage) => {
const unsaved = new Map<string, SearchValues>();
return {
save(key: string, values: SearchValues) {
try {
const target = storage();
const storageKey = `1panel:search-state:v2:${key}`;
const serialized = JSON.stringify(
Object.fromEntries(Object.entries(values).map(([name, value]) => [name, value ?? null])),
);
if (target.getItem(storageKey) !== serialized) target.setItem(storageKey, serialized);
unsaved.delete(key);
} catch {
// Only failed writes need an in-memory fallback.
unsaved.set(key, { ...values });
}
},
read(key: string): SearchValues | undefined {
const cached = unsaved.get(key);
if (cached) return { ...cached };
try {
const saved = JSON.parse(storage().getItem(`1panel:search-state:v2:${key}`) || 'null');
if (!saved || typeof saved !== 'object' || Array.isArray(saved)) return undefined;
return Object.fromEntries(
Object.entries(saved)
.filter(
([, value]) =>
value === null ||
typeof value === 'string' ||
(typeof value === 'number' && Number.isFinite(value)),
)
.map(([name, value]) => [name, value === null ? undefined : value]),
) as SearchValues;
} catch {
return undefined;
}
},
};
watch(sources, reset, { flush: 'sync' });
return reset;
};
const searchStorage = createSearchStateStorage();
export const bindSearchState = (key: () => string | undefined, fields: SearchFields, storage = searchStorage) => {
const defaults = Object.fromEntries(Object.entries(fields).map(([name, field]) => [name, field.value]));
const names = Object.keys(fields).sort((left, right) => Number(left === 'page') - Number(right === 'page'));
let pending: { key: string; values: SearchValues } | undefined;
let queued = false;
const flush = () => {
if (!pending) return;
const snapshot = pending;
pending = undefined;
storage.save(snapshot.key, snapshot.values);
};
onScopeDispose(flush);
let restoring = false;
let activeKey: string | undefined;
const restore = () => {
// Commit the previous node/resource before restoring another one.
flush();
activeKey = key();
if (!activeKey) return;
const saved = storage.read(activeKey) || defaults;
restoring = true;
try {
// Restore pagination last: search/filter watchers may reset it to page one.
for (const name of names) {
const value = Object.hasOwn(saved, name) ? saved[name] : defaults[name];
const initial = defaults[name];
fields[name].value =
initial !== undefined && value !== undefined && typeof value !== typeof initial ? initial : value;
}
} finally {
restoring = false;
}
};
watch(key, restore, { immediate: true, flush: 'sync' });
watch(
() => Object.fromEntries(Object.entries(fields).map(([name, field]) => [name, field.value])),
(values) => {
if (restoring || !activeKey) return;
pending = { key: activeKey, values };
if (queued) return;
queued = true;
queueMicrotask(() => {
queued = false;
flush();
});
},
{ flush: 'sync' },
);
};
interface SearchStateOptions {
scope?: () => string | number | undefined;
onRevisit: () => unknown;
}
/** Keep queries across page visits and reload data when a cached page becomes active. */
export const useSearchState = (page: string, fields: SearchFields, options: SearchStateOptions) => {
const { currentNode } = storeToRefs(GlobalStore());
bindSearchState(() => {
const scope = options.scope?.();
if (options.scope && scope === undefined) return undefined;
return JSON.stringify([currentNode.value, page, scope ?? '']);
}, fields);
let deactivated = false;
onDeactivated(() => {
deactivated = true;
});
onActivated(() => {
if (!deactivated) return;
deactivated = false;
return options.onRevisit();
});
};
@@ -172,7 +172,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { computed, ref, watch } from 'vue';
import { Refresh, Search } from '@element-plus/icons-vue';
import { ElMessageBox } from 'element-plus';
@@ -193,7 +193,8 @@ const searching = ref(false);
const operating = ref('');
const keyword = ref('');
const marketKeyword = ref('');
useSearchReset(
useSearchState(
'ai/agents/agent/config/tabs/plugins',
{ keyword, marketKeyword },
{
scope: () => agentId.value || undefined,
@@ -138,7 +138,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { computed, ref, watch } from 'vue';
import { Refresh, Search } from '@element-plus/icons-vue';
import { useI18n } from 'vue-i18n';
@@ -169,7 +169,8 @@ const getDefaultMarketSource = (): HermesSkillMarketSource => {
const marketSource = ref<HermesSkillMarketSource>(getDefaultMarketSource());
const marketSearched = ref(false);
const agentId = ref(0);
useSearchReset(
useSearchState(
'ai/agents/agent/config/tabs/skills/hermes',
{ installedKeyword, marketKeyword },
{
scope: () => agentId.value || undefined,
@@ -142,7 +142,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { computed, ref, watch } from 'vue';
import { Refresh, Search } from '@element-plus/icons-vue';
import { useI18n } from 'vue-i18n';
@@ -181,7 +181,8 @@ const getDefaultMarketSource = (): SkillMarketSource => {
const marketSource = ref<SkillMarketSource>(getDefaultMarketSource());
const marketSearched = ref(false);
const agentId = ref(0);
useSearchReset(
useSearchState(
'ai/agents/agent/config/tabs/skills/openclaw',
{ installedKeyword, marketKeyword },
{
scope: () => agentId.value || undefined,
+6 -2
View File
@@ -272,7 +272,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { toRef, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { deleteAgentCheck, pageAgents, resetAgentToken, unbindAgentWebsite, updateAgentRemark } from '@/api/modules/ai';
@@ -400,7 +400,11 @@ const paginationConfig = reactive({
pageSize: 10,
total: 0,
});
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'ai/agents/agent/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const checkNoApp = async () => {
try {
+6 -2
View File
@@ -69,7 +69,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { toRef, onMounted, reactive, ref } from 'vue';
import { deleteAgentAccount, getAgentProviders, pageAgentAccounts } from '@/api/modules/ai';
import { AI } from '@/api/interface/ai';
@@ -111,7 +111,11 @@ const paginationConfig = reactive({
pageSize: 10,
total: 0,
});
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'ai/agents/model/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const search = async () => {
const req: AI.AgentAccountSearch = {
+6 -2
View File
@@ -186,7 +186,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import AppStatus from '@/components/app-status/index.vue';
import AddDialog from '@/views/ai/model/ollama/add/index.vue';
import Conn from '@/views/ai/model/ollama/conn/index.vue';
@@ -237,7 +237,11 @@ const paginationConfig = reactive({
total: 0,
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'ai/model/ollama/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const appInstallID = ref(0);
const opRef = ref();
+3 -2
View File
@@ -70,7 +70,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { App } from '@/api/interface/app';
import { toRef, onMounted, reactive, ref } from 'vue';
import { searchApp, syncApp, syncCutomAppStore, syncLocalApp, getCurrentNodeCustomAppConfig } from '@/api/modules/app';
@@ -105,7 +105,8 @@ const req = reactive({
resource: 'all',
showCurrentArch: false,
});
useSearchReset(
useSearchState(
'app-store/apps/index',
{ search: toRef(req, 'name'), page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search(req) },
);
@@ -139,7 +139,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import AppCard from '@/views/app-store/installed/app/card.vue';
import Backups from '@/components/backup/index.vue';
import Uploads from '@/components/upload/index.vue';
@@ -211,7 +211,8 @@ const searchReq = reactive({
update: false,
sync: false,
});
useSearchReset(
useSearchState(
'app-store/installed/index',
{ search: toRef(searchReq, 'name'), page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
@@ -522,7 +522,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { computed, h, ref } from 'vue';
import CodemirrorPro from '@/components/codemirror-pro/index.vue';
import ContainerLog from '@/components/log/container/index.vue';
@@ -577,7 +577,7 @@ const dialogBackupRef = ref();
const uploadRef = ref();
const searchName = ref('');
useSearchReset({ search: searchName }, { onRevisit: () => search() });
useSearchState('container/compose/index', { search: searchName }, { onRevisit: () => search() });
const includeAppStore = ref(localStorage.getItem('includeAppStore') !== 'false');
const showType = ref('compose');
const containerStats = ref<any[]>([]);
@@ -474,7 +474,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import PruneDialog from '@/views/container/container/prune/index.vue';
import RenameDialog from '@/views/container/container/rename/index.vue';
import UpgradeDialog from '@/views/container/container/upgrade/index.vue';
@@ -536,7 +536,6 @@ const paginationConfig = reactive({
order: 'ascending',
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
const dialogUpgradeRef = ref();
const dialogCommitRef = ref();
const dialogPortJumpRef = ref();
@@ -552,6 +551,18 @@ const taskLogRef = ref();
const tags = ref([]);
const activeTag = ref('all');
useSearchState(
'container/container/index',
{
search: searchName,
page: toRef(paginationConfig, 'currentPage'),
state: toRef(paginationConfig, 'state'),
activeTag,
orderBy: toRef(paginationConfig, 'orderBy'),
order: toRef(paginationConfig, 'order'),
},
{ onRevisit: () => search() },
);
const activeDropdownContainerId = ref('');
const statFields = [
+3 -2
View File
@@ -157,7 +157,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { toRef, reactive, ref, computed } from 'vue';
import { dateFormat } from '@/utils/date';
import { newUUID } from '@/utils/id';
@@ -200,7 +200,8 @@ const paginationConfig = reactive({
orderBy: 'createdAt',
order: 'null',
});
useSearchReset(
useSearchState(
'container/image/index',
{ search: toRef(paginationConfig, 'name'), page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
@@ -95,7 +95,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import CreateDialog from '@/views/container/network/create/index.vue';
import DetailDrawer from '@/views/container/network/detail/index.vue';
import { toRef, reactive, ref } from 'vue';
@@ -121,7 +121,11 @@ const paginationConfig = reactive({
total: 0,
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'container/network/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const opRef = ref();
const isActive = ref(false);
+6 -2
View File
@@ -59,7 +59,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import OperatorDialog from '@/views/container/repo/operator/index.vue';
import { toRef, reactive, ref } from 'vue';
import { dateFormat } from '@/utils/date';
@@ -78,7 +78,11 @@ const paginationConfig = reactive({
total: 0,
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'container/repo/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const opRef = ref();
const confirmDialog = ref();
@@ -81,7 +81,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { toRef, reactive, ref } from 'vue';
import { dateFormat, getCurrentDateFormatted } from '@/utils/date';
import { downloadWithContent } from '@/utils/file';
@@ -111,7 +111,11 @@ const paginationConfig = reactive({
total: 0,
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'container/template/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const search = async () => {
if (!isActive.value || !isExist.value) {
@@ -124,7 +124,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import CreateDialog from '@/views/container/volume/create/index.vue';
import CodemirrorDrawer from '@/components/codemirror-pro/drawer.vue';
import DockerStatus from '@/views/container/docker-status/index.vue';
@@ -158,7 +158,11 @@ const paginationConfig = reactive({
total: 0,
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'container/volume/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const isActive = ref(false);
const isExist = ref(false);
+6 -2
View File
@@ -272,7 +272,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import Records from '@/views/cronjob/cronjob/record/index.vue';
import Backups from '@/views/cronjob/cronjob/backup/index.vue';
import Import from '@/views/cronjob/cronjob/import/index.vue';
@@ -332,7 +332,11 @@ const pageState = usePageState(() => ({
}));
const paginationConfig = pageState.paginationConfig;
const { defaultGroupID, searchName, searchGroupID } = toRefs(pageState);
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'cronjob/cronjob/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const search = async (column?: any) => {
if (column) {
+6 -2
View File
@@ -132,7 +132,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { dateFormat, getCurrentDateFormatted } from '@/utils/date';
import { deepCopy } from '@/utils/misc';
import { newUUID } from '@/utils/id';
@@ -170,7 +170,11 @@ const paginationConfig = reactive({
total: 0,
});
const searchInfo = ref<string>('');
useSearchReset({ search: searchInfo, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'cronjob/library/index',
{ search: searchInfo, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const group = ref<string>('');
const groupOptions = ref();
@@ -323,7 +323,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { toRef, nextTick, onMounted, reactive, ref } from 'vue';
import { dateFormat } from '@/utils/date';
import { getRandomStr } from '@/utils/id';
@@ -399,7 +399,11 @@ const paginationConfig = reactive({
orderBy: 'createdAt',
order: 'null',
});
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'database/mongodb/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
type FormInstance = InstanceType<typeof ElForm>;
const formRef = ref<FormInstance>();
@@ -75,7 +75,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { dateFormat } from '@/utils/date';
import { toRef, onMounted, reactive, ref } from 'vue';
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
@@ -101,7 +101,11 @@ const paginationConfig = reactive({
order: 'null',
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'database/mongodb/remote/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const search = async (column?: any) => {
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
+6 -2
View File
@@ -226,7 +226,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import BindDialog from '@/views/database/mysql/bind/index.vue';
import UserDialog from '@/views/database/mysql/user/index.vue';
import OperateDialog from '@/views/database/mysql/create/index.vue';
@@ -301,7 +301,11 @@ const paginationConfig = reactive({
order: 'null',
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'database/mysql/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const mysqlContainer = ref();
const mysqlStatus = ref();
@@ -74,7 +74,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { dateFormat } from '@/utils/date';
import { toRef, onMounted, reactive, ref } from 'vue';
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
@@ -100,7 +100,11 @@ const paginationConfig = reactive({
order: 'null',
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'database/mysql/remote/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const search = async (column?: any) => {
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
@@ -241,7 +241,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import BindDialog from '@/views/database/postgresql/bind/index.vue';
import OperateDialog from '@/views/database/postgresql/create/index.vue';
import DeleteDialog from '@/views/database/postgresql/delete/index.vue';
@@ -313,7 +313,11 @@ const paginationConfig = reactive({
order: 'null',
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'database/postgresql/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const postgresqlContainer = ref();
const postgresqlStatus = ref();
@@ -74,7 +74,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { dateFormat } from '@/utils/date';
import { toRef, onMounted, reactive, ref } from 'vue';
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
@@ -100,7 +100,11 @@ const paginationConfig = reactive({
order: 'null',
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'database/postgresql/remote/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const search = async (column?: any) => {
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
@@ -73,7 +73,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { dateFormat } from '@/utils/date';
import { toRef, onMounted, reactive, ref } from 'vue';
import { deleteCheckDatabase, searchDatabases } from '@/api/modules/database';
@@ -99,7 +99,11 @@ const paginationConfig = reactive({
order: 'null',
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'database/redis/remote/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const search = async (column?: any) => {
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
@@ -739,7 +739,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { toRef, computed, nextTick, onBeforeUnmount, onMounted, reactive, ref } from 'vue';
import {
addFavorite,
@@ -985,7 +985,8 @@ const paginationConfig = reactive({
pageSize: Number(localStorage.getItem('file-page-size')) || 100,
total: 0,
});
useSearchReset(
useSearchState(
'host/file-management/index',
{ search: toRef(req, 'search'), page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
@@ -15,19 +15,7 @@
<div v-for="issue in issues" :key="issue.family" class="family-row">
<div class="family-row__body">
<el-tag size="small" type="info" effect="plain">{{ issue.family === 'ipv6' ? 'IPv6' : 'IPv4' }}</el-tag>
<p>
{{ issue.message }}
<el-link
v-if="issue.helpUrl"
class="ml-1 text-xs"
type="primary"
target="_blank"
rel="noopener noreferrer"
:href="issue.helpUrl"
>
{{ $t('commons.button.helpDoc') }}
</el-link>
</p>
<p>{{ issue.message }}</p>
</div>
<el-button
v-if="issue.action"
@@ -67,7 +55,6 @@ import i18n from '@/lang';
interface FamilyIssue {
family: 'ipv4' | 'ipv6';
message: string;
helpUrl?: string;
action?: 'initialize' | 'repair' | 'bind';
}
const props = defineProps<{
@@ -219,7 +219,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { computed, reactive, ref, watch } from 'vue';
import FireRouter from '@/views/host/firewall/index.vue';
import DockerGuardStatus from '@/views/host/firewall/docker/status/index.vue';
@@ -263,7 +263,8 @@ const openRuleTask = (taskID: string) => taskLogRef.value?.openWithTaskID(taskID
const orphanDrawerVisible = ref(false);
const orphanSearchName = ref('');
const searchName = ref('');
useSearchReset(
useSearchState(
'host/firewall/docker/index',
{ search: searchName },
{
onRevisit: () => {
@@ -117,7 +117,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import OperateDialog from './operate/index.vue';
import ImportDialog from './import/index.vue';
import FireRouter from '@/views/host/firewall/index.vue';
@@ -188,7 +188,11 @@ const paginationConfig = reactive({
pageSize: Number(localStorage.getItem('firewall-forward-page-size')) || 20,
total: 0,
});
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'host/firewall/forward/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const search = async () => {
if (!isInit.value || !isBind.value || fireName.value === '-') {
@@ -302,7 +302,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { Firewall } from '@/api/interface/firewall';
import type { FuTableOperationButton } from '@/components/table/shared';
import { buildHostRuleExport } from './transfer';
@@ -432,7 +432,11 @@ const paginationConfig = reactive({
pageSize: Number(localStorage.getItem('firewall-rule-page-size')) || 20,
total: 0,
});
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'host/firewall/rule/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const providerScopes = (): Firewall.Scope[] => {
if (provider.value === 'iptables' || provider.value === 'nftables') {
@@ -182,12 +182,10 @@ import TaskLog from '@/components/log/task/index.vue';
import FamilyIssues from '@/views/host/firewall/components/family-issues.vue';
import RuleInitialize from '@/views/host/firewall/components/rule-initialize.vue';
import { newUUID } from '@/utils/id';
import { useGlobalStore } from '@/composables/useGlobalStore';
const props = defineProps({
currentTab: String,
});
const { docsUrl } = useGlobalStore();
const goToFirewallSetting = () => routerToName('FirewallSetting');
const goToScriptLibrary = () => routerToNameWithQuery('Library', { uncached: 'true' });
@@ -274,10 +272,6 @@ const familyActions = computed(() =>
return {
family: issue.family === 'IPv6' ? ('ipv6' as const) : ('ipv4' as const),
message: familyIssueText(issue),
helpUrl:
issue.available && issue.reason === 'ipv6_ra_required'
? `${docsUrl.value}/user_manual/hosts/firewall`
: undefined,
action,
};
}),
+6 -2
View File
@@ -93,7 +93,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import { dateFormatServerTimezone } from '@/utils/date';
import { downloadFile } from '@/utils/file';
@@ -120,7 +120,11 @@ const exportConfig = reactive({
status: 'All',
});
const searchInfo = ref();
useSearchReset({ search: searchInfo, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'host/ssh/log/log',
{ search: searchInfo, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const searchStatus = ref('All');
const search = async () => {
@@ -24,7 +24,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import FireRouter from '@/views/host/ssh/index.vue';
import { toRef, ref, onMounted, onUnmounted, reactive } from 'vue';
import i18n from '@/lang';
@@ -38,7 +38,7 @@ const sshSearch = reactive({
type: 'ssh',
loginUser: '',
});
useSearchReset({ search: toRef(sshSearch, 'loginUser') }, { onRevisit: () => search() });
useSearchState('host/ssh/session/index', { search: toRef(sshSearch, 'loginUser') }, { onRevisit: () => search() });
const buttons = [
{
+2 -2
View File
@@ -101,7 +101,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { onMounted, onUnmounted, reactive, ref, watch } from 'vue';
import { Log } from '@/api/interface/log';
import { getSystemLogStatus, listRunningServices, readSystemLogs } from '@/api/modules/log';
@@ -114,7 +114,7 @@ const logs = ref<Log.SystemLogItem[]>([]);
const loading = ref(false);
const watching = ref(false);
const keyword = ref('');
useSearchReset({ keyword }, { onRevisit: () => scheduleFilterSearch() });
useSearchState('log/host-system/index', { keyword }, { onRevisit: () => scheduleFilterSearch() });
const priority = ref('');
const service = ref('');
const services = ref<string[]>([]);
+6 -2
View File
@@ -45,7 +45,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import LogRouter from '@/views/log/router/index.vue';
import { dateFormat } from '@/utils/date';
@@ -67,7 +67,11 @@ const paginationConfig = reactive({
total: 0,
});
const searchInfo = ref<string>('');
useSearchReset({ search: searchInfo, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'log/login/index',
{ search: searchInfo, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const searchStatus = ref<string>('');
const search = async () => {
+6 -2
View File
@@ -139,7 +139,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import LogRouter from '@/views/log/router/index.vue';
import { dateFormat } from '@/utils/date';
@@ -160,7 +160,11 @@ const paginationConfig = reactive({
total: 0,
});
const searchName = ref<string>('');
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'log/operation/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const searchGroup = ref<string>('');
const searchStatus = ref<string>('');
const searchNode = ref<string>('');
@@ -120,7 +120,7 @@
</div>
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { dateFormat } from '@/utils/date';
import { toRef, onMounted, ref } from 'vue';
import { searchBackup, deleteBackup, refreshToken } from '@/api/modules/backup';
@@ -143,7 +143,8 @@ const paginationConfig = reactive({
type: '',
name: '',
});
useSearchReset(
useSearchState(
'setting/backup-account/index',
{ search: toRef(paginationConfig, 'name'), page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
@@ -225,7 +225,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import {
searchSnapshotPage,
snapshotDelete,
@@ -261,7 +261,11 @@ const paginationConfig = reactive({
order: 'null',
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'setting/snapshot/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const opRef = ref();
@@ -100,7 +100,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { Command } from '@/api/interface/command';
import GroupDialog from '@/components/group/index.vue';
import OperateDialog from '@/views/terminal/command/operate/index.vue';
@@ -124,7 +124,11 @@ const paginationConfig = reactive({
order: 'ascending',
});
const info = ref();
useSearchReset({ search: info, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'terminal/command/index',
{ search: info, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const group = ref<string>('');
const dialogRef = ref();
const opRef = ref();
+6 -2
View File
@@ -79,7 +79,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import GroupDialog from '@/components/agent-group/index.vue';
import OperateDialog from '@/views/terminal/host/operate/index.vue';
import { deleteHost, editHostGroup, searchHosts } from '@/api/modules/terminal';
@@ -100,7 +100,11 @@ const paginationConfig = reactive({
total: 0,
});
const info = ref();
useSearchReset({ search: info, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'terminal/host/index',
{ search: info, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const group = ref<string>('');
const opRef = ref();
+6 -2
View File
@@ -190,7 +190,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { toRef, onMounted, reactive, ref } from 'vue';
import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message';
@@ -218,7 +218,11 @@ const paginationConfig = reactive({
order: 'null',
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'toolbox/clam/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const opRef = ref();
const dialogRef = ref();
+6 -2
View File
@@ -174,7 +174,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { toRef, onMounted, reactive, ref } from 'vue';
import i18n from '@/lang';
import { MsgError, MsgSuccess } from '@/utils/message';
@@ -201,7 +201,11 @@ const paginationConfig = reactive({
order: 'null',
});
const searchName = ref();
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'toolbox/ftp/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const form = reactive({
isActive: true,
@@ -33,7 +33,7 @@
</template>
<script setup lang="ts">
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { Runtime } from '@/api/interface/runtime';
import { GetPHPExtensions, InstallPHPExtension, UnInstallPHPExtension } from '@/api/modules/runtime';
import i18n from '@/lang';
@@ -49,7 +49,11 @@ const supportExtensions = ref([]);
const loading = ref(false);
const taskLogRef = ref();
const searchName = ref('');
useSearchReset({ search: searchName }, { onRevisit: () => searchByName() });
useSearchState(
'website/runtime/php/extension-management/index',
{ search: searchName },
{ onRevisit: () => searchByName() },
);
const data = ref([]);
const handleClose = () => {
+3 -2
View File
@@ -221,7 +221,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { toRef, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
import { deleteSSL, downloadFile, pushSSLToNode, searchSSL, updateSSL } from '@/api/modules/website';
import DnsAccount from './dns-account/index.vue';
@@ -287,7 +287,8 @@ const req = reactive({
orderBy: 'updated_at',
order: 'descending',
});
useSearchReset(
useSearchState(
'website/ssl/index',
{ search: toRef(req, 'domain'), page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
@@ -59,7 +59,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import { Website } from '@/api/interface/website';
import { deleteTemplate, searchTemplates } from '@/api/modules/website';
import TemplateOperate from '@/views/website/template/operate/index.vue';
@@ -90,7 +90,11 @@ const paginationConfig = reactive({
pageSize: 20,
total: 0,
});
useSearchReset({ search: searchName, page: toRef(paginationConfig, 'currentPage') }, { onRevisit: () => search() });
useSearchState(
'website/template/index',
{ search: searchName, page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);
const buttons = [
{
+3 -2
View File
@@ -346,7 +346,7 @@
</template>
<script lang="ts" setup>
import { useSearchReset } from '@/composables/useSearchReset';
import { useSearchState } from '@/utils/search-reset';
import Backups from '@/components/backup/index.vue';
import UploadDialog from '@/components/upload/index.vue';
import DefaultServer from '@/views/website/website/default/index.vue';
@@ -451,7 +451,8 @@ const pageState = usePageState(() => ({
}));
const paginationConfig = pageState.paginationConfig;
const req = pageState.req;
useSearchReset(
useSearchState(
'website/website/index',
{ search: toRef(req, 'name'), page: toRef(paginationConfig, 'currentPage') },
{ onRevisit: () => search() },
);