feat(ui/admin): add reindex button
This commit is contained in:
parent
48b0ff2df0
commit
349eec92c0
3 changed files with 21 additions and 19 deletions
|
@ -268,20 +268,6 @@ export class UserForm extends React.Component<
|
||||||
|
|
||||||
<div className="hr"></div>
|
<div className="hr"></div>
|
||||||
|
|
||||||
<div>
|
|
||||||
<Flexbox
|
|
||||||
children={List([
|
|
||||||
<span>{this.props.msg.pkg.get("action.reindex.desc")}</span>,
|
|
||||||
<button className="button-default" onClick={resetUsedSpace}>
|
|
||||||
{this.props.msg.pkg.get("action.reindex")}
|
|
||||||
</button>,
|
|
||||||
])}
|
|
||||||
childrenStyles={List([{}, { justifyContent: "flex-end" }])}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="hr"></div>
|
|
||||||
|
|
||||||
<Flexbox
|
<Flexbox
|
||||||
className="margin-t-m"
|
className="margin-t-m"
|
||||||
children={List([
|
children={List([
|
||||||
|
@ -505,10 +491,6 @@ export class AdminPane extends React.Component<Props, State, {}> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
reindex = async () => {
|
|
||||||
return updater().reindex();
|
|
||||||
}
|
|
||||||
|
|
||||||
addUser = async () => {
|
addUser = async () => {
|
||||||
if (this.state.newUserPwd1 !== this.state.newUserPwd2) {
|
if (this.state.newUserPwd1 !== this.state.newUserPwd2) {
|
||||||
Env().alertMsg(this.props.msg.pkg.get("settings.pwd.notSame"));
|
Env().alertMsg(this.props.msg.pkg.get("settings.pwd.notSame"));
|
||||||
|
@ -876,6 +858,13 @@ export class SiteCfg extends React.Component<SiteCfgProps, SiteCfgState, {}> {
|
||||||
this.props.update(updater().updateUI);
|
this.props.update(updater().updateUI);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
reindex = async () => {
|
||||||
|
if (!Env().confirmMsg(this.props.msg.pkg.get("action.reindex.confirm"))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return updater().reindex();
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -1050,6 +1039,17 @@ export class SiteCfg extends React.Component<SiteCfgProps, SiteCfgState, {}> {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="hr"></div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div className="label">
|
||||||
|
{this.props.msg.pkg.get("action.reindex.desc")}
|
||||||
|
</div>
|
||||||
|
<button className="button-default" onClick={this.reindex}>
|
||||||
|
{this.props.msg.pkg.get("action.reindex")}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,5 +160,6 @@ export const msgs: Map<string, string> = Map({
|
||||||
"action.go": "Go",
|
"action.go": "Go",
|
||||||
"hint.keywords": "Please input keyword(s), separated by spaces",
|
"hint.keywords": "Please input keyword(s), separated by spaces",
|
||||||
"action.reindex": "Reindex",
|
"action.reindex": "Reindex",
|
||||||
"action.reindex.desc": "Reconstruct the searching index",
|
"action.reindex.desc": "Reconstruct the search index",
|
||||||
|
"action.reindex.confirm": "If there are a lot of files and folders, rebuilding index may take some time.",
|
||||||
});
|
});
|
||||||
|
|
|
@ -158,4 +158,5 @@ export const msgs: Map<string, string> = Map({
|
||||||
"hint.keywords": "请输入关键字,以空格分隔",
|
"hint.keywords": "请输入关键字,以空格分隔",
|
||||||
"action.reindex": "重新索引",
|
"action.reindex": "重新索引",
|
||||||
"action.reindex.desc": "重新建立搜索索引",
|
"action.reindex.desc": "重新建立搜索索引",
|
||||||
|
"action.reindex.confirm": "当文件数量较多,重新建立索引将可能花费一些时间",
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue