Compare commits
13 Commits
5b43b72838
...
1.2.0
Author | SHA1 | Date | |
---|---|---|---|
9bad75e7c2 | |||
7358b67072 | |||
1b0ba01258 | |||
6fc5ee3ed3 | |||
099707446d | |||
d6b7fd73df | |||
6bfb0ddbf9 | |||
e1b76fa628 | |||
e6f98def6a | |||
590479eee2 | |||
d25305be4a | |||
2889a97f17 | |||
b540821a32 |
@@ -8,15 +8,8 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
on-push-deploy_sh-edraft:
|
on-push-deploy_sh-edraft:
|
||||||
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
|
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
|
||||||
container: catthehacker/ubuntu:act-latest
|
container: sh-edraft.de/act-runner:latest
|
||||||
steps:
|
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
|
- name: Setup docker
|
||||||
uses: https://github.com/papodaca/install-docker-action@main
|
uses: https://github.com/papodaca/install-docker-action@main
|
||||||
- run: docker -v
|
- run: docker -v
|
||||||
@@ -30,7 +23,7 @@ jobs:
|
|||||||
- name: Prepare bot build
|
- name: Prepare bot build
|
||||||
run: |
|
run: |
|
||||||
cd bot
|
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
|
cpl i
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
|
@@ -8,15 +8,8 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
on-push-deploy_sh-edraft:
|
on-push-deploy_sh-edraft:
|
||||||
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
|
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
|
||||||
container: catthehacker/ubuntu:act-latest
|
container: sh-edraft.de/act-runner:latest
|
||||||
steps:
|
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
|
- name: Setup docker
|
||||||
uses: https://github.com/papodaca/install-docker-action@main
|
uses: https://github.com/papodaca/install-docker-action@main
|
||||||
- run: docker -v
|
- run: docker -v
|
||||||
@@ -30,7 +23,7 @@ jobs:
|
|||||||
- name: Prepare bot build
|
- name: Prepare bot build
|
||||||
run: |
|
run: |
|
||||||
cd bot
|
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
|
cpl i
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
|
@@ -8,15 +8,8 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
on-push-deploy_sh-edraft:
|
on-push-deploy_sh-edraft:
|
||||||
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
|
runs-on: [ dobby.sh-edraft.de, ubuntu-latest ]
|
||||||
container: catthehacker/ubuntu:act-latest
|
container: sh-edraft.de/act-runner:latest
|
||||||
steps:
|
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
|
- name: Setup docker
|
||||||
uses: https://github.com/papodaca/install-docker-action@main
|
uses: https://github.com/papodaca/install-docker-action@main
|
||||||
- run: docker -v
|
- run: docker -v
|
||||||
@@ -30,7 +23,7 @@ jobs:
|
|||||||
- name: Prepare bot build
|
- name: Prepare bot build
|
||||||
run: |
|
run: |
|
||||||
cd bot
|
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
|
cpl i
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
|
Submodule bot/docker updated: 8063944d87...9c0dc59534
@@ -398,6 +398,9 @@ class DataIntegrityService:
|
|||||||
if user is None:
|
if user is None:
|
||||||
continue
|
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._user_joins_vc.delete_user_joined_voice_channel_by_user_id(user.id)
|
||||||
self._users.delete_user(user)
|
self._users.delete_user(user)
|
||||||
self._db_context.save_changes()
|
self._db_context.save_changes()
|
||||||
|
@@ -17,14 +17,10 @@ class FixUserHistoryMigration(MigrationABC):
|
|||||||
|
|
||||||
# fix 1.1.0_AchievementsMigration
|
# fix 1.1.0_AchievementsMigration
|
||||||
self._cursor.execute(
|
self._cursor.execute(
|
||||||
str(
|
str(f"""ALTER TABLE UsersHistory ADD COLUMN ReactionCount BIGINT NOT NULL DEFAULT 0 AFTER XP;""")
|
||||||
f"""ALTER TABLE UsersHistory ADD COLUMN IF NOT EXISTS ReactionCount BIGINT NOT NULL DEFAULT 0 AFTER XP;"""
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
self._cursor.execute(
|
self._cursor.execute(
|
||||||
str(
|
str(f"""ALTER TABLE UsersHistory ADD COLUMN MessageCount BIGINT NOT NULL DEFAULT 0 AFTER ReactionCount;""")
|
||||||
f"""ALTER TABLE UsersHistory ADD COLUMN IF NOT EXISTS MessageCount BIGINT NOT NULL DEFAULT 0 AFTER ReactionCount;"""
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
self._exec(__file__, "users.sql")
|
self._exec(__file__, "users.sql")
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@ class SteamSpecialOfferMigration(MigrationABC):
|
|||||||
str(
|
str(
|
||||||
f"""
|
f"""
|
||||||
ALTER TABLE CFG_Server
|
ALTER TABLE CFG_Server
|
||||||
ADD COLUMN IF NOT EXISTS GameOfferNotificationChatId BIGINT NULL AFTER ShortRoleNameSetOnlyHighest;
|
ADD COLUMN GameOfferNotificationChatId BIGINT NULL AFTER ShortRoleNameSetOnlyHighest;
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -45,7 +45,7 @@ class SteamSpecialOfferMigration(MigrationABC):
|
|||||||
str(
|
str(
|
||||||
f"""
|
f"""
|
||||||
ALTER TABLE CFG_ServerHistory
|
ALTER TABLE CFG_ServerHistory
|
||||||
ADD COLUMN IF NOT EXISTS GameOfferNotificationChatId BIGINT NULL AFTER ShortRoleNameSetOnlyHighest;
|
ADD COLUMN GameOfferNotificationChatId BIGINT NULL AFTER ShortRoleNameSetOnlyHighest;
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@@ -124,6 +124,6 @@ class UserJoinedServer(TableABC):
|
|||||||
return str(
|
return str(
|
||||||
f"""
|
f"""
|
||||||
DELETE FROM `UserJoinedServers`
|
DELETE FROM `UserJoinedServers`
|
||||||
WHERE `Id` = {self._join_id};
|
WHERE `JoinId` = {self._join_id};
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@@ -38,7 +38,7 @@ type Server implements TableWithHistoryQuery {
|
|||||||
config: ServerConfig
|
config: ServerConfig
|
||||||
hasFeatureFlag(flag: String): FeatureFlag
|
hasFeatureFlag(flag: String): FeatureFlag
|
||||||
|
|
||||||
statistic(date: String): ServerStatistic
|
# statistic(date: String): ServerStatistic
|
||||||
|
|
||||||
createdAt: String
|
createdAt: String
|
||||||
modifiedAt: String
|
modifiedAt: String
|
||||||
|
@@ -6,10 +6,10 @@ type ServerStatistic {
|
|||||||
activeUserCount: Int
|
activeUserCount: Int
|
||||||
|
|
||||||
userJoinedVoiceChannelCount: Int
|
userJoinedVoiceChannelCount: Int
|
||||||
userJoinedVoiceChannelOntime: Int
|
userJoinedVoiceChannelOntime: Float
|
||||||
|
|
||||||
userJoinedGameServerCount: Int
|
userJoinedGameServerCount: Int
|
||||||
userJoinedGameServerOntime: Int
|
userJoinedGameServerOntime: Float
|
||||||
|
|
||||||
userWarningCount: Int
|
userWarningCount: Int
|
||||||
|
|
||||||
|
@@ -108,7 +108,7 @@ class ServerQuery(DataQueryWithHistoryABC):
|
|||||||
"hasFeatureFlag",
|
"hasFeatureFlag",
|
||||||
lambda server, *_, **kwargs: self._resolve_has_feature_flag(server, *_, **kwargs),
|
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
|
@staticmethod
|
||||||
def resolve_id(server: Server, *_):
|
def resolve_id(server: Server, *_):
|
||||||
|
@@ -62,6 +62,19 @@ export class Queries {
|
|||||||
static serversQuery = `
|
static serversQuery = `
|
||||||
query ServerInfo($filter: ServerFilter, $page: Page, $sort: Sort) {
|
query ServerInfo($filter: ServerFilter, $page: Page, $sort: Sort) {
|
||||||
serverCount
|
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) {
|
servers(filter: $filter, page: $page, sort: $sort) {
|
||||||
id
|
id
|
||||||
discordId
|
discordId
|
||||||
@@ -79,22 +92,23 @@ export class Queries {
|
|||||||
receivedCommandCount
|
receivedCommandCount
|
||||||
movedUsersCount
|
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 = `
|
static hasServerFeatureFlag = `
|
||||||
query HasServerFeatureFlag($filter: ServerFilter, $flag: String) {
|
query HasServerFeatureFlag($filter: ServerFilter, $flag: String) {
|
||||||
servers(filter: $filter) {
|
servers(filter: $filter) {
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="server-list-wrapper">
|
<div class="server-list-wrapper">
|
||||||
<div class="server-list">
|
<div class="server-list">
|
||||||
<div class="server">
|
<div class="server" *ngIf="server">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<img *ngIf="server ? server.iconURL : ''" [src]="server ? server.iconURL : ''">
|
<img *ngIf="server ? server.iconURL : ''" [src]="server ? server.iconURL : ''">
|
||||||
</div>
|
</div>
|
||||||
|
@@ -5,6 +5,10 @@ import { DataService } from "src/app/services/data/data.service";
|
|||||||
import { SpinnerService } from "src/app/services/spinner/spinner.service";
|
import { SpinnerService } from "src/app/services/spinner/spinner.service";
|
||||||
import { SidebarService } from "../../../../services/sidebar/sidebar.service";
|
import { SidebarService } from "../../../../services/sidebar/sidebar.service";
|
||||||
import { ServerService } from "../../../../services/server.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({
|
@Component({
|
||||||
selector: "app-server-dashboard",
|
selector: "app-server-dashboard",
|
||||||
@@ -27,14 +31,30 @@ export class ServerDashboardComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.data.getServerFromRoute(this.route).then(server => {
|
this.data.getServerFromRoute(this.route).then(server => {
|
||||||
this.server = server;
|
// this.server = server;
|
||||||
|
|
||||||
|
this.loadServer(server.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.serverService.server$.subscribe(server => {
|
this.serverService.server$.subscribe(server => {
|
||||||
if (!server) {
|
if (!server) {
|
||||||
return;
|
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> {
|
public getServerFromRoute(route: ActivatedRoute): Promise<Server> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.spinner.showSpinner();
|
this.spinner.showSpinner();
|
||||||
@@ -50,7 +62,6 @@ export class DataService {
|
|||||||
resolve(server);
|
resolve(server);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public query<T>(query: string, variables?: Variables, f?: Function): Observable<T> {
|
public query<T>(query: string, variables?: Variables, f?: Function): Observable<T> {
|
||||||
|
Reference in New Issue
Block a user