This commit is contained in:
@@ -37,6 +37,7 @@ todo: api / server landing page is shitty on a mobile
|
|||||||
todo: Should server show uptime somewhere?
|
todo: Should server show uptime somewhere?
|
||||||
todo: Log configuration into server log at startup? https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3523
|
todo: Log configuration into server log at startup? https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3523
|
||||||
log all config settings into server log on boot
|
log all config settings into server log on boot
|
||||||
|
todo:aycontext clean up old block of weird definitions
|
||||||
todo: Is there a log that records past jobs, how long can they be viewed?
|
todo: Is there a log that records past jobs, how long can they be viewed?
|
||||||
todo: Rename the link to AyaNova App on the server page to just "AyaNova"
|
todo: Rename the link to AyaNova App on the server page to just "AyaNova"
|
||||||
todo: translation cjkindex, no way to set this value currently
|
todo: translation cjkindex, no way to set this value currently
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ namespace AyaNova.Biz
|
|||||||
ServerStateChange=9,
|
ServerStateChange=9,
|
||||||
SeedDatabase=10,
|
SeedDatabase=10,
|
||||||
AttachmentModified=11,
|
AttachmentModified=11,
|
||||||
EraseAllData=12
|
EraseAllData=12,
|
||||||
|
ResetSerial=13
|
||||||
|
|
||||||
//NEW ITEMS REQUIRE translation KEYS and update CLIENT ay-history.vue code in eventypes list and translation fetcher
|
//NEW ITEMS REQUIRE translation KEYS and update CLIENT ay-history.vue code in eventypes list and translation fetcher
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace AyaNova.Biz
|
|||||||
return null;
|
return null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// newObject.Serial = ServerBootConfig.WIDGET_SERIAL.GetNext();
|
// newObject.Serial = ServerBootConfig.WIDGET_SERIAL.GetNext();
|
||||||
newObject.Tags = TagUtil.NormalizeTags(newObject.Tags);
|
newObject.Tags = TagUtil.NormalizeTags(newObject.Tags);
|
||||||
newObject.CustomFields = JsonUtil.CompactJson(newObject.CustomFields);
|
newObject.CustomFields = JsonUtil.CompactJson(newObject.CustomFields);
|
||||||
await ct.Widget.AddAsync(newObject);
|
await ct.Widget.AddAsync(newObject);
|
||||||
@@ -98,7 +98,7 @@ namespace AyaNova.Biz
|
|||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//UPDATE
|
//UPDATE
|
||||||
//
|
//
|
||||||
@@ -172,16 +172,31 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//RESET SERIAL
|
//RESET SERIAL
|
||||||
//
|
//
|
||||||
internal async Task<bool> ResetSerial(long newSerial)
|
internal async Task<bool> ResetSerial(long newSerial)
|
||||||
{
|
{
|
||||||
|
|
||||||
await ct.SaveChangesAsync();
|
/*
|
||||||
|
ALTER TABLE table_name
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, BizType, AyaEvent.ResetSerial,newSerial.ToString()), ct);
|
ALTER COLUMN column_name
|
||||||
|
{ SET GENERATED { ALWAYS| BY DEFAULT } |
|
||||||
|
SET sequence_option | RESTART [ [ WITH ] restart ] }
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using (var command = ct.Database.GetDbConnection().CreateCommand())
|
||||||
|
{
|
||||||
|
command.CommandText = $"alter table awidget alter column serial restart with {newSerial}";
|
||||||
|
await ct.Database.OpenConnectionAsync();
|
||||||
|
await command.ExecuteNonQueryAsync();
|
||||||
|
await ct.Database.CloseConnectionAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, 0, BizType, AyaEvent.ResetSerial, newSerial.ToString()), ct);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,6 +115,16 @@ namespace AyaNova.Models
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///////////////////////////////
|
||||||
|
//SERIALIZED OBJECTS
|
||||||
|
//
|
||||||
|
modelBuilder.Entity<Widget>().Property(z => z.Serial).UseIdentityByDefaultColumn();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
//TODO: this entire block is almost certainly wrong or not required
|
||||||
|
|
||||||
//Indexes must be specified through fluent api unfortunately
|
//Indexes must be specified through fluent api unfortunately
|
||||||
modelBuilder.Entity<FileAttachment>().HasIndex(p => p.StoredFileName);
|
modelBuilder.Entity<FileAttachment>().HasIndex(p => p.StoredFileName);
|
||||||
|
|
||||||
@@ -136,14 +146,11 @@ namespace AyaNova.Models
|
|||||||
.WithOne(i => i.User)
|
.WithOne(i => i.User)
|
||||||
.HasForeignKey<Widget>(b => b.UserId)
|
.HasForeignKey<Widget>(b => b.UserId)
|
||||||
.OnDelete(DeleteBehavior.NoAction);
|
.OnDelete(DeleteBehavior.NoAction);
|
||||||
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
modelBuilder.Entity<Widget>().Property(z => z.Serial).UseIdentityByDefaultColumn();
|
|
||||||
|
|
||||||
// //Workorder
|
|
||||||
// modelBuilder.Entity<WorkOrderItem>()
|
|
||||||
// .HasOne(p => p.WorkOrder)
|
|
||||||
// .WithMany(b => b.WorkorderItems);
|
|
||||||
|
|
||||||
|
|
||||||
//-----------
|
//-----------
|
||||||
|
|||||||
@@ -1646,6 +1646,7 @@
|
|||||||
"EventLicenseTrialRequest": "Testlizenz angefordert",
|
"EventLicenseTrialRequest": "Testlizenz angefordert",
|
||||||
"EventServerStateChange": "Serverstatus geändert",
|
"EventServerStateChange": "Serverstatus geändert",
|
||||||
"EventSeedDatabase": "Datenbank mit Beispieldaten erstellt",
|
"EventSeedDatabase": "Datenbank mit Beispieldaten erstellt",
|
||||||
|
"EventResetSerial":"Seriennummer zurückgesetzt",
|
||||||
"NoType": "Kein Typ",
|
"NoType": "Kein Typ",
|
||||||
"License": "Lizenz",
|
"License": "Lizenz",
|
||||||
"LogFile": "Logdatei",
|
"LogFile": "Logdatei",
|
||||||
|
|||||||
@@ -1646,6 +1646,7 @@
|
|||||||
"EventLicenseTrialRequest": "Trial license requested",
|
"EventLicenseTrialRequest": "Trial license requested",
|
||||||
"EventServerStateChange": "Server state changed",
|
"EventServerStateChange": "Server state changed",
|
||||||
"EventSeedDatabase": "Database seeded with trial data",
|
"EventSeedDatabase": "Database seeded with trial data",
|
||||||
|
"EventResetSerial":"Serial number reset",
|
||||||
"NoType": "No type",
|
"NoType": "No type",
|
||||||
"License": "License",
|
"License": "License",
|
||||||
"LogFile": "Log file",
|
"LogFile": "Log file",
|
||||||
|
|||||||
@@ -1646,6 +1646,7 @@
|
|||||||
"EventLicenseTrialRequest": "Licencia de prueba solicitada",
|
"EventLicenseTrialRequest": "Licencia de prueba solicitada",
|
||||||
"EventServerStateChange": "Estado del servidor cambiado",
|
"EventServerStateChange": "Estado del servidor cambiado",
|
||||||
"EventSeedDatabase": "Base de datos creada con datos de muestra",
|
"EventSeedDatabase": "Base de datos creada con datos de muestra",
|
||||||
|
"EventResetSerial":"Restablecimiento de número de serie",
|
||||||
"NoType": "Sin tipo",
|
"NoType": "Sin tipo",
|
||||||
"License": "Licencia",
|
"License": "Licencia",
|
||||||
"LogFile": "Archivo de registro",
|
"LogFile": "Archivo de registro",
|
||||||
|
|||||||
@@ -1646,6 +1646,7 @@
|
|||||||
"EventLicenseTrialRequest": "Licence d'essai demandée",
|
"EventLicenseTrialRequest": "Licence d'essai demandée",
|
||||||
"EventServerStateChange": "L'état du serveur a changé",
|
"EventServerStateChange": "L'état du serveur a changé",
|
||||||
"EventSeedDatabase": "Base de données créée avec des exemples de données",
|
"EventSeedDatabase": "Base de données créée avec des exemples de données",
|
||||||
|
"EventResetSerial":"Réinitialisation du numéro de série",
|
||||||
"NoType": "Aucun type",
|
"NoType": "Aucun type",
|
||||||
"License": "Licence",
|
"License": "Licence",
|
||||||
"LogFile": "Fichier journal",
|
"LogFile": "Fichier journal",
|
||||||
|
|||||||
Reference in New Issue
Block a user