Skip to content

Commit

Permalink
Activity 1 | Read me compat | Future tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
inventionpro committed Aug 28, 2024
1 parent 569a0ee commit 9c77fa4
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 3 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# Fsh Pterodactyl Panel
Fsh pt is a pterodactyl api web wrapper.\
This works for both client and application api keys, even tho it may not support all the features all the ones added are carefully thought for the best user experience.

## Compatibility
- [ ] User
- [ ] Servers
- [ ] View (Missing terminal)
- [x] Files
- [ ] Databases
- [ ] Schedules
- [ ] Users
- [ ] Backups
- [x] Network
- [ ] Startup
- [ ] Settings
- [ ] Activity
- [ ] Account
- [ ] View
- [ ] Edit
- [ ] Api keys
- [ ] 2FA
- [ ] Application
- [ ] Users
- [ ] Nodes
- [ ] Locations
- [ ] Servers
- [ ] Nests
7 changes: 4 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.subtext {
font-size: 75%;
}

.status-offline {
--status: #f66;
}
Expand Down Expand Up @@ -36,9 +40,6 @@ a:has(.server) {
.server-title {
font-weight: bold;
}
.subtext {
font-size: 75%;
}

.file {
background-color: var(--bg-2);
Expand Down
84 changes: 84 additions & 0 deletions user/activity.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Network view - Fsh Pterodactyl Panel</title>
<!-- Boiler plate------ -->
<link rel="icon" href="https://fsh.plus/fsh.png" type="image/png">
<meta name="description" content="A pterodactyl panel replacement. View network of a server (login required).">
<!-- ------- -->
<link rel="stylesheet" href="https://fsh.plus/media/style.css">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:image" content="https://fsh.plus/fsh.png"/>
<meta name="theme-color" content="#a89c9b">
<!-- ------------------ -->
<link rel="stylesheet" href="/style.css">
<script src="/script.js"></script>
<style>
#logs {
display: flex;
gap: 15px;
flex-direction: column;
}
#logs > div {
display: flex;
align-items: center;
margin: 0px 10px;
padding: 10px;
border-radius: 0.5rem;
background-color: var(--bg-2);
}
#logs > div > span {
display: flex;
align-items: center;
}
.badge {
padding: 2px 4px;
font-size: 75%;
margin-left: 5px;
border-radius: 0.5rem;
background-color: var(--bg-3);
}
</style>
</head>
<body>
<a id="Bback"><button>Back</button></a>
<div id="logs"></div>
<script>
const params = new URLSearchParams(location.search);
document.getElementById('Bback').href = '/user/server?id='+params.get('id');
PT('servers/'+params.get('id'), function(s){
s = s.attributes;
PT('servers/'+s.uuid+'/activity?sort=-timestamp&include[]=actor&page='+(params.get('page')||'1'), function(l){
document.getElementById('logs').innerHTML = l.data.map(p => {p=p.attributes;return `<div>
<span>
<img src="${p.relationships.actor.attributes.image}">
<span>
<label>${p.relationships.actor.attributes.username}</label>
${p.is_api ? '<label class="badge">API</label>' : ''}
<br>
<label class="subtext">${p.ip}</label>
</span>
</span>
<span>
<label>${p.event}</label>
<label>
</span>
</div>`}).join('')
/*
{
"event": "server:allocation.notes",
"properties": {
"allocation": "0.0.0.0:3000",
"old": "cat",
"new": null
},
"timestamp": "2024-08-28T20:43:17+02:00"
}
*/
})
})
</script>
</body>
</html>
10 changes: 10 additions & 0 deletions user/server.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,14 @@ <h1 id="name">Name</h1>
</div>
<div>
<a id="Bfiles"><button>Files</button></a>
<a id="Bdat"><button disabled>Databases</button></a>
<a id="Bsch"><button disabled>Schedules</button></a>
<a id="Busr"><button disabled>Users</button></a>
<a id="Bbku"><button disabled>Backups</button></a>
<a id="Bnet"><button>Network</button></a>
<a id="Bsta"><button disabled>Startup</button></a>
<a id="Bset"><button disabled>Settings</button></a>
<a id="Bact"><button disabled>Activity</button></a>
</div>
<div class="console">
<p>Coming soon</p>
Expand All @@ -111,9 +116,14 @@ <h1 id="name">Name</h1>
<script>
const params = new URLSearchParams(location.search);
document.getElementById('Bfiles').href = '/user/file?id='+params.get('id')+'&file=&f=false';
//document.getElementById('Bdat').href = '/user/databases?id='+params.get('id');
//document.getElementById('Bsch').href = '/user/schedules?id='+params.get('id');
//document.getElementById('Busr').href = '/user/users?id='+params.get('id');
//document.getElementById('Bbku').href = '/user/backups?id='+params.get('id');
document.getElementById('Bnet').href = '/user/network?id='+params.get('id');
//document.getElementById('Bsta').href = '/user/startup?id='+params.get('id');
//document.getElementById('Bset').href = '/user/settings?id='+params.get('id');
//document.getElementById('Bact').href = '/user/activity?id='+params.get('id');
PT('servers/'+params.get('id'), function(s){
s = s.attributes;
if (s.is_suspended) {
Expand Down

0 comments on commit 9c77fa4

Please sign in to comment.