Skip to content

Commit 25bd44b

Browse files
author
Jicheng Lu
committed
add merge utility
1 parent 2abdaab commit 25bd44b

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

src/lib/helpers/types/agentTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
* @property {boolean} allow_routing
5050
* @property {string} icon_url - Icon
5151
* @property {string[]} profiles - The agent profiles.
52+
* @property {boolean} merge_utility - Merge utility
5253
* @property {AgentUtility[]} utilities - The agent utilities.
5354
* @property {Date} created_datetime
5455
* @property {Date} updated_datetime

src/lib/scss/custom/pages/_agent.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@
107107
display: flex;
108108
flex-direction: column;
109109
gap: 10px;
110+
111+
.merge-utility {
112+
display: flex;
113+
gap: 3px;
114+
115+
input {
116+
outline: none !important;
117+
box-shadow: none !important;
118+
}
119+
}
110120

111121
.utility-wrapper {
112122
border: 1px dotted var(--bs-primary);

src/routes/page/agent/[agentId]/agent-utility.svelte

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script>
22
import { onMount } from 'svelte';
3-
import { Card, CardBody, Input, Button } from '@sveltestrap/sveltestrap';
3+
import { Card, CardBody, Input, Button, Tooltip } from '@sveltestrap/sveltestrap';
44
import { getAgentUtilities } from '$lib/services/agent-service';
55
66
const limit = 5;
@@ -150,6 +150,15 @@
150150
}
151151
}) || [];
152152
}
153+
154+
155+
/** @param {any} e */
156+
function changeMergeUtility(e) {
157+
const checked = e.target.checked;
158+
if (!!agent) {
159+
agent.merge_utility = checked;
160+
}
161+
}
153162
</script>
154163
155164
<Card>
@@ -159,8 +168,23 @@
159168
</div>
160169
161170
<div class="agent-utility-container">
162-
<div>
163-
171+
<div class="merge-utility">
172+
<Input
173+
type="checkbox"
174+
checked={agent?.merge_utility || false}
175+
on:change={e => changeMergeUtility(e)}
176+
/>
177+
<div class="fw-bold">
178+
Merge utility
179+
</div>
180+
<div
181+
class="line-align-center"
182+
data-bs-toggle="tooltip"
183+
data-bs-placement="top"
184+
title="Merge with entry agent utilities"
185+
>
186+
<i class="bx bx-info-circle" />
187+
</div>
164188
</div>
165189
166190
{#each innerUtilities as utility, uid (uid)}

0 commit comments

Comments
 (0)