Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

feat: update web app console #205

Merged
merged 95 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
a15786b
feat(web-app): upgrade next js version from 13.3.0 to 14.0.1
bryan-stclab Nov 9, 2023
f608385
feat(web-app): add omitted configurations and remove additional codes…
bryan-stclab Nov 13, 2023
6db8d47
feat(web-app): add welcome page
bryan-stclab Nov 13, 2023
6bd2898
refactor(web-app): refactor welcome page
bryan-stclab Nov 13, 2023
3ce6e63
feat(web-app): add layout component
bryan-stclab Nov 13, 2023
29a49da
feat(web-app): add menu component
bryan-stclab Nov 13, 2023
8be0e8c
refactor(web-app): refactor menu component
bryan-stclab Nov 13, 2023
f6e9d80
fix(web-app): edit svg file location and replace svg file
bryan-stclab Nov 13, 2023
033c0e7
feat(web-app): add favicon file
bryan-stclab Nov 13, 2023
7e5b93a
feat(web-app): add theme extend properties and edit spelling
bryan-stclab Nov 13, 2023
10cfb20
feat(web-app): add web-app metadata
bryan-stclab Nov 13, 2023
5857d5c
fix(web-app): edit web-app content header
bryan-stclab Nov 13, 2023
b52f191
feat(web-app): add web-app maximum width with md property
bryan-stclab Nov 13, 2023
528f95e
feat(web-app): add autoscaling history page header
bryan-stclab Nov 13, 2023
a6808fa
refactor(web-app): add history heatmap properties and fix to compromi…
bryan-stclab Nov 13, 2023
37accc7
fix(web-app): remove unnecesaary property
bryan-stclab Nov 14, 2023
ce289e1
feat(web-app): add indent flag to key value renderer utility
bryan-stclab Nov 14, 2023
4678da5
feat(web-app): add autoscaling history component
bryan-stclab Nov 14, 2023
cd03897
refactor(web-app): use nullish coalescing and optimize class name fun…
bryan-stclab Nov 14, 2023
9f1cacb
fix(web-app): edit omit property to key value renderer utility
bryan-stclab Nov 14, 2023
6bfef31
refactor(web-app): edit autoscaling history component and edit get hi…
bryan-stclab Nov 14, 2023
7154852
refactor(web-app): content header using interface
bryan-stclab Nov 14, 2023
c41aaea
refactor(web-app): refactor history heat map component
bryan-stclab Nov 14, 2023
6e0562c
feat(web-app): add flex weight to autoscaling history component
bryan-stclab Nov 14, 2023
dbef0d1
fix(web-app): edit back ground bug from tailwind css
bryan-stclab Nov 14, 2023
0819b54
feat(web-app): add tailwind configuration properties
bryan-stclab Nov 14, 2023
5eed709
fix(web-app): prevent possible error log for data compatibility
bryan-stclab Nov 14, 2023
b208ad1
feat(web-app): add check all function to autoscaling history component
bryan-stclab Nov 14, 2023
9a1872f
fix(web-app): edit priority value for folded situation in largest con…
bryan-stclab Nov 14, 2023
5c8ae8a
feat(web-app): add badge design in autoscaling history component
bryan-stclab Nov 14, 2023
714e0fd
feat(web-app): add default page
bryan-stclab Nov 14, 2023
378da49
fix(web-app): edit date format
bryan-stclab Nov 15, 2023
8a0c81f
fix(web-app): edit path include expression
bryan-stclab Nov 15, 2023
5b4090a
feat(web-app): add tailwind css config with red, gray, and blue for b…
bryan-stclab Nov 17, 2023
c3ec9bd
fix(web-app): edit content header design
bryan-stclab Nov 17, 2023
928ffdb
feat(web-app): add responsive web design frame
bryan-stclab Nov 17, 2023
34ddefe
feat(web-app): add planning component layout and type
bryan-stclab Nov 17, 2023
4a6d11a
fix(web-app): edit autoscaling history frame
bryan-stclab Nov 17, 2023
1e0db48
feat(web-app): add and edit overall planning component, page, and layout
bryan-stclab Nov 17, 2023
41de247
fix(web-app): edit autoscaling history component layout
bryan-stclab Nov 17, 2023
566b7f2
fix(web-app): edit common frame for drawers
bryan-stclab Nov 17, 2023
f609c54
refactor(web-app): edit code with common convention and remove unnece…
bryan-stclab Nov 17, 2023
cb7d6dc
fix(web-app): add class design for common layout in autoscaling history
bryan-stclab Nov 17, 2023
7bd1bd8
fix(web-app): edit import statements for common convention
bryan-stclab Nov 17, 2023
c78c3dd
fix(web-app): edit bug caculating time for today and checkbox design
bryan-stclab Nov 17, 2023
7e15adc
feat(web-app): add additional minimum height 14 with 56px
bryan-stclab Nov 17, 2023
01fabee
fix(web-app): add minimum width in tailwind css, edit design to trunc…
bryan-stclab Nov 17, 2023
4d826e3
feat(web-app): add scaling components page and layout
bryan-stclab Nov 17, 2023
98d6393
fix(web-app): edit default select option value
bryan-stclab Nov 17, 2023
e5e4692
feat(web-app): add metrics page and component
bryan-stclab Nov 17, 2023
db40885
fix(web-app): edit design for focus outline on calendar
bryan-stclab Nov 17, 2023
b77ae5f
fix(web-app): edit scaling component element tag layer
bryan-stclab Nov 19, 2023
2cb146c
feat(web-app): add properties in overall layout with specific urls
bryan-stclab Nov 19, 2023
2abc751
feat(web-app): add layout properties in metric drawer
bryan-stclab Nov 19, 2023
ecbf763
feat(web-app): add layout properties in scaling components drawer
bryan-stclab Nov 19, 2023
a75a389
feat(web-app): edit metadata form controller utility with common design
bryan-stclab Nov 19, 2023
800123e
fix(web-app): add layout properties in autoscaling history page
bryan-stclab Nov 19, 2023
4aaa320
feat(web-app): add metric drawer component
bryan-stclab Nov 19, 2023
f06768b
feat(web-app): add scaling component drawer component
bryan-stclab Nov 19, 2023
49b305f
feat(web-app): add drawer initialize image added in drawer features
bryan-stclab Nov 19, 2023
b32666d
fix(web-app): edit common word design to metrics and scaling components
bryan-stclab Nov 19, 2023
a163582
fix(web-app): edit reset button
bryan-stclab Nov 19, 2023
39f2b20
fix(web-app): edit main menu and sub menu design
bryan-stclab Nov 19, 2023
3a9953e
fix(web-app): edit table common design
bryan-stclab Nov 19, 2023
4cf0f72
feat(web-app): add plan new page layout
bryan-stclab Nov 19, 2023
8b0cf19
feat(web-app): add plan drawer removing from sidebar
bryan-stclab Nov 19, 2023
3fb20cb
feat(web-app): add layout conditional url for planning
bryan-stclab Nov 19, 2023
8c85756
fix(web-app): edit planning sidebar title design with minimum height
bryan-stclab Nov 19, 2023
a0f7b10
feat(web-app): remove redirection in configuration, and add redirecti…
bryan-stclab Nov 19, 2023
d4683c2
fix(web-app): add possible data value in generate plan definition for…
bryan-stclab Nov 19, 2023
cc2448c
feat(web-app): add initialize button, logic, and edit submit target b…
bryan-stclab Nov 19, 2023
93e71d2
refactor(web-app): refactor scaling components page
bryan-stclab Nov 19, 2023
2ebab01
refactor(web-app): refactor planning details layout
bryan-stclab Nov 19, 2023
69e5080
refactor(web-app): remove comments in planning page
bryan-stclab Nov 19, 2023
7e3a9dd
refactor(web-app): refactor overall layout
bryan-stclab Nov 19, 2023
7945a18
refactor(web-app): refactor metrics layout error variable name
bryan-stclab Nov 19, 2023
f7fa15f
refactor(web-app): refactor menu component using independent function
bryan-stclab Nov 19, 2023
f196dfe
refactor(web-app): refactor planning details tab component using inde…
bryan-stclab Nov 19, 2023
3b4b247
refactor(web-app): refactor plan binding to generate plan definition …
bryan-stclab Nov 19, 2023
18fb1ce
refactor(web-app): refactor metrics page using inner try catch and re…
bryan-stclab Nov 19, 2023
9ae5e4e
refactor(web-app): refactor scaling components layout using inner try…
bryan-stclab Nov 19, 2023
6ac9e9f
refactor(web-app): refactor scaling components detail layout using fa…
bryan-stclab Nov 19, 2023
b0a6e29
refactor(web-app): refactor metrics detail layout using fast return s…
bryan-stclab Nov 19, 2023
10fc977
refactor(web-app): add uncaught path in planning details tab
bryan-stclab Nov 19, 2023
a7acec5
refactor(web-app): refactor separate control and view part in metadat…
bryan-stclab Nov 19, 2023
7c491de
refactor(web-app): refactor autoscaling history page with simple date…
bryan-stclab Nov 19, 2023
a6ec7a2
refactor(web-app): refactor variable from e to event for common reada…
bryan-stclab Nov 19, 2023
1046cb8
fix(web-app): revert layout for new metrics and scaling components
bryan-stclab Nov 19, 2023
a40ae52
refactor(web-app): refactor layout for scaling components layout and …
bryan-stclab Nov 19, 2023
c416ddb
refactor(web-app): refactor planning tabs using simple function and r…
bryan-stclab Nov 19, 2023
c01f4eb
refactor(web-app): refactor plan component side bar handling undefine…
bryan-stclab Nov 19, 2023
fec17e8
refactor(web-app): refactor next config js for removing redirects
bryan-stclab Nov 19, 2023
6c150eb
refactor(web-app): refactor planning drawer with connection between h…
bryan-stclab Nov 19, 2023
b668bee
refactor(web-app): refactor drawers removing unnecessary statements a…
bryan-stclab Nov 19, 2023
5a95caf
Merge branch 'main' of https://github.com/STCLab-Inc/wave-autoscale i…
bryan-stclab Nov 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions core/web-app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ const nextConfig = {
appDir: true,
esmExternals: 'loose',
},
async redirects() {
return [
{
source: '/app/planning/:id',
destination: '/app/planning/:id/diagram',
permanent: true,
},
];
},
headers:
process.env.NODE_ENV === 'development'
? () => [
Expand Down
816 changes: 542 additions & 274 deletions core/web-app/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions core/web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
"daisyui": "^2.51.5",
"dayjs": "^1.11.7",
"eslint": "8.38.0",
"eslint-config-next": "13.3.0",
"eslint-config-next": "^14.0.1",
"immer": "^10.0.2",
"lodash": "^4.17.21",
"nanoid": "^4.0.2",
"next": "13.3.0",
"react": "18.2.0",
"next": "^14.0.1",
"react": "^18.2.0",
"react-ace": "^10.1.0",
"react-dom": "18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.43.9",
"reactflow": "^11.7.0",
"typescript": "5.0.4",
Expand Down
5 changes: 5 additions & 0 deletions core/web-app/public/assets/icons/delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions core/web-app/public/assets/images/wave-autoscale_symbol.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions core/web-app/public/assets/images/wave-autoscale_text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 38 additions & 22 deletions core/web-app/src/app/app/autoscaling-history/history-heatmap.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use client';

import { ResponsiveHeatMapCanvas } from '@nivo/heatmap';
import dayjs, { Dayjs } from 'dayjs';
import { groupBy } from 'lodash';
Expand All @@ -10,16 +8,17 @@ interface HistoryHeatmapProps {
from: Dayjs;
to: Dayjs;
}

function HistoryHeatmap({ history, from, to }: HistoryHeatmapProps) {
const dataForHeatmap = useMemo(() => {
if (!history) {
return [];
}
const groupedByDate = groupBy(history, (historyItem) => {
return dayjs.unix(historyItem.created_at).format('YYYY-MM-DD');
});

// Fill in missing dates
const groupedByDate = groupBy(history, (historyItem) =>
dayjs.unix(historyItem.created_at / 1000).format('YYYY-MM-DD')
);

let current = from;
while (current.isBefore(to) || current.isSame(to)) {
const date = current.format('YYYY-MM-DD');
Expand All @@ -30,15 +29,12 @@ function HistoryHeatmap({ history, from, to }: HistoryHeatmapProps) {
}

const data = Object.entries(groupedByDate)
.sort(([dateA], [dateB]) => {
return dateA < dateB ? -1 : 1;
})
.sort(([dateA], [dateB]) => (dateA < dateB ? -1 : 1))
.map(([date, historyItems]) => {
const groupedByHour = groupBy(historyItems, (historyItem) => {
return dayjs.unix(historyItem.created_at).format('HH');
});
const groupedByHour = groupBy(historyItems, (historyItem) =>
dayjs.unix(historyItem.created_at / 1000).format('HH')
);

// Fill in missing hours
for (let i = 0; i < 24; i++) {
const hour = i.toString().padStart(2, '0');
if (!groupedByHour[hour]) {
Expand All @@ -54,10 +50,16 @@ function HistoryHeatmap({ history, from, to }: HistoryHeatmapProps) {
return {
x: hour,
y: historyItems.length,
z: historyItems.some(
(historyItem) => historyItem.fail_message !== undefined
)
? 'Failed'
: 'Success',
};
}),
};
});

return data;
}, [history, from, to]);

Expand All @@ -76,28 +78,24 @@ function HistoryHeatmap({ history, from, to }: HistoryHeatmapProps) {
return (
<div className="h-80 w-full">
<ResponsiveHeatMapCanvas
// forceSquare={true}
data={dataForHeatmap}
xInnerPadding={0.1}
yInnerPadding={0.1}
margin={{ top: 70, right: 80, bottom: 20, left: 120 }}
margin={{ top: 50, right: 70, bottom: 30, left: 140 }}
axisTop={{
tickSize: 0,
tickPadding: 10,
// tickRotation: -90,
legend: 'Time',
legendOffset: -40,
legendPosition: 'middle',
}}
axisLeft={{
tickSize: 0,
tickPadding: 20,
tickRotation: 0,
format: (value) => value.replace(/-/g, '/'),
}}
colors={{
type: 'diverging',
divergeAt: 0.4,
scheme: 'greens',
divergeAt: 0.3,
scheme: 'turbo',
minValue: 0,
maxValue,
}}
Expand All @@ -107,9 +105,27 @@ function HistoryHeatmap({ history, from, to }: HistoryHeatmapProps) {
enableLabels={true}
labelTextColor={{
from: 'color',
modifiers: [['brighter', 2]],
modifiers: [['brighter', 3]],
}}
annotations={[]}
tooltip={({ cell }) => (
<div
className={`p-2 text-white shadow-md ${
cell.data.z === 'Failed' ? 'bg-[#E0242E]' : 'bg-[#074EAB]'
}`}
>
<div className="text-xs">
Date: {cell.serieId.replace(/-/g, '/')}
</div>
<div className="text-xs">
Time: {cell.data.x}:00~{cell.data.x}:59
</div>
<div className="text-xs">Activity: {cell.data.y}</div>
{cell.data.z === 'Failed' ? (
<div className="text-xs">Status: {cell.data.z}</div>
) : null}
</div>
)}
/>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion core/web-app/src/app/app/autoscaling-history/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export default async function AutoscalingHistoryLayout({
}: {
children: React.ReactNode;
}) {
return <div className="flex h-full w-full">{children}</div>;
return <div className="flex h-full w-full flex-row">{children}</div>;
}
Loading