Skip to content

Commit

Permalink
Merge pull request #242 from Wizarrrr/master
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
Ashley Bailey authored Oct 9, 2023
2 parents efbac60 + eac1b6a commit 1f6403d
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/beta-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ jobs:
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}-${{ steps.get_version.outputs.version }}
platforms: linux/amd64,linux/arm64,linux/arm32v7,linux/arm,linux/386,linux/ppc64le,linux/s390x,windows/amd64,mac/amd64,mac/arm64
platforms: linux/amd64,linux/arm64
provenance: false
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64,linux/arm32v7,linux/arm,linux/386,linux/ppc64le,linux/s390x,windows/amd64,mac/amd64,mac/arm64
platforms: linux/amd64,linux/arm64
provenance: false
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Compile Translations

on:
push:
branches:
- translations
workflow_dispatch: {}

permissions:
packages: write

jobs:
compile:
runs-on: ubuntu-latest
steps:
# Checkout the repo and the translations branch
- name: Checkout
uses: actions/checkout@v2
with:
ref: translations

# Install dependencies node and npm
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y nodejs npm
# Install dependencies for frontend
- name: Install dependencies for frontend
run: |
cd frontend
npm install
# Compile translations
- name: Compile translations
run: |
cd frontend
npm run gettext:compile
# Commit and push changes
- name: Commit and push changes
run: |
git config --local user.name "GitHub Action"
git config --local user.email "<>"
git add ./src/language/translations.json
git commit -m "Compile translations"
git push origin translations
13 changes: 13 additions & 0 deletions frontend/package-lock.json

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

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"prettier": "3.0.2",
"sass": "^1.66.1",
"start-server-and-test": "^2.0.0",
"tailwind-scrollbar": "^3.0.5",
"tailwindcss": "^3.3.3",
"tailwindcss-inner-border": "^0.2.0",
"terser": "^5.19.3",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/assets/img/discord.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/language/translations.json

Large diffs are not rendered by default.

103 changes: 103 additions & 0 deletions frontend/src/modules/help/components/Discord.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<template>
<div class="my-[-2rem] mx-[-2rem]">
<!-- Header -->
<div class="flex justify-between items-center flex-row bg-[#5865F2] py-4 px-6">
<DiscordLogo />
<div class="text-white text-sm">
<span class="font-bold">{{ totalMembersOnline }}</span>
{{ __("Members Online") }}
</div>
</div>

<!-- Members List -->
<div class="flex flex-col space-y-2 h-[30vh] overflow-y-auto p-4 scrollbar-thin scrollbar-track-white dark:scrollbar-thumb-gray-700 dark:scrollbar-track-gray-800">
<template v-for="member in members">
<div class="flex items-center space-x-2">
<div class="relative w-[26px] h-[26px]">
<img :src="member.avatar_url" class="w-[26px] h-[26px] rounded-full" alt="Avatar" />
<span class="absolute bottom-[-2px] right-[-2px] w-3 h-3 rounded-full border-2 border-white dark:border-gray-800" :class="statusColor(member.status)"></span>
</div>
<span>{{ member.username }}</span>
</div>
</template>
</div>

<!-- Footer -->
<div class="flex justify-between items-center flex-row bg-[#5865F2] py-4 px-6">
<div class="text-white text-sm">
{{ __("Join our Discord") }}
</div>
<a :href="invite" target="_blank" rel="noopener noreferrer" class="text-white text-sm">
{{ __("Join") }}
</a>
</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import DiscordLogo from "@/assets/img/discord.svg?component";
export interface Member {
id: string;
username: string;
discriminator: string;
avatar: null;
status: string;
avatar_url: string;
}
export type Members = Member[];
export default defineComponent({
name: "Discord",
components: {
DiscordLogo,
},
data() {
return {
guild: "1020742926856372224",
members: [] as Members,
invite: "",
interval: null as unknown as NodeJS.Timeout,
};
},
computed: {
totalMembersOnline() {
return this.members.filter((member) => member.status === "online").length;
},
},
methods: {
async loadWidgetAPI(guild: string) {
// Load the Discord Widget API
const response = await this.$axios.get(`https://discord.com/api/guilds/${guild}/widget.json`).catch(() => {
this.$toast.info("Unable to load Discord Widget, this is most likely due to too many requests.");
});
// Validate the response
if (!response) return;
// Set the widget data
this.invite = response.data.instant_invite;
this.members = response.data.members;
},
statusColor(status: string) {
switch (status) {
case "online":
return "bg-green-500";
case "idle":
return "bg-yellow-500";
case "dnd":
return "bg-red-500";
case "offline":
return "bg-gray-500";
default:
return "bg-gray-500";
}
},
},
mounted() {
this.loadWidgetAPI(this.guild);
},
});
</script>
5 changes: 5 additions & 0 deletions frontend/src/modules/help/views/Help.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import WizarrLogo from "@/components/WizarrLogo.vue";
import Welcome from "../components/Welcome.vue";
import Download from "../components/Download.vue";
// import Discord from "../components/Discord.vue";
export default defineComponent({
name: "HelpView",
Expand All @@ -47,6 +48,10 @@ export default defineComponent({
name: "download",
view: Download,
},
// {
// name: "discord",
// view: Discord,
// },
],
};
},
Expand Down
1 change: 1 addition & 0 deletions frontend/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ module.exports = {
require("tailwindcss-inner-border"), // inner border
require("@formkit/themes/tailwindcss"), // formkit
require("@tailwindcss/forms"), // tailwind forms
require('tailwind-scrollbar'), // scrollbar
],
};

0 comments on commit 1f6403d

Please sign in to comment.