mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-12 13:24:52 +00:00
Fix sys admin in no Pro version (#7336)
* fix repo history is less than 0 * fix setting button icon is green * fix admin statistic time lang * fix statistics traffic list when change page
This commit is contained in:
@@ -50,11 +50,9 @@ class SysAdminLibHistorySettingDialog extends React.Component {
|
|||||||
days = this.state.expireDays;
|
days = this.state.expireDays;
|
||||||
}
|
}
|
||||||
let repoID = this.props.repoID;
|
let repoID = this.props.repoID;
|
||||||
let reg = /^-?\d+$/;
|
if (Number(days) > 0) {
|
||||||
let flag = reg.test(days);
|
|
||||||
if (flag) {
|
|
||||||
let message = gettext('Successfully set library history.');
|
let message = gettext('Successfully set library history.');
|
||||||
systemAdminAPI.sysAdminUpdateRepoHistorySetting(repoID, days).then(res => {
|
systemAdminAPI.sysAdminUpdateRepoHistorySetting(repoID, parseInt(days)).then(res => {
|
||||||
toaster.success(message);
|
toaster.success(message);
|
||||||
this.setState({ keepDays: res.data.keep_days });
|
this.setState({ keepDays: res.data.keep_days });
|
||||||
this.props.toggleDialog();
|
this.props.toggleDialog();
|
||||||
|
@@ -4,10 +4,6 @@
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.web-setting-icon-btn-submit {
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
|
|
||||||
.web-setting-icon-btn-cancel {
|
.web-setting-icon-btn-cancel {
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,8 @@ import dayjs from 'dayjs';
|
|||||||
import Calendar from '@seafile/seafile-calendar';
|
import Calendar from '@seafile/seafile-calendar';
|
||||||
import DatePicker from '@seafile/seafile-calendar/lib/Picker';
|
import DatePicker from '@seafile/seafile-calendar/lib/Picker';
|
||||||
import { translateCalendar } from '../../../utils/date-format-utils';
|
import { translateCalendar } from '../../../utils/date-format-utils';
|
||||||
|
import 'dayjs/locale/zh-cn';
|
||||||
|
import 'dayjs/locale/en-gb';
|
||||||
|
|
||||||
import '@seafile/seafile-calendar/assets/index.css';
|
import '@seafile/seafile-calendar/assets/index.css';
|
||||||
|
|
||||||
@@ -13,12 +15,15 @@ class Picker extends React.Component {
|
|||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.defaultCalendarValue = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
let lang = window.app.config.lang;
|
let lang = window.app.config.lang;
|
||||||
this.defaultCalendarValue = dayjs().locale(lang).clone();
|
let now = dayjs();
|
||||||
|
const isZhcn = lang === 'zh-cn';
|
||||||
|
if (isZhcn) {
|
||||||
|
now = now.locale('zh-cn');
|
||||||
|
} else {
|
||||||
|
now = now.locale('en-gb');
|
||||||
|
}
|
||||||
|
this.defaultCalendarValue = now.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@@ -4,6 +4,8 @@ import dayjs from 'dayjs';
|
|||||||
import Calendar from '@seafile/seafile-calendar';
|
import Calendar from '@seafile/seafile-calendar';
|
||||||
import DatePicker from '@seafile/seafile-calendar/lib/Picker';
|
import DatePicker from '@seafile/seafile-calendar/lib/Picker';
|
||||||
import { translateCalendar } from '../../../utils/date-format-utils';
|
import { translateCalendar } from '../../../utils/date-format-utils';
|
||||||
|
import 'dayjs/locale/zh-cn';
|
||||||
|
import 'dayjs/locale/en-gb';
|
||||||
|
|
||||||
import '@seafile/seafile-calendar/assets/index.css';
|
import '@seafile/seafile-calendar/assets/index.css';
|
||||||
|
|
||||||
@@ -13,12 +15,15 @@ class Picker extends React.Component {
|
|||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.defaultCalendarValue = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
let lang = window.app.config.lang;
|
let lang = window.app.config.lang;
|
||||||
this.defaultCalendarValue = dayjs().locale(lang).clone();
|
let now = dayjs();
|
||||||
|
const isZhcn = lang === 'zh-cn';
|
||||||
|
if (isZhcn) {
|
||||||
|
now = now.locale('zh-cn');
|
||||||
|
} else {
|
||||||
|
now = now.locale('en-gb');
|
||||||
|
}
|
||||||
|
this.defaultCalendarValue = now.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@@ -104,7 +104,7 @@ class OrgsTraffic extends React.Component {
|
|||||||
resetPerPage = (newPerPage) => {
|
resetPerPage = (newPerPage) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
perPage: newPerPage,
|
perPage: newPerPage,
|
||||||
}, () => this.getTrafficList(this.initPage, this.initMonth));
|
}, () => this.getTrafficList(this.initMonth, this.initPage));
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
Reference in New Issue
Block a user