当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript admin-ui.UiService类代码示例

本文整理汇总了TypeScript中@colmena/admin-ui.UiService的典型用法代码示例。如果您正苦于以下问题:TypeScript UiService类的具体用法?TypeScript UiService怎么用?TypeScript UiService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UiService类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

 .map((roles: any) => {
   if (roles.includes('system-admin') || roles.includes('system-manager')) {
     return true
   }
   this.uiService.toastError('Access Denied', 'Your assigned roles do not allow access.')
   return false
 })
开发者ID:beeman,项目名称:loopback-angular-admin,代码行数:7,代码来源:app.guards.ts

示例2: handleAction

 handleAction(event) {
   switch (event.type) {
     case 'generateToken':
       return this.service.generateToken(
         this.item,
         () => {
           this.refreshTokens()
           this.uiService.toastSuccess('Generate Token Success', `A new token has been generated for <u>${this.item.username}</u>`)
         },
         err => this.uiService.toastError('Generate Token Fail', err.message)
       )
     case 'deleteToken':
       return this.service.deleteToken(
         {
           user: this.item,
           token: event.payload,
         },
         () => {
           this.refreshTokens()
           this.uiService.toastSuccess('Delete Token Success', `Token <u>${event.payload.id}</u> has been deleted successfully`)
         },
         err => this.uiService.toastError('Delete Token Fail', err.message)
       )
     case 'removeTtl':
       return this.service.removeTtl(
         {
           user: this.item,
           token: event.payload,
         },
         () => {
           this.refreshTokens()
           this.uiService.toastSuccess('Remove TTL Success', `TTL for token <u>${event.payload.id} has been removed successfully`)
         },
         err => this.uiService.toastError('Remove TTL Fail', err.message)
       )
     case 'deleteAllTokens':
       const successCb = () => this.service.deleteAllTokens(
         this.item,
         () => {
           this.refreshTokens()
           this.uiService.toastSuccess('Delete All Tokens Success', `All tokens for <u>${this.item.username}</u> have been deleted successfully`)
         },
         err => this.uiService.toastError('Delete All Tokens Fail', err.message)
       )
       const question = { title: 'Are you sure?', text: 'This action cannot be undone' }
       return this.uiService.alertError(question, successCb, () => ({}))
     default:
       return console.log('Unknown Event Type', event)
   }
 }
开发者ID:beeman,项目名称:loopback-angular-admin,代码行数:50,代码来源:user-access-tokens.component.ts

示例3:

 err => this.uiService.toastError('Delete All Tokens Fail', err.message)
开发者ID:beeman,项目名称:loopback-angular-admin,代码行数:1,代码来源:user-access-tokens.component.ts


注:本文中的@colmena/admin-ui.UiService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。