Fixed db set date & show only changed fields in history view #246
This commit is contained in:
parent
ad00dce5d9
commit
b1a0115e8b
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `ApiKeys`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `ApiKeys`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `ApiKeys`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ApiKeysHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `AuthUserUsersRelations`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `AuthUserUsersRelations`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `AuthUserUsersRelations`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `AuthUserUsersRelationsHistory`
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `AuthUsers`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `AuthUsers`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `AuthUsers`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `AuthUsersHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `AutoRoleRules`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `AutoRoleRules`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `AutoRoleRules`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `AutoRoleRulesHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `AutoRoles`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `AutoRoles`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `AutoRoles`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `AutoRolesHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `Clients`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `Clients`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `Clients`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ClientsHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `GameServers`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `GameServers`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `GameServers`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `GameServersHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `KnownUsers`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `KnownUsers`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `KnownUsers`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `KnownUsersHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `Levels`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `Levels`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `Levels`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `LevelsHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `Servers`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `Servers`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `Servers`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ServersHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `UserGameIdents`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserGameIdents`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserGameIdents`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `UserGameIdentsHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `UserJoinedGameServer`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserJoinedGameServer`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserJoinedGameServer`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `UserJoinedGameServerHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `UserJoinedServers`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserJoinedServers`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserJoinedServers`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `UserJoinedServersHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `UserJoinedVoiceChannel`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserJoinedVoiceChannel`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserJoinedVoiceChannel`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `UserJoinedVoiceChannelHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `UserMessageCountPerHour`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserMessageCountPerHour`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserMessageCountPerHour`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `UserMessageCountPerHourHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `UserWarnings`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserWarnings`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `UserWarnings`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `UserWarningsHistory`
|
||||
(
|
||||
|
@ -1,11 +1,8 @@
|
||||
ALTER TABLE `Users`
|
||||
MODIFY `LastModifiedAt` DATETIME(6) NULL ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `Users`
|
||||
CHANGE `CreatedAt` `CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
|
||||
ALTER TABLE `Users`
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6);
|
||||
CHANGE `LastModifiedAt` `LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `UsersHistory`
|
||||
(
|
||||
|
@ -30,7 +30,6 @@ type UserHistory implements HistoryTableQuery {
|
||||
xp: Int
|
||||
|
||||
server: ID
|
||||
leftServer: Boolean
|
||||
|
||||
deleted: Boolean
|
||||
dateFrom: String
|
||||
|
@ -10,7 +10,6 @@ class UserHistoryQuery(HistoryQueryABC):
|
||||
self.set_field("discordId", self.resolve_discord_id)
|
||||
self.set_field("xp", self.resolve_xp)
|
||||
self.set_field("server", self.resolve_server)
|
||||
self.set_field("leftServer", self.resolve_left_server)
|
||||
|
||||
@staticmethod
|
||||
def resolve_id(user: User, *_):
|
||||
@ -27,7 +26,3 @@ class UserHistoryQuery(HistoryQueryABC):
|
||||
@staticmethod
|
||||
def resolve_server(user: User, *_):
|
||||
return user.server
|
||||
|
||||
@staticmethod
|
||||
def resolve_left_server(user: User, *_):
|
||||
return user.left_server
|
||||
|
@ -133,7 +133,6 @@ export class Queries {
|
||||
discordId
|
||||
xp
|
||||
server
|
||||
leftServer
|
||||
deleted
|
||||
dateFrom
|
||||
dateTo
|
||||
|
@ -20,8 +20,20 @@ export class HistoryBtnComponent implements OnInit {
|
||||
}
|
||||
|
||||
openHistory(): void {
|
||||
console.log("history", this.history);
|
||||
this.showSidebar = true;
|
||||
let oldHistory: Partial<History> = {};
|
||||
for (const history of this.history) {
|
||||
const attributes = Object.keys(history).map((key) => {
|
||||
return key;
|
||||
});
|
||||
for (const attribute of attributes) {
|
||||
if (history[attribute] === oldHistory[attribute]) {
|
||||
delete oldHistory[attribute];
|
||||
}
|
||||
}
|
||||
|
||||
oldHistory = history;
|
||||
}
|
||||
}
|
||||
|
||||
getAttributeTranslationKey(key: string) {
|
||||
|
@ -1 +0,0 @@
|
||||
<p>history works!</p>
|
@ -1,23 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HistoryComponent } from './history.component';
|
||||
|
||||
describe('HistoryComponent', () => {
|
||||
let component: HistoryComponent;
|
||||
let fixture: ComponentFixture<HistoryComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ HistoryComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(HistoryComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,10 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-history',
|
||||
templateUrl: './history.component.html',
|
||||
styleUrls: ['./history.component.scss']
|
||||
})
|
||||
export class HistoryComponent {
|
||||
|
||||
}
|
@ -23,7 +23,6 @@ import { PanelModule } from "primeng/panel";
|
||||
import { InputNumberModule } from "primeng/inputnumber";
|
||||
import { ImageModule } from "primeng/image";
|
||||
import { SidebarModule } from "primeng/sidebar";
|
||||
import { HistoryComponent } from "./components/history/history.component";
|
||||
import { HistoryBtnComponent } from './components/history-btn/history-btn.component';
|
||||
|
||||
|
||||
@ -32,7 +31,6 @@ import { HistoryBtnComponent } from './components/history-btn/history-btn.compon
|
||||
AuthRolePipe,
|
||||
IpAddressPipe,
|
||||
BoolPipe,
|
||||
HistoryComponent,
|
||||
HistoryBtnComponent,
|
||||
],
|
||||
imports: [
|
||||
|
@ -9,7 +9,7 @@ function Main(): void {
|
||||
setVersion(version);
|
||||
})
|
||||
.catch(err => {
|
||||
throwError(() => err);
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ async function setVersion(version: SoftwareVersion) {
|
||||
const fs = require("fs");
|
||||
fs.readFile(jsonFilePath, "utf8", (err: Error, data: string) => {
|
||||
if (err) {
|
||||
throwError(() => err);
|
||||
throw err;
|
||||
}
|
||||
const settings: Appsettings = JSON.parse(data);
|
||||
settings.WebVersion = version;
|
||||
@ -59,7 +59,7 @@ async function setVersion(version: SoftwareVersion) {
|
||||
});
|
||||
fs.readFile('./package.json', "utf8", (err: Error, data: string) => {
|
||||
if (err) {
|
||||
throwError(() => err);
|
||||
throw err;
|
||||
}
|
||||
const settings = JSON.parse(data);
|
||||
settings.version = version.getVersionString();
|
||||
|
Loading…
Reference in New Issue
Block a user