Compare commits
10 Commits
d25305be4a
...
1.2.0
Author | SHA1 | Date | |
---|---|---|---|
9bad75e7c2 | |||
7358b67072 | |||
1b0ba01258 | |||
6fc5ee3ed3 | |||
099707446d | |||
d6b7fd73df | |||
6bfb0ddbf9 | |||
e1b76fa628 | |||
e6f98def6a | |||
590479eee2 |
@@ -8,15 +8,8 @@ on:
|
||||
jobs:
|
||||
on-push-deploy_sh-edraft:
|
||||
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
|
||||
container: catthehacker/ubuntu:act-latest
|
||||
container: sh-edraft.de/act-runner:latest
|
||||
steps:
|
||||
- name: Setup Python 3.10
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: "3.10.12"
|
||||
token: ${{ secrets.CI_GITHUB_ACCESS_TOKEN }}
|
||||
- run: python -v
|
||||
|
||||
- name: Setup docker
|
||||
uses: https://github.com/papodaca/install-docker-action@main
|
||||
- run: docker -v
|
||||
@@ -30,7 +23,7 @@ jobs:
|
||||
- name: Prepare bot build
|
||||
run: |
|
||||
cd bot
|
||||
pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
|
||||
python3.10 -m pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
|
||||
cpl i
|
||||
|
||||
- name: Setup node
|
||||
|
@@ -8,15 +8,8 @@ on:
|
||||
jobs:
|
||||
on-push-deploy_sh-edraft:
|
||||
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
|
||||
container: catthehacker/ubuntu:act-latest
|
||||
container: sh-edraft.de/act-runner:latest
|
||||
steps:
|
||||
- name: Setup Python 3.10
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: "3.10.12"
|
||||
token: ${{ secrets.CI_GITHUB_ACCESS_TOKEN }}
|
||||
- run: python -v
|
||||
|
||||
- name: Setup docker
|
||||
uses: https://github.com/papodaca/install-docker-action@main
|
||||
- run: docker -v
|
||||
@@ -30,7 +23,7 @@ jobs:
|
||||
- name: Prepare bot build
|
||||
run: |
|
||||
cd bot
|
||||
pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
|
||||
python3.10 -m pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
|
||||
cpl i
|
||||
|
||||
- name: Setup node
|
||||
|
@@ -8,15 +8,8 @@ on:
|
||||
jobs:
|
||||
on-push-deploy_sh-edraft:
|
||||
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
|
||||
container: catthehacker/ubuntu:act-latest
|
||||
container: sh-edraft.de/act-runner:latest
|
||||
steps:
|
||||
- name: Setup Python 3.10
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: "3.10.12"
|
||||
token: ${{ secrets.CI_GITHUB_ACCESS_TOKEN }}
|
||||
- run: python -v
|
||||
|
||||
- name: Setup docker
|
||||
uses: https://github.com/papodaca/install-docker-action@main
|
||||
- run: docker -v
|
||||
@@ -30,7 +23,7 @@ jobs:
|
||||
- name: Prepare bot build
|
||||
run: |
|
||||
cd bot
|
||||
pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
|
||||
python3.10 -m pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
|
||||
cpl i
|
||||
|
||||
- name: Setup node
|
||||
|
Submodule bot/docker updated: 8063944d87...9c0dc59534
@@ -398,6 +398,9 @@ class DataIntegrityService:
|
||||
if user is None:
|
||||
continue
|
||||
|
||||
for join in self._user_joins.get_user_joined_servers_by_user_id(user.id):
|
||||
self._user_joins.delete_user_joined_server(join)
|
||||
|
||||
self._user_joins_vc.delete_user_joined_voice_channel_by_user_id(user.id)
|
||||
self._users.delete_user(user)
|
||||
self._db_context.save_changes()
|
||||
|
@@ -124,6 +124,6 @@ class UserJoinedServer(TableABC):
|
||||
return str(
|
||||
f"""
|
||||
DELETE FROM `UserJoinedServers`
|
||||
WHERE `Id` = {self._join_id};
|
||||
WHERE `JoinId` = {self._join_id};
|
||||
"""
|
||||
)
|
||||
|
@@ -38,7 +38,7 @@ type Server implements TableWithHistoryQuery {
|
||||
config: ServerConfig
|
||||
hasFeatureFlag(flag: String): FeatureFlag
|
||||
|
||||
statistic(date: String): ServerStatistic
|
||||
# statistic(date: String): ServerStatistic
|
||||
|
||||
createdAt: String
|
||||
modifiedAt: String
|
||||
|
@@ -6,10 +6,10 @@ type ServerStatistic {
|
||||
activeUserCount: Int
|
||||
|
||||
userJoinedVoiceChannelCount: Int
|
||||
userJoinedVoiceChannelOntime: Int
|
||||
userJoinedVoiceChannelOntime: Float
|
||||
|
||||
userJoinedGameServerCount: Int
|
||||
userJoinedGameServerOntime: Int
|
||||
userJoinedGameServerOntime: Float
|
||||
|
||||
userWarningCount: Int
|
||||
|
||||
|
@@ -108,7 +108,7 @@ class ServerQuery(DataQueryWithHistoryABC):
|
||||
"hasFeatureFlag",
|
||||
lambda server, *_, **kwargs: self._resolve_has_feature_flag(server, *_, **kwargs),
|
||||
)
|
||||
self.set_field("statistic", lambda server, *_, **kwargs: ServerStatistics(server, kwargs))
|
||||
# self.set_field("statistic", lambda server, *_, **kwargs: ServerStatistics(server, kwargs))
|
||||
|
||||
@staticmethod
|
||||
def resolve_id(server: Server, *_):
|
||||
|
@@ -62,6 +62,19 @@ export class Queries {
|
||||
static serversQuery = `
|
||||
query ServerInfo($filter: ServerFilter, $page: Page, $sort: Sort) {
|
||||
serverCount
|
||||
servers(filter: $filter, page: $page, sort: $sort) {
|
||||
id
|
||||
discordId
|
||||
name
|
||||
iconURL
|
||||
userCount
|
||||
activeUserCount
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
static serversDashboardQuery = `
|
||||
query DetailedServerInfo($filter: ServerFilter, $page: Page, $sort: Sort) {
|
||||
servers(filter: $filter, page: $page, sort: $sort) {
|
||||
id
|
||||
discordId
|
||||
@@ -79,22 +92,23 @@ export class Queries {
|
||||
receivedCommandCount
|
||||
movedUsersCount
|
||||
}
|
||||
statistic {
|
||||
achievementsAchieved
|
||||
messageCount
|
||||
userCount
|
||||
activeUserCount
|
||||
userJoinedVoiceChannelCount
|
||||
userJoinedVoiceChannelOntime
|
||||
userJoinedGameServerCount
|
||||
userJoinedGameServerOntime
|
||||
userWarningCount
|
||||
activityScore
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// statistic {
|
||||
// achievementsAchieved
|
||||
// messageCount
|
||||
// userCount
|
||||
// activeUserCount
|
||||
// userJoinedVoiceChannelCount
|
||||
// userJoinedVoiceChannelOntime
|
||||
// userJoinedGameServerCount
|
||||
// userJoinedGameServerOntime
|
||||
// userWarningCount
|
||||
// activityScore
|
||||
// }
|
||||
|
||||
static hasServerFeatureFlag = `
|
||||
query HasServerFeatureFlag($filter: ServerFilter, $flag: String) {
|
||||
servers(filter: $filter) {
|
||||
|
@@ -12,7 +12,7 @@
|
||||
<div class="content">
|
||||
<div class="server-list-wrapper">
|
||||
<div class="server-list">
|
||||
<div class="server">
|
||||
<div class="server" *ngIf="server">
|
||||
<div class="logo">
|
||||
<img *ngIf="server ? server.iconURL : ''" [src]="server ? server.iconURL : ''">
|
||||
</div>
|
||||
|
@@ -5,6 +5,10 @@ import { DataService } from "src/app/services/data/data.service";
|
||||
import { SpinnerService } from "src/app/services/spinner/spinner.service";
|
||||
import { SidebarService } from "../../../../services/sidebar/sidebar.service";
|
||||
import { ServerService } from "../../../../services/server.service";
|
||||
import { Query } from "../../../../models/graphql/query.model";
|
||||
import { Queries } from "../../../../models/graphql/queries.model";
|
||||
import { catchError } from "rxjs/operators";
|
||||
import { throwError } from "rxjs";
|
||||
|
||||
@Component({
|
||||
selector: "app-server-dashboard",
|
||||
@@ -27,14 +31,30 @@ export class ServerDashboardComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.data.getServerFromRoute(this.route).then(server => {
|
||||
this.server = server;
|
||||
// this.server = server;
|
||||
|
||||
this.loadServer(server.id);
|
||||
});
|
||||
|
||||
this.serverService.server$.subscribe(server => {
|
||||
if (!server) {
|
||||
return;
|
||||
}
|
||||
this.server = server;
|
||||
this.loadServer(server.id);
|
||||
});
|
||||
}
|
||||
|
||||
loadServer(id?: number): void {
|
||||
this.data.query<Query>(Queries.serversDashboardQuery, {
|
||||
filter: {
|
||||
id: id
|
||||
}
|
||||
}).pipe(catchError(err => {
|
||||
this.spinner.hideSpinner();
|
||||
return throwError(() => err);
|
||||
})).subscribe(data => {
|
||||
this.server = data.servers[0];
|
||||
this.spinner.hideSpinner();
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -29,6 +29,18 @@ export class DataService {
|
||||
) {
|
||||
}
|
||||
|
||||
public getServerIdFromRoute(route: ActivatedRoute): Promise<number> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.spinner.showSpinner();
|
||||
if (!route.snapshot.params["serverId"] || route.snapshot.params["serverId"] == "undefined") {
|
||||
this.spinner.hideSpinner();
|
||||
this.router.navigate(["/dashboard"]);
|
||||
reject();
|
||||
}
|
||||
resolve(route.snapshot.params["serverId"]);
|
||||
});
|
||||
}
|
||||
|
||||
public getServerFromRoute(route: ActivatedRoute): Promise<Server> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.spinner.showSpinner();
|
||||
@@ -50,7 +62,6 @@ export class DataService {
|
||||
resolve(server);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public query<T>(query: string, variables?: Variables, f?: Function): Observable<T> {
|
||||
|
Reference in New Issue
Block a user