Skip to content

Commit 9153dad

Browse files
author
Jicheng Lu
committed
refine utility
1 parent 25bd44b commit 9153dad

File tree

6 files changed

+162
-56
lines changed

6 files changed

+162
-56
lines changed

src/lib/helpers/types/agentTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
/**
124124
* @typedef {Object} AgentUtility
125125
* @property {string} name
126+
* @property {boolean} disabled
126127
* @property {UtilityBase[]} functions
127128
* @property {UtilityBase[]} templates
128129
*/

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
.merge-utility {
112112
display: flex;
113113
gap: 3px;
114-
114+
115115
input {
116116
outline: none !important;
117117
box-shadow: none !important;
@@ -150,6 +150,21 @@
150150

151151
.utility-row-primary {
152152
display: flex;
153+
154+
.utility-label {
155+
display: flex;
156+
gap: 10px;
157+
158+
.utility-tooltip {
159+
display: flex;
160+
gap: 3px;
161+
}
162+
163+
input {
164+
outline: none !important;
165+
box-shadow: none !important;
166+
}
167+
}
153168
}
154169

155170
.utility-row-secondary {

src/lib/services/agent-service.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ export async function createAgent(agent) {
8484

8585
/**
8686
* Get agent utilities
87-
* @returns {Promise<string[]>}
87+
* @returns {Promise<import('$agentTypes').AgentUtility[]>}
8888
*/
89-
export async function getAgentUtilities() {
90-
const url = endpoints.agentUtilitiesUrl;
89+
export async function getAgentUtilityOptions() {
90+
const url = endpoints.agentUtilityOptionsUrl;
9191
const response = await axios.get(url);
9292
return response.data;
9393
}

src/lib/services/api-endpoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const endpoints = {
3333
agentDetailUrl: `${host}/agent/{id}`,
3434
agentRefreshUrl: `${host}/refresh-agents`,
3535
agentCreateUrl: `${host}/agent`,
36-
agentUtilitiesUrl: `${host}/agent/utilities`,
36+
agentUtilityOptionsUrl: `${host}/agent/utility/options`,
3737

3838
// agent task
3939
agentTaskListUrl: `${host}/agent/tasks`,

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import InPlaceEdit from '$lib/common/InPlaceEdit.svelte'
55
import { format } from '$lib/helpers/datetime';
66
import { AgentType } from '$lib/helpers/enums';
7-
import { getAgentUtilities } from '$lib/services/agent-service';
87
98
const profileLimit = 10;
109
@@ -15,15 +14,7 @@
1514
/** @type {string[]} */
1615
export let profiles = [];
1716
18-
/** @type {string[]} */
19-
let utilityOptions = [];
20-
21-
onMount(() => {
22-
getAgentUtilities().then(data => {
23-
const list = data?.filter(x => x?.trim()?.length > 0) || [];
24-
utilityOptions = ["", ...list];
25-
});
26-
});
17+
onMount(() => {});
2718
2819
function addProfile() {
2920
if (!!!agent) return;

0 commit comments

Comments
 (0)