mirror of
https://github.com/facefusion/facefusion-pinokio.git
synced 2026-07-08 12:07:50 +02:00
Fix coding style and reset.js
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const path = require('path')
|
||||
const path = require('path');
|
||||
|
||||
module.exports = async kernel =>
|
||||
{
|
||||
const hasEnv = await kernel.exists(__dirname, 'facefusion', 'env');
|
||||
@@ -10,117 +11,118 @@ module.exports = async kernel =>
|
||||
{
|
||||
if (kernel.running(__dirname, 'start.js'))
|
||||
{
|
||||
const memory = kernel.memory.local[path.resolve(__dirname, "start.js")]
|
||||
if (memory && memory.url && memory.mode)
|
||||
{
|
||||
menu =
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-rocket',
|
||||
text: 'Open session',
|
||||
href: memory.url,
|
||||
target: '_blank'
|
||||
},
|
||||
{
|
||||
icon: 'fa-solid fa-desktop',
|
||||
text: 'Server (' + memory.mode + ')',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
fullscreen: true
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
else
|
||||
{
|
||||
menu =
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-desktop',
|
||||
text: 'Server',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
fullscreen: true
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
menu =
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-power-off',
|
||||
text: 'Launch default',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true,
|
||||
mode: 'Default'
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: 'fa-solid fa-gauge',
|
||||
text: 'Launch benchmark',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true,
|
||||
mode: 'Benchmark'
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: 'fa-solid fa-camera',
|
||||
text: 'Launch webcam',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true,
|
||||
mode: 'Webcam'
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
menu = menu.concat(
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-rotate',
|
||||
text: 'Update',
|
||||
href: 'update.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: 'fa-solid fa-plug',
|
||||
text: 'Install',
|
||||
href: 'install.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: 'fa-regular fa-circle-xmark',
|
||||
text: 'Factory Reset',
|
||||
href: 'reset.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
const memory = kernel.memory.local[path.resolve(__dirname, 'start.js')];
|
||||
|
||||
if (memory && memory.url && memory.mode)
|
||||
{
|
||||
menu =
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-rocket',
|
||||
text: 'Open session',
|
||||
href: memory.url,
|
||||
target: '_blank'
|
||||
},
|
||||
{
|
||||
icon: 'fa-solid fa-desktop',
|
||||
text: 'Server (' + memory.mode + ')',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
fullscreen: true
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
else
|
||||
{
|
||||
menu =
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-desktop',
|
||||
text: 'Server',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
fullscreen: true
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
menu =
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-power-off',
|
||||
text: 'Launch default',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true,
|
||||
mode: 'Default'
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: 'fa-solid fa-gauge',
|
||||
text: 'Launch benchmark',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true,
|
||||
mode: 'Benchmark'
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: 'fa-solid fa-camera',
|
||||
text: 'Launch webcam',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true,
|
||||
mode: 'Webcam'
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
menu = menu.concat(
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-rotate',
|
||||
text: 'Update',
|
||||
href: 'update.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: 'fa-solid fa-plug',
|
||||
text: 'Install',
|
||||
href: 'install.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: 'fa-regular fa-circle-xmark',
|
||||
text: 'Factory Reset',
|
||||
href: 'reset.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true
|
||||
}
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user