update VFS API

This commit is contained in:
Dany LE 2021-10-24 20:56:18 +02:00
parent 86a94a817a
commit 66e96cc0db
3 changed files with 17 additions and 8 deletions

Binary file not shown.

View File

@ -388,6 +388,7 @@ namespace OS {
if (v.filename[0] === "." && !this.showhidden) { if (v.filename[0] === "." && !this.showhidden) {
return; return;
} }
if(!v.text)
v.text = v.filename; v.text = v.filename;
if (v.text.length > 10) { if (v.text.length > 10) {
v.text = v.text.substring(0, 9) + "..."; v.text = v.text.substring(0, 9) + "...";
@ -412,6 +413,7 @@ namespace OS {
if (v.filename[0] === "." && !this.showhidden) { if (v.filename[0] === "." && !this.showhidden) {
return; return;
} }
if(!v.text)
v.text = v.filename; v.text = v.filename;
v.iconclass = v.iconclass ? v.iconclass : v.type; v.iconclass = v.iconclass ? v.iconclass : v.type;
const row = [ const row = [
@ -467,6 +469,7 @@ namespace OS {
if (v.filename[0] === "." && !this.showhidden) { if (v.filename[0] === "." && !this.showhidden) {
return undefined; return undefined;
} }
if(!v.text)
v.text = v.filename; v.text = v.filename;
if (v.type === "dir") { if (v.type === "dir") {
v.nodes = []; v.nodes = [];

View File

@ -1356,11 +1356,17 @@ namespace OS {
constructor(path: string) { constructor(path: string) {
super(path); super(path);
if (this.basename) { if (this.basename) {
let v: any = OS.setting.system.packages[this.basename]; let v = OS.setting.system.packages[this.basename];
v.type = "app"; this.info = {} as FileInfoType;
v.mime = "antos/app"; for(const p in v)
v.size = 0; {
this.info = v as FileInfoType; this.info[p] = v[p];
}
this.info.type = "app";
this.info.mime = "antos/app";
this.info.size = 0;
this.info.text = v.name;
} }
this.ready = true; this.ready = true;
} }