> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/zh-cn/yong-hu-he-xiang-mu-guan-li/project-management.md).

# 项目管理

### 查看项目审计日志

管理员可以查看一份 **审计日志** ，适用于每个项目。此审计日志会显示诸如链接共享在私有/基于令牌之间发生更改、邀请被发送/接受以及用户使用令牌加入项目等事件。管理员可以通过以下方式按项目查看这些日志： **您的实例** -> **管理员** -> **管理用户** 然后：

* 搜索该用户
* 点击 **项目** 选项卡
* 选择一个项目
* 点击 (i) 图标
* 点击 **审计日志** 选项卡

如果项目与某个指定协作者（使用其电子邮件地址）共享，一旦收件人加入，他们将会连同其权限一起列在共享弹窗中，并且项目所有者可见。通过管理面板在该项目的“项目信息”选项卡中查看时，管理员也会看到这些信息。

### 恢复已删除的文档

1. 使用您的管理员凭据登录
2. 点击 **管理员** 并选择 **管理用户**
3. 使用搜索字段输入您想为其恢复文档的用户电子邮件地址
4. 点击返回结果列表中的其电子邮件地址，打开其用户信息页面
5. 点击 **项目** 选项卡，并使用搜索字段搜索该项目
6. 点击项目名称旁的信息图标，打开 **项目信息**
7. 点击 **已删除的文档** 选项卡
8. 点击 **恢复** 按钮，将已删除的文档恢复到用户的项目中。

恢复后的文件将采用以下格式： `文件名-时间戳.扩展名`。例如，恢复版本的 `main.tex` 将恢复到项目根目录，文件名为 `main-2024-02-23-130441542.tex`.

### 转移项目所有权

Server Pro 中的管理面板为每个项目都有一个专用页面。您可以先在“/admin/user”中搜索用户，然后进入其 **项目** 选项卡，找到列表中的项目并点击信息图标；或者直接通过已知的项目 ID 导航到该页面 [**https://your-instance-url/admin/project/**](https://your-instance-url/admin/project/)。在项目信息页面中，您可以找到一个 **转移所有权** 按钮，点击后会打开一个弹窗，您可以在其中指定任意用户作为新所有者。新所有者不需要是该项目的现有协作者。

{% hint style="info" %}
请注意，在所有权转移过程中，前所有者将被添加为该项目的协作者，并拥有读写权限。
{% endhint %}

### 更新项目编译超时

项目的默认编译超时目前设置为 180 秒。可以更改此值，但需要两步操作。

首先，编辑 **config/variables.env** 文件并添加 `COMPILE_TIMEOUT`环境变量，并将其值设置为所需的超时时间（秒）。例如， `COMPILE_TIMEOUT=300` 表示 5 分钟。

{% hint style="danger" %}
将超时时间推到 10 分钟以上并不值得。如果这样做，您很可能会在应用程序的其他组件中遇到超时。
{% endhint %}

完成此更改后，您需要重新创建 **sharelatex** 容器，方法是运行 `bin/up -d`命令重新创建所有服务。

设置此环境变量只会更新新用户的超时值，它 **不会** 追溯应用到现有用户，因为该值是在用户首次创建时填充的。

要调整现有用户的超时时间，您需要更改数据库中的每条用户记录。我们建议在这样做时格外谨慎，并建议在进行任何更改之前先做一个一致性备份。

您可以找到有关执行备份的信息 [这里](/on-premises/zh-cn/wei-hu/data-and-backups.md).

要更新所有现有用户的编译超时值，您需要在 Docker 主机上运行以下 shell 命令：

{% code overflow="wrap" %}

```bash
echo 'db.users.updateMany({}, {$set: {"features.compileTimeout": <value>}})' | docker exec -i mongo mongosh --quiet localhost/sharelatex
```

{% endcode %}

您需要将 `<value>` 替换为上述查询中所需的超时值（秒）。

命令完成后，您应该会看到一个包含已修改记录数量的确认信息。然后您可以输入 exit，再按回车键返回主机 shell。

### 跟踪项目访问

可以使用以下命令查看是谁以及何时加载了项目：

{% code overflow="wrap" %}

```bash
docker exec sharelatex bash -c 'grep "join project request" /var/log/overleaf/web.log'
```

{% endcode %}

这将同时提供 `时间戳`, `user_id` 和 `project_id`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/zh-cn/yong-hu-he-xiang-mu-guan-li/project-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
