feat: add status page edit action in admin list

This commit is contained in:
moonrailgun 2023-12-18 00:37:15 +08:00
parent 418208b0e3
commit 3cdbb948da
3 changed files with 8 additions and 3 deletions

View File

@ -28,7 +28,9 @@ export const MonitorStatusPage: React.FC<MonitorStatusPageProps> = React.memo(
const navigate = useNavigate();
const allowEdit = useAllowEdit(info?.workspaceId);
const [editMode, setEditMode] = useState(false);
const [editMode, setEditMode] = useState(() => {
return new URLSearchParams(window.location.search).has('edit');
});
const monitorList = info?.monitorList ?? [];

View File

@ -28,7 +28,10 @@ export const MonitorPageList: React.FC = React.memo(() => {
icon={<EyeOutlined />}
onClick={() => navigate(`/status/${p.slug}`)}
/>
<Button icon={<EditOutlined />} />
<Button
icon={<EditOutlined />}
onClick={() => navigate(`/status/${p.slug}?edit=1`)}
/>
</div>
</div>
</Card>

View File

@ -33,7 +33,7 @@ export const MonitorPage: React.FC = React.memo(() => {
</div>
</div>
<div className="py-5 flex flex-1 overflow-hidden">
<div className="w-5/12 bg-gray-50 dark:bg-gray-800">
<div className="w-5/12 rounded bg-gray-50 dark:bg-gray-800">
<MonitorList />
</div>
<div className="w-7/12">