1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-26 15:26:19 +00:00

change error page tip (#7915)

This commit is contained in:
Michael An
2025-06-10 18:02:01 +08:00
committed by GitHub
parent 39f092982e
commit 1c0689d187
13 changed files with 61 additions and 67 deletions

View File

@@ -25,10 +25,6 @@
width: 120px;
}
.error-tip {
color: red;
}
.statistic-traffic-tab {
display: flex;
font-size: 13px;

View File

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import cookie from 'react-cookies';
import classnames from 'classnames';
import { navigate } from '@gatsbyjs/reach-router';
import { gettext, siteRoot, username } from '../../utils/constants';
import { gettext, siteRoot, username, mediaUrl } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api';
import { Utils } from '../../utils/utils';
import Loading from '../../components/loading';
@@ -335,28 +335,28 @@ class GroupView extends React.Component {
className={classnames('cur-view-content', 'd-block', 'repos-container', { 'pt-3': currentViewMode != LIST_MODE })}
onScroll={this.handleScroll}
>
{isLoading
? <Loading />
: errMessage
? <p className="error text-center mt-2">{errMessage}</p>
: repoList.length == 0
? emptyTip
: (
<SharedRepoListView
repoList={this.state.repoList}
hasNextPage={this.state.hasNextPage}
currentGroup={this.state.currentGroup}
sortBy={this.state.sortBy}
sortOrder={this.state.sortOrder}
sortItems={this.sortItems}
onItemUnshare={this.onItemUnshare}
onItemDelete={this.onItemDelete}
onItemRename={this.onItemRename}
onMonitorRepo={this.onMonitorRepo}
onTransferRepo={this.onItemTransfer}
currentViewMode={currentViewMode}
/>
)
{isLoading ? <Loading /> : errMessage ?
<div className="w-100 h-100 d-flex flex-column align-items-center justify-content-center text-center">
<img src={`${mediaUrl}img/error-tip.png`} alt="" width="100" />
<p className="mt-2">{errMessage}</p>
</div>
: repoList.length == 0
? emptyTip
:
<SharedRepoListView
repoList={this.state.repoList}
hasNextPage={this.state.hasNextPage}
currentGroup={this.state.currentGroup}
sortBy={this.state.sortBy}
sortOrder={this.state.sortOrder}
sortItems={this.sortItems}
onItemUnshare={this.onItemUnshare}
onItemDelete={this.onItemDelete}
onItemRename={this.onItemRename}
onMonitorRepo={this.onMonitorRepo}
onTransferRepo={this.onItemTransfer}
currentViewMode={currentViewMode}
/>
}
</div>
</div>

View File

@@ -3,7 +3,7 @@ import { DropdownItem } from 'reactstrap';
import PropTypes from 'prop-types';
import dayjs from 'dayjs';
import classnames from 'classnames';
import { gettext } from '../../utils/constants';
import { gettext, mediaUrl } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import { seafileAPI } from '../../utils/seafile-api';
import SingleDropdownToolbar from '../../components/toolbar/single-dropdown-toolbar';
@@ -172,7 +172,12 @@ class Content extends Component {
}
if (errorMsg) {
return <p className="error text-center mt-2">{errorMsg}</p>;
return (
<div className="w-100 h-100 d-flex flex-column align-items-center justify-content-center text-center">
<img src={`${mediaUrl}img/error-tip.png`} alt="" width="100" />
<p className="mt-2">{errorMsg}</p>
</div>
);
}
if (!invitationsList.length) {

View File

@@ -2,7 +2,7 @@ import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { Link } from '@gatsbyjs/reach-router';
import { orgAdminAPI } from '../../utils/org-admin-api';
import { gettext, siteRoot } from '../../utils/constants';
import { gettext, siteRoot, mediaUrl } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import Loading from '../../components/loading';
import OrgAdminGroupNav from '../../components/org-admin-group-nav';
@@ -65,7 +65,12 @@ class Content extends Component {
return <Loading />;
}
if (errorMsg) {
return <p className="error text-center mt-2">{errorMsg}</p>;
return (
<div className="w-100 h-100 d-flex flex-column align-items-center justify-content-center text-center">
<img src={`${mediaUrl}img/error-tip.png`} alt="" width="100" />
<p className="mt-2">{errorMsg}</p>
</div>
);
}
return (

View File

@@ -2,7 +2,7 @@ import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { Link } from '@gatsbyjs/reach-router';
import { orgAdminAPI } from '../../utils/org-admin-api';
import { gettext, siteRoot } from '../../utils/constants';
import { gettext, siteRoot, mediaUrl } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import Loading from '../../components/loading';
import OrgAdminGroupNav from '../../components/org-admin-group-nav';
@@ -69,7 +69,12 @@ class Content extends Component {
return <Loading />;
}
if (errorMsg) {
return <p className="error text-center mt-2">{errorMsg}</p>;
return (
<div className="w-100 h-100 d-flex flex-column align-items-center justify-content-center text-center">
<img src={`${mediaUrl}img/error-tip.png`} alt="" width="100" />
<p className="mt-2">{errorMsg}</p>
</div>
);
}
return (

View File

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import classnames from 'classnames';
import { Link } from '@gatsbyjs/reach-router';
import { orgAdminAPI } from '../../utils/org-admin-api';
import { gettext, siteRoot } from '../../utils/constants';
import { gettext, siteRoot, mediaUrl } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import Loading from '../../components/loading';
import toaster from '../../components/toast';
@@ -72,7 +72,12 @@ class Content extends Component {
return <Loading />;
}
if (errorMsg) {
return <p className="error text-center mt-2">{errorMsg}</p>;
return (
<div className="w-100 h-100 d-flex flex-column align-items-center justify-content-center text-center">
<img src={`${mediaUrl}img/error-tip.png`} alt="" width="100" />
<p className="mt-2">{errorMsg}</p>
</div>
);
}
return (

View File

@@ -336,7 +336,6 @@ img {
margin: 0;
}
body,
input,
textarea,
button,
@@ -680,17 +679,7 @@ table img {
}
.error {
color: red;
}
.errorlist {
color: red;
padding: 0;
}
.error-tip {
text-align: center;
margin-top: 5em;
color: #212529;
}
.ovhd {
@@ -1416,7 +1405,7 @@ textarea:-moz-placeholder {
padding: 5px;
background: #FDF;
margin: 0;
color: #000;
color: #212529;
}
/**** narrow-panel ****/
@@ -3004,8 +2993,3 @@ a.sf-popover-item {
margin-right: 2px;
background-color: #DBDBDB;
}
.unable-view-file-tip {
margin-top: 20px;
font-size: 1.125rem;
}

View File

@@ -309,7 +309,7 @@ a, a:hover {
}
.error {
color: red;
color: #212529;
}
.no-deco,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -1,8 +1,9 @@
{% extends "base.html" %}
{% load i18n %}
{% block main_panel %}
<div class="text-panel">
{% block main_content %}
<div class="w-100 h-100 d-flex flex-column align-items-center justify-content-center text-center">
<img src="{{MEDIA_URL}}img/error-tip.png" alt="" width="100" />
<p>{% trans "Sorry, but the requested page could not be found." %}</p>
</div>
{% endblock %}

View File

@@ -1,15 +1,13 @@
{% extends 'base.html' %}
{% block main_content %}
<div class="text-panel">
{% if unable_view_file %}
<img src="{{MEDIA_URL}}img/failed-to-view-file.png" alt="" width="100" />
<p class="unable-view-file-tip">{{ error_msg }}</p>
{% elif organization_inactive %}
<div class="w-100 h-100 d-flex flex-column align-items-center justify-content-center text-center">
{% if organization_inactive %}
<img src="{{MEDIA_URL}}img/organization-inactive.png" alt="" width="100" />
<p>{{ error_msg }}</p>
{% else %}
<p class="error">{{ error_msg }}</p>
<img src="{{MEDIA_URL}}img/error-tip.png" alt="" width="100" />
<p>{{ error_msg }}</p>
{% endif %}
</div>
{% endblock %}

View File

@@ -157,10 +157,8 @@ FILEEXT_TYPE_MAP = gen_fileext_type_map()
def render_permission_error(request, msg=None, extra_ctx=None):
"""
Return permisson error page.
"""
ctx = {}
ctx['unable_view_file'] = msg == _('Unable to view file')
ctx['error_msg'] = msg or _('permission error')
if extra_ctx:
@@ -172,10 +170,8 @@ def render_permission_error(request, msg=None, extra_ctx=None):
def render_error(request, msg=None, extra_ctx=None):
"""
Return normal error page.
"""
ctx = {}
ctx['unable_view_file'] = msg == _('Unable to view file')
ctx['error_msg'] = msg or _('Internal Server Error')
if extra_ctx:
@@ -187,7 +183,6 @@ def render_error(request, msg=None, extra_ctx=None):
def list_to_string(l):
"""
Return string of a list.
"""
return ','.join(l)