From 3d61c28c1407b0d17d271e46d88091467373d8f5 Mon Sep 17 00:00:00 2001 From: Ian Torres Date: Fri, 20 Jun 2025 16:27:29 -0400 Subject: [PATCH 1/2] Better navigation. --- components/Cards/ChannelChatCard.vue | 1 - components/Cards/InstanceMetricsCard.vue | 92 +++++++++++++++++++ components/Forms/InsertForm.vue | 2 - components/Forms/PublishForm.vue | 4 - components/Forms/SetForm.vue | 2 - components/Forms/SubscribeForm.vue | 1 - components/Forms/UpdateForm.vue | 9 -- components/Items/ServicesItem.vue | 54 +++++++++++ components/Lists/ServicesList.vue | 45 +++++++++ components/Lists/SubscriptionsList.vue | 5 +- components/Resources/Services/Channels.vue | 1 - components/Resources/Services/Connections.vue | 1 - components/Resources/Services/Overview.vue | 25 ----- components/Resources/Services/Stats.vue | 1 - components/Resources/Services/Storage.vue | 1 - components/Tables/ChannelsTable.vue | 2 - components/Tables/KeysTable.vue | 5 - layouts/default.vue | 23 +++-- pages/services/index.vue | 4 +- server/plugins/connector.ts | 2 - server/plugins/ws.ts | 1 - stores/services.ts | 3 - 22 files changed, 213 insertions(+), 71 deletions(-) create mode 100644 components/Cards/InstanceMetricsCard.vue create mode 100644 components/Items/ServicesItem.vue create mode 100644 components/Lists/ServicesList.vue diff --git a/components/Cards/ChannelChatCard.vue b/components/Cards/ChannelChatCard.vue index aabaf75..997b681 100644 --- a/components/Cards/ChannelChatCard.vue +++ b/components/Cards/ChannelChatCard.vue @@ -47,7 +47,6 @@ const submit = async (event: FormSubmitEvent) => { }) toast.add({title: t('forms.event', { name: "Published"}), color: 'success'}) - console.log("Published ⤑ Response", response) } catch (error) { toast.add({title: t('forms.event', { name: "Published ⤑ Exception"}), color: 'error'}) console.error("Published ⤑ Exception", error) diff --git a/components/Cards/InstanceMetricsCard.vue b/components/Cards/InstanceMetricsCard.vue new file mode 100644 index 0000000..0d9db2b --- /dev/null +++ b/components/Cards/InstanceMetricsCard.vue @@ -0,0 +1,92 @@ + + + + + \ No newline at end of file diff --git a/components/Forms/InsertForm.vue b/components/Forms/InsertForm.vue index f95368d..e15b66e 100644 --- a/components/Forms/InsertForm.vue +++ b/components/Forms/InsertForm.vue @@ -82,8 +82,6 @@ const submit = async (event: FormSubmitEvent) => { }) toast.add({title: t('forms.event', { name: "Counter Created"}), color: 'success'}) - console.log("Counter Created ⤑ Response", response) - emit('success'); } catch (error) { diff --git a/components/Forms/PublishForm.vue b/components/Forms/PublishForm.vue index 03b78c6..6df836a 100644 --- a/components/Forms/PublishForm.vue +++ b/components/Forms/PublishForm.vue @@ -47,13 +47,9 @@ const submit = async (event: FormSubmitEvent) => { } }) - toast.add({title: t('forms.event', { name: "Published"}), color: 'success'}) - console.log("Published ⤑ Response", response) - emit('success'); } catch (error) { - toast.add({title: t('forms.event', { name: "Published ⤑ Exception"}), color: 'error'}) console.error("Published ⤑ Exception", error) throw error; diff --git a/components/Forms/SetForm.vue b/components/Forms/SetForm.vue index c7d0088..78d2a7c 100644 --- a/components/Forms/SetForm.vue +++ b/components/Forms/SetForm.vue @@ -82,8 +82,6 @@ const submit = async (event: FormSubmitEvent) => { }) toast.add({title: t('forms.event', { name: "Buffer Created"}), color: 'success'}) - console.log("Buffer Created ⤑ Response", response) - emit('success'); } catch (error) { diff --git a/components/Forms/SubscribeForm.vue b/components/Forms/SubscribeForm.vue index 511f666..f4ee689 100644 --- a/components/Forms/SubscribeForm.vue +++ b/components/Forms/SubscribeForm.vue @@ -52,7 +52,6 @@ const submit = async (event: FormSubmitEvent) => { } watch(open_chat, (next, old) => { - console.log(old, next); if (old == true && next == false) { emit("chat_closed"); } diff --git a/components/Forms/UpdateForm.vue b/components/Forms/UpdateForm.vue index 5f5e329..254c018 100644 --- a/components/Forms/UpdateForm.vue +++ b/components/Forms/UpdateForm.vue @@ -96,11 +96,6 @@ onMounted(async () => { state.attribute_type = AttributeType.Quota.valueOf(); state.change_type = ChangeType.Decrease.valueOf(); } - console.log(props.stored_key); - // state.ttl_type = props.stored_key.ttl_type; - // const response = await services.query(route.params.id, state.key!); - // state.ttl = response.ttl as number; - // state.quota = response.quota as number; }); const submit = async (event: FormSubmitEvent) => { @@ -115,14 +110,10 @@ const submit = async (event: FormSubmitEvent) => { } }) - console.log(response); - if (response.success) { toast.add({title: t('forms.event', { name: "Key Update ⤑ Success"}), color: 'success'}) - console.log("Key Updated ⤑ Accepted", response) } else { toast.add({title: t('forms.event', { name: "Key Update ⤑ Rejected"}), color: 'error'}) - console.log("Key Updated ⤑ Rejected", response) } diff --git a/components/Items/ServicesItem.vue b/components/Items/ServicesItem.vue new file mode 100644 index 0000000..e4b6014 --- /dev/null +++ b/components/Items/ServicesItem.vue @@ -0,0 +1,54 @@ + + + + + \ No newline at end of file diff --git a/components/Lists/ServicesList.vue b/components/Lists/ServicesList.vue new file mode 100644 index 0000000..eb4b34d --- /dev/null +++ b/components/Lists/ServicesList.vue @@ -0,0 +1,45 @@ + + + diff --git a/components/Lists/SubscriptionsList.vue b/components/Lists/SubscriptionsList.vue index e5e78fb..f2ac9e9 100644 --- a/components/Lists/SubscriptionsList.vue +++ b/components/Lists/SubscriptionsList.vue @@ -36,13 +36,14 @@ const subscriptions = useSubscriptions(); +
Subscriptions
  • # {{subscription.name }}
-
- Add +
+ Add Subscription
diff --git a/components/Resources/Services/Channels.vue b/components/Resources/Services/Channels.vue index 2a115ba..3a70820 100644 --- a/components/Resources/Services/Channels.vue +++ b/components/Resources/Services/Channels.vue @@ -38,7 +38,6 @@ const fetch = async () => { loading.value = true; data.value = await services.channels(route.params.id) as ChannelsResponse; toast.add({title: t('forms.event', {name: "Channels Retrieved ⤑ Success"}), color: 'success'}) - console.log("Stats Retrieved ⤑ Success", data.value) loading.value = false; } diff --git a/components/Resources/Services/Connections.vue b/components/Resources/Services/Connections.vue index 1dbb944..f94f1b6 100644 --- a/components/Resources/Services/Connections.vue +++ b/components/Resources/Services/Connections.vue @@ -34,7 +34,6 @@ const fetch = async () => { loading.value = true; data.value = await services.connections(route.params.id) as ConnectionsResponse; toast.add({title: t('forms.event', { name: "Connections Retrieved ⤑ Success"}), color: 'success'}) - console.log("Connections Retrieved ⤑ Success", data.value) loading.value = false; } diff --git a/components/Resources/Services/Overview.vue b/components/Resources/Services/Overview.vue index ec59be9..0b724c0 100644 --- a/components/Resources/Services/Overview.vue +++ b/components/Resources/Services/Overview.vue @@ -29,28 +29,6 @@ const data : Ref = ref({ success: false } as InfoResponse); -const sections = [ - { name: 'ALL', totalKey: 'total_requests', perMinuteKey: 'total_requests_per_minute' }, - { name: 'INSERT', totalKey: 'total_insert_requests', perMinuteKey: 'total_insert_requests_per_minute' }, - { name: 'QUERY', totalKey: 'total_query_requests', perMinuteKey: 'total_query_requests_per_minute' }, - { name: 'UPDATE', totalKey: 'total_update_requests', perMinuteKey: 'total_update_requests_per_minute' }, - { name: 'PURGE', totalKey: 'total_purge_requests', perMinuteKey: 'total_purge_requests_per_minute' }, - { name: 'SET', totalKey: 'total_set_requests', perMinuteKey: 'total_set_requests_per_minute' }, - { name: 'GET', totalKey: 'total_get_requests', perMinuteKey: 'total_get_requests_per_minute' }, - { name: 'LIST', totalKey: 'total_list_requests', perMinuteKey: 'total_list_requests_per_minute' }, - { name: 'INFO', totalKey: 'total_info_requests', perMinuteKey: 'total_info_requests_per_minute' }, - { name: 'STAT', totalKey: 'total_stat_requests', perMinuteKey: 'total_stat_requests_per_minute' }, - { name: 'STATS', totalKey: 'total_stats_requests', perMinuteKey: 'total_stats_requests_per_minute' }, - { name: 'SUBSCRIBE', totalKey: 'total_subscribe_requests', perMinuteKey: 'total_subscribe_requests_per_minute' }, - { name: 'UNSUBSCRIBE', totalKey: 'total_unsubscribe_requests', perMinuteKey: 'total_unsubscribe_requests_per_minute' }, - { name: 'PUBLISH', totalKey: 'total_publish_requests', perMinuteKey: 'total_publish_requests_per_minute' }, - { name: 'CONNECTIONS', totalKey: 'total_connections_requests', perMinuteKey: 'total_connections_requests_per_minute' }, - { name: 'CONNECTION', totalKey: 'total_connection_requests', perMinuteKey: 'total_connection_requests_per_minute' }, - { name: 'CHANNELS', totalKey: 'total_channels_requests', perMinuteKey: 'total_channels_requests_per_minute' }, - { name: 'CHANNEL', totalKey: 'total_channel_requests', perMinuteKey: 'total_channel_requests_per_minute' }, - { name: 'WHOAMI', totalKey: 'total_whoami_requests', perMinuteKey: 'total_whoami_requests_per_minute' }, -]; - const intervalId = ref() const fetch = async (silence: boolean = false) => { @@ -64,20 +42,17 @@ const fetch = async (silence: boolean = false) => { if (historic.value.length > 10) { historic.value.shift(); } - console.log("Metrics Retrieved ⤑ Success", data.value) } onMounted(async () => { await fetch() intervalId.value = setInterval(async () => { await fetch(true); - console.log("OVERVIEW INFO INTERVAL ASSIGNED") }, 1000) }) onUnmounted(() => { clearInterval(intervalId.value); - console.log("OVERVIEW INFO INTERVAL REMOVED") }) diff --git a/components/Resources/Services/Stats.vue b/components/Resources/Services/Stats.vue index 8ca0e8e..7b23890 100644 --- a/components/Resources/Services/Stats.vue +++ b/components/Resources/Services/Stats.vue @@ -33,7 +33,6 @@ const fetch = async () => { loading.value = true; data.value = await services.stats(route.params.id) as StatsResponse; toast.add({title: t('forms.event', { name: "Stats Retrieved ⤑ Success"}), color: 'success'}) - console.log("Stats Retrieved ⤑ Success", data.value) loading.value = false; } diff --git a/components/Resources/Services/Storage.vue b/components/Resources/Services/Storage.vue index 7fb2227..fa1b1ce 100644 --- a/components/Resources/Services/Storage.vue +++ b/components/Resources/Services/Storage.vue @@ -35,7 +35,6 @@ const fetch = async () => { loading.value = true; data.value = await services.list(route.params.id) as ListResponse; toast.add({title: t('forms.event', { name: "Keys Retrieved ⤑ Success"}), color: 'success'}) - console.log("Keys Retrieved ⤑ Success", data.value) loading.value = false; } diff --git a/components/Tables/ChannelsTable.vue b/components/Tables/ChannelsTable.vue index 3915c88..ffb42c3 100644 --- a/components/Tables/ChannelsTable.vue +++ b/components/Tables/ChannelsTable.vue @@ -61,9 +61,7 @@ const columns: TableColumn[] = [ label: 'View', async onSelect() { channel.value = await services.channel(route.params.id, row.original.channel); - console.log(channel.value); toast.add({title: t('forms.event', {name: "Channel Details Retrieved ⤑ Success"}), color: 'success'}) - console.log("Channel Details Retrieved ⤑ Success", row.original.channel) open_channel.value = true; } }, { diff --git a/components/Tables/KeysTable.vue b/components/Tables/KeysTable.vue index fd389f7..0ae9ca7 100644 --- a/components/Tables/KeysTable.vue +++ b/components/Tables/KeysTable.vue @@ -114,7 +114,6 @@ const columns: TableColumn[] = [ break; } toast.add({title: t('forms.event', { name: "Key Details Retrieved ⤑ Success"}), color: 'success'}) - console.log("Key Details Retrieved ⤑ Success", row.original.key) } }, { label: 'Update', @@ -131,11 +130,9 @@ const columns: TableColumn[] = [ const response = await services.stat(route.params.id, row.original.key); if (response.success) { toast.add({title: t('forms.event', { name: "Key Metrics Retrieved ⤑ Success"}), color: 'success'}) - console.log("Key Metrics Retrieved ⤑ Success", row.original.key) stat.value = response; } else { toast.add({title: t('forms.event', { name: "Key Metrics Retrieved ⤑ Failed"}), color: 'error'}) - console.log("Key Metrics Retrieved ⤑ Failed", row.original.key) } open_stats.value = true; } @@ -147,11 +144,9 @@ const columns: TableColumn[] = [ const response = await services.purge(route.params.id, row.original.key); if (response.success) { toast.add({title: t('forms.event', { name: "Key Purged ⤑ Success"}), color: 'success'}) - console.log("Key Purged ⤑ Success", row.original.key) emit('reload'); } else { toast.add({title: t('forms.event', { name: "Key Purged ⤑ Failed"}), color: 'error'}) - console.log("Key Purged ⤑ Failed", row.original.key) } } }] diff --git a/layouts/default.vue b/layouts/default.vue index d31601f..6e07855 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -13,22 +13,31 @@ // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . + +const route = useRoute(); + +const is_viewing_some_instance = computed(() => { + return route.params.hasOwnProperty('id'); +}) +
- - + +
diff --git a/server/plugins/connector.ts b/server/plugins/connector.ts index 8033387..2730197 100644 --- a/server/plugins/connector.ts +++ b/server/plugins/connector.ts @@ -14,6 +14,4 @@ // along with this program. If not, see . export default defineNitroPlugin((nitroApp) => { - // console.log('Nitro plugin', nitroApp) - console.log('Nitro plugin [Connector]') }) \ No newline at end of file diff --git a/server/plugins/ws.ts b/server/plugins/ws.ts index 851a783..0b3de95 100644 --- a/server/plugins/ws.ts +++ b/server/plugins/ws.ts @@ -5,7 +5,6 @@ import {StatusResponse, RequestType} from "@throttr/sdk"; export default defineNitroPlugin((nitroApp) => { const wss = new WebSocketServer({ port: 4000 }) - console.log('Nitro plugin [Server]') const services = getServices(); const subscriptions = new Map>() // canal -> conexiones diff --git a/stores/services.ts b/stores/services.ts index 6136595..e627a82 100644 --- a/stores/services.ts +++ b/stores/services.ts @@ -160,7 +160,6 @@ export const useServices = defineStore('services', () => { }) toast.add({title: t('forms.event', { name: "Service Registered"}), color: 'success'}) - console.log("Service Registered ⤑ Response", response) await setup(); } catch (error) { @@ -284,13 +283,11 @@ export const useServices = defineStore('services', () => { }) toast.add({title: t('forms.invoked', { name: "Fetch Registered Services"}), color: 'success'}) - console.log("Fetch Registered Services ⤑ Response", response) services.value = response.data as StoredService[]; attributes.value.formOpen = services.value.length === 0; } catch (error) { toast.add({title: t('forms.exception', { name: "Fetch Registered Services"}), color: 'error'}) - console.error("Fetch Registered Services ⤑ Exception", error) throw error; } From 68368a78f7c0b36f0f0d524948f8b638ac4b1ebe Mon Sep 17 00:00:00 2001 From: Ian Torres Date: Fri, 20 Jun 2025 16:36:35 -0400 Subject: [PATCH 2/2] Rollback toast. --- components/Forms/PublishForm.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/Forms/PublishForm.vue b/components/Forms/PublishForm.vue index 6df836a..2d657bb 100644 --- a/components/Forms/PublishForm.vue +++ b/components/Forms/PublishForm.vue @@ -47,9 +47,12 @@ const submit = async (event: FormSubmitEvent) => { } }) + toast.add({title: t('forms.event', { name: "Published"}), color: 'success'}) + emit('success'); } catch (error) { + toast.add({title: t('forms.event', { name: "Published ⤑ Exception"}), color: 'error'}) console.error("Published ⤑ Exception", error) throw error;