Updated backend to provide support for the overview tab
Updated frontend to parse chunks
This commit is contained in:
parent
d7b91d4dec
commit
da24c43a7d
|
@ -152,7 +152,7 @@ public static partial class Db
|
|||
|
||||
public static void AddCsvTimestamp(CsvTimestamp newCsvTimestamp,int installationId)
|
||||
{
|
||||
var maxCSvPerInstallation = 2 * 60 * 24;
|
||||
var maxCSvPerInstallation = 60 * 24;
|
||||
//Find the total number of warnings for this installation
|
||||
var totalCsvNames = CsvTimestamps.Count(csvTimestamp => csvTimestamp.InstallationId == installationId);
|
||||
|
||||
|
@ -172,7 +172,7 @@ public static partial class Db
|
|||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("---------------Added the new Csv Timestamp to the database-----------------");
|
||||
//Console.WriteLine("---------------Added the new Csv Timestamp to the database-----------------");
|
||||
Create(newCsvTimestamp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public static class RabbitMqManager
|
|||
{
|
||||
Installation installation = Db.Installations.FirstOrDefault(f => f.Product == receivedStatusMessage.Product && f.S3BucketId == receivedStatusMessage.InstallationId);
|
||||
int installationId = (int )installation.Id;
|
||||
Console.WriteLine("Received a message from installation: " + installationId + " , product is: "+receivedStatusMessage.Product+ " and status is: " + receivedStatusMessage.Status);
|
||||
//Console.WriteLine("Received a message from installation: " + installationId + " , product is: "+receivedStatusMessage.Product+ " and status is: " + receivedStatusMessage.Status);
|
||||
|
||||
//This is a heartbit message, just update the timestamp for this installation.
|
||||
//There is no need to notify the corresponding front-ends.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#define Amax
|
||||
#undef Amax
|
||||
#undef GridLimit
|
||||
|
||||
using System.Diagnostics;
|
||||
|
@ -728,7 +728,7 @@ internal static class Program
|
|||
Console.WriteLine("ERROR: PUT");
|
||||
var error = await response.GetStringAsync();
|
||||
Console.WriteLine(error);
|
||||
Heartbit(0);
|
||||
Heartbit(new DateTime(0));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -745,6 +745,7 @@ internal static class Program
|
|||
{
|
||||
var s3Bucket = Config.Load().S3?.Bucket;
|
||||
int.TryParse(s3Bucket?.Split("-")[0], out var installationId);
|
||||
|
||||
int.TryParse(timeStamp.ToUnixTime().ToString(), out var nameOfCsvFile);
|
||||
|
||||
var returnedStatus = new StatusMessage
|
||||
|
|
|
@ -418,20 +418,20 @@ function MainStats(props: MainStatsProps) {
|
|||
<ArrowBackIcon />
|
||||
</IconButton>
|
||||
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={handleSetDate}
|
||||
disabled={loading}
|
||||
sx={{
|
||||
marginTop: '20px',
|
||||
marginLeft: '20px',
|
||||
backgroundColor: dateOpen ? '#808080' : '#ffc04d',
|
||||
color: '#000000',
|
||||
'&:hover': { bgcolor: '#f7b34d' }
|
||||
}}
|
||||
>
|
||||
<FormattedMessage id="set_date" defaultMessage="Set Date" />
|
||||
</Button>
|
||||
{/*<Button*/}
|
||||
{/* variant="contained"*/}
|
||||
{/* onClick={handleSetDate}*/}
|
||||
{/* disabled={loading}*/}
|
||||
{/* sx={{*/}
|
||||
{/* marginTop: '20px',*/}
|
||||
{/* marginLeft: '20px',*/}
|
||||
{/* backgroundColor: dateOpen ? '#808080' : '#ffc04d',*/}
|
||||
{/* color: '#000000',*/}
|
||||
{/* '&:hover': { bgcolor: '#f7b34d' }*/}
|
||||
{/* }}*/}
|
||||
{/*>*/}
|
||||
{/* <FormattedMessage id="set_date" defaultMessage="Set Date" />*/}
|
||||
{/*</Button>*/}
|
||||
</Grid>
|
||||
<Grid
|
||||
container
|
||||
|
|
|
@ -482,20 +482,20 @@ function Overview(props: OverviewProps) {
|
|||
<FormattedMessage id="lastweek" defaultMessage="Last week" />
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={handleSetDate}
|
||||
disabled={loading}
|
||||
sx={{
|
||||
marginTop: '20px',
|
||||
marginLeft: '10px',
|
||||
backgroundColor: dateOpen ? '#808080' : '#ffc04d',
|
||||
color: '#000000',
|
||||
'&:hover': { bgcolor: '#f7b34d' }
|
||||
}}
|
||||
>
|
||||
<FormattedMessage id="lastmonth" defaultMessage="Set Date" />
|
||||
</Button>
|
||||
{/*<Button*/}
|
||||
{/* variant="contained"*/}
|
||||
{/* onClick={handleSetDate}*/}
|
||||
{/* disabled={loading}*/}
|
||||
{/* sx={{*/}
|
||||
{/* marginTop: '20px',*/}
|
||||
{/* marginLeft: '10px',*/}
|
||||
{/* backgroundColor: dateOpen ? '#808080' : '#ffc04d',*/}
|
||||
{/* color: '#000000',*/}
|
||||
{/* '&:hover': { bgcolor: '#f7b34d' }*/}
|
||||
{/* }}*/}
|
||||
{/*>*/}
|
||||
{/* <FormattedMessage id="lastmonth" defaultMessage="Set Date" />*/}
|
||||
{/*</Button>*/}
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
|
|
|
@ -319,22 +319,22 @@ function SalidomoOverview(props: salidomoOverviewProps) {
|
|||
</LocalizationProvider>
|
||||
)}
|
||||
<Grid container>
|
||||
<Grid item xs={6} md={6}>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={handleSetDate}
|
||||
disabled={loading}
|
||||
sx={{
|
||||
marginTop: '20px',
|
||||
marginLeft: '10px',
|
||||
backgroundColor: dateOpen ? '#808080' : '#ffc04d',
|
||||
color: '#000000',
|
||||
'&:hover': { bgcolor: '#f7b34d' }
|
||||
}}
|
||||
>
|
||||
<FormattedMessage id="lastmonth" defaultMessage="Set Date" />
|
||||
</Button>
|
||||
</Grid>
|
||||
{/*<Grid item xs={6} md={6}>*/}
|
||||
{/* <Button*/}
|
||||
{/* variant="contained"*/}
|
||||
{/* onClick={handleSetDate}*/}
|
||||
{/* disabled={loading}*/}
|
||||
{/* sx={{*/}
|
||||
{/* marginTop: '20px',*/}
|
||||
{/* marginLeft: '10px',*/}
|
||||
{/* backgroundColor: dateOpen ? '#808080' : '#ffc04d',*/}
|
||||
{/* color: '#000000',*/}
|
||||
{/* '&:hover': { bgcolor: '#f7b34d' }*/}
|
||||
{/* }}*/}
|
||||
{/* >*/}
|
||||
{/* <FormattedMessage id="lastmonth" defaultMessage="Set Date" />*/}
|
||||
{/* </Button>*/}
|
||||
{/*</Grid>*/}
|
||||
|
||||
<Grid
|
||||
container
|
||||
|
|
|
@ -92,10 +92,10 @@ function SalidomoInstallationTabs() {
|
|||
/>
|
||||
)
|
||||
},
|
||||
{
|
||||
value: 'overview',
|
||||
label: <FormattedMessage id="overview" defaultMessage="Overview" />
|
||||
},
|
||||
// {
|
||||
// value: 'overview',
|
||||
// label: <FormattedMessage id="overview" defaultMessage="Overview" />
|
||||
// },
|
||||
{
|
||||
value: 'log',
|
||||
label: <FormattedMessage id="log" defaultMessage="Log" />
|
||||
|
|
Loading…
Reference in New Issue