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;
|
||||
}
|
||||
let repoID = this.props.repoID;
|
||||
let reg = /^-?\d+$/;
|
||||
let flag = reg.test(days);
|
||||
if (flag) {
|
||||
if (Number(days) > 0) {
|
||||
let message = gettext('Successfully set library history.');
|
||||
systemAdminAPI.sysAdminUpdateRepoHistorySetting(repoID, days).then(res => {
|
||||
systemAdminAPI.sysAdminUpdateRepoHistorySetting(repoID, parseInt(days)).then(res => {
|
||||
toaster.success(message);
|
||||
this.setState({ keepDays: res.data.keep_days });
|
||||
this.props.toggleDialog();
|
||||
|
@@ -4,10 +4,6 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.web-setting-icon-btn-submit {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.web-setting-icon-btn-cancel {
|
||||
color: #666;
|
||||
}
|
||||
|
@@ -4,6 +4,8 @@ import dayjs from 'dayjs';
|
||||
import Calendar from '@seafile/seafile-calendar';
|
||||
import DatePicker from '@seafile/seafile-calendar/lib/Picker';
|
||||
import { translateCalendar } from '../../../utils/date-format-utils';
|
||||
import 'dayjs/locale/zh-cn';
|
||||
import 'dayjs/locale/en-gb';
|
||||
|
||||
import '@seafile/seafile-calendar/assets/index.css';
|
||||
|
||||
@@ -13,12 +15,15 @@ class Picker extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.defaultCalendarValue = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
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() {
|
||||
|
@@ -4,6 +4,8 @@ import dayjs from 'dayjs';
|
||||
import Calendar from '@seafile/seafile-calendar';
|
||||
import DatePicker from '@seafile/seafile-calendar/lib/Picker';
|
||||
import { translateCalendar } from '../../../utils/date-format-utils';
|
||||
import 'dayjs/locale/zh-cn';
|
||||
import 'dayjs/locale/en-gb';
|
||||
|
||||
import '@seafile/seafile-calendar/assets/index.css';
|
||||
|
||||
@@ -13,12 +15,15 @@ class Picker extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.defaultCalendarValue = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
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() {
|
||||
|
@@ -104,7 +104,7 @@ class OrgsTraffic extends React.Component {
|
||||
resetPerPage = (newPerPage) => {
|
||||
this.setState({
|
||||
perPage: newPerPage,
|
||||
}, () => this.getTrafficList(this.initPage, this.initMonth));
|
||||
}, () => this.getTrafficList(this.initMonth, this.initPage));
|
||||
};
|
||||
|
||||
render() {
|
||||
|
Reference in New Issue
Block a user