* FEATURE: Added MaxMindDb to resolve IP information. * FEATURE: Added browser detection based on user agent. * FEATURE: Added recently used devices in user preferences. * DEV: Added acceptance test for recently used devices. * UX: Do not show 'Show more' button if there aren't more tokens. * DEV: Fix unit tests. * DEV: Make changes after code review. * Add more detailed unit tests. * Improve logging messages. * Minor coding style fixes. * DEV: Use DropdownSelectBoxComponent and run Prettier. * DEV: Fix unit tests.
41 lines
882 B
JavaScript
41 lines
882 B
JavaScript
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
|
|
|
|
export default DropdownSelectBoxComponent.extend({
|
|
classNames: ["auth-token-dropdown"],
|
|
headerIcon: "wrench",
|
|
allowInitialValueMutation: false,
|
|
showFullTitle: false,
|
|
|
|
computeContent() {
|
|
const content = [
|
|
{
|
|
id: "notYou",
|
|
icon: "user-times",
|
|
name: I18n.t("user.auth_tokens.not_you"),
|
|
description: ""
|
|
},
|
|
{
|
|
id: "logOut",
|
|
icon: "sign-out",
|
|
name: I18n.t("user.log_out"),
|
|
description: ""
|
|
}
|
|
];
|
|
|
|
return content;
|
|
},
|
|
|
|
actions: {
|
|
onSelect(id) {
|
|
switch (id) {
|
|
case "notYou":
|
|
this.sendAction("showToken", this.get("token"));
|
|
break;
|
|
case "logOut":
|
|
this.sendAction("revokeAuthToken", this.get("token"));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
});
|