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

Ds 0.2.1 release #344

Merged
merged 5 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions .github/workflows/release-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ jobs:
git config user.email "[email protected]"

- name: Run chart-releaser
uses: powerfooI/[email protected].1
uses: powerfooI/[email protected].2
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
mark_as_latest: false
skip_existing: true
pages_branch: master
pages_index_path: docsite/static/index.yaml
pages_index_path: docsite/static/index.yaml
pr: true
3 changes: 2 additions & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ mysql -h{POD_IP} -P2881 -uroot -proot_password oceanbase -A -c
```
helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm repo update ob-operator
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard --version=0.2.0
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard
```

![oceanbase-dashboard-install](./docsite/static/img/oceanbase-dashboard-install.jpg)
Expand All @@ -147,6 +147,7 @@ kubectl get svc oceanbase-dashboard-oceanbase-dashboard

使用 admin 账号和查看到的密码登录。
![oceanbase-dashboard-overview](./docsite/static/img/oceanbase-dashboard-overview.jpg)
![oceanbase-dashboard-topology](./docsite/static/img/oceanbase-dashboard-topology.jpg)

## 项目架构

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Deploy OceanBase Dashboard is pretty simple, just run the following commands
```
helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm repo update ob-operator
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard --version=0.2.0
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard
```

![oceanbase-dashboard-install](./docsite/static/img/oceanbase-dashboard-install.jpg)
Expand All @@ -146,6 +146,7 @@ kubectl get svc oceanbase-dashboard-oceanbase-dashboard

Login with admin user and password
![oceanbase-dashboard-overview](./docsite/static/img/oceanbase-dashboard-overview.jpg)
![oceanbase-dashboard-topology](./docsite/static/img/oceanbase-dashboard-topology.jpg)

## Project Architecture

Expand Down
4 changes: 2 additions & 2 deletions charts/oceanbase-dashboard/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.0
version: 0.2.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.2.0"
appVersion: "0.2.1"
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ mysql -h{POD_IP} -P2881 -uroot -proot_password oceanbase -A -c
```
helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm repo update ob-operator
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard --version=0.2.0
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard
```

![oceanbase-dashboard-install](/img/oceanbase-dashboard-install.jpg)
Expand All @@ -150,6 +150,7 @@ kubectl get svc oceanbase-dashboard-oceanbase-dashboard

使用 admin 账号和查看到的密码登录。
![oceanbase-dashboard-overview](/img/oceanbase-dashboard-overview.jpg)
![oceanbase-dashboard-topology](/img/oceanbase-dashboard-topology.jpg)

## 项目架构

Expand Down
3 changes: 2 additions & 1 deletion docsite/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Deploy OceanBase Dashboard is pretty simple, just run the following commands
```
helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm repo update ob-operator
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard --version=0.2.0
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard
```

![oceanbase-dashboard-install](/img/oceanbase-dashboard-install.jpg)
Expand All @@ -150,6 +150,7 @@ kubectl get svc oceanbase-dashboard-oceanbase-dashboard

Login with admin user and password
![oceanbase-dashboard-overview](/img/oceanbase-dashboard-overview.jpg)
![oceanbase-dashboard-topology](/img/oceanbase-dashboard-topology.jpg)

## Project Architecture

Expand Down
Binary file modified docsite/static/img/oceanbase-dashboard-install.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docsite/static/img/oceanbase-dashboard-overview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion internal/dashboard/handler/conn_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func CreateOBTenantConnTerminal(c *gin.Context) (*response.OBConnection, error)
}

// Select unit information from the oceanbase cluster
db, err := getSysClient(c, obcluster, oceanbaseconst.RootUser, oceanbaseconst.SysTenant, obtenant.Spec.Credentials.Root)
db, err := getSysClient(c, obcluster, oceanbaseconst.RootUser, oceanbaseconst.SysTenant, obcluster.Spec.UserSecrets.Root)
if err != nil {
return nil, httpErr.NewInternal(err.Error())
}
Expand Down
128 changes: 74 additions & 54 deletions ui/src/components/Terminal/terminal.tsx
Original file line number Diff line number Diff line change
@@ -1,96 +1,116 @@
import { Terminal } from '@xterm/xterm'
import { Button, Modal } from 'antd'
import React from 'react'
import { intl } from '@/utils/intl';
import { Terminal } from '@xterm/xterm';
import { Button, Modal } from 'antd';
import React from 'react';

export interface ITerminal {
terminalId: string
onClose?: () => void
onConnected?: () => void
terminalId: string;
onClose?: () => void;
onConnected?: () => void;
}

function devLog(...args: any[]) {
if (process.env.NODE_ENV === 'development') {
console.log(...args)
console.log(...args);
}
}

export const OBTerminal: React.FC<ITerminal> = (props) => {
const { terminalId } = props
const ref = React.useRef<HTMLDivElement>(null)
const [ws, setWs] = React.useState<WebSocket | null>(null)
const { terminalId } = props;
const ref = React.useRef<HTMLDivElement>(null);
const [ws, setWs] = React.useState<WebSocket | null>(null);

React.useEffect(() => {
if (ref.current) {
const term = new Terminal({
cols: 160,
rows: 60,
})
term.open(ref.current)
});
term.open(ref.current);

if (term.options.fontSize) {
const containerWidth = ref.current.clientWidth
const containerWidth = ref.current.clientWidth;

const cols = Math.floor(containerWidth / 9.2)
const rows = Math.floor(cols / 4)
term.resize(cols, rows)
const ws = new WebSocket(`ws://${location.host}/api/v1/terminal/${terminalId}?cols=${cols}&rows=${rows}`)
term.write('Hello from \x1B[1;3;31mOceanBase\x1B[0m\r\n')
const cols = Math.floor(containerWidth / 9.2);
const rows = Math.floor(cols / 4);
term.resize(cols, rows);
const ws = new WebSocket(
`ws://${location.host}/api/v1/terminal/${terminalId}?cols=${cols}&rows=${rows}`,
);
term.write('Hello from \x1B[1;3;31mOceanBase\x1B[0m\r\n');

ws.onopen = function () {
devLog('Websocket connection open ...')
devLog('Websocket connection open ...');
// ws.send(JSON.stringify({ type: 'ping' }))
term.onData(function (data) {
ws.send(data)
})
props.onConnected?.()
setWs(ws)
ws.send(data);
});
props.onConnected?.();
setWs(ws);

window.addEventListener('beforeunload', () => {
if (ws) {
ws.close()
props.onClose?.()
setWs(null)
ws.close();
props.onClose?.();
setWs(null);
}
})
}
});
};

ws.onmessage = function (event) {
term.write(event.data)
}
term.write(event.data);
};

ws.onclose = function () {
devLog('Connection closed.')
term.write('\r\nConnection closed.\r\n')
}
devLog('Connection closed.');
term.write('\r\nConnection closed.\r\n');
};

ws.onerror = function (evt) {
console.error('WebSocket error observed:', evt)
}
console.error('WebSocket error observed:', evt);
};
}
}

return () => {
window.removeEventListener('beforeunload', () => { })
}
}, [])
window.removeEventListener('beforeunload', () => {});
};
}, []);

return (
<>
{ws && <div style={{ marginBottom: 12 }}>
<Button danger type="primary" onClick={() => {
Modal.confirm({
title: '断开连接',
content: '确定要断开连接吗?',
okType: 'danger',
onOk: () => {
ws.close()
props.onClose?.()
setWs(null)
}
})
}}>断开连接</Button>
</div>}
{ws && (
<div style={{ marginBottom: 12 }}>
<Button
danger
type="primary"
onClick={() => {
Modal.confirm({
title: intl.formatMessage({
id: 'Dashboard.components.Terminal.Disconnect',
defaultMessage: '断开连接',
}),
content: intl.formatMessage({
id: 'Dashboard.components.Terminal.Disconnect1',
defaultMessage: '确定要断开连接吗?',
}),
okType: 'danger',
onOk: () => {
ws.close();
props.onClose?.();
setWs(null);
},
});
}}
>
{intl.formatMessage({
id: 'Dashboard.components.Terminal.Disconnect',
defaultMessage: '断开连接',
})}
</Button>
</div>
)}
<div ref={ref} />
</>
)
}
);
};
12 changes: 11 additions & 1 deletion ui/src/i18n/strings/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -695,5 +695,15 @@
"Dashboard.Detail.Overview.BasicInfo.ClusterInformation": "Cluster Information",
"Dashboard.Detail.Overview.ServerTable.ServerList": "Server List",
"Dashboard.Detail.Overview.ZoneTable.ZoneList": "Zone List",
"Dashboard.Detail.NewBackup.AdvancedConfiguration.Days": "Days"
"Dashboard.Detail.NewBackup.AdvancedConfiguration.Days": "Days",
"Dashboard.Cluster.Detail.Connection1": "Connection",
"Dashboard.Cluster.Detail.Connection": "Cluster connection",
"Dashboard.Tenant.Detail.Connection1": "Connection",
"Dashboard.Cluster.Detail.CloseConnection": "Connection closed",
"Dashboard.Cluster.Detail.NotRunning": "Cluster is not running",
"Dashboard.Cluster.Detail.CreateConnection": "Create connection",
"Dashboard.components.Terminal.Disconnect": "Disconnect",
"Dashboard.components.Terminal.Disconnect1": "Are you sure you want to disconnect?",
"Dashboard.Tenant.Detail.Connection": "Tenant connection",
"Dashboard.Cluster.Detail.AbnormalOperation": "Tenant is not functioning properly"
}
12 changes: 11 additions & 1 deletion ui/src/i18n/strings/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -695,5 +695,15 @@
"Dashboard.Detail.Overview.BasicInfo.ClusterInformation": "集群信息",
"Dashboard.Detail.Overview.ServerTable.ServerList": "Server 列表",
"Dashboard.Detail.Overview.ZoneTable.ZoneList": "Zone 列表",
"Dashboard.Detail.NewBackup.AdvancedConfiguration.Days": "天"
"Dashboard.Detail.NewBackup.AdvancedConfiguration.Days": "天",
"Dashboard.Cluster.Detail.Connection": "集群连接",
"Dashboard.Cluster.Detail.Connection1": "集群连接",
"Dashboard.Tenant.Detail.Connection1": "连接租户",
"Dashboard.Cluster.Detail.CloseConnection": "连接已关闭",
"Dashboard.Cluster.Detail.NotRunning": "集群未运行",
"Dashboard.Cluster.Detail.CreateConnection": "创建连接",
"Dashboard.components.Terminal.Disconnect": "断开连接",
"Dashboard.components.Terminal.Disconnect1": "确定要断开连接吗?",
"Dashboard.Tenant.Detail.Connection": "连接租户",
"Dashboard.Cluster.Detail.AbnormalOperation": "租户未正常运行"
}
Loading
Loading