mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Adding latest version section to the admin panel.
Summary: Update for the admin page to show the latest available version information. - Latest version is read from docs.getgrist.com by default - It sends basic information (installationId, deployment type, and version) - Checks are done only on the page itself - The actual request is routed through the API (to avoid CORS) Test Plan: Added new test Reviewers: paulfitz Reviewed By: paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D4238
This commit is contained in:
@@ -64,3 +64,31 @@ export async function serveSomething(setup: (app: express.Express) => void, port
|
||||
const url = `http://localhost:${port}`;
|
||||
return {url, shutdown};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a promise like object that can be resolved from outside.
|
||||
*/
|
||||
export class Defer {
|
||||
private _resolve!: () => void;
|
||||
private _reject!: (err: any) => void;
|
||||
private _promise: Promise<void>;
|
||||
|
||||
constructor() {
|
||||
this._promise = new Promise<void>((resolve, reject) => {
|
||||
this._resolve = resolve;
|
||||
this._reject = reject;
|
||||
});
|
||||
}
|
||||
|
||||
public get then() {
|
||||
return this._promise.then.bind(this._promise);
|
||||
}
|
||||
|
||||
public resolve() {
|
||||
this._resolve();
|
||||
}
|
||||
|
||||
public reject(err: any) {
|
||||
this._reject(err);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user