1 Commits

Author SHA1 Message Date
fofolee
6f1c98fb4a 添加pin的雏形 2025-04-25 07:45:55 +08:00
16 changed files with 291 additions and 63 deletions

View File

@@ -1,4 +0,0 @@
#!/bin/sh
git pull
cd plugin && npm i && cd .. && npm i
quasar build

4
dev.sh
View File

@@ -1,4 +0,0 @@
#!/bin/sh
git pull
cd plugin && npm i && cd .. && npm i
quasar dev

51
package-lock.json generated
View File

@@ -80,7 +80,6 @@
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz",
"integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==",
"dev": true,
"peer": true,
"dependencies": {
"@ampproject/remapping": "^2.1.0",
"@babel/code-frame": "^7.16.7",
@@ -2810,7 +2809,6 @@
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
"integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
"license": "MIT",
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -2844,7 +2842,6 @@
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@@ -3411,7 +3408,6 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"caniuse-lite": "^1.0.30001688",
"electron-to-chromium": "^1.5.73",
@@ -4862,7 +4858,6 @@
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz",
"integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==",
"dev": true,
"peer": true,
"dependencies": {
"@eslint/eslintrc": "^1.2.1",
"@humanwhocodes/config-array": "^0.9.2",
@@ -6677,11 +6672,10 @@
"license": "MIT"
},
"node_modules/js-yaml": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
"license": "MIT",
"dependencies": {
"argparse": "^2.0.1"
},
@@ -7204,8 +7198,7 @@
"node_modules/monaco-editor": {
"version": "0.33.0",
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.33.0.tgz",
"integrity": "sha512-VcRWPSLIUEgQJQIE0pVT8FcGBIgFoxz7jtqctE+IiCxWugD0DwgyQBcZBhdSrdMC84eumoqMZsGl2GTreOzwqw==",
"peer": true
"integrity": "sha512-VcRWPSLIUEgQJQIE0pVT8FcGBIgFoxz7jtqctE+IiCxWugD0DwgyQBcZBhdSrdMC84eumoqMZsGl2GTreOzwqw=="
},
"node_modules/monaco-editor-webpack-plugin": {
"version": "7.0.1",
@@ -7941,7 +7934,6 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"nanoid": "^3.3.7",
"picocolors": "^1.1.1",
@@ -8648,7 +8640,6 @@
"resolved": "https://registry.npmjs.org/quasar/-/quasar-2.17.5.tgz",
"integrity": "sha512-gMpJm4T7dXo7NleeRhkU+phytw5cgjpiB90/Jpmi39p/ll64Xh7NpQNtvAhAvQAtqct0Z+DV0paKrfuGwZ0Ksw==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">= 10.18.1",
"npm": ">= 6.13.4",
@@ -9092,7 +9083,6 @@
"integrity": "sha512-/8cYZeL39evUqe0o//193na51Q1VWZ61qhxioQvLJwOtWIrX+PgNhCyD8RSuTtmzc4+6+waFZf899bfp/MCUwA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@bufbuild/protobuf": "^2.0.0",
"buffer-builder": "^0.2.0",
@@ -9545,7 +9535,6 @@
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@@ -10559,7 +10548,6 @@
"integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==",
"dev": true,
"license": "Apache-2.0",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -10780,7 +10768,6 @@
"version": "3.2.31",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.2.31.tgz",
"integrity": "sha512-odT3W2tcffTiQCy57nOT93INw1auq5lYLLYtWpPYQQYQOOdHiqFct9Xhna6GJ+pJQaF67yZABraH47oywkJgFw==",
"peer": true,
"dependencies": {
"@vue/compiler-dom": "3.2.31",
"@vue/compiler-sfc": "3.2.31",
@@ -10884,7 +10871,6 @@
"version": "4.0.14",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.14.tgz",
"integrity": "sha512-wAO6zF9zxA3u+7AkMPqw9LjoUCjSxfFvINQj3E/DceTt6uEz1XZLraDhdg2EYmvVwTBSGlLYsUw8bDmx0754Mw==",
"peer": true,
"dependencies": {
"@vue/devtools-api": "^6.0.0"
},
@@ -10988,7 +10974,6 @@
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz",
"integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==",
"license": "MIT",
"peer": true,
"dependencies": {
"@types/eslint-scope": "^3.7.7",
"@types/estree": "^1.0.6",
@@ -11439,7 +11424,6 @@
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz",
"integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==",
"dev": true,
"peer": true,
"requires": {
"@ampproject/remapping": "^2.1.0",
"@babel/code-frame": "^7.16.7",
@@ -13358,8 +13342,7 @@
"acorn": {
"version": "8.14.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
"integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
"peer": true
"integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA=="
},
"acorn-jsx": {
"version": "5.3.2",
@@ -13381,7 +13364,6 @@
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"peer": true,
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@@ -13783,7 +13765,6 @@
"version": "4.24.3",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.3.tgz",
"integrity": "sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA==",
"peer": true,
"requires": {
"caniuse-lite": "^1.0.30001688",
"electron-to-chromium": "^1.5.73",
@@ -14754,7 +14735,6 @@
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz",
"integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==",
"dev": true,
"peer": true,
"requires": {
"@eslint/eslintrc": "^1.2.1",
"@humanwhocodes/config-array": "^0.9.2",
@@ -15995,9 +15975,9 @@
"dev": true
},
"js-yaml": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
"requires": {
"argparse": "^2.0.1"
@@ -16388,8 +16368,7 @@
"monaco-editor": {
"version": "0.33.0",
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.33.0.tgz",
"integrity": "sha512-VcRWPSLIUEgQJQIE0pVT8FcGBIgFoxz7jtqctE+IiCxWugD0DwgyQBcZBhdSrdMC84eumoqMZsGl2GTreOzwqw==",
"peer": true
"integrity": "sha512-VcRWPSLIUEgQJQIE0pVT8FcGBIgFoxz7jtqctE+IiCxWugD0DwgyQBcZBhdSrdMC84eumoqMZsGl2GTreOzwqw=="
},
"monaco-editor-webpack-plugin": {
"version": "7.0.1",
@@ -16875,7 +16854,6 @@
"version": "8.4.49",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz",
"integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==",
"peer": true,
"requires": {
"nanoid": "^3.3.7",
"picocolors": "^1.1.1",
@@ -17305,8 +17283,7 @@
"quasar": {
"version": "2.17.5",
"resolved": "https://registry.npmjs.org/quasar/-/quasar-2.17.5.tgz",
"integrity": "sha512-gMpJm4T7dXo7NleeRhkU+phytw5cgjpiB90/Jpmi39p/ll64Xh7NpQNtvAhAvQAtqct0Z+DV0paKrfuGwZ0Ksw==",
"peer": true
"integrity": "sha512-gMpJm4T7dXo7NleeRhkU+phytw5cgjpiB90/Jpmi39p/ll64Xh7NpQNtvAhAvQAtqct0Z+DV0paKrfuGwZ0Ksw=="
},
"queue-microtask": {
"version": "1.2.3",
@@ -17606,7 +17583,6 @@
"resolved": "https://registry.npmjs.org/sass-embedded/-/sass-embedded-1.83.0.tgz",
"integrity": "sha512-/8cYZeL39evUqe0o//193na51Q1VWZ61qhxioQvLJwOtWIrX+PgNhCyD8RSuTtmzc4+6+waFZf899bfp/MCUwA==",
"dev": true,
"peer": true,
"requires": {
"@bufbuild/protobuf": "^2.0.0",
"buffer-builder": "^0.2.0",
@@ -17810,7 +17786,6 @@
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"peer": true,
"requires": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@@ -18527,8 +18502,7 @@
"version": "4.9.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz",
"integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==",
"dev": true,
"peer": true
"dev": true
},
"unicode-canonical-property-names-ecmascript": {
"version": "2.0.1",
@@ -18663,7 +18637,6 @@
"version": "3.2.31",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.2.31.tgz",
"integrity": "sha512-odT3W2tcffTiQCy57nOT93INw1auq5lYLLYtWpPYQQYQOOdHiqFct9Xhna6GJ+pJQaF67yZABraH47oywkJgFw==",
"peer": true,
"requires": {
"@vue/compiler-dom": "3.2.31",
"@vue/compiler-sfc": "3.2.31",
@@ -18732,7 +18705,6 @@
"version": "4.0.14",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.14.tgz",
"integrity": "sha512-wAO6zF9zxA3u+7AkMPqw9LjoUCjSxfFvINQj3E/DceTt6uEz1XZLraDhdg2EYmvVwTBSGlLYsUw8bDmx0754Mw==",
"peer": true,
"requires": {
"@vue/devtools-api": "^6.0.0"
}
@@ -18814,7 +18786,6 @@
"version": "5.97.1",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz",
"integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==",
"peer": true,
"requires": {
"@types/eslint-scope": "^3.7.7",
"@types/estree": "^1.0.6",

View File

@@ -520,10 +520,6 @@ document.addEventListener("DOMContentLoaded", () => {
if (dialogType === "textarea" && !e.ctrlKey) {
return;
}
// select 类型有自己的键盘处理器,不需要全局处理器处理 Enter 键
if (dialogType === "select") {
return;
}
document.getElementById("ok-btn").click();
}
});

View File

@@ -0,0 +1,30 @@
const { ipcRenderer } = require("electron");
// 等待 DOM 加载完成
document.addEventListener("DOMContentLoaded", () => {
let parentId = null;
let windowId = null;
let commandCode = null;
// 监听父窗口发来的配置
ipcRenderer.on("window-config", (event, config) => {
parentId = event.senderId;
windowId = config.windowId;
commandCode = config.commandCode;
// 设置主题
document.documentElement.setAttribute(
"data-theme",
config.isDark ? "dark" : "light"
);
// 设置图标
document.getElementById("command-icon").src = config.icon;
});
// 点击图标执行命令
document.querySelector(".pin-container").addEventListener("click", () => {
console.log("click", parentId, `pin-execute-${windowId}`);
ipcRenderer.sendTo(parentId, `pin-execute-${windowId}`, commandCode);
});
});

108
plugin/lib/pin/service.js Normal file
View File

@@ -0,0 +1,108 @@
const { ipcRenderer } = require("electron");
const { createBrowserWindow } = utools;
const pinPath = "lib/pin/view.html";
const preloadPath = "lib/pin/controller.js";
// 存储所有pin窗口的信息
const pinWindows = new Map();
/**
* 创建pin窗口
* @param {object} commandInfo - 命令信息
* @param {object} position - 窗口位置 {x, y}
* @returns {Promise} 返回窗口对象
*/
const createPinWindow = (commandInfo, position = null) => {
return new Promise((resolve) => {
const windowOptions = {
width: 52,
height: 52,
transparent: true,
frame: false,
resizable: false,
skipTaskbar: true,
alwaysOnTop: true,
focusable: false,
movable: true,
webPreferences: {
preload: preloadPath,
devTools: utools.isDev(),
},
};
// 如果指定了位置,添加到选项中
if (position) {
windowOptions.x = position.x;
windowOptions.y = position.y;
}
// 创建窗口
const UBrowser = createBrowserWindow(pinPath, windowOptions, () => {
const windowId = UBrowser.webContents.id;
UBrowser.webContents.openDevTools({
mode: "undocked",
});
// 监听命令执行请求
ipcRenderer.once(`pin-execute-${windowId}`, (event, code) => {
// 执行命令
console.log("execute command", event, code, commandInfo);
});
// 保存窗口信息
pinWindows.set(commandInfo.features.code, {
window: UBrowser,
windowId,
position: UBrowser.getPosition(),
});
// 发送配置到子窗口
ipcRenderer.sendTo(windowId, "window-config", {
isDark: utools.isDarkColors(),
icon: commandInfo.features.icon,
commandCode: commandInfo.features.code,
windowId,
});
resolve(UBrowser);
});
});
};
/**
* 移除pin窗口
* @param {string} commandCode - 命令代码
*/
const removePinWindow = (commandCode) => {
const pinInfo = pinWindows.get(commandCode);
if (pinInfo) {
pinInfo.window.destroy();
pinWindows.delete(commandCode);
}
};
/**
* 获取所有pin窗口信息
* @returns {Map} pin窗口信息Map
*/
const getPinWindows = () => {
return pinWindows;
};
/**
* 恢复所有pin窗口
* @param {Array} pinnedCommands - pin命令列表
*/
const restorePinWindows = async (pinnedCommands) => {
for (const command of pinnedCommands) {
await createPinWindow(command.info, command.position);
}
};
module.exports = {
createPinWindow,
removePinWindow,
getPinWindows,
restorePinWindows,
};

40
plugin/lib/pin/style.css Normal file
View File

@@ -0,0 +1,40 @@
body {
margin: 0;
padding: 0;
background: transparent;
overflow: hidden;
user-select: none;
}
.pin-container {
width: 52px;
height: 52px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: transform 0.3s ease;
}
.pin-container:hover {
transform: scale(1.1);
}
.pin-icon {
width: 45px;
height: 45px;
overflow: hidden;
}
.pin-icon img {
width: 100%;
height: 100%;
object-fit: contain;
}
body[data-theme="dark"] .pin-icon {
background: rgba(57, 57, 57, 0.09);
border: 1px solid rgb(59 58 58 / 5%);
box-shadow: 0 1px 5px rgb(0 0 0 / 20%), 0 2px 2px rgb(0 0 0 / 14%),
0 3px 1px -2px rgb(69 67 67 / 12%);
}

15
plugin/lib/pin/view.html Normal file
View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Pin</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="pin-container">
<div class="pin-icon">
<img id="command-icon" src="" alt="command icon" />
</div>
</div>
</body>
</html>

View File

@@ -20,6 +20,7 @@ const md5 = (input) => {
window.lodashM = require("./lib/lodashMini");
window.pinyinMatch = require("pinyin-match");
window.pinService = require("./lib/pin/service");
window.DOMPurify = DOMPurify;
const createTerminalCommand = require("./lib/createTerminalCommand");

View File

@@ -122,6 +122,10 @@ export default defineComponent({
window.quickcommandHttpServer().run(this.nativeProfile.serverPort);
console.log("Server Start...");
}
// 恢复固定到桌面的命令
if (this.nativeProfile.pinnedCommands) {
window.pinService.restorePinWindows(this.nativeProfile.pinnedCommands);
}
},
enterPlugin(enter) {
this.updateExp();

View File

@@ -257,8 +257,12 @@ export default defineComponent({
defaultConfig.apiUrl = "";
}
this.aiConfigs.unshift(defaultConfig);
this.aiConfigs.push(defaultConfig);
// 滚动到底部
this.$nextTick(() => {
this.$refs.scrollArea.setScrollPosition("vertical", 99999);
});
},
getConfigListHeight() {
const counts = Math.min(this.aiConfigs.length, 3);

View File

@@ -4,6 +4,20 @@
v-ripple
:class="{ [`text-${disabledColor}`]: !isActivated, command: 1 }"
>
<q-badge floating transparent style="z-index: 1000" v-if="isActivated">
<q-btn
flat
round
dense
:color="isPinned ? 'amber' : 'grey'"
icon="push_pin"
@click.stop="togglePin"
size="12px"
>
<q-tooltip>{{ isPinned ? "取消固定到桌面" : "固定到桌面" }}</q-tooltip>
</q-btn>
</q-badge>
<component
:is="currentLayout"
:commandInfo="commandInfo"
@@ -56,6 +70,33 @@ export default {
"--icon-url": `url(${this.commandInfo.features.icon})`,
};
},
isPinned() {
return (
this.$root.nativeProfile.pinnedCommands?.some(
(cmd) => cmd.info.features.code === this.commandInfo.features.code
) || false
);
},
},
methods: {
async togglePin() {
if (this.isPinned) {
window.pinService.removePinWindow(this.commandInfo.features.code);
this.$root.nativeProfile.pinnedCommands =
this.$root.nativeProfile.pinnedCommands.filter(
(cmd) => cmd.info.features.code !== this.commandInfo.features.code
);
} else {
await window.pinService.createPinWindow(this.commandInfo);
if (!this.$root.nativeProfile.pinnedCommands) {
this.$root.nativeProfile.pinnedCommands = [];
}
this.$root.nativeProfile.pinnedCommands.push({
info: this.commandInfo,
position: utools.getCursorScreenPoint(),
});
}
},
},
};
</script>
@@ -80,4 +121,28 @@ export default {
box-shadow: 0 1px 5px rgb(0 0 0 / 20%), 0 2px 2px rgb(0 0 0 / 14%),
0 3px 1px -2px rgb(69 67 67 / 12%);
}
.pin-icon {
opacity: 0;
transform: translateY(-5px);
visibility: hidden;
transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
will-change: transform, opacity, visibility;
}
.q-card:hover .pin-icon {
opacity: 1;
transform: translateY(0);
visibility: visible;
backdrop-filter: blur(1px);
}
.pin-icon .q-btn {
transition: transform 0.35s cubic-bezier(0.68, -0.6, 0.32, 1.6);
will-change: transform;
}
.pin-icon .q-btn:hover {
transform: scale(1.15);
}
</style>

View File

@@ -46,7 +46,7 @@ export const controlCommands = {
{
label: "结束",
value: "end",
codeTemplate: "};",
codeTemplate: "}",
},
],
},
@@ -112,7 +112,7 @@ export const controlCommands = {
{
label: "结束",
value: "end",
codeTemplate: "};",
codeTemplate: "}",
},
],
},
@@ -169,7 +169,7 @@ export const controlCommands = {
{
label: "结束",
value: "end",
codeTemplate: "};",
codeTemplate: "}",
},
],
},
@@ -225,7 +225,7 @@ export const controlCommands = {
{
label: "结束",
value: "end",
codeTemplate: "};",
codeTemplate: "}",
},
],
},
@@ -266,7 +266,7 @@ export const controlCommands = {
{
label: "结束",
value: "end",
codeTemplate: "};",
codeTemplate: "}",
},
],
},
@@ -320,7 +320,7 @@ export const controlCommands = {
{
label: "结束",
value: "end",
codeTemplate: "};",
codeTemplate: "}",
},
],
},
@@ -360,7 +360,7 @@ export const controlCommands = {
{
label: "结束",
value: "end",
codeTemplate: "};",
codeTemplate: "}",
},
],
},

View File

@@ -124,7 +124,7 @@ export function generateCode(flow) {
if (cmd.asyncMode === "await") {
cmdCode = `await ${cmdCode}`;
}
code.push(indent + cmdCode + (cmd.isControlFlow ? "" : comma));
code.push(indent + cmdCode + comma);
}
});

View File

@@ -70,6 +70,8 @@ export function generateUBrowserCode(argvs) {
// 添加其他操作
if (argvs.operations?.length) {
argvs.operations.forEach(({ value, args }) => {
if (!args?.length) return;
const stringifiedArgs = args
.map((arg) => stringifyArgv(arg))
.filter(Boolean);

View File

@@ -491,13 +491,13 @@ export const ubrowserOperationConfigs = {
],
},
setValue: {
value: "value",
value: "setValue",
label: "设置值",
icon: "check_box",
config: [
{
label: "元素选择器",
icon: "find_in_page",
icon: "varInput",
component: "VariableInput",
width: 6,
},