mirror of https://github.com/casbin/casnode.git
Remove loading indicator.
This commit is contained in:
parent
2a5bd08a5e
commit
c6f1d1f2a5
|
@ -62,3 +62,5 @@ export const ReplyMobileMaxDepth = 3;
|
|||
export const AvatarAnonymousUrl =
|
||||
"https://cdn.casbin.com/avatar-pool/anonymous.png";
|
||||
export const AvatarErrorUrl = "https://cdn.casbin.com/avatar-pool/error.png";
|
||||
|
||||
export const ShowLoadingIndicator = false;
|
||||
|
|
|
@ -16,6 +16,7 @@ import React from "react";
|
|||
import * as Setting from "../Setting";
|
||||
import { withRouter, Link } from "react-router-dom";
|
||||
import i18next from "i18next";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
class AdminHomepage extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -124,6 +125,10 @@ class AdminHomepage extends React.Component {
|
|||
|
||||
render() {
|
||||
if (this.props.account === undefined) {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
|
|
|
@ -26,6 +26,7 @@ import Zmage from "react-zmage";
|
|||
import "../codemirrorSize.css";
|
||||
import Select2 from "react-select2-wrapper";
|
||||
import i18next from "i18next";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
class AdminNode extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -559,6 +560,10 @@ class AdminNode extends React.Component {
|
|||
if (this.state.nodeId !== undefined || newNode) {
|
||||
if (this.state.nodeId !== undefined) {
|
||||
if (this.state.nodeInfo !== null && this.state.nodeInfo.length === 0) {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
|
|
|
@ -19,6 +19,7 @@ import * as Setting from "../Setting";
|
|||
import Zmage from "react-zmage";
|
||||
import { SketchPicker } from "react-color";
|
||||
import i18next from "i18next";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
class AdminPlane extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -441,6 +442,10 @@ class AdminPlane extends React.Component {
|
|||
if (this.state.planeId !== undefined || newPlane) {
|
||||
if (this.state.planeId !== undefined) {
|
||||
if (this.state.plane !== null && this.state.plane.length === 0) {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
|
|
|
@ -18,6 +18,7 @@ import * as TabBackend from "../backend/TabBackend.js";
|
|||
import * as Setting from "../Setting";
|
||||
import Select2 from "react-select2-wrapper";
|
||||
import i18next from "i18next";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
class AdminTab extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -363,6 +364,10 @@ class AdminTab extends React.Component {
|
|||
if (this.state.tabId !== undefined || newTab) {
|
||||
if (this.state.tabId !== undefined) {
|
||||
if (this.state.tab !== null && this.state.tab.length === 0) {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
|
|
|
@ -21,6 +21,7 @@ import Collapse, { Panel } from "rc-collapse";
|
|||
import ReactMarkdown from "react-markdown";
|
||||
import Zmage from "react-zmage";
|
||||
import i18next from "i18next";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
class AdminTopic extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -668,6 +669,10 @@ class AdminTopic extends React.Component {
|
|||
render() {
|
||||
if (this.state.topicId !== undefined) {
|
||||
if (this.state.topic !== null && this.state.topic.length === 0) {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
// limitations under the License.
|
||||
|
||||
import React, { Suspense } from "react";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
export default class LazyLoad extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -24,6 +25,10 @@ export default class LazyLoad extends React.Component {
|
|||
|
||||
// edit this function to modify the loading style
|
||||
renderFallback() {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <div>loading...</div>;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import * as Tools from "./Tools";
|
|||
import i18next from "i18next";
|
||||
import Editor from "./richTextEditor";
|
||||
import Select2 from "react-select2-wrapper";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
const pangu = require("pangu");
|
||||
|
||||
|
@ -243,6 +244,10 @@ class EditBox extends React.Component {
|
|||
|
||||
render() {
|
||||
if (this.state.editObject !== null && this.state.editObject.length === 0) {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
|
|
|
@ -21,6 +21,7 @@ import { withRouter, Link } from "react-router-dom";
|
|||
import "../deopzone.css";
|
||||
import Dropzone from "react-dropzone";
|
||||
import i18next from "i18next";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
const browserImageSize = require("browser-image-size");
|
||||
|
||||
|
@ -657,6 +658,10 @@ class FilesBox extends React.Component {
|
|||
}
|
||||
|
||||
renderFileLoading() {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
|
|
|
@ -22,6 +22,7 @@ import AllCreatedTopicsBox from "./AllCreatedTopicsBox";
|
|||
import LatestReplyBox from "./LatestReplyBox";
|
||||
import i18next from "i18next";
|
||||
import { scoreConverter } from "./Tools";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
class MemberBox extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -126,6 +127,10 @@ class MemberBox extends React.Component {
|
|||
|
||||
renderMember() {
|
||||
if (this.state.member !== null && this.state.member.length === 0) {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
|
|
|
@ -19,6 +19,7 @@ import * as NodeBackend from "../backend/NodeBackend";
|
|||
import * as TopicBackend from "../backend/TopicBackend";
|
||||
import Select2 from "react-select2-wrapper";
|
||||
import i18next from "i18next";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
const pangu = require("pangu");
|
||||
|
||||
|
@ -100,6 +101,10 @@ class MoveTopicNodeBox extends React.Component {
|
|||
|
||||
render() {
|
||||
if (this.state.topic !== null && this.state.topic.length === 0) {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
|
|
|
@ -24,6 +24,7 @@ import NewNodeTopicBox from "./NewNodeTopicBox";
|
|||
import "../node.css";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import i18next from "i18next";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
class NodeBox extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -553,6 +554,10 @@ class NodeBox extends React.Component {
|
|||
const pcBrowser = Setting.PcBrowser;
|
||||
|
||||
if (this.state.nodeInfo !== null && this.state.nodeInfo.length === 0) {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div id={pcBrowser ? "Main" : ""}>
|
||||
<div className="box">
|
||||
|
|
|
@ -27,6 +27,7 @@ import Zmage from "react-zmage";
|
|||
import { Link } from "react-router-dom";
|
||||
import i18next from "i18next";
|
||||
import UserLink from "../UserLink";
|
||||
import * as Conf from "../Conf";
|
||||
|
||||
require("codemirror/mode/markdown/markdown");
|
||||
|
||||
|
@ -504,6 +505,10 @@ class TopicBox extends React.Component {
|
|||
this.props.account === undefined ||
|
||||
(this.state.topic !== null && this.state.topic.length === 0)
|
||||
) {
|
||||
if (!Conf.ShowLoadingIndicator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="box">
|
||||
<div className="header">
|
||||
|
|
Loading…
Reference in New Issue