Skip to content

Commit

Permalink
chore: update rendering for object
Browse files Browse the repository at this point in the history
  • Loading branch information
v3g42 committed Jul 13, 2024
1 parent a632701 commit 41d9169
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 23 deletions.
11 changes: 1 addition & 10 deletions packages/langdb-files/src/contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,21 @@ async function saveFile(appId: string, content: any): Promise<any> {
}

class LangdbFile implements Contents.IModel {
// @ts-ignore
name: string;
// @ts-ignore
path: string;
serverPath?: string | undefined;
// @ts-ignore
type: string;
// @ts-ignore
writable: boolean;
// @ts-ignore
created: string;
// @ts-ignore
last_modified: string;
// @ts-ignore
mimetype: string;
content: any;
chunk?: number | undefined;
// @ts-ignore
format: Contents.FileFormat;
size?: number | undefined;
indices?: readonly number[] | null | undefined;
hash?: string | undefined;
hash_algorithm?: string | undefined;

}

/**
Expand Down Expand Up @@ -285,7 +276,7 @@ export class LangdbDrive implements Contents.IDrive {
try {
const response = await saveFile(appId, options.content);
console.log(response);
let model = options as LangdbFile;
const model = options as LangdbFile;
model.writable = true;
return Promise.resolve(model);
} catch (e: any) {
Expand Down
11 changes: 0 additions & 11 deletions packages/langdb-kernel-lite/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ module.exports = {
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/naming-convention': [
'error',
{
'selector': 'interface',
'format': ['PascalCase'],
'custom': {
'regex': '^I[A-Z]',
'match': true
}
}
],
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
Expand Down
6 changes: 4 additions & 2 deletions packages/langdb-kernel-lite/src/kernel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ interface Column {
type: string;
}
interface ClickhouseResponse {
data: Record<string, object>[];
data: Record<string, any>[];
meta: Column[];
}

Expand All @@ -504,7 +504,9 @@ const toHtml = (jsonData: ClickhouseResponse): string => {
jsonData.data.forEach(row => {
table += '<tr>';
jsonData.meta.forEach(col => {
table += `<td>${row[col.name]}</td>`;
let val = row[col.name];
val = typeof val === 'object' ? JSON.stringify(row[col.name]) : val;
table += `<td>${val}</td>`;
});
table += '</tr>';
});
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"rootDir": "src",
"strict": true,
"strictNullChecks": true,
"strictPropertyInitialization": false,
"target": "ES2018"
},
"include": [
Expand Down

0 comments on commit 41d9169

Please sign in to comment.