本文整理汇总了TypeScript中src/shared/copy/notifications.resourceLimitReached函数的典型用法代码示例。如果您正苦于以下问题:TypeScript resourceLimitReached函数的具体用法?TypeScript resourceLimitReached怎么用?TypeScript resourceLimitReached使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resourceLimitReached函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: async
export const cloneDashboard = (dashboard: Dashboard) => async (
dispatch,
getState: GetState
): Promise<void> => {
try {
const {
orgs: {org},
dashboards,
} = getState()
const allDashboardNames = dashboards.list.map(d => d.name)
const clonedName = incrementCloneName(allDashboardNames, dashboard.name)
const data = await client.dashboards.clone(dashboard.id, clonedName, org.id)
dispatch(checkDashboardLimits())
dispatch(push(`/orgs/${org.id}/dashboards/${data.id}`))
} catch (error) {
console.error(error)
if (isLimitError(error)) {
dispatch(notify(copy.resourceLimitReached('dashboards')))
} else {
dispatch(notify(copy.dashboardCreateFailed()))
}
}
}
开发者ID:influxdata,项目名称:influxdb,代码行数:27,代码来源:index.ts
示例2: async
export const saveNewScript = (script: string, preamble: string) => async (
dispatch,
getState: GetStateFunc
): Promise<void> => {
try {
const fluxScript = await insertPreambleInScript(script, preamble)
const {
orgs: {org},
} = getState()
await client.tasks.createByOrgID(org.id, fluxScript)
dispatch(setNewScript(''))
dispatch(clearTask())
dispatch(getTasks())
dispatch(goToTasks())
dispatch(notify(taskCreatedSuccess()))
dispatch(checkTaskLimits())
} catch (error) {
console.error(error)
if (isLimitError(error)) {
dispatch(notify(copy.resourceLimitReached('tasks')))
} else {
const message = getErrorMessage(error)
dispatch(notify(taskNotCreated(message)))
}
}
}
开发者ID:influxdata,项目名称:influxdb,代码行数:29,代码来源:index.ts
示例3: dispatch
export const cloneTask = (task: Task, _) => async dispatch => {
try {
await client.tasks.clone(task.id)
dispatch(notify(taskCloneSuccess(task.name)))
dispatch(getTasks())
dispatch(checkTaskLimits())
} catch (error) {
console.error(error)
if (isLimitError(error)) {
dispatch(notify(copy.resourceLimitReached('tasks')))
} else {
const message = getErrorMessage(error)
dispatch(notify(taskCloneFailed(task.name, message)))
}
}
}
开发者ID:influxdata,项目名称:influxdb,代码行数:17,代码来源:index.ts
注:本文中的src/shared/copy/notifications.resourceLimitReached函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论