Merge pull request #502 from janhq/chore-refactor-code
Chore: refactor code, hide plugin menu in web
This commit is contained in:
commit
7fff63367a
@ -19,7 +19,7 @@ module.exports = {
|
|||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
PLUGIN_NAME: JSON.stringify(packageJson.name),
|
PLUGIN_NAME: JSON.stringify(packageJson.name),
|
||||||
MODULE_PATH: JSON.stringify(`${packageJson.name}/${packageJson.module}`),
|
MODULE_PATH: JSON.stringify(`${packageJson.name}/${packageJson.module}`),
|
||||||
INFERENCE_URL: JSON.stringify("http://127.0.0.1:3928/inferences/llamacpp/chat_completion"),
|
INFERENCE_URL: JSON.stringify(process.env.INFERENCE_URL || "http://127.0.0.1:3928/inferences/llamacpp/chat_completion"),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
|
|||||||
@ -132,8 +132,10 @@ function getModelById(modelId: string): Promise<any> {
|
|||||||
|
|
||||||
function onStart() {
|
function onStart() {
|
||||||
store.createCollection("models", {});
|
store.createCollection("models", {});
|
||||||
|
if (!(window as any)?.electronAPI) {
|
||||||
fetchDownloadProgress(null, null).then((fileName: string) => fileName && checkDownloadProgress(fileName));
|
fetchDownloadProgress(null, null).then((fileName: string) => fileName && checkDownloadProgress(fileName));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Register all the above functions and objects with the relevant extension points
|
// Register all the above functions and objects with the relevant extension points
|
||||||
export function init({ register }: { register: RegisterExtensionPoint }) {
|
export function init({ register }: { register: RegisterExtensionPoint }) {
|
||||||
|
|||||||
@ -18,7 +18,11 @@ import {
|
|||||||
extensionPoints,
|
extensionPoints,
|
||||||
} from '@/../../electron/core/plugin-manager/execution/index'
|
} from '@/../../electron/core/plugin-manager/execution/index'
|
||||||
|
|
||||||
const staticMenu = ['Appearance', 'Core Plugins']
|
const staticMenu = ['Appearance']
|
||||||
|
|
||||||
|
if (typeof window !== "undefined" && window.electronAPI) {
|
||||||
|
staticMenu.push('Core Plugins');
|
||||||
|
}
|
||||||
|
|
||||||
const SettingsScreen = () => {
|
const SettingsScreen = () => {
|
||||||
const [activeStaticMenu, setActiveStaticMenu] = useState('Appearance')
|
const [activeStaticMenu, setActiveStaticMenu] = useState('Appearance')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user