diff --git a/src/lib/helpers/enums.js b/src/lib/helpers/enums.js index 4583819c..06af8793 100644 --- a/src/lib/helpers/enums.js +++ b/src/lib/helpers/enums.js @@ -127,4 +127,10 @@ const userAction = { Edit: "edit", Chat: "chat" }; -export const UserAction = Object.freeze(userAction); \ No newline at end of file +export const UserAction = Object.freeze(userAction); + +const globalEvent = { + Search: "search", + Chat: "chat" +}; +export const GlobalEvent = Object.freeze(globalEvent); \ No newline at end of file diff --git a/src/lib/helpers/store.js b/src/lib/helpers/store.js index 7d4623b8..7b2677ed 100644 --- a/src/lib/helpers/store.js +++ b/src/lib/helpers/store.js @@ -8,6 +8,10 @@ const conversationUserStatesKey = "conversation_user_states"; const conversationSearchOptionKey = "conversation_search_option"; const conversationUserMessageKey = "conversation_user_messages"; +/** @type {Writable} */ +export const globalEventStore = writable({ name: "", payload: {} }); + + /** @type {Writable} */ export const userStore = writable({ id: "", full_name: "", expires: 0, token: null }); diff --git a/src/lib/helpers/types/agentTypes.js b/src/lib/helpers/types/agentTypes.js index d429c2db..bbe84e6f 100644 --- a/src/lib/helpers/types/agentTypes.js +++ b/src/lib/helpers/types/agentTypes.js @@ -28,6 +28,7 @@ * @typedef {Object} AgentFilter * @property {import('$commonTypes').Pagination} pager - Pagination * @property {string} [type] + * @property {string} [agentName] * @property {boolean} [isPublic] * @property {boolean} [disabled] * @property {string[]} [agentIds] diff --git a/src/lib/helpers/types/commonTypes.js b/src/lib/helpers/types/commonTypes.js index 01681d80..009a8711 100644 --- a/src/lib/helpers/types/commonTypes.js +++ b/src/lib/helpers/types/commonTypes.js @@ -31,4 +31,10 @@ */ +/** + * @typedef {Object} GlobalEvent + * @property {string} name + * @property {any} payload + */ + export default {}; \ No newline at end of file diff --git a/src/lib/scss/custom/pages/_users.scss b/src/lib/scss/custom/pages/_users.scss index feddbf37..e4133489 100644 --- a/src/lib/scss/custom/pages/_users.scss +++ b/src/lib/scss/custom/pages/_users.scss @@ -32,7 +32,7 @@ } .basic-info { - margin: 15px 0px 8px 0px; + margin: 15px 0px 0px 0px; display: flex; flex-wrap: wrap; @@ -46,6 +46,32 @@ } } + .user-permission-container { + display: flex; + gap: 5px; + + .permission-wrapper { + display: flex; + flex-direction: column; + gap: 3px; + + .edit-wrapper { + display: flex; + gap: 3px; + } + + input[type="text"] { + height: 30px; + font-size: 12px; + } + } + + + .list-add { + font-size: 18px; + } + } + .user-agent-container { margin: 20px 0px; padding: 0px 2rem; diff --git a/src/routes/VerticalLayout/Header.svelte b/src/routes/VerticalLayout/Header.svelte index 1de4cb8d..d46df681 100644 --- a/src/routes/VerticalLayout/Header.svelte +++ b/src/routes/VerticalLayout/Header.svelte @@ -1,19 +1,24 @@
@@ -72,7 +84,7 @@ type="button" class="btn btn-sm px-3 font-size-16 header-item waves-effect" id="vertical-menu-btn" - on:click={toggleSideBar} + on:click={() => toggleSideBar()} > @@ -80,7 +92,14 @@ diff --git a/src/routes/VerticalLayout/Index.svelte b/src/routes/VerticalLayout/Index.svelte index 7010cf6c..3bb24bf4 100644 --- a/src/routes/VerticalLayout/Index.svelte +++ b/src/routes/VerticalLayout/Index.svelte @@ -39,7 +39,7 @@
-
+
toggleRightBar()} /> {#if menu} {/if} @@ -52,5 +52,5 @@
- + closebar()} /> diff --git a/src/routes/page/agent/+page.svelte b/src/routes/page/agent/+page.svelte index 516bbe66..490ef2ab 100644 --- a/src/routes/page/agent/+page.svelte +++ b/src/routes/page/agent/+page.svelte @@ -1,5 +1,5 @@ @@ -283,15 +300,46 @@ {/if} - {#if item.permissions} + +
  • -
    - {'Permissions:'} - {item.permissions?.length > 0 ? item.permissions.join(', ') : 'N/A'} +
    +
    {'Permissions:'}
    +
    + {#each innerItem.permissions as permission, index} +
    + +
    + {}} + on:click={() => deletePermission(index)} + /> +
    +
    + {/each} + {#if innerItem.permissions?.length < 5} +
    + {}} + on:click={() => addPermission()} + /> +
    + {/if} +
  • - {/if}
+ {#if innerActions.length > 0}