mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-11-01 09:50:26 +01:00
import scaffoldings
This commit is contained in:
1 parent
95f9d685dc
commit
f459dd8812
25 files changed
+1362
-261
No files matched your search
@@ -600,6 +600,22 @@ export default class CommonHelper {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Downloads a json file created from the provide object.
|
||||
*
|
||||
* @param {mixed} obj The JS object to download.
|
||||
* @param {String} name The result file name.
|
||||
*/
|
||||
static downloadJson(obj, name) {
|
||||
const encodedObj = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(obj, null, 2));
|
||||
|
||||
const tempLink = document.createElement('a');
|
||||
tempLink.setAttribute("href", encodedObj);
|
||||
tempLink.setAttribute("download", name + ".json");
|
||||
tempLink.click();
|
||||
tempLink.remove();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses and returns the decoded jwt payload data.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user