Skip to content

Commit

Permalink
#10 - wip - update apache echarts templates.
Browse files Browse the repository at this point in the history
- deactivate logging of all report data view runs.
- use a longblob for assets.data_content instead of blob.
  • Loading branch information
spo committed Aug 29, 2024
1 parent 51c21b2 commit 2b40888
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 37 deletions.
24 changes: 12 additions & 12 deletions app/Jobs/ProcessReportJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,17 @@ public function handle(ConnectorService $connectorService, CacheService $cacheSe
ReportRunEnd::dispatch($this->execReportInfo, $this->report, $ms_elapsed);
}

$num_seconds_all_run = $this->report->num_seconds_all_run + $ms_elapsed;

if (!$this->execReportInfo->reportCacheInfo->cached) {

$this->report->update(
[
'num_runs' => ($this->report->num_runs + 1),
'num_seconds_all_run' => $num_seconds_all_run,
'avg_seconds_by_run' => $num_seconds_all_run / ($this->report->num_runs + 1),
]
);
}
// $num_seconds_all_run = $this->report->num_seconds_all_run + $ms_elapsed;
//
// if (!$this->execReportInfo->reportCacheInfo->cached) {
//
// $this->report->update(
// [
// 'num_runs' => ($this->report->num_runs + 1),
// 'num_seconds_all_run' => $num_seconds_all_run,
// 'avg_seconds_by_run' => $num_seconds_all_run / ($this->report->num_runs + 1),
// ]
// );
// }
}
}
3 changes: 2 additions & 1 deletion database/migrations/2024_08_15_073828_create_assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function up(): void
$table->foreign('organization_id')->references('id')->on('organizations')->onDelete('cascade');

$table->enum('storage_type', ['database', 'filesystem', 'online'])->default('database')->nullable(false);
$table->binary('data')->nullable(true)->comment('When storage type = database');
$table->enum('data_type', ['file', 'string'])->nullable(true)->default('string')->comment('When storage type = database');
$table->text('pathname')->nullable(true)->comment('When storage type = filesystem');
$table->text('url')->nullable(true)->comment('When storage type = online');
Expand All @@ -47,5 +46,7 @@ public function up(): void
(2, 'asset', 'asset', 1, 1, 1, 1, 1, 1, 0),
(3, 'asset', 'asset', 0, 0, 0, 0, 0, 1, 0)
");

DB ::statement("alter table assets add column data longblob default null comment 'When storage type = database'");
}
};
2 changes: 1 addition & 1 deletion storage/app/templates/data_view_lib_versions/9/bar_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const resizeObserver = new ResizeObserver((entries) => {

if(refDiv.current && chart[DATA_VIEW_JS_ID]) {

chart[DATA_VIEW_JS_ID].setOption(option);
// chart[DATA_VIEW_JS_ID].setOption(option);
resizeObserver.observe(refDiv.current.parentNode);
}
4 changes: 2 additions & 2 deletions storage/app/templates/data_view_lib_versions/9/bar_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const series = [
}
];

const option = {
chart[DATA_VIEW_JS_ID].setOption({
xAxis: {
type: 'category',
data: labels
Expand All @@ -32,4 +32,4 @@ const option = {
bottom: '5%'
},
series: series
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const resizeObserver = new ResizeObserver((entries) => {

if(refDiv.current && chart[DATA_VIEW_JS_ID]) {

chart[DATA_VIEW_JS_ID].setOption(option);
// chart[DATA_VIEW_JS_ID].setOption(option);
resizeObserver.observe(refDiv.current.parentNode);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

const labels = jsonResults.map(row => row.x_label);

const option = {
chart[DATA_VIEW_JS_ID].setOption({
xAxis: {
data: labels
},
Expand All @@ -29,4 +29,4 @@ const option = {
}),
}
]
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const resizeObserver = new ResizeObserver((entries) => {

if(refDiv.current && chart[DATA_VIEW_JS_ID]) {

chart[DATA_VIEW_JS_ID].setOption(option);
// chart[DATA_VIEW_JS_ID].setOption(option);
resizeObserver.observe(refDiv.current.parentNode);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const series = [
}
];

const option = {
chart[DATA_VIEW_JS_ID].setOption({
xAxis: {
type: 'category',
data: dataset_names
Expand All @@ -26,4 +26,4 @@ const option = {
type: 'value'
},
series: series
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const resizeObserver = new ResizeObserver((entries) => {

if(refDiv.current && chart[DATA_VIEW_JS_ID]) {

chart[DATA_VIEW_JS_ID].setOption(option);
// chart[DATA_VIEW_JS_ID].setOption(option);
resizeObserver.observe(refDiv.current.parentNode);
}
4 changes: 2 additions & 2 deletions storage/app/templates/data_view_lib_versions/9/line_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const series = [
}
];

const option = {
chart[DATA_VIEW_JS_ID].setOption({
xAxis: {
type: 'category',
data: labels
Expand All @@ -32,4 +32,4 @@ const option = {
bottom: '5%'
},
series: series
};
});
2 changes: 1 addition & 1 deletion storage/app/templates/data_view_lib_versions/9/pie_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const resizeObserver = new ResizeObserver((entries) => {

if(refDiv.current && chart[DATA_VIEW_JS_ID]) {

chart[DATA_VIEW_JS_ID].setOption(option);
// chart[DATA_VIEW_JS_ID].setOption(option);
resizeObserver.observe(refDiv.current.parentNode);
}
4 changes: 2 additions & 2 deletions storage/app/templates/data_view_lib_versions/9/pie_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const series = [
}
];

const option = {
chart[DATA_VIEW_JS_ID].setOption({
tooltip: {
trigger: 'item'
},
Expand All @@ -48,4 +48,4 @@ const option = {
left: 'center'
},
series: series
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const resizeObserver = new ResizeObserver((entries) => {

if(refDiv.current && chart[DATA_VIEW_JS_ID]) {

chart[DATA_VIEW_JS_ID].setOption(option);
// chart[DATA_VIEW_JS_ID].setOption(option);
resizeObserver.observe(refDiv.current.parentNode);
}
4 changes: 2 additions & 2 deletions storage/app/templates/data_view_lib_versions/9/radar_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const series = [
}
];

const option = {
chart[DATA_VIEW_JS_ID].setOption({
title: {
text: 'Basic Radar Chart'
},
Expand All @@ -70,4 +70,4 @@ const option = {
]
},
series: series
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const resizeObserver = new ResizeObserver((entries) => {

if(refDiv.current && chart[DATA_VIEW_JS_ID]) {

chart[DATA_VIEW_JS_ID].setOption(option);
// chart[DATA_VIEW_JS_ID].setOption(option);
resizeObserver.observe(refDiv.current.parentNode);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const series = [
}
];

const option = {
chart[DATA_VIEW_JS_ID].setOption({
xAxis: {},
yAxis: {},
grid: {
Expand All @@ -27,4 +27,4 @@ const option = {
bottom: '5%'
},
series: series
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const resizeObserver = new ResizeObserver((entries) => {

if(refDiv.current && chart[DATA_VIEW_JS_ID]) {

chart[DATA_VIEW_JS_ID].setOption(option);
// chart[DATA_VIEW_JS_ID].setOption(option);
resizeObserver.observe(refDiv.current.parentNode);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jsonResults.forEach(row => {
}
});

const option = {
chart[DATA_VIEW_JS_ID].setOption({
tooltip: {
trigger: 'axis'
},
Expand Down Expand Up @@ -74,4 +74,4 @@ const option = {
type: 'value'
},
series: data_series
};
});

0 comments on commit 2b40888

Please sign in to comment.