Comments (53)
20/03/2017 Update:
- Removed ID by email, now identifying by Discord OAuth2 App User ID
- Removed all views under Manage and removed the ManageController
- Work started on dashboard, trying to implement AJAX calls to update the display (thinking of using React.js for the dashboard connecting to an ASP.NET backend)
This is where I see the dashboard designed by @celanthe coming in (the React UI can call ASP.NET Core endpoints, which will organize the appropriate data and do the relevant calls etc)
- AJAX. Just AJAX.
from archived-bot.
I'm experienced about front end design and development. I can provide.
from archived-bot.
That'd be great! The site is coded with React.js. Got any experience with that? Otherwise, it's not too difficult to learn.
The repo for the web project is located at https://github.com/Frederikam/FredBoat-Web
Master is automatically built to https://fredboat.com/
from archived-bot.
I don't have any experience with React.
from archived-bot.
from archived-bot.
@Frederikam If you're still in need of this, I know a bit of React and UI/UX design. I would love to help out with this.
from archived-bot.
Hey there @celanthe. Yes, this is still on the table and I would love some help, though I'm still wondering about how I am going to build the API gateway.
Be sure to ask if you need more info.
from archived-bot.
@Frederikam I am wondering if https://github.com/celanthe/ReactJS-AdminLTE would be a good jumping off place to start for said dashboard?
Unsure as to the gateway!
from archived-bot.
The API gateway is backend territory so it's probably something I'll end up dealing with. It's just impossible to finish this issue without it.
That React based template looks really neat and could be a useful starting point if you choose to delve into that. We don't need to really worry about having user customizable widgets and things like that, though.
from archived-bot.
@Frederikam Fantastic! I'll delve into this over the next couple of weeks.
from archived-bot.
@Frederikam slow progress, but still some progress. ^_^ Curious as to how you want the server permissions handled? For the sake of missing the back-end piece, would the commands from Discord need to actually do anything at this point?
I am assuming that the permissions in question are those listed at: https://discordapp.com/developers/docs/topics/permissions#role-object
EG: If someone clicks on the 'Discord Permissions' page in the sidebar, from there would it be enough to list the permissions for now in a table/with icons or somesuch until the back end is figured out?
from archived-bot.
Looks like you're off to a good start!
Here's some quick feedback:
- We don't need to tell users that they are online. This is not a social platform.
- I don't plan for this dashboard to be able to handle Discord permissions. That would be tricky to implement and would require maintenance for each new Discord permission.
- Overrides are quite low priority at the moment, but if we do wind up getting them, we'll want to use the same layout as Discord rather than having a separate tab.
- Sync with Discord? Not sure what that is supposed to be. Do you mean account authentication? People will need to authenticate to even view the dashboard.
- The user must have some way of switching the server they are looking at managing.
I'm not sure what you are asking in regards to how we handle role permissions. In essence, we are just cloning Discord's UI for permissions, only with our own set of permissions. I'll need to think about exactly which permissions we want.
The base URL of the gateway will be https://fredboat.com/api/
I currently only intend to use the identity
and identity.guilds
scopes for oauth. The latter allows us to retrieve a list of guilds the user is in, and which permissions they have there.
from archived-bot.
@Frederikam Ohh I see. I was making this much harder than it has to be, for sure! Wonderful. I'll get back to this over the weekend, for sure. :) That makes this a lot simpler.
from archived-bot.
@Frederikam just wanted to update--should have some time to work on this next weekend for a bit. I work f/t so I'll progress through as time allows! Look forward to working on it.
from archived-bot.
from archived-bot.
There are quite a few problems here:
- The avatar is too big and there's no form of padding.
- You're mixing the guild selection with the guild settings. It's really odd to have it there, seeing from a UX design perspective.
- You're not using react-router for this page. The route should be something like
/guild/:guildId/manage
. - Why is the home tab on the bottom? Most designers would put it at the top of the list.
- The home page is a mess. Why have those big unpadded banners when you can just style some simple buttons? We have an about page btw.
- Please use the same checkboxes that we use on the master branch. They are identical to what Discord uses.
It may be simpler to simply just fork master and continue my work. We already have react-router and checkmark components in place
from archived-bot.
@Frederikam Thanks for the feedback. I'll revisit this at a later date and follow your advice for forking the master repo.
from archived-bot.
So, because ASP.NET Core, I've made this:
http://imgur.com/a/5f2x3
(Note this is for anonymous users, the main page cuts straight to the dash for logged in users)
I've almost done setting it up with Discord OAuth2.
It runs on .NET Core (so multiplatform and performance gains ftw)
Uses Semantic UI
from archived-bot.
@averagenamespace looks really great! I particularly like the first image.
The system I had in mind is where the front-end is located on a CDN (namely netlify) and where API calls are made to https://fredboat.com/api/some_route
.
Though a big problem with this is that it splits the stack into .NET and Java. Not completely sure how that is going to work. @Nanabell told me he would like to help if only he did Java.
from archived-bot.
@Frederikam Has anything happened on the API end? I was assuming the API was going to be hosted separately (Java/whatever API backend communicates with ASP/React frontend), but if nothing has happened I can easily add some API controllers to this project, for example:
Which produces a result like this:
The [HttpGet]
attribute can be changed to HttpPost, HttpDelete, HttpPut
etc
from archived-bot.
I see an application stack like this:
(Or we skip the middle layer and connect the dash straight to the FredBoat client?)
Notes:
- Could seperate middle layer (Java)
- Could cut the second layer and connect the FredBoat client directly to the web dashboard
- At the moment the top and second layer are on the same application (FredBoatDashboard.sln, coming soon to a repository near you)
from archived-bot.
The problem with this is that FredBoat will eventually be dockerized into many different shards. My plan was for the API server to also manage those.
However, I'm not sure how your second layer fits in. By the third layer do you mean the bot itself?
from archived-bot.
from archived-bot.
For now, I'll focus on building the web dashboard. Do you have a general idea of what the URLs are for the API endpoints?
For the requirements you stated in the first post:
I don't get what you mean by the first one, do you mean like a role editor? I don't think I can do that with the Discord API. If you mean roles like FredBoat-only roles (add a user to a role, user can only do X or cannot play music etc), then with appropriate API endpoints, yeah, I can.
I can sort out updating what the bot can and cannot do from the dashboard, I just need a URL I can call (POST preferred) with a data object containing the new permissions (that I would assume update your local DB).
from archived-bot.
Progress:
Notes: Today was slow, because OAuth2 was hard to set up. Firstly, it wouldn't show up in ExternalProviderSchemes
. Then it wouldn't connect. But it works now 👍 I'm going to start working on the main dashboard (I'll just use a temporary fake data internal API for now, until the details for the API are done/whatever) but if you need anything changed just say.
I'm going to open-source it, but for now it's going to be on GitLab (because private repositories) because there is still some sensitive data (Discord app login data, for testing at the moment).
Written in Visual Studio 2017 and tested in Google Chrome
from archived-bot.
from archived-bot.
from archived-bot.
from archived-bot.
from archived-bot.
Sorry, but I fail to realize how that would work. API endpoints to control the swarm?
from archived-bot.
from archived-bot.
I could add endpoints on the shards, but how would you know which one of them to contact? Say you needed shard 23? Should I add an endpoint for that in the swarm controller?
from archived-bot.
@Frederikam Exactly. Example:
https://fredboat.com/api/shards/23
?
Or
https://fredboat.com/api/shards/status?shard=23
from archived-bot.
I need some constants as well like:
- How often to ping each shard
- What a successful ping would look like
- What to do in case a shard doesn't return a successful ping (endpoints for restart etc)
The ping reply would be in JSON preferably.
Potential example:GET https://fredboat.com/api/shards/23/status
? Do you want a dashboard just for you that shows the status and the ability to restart them (this endpoint would require a certain logged in Discord ID, of course, the endpoint would also need some kind of auth).
from archived-bot.
A shard would return one of the following statuses:
https://github.com/DV8FromTheWorld/JDA/blob/master/src/main/java/net/dv8tion/jda/core/JDA.java#L40-L70
Probably in a format like this:
{
"shardId": 23,
"status": "CONNECTED",
"guildCount": 1008,
"playersPlaying": 70,
"baseUrl": "http://123:123:123:123:3523"
}
The endpoint would be /api/shard/:shardId
. (note: shard is singular)
A dead shard is usually not playing anything or has no guilds. The status could be something like ATTEMPTING_TO_RECONNECT
or LOADING_SUBSYSTEMS
, but the shards should usually recover from this after a short while, but is sometimes not the case.
I'm not sure how a shard would be restarted. I'm no docker expert.
from archived-bot.
And if the shard sends no reply, is that a critical error (think red text), because the API should return data even if the bot is down? (This is for the owner dash)
from archived-bot.
If the shard doesn't respond it has likely crashed the JVM, or experiencing network issues. That should be considered critical.
from archived-bot.
I don't know how to manage docker containers, do you mean the FredBoat (the Java API) API will manage the docker containers and I can call an endpoint with relevant auth to restart a dshard (Docker shard)?
WebSockets perhaps?
from archived-bot.
from archived-bot.
For the meantime; is there any (any at all), any endpoints I can call right now to check if FredBoat is online?
Edit: For testing.
from archived-bot.
A status endpoint is currently available from http://host:1356/stats
I have made some changes to my scaling strategy. Instead of creating one huge swarm I'm now thinking of putting up buffering sender nodes around the globe, which would lessen the load on my machines in Paris while decreasing packet loss.
from archived-bot.
from archived-bot.
from archived-bot.
A little suggestion for this.
- Add smth like a dj role to the dashboard, so people can easily select a role from a dropdown menu
- Add a thing that people can select a music channel (with a dropdown menu) where the bot is only able to talk in
- Would like something to see like the dyno dashboard`
Imgur link like this
Also I would like (like dyno's dashboard) a dashboard that is avaible for everyone
from archived-bot.
I was thinking of something more flexible though, like the Discord permission system
from archived-bot.
Okay. But i would be cool for the music bot itself, with or without web dashboard. Especially for the dj role. I would really love if you would add some sort of command to that
from archived-bot.
from archived-bot.
Okay but would a command be nice, automatically adding a dj role and add dj's to it by saying ?dj add or ?adddj . That isn't hard for people to understand right?
from archived-bot.
from archived-bot.
Really? Many bots written in js and python have that. But if the user can create a role itself or through some other form of moderation bot and than add djs by doing some command? Or is that too hard?
from archived-bot.
Maybe FredBoat could implicitly allow anyone with the "DJ" role, but I am going to have to trust admins to assign and create that role.
from archived-bot.
Is that possible right now? To only let people with a specific role talk to FredBoat?
from archived-bot.
Yes, the Patreon API has webhook support, but in which way is that related to the dashboard?
from archived-bot.
Related Issues (20)
- Bot got stuck in connecting to VC after discord server crash HOT 5
- Bot doesn't leave when left alone HOT 4
- Bot not responding while doing searching tracks from Spotify in YouTube
- DanceCommand is broken
- FredBoat Music Failures HOT 1
- Prioritized tracks remain prioritized with the 'all' repeat mode HOT 6
- Compatibility issue with Clyp.it HOT 1
- Youtube error with Twitch streams HOT 1
- Feature: Gracefully handling Lavalink restarts HOT 1
- Edit the message sent when ;;help is executed HOT 3
- Feature: Add build instructions to CONTRIBUTING.md HOT 4
- [Feature Request] playfirst command HOT 1
- Use more updated version of gradle
- Add youtube title to ;;export output. HOT 1
- Configuration option to restrict DJs from skipping Admin's songs.
- SELFHOSTED - stop command makes the bot leave the channel HOT 3
- Youtube search is broken
- Feature request: Allow FredBoat to DM me track announcements HOT 1
- [Feature Request] Play direct links to mp3, wav, or other music files HOT 2
- SayCommand is not secure HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from archived-bot.