mirror of
https://github.com/facefusion/facefusion-pinokio.git
synced 2026-07-23 06:20:48 +02:00
Early version for 3.0.0 part3
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = kernel =>
|
||||
module.exports = async kernel =>
|
||||
{
|
||||
if (!kernel.exists(__dirname, 'facefusion'))
|
||||
if (!await kernel.exists(__dirname, 'facefusion', '.git'))
|
||||
{
|
||||
const menu =
|
||||
[
|
||||
@@ -21,116 +21,81 @@ module.exports = kernel =>
|
||||
return menu;
|
||||
}
|
||||
|
||||
[
|
||||
[ 'fa-solid fa-plug', 'Installing', 'install.js' ],
|
||||
[ 'fa-solid fa-rotate', 'Updating', 'update.js' ],
|
||||
[ 'fa-regular fa-circle-xmark', 'Resetting', 'reset.js' ]
|
||||
]
|
||||
.forEach(([ icon, text, href ]) =>
|
||||
{
|
||||
if (kernel.running(__dirname, href))
|
||||
{
|
||||
const menu =
|
||||
[
|
||||
{
|
||||
icon,
|
||||
text,
|
||||
href,
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
return menu;
|
||||
}
|
||||
});
|
||||
|
||||
const menu = [];
|
||||
|
||||
if (kernel.running(__dirname, 'run.js'))
|
||||
if (await kernel.running(__dirname, 'run.js'))
|
||||
{
|
||||
const start_path = path.resolve(__dirname, 'run.js');
|
||||
const memory = kernel.memory.local[start_path];
|
||||
const memory = await kernel.memory.local[path.resolve(__dirname, 'run.js')];
|
||||
|
||||
if (memory && memory.url && memory.mode)
|
||||
{
|
||||
menu.concat(
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-rocket',
|
||||
text: 'Open Session',
|
||||
href: memory.url
|
||||
},
|
||||
{
|
||||
icon: 'fa-solid fa-desktop',
|
||||
text: 'Running (' + memory.mode + ')',
|
||||
href: 'run.js',
|
||||
params:
|
||||
{
|
||||
fullscreen: true
|
||||
}
|
||||
}
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
menu.push(
|
||||
{
|
||||
icon: 'fa-solid fa-desktop',
|
||||
text: 'Run',
|
||||
href: 'run.js',
|
||||
icon: 'fa-solid fa-rocket',
|
||||
text: 'UI (' + memory.mode + ')',
|
||||
href: memory.url,
|
||||
params:
|
||||
{
|
||||
fullscreen: true
|
||||
run: true,
|
||||
fullscreen: true,
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[
|
||||
[ 'fa-solid fa-power-off', 'Run Default', 'Default' ],
|
||||
[ 'fa-solid fa-gauge', 'Run Benchmark', 'Benchmark' ],
|
||||
[ 'fa-solid fa-robot', 'Run Jobs', 'Jobs' ],
|
||||
[ 'fa-solid fa-camera', 'Run Webcam', 'Webcam' ]
|
||||
]
|
||||
.forEach(([ icon, text, mode ]) =>
|
||||
{
|
||||
menu.push(
|
||||
{
|
||||
icon,
|
||||
text,
|
||||
icon: 'fa-solid fa-desktop',
|
||||
text: 'CLI',
|
||||
href: 'run.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true,
|
||||
mode
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
[
|
||||
[ 'fa-solid fa-plug', 'Install', 'install.js' ],
|
||||
[ 'fa-solid fa-rotate', 'Update', 'update.js' ],
|
||||
[ 'fa-regular fa-circle-xmark', 'Reset', 'reset.js' ]
|
||||
]
|
||||
.forEach(([ icon, text, href ]) =>
|
||||
}
|
||||
else
|
||||
{
|
||||
menu.push(
|
||||
[
|
||||
[ 'fa-solid fa-power-off', 'Run Default', 'Default' ],
|
||||
[ 'fa-solid fa-gauge', 'Run Benchmark', 'Benchmark' ],
|
||||
[ 'fa-solid fa-robot', 'Run Jobs', 'Jobs' ],
|
||||
[ 'fa-solid fa-camera', 'Run Webcam', 'Webcam' ]
|
||||
]
|
||||
.forEach(([ icon, text, mode ]) =>
|
||||
{
|
||||
icon,
|
||||
text,
|
||||
href,
|
||||
params:
|
||||
menu.push(
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true
|
||||
}
|
||||
icon,
|
||||
text,
|
||||
href: 'run.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true,
|
||||
mode
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
[
|
||||
[ 'fa-solid fa-plug', 'Install', 'install.js' ],
|
||||
[ 'fa-solid fa-rotate', 'Update', 'update.js' ],
|
||||
[ 'fa-regular fa-circle-xmark', 'Reset', 'reset.js' ]
|
||||
]
|
||||
.forEach(([ icon, text, href ]) =>
|
||||
{
|
||||
menu.push(
|
||||
{
|
||||
icon,
|
||||
text,
|
||||
href,
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return menu;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user