mirror of
https://github.com/eyebluecn/tank-front
synced 2026-10-19 16:16:18 +00:00
preference recycle bin zero keep-day setting.
This commit is contained in:
@@ -223,7 +223,8 @@ let LangEn = {
|
||||
scanCustom: "Scan custom",
|
||||
chooseUsers: "Fuzzy search users",
|
||||
chooseUsersValidate: "choose one more user",
|
||||
scanLoading: "waiting..."
|
||||
scanLoading: "waiting...",
|
||||
matterBinDefaultTip: "set zero means to turn off the recycle bin"
|
||||
},
|
||||
share: {
|
||||
shareDetail: "Share Detail",
|
||||
|
||||
@@ -223,7 +223,8 @@ let LangZh = {
|
||||
scanCustom: "自定义",
|
||||
chooseUsers: "模糊搜索用户",
|
||||
chooseUsersValidate: "请选择至少一个用户",
|
||||
scanLoading: "扫描中,请稍后..."
|
||||
scanLoading: "扫描中,请稍后...",
|
||||
matterBinDefaultTip: "设置0表示关闭回收站功能"
|
||||
},
|
||||
share: {
|
||||
shareDetail: "分享详情",
|
||||
|
||||
@@ -62,6 +62,10 @@ export default class Preference extends BaseEntity {
|
||||
this.assignEntity("scanConfig", ScanConfig)
|
||||
}
|
||||
|
||||
getRecycleBinStatus() {
|
||||
return this.deletedKeepDays > 0
|
||||
}
|
||||
|
||||
getForm(): any {
|
||||
return {
|
||||
name: this.name,
|
||||
|
||||
@@ -91,6 +91,11 @@ export default class SideLayout extends TankComponent<IProps, IState> {
|
||||
mode="inline"
|
||||
>
|
||||
{menuItems.map((menuItem: MenuItem, index: number) => {
|
||||
if (
|
||||
menuItem.url === "/bin/list" &&
|
||||
!preference.getRecycleBinStatus()
|
||||
)
|
||||
return null;
|
||||
return (
|
||||
<Menu.Item key={menuItem.url}>
|
||||
{menuItem.icon}
|
||||
|
||||
@@ -2,10 +2,10 @@ import React from "react";
|
||||
import TankComponent from "../../../common/component/TankComponent";
|
||||
import { Modal, Button } from "antd";
|
||||
import Lang from "../../../common/model/global/Lang";
|
||||
import {
|
||||
ExclamationCircleFilled,
|
||||
} from "@ant-design/icons";
|
||||
import Moon from "../../../common/model/global/Moon";
|
||||
import { ExclamationCircleFilled } from "@ant-design/icons";
|
||||
import "./MatterDeleteModal.less";
|
||||
import Preference from "../../../common/model/preference/Preference";
|
||||
|
||||
interface IProps {
|
||||
onSoftDel: () => void;
|
||||
@@ -20,6 +20,8 @@ export default class MatterDeleteModal extends TankComponent<IProps, IState> {
|
||||
super(props);
|
||||
}
|
||||
|
||||
static preference: Preference = Moon.getSingleton().preference;
|
||||
|
||||
static open(onSoftDel: () => void, onHardDel: () => void) {
|
||||
let modal = Modal.warning({
|
||||
className: "delete-modal",
|
||||
@@ -55,12 +57,18 @@ export default class MatterDeleteModal extends TankComponent<IProps, IState> {
|
||||
<Button className="mr10" onClick={this.props.onClose}>
|
||||
{Lang.t("cancel")}
|
||||
</Button>
|
||||
<Button type="primary" danger className="mr10" onClick={this.props.onHardDel}>
|
||||
<Button
|
||||
type="primary"
|
||||
danger
|
||||
onClick={this.props.onHardDel}
|
||||
>
|
||||
{Lang.t("deleteDirectly")}
|
||||
</Button>
|
||||
<Button type="primary" onClick={this.props.onSoftDel}>
|
||||
{Lang.t("matter.intoRecycleBin")}
|
||||
</Button>
|
||||
{MatterDeleteModal.preference.getRecycleBinStatus() && (
|
||||
<Button type="primary" className="ml10" onClick={this.props.onSoftDel}>
|
||||
{Lang.t("matter.intoRecycleBin")}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -15,7 +15,6 @@ import MessageBoxUtil from "../../common/util/MessageBoxUtil";
|
||||
import Sun from "../../common/model/global/Sun";
|
||||
import Lang from "../../common/model/global/Lang";
|
||||
import MatterImage from "../matter/widget/MatterImage";
|
||||
import PreviewConfigPanel from "./widget/PreviewConfigPanel";
|
||||
|
||||
interface IProps extends RouteComponentProps {
|
||||
}
|
||||
@@ -214,8 +213,11 @@ export default class Edit extends TankComponent<IProps, IState> {
|
||||
]}
|
||||
noStyle
|
||||
>
|
||||
<InputNumber min={1} className="w150" />
|
||||
<InputNumber min={0} className="w150" />
|
||||
</Form.Item>
|
||||
<span className="pl10">
|
||||
{Lang.t("preference.matterBinDefaultTip")}
|
||||
</span>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
|
||||
Reference in New Issue
Block a user