mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-10-23 12:52:31 +00:00
add some initial support
This commit is contained in:
3 files changed
+13
-2
No files matched your search
@@ -18,6 +18,7 @@ import {
|
||||
startTypingjson,
|
||||
wsjson,
|
||||
pollUpdateJson,
|
||||
applicationJson,
|
||||
} from "./jsontypes.js";
|
||||
import {Member} from "./member.js";
|
||||
import {Dialog, Form, FormError, Options} from "./settings.js";
|
||||
@@ -2626,7 +2627,6 @@ class Localuser {
|
||||
headers: this.headers,
|
||||
});
|
||||
const json = await res.json();
|
||||
console.error(json);
|
||||
const form = container.addSubForm(json.name, () => {}, {
|
||||
fetchURL: this.info.api + "/applications/" + appId,
|
||||
method: "PATCH",
|
||||
@@ -2670,6 +2670,16 @@ class Localuser {
|
||||
form.addCheckboxInput(I18n.localuser.requireCode(), "bot_require_code_grant", {
|
||||
initState: json.bot_require_code_grant,
|
||||
});
|
||||
//TODO remove this conditional once https://codeberg.org/MelodyChat/Harmony/pulls/278 is merged
|
||||
if (false as boolean)
|
||||
form.addMDInput(I18n.localuser.redirURIs(), "redirect_uris", {
|
||||
initText: json.redirect_uris.join("\n"),
|
||||
});
|
||||
form.addPreprocessor((_) => {
|
||||
if ("redirect_uris" in _ && typeof _.redirect_uris === "string") {
|
||||
_.redirect_uris = _.redirect_uris.split("\n");
|
||||
}
|
||||
});
|
||||
form.addButtonInput("", I18n.localuser[json.bot ? "manageBot" : "addBot"](), async () => {
|
||||
if (!json.bot) {
|
||||
if (!confirm(I18n.localuser.confirmAddBot())) {
|
||||
|
||||
@@ -2353,7 +2353,7 @@ class Form implements OptionsElement<object> {
|
||||
}
|
||||
}
|
||||
preprocessor: (obj: Object) => void = () => {};
|
||||
addPreprocessor(func: (obj: Object) => void) {
|
||||
addPreprocessor(func: (obj: object) => void) {
|
||||
this.preprocessor = func;
|
||||
}
|
||||
onFormError = (_: FormError) => {};
|
||||
|
||||
@@ -593,6 +593,7 @@
|
||||
"publicAvaliable": "Make bot publicly inviteable?",
|
||||
"refreshPage": "Refresh to apply",
|
||||
"requireCode": "Require code grant to invite the bot?",
|
||||
"redirURIs": "Redirect URIs:",
|
||||
"resetToken": "Reset token",
|
||||
"saveToken": "Save token to local storage",
|
||||
"setUp2fa": "2FA Setup",
|
||||
|
||||
Reference in new issue
Block a user