hermes-web-ui 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -6
- package/bin/hermes-web-ui.mjs +34 -4
- package/dist/assets/{Button-CpNld4Mc.js → Button-sJ2BpaPl.js} +14 -14
- package/dist/assets/{ChannelsView-BWEvTQwM.css → ChannelsView-C2h4_vNn.css} +1 -1
- package/dist/assets/ChannelsView-CD_79lUP.js +1 -0
- package/dist/assets/ChatView-CLIjlJ1x.js +142 -0
- package/dist/assets/ChatView-CX_ZYhvz.css +1 -0
- package/dist/assets/Close-2w73mIOt.js +45 -0
- package/dist/assets/FormItem-XpOdWzQ0.js +110 -0
- package/dist/assets/Input-BzhYBEbH.js +234 -0
- package/dist/assets/InputNumber-8txyKuLX.js +13 -0
- package/dist/assets/JobsView-C-1FgnDL.js +2 -0
- package/dist/assets/{JobsView-DkwaDky6.css → JobsView-OYrxaGgM.css} +1 -1
- package/dist/assets/LoginView-BD15AZNF.js +1 -0
- package/dist/assets/LoginView-BHThbj0n.css +1 -0
- package/dist/assets/LogsView-DmQ4ttpe.js +1 -0
- package/dist/assets/LogsView-DzYGlYxF.css +1 -0
- package/dist/assets/{MarkdownRenderer-C2pkccH2.js → MarkdownRenderer-DJm5zGZj.js} +2 -2
- package/dist/assets/MemoryView-DBtvO2X2.js +5 -0
- package/dist/assets/MemoryView-WR7DvkW0.css +1 -0
- package/dist/assets/Modal-D421R1s7.js +232 -0
- package/dist/assets/{ModelsView-CLdtVeiJ.css → ModelsView-Dm1vBT2p.css} +1 -1
- package/dist/assets/ModelsView-Dt3deKCr.js +1 -0
- package/dist/assets/Popover-pOQtxFC1.js +117 -0
- package/dist/assets/Select-rOqAn7Lj.js +340 -0
- package/dist/assets/SettingRow-CndAlF8Z.js +1 -0
- package/dist/assets/SettingsView-CIcrKeJw.css +1 -0
- package/dist/assets/SettingsView-CxEQl8Fh.js +352 -0
- package/dist/assets/SkillsView-4FLTf1XD.css +1 -0
- package/dist/assets/SkillsView-BopVAaC6.js +1 -0
- package/dist/assets/Spin-CaLC5eru.js +43 -0
- package/dist/assets/Suffix-C1X_jn5E.js +101 -0
- package/dist/assets/Switch-BeZgnVyD.js +102 -0
- package/dist/assets/Tag-DFrN7AVl.js +71 -0
- package/dist/assets/Tooltip-ClSL1Ac2.js +1 -0
- package/dist/assets/{UsageView-CXSijPwc.css → UsageView-Bdck_cnA.css} +1 -1
- package/dist/assets/UsageView-BvGRIGlC.js +1 -0
- package/dist/assets/_plugin-vue_export-helper-DQGaK6t5.js +3 -0
- package/dist/assets/app-DHhjDueA.js +1 -0
- package/dist/assets/app-DqRfMAIZ.js +1 -0
- package/dist/assets/browser-Bf2Q3p4g.js +47 -0
- package/dist/assets/chat-B0V07VGa.js +6 -0
- package/dist/assets/context-Bm7UPqDk.js +1 -0
- package/dist/assets/index-BR3ulF5g.css +1 -0
- package/dist/assets/index-Bdq3IZmO.js +306 -0
- package/dist/assets/jobs-QM3wEm9o.js +1 -0
- package/dist/assets/logo-CiQBpLPw.js +1 -0
- package/dist/assets/pinia-bZ6_VpBU.js +1 -0
- package/dist/assets/router-Ddepf70Q.js +4 -0
- package/dist/assets/{sessions-DYkP_X2v.js → sessions-r2FX4lYx.js} +1 -1
- package/dist/assets/{skills-C6QBmS9j.js → skills-DtNdlEJd.js} +1 -1
- package/dist/assets/use-message-DAtcV1hg.js +1 -0
- package/dist/index.html +18 -18
- package/dist/server/index.js +104 -61
- package/dist/server/routes/filesystem.js +38 -0
- package/dist/server/services/auth.d.ts +9 -0
- package/dist/server/services/auth.js +67 -0
- package/dist/server/services/hermes-cli.js +13 -1
- package/package.json +2 -2
- package/dist/assets/ChannelsView-BGXB46ZU.js +0 -1
- package/dist/assets/ChatView-BVHQ6KhU.css +0 -1
- package/dist/assets/ChatView-CaO-j1NR.js +0 -142
- package/dist/assets/Close-BAvirVyH.js +0 -45
- package/dist/assets/FormItem-DUC1YCrh.js +0 -110
- package/dist/assets/Input-CCmp4iGM.js +0 -234
- package/dist/assets/InputNumber-DpIdrMEW.js +0 -13
- package/dist/assets/JobsView-t5o1pB0r.js +0 -2
- package/dist/assets/LogsView-B2TeFIUX.css +0 -1
- package/dist/assets/LogsView-QqOV3ZEf.js +0 -1
- package/dist/assets/MemoryView-CHeaa1-C.css +0 -1
- package/dist/assets/MemoryView-oeAn8ZfB.js +0 -5
- package/dist/assets/Modal-BljFqAJF.js +0 -232
- package/dist/assets/ModelsView-DvK44HBy.js +0 -1
- package/dist/assets/Popover-BQMR8Xxo.js +0 -117
- package/dist/assets/Select-D33SMWcz.js +0 -340
- package/dist/assets/SettingRow-BxCsRfGG.js +0 -102
- package/dist/assets/SettingsView-CK9ArFcg.js +0 -352
- package/dist/assets/SettingsView-Cl1ts-YY.css +0 -1
- package/dist/assets/SkillsView-BvNhRbMq.css +0 -1
- package/dist/assets/SkillsView-_z2SQ9kJ.js +0 -1
- package/dist/assets/Spin-CwbBDHwW.js +0 -43
- package/dist/assets/Suffix-CKUJBJSi.js +0 -101
- package/dist/assets/Tag-87KswiOb.js +0 -71
- package/dist/assets/Tooltip-CuLVJgy8.js +0 -1
- package/dist/assets/UsageView-COiUupLe.js +0 -1
- package/dist/assets/_plugin-vue_export-helper-C7dadZ10.js +0 -49
- package/dist/assets/app-DX-WvBe8.js +0 -1
- package/dist/assets/app-DwI_Lyfm.js +0 -1
- package/dist/assets/chat-De2jGIM6.js +0 -6
- package/dist/assets/client-D-w1KhaU.js +0 -1
- package/dist/assets/context-vjXbZCu8.js +0 -1
- package/dist/assets/index-D3MGnlpF.js +0 -307
- package/dist/assets/index-DCNlSGk-.css +0 -1
- package/dist/assets/jobs-B2WdYQNb.js +0 -1
- package/dist/assets/pinia-B4dETPKk.js +0 -1
- package/dist/assets/preload-helper-D4M6sveU.js +0 -1
- package/dist/assets/use-message-BeTKmVAO.js +0 -1
- package/dist/assets/vue.runtime.esm-bundler-BoqZ7fRe.js +0 -3
- /package/dist/{assets/logo-BAarh-tH.png → logo.png} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Hermes Web UI
|
|
2
2
|
|
|
3
|
-
Web dashboard for [Hermes Agent](https://github.com/NousResearch/hermes-agent) — chat interaction, session management, scheduled jobs, platform channel configuration, and log viewing.
|
|
3
|
+
Web dashboard for [Hermes Agent](https://github.com/NousResearch/hermes-agent) — chat interaction, session management, scheduled jobs, usage statistics, platform channel configuration, and log viewing.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
@@ -57,11 +57,20 @@ Automatically installs Node.js (if missing) and hermes-web-ui on Debian/Ubuntu/m
|
|
|
57
57
|
| `hermes-web-ui stop` | Stop background process |
|
|
58
58
|
| `hermes-web-ui restart` | Restart background process |
|
|
59
59
|
| `hermes-web-ui status` | Check if running |
|
|
60
|
+
| `hermes-web-ui update` | Update to latest version & restart|
|
|
61
|
+
| `hermes-web-ui -v` | Show version number |
|
|
62
|
+
| `hermes-web-ui -h` | Show help message |
|
|
60
63
|
| `hermes-web-ui` | Run in foreground (for debugging) |
|
|
61
64
|
|
|
62
65
|
### Auto Configuration
|
|
63
66
|
|
|
64
|
-
On startup, the BFF server automatically
|
|
67
|
+
On startup, the BFF server automatically:
|
|
68
|
+
|
|
69
|
+
- Checks `~/.hermes/config.yaml` and ensures `platforms.api_server` has all required fields (`enabled`, `host`, `port`, `key`, `cors_origins`)
|
|
70
|
+
- If any field is missing, backs up the original to `config.yaml.bak`, fills in defaults, and restarts the gateway
|
|
71
|
+
- Detects if the gateway is running and starts it if needed
|
|
72
|
+
- Kills any process occupying the target port before starting
|
|
73
|
+
- Opens the browser automatically after successful startup
|
|
65
74
|
|
|
66
75
|
## Development
|
|
67
76
|
|
|
@@ -90,7 +99,7 @@ Outputs to `dist/` (frontend + compiled BFF server).
|
|
|
90
99
|
```
|
|
91
100
|
hermes-web-ui/
|
|
92
101
|
├── bin/
|
|
93
|
-
│ └── hermes-web-ui.mjs # CLI entry (start/stop/restart/status)
|
|
102
|
+
│ └── hermes-web-ui.mjs # CLI entry (start/stop/restart/status/update/version/help)
|
|
94
103
|
├── server/src/
|
|
95
104
|
│ ├── index.ts # BFF entry (Koa app bootstrap)
|
|
96
105
|
│ ├── config.ts # Configuration (port, upstream, etc.)
|
|
@@ -124,6 +133,7 @@ hermes-web-ui/
|
|
|
124
133
|
│ │ ├── settings/ # Settings components
|
|
125
134
|
│ │ │ ├── PlatformCard.vue # Platform card with config status
|
|
126
135
|
│ │ │ └── PlatformSettings.vue # Platform channel configuration
|
|
136
|
+
│ │ ├── usage/ # Usage statistics components
|
|
127
137
|
│ │ └── skills/ # Skill components
|
|
128
138
|
│ ├── views/
|
|
129
139
|
│ │ ├── ChatView.vue # Chat page
|
|
@@ -133,6 +143,7 @@ hermes-web-ui/
|
|
|
133
143
|
│ │ ├── ChannelsView.vue # Platform channels page
|
|
134
144
|
│ │ ├── SkillsView.vue # Skills page
|
|
135
145
|
│ │ ├── MemoryView.vue # Memory page
|
|
146
|
+
│ │ ├── UsageView.vue # Usage statistics page
|
|
136
147
|
│ │ └── SettingsView.vue # Settings page
|
|
137
148
|
│ └── router/index.ts # Router configuration
|
|
138
149
|
└── dist/ # Build output (published to npm)
|
|
@@ -156,6 +167,17 @@ hermes-web-ui/
|
|
|
156
167
|
- Model selector — automatically discovers available models from `~/.hermes/auth.json` credential pool
|
|
157
168
|
- Global model switching (updates `~/.hermes/config.yaml`)
|
|
158
169
|
- Per-session model display (badge in chat header and session list)
|
|
170
|
+
- Context token usage display (used / total)
|
|
171
|
+
|
|
172
|
+
### Usage Statistics
|
|
173
|
+
|
|
174
|
+
- Total token usage breakdown (input / output)
|
|
175
|
+
- Session count with daily average
|
|
176
|
+
- Estimated cost tracking
|
|
177
|
+
- Cache hit rate
|
|
178
|
+
- Model usage distribution (horizontal bar chart)
|
|
179
|
+
- 30-day daily trend (bar chart + data table)
|
|
180
|
+
- Hover tooltips on chart bars
|
|
159
181
|
|
|
160
182
|
### Platform Channels
|
|
161
183
|
|
|
@@ -208,8 +230,10 @@ hermes-web-ui/
|
|
|
208
230
|
- Internationalization — auto-detect browser language, manual toggle between Chinese and English
|
|
209
231
|
- Real-time connection status monitoring
|
|
210
232
|
- Hermes version display in sidebar
|
|
211
|
-
- Auto config check on startup
|
|
212
|
-
-
|
|
233
|
+
- Auto config check on startup with field-level validation
|
|
234
|
+
- Port conflict auto-resolution (kills stale processes)
|
|
235
|
+
- Auto browser open on startup
|
|
236
|
+
- Minimalist "Pure Ink" theme
|
|
213
237
|
- Session group collapse state persisted across navigation
|
|
214
238
|
|
|
215
239
|
## Architecture
|
|
@@ -229,7 +253,7 @@ The BFF layer handles:
|
|
|
229
253
|
- API proxy to Hermes (with header forwarding)
|
|
230
254
|
- SSE streaming passthrough
|
|
231
255
|
- File upload to temp directory
|
|
232
|
-
- Session CRUD via Hermes CLI
|
|
256
|
+
- Session CRUD via Hermes CLI (with cache/cost token passthrough)
|
|
233
257
|
- Config & credential management (config.yaml + .env)
|
|
234
258
|
- WeChat QR code login flow (fetch QR, poll status, save credentials)
|
|
235
259
|
- Auto gateway restart on platform config changes
|
package/bin/hermes-web-ui.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { spawn, execSync } from 'child_process'
|
|
|
3
3
|
import { resolve, dirname, join } from 'path'
|
|
4
4
|
import { fileURLToPath } from 'url'
|
|
5
5
|
import { readFileSync, writeFileSync, unlinkSync, mkdirSync, openSync } from 'fs'
|
|
6
|
+
import { randomBytes } from 'crypto'
|
|
6
7
|
import { homedir } from 'os'
|
|
7
8
|
|
|
8
9
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
@@ -12,8 +13,31 @@ const VERSION = pkg.version
|
|
|
12
13
|
const PID_DIR = resolve(homedir(), '.hermes-web-ui')
|
|
13
14
|
const PID_FILE = join(PID_DIR, 'server.pid')
|
|
14
15
|
const LOG_FILE = join(PID_DIR, 'server.log')
|
|
16
|
+
const TOKEN_FILE = resolve(__dirname, '..', 'dist', 'server', 'data', '.token')
|
|
15
17
|
const DEFAULT_PORT = 8648
|
|
16
18
|
|
|
19
|
+
function getToken() {
|
|
20
|
+
try {
|
|
21
|
+
return readFileSync(TOKEN_FILE, 'utf-8').trim()
|
|
22
|
+
} catch {
|
|
23
|
+
return null
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function ensureToken() {
|
|
28
|
+
// If AUTH_DISABLED or AUTH_TOKEN is set, let server handle it
|
|
29
|
+
if (process.env.AUTH_DISABLED === '1' || process.env.AUTH_DISABLED === 'true') return null
|
|
30
|
+
if (process.env.AUTH_TOKEN) return process.env.AUTH_TOKEN
|
|
31
|
+
|
|
32
|
+
let token = getToken()
|
|
33
|
+
if (!token) {
|
|
34
|
+
mkdirSync(dirname(TOKEN_FILE), { recursive: true })
|
|
35
|
+
token = randomBytes(32).toString('hex')
|
|
36
|
+
writeFileSync(TOKEN_FILE, token + '\n', { mode: 0o600 })
|
|
37
|
+
}
|
|
38
|
+
return token
|
|
39
|
+
}
|
|
40
|
+
|
|
17
41
|
function getPort() {
|
|
18
42
|
if (process.argv[3] && !isNaN(process.argv[3])) return parseInt(process.argv[3])
|
|
19
43
|
if (process.argv.includes('--port')) return parseInt(process.argv[process.argv.indexOf('--port') + 1])
|
|
@@ -81,11 +105,14 @@ function startDaemon(port) {
|
|
|
81
105
|
|
|
82
106
|
mkdirSync(PID_DIR, { recursive: true })
|
|
83
107
|
|
|
108
|
+
const token = ensureToken()
|
|
109
|
+
|
|
84
110
|
const logStream = openSync(LOG_FILE, 'a')
|
|
85
111
|
const child = spawn(process.execPath, [serverEntry], {
|
|
86
112
|
detached: true,
|
|
87
113
|
stdio: ['ignore', logStream, logStream],
|
|
88
|
-
env: { ...process.env, PORT: String(port) },
|
|
114
|
+
env: { ...process.env, PORT: String(port), AUTH_TOKEN: token },
|
|
115
|
+
windowsHide: true,
|
|
89
116
|
})
|
|
90
117
|
|
|
91
118
|
child.on('error', (err) => {
|
|
@@ -100,10 +127,11 @@ function startDaemon(port) {
|
|
|
100
127
|
setTimeout(() => {
|
|
101
128
|
if (isRunning(child.pid)) {
|
|
102
129
|
console.log(` ✓ hermes-web-ui started (PID: ${child.pid}, port: ${port})`)
|
|
103
|
-
|
|
130
|
+
const url = token
|
|
131
|
+
? `http://localhost:${port}/#/?token=${token}`
|
|
132
|
+
: `http://localhost:${port}`
|
|
133
|
+
console.log(` ${url}`)
|
|
104
134
|
console.log(` Log: ${LOG_FILE}`)
|
|
105
|
-
// Open browser
|
|
106
|
-
const url = `http://localhost:${port}`
|
|
107
135
|
const isWin = process.platform === 'win32'
|
|
108
136
|
const cmd = isWin ? `start ${url}` : process.platform === 'darwin' ? `open ${url}` : `xdg-open ${url}`
|
|
109
137
|
try { execSync(cmd, { stdio: 'ignore' }) } catch {}
|
|
@@ -199,6 +227,7 @@ function doUpdate() {
|
|
|
199
227
|
|
|
200
228
|
const child = spawn(isWin ? 'cmd' : 'sh', isWin ? ['/c', ...cmd.split(' ')] : ['-c', cmd], {
|
|
201
229
|
stdio: 'inherit',
|
|
230
|
+
windowsHide: true,
|
|
202
231
|
})
|
|
203
232
|
|
|
204
233
|
child.on('exit', (code) => {
|
|
@@ -235,6 +264,7 @@ switch (command) {
|
|
|
235
264
|
const child = spawn(process.execPath, [serverEntry], {
|
|
236
265
|
stdio: 'inherit',
|
|
237
266
|
env: { ...process.env, PORT: String(port) },
|
|
267
|
+
windowsHide: true,
|
|
238
268
|
})
|
|
239
269
|
child.on('exit', (code) => process.exit(code ?? 1))
|
|
240
270
|
process.on('SIGTERM', () => child.kill('SIGTERM'))
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as e,F as t,N as n,R as r,V as i,ct as a,d as o,dt as s,f as c,j as l}from"./router-Ddepf70Q.js";import{B as u,K as d,Q as f,R as p,U as m,Z as h,a as g,at as _,c as v,ct as y,d as b,dt as x,et as S,l as C,lt as w,n as T,nt as E,o as D,ot as O,q as k,r as A,t as j,tt as M,u as N,ut as P,z as F}from"./browser-Bf2Q3p4g.js";function I(e){return e.replace(/#|\(|\)|,|\s|\./g,`_`)}var L=l({name:`FadeInExpandTransition`,props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:t}){function r(t){e.width?t.style.maxWidth=`${t.offsetWidth}px`:t.style.maxHeight=`${t.offsetHeight}px`,t.offsetWidth}function i(t){e.width?t.style.maxWidth=`0`:t.style.maxHeight=`0`,t.offsetWidth;let{onLeave:n}=e;n&&n()}function a(t){e.width?t.style.maxWidth=``:t.style.maxHeight=``;let{onAfterLeave:n}=e;n&&n()}function s(t){if(t.style.transition=`none`,e.width){let e=t.offsetWidth;t.style.maxWidth=`0`,t.offsetWidth,t.style.transition=``,t.style.maxWidth=`${e}px`}else if(e.reverse)t.style.maxHeight=`${t.offsetHeight}px`,t.offsetHeight,t.style.transition=``,t.style.maxHeight=`0`;else{let e=t.offsetHeight;t.style.maxHeight=`0`,t.offsetWidth,t.style.transition=``,t.style.maxHeight=`${e}px`}t.offsetWidth}function l(t){var n;e.width?t.style.maxWidth=``:e.reverse||(t.style.maxHeight=``),(n=e.onAfterEnter)==null||n.call(e)}return()=>{let{group:u,width:d,appear:f,mode:p}=e,m=u?c:o,h={name:d?`fade-in-width-expand-transition`:`fade-in-height-expand-transition`,appear:f,onEnter:s,onAfterEnter:l,onBeforeLeave:r,onLeave:i,onAfterLeave:a};return u||(h.mode=p),n(m,h,t)}}}),{cubicBezierEaseInOut:R}=N;function z({duration:e=`.2s`,delay:t=`.1s`}={}){return[_(`&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to`,{opacity:1}),_(`&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from`,`
|
|
2
2
|
opacity: 0!important;
|
|
3
3
|
margin-left: 0!important;
|
|
4
4
|
margin-right: 0!important;
|
|
5
|
-
`),
|
|
5
|
+
`),_(`&.fade-in-width-expand-transition-leave-active`,`
|
|
6
6
|
overflow: hidden;
|
|
7
7
|
transition:
|
|
8
8
|
opacity ${e} ${R},
|
|
9
9
|
max-width ${e} ${R} ${t},
|
|
10
10
|
margin-left ${e} ${R} ${t},
|
|
11
11
|
margin-right ${e} ${R} ${t};
|
|
12
|
-
`),
|
|
12
|
+
`),_(`&.fade-in-width-expand-transition-enter-active`,`
|
|
13
13
|
overflow: hidden;
|
|
14
14
|
transition:
|
|
15
15
|
opacity ${e} ${R} ${t},
|
|
16
16
|
max-width ${e} ${R},
|
|
17
17
|
margin-left ${e} ${R},
|
|
18
18
|
margin-right ${e} ${R};
|
|
19
|
-
`)]}var B=
|
|
19
|
+
`)]}var B=O(`base-wave`,`
|
|
20
20
|
position: absolute;
|
|
21
21
|
left: 0;
|
|
22
22
|
right: 0;
|
|
23
23
|
top: 0;
|
|
24
24
|
bottom: 0;
|
|
25
25
|
border-radius: inherit;
|
|
26
|
-
`),V=
|
|
26
|
+
`),V=l({name:`BaseWave`,props:{clsPrefix:{type:String,required:!0}},setup(e){C(`-base-wave`,B,s(e,`clsPrefix`));let t=a(null),n=a(!1),o=null;return i(()=>{o!==null&&window.clearTimeout(o)}),{active:n,selfRef:t,play(){o!==null&&(window.clearTimeout(o),n.value=!1,o=null),r(()=>{var e;(e=t.value)==null||e.offsetHeight,n.value=!0,o=window.setTimeout(()=>{n.value=!1,o=null},1e3)})}}},render(){let{clsPrefix:e}=this;return n(`div`,{ref:`selfRef`,"aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}});function H(e){return E(e,[255,255,255,.16])}function U(e){return E(e,[0,0,0,.12])}var W=f(`n-button-group`),G={paddingTiny:`0 6px`,paddingSmall:`0 10px`,paddingMedium:`0 14px`,paddingLarge:`0 18px`,paddingRoundTiny:`0 10px`,paddingRoundSmall:`0 14px`,paddingRoundMedium:`0 18px`,paddingRoundLarge:`0 22px`,iconMarginTiny:`6px`,iconMarginSmall:`6px`,iconMarginMedium:`6px`,iconMarginLarge:`6px`,iconSizeTiny:`14px`,iconSizeSmall:`18px`,iconSizeMedium:`18px`,iconSizeLarge:`20px`,rippleDuration:`.6s`};function K(e){let{heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:i,borderRadius:a,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:l,opacityDisabled:u,textColor2:d,textColor3:f,primaryColorHover:p,primaryColorPressed:m,borderColor:h,primaryColor:g,baseColor:_,infoColor:v,infoColorHover:y,infoColorPressed:b,successColor:x,successColorHover:S,successColorPressed:C,warningColor:w,warningColorHover:T,warningColorPressed:E,errorColor:D,errorColorHover:O,errorColorPressed:k,fontWeight:A,buttonColor2:j,buttonColor2Hover:M,buttonColor2Pressed:N,fontWeightStrong:P}=e;return Object.assign(Object.assign({},G),{heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:i,borderRadiusTiny:a,borderRadiusSmall:a,borderRadiusMedium:a,borderRadiusLarge:a,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:l,opacityDisabled:u,colorOpacitySecondary:`0.16`,colorOpacitySecondaryHover:`0.22`,colorOpacitySecondaryPressed:`0.28`,colorSecondary:j,colorSecondaryHover:M,colorSecondaryPressed:N,colorTertiary:j,colorTertiaryHover:M,colorTertiaryPressed:N,colorQuaternary:`#0000`,colorQuaternaryHover:M,colorQuaternaryPressed:N,color:`#0000`,colorHover:`#0000`,colorPressed:`#0000`,colorFocus:`#0000`,colorDisabled:`#0000`,textColor:d,textColorTertiary:f,textColorHover:p,textColorPressed:m,textColorFocus:p,textColorDisabled:d,textColorText:d,textColorTextHover:p,textColorTextPressed:m,textColorTextFocus:p,textColorTextDisabled:d,textColorGhost:d,textColorGhostHover:p,textColorGhostPressed:m,textColorGhostFocus:p,textColorGhostDisabled:d,border:`1px solid ${h}`,borderHover:`1px solid ${p}`,borderPressed:`1px solid ${m}`,borderFocus:`1px solid ${p}`,borderDisabled:`1px solid ${h}`,rippleColor:g,colorPrimary:g,colorHoverPrimary:p,colorPressedPrimary:m,colorFocusPrimary:p,colorDisabledPrimary:g,textColorPrimary:_,textColorHoverPrimary:_,textColorPressedPrimary:_,textColorFocusPrimary:_,textColorDisabledPrimary:_,textColorTextPrimary:g,textColorTextHoverPrimary:p,textColorTextPressedPrimary:m,textColorTextFocusPrimary:p,textColorTextDisabledPrimary:d,textColorGhostPrimary:g,textColorGhostHoverPrimary:p,textColorGhostPressedPrimary:m,textColorGhostFocusPrimary:p,textColorGhostDisabledPrimary:g,borderPrimary:`1px solid ${g}`,borderHoverPrimary:`1px solid ${p}`,borderPressedPrimary:`1px solid ${m}`,borderFocusPrimary:`1px solid ${p}`,borderDisabledPrimary:`1px solid ${g}`,rippleColorPrimary:g,colorInfo:v,colorHoverInfo:y,colorPressedInfo:b,colorFocusInfo:y,colorDisabledInfo:v,textColorInfo:_,textColorHoverInfo:_,textColorPressedInfo:_,textColorFocusInfo:_,textColorDisabledInfo:_,textColorTextInfo:v,textColorTextHoverInfo:y,textColorTextPressedInfo:b,textColorTextFocusInfo:y,textColorTextDisabledInfo:d,textColorGhostInfo:v,textColorGhostHoverInfo:y,textColorGhostPressedInfo:b,textColorGhostFocusInfo:y,textColorGhostDisabledInfo:v,borderInfo:`1px solid ${v}`,borderHoverInfo:`1px solid ${y}`,borderPressedInfo:`1px solid ${b}`,borderFocusInfo:`1px solid ${y}`,borderDisabledInfo:`1px solid ${v}`,rippleColorInfo:v,colorSuccess:x,colorHoverSuccess:S,colorPressedSuccess:C,colorFocusSuccess:S,colorDisabledSuccess:x,textColorSuccess:_,textColorHoverSuccess:_,textColorPressedSuccess:_,textColorFocusSuccess:_,textColorDisabledSuccess:_,textColorTextSuccess:x,textColorTextHoverSuccess:S,textColorTextPressedSuccess:C,textColorTextFocusSuccess:S,textColorTextDisabledSuccess:d,textColorGhostSuccess:x,textColorGhostHoverSuccess:S,textColorGhostPressedSuccess:C,textColorGhostFocusSuccess:S,textColorGhostDisabledSuccess:x,borderSuccess:`1px solid ${x}`,borderHoverSuccess:`1px solid ${S}`,borderPressedSuccess:`1px solid ${C}`,borderFocusSuccess:`1px solid ${S}`,borderDisabledSuccess:`1px solid ${x}`,rippleColorSuccess:x,colorWarning:w,colorHoverWarning:T,colorPressedWarning:E,colorFocusWarning:T,colorDisabledWarning:w,textColorWarning:_,textColorHoverWarning:_,textColorPressedWarning:_,textColorFocusWarning:_,textColorDisabledWarning:_,textColorTextWarning:w,textColorTextHoverWarning:T,textColorTextPressedWarning:E,textColorTextFocusWarning:T,textColorTextDisabledWarning:d,textColorGhostWarning:w,textColorGhostHoverWarning:T,textColorGhostPressedWarning:E,textColorGhostFocusWarning:T,textColorGhostDisabledWarning:w,borderWarning:`1px solid ${w}`,borderHoverWarning:`1px solid ${T}`,borderPressedWarning:`1px solid ${E}`,borderFocusWarning:`1px solid ${T}`,borderDisabledWarning:`1px solid ${w}`,rippleColorWarning:w,colorError:D,colorHoverError:O,colorPressedError:k,colorFocusError:O,colorDisabledError:D,textColorError:_,textColorHoverError:_,textColorPressedError:_,textColorFocusError:_,textColorDisabledError:_,textColorTextError:D,textColorTextHoverError:O,textColorTextPressedError:k,textColorTextFocusError:O,textColorTextDisabledError:d,textColorGhostError:D,textColorGhostHoverError:O,textColorGhostPressedError:k,textColorGhostFocusError:O,textColorGhostDisabledError:D,borderError:`1px solid ${D}`,borderHoverError:`1px solid ${O}`,borderPressedError:`1px solid ${k}`,borderFocusError:`1px solid ${O}`,borderDisabledError:`1px solid ${D}`,rippleColorError:D,waveOpacity:`0.6`,fontWeight:A,fontWeightStrong:P})}var q={name:`Button`,common:T,self:K},J=_([O(`button`,`
|
|
27
27
|
margin: 0;
|
|
28
28
|
font-weight: var(--n-font-weight);
|
|
29
29
|
line-height: 1;
|
|
@@ -55,7 +55,7 @@ import{$ as e,E as t,M as n,S as r,k as i,m as a,n as o,r as s,rt as c,w as l}fr
|
|
|
55
55
|
background-color .3s var(--n-bezier),
|
|
56
56
|
opacity .3s var(--n-bezier),
|
|
57
57
|
border-color .3s var(--n-bezier);
|
|
58
|
-
`,[
|
|
58
|
+
`,[w(`color`,[y(`border`,{borderColor:`var(--n-border-color)`}),w(`disabled`,[y(`border`,{borderColor:`var(--n-border-color-disabled)`})]),P(`disabled`,[_(`&:focus`,[y(`state-border`,{borderColor:`var(--n-border-color-focus)`})]),_(`&:hover`,[y(`state-border`,{borderColor:`var(--n-border-color-hover)`})]),_(`&:active`,[y(`state-border`,{borderColor:`var(--n-border-color-pressed)`})]),w(`pressed`,[y(`state-border`,{borderColor:`var(--n-border-color-pressed)`})])])]),w(`disabled`,{backgroundColor:`var(--n-color-disabled)`,color:`var(--n-text-color-disabled)`},[y(`border`,{border:`var(--n-border-disabled)`})]),P(`disabled`,[_(`&:focus`,{backgroundColor:`var(--n-color-focus)`,color:`var(--n-text-color-focus)`},[y(`state-border`,{border:`var(--n-border-focus)`})]),_(`&:hover`,{backgroundColor:`var(--n-color-hover)`,color:`var(--n-text-color-hover)`},[y(`state-border`,{border:`var(--n-border-hover)`})]),_(`&:active`,{backgroundColor:`var(--n-color-pressed)`,color:`var(--n-text-color-pressed)`},[y(`state-border`,{border:`var(--n-border-pressed)`})]),w(`pressed`,{backgroundColor:`var(--n-color-pressed)`,color:`var(--n-text-color-pressed)`},[y(`state-border`,{border:`var(--n-border-pressed)`})])]),w(`loading`,`cursor: wait;`),O(`base-wave`,`
|
|
59
59
|
pointer-events: none;
|
|
60
60
|
top: 0;
|
|
61
61
|
right: 0;
|
|
@@ -64,7 +64,7 @@ import{$ as e,E as t,M as n,S as r,k as i,m as a,n as o,r as s,rt as c,w as l}fr
|
|
|
64
64
|
animation-iteration-count: 1;
|
|
65
65
|
animation-duration: var(--n-ripple-duration);
|
|
66
66
|
animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out);
|
|
67
|
-
`,[
|
|
67
|
+
`,[w(`active`,{zIndex:1,animationName:`button-wave-spread, button-wave-opacity`})]),h&&`MozBoxSizing`in document.createElement(`div`).style?_(`&::moz-focus-inner`,{border:0}):null,y(`border, state-border`,`
|
|
68
68
|
position: absolute;
|
|
69
69
|
left: 0;
|
|
70
70
|
top: 0;
|
|
@@ -73,13 +73,13 @@ import{$ as e,E as t,M as n,S as r,k as i,m as a,n as o,r as s,rt as c,w as l}fr
|
|
|
73
73
|
border-radius: inherit;
|
|
74
74
|
transition: border-color .3s var(--n-bezier);
|
|
75
75
|
pointer-events: none;
|
|
76
|
-
`),
|
|
76
|
+
`),y(`border`,`
|
|
77
77
|
border: var(--n-border);
|
|
78
|
-
`),
|
|
78
|
+
`),y(`state-border`,`
|
|
79
79
|
border: var(--n-border);
|
|
80
80
|
border-color: #0000;
|
|
81
81
|
z-index: 1;
|
|
82
|
-
`),
|
|
82
|
+
`),y(`icon`,`
|
|
83
83
|
margin: var(--n-icon-margin);
|
|
84
84
|
margin-left: 0;
|
|
85
85
|
height: var(--n-icon-size);
|
|
@@ -88,7 +88,7 @@ import{$ as e,E as t,M as n,S as r,k as i,m as a,n as o,r as s,rt as c,w as l}fr
|
|
|
88
88
|
font-size: var(--n-icon-size);
|
|
89
89
|
position: relative;
|
|
90
90
|
flex-shrink: 0;
|
|
91
|
-
`,[
|
|
91
|
+
`,[O(`icon-slot`,`
|
|
92
92
|
height: var(--n-icon-size);
|
|
93
93
|
width: var(--n-icon-size);
|
|
94
94
|
position: absolute;
|
|
@@ -98,12 +98,12 @@ import{$ as e,E as t,M as n,S as r,k as i,m as a,n as o,r as s,rt as c,w as l}fr
|
|
|
98
98
|
display: flex;
|
|
99
99
|
align-items: center;
|
|
100
100
|
justify-content: center;
|
|
101
|
-
`,[
|
|
101
|
+
`,[g({top:`50%`,originalTransform:`translateY(-50%)`})]),z()]),y(`content`,`
|
|
102
102
|
display: flex;
|
|
103
103
|
align-items: center;
|
|
104
104
|
flex-wrap: nowrap;
|
|
105
105
|
min-width: 0;
|
|
106
|
-
`,[
|
|
106
|
+
`,[_(`~`,[y(`icon`,{margin:`var(--n-icon-margin)`,marginRight:0})])]),w(`block`,`
|
|
107
107
|
display: flex;
|
|
108
108
|
width: 100%;
|
|
109
|
-
`),
|
|
109
|
+
`),w(`dashed`,[y(`border, state-border`,{borderStyle:`dashed !important`})]),w(`disabled`,{cursor:`not-allowed`,opacity:`var(--n-opacity-disabled)`})]),_(`@keyframes button-wave-spread`,{from:{boxShadow:`0 0 0.5px 0 var(--n-ripple-color)`},to:{boxShadow:`0 0 0.5px 4.5px var(--n-ripple-color)`}}),_(`@keyframes button-wave-opacity`,{from:{opacity:`var(--n-wave-opacity)`},to:{opacity:0}})]),Y=l({name:`Button`,props:Object.assign(Object.assign({},v.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:`button`},type:{type:String,default:`default`},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:`left`},attrType:{type:String,default:`button`},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!j},spinProps:Object}),slots:Object,setup(n){let r=a(null),i=a(null),o=a(!1),s=S(()=>!n.quaternary&&!n.tertiary&&!n.secondary&&!n.text&&(!n.color||n.ghost||n.dashed)&&n.bordered),c=t(W,{}),{inlineThemeDisabled:l,mergedClsPrefixRef:d,mergedRtlRef:f,mergedComponentPropsRef:m}=u(n),{mergedSizeRef:h}=p({},{defaultSize:`medium`,mergedSize:e=>{let{size:t}=n;if(t)return t;let{size:r}=c;if(r)return r;let{mergedSize:i}=e||{};return i?i.value:m?.value?.Button?.size||`medium`}}),g=e(()=>n.focusable&&!n.disabled),_=e=>{var t;g.value||e.preventDefault(),!n.nativeFocusBehavior&&(e.preventDefault(),!n.disabled&&g.value&&((t=r.value)==null||t.focus({preventScroll:!0})))},y=e=>{var t;if(!n.disabled&&!n.loading){let{onClick:r}=n;r&&k(r,e),n.text||(t=i.value)==null||t.play()}},C=e=>{switch(e.key){case`Enter`:if(!n.keyboard)return;o.value=!1}},w=e=>{switch(e.key){case`Enter`:if(!n.keyboard||n.loading){e.preventDefault();return}o.value=!0}},T=()=>{o.value=!1},E=v(`Button`,`-button`,J,q,n,d),D=b(`Button`,f,d),O=e(()=>{let{common:{cubicBezierEaseInOut:e,cubicBezierEaseOut:t},self:r}=E.value,{rippleDuration:i,opacityDisabled:a,fontWeight:o,fontWeightStrong:s}=r,c=h.value,{dashed:l,type:u,ghost:d,text:f,color:p,round:m,circle:g,textColor:_,secondary:v,tertiary:y,quaternary:b,strong:S}=n,C={"--n-font-weight":S?s:o},w={"--n-color":`initial`,"--n-color-hover":`initial`,"--n-color-pressed":`initial`,"--n-color-focus":`initial`,"--n-color-disabled":`initial`,"--n-ripple-color":`initial`,"--n-text-color":`initial`,"--n-text-color-hover":`initial`,"--n-text-color-pressed":`initial`,"--n-text-color-focus":`initial`,"--n-text-color-disabled":`initial`},T=u===`tertiary`,D=u===`default`,O=T?`default`:u;if(f){let e=_||p;w={"--n-color":`#0000`,"--n-color-hover":`#0000`,"--n-color-pressed":`#0000`,"--n-color-focus":`#0000`,"--n-color-disabled":`#0000`,"--n-ripple-color":`#0000`,"--n-text-color":e||r[x(`textColorText`,O)],"--n-text-color-hover":e?H(e):r[x(`textColorTextHover`,O)],"--n-text-color-pressed":e?U(e):r[x(`textColorTextPressed`,O)],"--n-text-color-focus":e?H(e):r[x(`textColorTextHover`,O)],"--n-text-color-disabled":e||r[x(`textColorTextDisabled`,O)]}}else if(d||l){let e=_||p;w={"--n-color":`#0000`,"--n-color-hover":`#0000`,"--n-color-pressed":`#0000`,"--n-color-focus":`#0000`,"--n-color-disabled":`#0000`,"--n-ripple-color":p||r[x(`rippleColor`,O)],"--n-text-color":e||r[x(`textColorGhost`,O)],"--n-text-color-hover":e?H(e):r[x(`textColorGhostHover`,O)],"--n-text-color-pressed":e?U(e):r[x(`textColorGhostPressed`,O)],"--n-text-color-focus":e?H(e):r[x(`textColorGhostHover`,O)],"--n-text-color-disabled":e||r[x(`textColorGhostDisabled`,O)]}}else if(v){let e=D?r.textColor:T?r.textColorTertiary:r[x(`color`,O)],t=p||e,n=u!==`default`&&u!==`tertiary`;w={"--n-color":n?M(t,{alpha:Number(r.colorOpacitySecondary)}):r.colorSecondary,"--n-color-hover":n?M(t,{alpha:Number(r.colorOpacitySecondaryHover)}):r.colorSecondaryHover,"--n-color-pressed":n?M(t,{alpha:Number(r.colorOpacitySecondaryPressed)}):r.colorSecondaryPressed,"--n-color-focus":n?M(t,{alpha:Number(r.colorOpacitySecondaryHover)}):r.colorSecondaryHover,"--n-color-disabled":r.colorSecondary,"--n-ripple-color":`#0000`,"--n-text-color":t,"--n-text-color-hover":t,"--n-text-color-pressed":t,"--n-text-color-focus":t,"--n-text-color-disabled":t}}else if(y||b){let e=D?r.textColor:T?r.textColorTertiary:r[x(`color`,O)],t=p||e;y?(w[`--n-color`]=r.colorTertiary,w[`--n-color-hover`]=r.colorTertiaryHover,w[`--n-color-pressed`]=r.colorTertiaryPressed,w[`--n-color-focus`]=r.colorSecondaryHover,w[`--n-color-disabled`]=r.colorTertiary):(w[`--n-color`]=r.colorQuaternary,w[`--n-color-hover`]=r.colorQuaternaryHover,w[`--n-color-pressed`]=r.colorQuaternaryPressed,w[`--n-color-focus`]=r.colorQuaternaryHover,w[`--n-color-disabled`]=r.colorQuaternary),w[`--n-ripple-color`]=`#0000`,w[`--n-text-color`]=t,w[`--n-text-color-hover`]=t,w[`--n-text-color-pressed`]=t,w[`--n-text-color-focus`]=t,w[`--n-text-color-disabled`]=t}else w={"--n-color":p||r[x(`color`,O)],"--n-color-hover":p?H(p):r[x(`colorHover`,O)],"--n-color-pressed":p?U(p):r[x(`colorPressed`,O)],"--n-color-focus":p?H(p):r[x(`colorFocus`,O)],"--n-color-disabled":p||r[x(`colorDisabled`,O)],"--n-ripple-color":p||r[x(`rippleColor`,O)],"--n-text-color":_||(p?r.textColorPrimary:T?r.textColorTertiary:r[x(`textColor`,O)]),"--n-text-color-hover":_||(p?r.textColorHoverPrimary:r[x(`textColorHover`,O)]),"--n-text-color-pressed":_||(p?r.textColorPressedPrimary:r[x(`textColorPressed`,O)]),"--n-text-color-focus":_||(p?r.textColorFocusPrimary:r[x(`textColorFocus`,O)]),"--n-text-color-disabled":_||(p?r.textColorDisabledPrimary:r[x(`textColorDisabled`,O)])};let k={"--n-border":`initial`,"--n-border-hover":`initial`,"--n-border-pressed":`initial`,"--n-border-focus":`initial`,"--n-border-disabled":`initial`};k=f?{"--n-border":`none`,"--n-border-hover":`none`,"--n-border-pressed":`none`,"--n-border-focus":`none`,"--n-border-disabled":`none`}:{"--n-border":r[x(`border`,O)],"--n-border-hover":r[x(`borderHover`,O)],"--n-border-pressed":r[x(`borderPressed`,O)],"--n-border-focus":r[x(`borderFocus`,O)],"--n-border-disabled":r[x(`borderDisabled`,O)]};let{[x(`height`,c)]:A,[x(`fontSize`,c)]:j,[x(`padding`,c)]:N,[x(`paddingRound`,c)]:P,[x(`iconSize`,c)]:F,[x(`borderRadius`,c)]:I,[x(`iconMargin`,c)]:L,waveOpacity:R}=r,z={"--n-width":g&&!f?A:`initial`,"--n-height":f?`initial`:A,"--n-font-size":j,"--n-padding":g||f?`initial`:m?P:N,"--n-icon-size":F,"--n-icon-margin":L,"--n-border-radius":f?`initial`:g||m?A:I};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":e,"--n-bezier-ease-out":t,"--n-ripple-duration":i,"--n-opacity-disabled":a,"--n-wave-opacity":R},C),w),k),z)}),A=l?F(`button`,e(()=>{let e=``,{dashed:t,type:r,ghost:i,text:a,color:o,round:s,circle:c,textColor:l,secondary:u,tertiary:d,quaternary:f,strong:p}=n;t&&(e+=`a`),i&&(e+=`b`),a&&(e+=`c`),s&&(e+=`d`),c&&(e+=`e`),u&&(e+=`f`),d&&(e+=`g`),f&&(e+=`h`),p&&(e+=`i`),o&&(e+=`j${I(o)}`),l&&(e+=`k${I(l)}`);let{value:m}=h;return e+=`l${m[0]}`,e+=`m${r[0]}`,e}),O,n):void 0;return{selfElRef:r,waveElRef:i,mergedClsPrefix:d,mergedFocusable:g,mergedSize:h,showBorder:s,enterPressed:o,rtlEnabled:D,handleMousedown:_,handleKeydown:w,handleBlur:T,handleKeyup:C,handleClick:y,customColorCssVars:e(()=>{let{color:e}=n;if(!e)return null;let t=H(e);return{"--n-border-color":e,"--n-border-color-hover":t,"--n-border-color-pressed":U(e),"--n-border-color-focus":t,"--n-border-color-disabled":e}}),cssVars:l?void 0:O,themeClass:A?.themeClass,onRender:A?.onRender}},render(){let{mergedClsPrefix:e,tag:t,onRender:r}=this;r?.();let i=d(this.$slots.default,t=>t&&n(`span`,{class:`${e}-button__content`},t));return n(t,{ref:`selfElRef`,class:[this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement===`right`&&i,n(L,{width:!0},{default:()=>d(this.$slots.icon,t=>(this.loading||this.renderIcon||t)&&n(`span`,{class:`${e}-button__icon`,style:{margin:m(this.$slots.default)?`0`:``}},n(D,null,{default:()=>this.loading?n(A,Object.assign({clsPrefix:e,key:`loading`,class:`${e}-icon-slot`,strokeWidth:20},this.spinProps)):n(`div`,{key:`icon`,class:`${e}-icon-slot`,role:`none`},this.renderIcon?this.renderIcon():t)})))}),this.iconPlacement===`left`&&i,this.text?null:n(V,{ref:`waveElRef`,clsPrefix:e}),this.showBorder?n(`div`,{"aria-hidden":!0,class:`${e}-button__border`,style:this.customColorCssVars}):null,this.showBorder?n(`div`,{"aria-hidden":!0,class:`${e}-button__state-border`,style:this.customColorCssVars}):null)}}),X=Y;export{I as a,L as i,X as n,q as r,Y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.platform-card[data-v-ee5f4168]{background-color:#fff;border:1px solid #e0e0e0;border-radius:10px;margin-bottom:12px;overflow:hidden}.platform-card.configured[data-v-ee5f4168]{border-color:#2e7d3233}.platform-card-header[data-v-ee5f4168]{cursor:pointer;-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;padding:12px 16px;display:flex}.platform-card-header[data-v-ee5f4168]:hover{background-color:#1a1a1a08}.platform-info[data-v-ee5f4168]{align-items:center;gap:10px;display:flex}.platform-icon[data-v-ee5f4168]{color:#666;flex-shrink:0;width:18px;height:18px}.platform-name[data-v-ee5f4168]{color:#1a1a1a;font-size:14px;font-weight:500}.expand-icon[data-v-ee5f4168]{color:#999;font-size:12px;transition:transform .2s}.expand-icon.expanded[data-v-ee5f4168]{transform:rotate(0)}.expand-icon[data-v-ee5f4168]:not(.expanded){transform:rotate(-90deg)}.platform-card-body[data-v-ee5f4168]{border-top:1px solid #ebebeb;padding:0 16px 12px}.settings-section[data-v-afd5f277]{margin-top:16px}.weixin-qr-section[data-v-afd5f277]{margin-top:12px;margin-bottom:12px}.weixin-qr-loading[data-v-afd5f277]{color:#999;align-items:center;gap:8px;font-size:13px;display:flex}.weixin-qr-hint[data-v-afd5f277]{color:#666;font-size:13px}.channels-view[data-v-
|
|
1
|
+
.platform-card[data-v-ee5f4168]{background-color:#fff;border:1px solid #e0e0e0;border-radius:10px;margin-bottom:12px;overflow:hidden}.platform-card.configured[data-v-ee5f4168]{border-color:#2e7d3233}.platform-card-header[data-v-ee5f4168]{cursor:pointer;-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;padding:12px 16px;display:flex}.platform-card-header[data-v-ee5f4168]:hover{background-color:#1a1a1a08}.platform-info[data-v-ee5f4168]{align-items:center;gap:10px;display:flex}.platform-icon[data-v-ee5f4168]{color:#666;flex-shrink:0;width:18px;height:18px}.platform-name[data-v-ee5f4168]{color:#1a1a1a;font-size:14px;font-weight:500}.expand-icon[data-v-ee5f4168]{color:#999;font-size:12px;transition:transform .2s}.expand-icon.expanded[data-v-ee5f4168]{transform:rotate(0)}.expand-icon[data-v-ee5f4168]:not(.expanded){transform:rotate(-90deg)}.platform-card-body[data-v-ee5f4168]{border-top:1px solid #ebebeb;padding:0 16px 12px}.settings-section[data-v-afd5f277]{margin-top:16px}.weixin-qr-section[data-v-afd5f277]{margin-top:12px;margin-bottom:12px}.weixin-qr-loading[data-v-afd5f277]{color:#999;align-items:center;gap:8px;font-size:13px;display:flex}.weixin-qr-hint[data-v-afd5f277]{color:#666;font-size:13px}.channels-view[data-v-11275a38]{flex-direction:column;height:100vh;display:flex}.channels-content[data-v-11275a38]{flex:1;padding:20px;overflow-y:auto}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,C as t,D as n,E as r,G as i,J as a,Q as o,T as s,U as c,W as l,ct as u,gt as d,j as f,k as p,mt as m,pt as h,q as g,w as _,y as v}from"./router-Ddepf70Q.js";import{r as y,t as b}from"./_plugin-vue_export-helper-DQGaK6t5.js";import{t as x}from"./Button-sJ2BpaPl.js";import{t as S}from"./Input-BzhYBEbH.js";import{t as C}from"./Tag-DFrN7AVl.js";import{t as w}from"./use-message-DAtcV1hg.js";import{t as T}from"./Spin-CaLC5eru.js";import{t as E}from"./Switch-BeZgnVyD.js";import{a as D,i as O,n as k,o as A,r as j,t as M}from"./SettingRow-CndAlF8Z.js";var N={class:`platform-info`},P=[`innerHTML`],F={class:`platform-name`},I={key:0,class:`platform-card-body`},L=b(f({__name:`PlatformCard`,props:{name:{},icon:{},config:{},credentials:{}},setup(s){let c=s,l=u(!0),{t:f}=y(),g=t(()=>{let e=c.credentials;if(!e)return!1;let t=[`token`,`api_key`,`app_id`,`client_id`,`secret`,`app_secret`,`client_secret`,`access_token`,`bot_id`,`account_id`,`enabled`];return[e,e.extra].filter(Boolean).some(e=>t.some(t=>{let n=e[t];return n!=null&&n!==``&&n!==!1}))});return(t,c)=>(i(),n(`div`,{class:m([`platform-card`,{configured:g.value}])},[_(`div`,{class:`platform-card-header`,onClick:c[0]||=e=>l.value=!l.value},[_(`div`,N,[_(`span`,{class:`platform-icon`,innerHTML:s.icon},null,8,P),_(`span`,F,d(s.name),1),e(h(C),{type:g.value?`success`:`default`,size:`small`,round:``},{default:o(()=>[p(d(g.value?h(f)(`common.configured`):h(f)(`common.notConfigured`)),1)]),_:1},8,[`type`])]),_(`span`,{class:m([`expand-icon`,{expanded:l.value}])},`▾`,2)]),l.value?(i(),n(`div`,I,[a(t.$slots,`default`,{},void 0,!0)])):r(``,!0)],2))}}),[[`__scopeId`,`data-v-ee5f4168`]]),R={class:`settings-section`},z={class:`weixin-qr-section`},B={key:1,class:`weixin-qr-loading`},V={key:2,class:`weixin-qr-hint`},H=b(f({__name:`PlatformSettings`,setup(t){let a=k(),c=w(),{t:f}=y();async function m(e,t){try{await a.saveSection(e,t),c.success(f(`settings.saved`))}catch{c.error(f(`settings.saveFailed`))}}async function b(e,t){try{await D(e,t),await a.fetchSettings(),c.success(f(`settings.saved`))}catch{c.error(f(`settings.saveFailed`))}}function C(e){return a.platforms[e]||{}}let N=u(``),P=u(``),F=u(`idle`),I=null;async function H(){F.value=`loading`,N.value=``,P.value=``,W();try{let e=await j();P.value=e.qrcode,N.value=e.qrcode_url,window.open(e.qrcode_url,`_blank`),F.value=`waiting`,U()}catch(e){F.value=`error`,c.error(e.message||`Failed to get QR code`)}}function U(){P.value&&(I=setTimeout(async()=>{try{let e=await O(P.value);e.status===`wait`?U():e.status===`scaned`?(F.value=`scaned`,U()):e.status===`expired`?F.value=`expired`:e.status===`confirmed`&&(F.value=`confirmed`,await A({account_id:e.account_id,token:e.token,base_url:e.base_url}),await a.fetchSettings(),c.success(f(`settings.saved`)))}catch{U()}},3e3))}function W(){I&&=(clearTimeout(I),null)}l(()=>{W()});let G=[{key:`telegram`,name:`Telegram`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.479.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>`},{key:`discord`,name:`Discord`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"/></svg>`},{key:`slack`,name:`Slack`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 0a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V5.042zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1 2.523-2.52h6.313A2.528 2.528 0 0 1 24 18.956a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>`},{key:`whatsapp`,name:`WhatsApp`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>`},{key:`matrix`,name:`Matrix`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.48.324.448.217.786.619 1.017 1.205.24-.376.558-.702.956-.98.398-.277.872-.414 1.424-.414.41 0 .784.065 1.122.194.34.13.629.325.87.588.241.263.428.59.56.984.132.393.198.85.198 1.368v5.89h-2.49v-4.893c0-.268-.016-.525-.048-.77a1.627 1.627 0 00-.2-.63 1.028 1.028 0 00-.392-.426 1.294 1.294 0 00-.616-.134c-.277 0-.508.05-.693.15a1.043 1.043 0 00-.43.41 1.768 1.768 0 00-.214.616 4.15 4.15 0 00-.06.74v4.937H9.29v-4.937c0-.25-.01-.498-.032-.742a1.84 1.84 0 00-.166-.638.998.998 0 00-.363-.448 1.206 1.206 0 00-.624-.154c-.26 0-.483.048-.67.144a1.055 1.055 0 00-.436.402 1.744 1.744 0 00-.227.616 4.108 4.108 0 00-.063.74v4.937H5.21V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg>`},{key:`feishu`,name:`Feishu`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6.59 3.41a2.25 2.25 0 0 1 3.182 0L13.5 7.14l-3.182 3.182L6.59 7.59a2.25 2.25 0 0 1 0-3.182zm5.303 5.303L15.075 5.53a2.25 2.25 0 0 1 3.182 3.182L15.075 11.894 11.893 8.713zM3.41 6.59a2.25 2.25 0 0 1 3.182 0l3.182 3.182-3.182 3.182a2.25 2.25 0 0 1-3.182-3.182L3.41 6.59zm5.303 5.303L11.894 15.075a2.25 2.25 0 0 1-3.182 3.182L5.53 15.075 8.713 11.893zm5.303-5.303L17.478 9.778a2.25 2.25 0 0 1-3.182 3.182L10.53 10.075l3.182-3.182 0 .023z"/></svg>`},{key:`weixin`,name:`Weixin`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>`},{key:`wecom`,name:`WeCom`,icon:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 01.213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 00.167-.054l1.903-1.114a.864.864 0 01.717-.098 10.16 10.16 0 002.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178A1.17 1.17 0 014.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 01-1.162 1.178 1.17 1.17 0 01-1.162-1.178c0-.651.52-1.18 1.162-1.18zm3.68 4.025c-3.694 0-6.69 2.462-6.69 5.496 0 3.034 2.996 5.496 6.69 5.496.753 0 1.477-.1 2.158-.28a.66.66 0 01.548.074l1.46.854a.25.25 0 00.127.041.224.224 0 00.221-.225c0-.055-.022-.109-.037-.162l-.298-1.131a.453.453 0 01.163-.509C21.81 18.613 22.77 16.973 22.77 15.512c0-3.034-2.996-5.496-6.69-5.496h.198zm-2.454 3.347c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902zm4.912 0c.491 0 .889.404.889.902a.896.896 0 01-.889.903.896.896 0 01-.889-.903c0-.498.398-.902.889-.902z"/></svg>`}];return(t,c)=>(i(),n(`section`,R,[(i(),n(v,null,g(G,t=>e(L,{key:t.key,name:t.name,icon:t.icon,config:h(a)[t.key],credentials:C(t.key)},{default:o(()=>[t.key===`telegram`?(i(),n(v,{key:0},[e(M,{label:h(f)(`platform.botToken`),hint:h(f)(`platform.botTokenHint`)},{default:o(()=>[e(h(S),{value:C(`telegram`).token||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`123456:ABC-DEF...`,"onUpdate:value":c[0]||=e=>b(`telegram`,{token:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.requireMention`),hint:h(f)(`platform.requireMentionGroup`)},{default:o(()=>[e(h(E),{value:h(a).telegram.require_mention,"onUpdate:value":c[1]||=e=>m(`telegram`,{require_mention:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.reactions`),hint:h(f)(`platform.reactionsHint`)},{default:o(()=>[e(h(E),{value:h(a).telegram.reactions,"onUpdate:value":c[2]||=e=>m(`telegram`,{reactions:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.freeResponseChats`),hint:h(f)(`platform.freeResponseChatsHint`)},{default:o(()=>[e(h(S),{value:h(a).telegram.free_response_chats||``,size:`small`,placeholder:`chat_id1,chat_id2`,"onUpdate:value":c[3]||=e=>m(`telegram`,{free_response_chats:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.mentionPatterns`),hint:h(f)(`platform.mentionPatternsHint`)},{default:o(()=>[e(h(S),{value:(h(a).telegram.mention_patterns||[]).join(`, `),size:`small`,placeholder:`pattern1, pattern2`,"onUpdate:value":c[4]||=e=>m(`telegram`,{mention_patterns:e?e.split(`,`).map(e=>e.trim()):[]})},null,8,[`value`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`discord`?(i(),n(v,{key:1},[e(M,{label:h(f)(`platform.botToken`),hint:h(f)(`platform.botTokenHint`)},{default:o(()=>[e(h(S),{value:C(`discord`).token||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`Bot token...`,"onUpdate:value":c[5]||=e=>b(`discord`,{token:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.requireMention`),hint:h(f)(`platform.requireMentionChannel`)},{default:o(()=>[e(h(E),{value:h(a).discord.require_mention,"onUpdate:value":c[6]||=e=>m(`discord`,{require_mention:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.autoThread`),hint:h(f)(`platform.autoThreadHint`)},{default:o(()=>[e(h(E),{value:h(a).discord.auto_thread,"onUpdate:value":c[7]||=e=>m(`discord`,{auto_thread:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.reactions`),hint:h(f)(`platform.reactionsHint`)},{default:o(()=>[e(h(E),{value:h(a).discord.reactions,"onUpdate:value":c[8]||=e=>m(`discord`,{reactions:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.freeResponseChannels`),hint:h(f)(`platform.freeResponseChannelsHint`)},{default:o(()=>[e(h(S),{value:h(a).discord.free_response_channels||``,size:`small`,placeholder:`channel_id1,channel_id2`,"onUpdate:value":c[9]||=e=>m(`discord`,{free_response_channels:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.allowedChannels`),hint:h(f)(`platform.allowedChannelsHint`)},{default:o(()=>[e(h(S),{value:h(a).discord.allowed_channels||``,size:`small`,placeholder:`channel_id1,channel_id2`,"onUpdate:value":c[10]||=e=>m(`discord`,{allowed_channels:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.ignoredChannels`),hint:h(f)(`platform.ignoredChannelsHint`)},{default:o(()=>[e(h(S),{value:h(a).discord.ignored_channels||``,size:`small`,placeholder:`channel_id1,channel_id2`,"onUpdate:value":c[11]||=e=>m(`discord`,{ignored_channels:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.noThreadChannels`),hint:h(f)(`platform.noThreadChannelsHint`)},{default:o(()=>[e(h(S),{value:h(a).discord.no_thread_channels||``,size:`small`,placeholder:`channel_id1,channel_id2`,"onUpdate:value":c[12]||=e=>m(`discord`,{no_thread_channels:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`slack`?(i(),n(v,{key:2},[e(M,{label:h(f)(`platform.botToken`),hint:h(f)(`platform.botTokenHint`)},{default:o(()=>[e(h(S),{value:C(`slack`).token||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`xoxb-...`,"onUpdate:value":c[13]||=e=>b(`slack`,{token:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.requireMention`),hint:h(f)(`platform.requireMentionChannel`)},{default:o(()=>[e(h(E),{value:h(a).slack.require_mention,"onUpdate:value":c[14]||=e=>m(`slack`,{require_mention:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.allowBots`),hint:h(f)(`platform.allowBotsHint`)},{default:o(()=>[e(h(E),{value:h(a).slack.allow_bots,"onUpdate:value":c[15]||=e=>m(`slack`,{allow_bots:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.freeResponseChannels`),hint:h(f)(`platform.freeResponseChannelsHint`)},{default:o(()=>[e(h(S),{value:h(a).slack.free_response_channels||``,size:`small`,placeholder:`channel_id1,channel_id2`,"onUpdate:value":c[16]||=e=>m(`slack`,{free_response_channels:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`whatsapp`?(i(),n(v,{key:3},[e(M,{label:h(f)(`platform.waEnabled`),hint:h(f)(`platform.waEnabledHint`)},{default:o(()=>[e(h(E),{value:C(`whatsapp`).enabled,"onUpdate:value":c[17]||=e=>b(`whatsapp`,{enabled:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.requireMention`),hint:h(f)(`platform.requireMentionGroup`)},{default:o(()=>[e(h(E),{value:h(a).whatsapp.require_mention,"onUpdate:value":c[18]||=e=>m(`whatsapp`,{require_mention:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.freeResponseChats`),hint:h(f)(`platform.freeResponseChatsHint`)},{default:o(()=>[e(h(S),{value:h(a).whatsapp.free_response_chats||``,size:`small`,placeholder:`chat_id1,chat_id2`,"onUpdate:value":c[19]||=e=>m(`whatsapp`,{free_response_chats:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.mentionPatterns`),hint:h(f)(`platform.mentionPatternsHint`)},{default:o(()=>[e(h(S),{value:(h(a).whatsapp.mention_patterns||[]).join(`, `),size:`small`,placeholder:`pattern1, pattern2`,"onUpdate:value":c[20]||=e=>m(`whatsapp`,{mention_patterns:e?e.split(`,`).map(e=>e.trim()):[]})},null,8,[`value`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`matrix`?(i(),n(v,{key:4},[e(M,{label:h(f)(`platform.accessToken`),hint:h(f)(`platform.accessTokenHint`)},{default:o(()=>[e(h(S),{value:C(`matrix`).token||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`syt_...`,"onUpdate:value":c[21]||=e=>b(`matrix`,{token:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.homeserver`),hint:h(f)(`platform.homeserverHint`)},{default:o(()=>[e(h(S),{value:C(`matrix`).extra?.homeserver||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`https://matrix.org`,"onUpdate:value":c[22]||=e=>b(`matrix`,{extra:{...C(`matrix`).extra,homeserver:e}})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.requireMention`),hint:h(f)(`platform.requireMentionRoom`)},{default:o(()=>[e(h(E),{value:h(a).matrix.require_mention,"onUpdate:value":c[23]||=e=>m(`matrix`,{require_mention:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.autoThread`),hint:h(f)(`platform.autoThreadHintRoom`)},{default:o(()=>[e(h(E),{value:h(a).matrix.auto_thread,"onUpdate:value":c[24]||=e=>m(`matrix`,{auto_thread:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.dmMentionThreads`),hint:h(f)(`platform.dmMentionThreadsHint`)},{default:o(()=>[e(h(E),{value:h(a).matrix.dm_mention_threads,"onUpdate:value":c[25]||=e=>m(`matrix`,{dm_mention_threads:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.freeResponseRooms`),hint:h(f)(`platform.freeResponseRoomsHint`)},{default:o(()=>[e(h(S),{value:h(a).matrix.free_response_rooms||``,size:`small`,placeholder:`room_id1,room_id2`,"onUpdate:value":c[26]||=e=>m(`matrix`,{free_response_rooms:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`feishu`?(i(),n(v,{key:5},[e(M,{label:h(f)(`platform.appId`),hint:h(f)(`platform.appIdHint`)},{default:o(()=>[e(h(S),{value:C(`feishu`).extra?.app_id||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`cli_...`,"onUpdate:value":c[27]||=e=>b(`feishu`,{extra:{...C(`feishu`).extra,app_id:e}})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.appSecret`),hint:h(f)(`platform.appSecretHint`)},{default:o(()=>[e(h(S),{value:C(`feishu`).extra?.app_secret||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`App Secret`,"onUpdate:value":c[28]||=e=>b(`feishu`,{extra:{...C(`feishu`).extra,app_secret:e}})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.requireMention`),hint:h(f)(`platform.requireMentionGroup`)},{default:o(()=>[e(h(E),{value:h(a).feishu.require_mention,"onUpdate:value":c[29]||=e=>m(`feishu`,{require_mention:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.freeResponseChats`),hint:h(f)(`platform.freeResponseChatsHint`)},{default:o(()=>[e(h(S),{value:h(a).feishu.free_response_chats||``,size:`small`,placeholder:`chat_id1,chat_id2`,"onUpdate:value":c[30]||=e=>m(`feishu`,{free_response_chats:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`dingtalk`?(i(),n(v,{key:6},[e(M,{label:h(f)(`platform.clientId`),hint:h(f)(`platform.clientIdHint`)},{default:o(()=>[e(h(S),{value:C(`dingtalk`).extra?.client_id||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`Client ID`,"onUpdate:value":c[31]||=e=>b(`dingtalk`,{extra:{...C(`dingtalk`).extra,client_id:e}})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.clientSecret`),hint:h(f)(`platform.clientSecretHint`)},{default:o(()=>[e(h(S),{value:C(`dingtalk`).extra?.client_secret||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`Client Secret`,"onUpdate:value":c[32]||=e=>b(`dingtalk`,{extra:{...C(`dingtalk`).extra,client_secret:e}})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.requireMention`),hint:h(f)(`platform.requireMentionGroup`)},{default:o(()=>[e(h(E),{value:h(a).dingtalk.require_mention,"onUpdate:value":c[33]||=e=>m(`dingtalk`,{require_mention:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.freeResponseChats`),hint:h(f)(`platform.freeResponseChatsHint`)},{default:o(()=>[e(h(S),{value:h(a).dingtalk.free_response_chats||``,size:`small`,placeholder:`chat_id1,chat_id2`,"onUpdate:value":c[34]||=e=>m(`dingtalk`,{free_response_chats:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`weixin`?(i(),n(v,{key:7},[_(`div`,z,[F.value===`idle`||F.value===`error`||F.value===`expired`||F.value===`confirmed`?(i(),s(h(x),{key:0,type:`primary`,size:`small`,onClick:H},{default:o(()=>[p(d(F.value===`confirmed`?h(f)(`platform.qrRelogin`):h(f)(`platform.qrLogin`)),1)]),_:1})):r(``,!0),F.value===`loading`?(i(),n(`div`,B,[e(h(T),{size:`small`}),_(`span`,null,d(h(f)(`platform.qrFetching`)),1)])):r(``,!0),F.value===`waiting`||F.value===`scaned`?(i(),n(`div`,V,d(F.value===`scaned`?h(f)(`platform.qrScanedHint`):h(f)(`platform.qrScanHint`)),1)):r(``,!0)]),e(M,{label:h(f)(`platform.weixinToken`),hint:h(f)(`platform.weixinTokenHint`)},{default:o(()=>[e(h(S),{value:C(`weixin`).token||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`Token`,"onUpdate:value":c[35]||=e=>b(`weixin`,{token:e})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.accountId`),hint:h(f)(`platform.accountIdHint`)},{default:o(()=>[e(h(S),{value:C(`weixin`).extra?.account_id||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`Account ID`,"onUpdate:value":c[36]||=e=>b(`weixin`,{extra:{...C(`weixin`).extra,account_id:e}})},null,8,[`value`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0),t.key===`wecom`?(i(),n(v,{key:8},[e(M,{label:h(f)(`platform.botId`),hint:h(f)(`platform.botIdHint`)},{default:o(()=>[e(h(S),{value:C(`wecom`).extra?.bot_id||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`Bot ID`,"onUpdate:value":c[37]||=e=>b(`wecom`,{extra:{...C(`wecom`).extra,bot_id:e}})},null,8,[`value`])]),_:1},8,[`label`,`hint`]),e(M,{label:h(f)(`platform.appSecret`),hint:h(f)(`platform.wecomSecretHint`)},{default:o(()=>[e(h(S),{value:C(`wecom`).extra?.secret||``,clearable:``,size:`small`,style:{width:`300px`},placeholder:`Secret`,"onUpdate:value":c[38]||=e=>b(`wecom`,{extra:{...C(`wecom`).extra,secret:e}})},null,8,[`value`])]),_:1},8,[`label`,`hint`])],64)):r(``,!0)]),_:2},1032,[`name`,`icon`,`config`,`credentials`])),64))]))}}),[[`__scopeId`,`data-v-afd5f277`]]),U={class:`channels-view`},W={class:`page-header`},G={class:`header-title`},K={class:`channels-content`},q=b(f({__name:`ChannelsView`,setup(t){let r=k(),{t:a}=y();return c(()=>{r.fetchSettings()}),(t,s)=>(i(),n(`div`,U,[_(`header`,W,[_(`h2`,G,d(h(a)(`sidebar.channels`)),1)]),_(`div`,K,[e(h(T),{show:h(r).loading},{default:o(()=>[e(H)]),_:1},8,[`show`])])]))}}),[[`__scopeId`,`data-v-11275a38`]]);export{q as default};
|