Skip to content
Merged
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
3 changes: 1 addition & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ APP_DESCRIPTION=Vue 3 Feedback Application.
APP_GITHUB_URL=https://github.com/cssnr
APP_DISCORD_URL=https://discord.gg/wXy6m2X8wY
APP_KOFI_URL=https://ko-fi.com/cssnr
#APP_RELAY_URL=https://relay.cssnr.com/discord/1258944618389569566 # prod
APP_RELAY_URL=https://relay.cssnr.com/discord/1376046470926438440 # dev
APP_RELAY_URL=https://relay.cssnr.com/discord/1258944618389569566
APP_WEBSITE_URL=https://cssnr.github.io/
1 change: 1 addition & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
branches-ignore: [master]
paths:
- ".github/workflows/preview.yaml"
- ".env"
- "public/**"
- "src/**"
- "package*.json"
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Feedback Vue

<a title="Feedback Vue" href="https://github.com/cssnr/feedback?tab=readme-ov-file#readme" target="_blank">
<img alt="Feedback Vue" align="right" width="128" height="auto" src="https://raw.githubusercontent.com/cssnr/feedback/master/src/images/logo128.png"></a>
<img alt="Feedback Vue" align="right" width="128" height="auto" src="https://raw.githubusercontent.com/cssnr/feedback/master/src/assets/logo.svg"></a>

- [Development](#development)
- [Contributing](#contributing)
Expand All @@ -31,6 +31,8 @@ More details coming soon...

See [Vite Configuration Reference](https://vite.dev/config/).

- https://vite.dev/guide/env-and-mode#env-files

### Project Setup

```sh
Expand Down
14 changes: 11 additions & 3 deletions src/components/FeedbackForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import SupportLinks from '@/components/SupportLinks.vue'

const props = defineProps<{
app: App
version?: string
version: string
id: string
}>()

const textArea = ref<HTMLTextAreaElement | null>(null)

const inputText = ref('')

const hasFocus = ref(false)
Expand Down Expand Up @@ -77,6 +77,7 @@ async function processForm() {

const lines = [
`**${props.app.name}** Uninstall, Version: \`${props.version}\``,
`**ID**: \`${props.id}\``,
`**Browser**: ${ua.browser.name} ${ua.browser.major} (${ua.engine.name} - ${ua.browser.version})`,
`**System**: ${ua.os.name} ${ua.os.version} (${ua.cpu.architecture})`,
`${getIcon(values['not-used'])} Not Used`,
Expand All @@ -92,7 +93,14 @@ async function processForm() {

// await new Promise((resolve) => setTimeout(resolve, 2000))

const response = await axios.post(appConfig.relay_url, { content })
// const data = { content, username: props.app.name }
const data = {
content,
username: props.app.name,
...(props.app.icon?.endsWith('png') && { avatar_url: props.app.icon }),
}
console.debug('data:', data)
const response = await axios.post(appConfig.relay_url, data)
console.debug('response:', response)
console.debug('response.status:', response.status)

Expand Down
10 changes: 6 additions & 4 deletions src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ const name = url.searchParams.get('name') || ''
console.log('name:', name)
const version = url.searchParams.get('version') || 'unknown'
console.log('version:', version)

const id = camelCase(name)
const id = url.searchParams.get('id') || 'unknown'
console.log('id:', id)

const app: App = apps[id as keyof typeof apps]
const key = camelCase(name)
console.log('key:', key)

const app: App = apps[key as keyof typeof apps]
console.log('app:', app)

function processApp(app?: App) {
Expand All @@ -40,7 +42,7 @@ onUnmounted(() => {

<template>
<div class="container-fluid d-flex align-items-center justify-content-center h-100">
<FeedbackForm v-if="app" :app="app" />
<FeedbackForm v-if="app" :app="app" :version="version" :id="id" />

<NotFound v-else :name="name" />
</div>
Expand Down
Loading