mirror of https://github.com/casbin/casnode.git
fix: submit when uploading img cause img failure (#529)
* fix: submit when uploading img cause img failure
* Revert "fix: submit when uploading img cause img failure"
This reverts commit b951f79153
.
* fix: submit when uploading img cause img failure
* fix
* fix
* format
This commit is contained in:
parent
f62f30e8dc
commit
1b92c06349
|
@ -358,3 +358,7 @@ export function getThemeBtnUrl() {
|
|||
|
||||
return getStatic(`/img/toggle-${themeMode}.png`);
|
||||
}
|
||||
|
||||
export function isFileUploading(value) {
|
||||
return value !== undefined && value.includes("![Uploading file...]()");
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ class AdminFrontConf extends React.Component {
|
|||
justifyContent: "space-between",
|
||||
}}
|
||||
>
|
||||
<button onClick={this.updateConf.bind(this)} type="submit" className="super normal button">
|
||||
<button onClick={this.updateConf.bind(this)} type="submit" disabled={Setting.isFileUploading(this.state.content)} className="super normal button">
|
||||
<li className={this.state.publishClicked ? "fa fa-circle-o-notch fa-spin" : "fa fa-paper-plane"} />
|
||||
{this.state.publishClicked ? i18next.t("new:Publishing...") : i18next.t("frontConf:Save")}
|
||||
</button>
|
||||
|
|
|
@ -824,7 +824,7 @@ class AdminNode extends React.Component {
|
|||
<tr>
|
||||
<td width="120" align="right"></td>
|
||||
<td width="auto" align="left">
|
||||
{!newNode ? <input type="submit" className="super normal button" value={i18next.t("node:Save")} onClick={() => this.updateNodeInfo()} /> : null}
|
||||
{!newNode ? <input type="submit" disabled={Setting.isFileUploading(this.state.form.desc)} className="super normal button" value={i18next.t("node:Save")} onClick={() => this.updateNodeInfo()} /> : null}
|
||||
</td>
|
||||
</tr>
|
||||
{newNode ? (
|
||||
|
|
|
@ -281,7 +281,7 @@ class EditBox extends React.Component {
|
|||
<tr>
|
||||
<td style={{display: "flex", justifyContent: "space-between"}}>
|
||||
<div>
|
||||
<input type="submit" value={i18next.t("edit:Save")} className="super normal button" onClick={() => this.editContent()} />
|
||||
<input type="submit" value={i18next.t("edit:Save")} disabled={Setting.isFileUploading(this.state.form.content)} className="super normal button" onClick={() => this.editContent()} />
|
||||
</div>
|
||||
{this.renderEditorSelect()}
|
||||
</td>
|
||||
|
@ -334,7 +334,7 @@ class EditBox extends React.Component {
|
|||
/>
|
||||
<td style={{display: "flex", justifyContent: "space-between"}}>
|
||||
<div>
|
||||
<input type="submit" value={i18next.t("edit:Save")} className="super normal button" onClick={() => this.editContent()} />
|
||||
<input type="submit" value={i18next.t("edit:Save")} disabled={Setting.isFileUploading(this.state.form.content)} className="super normal button" onClick={() => this.editContent()} />
|
||||
</div>
|
||||
{this.renderEditorSelect()}
|
||||
</td>
|
||||
|
|
|
@ -395,7 +395,7 @@ class NewBox extends React.Component {
|
|||
<div className="cell">
|
||||
<div className="fr">
|
||||
<span id="error_message" />
|
||||
<button type="button" className="super normal button" onClick={this.publishTopic.bind(this)}>
|
||||
<button type="button" disabled={Setting.isFileUploading(this.state.form.body)} className="super normal button" onClick={this.publishTopic.bind(this)}>
|
||||
<li className={this.state.publishClicked ? "fa fa-circle-o-notch fa-spin" : "fa fa-paper-plane"} />
|
||||
{this.state.publishClicked ? i18next.t("new:Publishing...") : i18next.t("new:Publish")}
|
||||
</button>
|
||||
|
|
|
@ -465,7 +465,7 @@ class NewNodeTopicBox extends React.Component {
|
|||
{i18next.t("newNodeTopic:Preview")}{" "}
|
||||
</button>{" "}
|
||||
|
||||
<button type="submit" className="super normal button" onClick={this.publishTopic.bind(this)}>
|
||||
<button type="submit" disabled={Setting.isFileUploading(this.state.form.body)} className="super normal button" onClick={this.publishTopic.bind(this)}>
|
||||
<li className="fa fa-paper-plane"></li>
|
||||
|
||||
{i18next.t("newNodeTopic:Publish")}{" "}
|
||||
|
|
|
@ -427,7 +427,7 @@ class NewReplyBox extends React.Component {
|
|||
justifyContent: "space-between",
|
||||
}}
|
||||
>
|
||||
<button style={blurStyle} onClick={this.publishReply.bind(this)} type="submit" className="super normal button">
|
||||
<button style={blurStyle} onClick={this.publishReply.bind(this)} type="submit" disabled={Setting.isFileUploading(this.state.form.content)} className="super normal button">
|
||||
<li className={this.state.publishClicked ? "fa fa-circle-o-notch fa-spin" : "fa fa-paper-plane"} />
|
||||
{this.state.publishClicked ? i18next.t("new:Publishing...") : i18next.t("reply:Reply")}
|
||||
</button>
|
||||
|
|
Loading…
Reference in New Issue