Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 8c93137

Browse files
DEV: Use section landing components for LLMs templates
Relies on discourse/discourse#28477, uses AdminSectionLandingWrapper and AdminSectionLandingItem for the section items on the LLM page which are used to create a new LLM config from a template.
1 parent 2063b38 commit 8c93137

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

assets/javascripts/discourse/components/ai-llms-list-editor.gjs

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import icon from "discourse-common/helpers/d-icon";
1212
import i18n from "discourse-common/helpers/i18n";
1313
import I18n from "discourse-i18n";
1414
import AdminPageSubheader from "admin/components/admin-page-subheader";
15+
import AdminSectionLandingItem from "admin/components/admin-section-landing-item";
16+
import AdminSectionLandingWrapper from "admin/components/admin-section-landing-wrapper";
1517
import AiLlmEditor from "./ai-llm-editor";
1618

1719
export default class AiLlmsListEditor extends Component {
@@ -181,29 +183,31 @@ export default class AiLlmsListEditor extends Component {
181183
{{/if}}
182184
<section class="ai-llms-list-editor__templates">
183185
<AdminPageSubheader @titleLabel={{this.preconfiguredTitle}} />
184-
<div class="ai-llms-list-editor__templates-list">
186+
187+
<AdminSectionLandingWrapper
188+
class="ai-llms-list-editor__templates-list"
189+
>
185190
{{#each this.preConfiguredLlms as |llm|}}
186-
<div
191+
<AdminSectionLandingItem
192+
@titleLabelTranslated={{llm.name}}
193+
@descriptionLabelTranslated={{this.modelDescription llm}}
194+
@taglineLabel={{concat
195+
"discourse_ai.llms.providers."
196+
llm.provider
197+
}}
187198
data-llm-id={{llm.id}}
188199
class="ai-llms-list-editor__templates-list-item"
189200
>
190-
<h4>
191-
{{i18n (concat "discourse_ai.llms.providers." llm.provider)}}
192-
</h4>
193-
<h3>
194-
{{llm.name}}
195-
</h3>
196-
<p>
197-
{{this.modelDescription llm}}
198-
</p>
199-
<DButton
200-
@action={{fn this.transitionToLlmEditor llm.id}}
201-
@icon="gear"
202-
@label="discourse_ai.llms.preconfigured.button"
203-
/>
204-
</div>
201+
<:buttons as |buttons|>
202+
<buttons.Default
203+
@action={{fn this.transitionToLlmEditor llm.id}}
204+
@icon="gear"
205+
@label="discourse_ai.llms.preconfigured.button"
206+
/>
207+
</:buttons>
208+
</AdminSectionLandingItem>
205209
{{/each}}
206-
</div>
210+
</AdminSectionLandingWrapper>
207211
</section>
208212
{{/if}}
209213
</section>

0 commit comments

Comments
 (0)