前端页面
This commit is contained in:
@@ -1,8 +1,37 @@
|
||||
Tea.context(function () {
|
||||
Tea.context(function () {
|
||||
if (typeof this.keywordInput == "undefined") {
|
||||
this.keywordInput = "";
|
||||
}
|
||||
if (typeof this.keyword == "undefined") {
|
||||
this.keyword = "";
|
||||
}
|
||||
|
||||
if (typeof this.domains == "undefined") {
|
||||
this.domains = [];
|
||||
}
|
||||
|
||||
this.keywordInput = this.keyword;
|
||||
|
||||
this.doSearch = function () {
|
||||
this.keyword = this.keywordInput.trim();
|
||||
};
|
||||
|
||||
this.clearSearch = function () {
|
||||
this.keywordInput = "";
|
||||
this.keyword = "";
|
||||
};
|
||||
|
||||
this.filteredDomains = function () {
|
||||
let keyword = this.keyword.trim().toLowerCase();
|
||||
if (keyword.length == 0) {
|
||||
return this.domains;
|
||||
}
|
||||
return this.domains.filter(function (domain) {
|
||||
let name = (domain.name || "").toLowerCase();
|
||||
return name.indexOf(keyword) >= 0;
|
||||
});
|
||||
};
|
||||
|
||||
this.bindDomain = function () {
|
||||
teaweb.popup("/httpdns/apps/domains/createPopup?appId=" + this.app.id, {
|
||||
height: "24em",
|
||||
@@ -11,6 +40,19 @@ Tea.context(function () {
|
||||
});
|
||||
};
|
||||
|
||||
this.deleteApp = function () {
|
||||
let that = this;
|
||||
teaweb.confirm("确定要删除当前应用吗?", function () {
|
||||
that.$post("/httpdns/apps/delete")
|
||||
.params({
|
||||
appId: that.app.id
|
||||
})
|
||||
.success(function () {
|
||||
window.location = "/httpdns/apps";
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
this.deleteDomain = function (domainId) {
|
||||
let that = this;
|
||||
teaweb.confirm("确定要解绑这个域名吗?", function () {
|
||||
|
||||
Reference in New Issue
Block a user