support custom icons
This commit is contained in:
1 parent
1c0ac119f4
commit
b81d9449c9
8 files changed
+16
-6
No files matched your search
@@ -32,6 +32,9 @@ if (!app.requestSingleInstanceLock()) {
|
|||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.commandLine.appendArgument("–-allow-file-access-from-files");
|
||||||
|
app.commandLine.appendArgument("--disable-web-security");
|
||||||
|
|
||||||
// Remove electron security warnings
|
// Remove electron security warnings
|
||||||
// This warning only shows in development mode
|
// This warning only shows in development mode
|
||||||
// Read more on https://www.electronjs.org/docs/latest/tutorial/security
|
// Read more on https://www.electronjs.org/docs/latest/tutorial/security
|
||||||
@@ -73,6 +76,7 @@ async function createWindow(projectPath?: string) {
|
|||||||
// Read more on https://www.electronjs.org/docs/latest/tutorial/context-isolation
|
// Read more on https://www.electronjs.org/docs/latest/tutorial/context-isolation
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
|
webSecurity: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
"node.deleteRootNodeDenied": "Unable to delete the root node",
|
"node.deleteRootNodeDenied": "Unable to delete the root node",
|
||||||
"node.editSubtreeDenied": "Unable to edit the subtree node",
|
"node.editSubtreeDenied": "Unable to edit the subtree node",
|
||||||
"node.desc": "Node desc",
|
"node.desc": "Node desc",
|
||||||
"node.fileRequired": "{{field}} field is required",
|
"node.fileRequired": "field '{{field}}' is required",
|
||||||
"node.id": "Node id",
|
"node.id": "Node id",
|
||||||
"node.inputVariable": "Input variables",
|
"node.inputVariable": "Input variables",
|
||||||
"node.name": "Node name",
|
"node.name": "Node name",
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
"node.deleteRootNodeDenied": "不能删除根节点",
|
"node.deleteRootNodeDenied": "不能删除根节点",
|
||||||
"node.editSubtreeDenied": "不能编辑子树节点",
|
"node.editSubtreeDenied": "不能编辑子树节点",
|
||||||
"node.desc": "节点说明",
|
"node.desc": "节点说明",
|
||||||
"node.fileRequired": "字段<b>{{field}}</b>必填",
|
"node.fileRequired": "字段“{{field}}”必填",
|
||||||
"node.id": "节点标识",
|
"node.id": "节点标识",
|
||||||
"node.inputVariable": "输入变量",
|
"node.inputVariable": "输入变量",
|
||||||
"node.name": "节点名称",
|
"node.name": "节点名称",
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" height="200px" width="200px"
|
||||||
|
xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path
|
||||||
|
d="M6.01 2c-1.93 0-3.5 1.57-3.5 3.5 0 1.58 1.06 2.903 2.5 3.337v7.16c-.001.179.027 1.781 1.174 2.931C6.892 19.64 7.84 20 9 20v2l4-3-4-3v2c-1.823 0-1.984-1.534-1.99-2V8.837c1.44-.434 2.5-1.757 2.5-3.337 0-1.93-1.571-3.5-3.5-3.5zm0 5c-.827 0-1.5-.673-1.5-1.5S5.183 4 6.01 4s1.5.673 1.5 1.5S6.837 7 6.01 7zm13 8.163V7.997C19.005 6.391 17.933 4 15 4V2l-4 3 4 3V6c1.829 0 2.001 1.539 2.01 2v7.163c-1.44.434-2.5 1.757-2.5 3.337 0 1.93 1.57 3.5 3.5 3.5s3.5-1.57 3.5-3.5c0-1.58-1.06-2.903-2.5-3.337zm-1 4.837c-.827 0-1.5-.673-1.5-1.5s.673-1.5 1.5-1.5 1.5.673 1.5 1.5-.673 1.5-1.5 1.5z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 768 B |
@@ -22,6 +22,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Cmp",
|
"name": "Cmp",
|
||||||
"type": "Condition",
|
"type": "Condition",
|
||||||
|
"icon": "icons/cmp.svg",
|
||||||
"doc": "+ 若值为空,返回失败\n+ 非整数类型可能会报错\n",
|
"doc": "+ 若值为空,返回失败\n+ 非整数类型可能会报错\n",
|
||||||
"input": [
|
"input": [
|
||||||
"值(int)"
|
"值(int)"
|
||||||
|
|||||||
@@ -68,13 +68,13 @@ export const Inspector: FC = () => {
|
|||||||
if (node) {
|
if (node) {
|
||||||
node.input?.forEach((v, i) => {
|
node.input?.forEach((v, i) => {
|
||||||
const desc = node.def.input?.[i] ?? "<unknown>";
|
const desc = node.def.input?.[i] ?? "<unknown>";
|
||||||
if (v && !options.find((option) => option.value !== v)) {
|
if (v && !options.find((option) => option.value === v)) {
|
||||||
options.push({ label: `${v}(${desc})`, value: v });
|
options.push({ label: `${v}(${desc})`, value: v });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
node.output?.forEach((v, i) => {
|
node.output?.forEach((v, i) => {
|
||||||
const desc = node.def.output?.[i] ?? "<unknown>";
|
const desc = node.def.output?.[i] ?? "<unknown>";
|
||||||
if (v && !options.find((option) => option.value !== v)) {
|
if (v && !options.find((option) => option.value === v)) {
|
||||||
options.push({ label: `${v}(${desc})`, value: v });
|
options.push({ label: `${v}(${desc})`, value: v });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ G6.registerNode(
|
|||||||
});
|
});
|
||||||
|
|
||||||
// icon
|
// icon
|
||||||
const img = `./icons/${classify}.svg`;
|
const img = nodeDef.icon ? workspace.workdir + "/" + nodeDef.icon : `./icons/${classify}.svg`;
|
||||||
addShape("image", {
|
addShape("image", {
|
||||||
attrs: {
|
attrs: {
|
||||||
x: 5,
|
x: 5,
|
||||||
|
|||||||
@@ -381,7 +381,6 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
|
|||||||
const workspace = get();
|
const workspace = get();
|
||||||
let hasEvent = false;
|
let hasEvent = false;
|
||||||
fs.watch(workspace.workdir, { recursive: true }, (event, filename) => {
|
fs.watch(workspace.workdir, { recursive: true }, (event, filename) => {
|
||||||
console.log("fileanme", event, filename);
|
|
||||||
if (event === "rename") {
|
if (event === "rename") {
|
||||||
if (!hasEvent) {
|
if (!hasEvent) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
Reference in new issue
Block a user