-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy path_lib.action.js
233 lines (231 loc) · 6.84 KB
/
_lib.action.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
const action_data = [
{
vod_id: JSON.stringify({
actionId: '连续对话',
id: 'talk',
type: 'input',
title: '连续对话',
tip: '请输入消息',
value: '',
msg: '开始新的对话',
button: 3,
imageUrl: 'https://img2.baidu.com/it/u=1206278833,3265480730&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=800',
imageHeight: 200,
imageType: 'card_pic_3',
keep: true,
width: 680,
height: 800,
msgType: 'long_text',
httpTimeout: 60,
canceledOnTouchOutside: false,
selectData: '新的对话:=清空AI对话记录'
}),
vod_name: '连续对话',
vod_pic: 'https://img2.baidu.com/it/u=1206278833,3265480730&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=800',
vod_tag: 'action'
},
{
vod_id: '夸克扫码',
vod_name: '夸克扫码',
vod_pic: 'https://pic.qisuidc.cn/s/2024/10/23/6718c212f1fdd.webp',
vod_remarks: '夸克',
vod_tag: 'action'
},
{
vod_id: '基础Action指令',
vod_name: '基础Action',
vod_tag: 'action'
},
{
vod_id: 'set-cookie',
vod_name: '设置Cookie',
vod_pic: 'https://pic.qisuidc.cn/s/2024/10/23/6718c212f1fdd.webp',
vod_remarks: '夸克',
vod_tag: 'action'
},
{
vod_id: JSON.stringify({
actionId: '单项输入',
id: 'alitoken',
type: 'input',
title: '阿里云盘Token',
tip: '请输入阿里云盘32位的Token',
value: '',
msg: '单项输入带图, 例如显示验证码图片',
imageUrl: 'https://pic.imgdb.cn/item/667ce9f4d9c307b7e9f9d052.webp',
imageHeight: 200,
imageType: 'card_pic_3',
}),
vod_name: '单项输入带图',
vod_tag: 'action'
},
{
vod_id: JSON.stringify({
actionId: '扫码初始动作',
id: 'alitoken',
type: 'input',
title: '阿里云盘Token',
msg: '弹出窗口就执行initAction里的动作,回调时就关闭窗口,应用于扫码场景,为了演示,动作注释了',
button: 0,
timeout: 20,
qrcode: 'https://www.alipan.com/',
//initAction: 'initAction'
}),
vod_name: '扫码初始动作',
vod_tag: 'action'
},
{
vod_id: JSON.stringify({
actionId: '单项快速输入',
id: 'alitoken',
type: 'input',
width: 680,
title: '阿里云盘Token',
tip: '请输入阿里云盘32位的Token',
value: '',
msg: '中国第五座南极科考站秦岭站正式建成。',
selectData: '1:=aaa输入默认值,2:=bb输入默认值bbbbb,3:=c输入默认值ddd,4:=输入默认值,5:=111,6:=22222,7:=HOHO,HELLO,world'
}),
vod_name: '单项快速输入',
vod_tag: 'action'
},
{
vod_id: JSON.stringify({
actionId: '多项输入',
type: 'multiInput',
title: 'Action多项输入',
width: 640,
msg: '通过action配置的多项输入',
input: [
{
id: 'item1',
name: '项目1',
tip: '请输入项目1内容',
value: ''
},
{
id: 'item2',
name: '项目2',
tip: '请输入项目2内容',
value: ''
},
{
id: 'item3',
name: '项目3',
tip: '请输入项目3内容',
value: ''
}
]
}),
vod_name: '多项输入',
vod_tag: 'action'
},
{
vod_id: JSON.stringify({
actionId: '单选菜单',
type: 'menu',
title: 'Action菜单',
width: 300,
column: 2,
option: [
{
name: '菜单1',
action: 'menu1'
},
{
name: '菜单2',
action: 'menu2'
},
'菜单3$menu3',
'菜单4$menu4',
'菜单5$menu5',
'菜单6$menu6',
'菜单7$menu7',
'菜单8$menu8',
'菜单9$menu9',
'菜单10$menu10',
],
selectedIndex: 3
}),
vod_name: '单选菜单',
vod_tag: 'action'
},
{
vod_id: JSON.stringify({
actionId: '多选菜单',
type: 'select',
title: 'Action多选菜单',
width: 480,
column: 2,
option: [
{
name: '选项1',
action: 'menu1',
selected: true
},
{
name: '选项2',
action: 'menu2'
},
{
name: '选项3',
action: 'menu3',
selected: true
},
{
name: '选项4',
action: 'menu4'
},
{
name: '选项5',
action: 'menu5'
},
{
name: '选项6',
action: 'menu6'
},
{
name: '选项7',
action: 'menu7'
},
{
name: '选项8',
action: 'menu8'
},
{
name: '选项9',
action: 'menu9',
selected: true
},
{
name: '选项10',
action: 'menu10',
selected: true
},
{
name: '选项11',
action: 'menu11',
selected: true
},
{
name: '选项12',
action: 'menu12',
selected: true
}
]
}),
vod_name: '多选菜单',
vod_tag: 'action'
},
];
function generateUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = (Math.random() * 16) | 0,
v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
$.exports = {
action_data,
generateUUID
}