WebUI for fix login issue about last index

This commit is contained in:
DitFranXX 2020-12-26 16:11:18 +09:00
parent b7bb38f626
commit 546175f1af
4 changed files with 52 additions and 1 deletions

View File

@ -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)

View 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
}
}
);
}
};

View File

@ -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.

View 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