mirror of
https://github.com/1f349/admin.1f349.com.git
synced 2025-02-22 13:34:57 +00:00
Change domain name in rest queries
This commit is contained in:
parent
e2615861b0
commit
cb25cf000a
@ -16,6 +16,10 @@ export class RestTable<T extends object> implements IPromiseLike<RestTable<T>> {
|
|||||||
this.rows = [];
|
this.rows = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeUrl(apiUrl: string) {
|
||||||
|
this.apiUrl = apiUrl;
|
||||||
|
}
|
||||||
|
|
||||||
updateSubs() {
|
updateSubs() {
|
||||||
this.subs.forEach(x => x(this));
|
this.subs.forEach(x => x(this));
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {domainOption} from "../stores/domain-option";
|
import {domainOption} from "../stores/domain-option";
|
||||||
import {
|
import {
|
||||||
DnsTypeA,
|
|
||||||
DnsTypeCAA,
|
DnsTypeCAA,
|
||||||
DnsTypeCNAME,
|
DnsTypeCNAME,
|
||||||
DnsTypeMX,
|
DnsTypeMX,
|
||||||
@ -26,7 +25,6 @@
|
|||||||
type CnameValue,
|
type CnameValue,
|
||||||
type MxValue,
|
type MxValue,
|
||||||
type NsValue,
|
type NsValue,
|
||||||
type SoaValue,
|
|
||||||
type SrvValue,
|
type SrvValue,
|
||||||
type TxtValue,
|
type TxtValue,
|
||||||
} from "../types/records";
|
} from "../types/records";
|
||||||
@ -51,6 +49,11 @@
|
|||||||
|
|
||||||
const table = new RestTable<AnyRecord>(apiAzalea + "/domains/" + $domainOption + "/records", (item: AnyRecord) => item.name);
|
const table = new RestTable<AnyRecord>(apiAzalea + "/domains/" + $domainOption + "/records", (item: AnyRecord) => item.name);
|
||||||
|
|
||||||
|
domainOption.subscribe(x => {
|
||||||
|
table.changeUrl(apiAzalea + "/domains/" + x + "/records");
|
||||||
|
table.reload();
|
||||||
|
});
|
||||||
|
|
||||||
function rowOrdering<T extends AnyValue>(
|
function rowOrdering<T extends AnyValue>(
|
||||||
rows: RestItem<AnyRecord>[],
|
rows: RestItem<AnyRecord>[],
|
||||||
domain: string,
|
domain: string,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user