显示没有任何资源的仪表板

时间:2018-12-17 16:01:09

标签: react-admin

如果用户无权显示react-admin的资源,则他无法登录,并且显示以下消息:

React-admin is properly configured.
Now you can add a first <Resource> as child of <Admin>

我们如何显示没有资源的登录页面和仪表板?

const App = ({ classes }) => (
    <React.Fragment>
        <Admin
            locale="fr"
            i18nProvider={i18nProvider}
            customReducers={{ reducer, theme: themeReducer }}
            customRoutes={customRoutes}
            appLayout={MyLayout}
            authProvider={authProvider}
            dashboard={Dashboard}
            loginPage={MyLoginForm}
            dataProvider={dataProvider}
        >
            {permissions => [

                hasRight(permissions, 'resource') ?
                    <Resource name="Myresource"
                        list={MyresourceList}
                        show={hasRight(permissions, 'show') ? MyresourceShow : null}
                        create={hasRight(permissions, 'create') ? MyresourceCreate : null}
                        edit={hasRight(permissions, 'edit') ? MyresourceEdit : null}
                        />
                    : null,

            ]}

        </Admin>
    </React.Fragment>
)

1 个答案:

答案 0 :(得分:0)

当然,此消息应仅用于调试。 我在React Admin上打开了一个问题:https://github.com/marmelab/react-admin/issues/2749

同时,您可以在呈现Admin组件之前复制在double phase = mPhase; __m128d v_pB = _mm_setr_pd(0.0, pB[0]); v_pB = _mm_mul_pd(v_pB, v_radiansPerSampleBp0); __m128d v_pC = _mm_setr_pd(0.0, pC[0]); v_pC = _mm_mul_pd(v_pC, v_radiansPerSample); __m128d v_pB_prev = _mm_setr_pd(0.0, 0.0); v_pB_prev = _mm_mul_pd(v_pB_prev, v_radiansPerSampleBp0); __m128d v_pC_prev = _mm_setr_pd(0.0, 0.0); v_pC_prev = _mm_mul_pd(v_pC_prev, v_radiansPerSample); __m128d v_phaseAcc1; __m128d v_phaseAcc2; __m128d v_phase = _mm_set1_pd(phase); // phase v_phaseAcc1 = _mm_add_pd(v_pB, v_pC); v_phaseAcc1 = _mm_max_pd(v_phaseAcc1, v_boundLower); v_phaseAcc1 = _mm_min_pd(v_phaseAcc1, v_boundUpper); v_phaseAcc2 = _mm_add_pd(v_pB_prev, v_pC_prev); v_phaseAcc2 = _mm_max_pd(v_phaseAcc2, v_boundLower); v_phaseAcc2 = _mm_min_pd(v_phaseAcc2, v_boundUpper); v_phase = _mm_add_pd(v_phase, v_phaseAcc1); v_phase = _mm_add_pd(v_phase, v_phaseAcc2); for (int sampleIndex = 0; sampleIndex < blockSize; sampleIndex += 2, pB += 2, pC += 2) { // code that will use v_phase // phase increment v_pB = _mm_loadu_pd(pB + 1); v_pB = _mm_mul_pd(v_pB, v_radiansPerSampleBp0); v_pC = _mm_loadu_pd(pC + 1); v_pC = _mm_mul_pd(v_pC, v_radiansPerSample); v_pB_prev = _mm_load_pd(pB); v_pB_prev = _mm_mul_pd(v_pB_prev, v_radiansPerSampleBp0); v_pC_prev = _mm_load_pd(pC); v_pC_prev = _mm_mul_pd(v_pC_prev, v_radiansPerSample); v_phaseAcc1 = _mm_add_pd(v_pB, v_pC); v_phaseAcc1 = _mm_max_pd(v_phaseAcc1, v_boundLower); v_phaseAcc1 = _mm_min_pd(v_phaseAcc1, v_boundUpper); v_phaseAcc2 = _mm_add_pd(v_pB_prev, v_pC_prev); v_phaseAcc2 = _mm_max_pd(v_phaseAcc2, v_boundLower); v_phaseAcc2 = _mm_min_pd(v_phaseAcc2, v_boundUpper); v_phase = _mm_add_pd(v_phase, v_phaseAcc1); v_phase = _mm_add_pd(v_phase, v_phaseAcc2); } // cleanup code if (blockSize % 2 == 0) { mPhase = v_phase.m128d_f64[0]; } else { ??? if odd? } 中完成的检查。

authProvider