2 Commits

Author SHA1 Message Date
00bd6cd9c3 Possibly fixed rate limit in actions
Some checks failed
Deploy dev on push / on-push-deploy_sh-edraft (push) Failing after 26s
2023-11-06 21:19:21 +01:00
382c8fc424 Set migration only on prod
Some checks failed
Deploy staging on push / on-push-deploy_sh-edraft (push) Failing after 4s
2023-11-06 20:53:35 +01:00
11 changed files with 24 additions and 69 deletions

View File

@@ -23,7 +23,7 @@ jobs:
- name: Prepare bot build
run: |
cd bot
python3.10 -m pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
cpl i
- name: Setup node

View File

@@ -23,7 +23,7 @@ jobs:
- name: Prepare bot build
run: |
cd bot
python3.10 -m pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
cpl i
- name: Setup node

View File

@@ -23,7 +23,7 @@ jobs:
- name: Prepare bot build
run: |
cd bot
python3.10 -m pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
pip install --extra-index-url https://pip.sh-edraft.de cpl-cli
cpl i
- name: Setup node

View File

@@ -124,6 +124,6 @@ class UserJoinedServer(TableABC):
return str(
f"""
DELETE FROM `UserJoinedServers`
WHERE `JoinId` = {self._join_id};
WHERE `Id` = {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: Float
userJoinedVoiceChannelOntime: Int
userJoinedGameServerCount: Int
userJoinedGameServerOntime: Float
userJoinedGameServerOntime: Int
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,19 +62,6 @@ 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
@@ -92,23 +79,22 @@ 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" *ngIf="server">
<div class="server">
<div class="logo">
<img *ngIf="server ? server.iconURL : ''" [src]="server ? server.iconURL : ''">
</div>

View File

@@ -5,10 +5,6 @@ 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",
@@ -31,30 +27,14 @@ export class ServerDashboardComponent implements OnInit {
ngOnInit(): void {
this.data.getServerFromRoute(this.route).then(server => {
// this.server = server;
this.loadServer(server.id);
this.server = server;
});
this.serverService.server$.subscribe(server => {
if (!server) {
return;
}
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();
this.server = server;
});
}

View File

@@ -29,18 +29,6 @@ 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();
@@ -62,6 +50,7 @@ export class DataService {
resolve(server);
});
});
}
public query<T>(query: string, variables?: Variables, f?: Function): Observable<T> {