mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-16 12:27:29 -06:00
[feature] Add domain permission drafts and excludes (#3547)
* [feature] Add domain permission drafts and excludes * fix typescript complaining * lint * make filenames more consistent * test own domain excluded
This commit is contained in:
parent
c2029df9bc
commit
301543616b
69 changed files with 5664 additions and 264 deletions
|
|
@ -22,32 +22,11 @@ import { TextInput } from "../../../../components/form/inputs";
|
|||
import MutationButton from "../../../../components/form/mutation-button";
|
||||
import { useTextInput } from "../../../../lib/form";
|
||||
import { useInstanceKeysExpireMutation } from "../../../../lib/query/admin/actions";
|
||||
import isValidDomain from "is-valid-domain";
|
||||
import { formDomainValidator } from "../../../../lib/util/formvalidators";
|
||||
|
||||
export default function ExpireRemote({}) {
|
||||
const domainField = useTextInput("domain", {
|
||||
validator: (v: string) => {
|
||||
if (v.length === 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (v[v.length-1] === ".") {
|
||||
return "invalid domain";
|
||||
}
|
||||
|
||||
const valid = isValidDomain(v, {
|
||||
subdomain: true,
|
||||
wildcard: false,
|
||||
allowUnicode: true,
|
||||
topLevel: false,
|
||||
});
|
||||
|
||||
if (valid) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return "invalid domain";
|
||||
}
|
||||
validator: formDomainValidator,
|
||||
});
|
||||
|
||||
const [expire, expireResult] = useInstanceKeysExpireMutation();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue