Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support ui 2.0 add logs view #5357

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
35fd44b
feat: datePicker
mlhiter Jan 7, 2025
220498c
feat: header ui
mlhiter Jan 7, 2025
abdc473
fix: DatePicker input status bug
mlhiter Jan 8, 2025
577f502
feat: header ui
mlhiter Jan 8, 2025
e5a6ef5
feat: log number ui
mlhiter Jan 8, 2025
38caebd
feat: LogCount ui
mlhiter Jan 8, 2025
2f5f372
add layout
zjy365 Jan 8, 2025
b4b8549
update layouts
zjy365 Jan 8, 2025
c3f7c78
add AdvancedInfo
zjy365 Jan 8, 2025
83e82e5
chore: move file to page/log
mlhiter Jan 8, 2025
82f9196
chore: move log component to log/component
mlhiter Jan 8, 2025
9641e39
fix: add contains and not contains operator
mlhiter Jan 8, 2025
2fe9151
feat: log list header ui
mlhiter Jan 8, 2025
0881533
update index
zjy365 Jan 8, 2025
33a0f69
feat: log table ui
mlhiter Jan 8, 2025
227bd4b
chore: i18n adjust
mlhiter Jan 9, 2025
fd51b97
fix: pod and container
mlhiter Jan 9, 2025
06ef82e
update style
zjy365 Jan 10, 2025
87cbb60
update monitor
zjy365 Jan 10, 2025
c51aa04
update pages
zjy365 Jan 13, 2025
ef6a1b5
chore: adjust logs components position
mlhiter Jan 13, 2025
9dd0a3a
fix: select placeholder
mlhiter Jan 13, 2025
caac274
add api
zjy365 Jan 15, 2025
f893606
update logs
zjy365 Jan 20, 2025
68c7b2c
add logs & filter & logCounts
zjy365 Jan 21, 2025
27f4d5b
update logs
zjy365 Jan 21, 2025
e961162
update
zjy365 Jan 22, 2025
7ca41a4
update MonitorChart
zjy365 Jan 22, 2025
d091443
add prevFieldList
zjy365 Jan 22, 2025
04d3026
update api
zjy365 Jan 22, 2025
cda4a4f
delete table
zjy365 Jan 22, 2025
ab4da35
update log api
zjy365 Jan 23, 2025
f3f453a
update scroll
zjy365 Jan 23, 2025
d400e28
update common.json
zjy365 Jan 23, 2025
c1a7537
update defaultRecentDate
zjy365 Jan 23, 2025
390b6ab
fix
zjy365 Jan 23, 2025
1669a21
update keys
zjy365 Jan 24, 2025
f366c1e
update timerange
zjy365 Jan 24, 2025
4cb4c7c
done
zjy365 Jan 25, 2025
e9f1562
update datepicker
zjy365 Feb 7, 2025
88cd09d
add queryPodList api
zjy365 Feb 8, 2025
12d5c14
update podname
zjy365 Feb 8, 2025
e4f50cb
fix init pods
zjy365 Feb 10, 2025
e92b472
fix ReleaseModal
zjy365 Feb 10, 2025
5a8b4ec
delete release-modal
zjy365 Feb 10, 2025
ef7f3ac
fix log height
zjy365 Feb 10, 2025
2ecace9
fix pvc bug
zjy365 Feb 11, 2025
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
11 changes: 10 additions & 1 deletion frontend/packages/ui/src/components/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ const MySelect = (
}
});

const activeMenu = useMemo(() => list.find((item) => item.value === value), [list, value]);
const activeMenu = useMemo(() => {
const foundItem = list.find((item) => item.value === value);
if (!foundItem && value) {
return {
label: value,
value: value
};
}
return foundItem;
}, [list, value]);

return (
<Menu autoSelect={false} isOpen={isOpen} onOpen={onOpen} onClose={onClose}>
Expand Down
10 changes: 10 additions & 0 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/providers/applaunchpad/data/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ launchpad:
url: http://launchpad-monitor.sealos.svc.cluster.local:8428
billing:
url: "http://account-service.account-system.svc:2333"
log:
url: "http://service-vlogs.sealos.svc.cluster.local:8428"
appResourceFormSliderConfig:
default:
cpu: [100, 200, 500, 1000, 2000, 3000, 4000, 8000]
Expand Down
3 changes: 3 additions & 0 deletions frontend/providers/applaunchpad/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
"@sealos/driver": "workspace:^",
"@sealos/ui": "workspace:^",
"@tanstack/react-query": "^4.35.3",
"@tanstack/react-table": "^8.10.7",
"ansi_up": "^5.2.1",
"axios": "^1.5.1",
"base64-stream": "^1.0.0",
"date-fns": "^2.30.0",
"dayjs": "^1.11.10",
"decimal.js": "^10.4.3",
"dns": "^0.2.2",
Expand All @@ -45,6 +47,7 @@
"nprogress": "^0.2.0",
"prettier": "^2.8.8",
"react": "18.2.0",
"react-day-picker": "^8.8.2",
"react-dom": "18.2.0",
"react-hook-form": "^7.46.2",
"react-i18next": "^14.1.2",
Expand Down
54 changes: 47 additions & 7 deletions frontend/providers/applaunchpad/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"ConfigMap Path Conflict": "ConfigMap Path Conflict",
"ConfigMap Tip": "ConfigMap",
"Configurable number of instances or automatic horizontal scaling": "Configurable replica count and auto horizontal scaling",
"Configuration File": "Configmap",
"Confirm": "Yes",
"Configuration File": "Configmaps",
"Confirm": "Confirm",
"Confirm deletion": "Yes",
"Confirm Deploy Application?": "Are you sure you want to deploy the application?",
"Confirm to restart this application?": "Are you sure you want to update the application?",
Expand Down Expand Up @@ -86,7 +86,7 @@
"Edit Env Variable": "Edit Environment Variables",
"Edit Environment Variables": "Edit Environment Variables",
"Env Placeholder": "one per line, key and value separated by colon or equals sign, e.g.:\nmongoUrl=127.0.0.1:8000\nredisUrl:127.0.0.0:8001\n-env1 =test",
"Environment Variables": "Environment",
"Environment Variables": "Environment Variables",
"Export": "Export",
"Export Domain": "Assigned Domain",
"file": "File",
Expand Down Expand Up @@ -163,7 +163,7 @@
"please enter app name": "please enter: {{appName}}",
"Pod": "Pod",
"Pod Name": "Pod Name",
"Pods List": "Pods List",
"Pods List": "Pod List",
"Port": "Port",
"private": "private",
"Private": "Private",
Expand Down Expand Up @@ -197,7 +197,7 @@
"Stateless": "Stateless",
"Status": "Status",
"storage": "Storage",
"Storage": "Storage",
"Storage": "Mounted Volumes",
"Storage path can not empty": "Storage mount path is required",
"Storage Range": "Storage Range",
"Storage Value can not empty": "Storage size is required",
Expand Down Expand Up @@ -257,7 +257,7 @@
"total_price_tip": "The estimated cost does not include port fees and traffic fees, and is subject to actual usage.",
"nodeports": "NodePorts",
"streaming_logs": "Streaming logs",
"within_5_minutes": "Within 5 minutes",
"within_5_minute": "Within 5 minute",
"within_1_hour": "Within 1 hour",
"within_1_day": "Within 1 day",
"terminated_logs": "Terminated logs",
Expand All @@ -277,5 +277,45 @@
"storage_path_placeholder": "For Example: /data"
},
"guide_deploy_button": "Complete creation",
"shared": "Shared"
"filter": "Filter",
"start": "Start",
"end": "End",
"time_zone": "Time Zone",
"recently": "Last",
"minute": "minutes",
"day": "days",
"hour": "hours",
"time": "Range",
"log_number": "Log Number",
"close": "Off",
"normal_filter": "Normal",
"advanced_filter": "Advance",
"json_mode": "JSON Mode",
"only_stderr": "Stderr Only",
"keyword": "Keywords",
"search": "Search",
"equal": "equal",
"greater_than": "Greater than",
"less_than": "Less than",
"field_name": "Select Field",
"value": "Enter Value",
"logNumber": "Log Counts",
"overview": "Overview",
"monitor": "Monitors",
"logs": "Logs",
"application_source": "Source",
"contains": "contains",
"not_contains": "not contains",
"visible": "Visable",
"hidden": "Hidden",
"export_log": "Export",
"no_data_available": "No data available",
"all": "All",
"hour-singular": "hour",
"not_equal": "not",
"field_settings": "Field Setting",
"selected": "Selected",
"please_select": "Please Select",
"refetching_success": "Refresh Successful",
"refresh": "refresh"
}
49 changes: 44 additions & 5 deletions frontend/providers/applaunchpad/public/locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"Auto scaling": "弹性伸缩",
"Balance": "余额",
"Basic Config": "基础配置",
"Basic Information": "基本信息",
"Basic Information": "基础信息",
"Can help you deploy any Docker image": "丰富的镜像仓库,支持任意 Docker 镜像",
"Can not change storage path": "不允许修改挂载路径",
"Cancel": "取消",
Expand Down Expand Up @@ -162,8 +162,8 @@
"Please enter": "请输入",
"please enter app name": "请输入:{{appName}}",
"Pod": "实例",
"Pod Name": "实例名",
"Pods List": "实例列表",
"Pod Name": "Pod 名称",
"Pods List": "Pod 列表",
"Port": "端口",
"private": "私有",
"Private": "私有",
Expand Down Expand Up @@ -257,7 +257,7 @@
"total_price_tip": "预估费用不包括端口费用和流量费用,以实际使用为准",
"nodeports": "外网端口",
"streaming_logs": "实时日志",
"within_5_minutes": "五分钟内",
"within_5_minute": "五分钟内",
"within_1_hour": "一小时内",
"within_1_day": "一天内",
"terminated_logs": "中断前",
Expand All @@ -278,5 +278,44 @@
"storage_path_placeholder": "如:/data"
},
"guide_deploy_button": "完成创建",
"shared": "共享"
"filter": "筛选",
"start": "开始",
"end": "结束",
"time_zone": "时区",
"recently": "最近",
"minute": "分钟",
"hour": "小时",
"day": "天",
"time": "时间",
"log_number": "日志数",
"close": "关闭",
"normal_filter": "普通筛选",
"advanced_filter": "高级筛选",
"json_mode": "JSON模式",
"only_stderr": "只看 Stderr",
"keyword": "关键词",
"search": "查询",
"field_name": "字段名",
"equal": "等于",
"value": "值",
"logNumber": "日志数量",
"overview": "概览",
"monitor": "监控",
"logs": "日志",
"application_source": "来源",
"contains": "包含",
"not_contains": "不包含",
"visible": "可见",
"hidden": "隐藏",
"piece": "个",
"export_log": "导出日志",
"no_data_available": "暂无数据",
"all": "全部",
"hour-singular": "小时",
"not_equal": "不等于",
"field_settings": "字段设置",
"selected": "已选中",
"please_select": "请选择",
"refetching_success": "刷新成功",
"refresh": "刷新"
}
9 changes: 9 additions & 0 deletions frontend/providers/applaunchpad/src/api/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
} from '@/utils/adapt';
import type { AppPatchPropsType, PodDetailType } from '@/types/app';
import { MonitorDataResult, MonitorQueryKey } from '@/types/monitor';
import { LogQueryPayload } from '@/pages/api/log/queryLogs';
import { PodListQueryPayload } from '@/pages/api/log/queryPodList';

export const postDeployApp = (yamlList: string[]) => POST('/api/applyApp', { yamlList });

Expand Down Expand Up @@ -58,4 +60,11 @@ export const getAppMonitorData = (payload: {
queryName: string;
queryKey: keyof MonitorQueryKey;
step: string;
start?: number;
end?: number;
}) => GET<MonitorDataResult[]>(`/api/monitor/getMonitorData`, payload);

export const getAppLogs = (payload: LogQueryPayload) => POST<string>('/api/log/queryLogs', payload);

export const getLogPodList = (payload: PodListQueryPayload) =>
POST<string[]>('/api/log/queryPodList', payload);
Loading