Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Webhook Utility #633

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
266 changes: 266 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions site/docs/.vuepress/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import "@mdi/font/css/materialdesignicons.css";
import { defineClientConfig } from "@vuepress/client";
import { defineAsyncComponent } from "vue";
import { createVuetify } from "vuetify";
import { aliases, mdi } from "vuetify/iconsets/mdi";
import "vuetify/styles";

export default defineClientConfig({
enhance({ app }) {
const vuetify = createVuetify({
theme: {
defaultTheme: "dark",
themes: {
dark: {
dark: true,
colors: {
primary: "#009dcaFF",
background: "#38404a",
surface: "#38404AFF",
},
},
},
},
ssr: true,
aliases,
icons: {
defaultSet: "mdi",
sets: {
mdi,
},
},
});

app.use(vuetify);

app.component(
"WebhookUtil",
defineAsyncComponent(() =>
import("./components/webhook-util/WebhookUtil.vue")
),
);
},
});
53 changes: 53 additions & 0 deletions site/docs/.vuepress/components/webhook-util/InfoUi.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<script lang="ts" setup>
import { UserFromGetMe } from '@grammyjs/types'
import { computed } from 'vue'
import { VBtn } from 'vuetify/components/VBtn'
import { VCard, VCardActions, VCardText, VCardTitle } from 'vuetify/components/VCard'
import { VCheckbox } from 'vuetify/components/VCheckbox'
import { VContainer, VRow, VSpacer } from 'vuetify/components/VGrid'
import ProfilePhoto from './ProfilePhoto.vue'
import TabsUi from './TabsUi.vue'
import { Translation } from './translations/types'

const props = defineProps<{ strings: Translation, info: UserFromGetMe, token: string }>()
const botName = computed(() => [ props.info.first_name, props.info.last_name ].filter(Boolean).join(' '))
const emit = defineEmits([ 'reset' ])
</script>

<template>
<div class="info-ui">
<v-card>
<v-card-title>
<v-container>
<v-row align="center" dense>
<profile-photo :token="token" />
<div class="text-body-1 ml-3">{{ botName }}</div>
<v-spacer />
<span class="text-body-2">ID: {{ info.id }}</span>
</v-row>
</v-container>
</v-card-title>
<hr>
<v-card-text class="pb-0">
<v-container class="pt-0 pb-0">
<v-row align-content="center">
<v-checkbox readonly color="primary" :model-value="info.can_join_groups"
:label="strings.botCard.canJoinGroups"></v-checkbox>
<v-checkbox readonly color="primary" :model-value="info.can_read_all_group_messages"
:label="strings.botCard.canReadGroupMessages"></v-checkbox>
<v-checkbox readonly color="primary" :model-value="info.supports_inline_queries"
:label="strings.botCard.inlineQueries"></v-checkbox>
</v-row>
</v-container>
<tabs-ui :strings="strings" :token="token" />
</v-card-text>
<hr class="mt-5">
<v-card-actions class="pt-0">
<v-container class="py-0">
<v-btn size="small" prepend-icon="mdi-arrow-left" @click="emit('reset')">{{ strings.botCard.buttons.changeToken
}}</v-btn>
</v-container>
</v-card-actions>
</v-card>
</div>
</template>
Loading