mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-03-21 17:34:46 -05:00
WebUI for fix login issue about last index
This commit is contained in:
parent
b7bb38f626
commit
546175f1af
|
|
@ -4,7 +4,7 @@ Plugin Version: **v1.2.0**
|
|||
|
||||
Supported Versions
|
||||
-------------------
|
||||
- ノスタルジア / First Version (Experiment-Old)
|
||||
- ノスタルジア/ First Version (Experiment-Old)
|
||||
- Forte (Experiment-Old)
|
||||
- Op.2
|
||||
|
||||
|
|
@ -13,6 +13,8 @@ About Experiment-Old Support
|
|||
A version that marked as **Experiment-Old** is _Not_ Primary supported experiment version.
|
||||
Since This plugin is mainly focused on Op.2, other versions may not work correctly.
|
||||
|
||||
If you have a problem that move from old version to new version, There's webui for mitigate the issue.
|
||||
|
||||
Changelog
|
||||
=========
|
||||
1.2.0 (Current)
|
||||
|
|
|
|||
20
nostalgia@asphyxia/handler/webui.ts
Normal file
20
nostalgia@asphyxia/handler/webui.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { Profile } from "../models/profile";
|
||||
|
||||
export const fixIndexBug = async (data: {
|
||||
refid: string;
|
||||
confirm: string;
|
||||
}) => {
|
||||
if (data.confirm == "on") {
|
||||
console.warn(`refid "${data.refid}" performs index reset!`)
|
||||
await DB.Update<Profile>(
|
||||
data.refid,
|
||||
{ collection: 'profile' },
|
||||
{ $set: {
|
||||
music: 0,
|
||||
sheet: 0,
|
||||
brooch: 0
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
@ -1,9 +1,12 @@
|
|||
import { get_common_info, get_music_info } from "./handler/common";
|
||||
import { get_musicdata, get_playdata, regist_playdata, set_total_result } from "./handler/player"
|
||||
import { fixIndexBug } from "./handler/webui";
|
||||
|
||||
export function register() {
|
||||
R.GameCode('PAN');
|
||||
|
||||
R.WebUIEvent("nosFixIndexBug", fixIndexBug)
|
||||
|
||||
const MultiRoute = (method: string, handler: EPR | boolean) => {
|
||||
// Helper for register multiple versions.
|
||||
R.Route(method, handler); // First version and Forte.
|
||||
|
|
|
|||
26
nostalgia@asphyxia/webui/profile_fix_login.pug
Normal file
26
nostalgia@asphyxia/webui/profile_fix_login.pug
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
div
|
||||
.card
|
||||
.card-header
|
||||
p.card-header-title
|
||||
span.icon
|
||||
i.mdi.mdi-account-edit
|
||||
| Fix Error with Login
|
||||
.card-content
|
||||
p If you unable to login after travels of between versions, This may helpful.
|
||||
p Normally, login issue caused you played deleted song last time in previous version that not deleted time.
|
||||
p This page is about reset of last indexes that causing login problem.
|
||||
form(method="post" action="/emit/nosFixIndexBug")
|
||||
.field
|
||||
label.label ID
|
||||
.control
|
||||
input.input(type="text" name="refid", value=refid readonly)
|
||||
.field
|
||||
label.label Are you sure to reset indexes?
|
||||
.control
|
||||
input(type="checkbox" name="confirm")
|
||||
| This is not recoverable. Do this if you have a problem.
|
||||
.field
|
||||
button.button.is-primary(type="submit")
|
||||
span.icon
|
||||
i.mdi.mdi-check
|
||||
span Submit
|
||||
Loading…
Reference in New Issue
Block a user