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

Remove codes (#7309)

* remove-seafile-collab-server

* remove-enable-seafle-doc

* update
This commit is contained in:
Ranjiwei
2025-01-04 18:03:00 +08:00
committed by GitHub
parent f0ee34399b
commit 2733211cc9
17 changed files with 10 additions and 131 deletions

View File

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import ModalPortal from './modal-portal';
import { Link } from '@gatsbyjs/reach-router';
import { gettext, siteRoot, canInvitePeople, enableTC, sideNavFooterCustomHtml, showWechatSupportGroup,
isDocs, isPro, isDBSqlite3, customNavItems, mediaUrl, curNoteMsg, enableShowAbout } from '../utils/constants';
isPro, isDBSqlite3, customNavItems, mediaUrl, curNoteMsg, enableShowAbout } from '../utils/constants';
import { SIDE_PANEL_FOLDED_WIDTH, SUB_NAV_ITEM_HEIGHT } from '../constants';
import Tip from './side-nav-icon-tip';
import FilesSubNav from '../components/files-sub-nav';
@@ -110,7 +110,7 @@ class MainSideNavFolded extends React.Component {
};
render() {
let showActivity = isDocs || isPro || !isDBSqlite3;
let showActivity = isPro || !isDBSqlite3;
const { groupItems, isFilesSubNavShown } = this.state;
return (
<Fragment>

View File

@@ -6,7 +6,7 @@ import {
gettext, siteRoot, canAddGroup, canAddRepo, canShareRepo,
canGenerateShareLink, canGenerateUploadLink, canInvitePeople,
enableTC, sideNavFooterCustomHtml, enableShowAbout, showWechatSupportGroup,
canViewOrg, isDocs, isPro, isDBSqlite3, customNavItems, mediaUrl
canViewOrg, isPro, isDBSqlite3, customNavItems, mediaUrl
} from '../utils/constants';
import { seafileAPI } from '../utils/seafile-api';
import { Utils } from '../utils/utils';
@@ -224,7 +224,7 @@ class MainSideNav extends React.Component {
};
render() {
let showActivity = isDocs || isPro || !isDBSqlite3;
let showActivity = isPro || !isDBSqlite3;
const { filesNavUnfolded, groupItems } = this.state;
return (
<Fragment>

View File

@@ -10,7 +10,6 @@ import { navigate } from '@gatsbyjs/reach-router';
import { gettext, siteRoot, username } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api';
import { Utils } from '../../utils/utils';
import collabServer from '../../utils/collab-server';
import { Dirent, FileTag, RepoTag, RepoInfo } from '../../models';
import TreeNode from '../../components/tree-view/tree-node';
import treeHelper from '../../components/tree-view/tree-helper';
@@ -254,7 +253,6 @@ class LibContentView extends React.Component {
componentWillUnmount() {
window.onpopstate = this.oldonpopstate;
collabServer.unwatchRepo(this.props.repoID, this.onRepoUpdateEvent);
this.unsubscribeEvent();
this.unsubscribeEventBus && this.unsubscribeEventBus();
this.props.eventBus.dispatch(EVENT_BUS_TYPE.CURRENT_LIBRARY_CHANGED, {
@@ -393,11 +391,6 @@ class LibContentView extends React.Component {
// load data
loadDirData = (path) => {
let repoID = this.props.repoID;
// listen current repo
collabServer.watchRepo(repoID, this.onRepoUpdateEvent);
// list used FileTags
this.updateUsedRepoTags();

View File

@@ -4,7 +4,6 @@ import { EXTERNAL_EVENTS, EventBus } from '@seafile/seafile-editor';
import { gettext, canGenerateShareLink, isPro, mediaUrl, canLockUnlockFile } from '../../../utils/constants';
import ButtonGroup from './button-group';
import ButtonItem from './button-item';
import CollabUsersButton from './collab-users-button';
import MoreMenu from './more-menu';
import FileInfo from './file-info';
import Icon from '../../../components/icon';
@@ -16,7 +15,6 @@ import Dirent from '../../../../src/models/dirent';
import '../css/header-toolbar.css';
const { seafileCollabServer } = window.app.config;
const { canDownloadFile, repoID, filePath, isRepoAdmin } = window.app.pageOptions;
const propTypes = {
@@ -140,13 +138,6 @@ class HeaderToolbar extends React.Component {
isStarred={this.props.fileInfo.isStarred}
/>
<div className="topbar-btn-container">
{(seafileCollabServer && this.props.collabUsers.length > 0) &&
<CollabUsersButton
className="collab-users-dropdown"
users={this.props.collabUsers}
id="usersButton"
/>
}
<ButtonGroup>
{(canLockUnlockFile && !isLocked) && (
<ButtonItem
@@ -268,13 +259,6 @@ class HeaderToolbar extends React.Component {
<FileInfo toggleStar={this.props.toggleStar} editorApi={this.props.editorApi}
fileInfo={this.props.fileInfo}/>
<div className="topbar-btn-container">
{(seafileCollabServer && this.props.collabUsers.length > 0) &&
<CollabUsersButton
className="collab-users-dropdown"
users={this.props.collabUsers}
id="usersButton"
/>
}
<ButtonGroup>
{saving ?
<button type={'button'} className={'btn btn-icon btn-secondary btn-active'}>

View File

@@ -1,5 +1,4 @@
import React, { Fragment } from 'react';
import io from 'socket.io-client';
import {
EXTERNAL_EVENTS,
EventBus,
@@ -22,7 +21,7 @@ const CryptoJS = require('crypto-js');
const URL = require('url-parse');
const { repoID, filePath, fileName, isLocked, lockedByMe } = window.app.pageOptions;
const { siteRoot, serviceUrl, seafileCollabServer } = window.app.config;
const { siteRoot, serviceUrl } = window.app.config;
const userInfo = window.app.userInfo;
const IMAGE_SUFFIXES = ['png', 'PNG', 'jpg', 'JPG', 'jpeg', 'JPEG', 'gif', 'GIF'];
@@ -46,7 +45,6 @@ class MarkdownEditor extends React.Component {
id: '',
},
editorMode: 'rich',
collabServer: seafileCollabServer ? seafileCollabServer : null,
showMarkdownEditorDialog: false,
showShareLinkDialog: false,
showInsertFileDialog: false,
@@ -65,15 +63,6 @@ class MarkdownEditor extends React.Component {
this.timer = null;
if (this.state.collabServer) {
const socket = io(this.state.collabServer);
this.socket = socket;
socket.on('presence', (data) => this.receivePresenceData(data));
socket.on('repo_update', (data) => this.receiveUpdateData(data));
socket.on('connect', () => {
this.socket_id = socket.id;
});
}
this.editorRef = React.createRef();
this.isParticipant = false;
this.editorSelection = null;
@@ -92,18 +81,6 @@ class MarkdownEditor extends React.Component {
}
};
emitSwitchEditor = (is_editing = false) => {
if (userInfo && this.state.collabServer) {
const { repoID, path } = this.state.fileInfo;
this.socket.emit('presence', {
request: 'editing',
doc_id: CryptoJS.MD5(repoID + path).toString(),
user: userInfo,
is_editing,
});
}
};
receiveUpdateData(data) {
let currentTime = new Date();
if ((parseFloat(currentTime - this.lastModifyTime) / 1000) <= 5) {

View File

@@ -22,7 +22,6 @@ const propTypes = {
};
const { repoID, filePath, fileName, isLocked, lockedByMe } = window.app.pageOptions;
const { seafileCollabServer } = window.app.config;
const userInfo = window.app.userInfo;
const initOptions = {
@@ -41,7 +40,6 @@ const initOptions = {
id: '',
},
editorMode: 'plain',
collabServer: seafileCollabServer ? seafileCollabServer : null,
showMarkdownEditorDialog: false,
showShareLinkDialog: false,
showInsertFileDialog: false,

View File

@@ -1,43 +0,0 @@
import io from 'socket.io-client';
import { name, username, contactEmail, seafileCollabServer } from './constants';
const socket = (seafileCollabServer !== '') ? io(seafileCollabServer) : undefined;
class CollabServer {
watchRepo(repoID, fn) {
if (!socket) {
return;
}
socket.emit('repo_update', {
request: 'watch_update',
repo_id: repoID,
user: {
name: name,
username: username,
contact_email: contactEmail,
},
});
socket.on('repo_update', fn);
}
unwatchRepo(repoID, fn) {
if (!socket) {
return;
}
socket.emit('repo_update', {
request: 'unwatch_update',
repo_id: repoID,
user: {
name: name,
username: username,
contact_email: contactEmail,
},
});
socket.off('repo_update', fn);
}
}
const collabServer = new CollabServer();
export default collabServer;

View File

@@ -19,7 +19,6 @@ export const logoWidth = window.app.config.logoWidth;
export const logoHeight = window.app.config.logoHeight;
export const isPro = window.app.config.isPro === 'True';
export const isDBSqlite3 = window.app.config.isDBSqlite3;
export const isDocs = window.app.config.isDocs === 'True';
export const lang = window.app.config.lang;
export const fileServerRoot = window.app.config.fileServerRoot;
export const useGoFileserver = window.app.config.useGoFileserver;
@@ -32,7 +31,6 @@ export const enableRepoAutoDel = window.app.config.enableRepoAutoDel;
// pageOptions
export const trashReposExpireDays = window.app.pageOptions.trashReposExpireDays;
export const seafileCollabServer = window.app.pageOptions.seafileCollabServer;
export const name = window.app.pageOptions.name;
export const contactEmail = window.app.pageOptions.contactEmail;
export const username = window.app.pageOptions.username;

View File

@@ -22,7 +22,7 @@ from seahub.settings import SEAFILE_VERSION, SITE_DESCRIPTION, \
SHOW_REPO_DOWNLOAD_BUTTON, SITE_ROOT, ENABLE_GUEST_INVITATION, \
FAVICON_PATH, APPLE_TOUCH_ICON_PATH, THUMBNAIL_SIZE_FOR_ORIGINAL, \
MEDIA_ROOT, SHOW_LOGOUT_ICON, CUSTOM_LOGO_PATH, CUSTOM_FAVICON_PATH, \
ENABLE_SEAFILE_DOCS, LOGIN_BG_IMAGE_PATH, THUMBNAIL_DEFAULT_SIZE, \
LOGIN_BG_IMAGE_PATH, THUMBNAIL_DEFAULT_SIZE, \
CUSTOM_LOGIN_BG_PATH, ENABLE_SHARE_LINK_REPORT_ABUSE, \
PRIVACY_POLICY_LINK, TERMS_OF_SERVICE_LINK, ENABLE_SEADOC, THUMBNAIL_SIZE_FOR_GRID, \
FILE_SERVER_ROOT, ENABLE_WHITEBOARD, ENABLE_SEAFILE_AI
@@ -162,7 +162,6 @@ def base(request):
'show_logout_icon': SHOW_LOGOUT_ICON,
'is_pro': True if is_pro_version() else False,
'is_db_sqlite3': IS_DB_SQLITE3,
'is_docs': ENABLE_SEAFILE_DOCS,
'enable_upload_folder': dj_settings.ENABLE_UPLOAD_FOLDER,
'enable_resumable_fileupload': dj_settings.ENABLE_RESUMABLE_FILEUPLOAD,
'service_url': get_service_url().rstrip('/'),

View File

@@ -491,8 +491,6 @@ ENABLE_SHARE_TO_DEPARTMENT = True
# interval for request unread notifications
UNREAD_NOTIFICATIONS_REQUEST_INTERVAL = 3 * 60 # seconds
# Enable seafile docs
ENABLE_SEAFILE_DOCS = False
ENABLE_CONVERT_TO_TEAM_ACCOUNT = False
@@ -892,21 +890,7 @@ FILESERVER_TOKEN_ONCE_ONLY = True
SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER = True # Whether to send email when a system staff adding new member.
SEND_EMAIL_ON_RESETTING_USER_PASSWD = True # Whether to send email when a system staff resetting user's password.
##########################
# Settings for Extra App #
##########################
##########################
# Settings for frontend #
##########################
SEAFILE_COLLAB_SERVER = ''
##########################
# Settings for dtable web #
##########################
DTABLE_WEB_SERVER = ''
##########################
# Settings for seadoc #

View File

@@ -48,7 +48,6 @@
loginUrl: '{{ LOGIN_URL }}',
isPro: '{{ is_pro }}',
isDBSqlite3: {% if is_db_sqlite3 %} true {% else %} false {% endif %},
isDocs: '{{ is_docs }}',
lang: '{{ LANGUAGE_CODE }}',
fileServerRoot: '{{ FILE_SERVER_ROOT }}',
enableRepoAutoDel: {% if enable_repo_auto_del %} true {% else %} false {% endif %},
@@ -59,7 +58,6 @@
},
pageOptions: {
csrfToken: "{{ csrf_token }}",
seafileCollabServer: '{{seafile_collab_server}}',
name: "{{request.user.username|email2nickname|escapejs}}",
contactEmail: "{{request.user.username|email2contact_email|escapejs}}",
username: "{{request.user.username|escapejs}}",

View File

@@ -36,7 +36,6 @@ window.app.pageOptions = {
fileType: '{{ filetype }}',
parentDir: '{{ parent_dir|escapejs }}',
err: '{{ err }}',
seafileCollabServer: '{{seafile_collab_server}}',
contactEmail: "{{request.user.username|email2contact_email|escapejs}}",
lockedByMe: {% if locked_by_me %}true{% else %}false{% endif %},
canLockUnlockFile: {% if can_lock_unlock_file %}true{% else %}false{% endif %},

View File

@@ -31,9 +31,7 @@
siteRoot: '{{ SITE_ROOT }}',
serviceUrl: '{{ serviceUrl }}',
isPro: '{{ is_pro }}',
isDocs: '{{ is_docs }}',
lang: '{{ LANGUAGE_CODE }}',
seafileCollabServer: '{{ seafile_collab_server}}',
},
pageOptions: {
repoID: '{{ repo.id }}',

View File

@@ -31,9 +31,7 @@
siteRoot: '{{ SITE_ROOT }}',
serviceUrl: '{{ serviceUrl }}',
isPro: '{{ is_pro }}',
isDocs: '{{ is_docs }}',
lang: '{{ LANGUAGE_CODE }}',
seafileCollabServer: '{{ seafile_collab_server}}',
},
pageOptions: {
repoID: '{{ repo.id }}',

View File

@@ -56,9 +56,9 @@ from seahub.settings import AVATAR_FILE_STORAGE, ENABLE_REPO_SNAPSHOT_LABEL, \
SHARE_LINK_EXPIRE_DAYS_MIN, ENABLE_METADATA_MANAGEMENT, \
SHARE_LINK_EXPIRE_DAYS_MAX, SHARE_LINK_EXPIRE_DAYS_DEFAULT, \
UPLOAD_LINK_EXPIRE_DAYS_MIN, UPLOAD_LINK_EXPIRE_DAYS_MAX, UPLOAD_LINK_EXPIRE_DAYS_DEFAULT, \
SEAFILE_COLLAB_SERVER, ENABLE_RESET_ENCRYPTED_REPO_PASSWORD, \
ENABLE_RESET_ENCRYPTED_REPO_PASSWORD, \
ADDITIONAL_SHARE_DIALOG_NOTE, ADDITIONAL_ABOUT_DIALOG_LINKS, \
DTABLE_WEB_SERVER, SEADOC_SERVER_URL, SHOW_WECHAT_SUPPORT_GROUP
SEADOC_SERVER_URL, SHOW_WECHAT_SUPPORT_GROUP
from seahub.ocm.settings import ENABLE_OCM, OCM_REMOTE_SERVERS
from seahub.ocm_via_webdav.settings import ENABLE_OCM_VIA_WEBDAV
@@ -1112,7 +1112,6 @@ def react_fake_view(request, **kwargs):
"guide_enabled": guide_enabled,
'trash_repos_expire_days': expire_days if expire_days > 0 else 30,
'max_upload_file_size': max_upload_file_size,
'seafile_collab_server': SEAFILE_COLLAB_SERVER,
'storages': get_library_storages(request),
'library_templates': list(LIBRARY_TEMPLATES.keys()),
'enable_repo_snapshot_label': settings.ENABLE_REPO_SNAPSHOT_LABEL,

View File

@@ -85,7 +85,7 @@ if HAS_OFFICE_CONVERTER:
import seahub.settings as settings
from seahub.settings import FILE_ENCODING_LIST, FILE_PREVIEW_MAX_SIZE, \
FILE_ENCODING_TRY_LIST, MEDIA_URL, SEAFILE_COLLAB_SERVER, ENABLE_WATERMARK, \
FILE_ENCODING_TRY_LIST, MEDIA_URL, ENABLE_WATERMARK, \
SHARE_LINK_EXPIRE_DAYS_MIN, SHARE_LINK_EXPIRE_DAYS_MAX, SHARE_LINK_PASSWORD_MIN_LENGTH, \
SHARE_LINK_FORCE_USE_PASSWORD, SHARE_LINK_PASSWORD_STRENGTH_LEVEL, \
SHARE_LINK_EXPIRE_DAYS_DEFAULT, ENABLE_SHARE_LINK_REPORT_ABUSE, SEADOC_SERVER_URL, \
@@ -640,7 +640,6 @@ def view_lib_file(request, repo_id, path):
'share_link_expire_days_min': SHARE_LINK_EXPIRE_DAYS_MIN,
'share_link_expire_days_max': SHARE_LINK_EXPIRE_DAYS_MAX,
'can_download_file': parse_repo_perm(permission).can_download,
'seafile_collab_server': SEAFILE_COLLAB_SERVER,
'enable_metadata_management': ENABLE_METADATA_MANAGEMENT,
'file_download_url': gen_file_get_url_new(repo_id, path),
'mobile_login': mobile_login,
@@ -2237,7 +2236,6 @@ def view_sdoc_revision(request, repo_id, revision_id):
'share_link_expire_days_min': SHARE_LINK_EXPIRE_DAYS_MIN,
'share_link_expire_days_max': SHARE_LINK_EXPIRE_DAYS_MAX,
'can_download_file': parse_repo_perm(permission).can_download,
'seafile_collab_server': SEAFILE_COLLAB_SERVER,
'mobile_login': mobile_login,
}

View File

@@ -31,7 +31,7 @@ from seahub.settings import ENABLE_UPLOAD_FOLDER, \
ENABLE_RESUMABLE_FILEUPLOAD, ENABLE_VIDEO_THUMBNAIL, \
THUMBNAIL_ROOT, THUMBNAIL_DEFAULT_SIZE, THUMBNAIL_SIZE_FOR_GRID, \
MAX_NUMBER_OF_FILES_FOR_FILEUPLOAD, SHARE_LINK_EXPIRE_DAYS_MIN, \
SHARE_LINK_EXPIRE_DAYS_MAX, SEAFILE_COLLAB_SERVER, \
SHARE_LINK_EXPIRE_DAYS_MAX, \
ENABLE_SHARE_LINK_REPORT_ABUSE, ENABLE_PDF_THUMBNAIL
from seahub.utils.file_types import IMAGE, VIDEO, XMIND
from seahub.thumbnail.utils import get_share_link_thumbnail_src
@@ -235,7 +235,6 @@ def view_lib_as_wiki(request, repo_id, path):
user_can_write = False
return render(request, 'view_lib_as_wiki.html', {
'seafile_collab_server': SEAFILE_COLLAB_SERVER,
'repo_id': repo_id,
'service_url': get_service_url().rstrip('/'),
'initial_path': path,