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
2 changes: 0 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
<!--<meta property="og:image:alt" content="%APP_TITLE%" />-->

<meta name="darkreader-lock" />

<script src="/theme.js"></script>
</head>
<body class="d-flex flex-column h-100">
<div id="app" class="d-flex h-100 flex-column"></div>
Expand Down
13 changes: 0 additions & 13 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"animate.css": "^4.1.1",
"axios": "^1.15.0",
"bootstrap": "^5.3.8",
"camelcase": "^9.0.0",
"ua-parser-js": "^2.0.9",
"vue": "^3.5.32",
"vue-router": "^5.0.4"
Expand Down
File renamed without changes.
13 changes: 6 additions & 7 deletions src/components/FeedbackForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import SupportLinks from '@/components/SupportLinks.vue'

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

const textArea = ref<HTMLTextAreaElement | null>(null)
Expand Down Expand Up @@ -76,8 +75,8 @@ async function processForm() {
console.log('ua:', ua)

const lines = [
`**${props.app.name}** Uninstall, Version: \`${props.version}\``,
`**ID**: \`${props.id}\``,
`**${props.app.name}** Uninstall, Version: \`${props.params['version']}\``,
`**ID**: \`${props.params['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 @@ -89,18 +88,18 @@ async function processForm() {

const content = lines.join('\n')
console.debug('content.length:', content.length)
console.debug('appConfig.relay_url:', appConfig.relay_url)
const relay_url = props.app.relay_url || appConfig.relay_url
console.debug('relay_url:', relay_url)

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

// 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)
const response = await axios.post(relay_url, data)
console.debug('response:', response)
console.debug('response.status:', response.status)

Expand Down
13 changes: 3 additions & 10 deletions src/components/NotFound.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<script setup lang="ts">
import appConfig from '@/config/app.ts'
import IconLink from '@/components/IconLink.vue'
// import { apps } from '@/config/apps.ts'

defineProps<{
name: string
params: Record<string, string>
}>()
</script>

Expand All @@ -16,7 +15,7 @@ defineProps<{
<div class="alert alert-danger my-2">Application Not Found</div>
<img alt="404" src="/404.png" class="img-fluid my-2" />
<p class="lead">
The application <b>{{ name }}</b> was not found.
The application <b>{{ params['name'] }}</b> was not found.
</p>
<p class="px-md-5">
To find more applications visit the <a :href="appConfig.website_url" class="link-body-emphasis">Website</a>, or
Expand All @@ -25,13 +24,7 @@ defineProps<{
</p>
</div>

<!--<ul>-->
<!-- <li v-for="item in apps">-->
<!-- <a :href="item.github_url">{{ item.name }}</a>-->
<!-- </li>-->
<!--</ul>-->

<hr class="" />
<hr />

<div class="row justify-content-center align-items-center fs-5">
<IconLink :href="appConfig.discord_invite" fa="fa-brands fa-discord" class="col-auto hvr-grow discord"
Expand Down
51 changes: 35 additions & 16 deletions src/config/apps.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,55 @@
export interface App {
name: string
id: string
github_url: string
icon?: string
redirect_url?: string
broken_text?: string
relay_url?: string
}

// export type App = (typeof apps)[keyof typeof apps]

export const apps = {
autoAuth: {
name: 'Auto Auth',
'auto-auth': {
id: 'auto-auth',
name: 'Auto Auth',
github_url: 'https://github.com/cssnr/auto-auth',
icon: 'https://raw.githubusercontent.com/cssnr/auto-auth/master/src/images/logo128.png',
redirect_url: 'https://github.com/cssnr/auto-auth/issues',
broken_text: 'Please provide a link to the site that is not functioning.',
},
cacheCleaner: {
name: 'Cache Cleaner',
'cache-cleaner': {
id: 'cache-cleaner',
name: 'Cache Cleaner',
github_url: 'https://github.com/cssnr/cache-cleaner',
icon: 'https://raw.githubusercontent.com/cssnr/cache-cleaner/master/src/images/logo128.png',
redirect_url: 'https://github.com/cssnr/cache-cleaner/issues',
broken_text: 'Please provide a link to the site that is not functioning.',
},
geoImage: {
name: 'GeoImage',
'hls-video-downloader': {
id: 'hls-video-downloader',
name: 'HLS Video Downloader',
github_url: 'https://github.com/cssnr/hls-video-downloader',
icon: 'https://raw.githubusercontent.com/cssnr/hls-video-downloader/master/src/images/logo128.png',
redirect_url: 'https://github.com/cssnr/hls-video-downloader/issues',
broken_text: 'Please provide a link to the site that is not functioning.',
},
'geo-image': {
id: 'geo-image',
name: 'GeoImage',
github_url: 'https://github.com/cssnr/geo-image',
icon: 'https://raw.githubusercontent.com/cssnr/geo-image/master/src/assets/icon.svg',
redirect_url: 'https://github.com/cssnr/geo-image/issues',
broken_text: 'Please provide a link to the image that is not functioning.',
},
}

// export type App = (typeof apps)[keyof typeof apps]
export interface App {
name: string
id: string
github_url: string
icon?: string
redirect_url?: string
broken_text?: string
'wxt-extension': {
id: 'wxt-extension',
name: 'WXT Extension',
github_url: 'https://github.com/smashedr/wxt-extension',
icon: 'https://raw.githubusercontent.com/smashedr/wxt-extension/master/src/assets/icon.svg',
redirect_url: 'https://github.com/smashedr/wxt-extension/issues',
broken_text: 'Please provide a link to the image that is not functioning.',
relay_url: 'https://relay.cssnr.com/discord/1376046470926438440',
},
}
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import '@fortawesome/fontawesome-free/css/all.min.css'
import 'animate.css'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap'
import '@/assets/styles.scss'
import '@/utils/theme.js'
import '@/assets/css/styles.scss'
import { createApp } from 'vue'
import Particles from '@tsparticles/vue3'
import { loadSlim } from '@tsparticles/slim'
Expand Down
File renamed without changes.
37 changes: 12 additions & 25 deletions src/views/HomeView.vue
Original file line number Diff line number Diff line change
@@ -1,38 +1,26 @@
<script setup lang="ts">
import { onMounted, onUnmounted } from 'vue'
import camelCase from 'camelcase'
import { type App, apps } from '@/config/apps.ts'
import particlesConfig from '@/assets/particles.json'
import FeedbackForm from '@/components/FeedbackForm.vue'
import NotFound from '@/components/NotFound.vue'

const url = new URL(window.location.href)
console.log('url:', url)
const name = url.searchParams.get('name') || ''
console.log('name:', name)
const version = url.searchParams.get('version') || 'unknown'
console.log('version:', version)
const id = url.searchParams.get('id') || 'unknown'
console.log('id:', id)

const key = camelCase(name)
console.log('key:', key)

const app: App = apps[key as keyof typeof apps]
const params = Object.fromEntries(url.searchParams.entries())
console.log('params:', params)
const app: App = apps[params['name'] as keyof typeof apps]
console.log('app:', app)

function processApp(app?: App) {
if (!app) return console.log('processApp: no App')
document.title = `${app.name} Feedback`
const link = document.querySelector<HTMLLinkElement>('link[rel*="icon"]')
if (link && app.icon) link.href = app.icon
console.debug('link.href:', link?.href)
}

onMounted(async () => {
onMounted(() => {
document.body.style.background = "url('https://images.cssnr.com/aviation')"
document.body.style.backgroundSize = 'cover'
processApp(app)
if (app) {
document.title = `${app.name} Feedback`
const link = document.querySelector<HTMLLinkElement>('link[rel*="icon"]')
if (link && app.icon) link.href = app.icon
console.debug('link.href:', link?.href)
}
})
onUnmounted(() => {
document.body.style.background = ''
Expand All @@ -42,9 +30,8 @@ onUnmounted(() => {

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

<NotFound v-else :name="name" />
<FeedbackForm v-if="app" :app="app" :params="params" />
<NotFound v-else :params="params" />
</div>

<vue-particles id="tsparticles" :options="particlesConfig" />
Expand Down
Loading