move codeberg fetch to backend
This commit is contained in:
parent
4206f46cf4
commit
92150c575f
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "calckey",
|
"name": "calckey",
|
||||||
"version": "12.119.0-calc.1-rc.6",
|
"version": "12.119.0-calc.1-rc.7",
|
||||||
"codename": "aqua",
|
"codename": "aqua",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -272,6 +272,7 @@ import * as ep___recommendedInstances from './endpoints/recommended-instances.js
|
||||||
import * as ep___pinnedUsers from './endpoints/pinned-users.js';
|
import * as ep___pinnedUsers from './endpoints/pinned-users.js';
|
||||||
import * as ep___customMOTD from './endpoints/custom-motd.js';
|
import * as ep___customMOTD from './endpoints/custom-motd.js';
|
||||||
import * as ep___customSplashIcons from './endpoints/custom-splash-icons.js';
|
import * as ep___customSplashIcons from './endpoints/custom-splash-icons.js';
|
||||||
|
import * as ep___latestVersion from './endpoints/latest-version.js';
|
||||||
import * as ep___promo_read from './endpoints/promo/read.js';
|
import * as ep___promo_read from './endpoints/promo/read.js';
|
||||||
import * as ep___requestResetPassword from './endpoints/request-reset-password.js';
|
import * as ep___requestResetPassword from './endpoints/request-reset-password.js';
|
||||||
import * as ep___resetDb from './endpoints/reset-db.js';
|
import * as ep___resetDb from './endpoints/reset-db.js';
|
||||||
|
@ -592,7 +593,8 @@ const eps = [
|
||||||
['pinned-users', ep___pinnedUsers],
|
['pinned-users', ep___pinnedUsers],
|
||||||
['recommended-instances', ep___recommendedInstances],
|
['recommended-instances', ep___recommendedInstances],
|
||||||
['custom-motd', ep___customMOTD],
|
['custom-motd', ep___customMOTD],
|
||||||
['custom-motd', ep___customSplashIcons],
|
['custom-splash-icons', ep___customSplashIcons],
|
||||||
|
['latest-version', ep___latestVersion],
|
||||||
['promo/read', ep___promo_read],
|
['promo/read', ep___promo_read],
|
||||||
['request-reset-password', ep___requestResetPassword],
|
['request-reset-password', ep___requestResetPassword],
|
||||||
['reset-db', ep___resetDb],
|
['reset-db', ep___resetDb],
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
export async function getLatestVersion(): Promise<string> {
|
||||||
|
let tag_name = 'v12.119.0-calc';
|
||||||
|
fetch('https://codeberg.org/api/v1/repos/thatonecalculator/calckey/releases?draft=false&pre-release=false&page=1&limit=1')
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => { tag_name = data[0].tag_name; });
|
||||||
|
return tag_name;
|
||||||
|
}
|
|
@ -68,15 +68,9 @@ os.api('admin/abuse-user-reports', {
|
||||||
if (reports?.length > 0) thereIsUnresolvedAbuseReport = true;
|
if (reports?.length > 0) thereIsUnresolvedAbuseReport = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
await fetch('https://codeberg.org/api/v1/repos/thatonecalculator/calckey/releases?draft=false&pre-release=false&page=1&limit=1')
|
os.api('latest-version').then(res => {
|
||||||
.then((response) => response.json())
|
console.log(res);
|
||||||
.then((data) => {
|
});
|
||||||
console.log(data);
|
|
||||||
console.log(data[0]);
|
|
||||||
if (data[0].tag_name !== version) {
|
|
||||||
updateAvailable = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const NARROW_THRESHOLD = 600;
|
const NARROW_THRESHOLD = 600;
|
||||||
const ro = new ResizeObserver((entries, observer) => {
|
const ro = new ResizeObserver((entries, observer) => {
|
||||||
|
|
Loading…
Reference in New Issue