Skip to content

Commit

Permalink
add azure sample, implement various typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
valgaze committed Jul 10, 2024
1 parent 1cf17bd commit 185aba4
Show file tree
Hide file tree
Showing 28 changed files with 2,186 additions and 21 deletions.
60 changes: 55 additions & 5 deletions docs/.vitepress/components/monaco.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,35 @@ onMounted(() => {
type HeaderConfig = {
iconURL?: string;
backgroundColor?: ColorChoices;
backgroundColor?: "Default"
| "Dark"
| "Light"
| "Accent"
| "Good"
| "Warning"
| "Attention"
| "blue"
| "red"
| "green"
| "yellow";
rtl?: boolean;
iconSize?: SizeChoices;
iconAlignment?: AlignmentChoices;
iconWidth?: number;
iconRound?: boolean;
textSize?: SizeChoices;
textAlign?: AlignmentChoices;
textColor?: ColorChoices;
textColor?: "Default"
| "Dark"
| "Light"
| "Accent"
| "Good"
| "Warning"
| "Attention"
| "blue"
| "red"
| "green"
| "yellow";
};
type SizeChoices =
| "Small"
Expand All @@ -105,7 +125,17 @@ type SizeChoices =
addBlock(
content: string | CardBuilder,
config: {
backgroundColor?: ColorChoices;
backgroundColor?: "Default"
| "Dark"
| "Light"
| "Accent"
| "Good"
| "Warning"
| "Attention"
| "blue"
| "red"
| "green"
| "yellow";
vertAlign?: VAlignChoices;
} = {}
): CardBuilder;
Expand All @@ -126,8 +156,28 @@ type SizeChoices =
config: {
size?: SizeChoices;
align?: AlignmentChoices;
color?: ColorChoices;
backgroundColor?: ColorChoices;
color?: "Default"
| "Dark"
| "Light"
| "Accent"
| "Good"
| "Warning"
| "Attention"
| "blue"
| "red"
| "green"
| "yellow";
backgroundColor?: "Default"
| "Dark"
| "Light"
| "Accent"
| "Good"
| "Warning"
| "Attention"
| "blue"
| "red"
| "green"
| "yellow";
vertAlign?: VAlignChoices;
} = {}): CardBuilder;
addChips(
Expand Down
3 changes: 3 additions & 0 deletions docs/.vitepress/components/token_handler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,13 @@ const store = useCustomStore();
const label = ref("⭐️");
const emit = defineEmits();
const checkToken = async (tokenCandidate: string) => {
if (!tokenCandidate) store.invalidateToken();
if (tokenCandidate.length > 5) {
await store.validateToken(tokenCandidate);
if (store.state.tokenValid) {
emit("tokenValidated", { valid: true });
} else {
}
}
};
Expand Down
13 changes: 13 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export default defineConfig({
text: "🔥 Deploy to Worker ",
link: "/examples/worker/README",
},

{
text: "🔗 Bot + Azure LLM",
link: "/examples/azure/README",
},
{
text: "🦖 Deploy to Deno",
link: "/examples/deno/README",
Expand Down Expand Up @@ -77,6 +82,10 @@ export default defineConfig({
{
text: `v${version}`,
items: [
{
text: "NPM Package",
link: "https://www.npmjs.com/package/speedybot",
},
{
text: "Release Notes",
link: "https://github.com/valgaze/speedybot/releases",
Expand Down Expand Up @@ -119,6 +128,10 @@ export default defineConfig({
text: "🦖 Deploy to Deno",
link: "/examples/deno/README",
},
{
text: "🔗 Bot + Azure LLM",
link: "/examples/azure/README",
},
{
text: "🌐 Deploy to Server ",
link: "/examples/standard-server/README",
Expand Down
5 changes: 5 additions & 0 deletions docs/.vitepress/util/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ function addWebhook(webhook: Webhook) {
store.webhooks.push(webhook);
}

async function invalidateToken() {
store.tokenValid = false;
}

async function validateToken(tokenCandidate: string): Promise<void | boolean> {
const loading = ElLoading.service({
lock: true,
Expand Down Expand Up @@ -141,6 +145,7 @@ export const storeHelper = {
setToken,
addWebhook,
validateToken,
invalidateToken,
cycle,
setSearchlevel,
};
Expand Down
Loading

0 comments on commit 185aba4

Please sign in to comment.