přidání Settings
This commit is contained in:
17
js/model.js
17
js/model.js
@@ -35,8 +35,9 @@ class Model {
|
||||
return dirtree;
|
||||
}
|
||||
|
||||
async dirTree(dir = "/") {
|
||||
var tree = await this.dirList(dir);
|
||||
async dirTree() {
|
||||
let baseDir = localStorage.getItem("baseDir");
|
||||
var tree = await this.dirList(baseDir);
|
||||
|
||||
return tree;
|
||||
}
|
||||
@@ -47,12 +48,22 @@ class Model {
|
||||
}
|
||||
|
||||
async cloneRep() {
|
||||
this.wipeFS();
|
||||
|
||||
await git.clone({
|
||||
fs,
|
||||
http,
|
||||
dir,
|
||||
url: "https://git.microlab.space/microlab/website.git",
|
||||
url: localStorage.getItem("repo"),
|
||||
corsProxy: "https://cors.isomorphic-git.org",
|
||||
});
|
||||
}
|
||||
|
||||
setRepo(repoURL) {
|
||||
localStorage.setItem("repo", repoURL);
|
||||
}
|
||||
|
||||
setBaseDir(baseDir) {
|
||||
localStorage.setItem("baseDir", baseDir);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user