mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
Fix small web interface nits from the RC smoke test (#1215)
Fix the "Permamently" typo in the delete instance confirm. The Search Mod Portal dialog now opens on the default mod pack's Factorio version, or the newest known version when there is no default pack. It used to always start on 2.0. A version the user picks still sticks while the page is open. The mod portal cache key used request.hide_deprecated directly, and the web interface never sends it, so the controller logged "2.0-undefined". A missing value now counts as false, the same default fetchAllModsFromPortal already uses, so "2.1" and "2.1-false" share a cache entry. Closes #1209 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c6bc81b0df
commit
09d79d775f
4 files changed
+65
-20
No files matched your search
@@ -631,7 +631,8 @@ export default class ControlConnection extends BaseConnection {
|
||||
* @param request - The request object containing factorioVersion.
|
||||
*/
|
||||
async handleModPortalGetAllRequest(request: lib.ModPortalGetAllRequest) {
|
||||
const cacheKey = `${request.factorioVersion}-${request.hide_deprecated}`;
|
||||
const hideDeprecated = request.hide_deprecated ?? false;
|
||||
const cacheKey = `${request.factorioVersion}-${hideDeprecated}`;
|
||||
const cachedData = this._controller.modPortalCache.get(cacheKey);
|
||||
|
||||
const cacheDuration = this._controller.config.get("controller.mod_portal_cache_duration_minutes") * 60 * 1000;
|
||||
@@ -644,7 +645,7 @@ export default class ControlConnection extends BaseConnection {
|
||||
const mods = await lib.ModStore.fetchAllModsFromPortal(
|
||||
request.factorioVersion,
|
||||
this._controller.config.get("controller.mod_portal_page_size"),
|
||||
request.hide_deprecated
|
||||
hideDeprecated
|
||||
);
|
||||
this._controller.modPortalCache.set(cacheKey, { timestamp: Date.now(), data: mods });
|
||||
// The Response class is defined inline within the Request class
|
||||
|
||||
Reference in new issue
Block a user