Skip to content

Commit

Permalink
chore: copy
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-menlo committed Jan 22, 2024
1 parent 52dbc51 commit fbfd924
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 25 deletions.
4 changes: 2 additions & 2 deletions core/src/node/extension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default class Extension {
const pacote = await import('pacote')
await pacote.extract(
this.specifier,
join((await ExtensionManager.instance.getExtensionsPath()) ?? '', this.name ?? ''),
join(ExtensionManager.instance.getExtensionsPath() ?? '', this.name ?? ''),
this.installOptions,
)

Expand Down Expand Up @@ -180,7 +180,7 @@ export default class Extension {
* @returns {Promise}
*/
async uninstall(): Promise<void> {
const path = await ExtensionManager.instance.getExtensionsPath()
const path = ExtensionManager.instance.getExtensionsPath()
const extPath = resolve(path ?? '', this.name ?? '')
await rmdirSync(extPath, { recursive: true })

Expand Down
4 changes: 2 additions & 2 deletions core/src/node/extension/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function registerExtensionProtocol() {
} catch (err) {
console.error('Electron is not available')
}
const extensionPath = await ExtensionManager.instance.getExtensionsPath()
const extensionPath = ExtensionManager.instance.getExtensionsPath()
if (electron) {
return electron.protocol.registerFileProtocol('extension', (request: any, callback: any) => {
const entry = request.url.substr('extension://'.length - 1)
Expand All @@ -57,7 +57,7 @@ async function registerExtensionProtocol() {
* @param {string} extensionsPath Path to the extensions folder. Required if not yet set up.
* @returns {extensionManager} A set of functions used to manage the extension lifecycle.
*/
export async function useExtensions(extensionsPath: string) {
export function useExtensions(extensionsPath: string) {
if (!extensionsPath) throw Error('A path to the extensions folder is required to use extensions')
// Store the path to the extensions folder
ExtensionManager.instance.setExtensionsPath(extensionsPath)
Expand Down
2 changes: 1 addition & 1 deletion core/src/node/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const log = function (message: string) {
export const logServer = function (message: string) {
const serverLogPath = getServerLogPath()
if (!message.startsWith('[')) {
message = `[APP]::${message}`
message = `[SERVER]::${message}`
}

message = `${new Date().toISOString()} ${message}`
Expand Down
2 changes: 1 addition & 1 deletion electron/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ module.exports = {
{ name: 'Link', linkAttribute: 'to' },
],
},
ignorePatterns: ['build', 'renderer', 'node_modules'],
ignorePatterns: ['build', 'renderer', 'node_modules', '@global'],
}
10 changes: 5 additions & 5 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const startServer = async (configs?: ServerConfig) => {
// Start the server
try {
// Log server start
if (isVerbose) logServer(`[API]::Debug: Starting JAN API server...`);
if (isVerbose) logServer(`Debug: Starting JAN API server...`);

// Initialize Fastify server with logging
server = fastify({
Expand Down Expand Up @@ -116,12 +116,12 @@ export const startServer = async (configs?: ServerConfig) => {
// Log server listening
if (isVerbose)
logServer(
`[API]::Debug: JAN API listening at: http://${JAN_API_HOST}:${JAN_API_PORT}`
`Debug: JAN API listening at: http://${JAN_API_HOST}:${JAN_API_PORT}`
);
});
} catch (e) {
// Log any errors
if (isVerbose) logServer(`[API]::Error: ${e}`);
if (isVerbose) logServer(`Error: ${e}`);
}
};

Expand All @@ -131,11 +131,11 @@ export const startServer = async (configs?: ServerConfig) => {
export const stopServer = async () => {
try {
// Log server stop
if (isVerbose) logServer(`[API]::Debug: Server stopped`);
if (isVerbose) logServer(`Debug: Server stopped`);
// Stop the server
await server.close();
} catch (e) {
// Log any errors
if (isVerbose) logServer(`[API]::Error: ${e}`);
if (isVerbose) logServer(`Error: ${e}`);
}
};
36 changes: 22 additions & 14 deletions web/screens/Settings/Advanced/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,30 @@ const Advanced = () => {
Clear
</Button>
</div>
<div className="flex w-full items-start justify-between border-b border-border py-4 first:pt-0 last:border-none">
<div className="w-4/5 flex-shrink-0 space-y-1.5">
<div className="flex gap-x-2">
<h6 className="text-sm font-semibold capitalize">
Select Jan Data Folder
</h6>
{experimentalFeature && (
<div className="flex w-full items-start justify-between border-b border-border py-4 first:pt-0 last:border-none">
<div className="w-4/5 flex-shrink-0 space-y-1.5">
<div className="flex gap-x-2">
<h6 className="text-sm font-semibold capitalize">
Jan Data Folder
</h6>
</div>
<p className="whitespace-pre-wrap leading-relaxed">
Where messages, model configurations, and other user data is placed.

Check failure on line 244 in web/screens/Settings/Advanced/index.tsx

View workflow job for this annotation

GitHub Actions / test-on-ubuntu

Insert `⏎·············`

Check failure on line 244 in web/screens/Settings/Advanced/index.tsx

View workflow job for this annotation

GitHub Actions / test-on-macos

Insert `⏎·············`

Check failure on line 244 in web/screens/Settings/Advanced/index.tsx

View workflow job for this annotation

GitHub Actions / test-on-windows (default-windows-security)

Insert `␍⏎·············`
</p>
<p className="whitespace-pre-wrap leading-relaxed text-gray-500">
{`${currentPath}`}
</p>
</div>
<p className="whitespace-pre-wrap leading-relaxed">
Select Jan&apos;s data folder. Current folder is located at
{` ${currentPath}`}
</p>
<Button
size="sm"
themes="secondary"
onClick={onJanVaultDirectoryClick}
>
Select
</Button>
</div>
<Button size="sm" themes="secondary" onClick={onJanVaultDirectoryClick}>
Select
</Button>
</div>
)}
<div className="flex w-full items-start justify-between border-b border-border py-4 first:pt-0 last:border-none">
<div className="w-4/5 flex-shrink-0 space-y-1.5">
<div className="flex gap-x-2">
Expand Down

0 comments on commit fbfd924

Please sign in to comment.