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

Commit 7325fb2

Browse files
DEV: Use section landing components for LLMs templates (#817)
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 62ba2fa commit 7325fb2

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

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

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import { action } from "@ember/object";
55
import { LinkTo } from "@ember/routing";
66
import { inject as service } from "@ember/service";
77
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
8-
import DButton from "discourse/components/d-button";
98
import DToggleSwitch from "discourse/components/d-toggle-switch";
109
import { popupAjaxError } from "discourse/lib/ajax-error";
1110
import icon from "discourse-common/helpers/d-icon";
1211
import i18n from "discourse-common/helpers/i18n";
1312
import I18n from "discourse-i18n";
1413
import AdminPageSubheader from "admin/components/admin-page-subheader";
14+
import AdminSectionLandingItem from "admin/components/admin-section-landing-item";
15+
import AdminSectionLandingWrapper from "admin/components/admin-section-landing-wrapper";
1516
import AiLlmEditor from "./ai-llm-editor";
1617

1718
export default class AiLlmsListEditor extends Component {
@@ -181,29 +182,31 @@ export default class AiLlmsListEditor extends Component {
181182
{{/if}}
182183
<section class="ai-llms-list-editor__templates">
183184
<AdminPageSubheader @titleLabel={{this.preconfiguredTitle}} />
184-
<div class="ai-llms-list-editor__templates-list">
185+
186+
<AdminSectionLandingWrapper
187+
class="ai-llms-list-editor__templates-list"
188+
>
185189
{{#each this.preConfiguredLlms as |llm|}}
186-
<div
190+
<AdminSectionLandingItem
191+
@titleLabelTranslated={{llm.name}}
192+
@descriptionLabelTranslated={{this.modelDescription llm}}
193+
@taglineLabel={{concat
194+
"discourse_ai.llms.providers."
195+
llm.provider
196+
}}
187197
data-llm-id={{llm.id}}
188198
class="ai-llms-list-editor__templates-list-item"
189199
>
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>
200+
<:buttons as |buttons|>
201+
<buttons.Default
202+
@action={{fn this.transitionToLlmEditor llm.id}}
203+
@icon="gear"
204+
@label="discourse_ai.llms.preconfigured.button"
205+
/>
206+
</:buttons>
207+
</AdminSectionLandingItem>
205208
{{/each}}
206-
</div>
209+
</AdminSectionLandingWrapper>
207210
</section>
208211
{{/if}}
209212
</section>

0 commit comments

Comments
 (0)