release: bump version to 0.84.2
This commit is contained in:
1 parent
5e6352f524
commit
30b44ec00d
77 files changed
+3312
-1039
No files matched your search
@@ -107,6 +107,8 @@ function readRepoText(relativePath) {
|
||||
return readFileSync(new URL(`../../${relativePath}`, import.meta.url), 'utf8')
|
||||
}
|
||||
|
||||
const smokeAppVersion = readRepoText('VERSION').trim() || '0.0.0'
|
||||
|
||||
function extractBalanced(text, start, openChar, closeChar) {
|
||||
let depth = 0
|
||||
let quote = null
|
||||
@@ -932,8 +934,14 @@ function tokenResponse() {
|
||||
})
|
||||
}
|
||||
|
||||
function apiPayloadFor(requestUrl, method) {
|
||||
// Single opaque RGB (128, 0, 0) pixel encodes sea level in Terrarium.
|
||||
const smokeTerrainPng = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGNoYGAAAAGEAIH5/mWIAAAAAElFTkSuQmCC'
|
||||
|
||||
function apiPayloadFor(requestUrl, method, postData) {
|
||||
const url = new URL(requestUrl)
|
||||
if (method === 'GET' && url.pathname === '/api/health') {
|
||||
return jsonResponse({ status: 'healthy', version: smokeAppVersion })
|
||||
}
|
||||
const path = url.pathname.replace(/^\/api\/v1/, '') || '/'
|
||||
|
||||
if (method === 'GET' && earthGeoJsonPaths.has(path)) {
|
||||
@@ -1546,6 +1554,19 @@ function apiPayloadFor(requestUrl, method) {
|
||||
if (method === 'DELETE' && /^\/earth\/tiles\/[a-z0-9_]+\/cache$/.test(path)) {
|
||||
return jsonResponse({ removed_files: 5 })
|
||||
}
|
||||
if (method === 'POST' && path === '/visualization/terrain/terrarium/batch') {
|
||||
const { tiles } = JSON.parse(postData ?? '{}')
|
||||
if (!Array.isArray(tiles) || tiles.length === 0) {
|
||||
return jsonResponse({ detail: 'Expected terrain tile coordinates' }, 422)
|
||||
}
|
||||
return jsonResponse({
|
||||
tiles: tiles.map(({ z, x, y }) => ({ z, x, y, content_type: 'image/png', data: smokeTerrainPng })),
|
||||
errors: [],
|
||||
})
|
||||
}
|
||||
if (method === 'GET' && /^\/visualization\/terrain\/terrarium\/\d+\/\d+\/\d+\.png$/.test(path)) {
|
||||
return { status: 200, contentType: 'image/png', body: Buffer.from(smokeTerrainPng, 'base64') }
|
||||
}
|
||||
if (path === '/earth/wind/meta') {
|
||||
return jsonResponse({
|
||||
available: true,
|
||||
@@ -1921,7 +1942,8 @@ function apiPayloadFor(requestUrl, method) {
|
||||
|
||||
async function installApiMocks(context) {
|
||||
await context.route('**/api/**', async (route) => {
|
||||
const response = apiPayloadFor(route.request().url(), route.request().method())
|
||||
const request = route.request()
|
||||
const response = apiPayloadFor(request.url(), request.method(), request.postData())
|
||||
await route.fulfill(response)
|
||||
})
|
||||
}
|
||||
@@ -3141,7 +3163,7 @@ async function main() {
|
||||
&& !english.classList.contains('is-active')
|
||||
&& getComputedStyle(segmented).getPropertyValue('--active-index').trim() === '0'
|
||||
)
|
||||
}, null, { timeout: 5000 })
|
||||
}, null, { polling: 100, timeout: SMOKE_RENDER_TIMEOUT_MS })
|
||||
const zhSystemText = await earthFrame.evaluate(() => (
|
||||
document.querySelector('.earth-settings-sheet [data-settings-tab-panel="system"]')?.innerText || ''
|
||||
))
|
||||
@@ -3164,7 +3186,7 @@ async function main() {
|
||||
&& !chinese.classList.contains('is-active')
|
||||
&& getComputedStyle(segmented).getPropertyValue('--active-index').trim() === '1'
|
||||
)
|
||||
}, null, { timeout: 5000 })
|
||||
}, null, { polling: 100, timeout: SMOKE_RENDER_TIMEOUT_MS })
|
||||
const hdTextureStatus = await earthFrame.evaluate(async () => {
|
||||
const { earthMessage, formatEarthMessage } = await import('/earth/js/i18n.js?frontend_smoke_i18n')
|
||||
const ui = await import('/earth/js/ui.js?frontend_smoke_i18n')
|
||||
@@ -3383,7 +3405,7 @@ async function main() {
|
||||
const ui = await import('/earth/js/ui.js')
|
||||
ui.setLoading(false)
|
||||
ui.showStatusMessage('成功加载 12 条电缆', 'success')
|
||||
await new Promise((resolve) => window.setTimeout(resolve, 360))
|
||||
// Read the temporary toast before a startup notification can replace it.
|
||||
const status = document.getElementById('status-message')
|
||||
const brand = document.getElementById('brand-panel')
|
||||
const ticker = document.getElementById('desktop-news-ticker')
|
||||
@@ -3396,7 +3418,7 @@ async function main() {
|
||||
stacked: status?.classList.contains('earth-status-message--ticker-stack') === true,
|
||||
left: rect?.left || 0,
|
||||
right: rect?.right || 0,
|
||||
top: rect?.top || 0,
|
||||
top: status?.offsetTop || 0,
|
||||
brandRight: brandRect?.right || 0,
|
||||
tickerLeft: tickerRect?.left || 0,
|
||||
tickerTop: tickerRect?.top || 0,
|
||||
@@ -3408,9 +3430,8 @@ async function main() {
|
||||
status.style.minWidth = '260px'
|
||||
window.dispatchEvent(new Event('resize'))
|
||||
}
|
||||
const stackedRect = status?.getBoundingClientRect()
|
||||
const stackedWhenConstrained = status?.classList.contains('earth-status-message--ticker-stack') === true
|
||||
const stackedTop = stackedRect?.top || 0
|
||||
const stackedTop = status?.offsetTop || 0
|
||||
if (status instanceof HTMLElement) {
|
||||
status.style.minWidth = ''
|
||||
window.dispatchEvent(new Event('resize'))
|
||||
|
||||
Reference in new issue
Block a user