mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-20 02:58:53 +00:00
feat: redirect to deployments when click on deploy
This commit is contained in:
+11
-4
@@ -44,7 +44,7 @@ import type {
|
||||
import Head from "next/head";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import React, { useState, type ReactElement } from "react";
|
||||
import React, { useState, useEffect, type ReactElement } from "react";
|
||||
import superjson from "superjson";
|
||||
|
||||
type TabState =
|
||||
@@ -62,7 +62,14 @@ const Service = (
|
||||
const { applicationId, activeTab } = props;
|
||||
const router = useRouter();
|
||||
const { projectId } = router.query;
|
||||
const [tab, setSab] = useState<TabState>(activeTab);
|
||||
const [tab, setTab] = useState<TabState>(activeTab);
|
||||
|
||||
useEffect(() => {
|
||||
if (router.query.tab) {
|
||||
setTab(router.query.tab as TabState);
|
||||
}
|
||||
}, [router.query.tab]);
|
||||
|
||||
const { data } = api.application.one.useQuery(
|
||||
{ applicationId },
|
||||
{
|
||||
@@ -191,9 +198,9 @@ const Service = (
|
||||
defaultValue="general"
|
||||
className="w-full"
|
||||
onValueChange={(e) => {
|
||||
setSab(e as TabState);
|
||||
setTab(e as TabState);
|
||||
const newPath = `/dashboard/project/${projectId}/services/application/${applicationId}?tab=${e}`;
|
||||
router.push(newPath, undefined, { shallow: true });
|
||||
router.push(newPath);
|
||||
}}
|
||||
>
|
||||
<div className="flex flex-row items-center justify-between w-full gap-4">
|
||||
|
||||
Reference in New Issue
Block a user