10 Commits

Author SHA1 Message Date
9bad75e7c2 Temporarily removed server stats
All checks were successful
Deploy prod on push / on-push-deploy_sh-edraft (push) Successful in 5m7s
Deploy staging on push / on-push-deploy_sh-edraft (push) Successful in 3m16s
Deploy dev on push / on-push-deploy_sh-edraft (push) Successful in 3m11s
2023-11-07 00:28:22 +01:00
7358b67072 Fixed server loading in web
All checks were successful
Deploy prod on push / on-push-deploy_sh-edraft (push) Successful in 5m6s
2023-11-07 00:06:17 +01:00
1b0ba01258 Fixed gql types
All checks were successful
Deploy dev on push / on-push-deploy_sh-edraft (push) Successful in 3m52s
Deploy staging on push / on-push-deploy_sh-edraft (push) Successful in 3m3s
Deploy prod on push / on-push-deploy_sh-edraft (push) Successful in 3m3s
2023-11-06 23:29:11 +01:00
6fc5ee3ed3 Merge pull request 'Fixed DeleteUserJoinedServer' (#431) from staging into master
All checks were successful
Deploy prod on push / on-push-deploy_sh-edraft (push) Successful in 3m18s
Reviewed-on: #431
2023-11-06 21:43:36 +01:00
099707446d Merge branch 'master' into staging
Some checks reported warnings
Deploy staging on push / on-push-deploy_sh-edraft (push) Has been cancelled
2023-11-06 21:43:25 +01:00
d6b7fd73df Fixed DeleteUserJoinedServer
All checks were successful
Deploy staging on push / on-push-deploy_sh-edraft (push) Successful in 4m2s
2023-11-06 21:42:52 +01:00
6bfb0ddbf9 Merge pull request 'Fixed remove user process' (#429) from staging into master
All checks were successful
Deploy prod on push / on-push-deploy_sh-edraft (push) Successful in 3m10s
Reviewed-on: #429
Reviewed-by: edraft-dev <dev.sven.heidemann@sh-edraft.de>
2023-11-06 21:34:29 +01:00
e1b76fa628 Possibly fixed rate limit in actions
All checks were successful
Deploy staging on push / on-push-deploy_sh-edraft (push) Successful in 3m0s
2023-11-06 21:26:25 +01:00
e6f98def6a Possibly fixed rate limit in actions 2023-11-06 21:26:25 +01:00
590479eee2 Set migration only on prod 2023-11-06 21:26:25 +01:00
13 changed files with 76 additions and 49 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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()

View File

@@ -124,6 +124,6 @@ class UserJoinedServer(TableABC):
return str(
f"""
DELETE FROM `UserJoinedServers`
WHERE `Id` = {self._join_id};
WHERE `JoinId` = {self._join_id};
"""
)

View File

@@ -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

View File

@@ -6,10 +6,10 @@ type ServerStatistic {
activeUserCount: Int
userJoinedVoiceChannelCount: Int
userJoinedVoiceChannelOntime: Int
userJoinedVoiceChannelOntime: Float
userJoinedGameServerCount: Int
userJoinedGameServerOntime: Int
userJoinedGameServerOntime: Float
userWarningCount: Int

View File

@@ -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, *_):

View File

@@ -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) {

View File

@@ -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>

View File

@@ -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();
});
}

View File

@@ -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> {