frontend: add charset=utf16

This commit is contained in:
Hay1tsme 2024-01-12 18:03:44 -05:00
parent ae09c2ad48
commit e80b0671c2
5 changed files with 18 additions and 18 deletions

View File

@ -180,7 +180,7 @@ class FE_Base():
title=self.core_config.server.name, title=self.core_config.server.name,
game_list=self.environment.globals["game_list"], game_list=self.environment.globals["game_list"],
sesh=vars(sesh) if sesh is not None else vars(UserSession()), sesh=vars(sesh) if sesh is not None else vars(UserSession()),
)) ), media_type="text/html; charset=utf-16")
if sesh is None: if sesh is None:
resp.delete_cookie("DIANA_SESH") resp.delete_cookie("DIANA_SESH")
@ -281,7 +281,7 @@ class FE_Gate(FE_Base):
title=f"{self.core_config.server.name} | Login Gate", title=f"{self.core_config.server.name} | Login Gate",
error=err, error=err,
sesh=vars(UserSession()), sesh=vars(UserSession()),
)) ), media_type="text/html; charset=utf-16")
resp.delete_cookie("DIANA_SESH") resp.delete_cookie("DIANA_SESH")
return resp return resp
@ -392,7 +392,7 @@ class FE_Gate(FE_Base):
title=f"{self.core_config.server.name} | Create User", title=f"{self.core_config.server.name} | Create User",
code=ac, code=ac,
sesh={"user_id": 0, "permissions": 0}, sesh={"user_id": 0, "permissions": 0},
)) ), media_type="text/html; charset=utf-16")
class FE_User(FE_Base): class FE_User(FE_Base):
async def render_GET(self, request: Request): async def render_GET(self, request: Request):
@ -483,7 +483,7 @@ class FE_User(FE_Base):
success=succ, success=succ,
username=user['username'], username=user['username'],
arcades=arcade_data arcades=arcade_data
)) ), media_type="text/html; charset=utf-16")
async def render_logout(self, request: Request): async def render_logout(self, request: Request):
resp = RedirectResponse("/gate/", 303) resp = RedirectResponse("/gate/", 303)
@ -557,7 +557,7 @@ class FE_System(FE_Base):
title=f"{self.core_config.server.name} | System", title=f"{self.core_config.server.name} | System",
sesh=vars(usr_sesh), sesh=vars(usr_sesh),
usrlist=[], usrlist=[],
)) ), media_type="text/html; charset=utf-16")
async def lookup_user(self, request: Request): async def lookup_user(self, request: Request):
template = self.environment.get_template("core/templates/sys/index.jinja") template = self.environment.get_template("core/templates/sys/index.jinja")
@ -590,7 +590,7 @@ class FE_System(FE_Base):
sesh=vars(usr_sesh), sesh=vars(usr_sesh),
usrlist=usrlist, usrlist=usrlist,
shoplist=[], shoplist=[],
)) ), media_type="text/html; charset=utf-16")
async def lookup_shop(self, request: Request): async def lookup_shop(self, request: Request):
shoplist = [] shoplist = []
@ -624,7 +624,7 @@ class FE_System(FE_Base):
usrlist=[], usrlist=[],
shoplist=shoplist, shoplist=shoplist,
error=4 error=4
)) ), media_type="text/html; charset=utf-16")
if sn_search: if sn_search:
sn_search = sn_search.upper().replace("-", "").strip() sn_search = sn_search.upper().replace("-", "").strip()
@ -653,7 +653,7 @@ class FE_System(FE_Base):
usrlist=[], usrlist=[],
shoplist=shoplist, shoplist=shoplist,
error=10 error=10
)) ), media_type="text/html; charset=utf-16")
return Response(template.render( return Response(template.render(
@ -661,7 +661,7 @@ class FE_System(FE_Base):
sesh=vars(usr_sesh), sesh=vars(usr_sesh),
usrlist=[], usrlist=[],
shoplist=shoplist, shoplist=shoplist,
)) ), media_type="text/html; charset=utf-16")
class FE_Arcade(FE_Base): class FE_Arcade(FE_Base):
async def render_GET(self, request: Request): async def render_GET(self, request: Request):
@ -677,14 +677,14 @@ class FE_Arcade(FE_Base):
return Response(template.render( return Response(template.render(
title=f"{self.core_config.server.name} | Arcade", title=f"{self.core_config.server.name} | Arcade",
sesh=vars(usr_sesh), sesh=vars(usr_sesh),
)) ), media_type="text/html; charset=utf-16")
sinfo = await self.data.arcade.get_arcade(shop_id) sinfo = await self.data.arcade.get_arcade(shop_id)
if not sinfo: if not sinfo:
return Response(template.render( return Response(template.render(
title=f"{self.core_config.server.name} | Arcade", title=f"{self.core_config.server.name} | Arcade",
sesh=vars(usr_sesh), sesh=vars(usr_sesh),
)) ), media_type="text/html; charset=utf-16")
cabs = await self.data.arcade.get_arcade_machines(shop_id) cabs = await self.data.arcade.get_arcade_machines(shop_id)
cablst = [] cablst = []
@ -705,7 +705,7 @@ class FE_Arcade(FE_Base):
"cabs": cablst "cabs": cablst
} }
)) ), media_type="text/html; charset=utf-16")
class FE_Machine(FE_Base): class FE_Machine(FE_Base):
async def render_GET(self, request: Request): async def render_GET(self, request: Request):
@ -721,13 +721,13 @@ class FE_Machine(FE_Base):
return Response(template.render( return Response(template.render(
title=f"{self.core_config.server.name} | Machine", title=f"{self.core_config.server.name} | Machine",
sesh=vars(usr_sesh), sesh=vars(usr_sesh),
)) ), media_type="text/html; charset=utf-16")
return Response(template.render( return Response(template.render(
title=f"{self.core_config.server.name} | Machine", title=f"{self.core_config.server.name} | Machine",
sesh=vars(usr_sesh), sesh=vars(usr_sesh),
arcade={} arcade={}
)) ), media_type="text/html; charset=utf-16")
cfg_dir = environ.get("DIANA_CFG_DIR", "config") cfg_dir = environ.get("DIANA_CFG_DIR", "config")
cfg: CoreConfig = CoreConfig() cfg: CoreConfig = CoreConfig()

View File

@ -141,4 +141,4 @@ class IDACFrontend(FE_Base):
rank=rank, rank=rank,
sesh=vars(usr_sesh), sesh=vars(usr_sesh),
active_page="idac", active_page="idac",
)) ), media_type="text/html; charset=utf-16")

View File

@ -64,7 +64,7 @@ class OngekiFrontend(FE_Base):
version_list=self.version_list, version_list=self.version_list,
version=self.version, version=self.version,
sesh=vars(usr_sesh) sesh=vars(usr_sesh)
)) ), media_type="text/html; charset=utf-16")
else: else:
return RedirectResponse("/gate/", 303) return RedirectResponse("/gate/", 303)

View File

@ -74,7 +74,7 @@ class PokkenFrontend(FE_Base):
profile=pf, profile=pf,
error=err, error=err,
success=succ success=succ
)) ), media_type="text/html; charset=utf-16")
async def change_name(self, request: Request) -> RedirectResponse: async def change_name(self, request: Request) -> RedirectResponse:
usr_sesh = self.validate_session(request) usr_sesh = self.validate_session(request)

View File

@ -43,4 +43,4 @@ class WaccaFrontend(FE_Base):
title=f"{self.core_config.server.name} | {self.nav_name}", title=f"{self.core_config.server.name} | {self.nav_name}",
game_list=self.environment.globals["game_list"], game_list=self.environment.globals["game_list"],
sesh=vars(usr_sesh) sesh=vars(usr_sesh)
)) ), media_type="text/html; charset=utf-16")