mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-26 07:57:10 +00:00
dev: add parameter to exclude fetching subdomains
This parameter will allow readdir requests to not include subdomain fetching, which will allow for the later effort of fetching subdomains for directory listings in the gui with a separate request.
This commit is contained in:
@@ -39,7 +39,7 @@ class HLReadDir extends HLFilesystemOperation {
|
||||
});
|
||||
}
|
||||
async __run () {
|
||||
const { subject: subject_let, user, no_thumbs, no_assocs, actor } = this.values;
|
||||
const { subject: subject_let, user, no_thumbs, no_assocs, no_subdomains, actor } = this.values;
|
||||
let subject = subject_let;
|
||||
|
||||
if ( ! await subject.exists() ) {
|
||||
@@ -120,10 +120,11 @@ class HLReadDir extends HLFilesystemOperation {
|
||||
}
|
||||
|
||||
if ( ! no_assocs ) {
|
||||
await Promise.all([
|
||||
this.#batchFetchSuggestedApps(children, user),
|
||||
this.#batchFetchSubdomains(children, user),
|
||||
]);
|
||||
await this.#batchFetchSuggestedApps(children, user);
|
||||
}
|
||||
|
||||
if ( ! no_subdomains ) {
|
||||
await this.#batchFetchSubdomains(children, user);
|
||||
}
|
||||
|
||||
return Promise.all(children.map(async child => {
|
||||
|
||||
@@ -42,6 +42,7 @@ module.exports = eggspress('/readdir', {
|
||||
recursive: new FlagParam('recursive', { optional: true }),
|
||||
no_thumbs: new FlagParam('no_thumbs', { optional: true }),
|
||||
no_assocs: new FlagParam('no_assocs', { optional: true }),
|
||||
no_subdomains: new FlagParam('no_subdomains', { optional: true }),
|
||||
},
|
||||
}, async (req, res, next) => {
|
||||
let log; {
|
||||
@@ -56,6 +57,7 @@ module.exports = eggspress('/readdir', {
|
||||
const recursive = req.values.recursive;
|
||||
const no_thumbs = req.values.no_thumbs;
|
||||
const no_assocs = req.values.no_assocs;
|
||||
const no_subdomains = req.values.no_subdomains;
|
||||
|
||||
const hl_readdir = new HLReadDir();
|
||||
const result = await hl_readdir.run({
|
||||
@@ -63,6 +65,7 @@ module.exports = eggspress('/readdir', {
|
||||
recursive,
|
||||
no_thumbs,
|
||||
no_assocs,
|
||||
no_subdomains,
|
||||
user: req.user,
|
||||
actor: req.actor,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user