# Development

**URL:** https://meta.discourse.org/c/dev/7.md?page=67

[最新版本](https://meta.discourse.org/latest.md) · [分類](https://meta.discourse.org/categories.md) · [標簽](https://meta.discourse.org/tags.md)

**Page:** 68

---

## [点击“回复”进行呼叫](https://meta.discourse.org/t/on-reply-click-call/149603)

<div class="topic-metadata">

**Author:** [@Varsii](https://meta.discourse.org/u/Varsii)\
**回覆:** 4\
**Last updated:** [2020年十月4日 17:43 UTC](https://meta.discourse.org/t/on-reply-click-call/149603 "2020-10-04T17:43:02Z")

</div>

大家好 :slight\_smile: 我想知道如何在点击某些话题的“回复”按钮时添加一个调用方法？如果满足某些条件，我想弹出一条消息。 谢谢。

---

## [在 Ember 中访问另一个模型--肯定有比 ajax 更好的方法](https://meta.discourse.org/t/accessing-another-model-in-ember-surely-theres-a-better-way-than-ajax/216695)

<div class="topic-metadata">

**Author:** [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**回覆:** 2\
**Last updated:** [2022年二月1日 19:49 UTC](https://meta.discourse.org/t/accessing-another-model-in-ember-surely-theres-a-better-way-than-ajax/216695 "2022-02-01T19:49:01Z")

</div>

我正在标题中插入一个按钮，该按钮将用户添加到组。这可以工作，但为此进行 ajax 调用似乎不太对。似乎我“可以”直接调用 Group 模型并在那里完成它……

---

## [未读主题 (手机版)](https://meta.discourse.org/t/unread-topics-mobile-version/216653)

<div class="topic-metadata">

**Author:** [@PaulinaMX](https://meta.discourse.org/u/PaulinaMX)\
**回覆:** 4\
**Last updated:** [2022年二月1日 19:30 UTC](https://meta.discourse.org/t/unread-topics-mobile-version/216653 "2022-02-01T19:30:07Z")

</div>

几天前我的论坛出现了这个问题，虽然我已经进入了帖子，但它们对我来说仍然是未读的，桌面版也出现了同样的问题，但我已经在模板中解决了，但是……

---

## [如何使搜索横幅文本使用主色而不是次色？](https://meta.discourse.org/t/how-to-make-the-search-banner-text-use-primary-instead-of-sceondary-color/273645)

<div class="topic-metadata">

**Author:** [@Nerd\_Alert](https://meta.discourse.org/u/Nerd_Alert)\
**回覆:** 0\
**Last updated:** [2022年一月31日 17:24 UTC](https://meta.discourse.org/t/how-to-make-the-search-banner-text-use-primary-instead-of-sceondary-color/273645 "2022-01-31T17:24:32Z")

</div>

我怎样才能让文本使用我的主色而不是我的次色？我查看了 common.scss 文件，但没有找到任何与文本/文本颜色相关的设置。（我说的是你……的文本……

---

## [userCustomFields attr is undefined when extending the poster-name widget](https://meta.discourse.org/t/usercustomfields-attr-is-undefined-when-extending-the-poster-name-widget/43398)

<div class="topic-metadata">

**Author:** [@stevenpslade](https://meta.discourse.org/u/stevenpslade)\
**回覆:** 3\
**Last updated:** [2022年一月29日 16:20 UTC](https://meta.discourse.org/t/usercustomfields-attr-is-undefined-when-extending-the-poster-name-widget/43398 "2022-01-29T16:20:23Z")

</div>

Continuing the discussion from Getting joined data for widget scope: I am trying to extend the poster-name widget and add some user custom fields next to a user’s name on a post. As per @eviltrout: and… whitelist\_s…

---

## [如何使用 Discourse API 通过 Slug 获取子类别详细信息？](https://meta.discourse.org/t/how-do-i-get-subcategory-details-by-slug-using-discourse-api/216117)

<div class="topic-metadata">

**Author:** [@yilin](https://meta.discourse.org/u/yilin)\
**回覆:** 2\
**Last updated:** [2022年一月27日 00:10 UTC](https://meta.discourse.org/t/how-do-i-get-subcategory-details-by-slug-using-discourse-api/216117 "2022-01-27T00:10:15Z")

</div>

您好， 我创建了一个 slug 为“testparent”的父类别和一个 slug 为“testsub”的子类别。当我使用 /c/testparent/show.json 时，可以正常获取父类别的详细信息。但是当我使用 /c/testsub/show。…

---

## [是否有主题组件或插件允许管理员访问 img src 内容？](https://meta.discourse.org/t/is-there-a-theme-component-or-plugin-to-allow-admins-access-to-img-src-content/216096)

<div class="topic-metadata">

**Author:** [@michellefs](https://meta.discourse.org/u/michellefs)\
**回覆:** 1\
**Last updated:** [2022年一月26日 16:49 UTC](https://meta.discourse.org/t/is-there-a-theme-component-or-plugin-to-allow-admins-access-to-img-src-content/216096 "2022-01-26T16:49:02Z")

</div>

当我上传图片到主题时，有没有办法查看（并可能管理）图片的存储位置？ \<img src="https://global.discourse-cdn.com/… 例如，不同的管理员可能想使用相同的图片……

---

## [Discourse API 文档. 找不到已发送的参数](https://meta.discourse.org/t/discourse-api-documentation-cant-find-the-parameter-sent/215898)

<div class="topic-metadata">

**Author:** [@Drew-ART](https://meta.discourse.org/u/Drew-ART)\
**回覆:** 2\
**Last updated:** [2022年一月26日 14:37 UTC](https://meta.discourse.org/t/discourse-api-documentation-cant-find-the-parameter-sent/215898 "2022-01-26T14:37:18Z")

</div>

你好，我正尝试从管理员区域提取一些统计数据到外部网站。 我一直在遵循‘逆向工程指南’，但我无法确定在哪里找到必需的第3项，即发送的参数。 我已经‘检查……

---

## [“假”OAuth提供商？](https://meta.discourse.org/t/fake-oauth-provider/212116)

<div class="topic-metadata">

**Author:** [@cookieman768](https://meta.discourse.org/u/cookieman768)\
**回覆:** 7\
**Last updated:** [2022年一月26日 05:14 UTC](https://meta.discourse.org/t/fake-oauth-provider/212116 "2022-01-26T05:14:23Z")

</div>

你好 :wave: 我想知道我正在尝试做的事情是否可行。 所以，我想将 Minecraft 账户与 Discourse 账户关联起来，就像你可以添加 Discord、Google 等一样，但 Minecraft 做…

---

## [需要帮助找出为什么点击新主题/回复警报后主题列表未更新](https://meta.discourse.org/t/need-help-finding-why-topic-list-not-updating-after-click-new-topic-reply-alert/215036)

<div class="topic-metadata">

**Author:** [@th21](https://meta.discourse.org/u/th21)\
**回覆:** 9\
**Last updated:** [2022年一月21日 03:21 UTC](https://meta.discourse.org/t/need-help-finding-why-topic-list-not-updating-after-click-new-topic-reply-alert/215036 "2022-01-21T03:21:09Z")

</div>

在主题创建者网站上，我试图从主题列表中删除被忽略用户的主题，这是我的代码 api.modifyClass("component:topic-list", { @on("didReceiveAttrs") removeIgnoredUsers() { …

---

## [自定义用户字段，对用户隐藏并通过 API 可编辑？](https://meta.discourse.org/t/custom-user-field-that-s-hidden-from-user-and-editable-by-api/215838)

<div class="topic-metadata">

**Author:** [@Nerd\_Alert](https://meta.discourse.org/u/Nerd_Alert)\
**回覆:** 6\
**Last updated:** [2022年一月25日 16:04 UTC](https://meta.discourse.org/t/custom-user-field-that-s-hidden-from-user-and-editable-by-api/215838 "2022-01-25T16:04:27Z")

</div>

有没有办法拥有一个可以通过 API 编辑的自定义用户字段，该字段不会在任何地方显示给用户，并且用户无法以任何方式编辑它？

---

## [类别展示页：哪个调用了 topic-list 组件？](https://meta.discourse.org/t/category-show-page-what-calls-the-topic-list-component/215846)

<div class="topic-metadata">

**Author:** [@JQ331](https://meta.discourse.org/u/JQ331)\
**回覆:** 0\
**Last updated:** [2022年一月24日 17:46 UTC](https://meta.discourse.org/t/category-show-page-what-calls-the-topic-list-component/215846 "2022-01-24T17:46:45Z")

</div>

大家好。我正在尝试了解类别视图是如何渲染的（例如，类别显示页面，如这里）。具体来说：什么调用了主题列表组件？ 据我所知，类别显示页面的主要两个……

---

## [数据资源管理器 - Power BI](https://meta.discourse.org/t/data-explorer-power-bi/215822)

<div class="topic-metadata">

**Author:** [@Amine\_Akkar](https://meta.discourse.org/u/Amine_Akkar)\
**回覆:** 3\
**Last updated:** [2022年一月24日 15:59 UTC](https://meta.discourse.org/t/data-explorer-power-bi/215822 "2022-01-24T15:59:48Z")

</div>

你好， 我正在使用以下代码通过 API 将数据从 Data Explorer 调用到 PBI (queryID) =\> let resultCount = 10000, otherNameForPage = 0, GetPage = (otherNameForPage) =\> let content……

---

## [快速通知过滤器](https://meta.discourse.org/t/quick-notifications-filter/215632)

<div class="topic-metadata">

**Author:** [@Don](https://meta.discourse.org/u/Don)\
**回覆:** 5\
**Last updated:** [2022年一月23日 23:38 UTC](https://meta.discourse.org/t/quick-notifications-filter/215632 "2022-01-23T23:38:29Z")

</div>

您好， 我正在尝试创建一个主题组件，以便我们可以在菜单面板中筛选通知。我使用了 Kris 的精彩主题组件“在 PM 通知菜单中添加新消息按钮”作为模板。 它包含两个按钮……

---

## [如何用API为主题设置标签](https://meta.discourse.org/t/how-could-i-set-tag-for-a-topic-by-api/215688)

<div class="topic-metadata">

**Author:** [@cmdntd](https://meta.discourse.org/u/cmdntd)\
**回覆:** 0\
**Last updated:** [2022年一月23日 10:20 UTC](https://meta.discourse.org/t/how-could-i-set-tag-for-a-topic-by-api/215688 "2022-01-23T10:20:35Z")

</div>

Intenté establecer una etiqueta para el tema por API como Cómo hacer ingeniería inversa de la API de Discourse Pero no puedo ver el parámetro de etiqueta en la consola: acting\_avatar\_template: ":"/user\_avatar/help.working24.net/wo24/{size}/3\_2.png"" acting\_nam..."hellip;

---

## [在生产环境中使用Faker](https://meta.discourse.org/t/using-faker-in-production/215605)

<div class="topic-metadata">

**Author:** [@alangibson](https://meta.discourse.org/u/alangibson)\
**回覆:** 0\
**Last updated:** [2022年一月21日 21:53 UTC](https://meta.discourse.org/t/using-faker-in-production/215605 "2022-01-21T21:53:44Z")

</div>

大家好。我正在尝试使用 Faker 在控制器中生成用户名。在我的本地开发版本中运行正常，但在生产服务器上运行时会因以下错误而失败： I18n::MissingTranslat…

---

## [为插件添加表单](https://meta.discourse.org/t/adding-a-form-to-a-plugin/215203)

<div class="topic-metadata">

**Author:** [@alangibson](https://meta.discourse.org/u/alangibson)\
**回覆:** 3\
**Last updated:** [2022年一月20日 06:55 UTC](https://meta.discourse.org/t/adding-a-form-to-a-plugin/215203 "2022-01-20T06:55:44Z")

</div>

我正在尝试创建一个简单的插件，该插件 在主题时间线上方添加一个表单 将用户输入的电子邮件 POST 到控制器 表单已在时间线上方呈现，但当我输入电子邮件并单击提交时……

---

## [使用 Theme Creator CLI 上传主题](https://meta.discourse.org/t/uploading-theme-via-theme-creator-cli/215414)

<div class="topic-metadata">

**Author:** [@hrayner](https://meta.discourse.org/u/hrayner)\
**回覆:** 0\
**Last updated:** [2022年一月20日 03:56 UTC](https://meta.discourse.org/t/uploading-theme-via-theme-creator-cli/215414 "2022-01-20T03:56:52Z")

</div>

您好！ 我正在尝试使用 Discourse Theme Creator CLI 上传我的主题，但遇到一个问题。 README 文件中说明要使用 ‘run’ 命令。我正在 Docker 容器中运行 Discourse，但不幸的是，run 命令…

---

## [通过API获取用户的讨论订阅](https://meta.discourse.org/t/getting-a-users-discourse-subscriptions-through-api/215395)

<div class="topic-metadata">

**Author:** [@Nerd\_Alert](https://meta.discourse.org/u/Nerd_Alert)\
**回覆:** 2\
**Last updated:** [2022年一月19日 23:09 UTC](https://meta.discourse.org/t/getting-a-users-discourse-subscriptions-through-api/215395 "2022-01-19T23:09:14Z")

</div>

大家好！我正试图通过官方插件使用API获取用户的 Discourse 订阅。但每次尝试时，它都会返回 {"errors":\["You need to be logged in to do that."\],"error\_type":"not\_logged\_in"}…

---

## [如何将组件的操作添加到插件插槽中？](https://meta.discourse.org/t/how-to-add-a-components-actions-into-a-plugin-outlet/215322)

<div class="topic-metadata">

**Author:** [@JQ331](https://meta.discourse.org/u/JQ331)\
**回覆:** 1\
**Last updated:** [2022年一月19日 21:09 UTC](https://meta.discourse.org/t/how-to-add-a-components-actions-into-a-plugin-outlet/215322 "2022-01-19T21:09:33Z")

</div>

我一直在尝试在插件插槽中引用现有组件，但一直出现错误。主要问题似乎是与组件关联的操作。是否有正确的方法来引用操作……

---

## [通过原始模板插件插槽传递属性的有趣策略](https://meta.discourse.org/t/an-interesting-strategy-for-passing-properties-via-raw-template-plugin-outlets/210054)

<div class="topic-metadata">

**Author:** [@merefield](https://meta.discourse.org/u/merefield)\
**回覆:** 4\
**Last updated:** [2022年一月18日 16:26 UTC](https://meta.discourse.org/t/an-interesting-strategy-for-passing-properties-via-raw-template-plugin-outlets/210054 "2022-01-18T16:26:06Z")

</div>

关于这个，我有一个快速的问题。 我注意到 TLT 中有一个有趣的地方： 这里没有传递模型。 但你却能做到这一点： 我只能假设这是一种传递模型属性的稳定策略……

---

## [将上传文件的描述放入编辑器的代码在哪里？](https://meta.discourse.org/t/wheres-the-code-that-puts-the-uploaded-file-description-into-the-editor/215271)

<div class="topic-metadata">

**Author:** [@JQ331](https://meta.discourse.org/u/JQ331)\
**回覆:** 2\
**Last updated:** [2022年一月19日 00:01 UTC](https://meta.discourse.org/t/wheres-the-code-that-puts-the-uploaded-file-description-into-the-editor/215271 "2022-01-19T00:01:45Z")

</div>

大家好。我正在试验当文件上传时在撰写编辑器文本区域中显示的文本。我正在尝试弄清楚代码是如何工作的。当用户点击上传并上传文件（“Cool-Fi…”

---

## [在所有设备上使中心标志水平和垂直居中](https://meta.discourse.org/t/center-logo-horizontally-and-vertically-on-all-devices/312729)

<div class="topic-metadata">

**Author:** [@falcon9](https://meta.discourse.org/u/falcon9)\
**回覆:** 1\
**Last updated:** [2022年一月18日 16:34 UTC](https://meta.discourse.org/t/center-logo-horizontally-and-vertically-on-all-devices/312729 "2022-01-18T16:34:00Z")

</div>

@vinothkannans 如何在所有设备上将logo水平和垂直居中？我不打算使用链接……只用Logo。

---

## [如何在本地开发docker安装中从pgdump恢复？](https://meta.discourse.org/t/how-to-restore-from-pgdump-on-local-development-docker-install/215083)

<div class="topic-metadata">

**Author:** [@Nacho\_Caballero](https://meta.discourse.org/u/Nacho_Caballero)\
**回覆:** 1\
**Last updated:** [2022年一月18日 08:17 UTC](https://meta.discourse.org/t/how-to-restore-from-pgdump-on-local-development-docker-install/215083 "2022-01-18T08:17:32Z")

</div>

我之前使用的是 macOS 环境，但我厌倦了 Discourse 更新后 rails 代码的损坏，所以我正在尝试 docker 设置。 一切都运行正常，直到我看到向导欢迎屏幕，但是……

---

## [是否有API调用来设置分类的logo图片？](https://meta.discourse.org/t/is-there-an-api-call-to-set-the-logo-image-of-a-category/214899)

<div class="topic-metadata">

**Author:** [@ariznaf](https://meta.discourse.org/u/ariznaf)\
**回覆:** 8\
**Last updated:** [2022年一月16日 17:08 UTC](https://meta.discourse.org/t/is-there-an-api-call-to-set-the-logo-image-of-a-category/214899 "2022-01-16T17:08:39Z")

</div>

我们使用外部程序的API调用来自动创建一些主题。 我们现在想自动更改某些类别的徽标图像，从之前在discours中创建的一些帖子中提取图像……

---

## [Lighthouse 的实际性能数据](https://meta.discourse.org/t/real-performance-data-for-lighthouse/214920)

<div class="topic-metadata">

**Author:** [@rrit](https://meta.discourse.org/u/rrit)\
**回覆:** 4\
**Last updated:** [2022年一月16日 15:10 UTC](https://meta.discourse.org/t/real-performance-data-for-lighthouse/214920 "2022-01-16T15:10:52Z")

</div>

我们可以排除用户代理“Chrome-Lighthouse”，从而向 Lighthouse 展示真实的应用程序视图吗？ 应用程序视图性能 这使 Lighthouse 在 Chrome DevTools 和 PageSpeed Insights 中能够……

---

## [Discourse 如何检测/推断虚拟键盘？](https://meta.discourse.org/t/how-does-discourse-detect-infer-virtual-keyboards/214950)

<div class="topic-metadata">

**Author:** [@Dannii](https://meta.discourse.org/u/Dannii)\
**回覆:** 2\
**Last updated:** [2022年一月15日 22:50 UTC](https://meta.discourse.org/t/how-does-discourse-detect-infer-virtual-keyboards/214950 "2022-01-15T22:50:08Z")

</div>

我有一个与Discourse无关的项目，我非常希望能够检测到移动浏览器的虚拟键盘是否处于活动状态。我才意识到，在花了好几天的时间思考和寻找解决方案之后，我……

---

## [如何测试主题或主题组件？](https://meta.discourse.org/t/how-to-test-themes-or-theme-components/142788)

<div class="topic-metadata">

**Author:** [@agmontpetit](https://meta.discourse.org/u/agmontpetit)\
**回覆:** 16\
**Last updated:** [2022年一月15日 12:57 UTC](https://meta.discourse.org/t/how-to-test-themes-or-theme-components/142788 "2022-01-15T12:57:13Z")

</div>

我发现了一个关于自动测试插件的主题，但尚未见到任何提及如何测试主题或主题组件的内容。是否有关于如何在主题中使用 QUnit（或类似工具）的示例？

---

## [按用户/API密钥查看API请求](https://meta.discourse.org/t/view-api-requests-per-user-api-key/214584)

<div class="topic-metadata">

**Author:** [@IdentityDan](https://meta.discourse.org/u/IdentityDan)\
**回覆:** 2\
**Last updated:** [2022年一月14日 20:03 UTC](https://meta.discourse.org/t/view-api-requests-per-user-api-key/214584 "2022-01-14T20:03:24Z")

</div>

大家好， 我正在尝试对我们的 Discourse API 发起临时请求，并且经常遇到速率限制错误。我们有一些集成会定期使用该 API，我想监控这些请求。……

---

## [Python API 发送帖子](https://meta.discourse.org/t/python-api-send-posts/205161)

<div class="topic-metadata">

**Author:** [@FunnySmile](https://meta.discourse.org/u/FunnySmile)\
**回覆:** 5\
**Last updated:** [2022年一月14日 17:46 UTC](https://meta.discourse.org/t/python-api-send-posts/205161 "2022-01-14T17:46:58Z")

</div>

如果您需要使用 Python 发布到您的论坛，我相信这段代码肯定会有所帮助。 首先，请获取工具帖子、工具。 或者直接获取包： pip install fluent-discourse 更多接口……

[上一頁](https://meta.discourse.org/c/dev/7.md?page=66)

[下一頁](https://meta.discourse.org/c/dev/7.md?page=68)
