SSH认证可搜索

This commit is contained in:
刘祥超
2021-05-23 21:12:52 +08:00
parent 48012072d7
commit 0bb63b5bb7
5 changed files with 68 additions and 13 deletions

View File

@@ -1,5 +1,7 @@
Tea.context(function () {
this.grantId = 0;
this.grantId = 0
this.keyword = ""
let allGrants = this.grants.$copy()
this.selectGrant = function (grant) {
NotifyPopup({
@@ -8,5 +10,20 @@ Tea.context(function () {
grant: grant
}
})
};
});
}
this.$delay(function () {
let that = this
this.$watch("keyword", function (keyword) {
if (keyword.length > 0) {
that.grants = allGrants.$findAll(function (k, grant) {
return teaweb.match(grant.name, keyword)
|| teaweb.match(grant.description, keyword)
|| teaweb.match(grant.username, keyword)
})
} else {
that.grants = allGrants
}
})
})
})