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

Commit

Permalink
Remove all /app in the pathname
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin Guidée <[email protected]>
  • Loading branch information
quentinguidee committed Jan 31, 2024
1 parent bc87e2b commit 1054e78
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 76 deletions.
18 changes: 9 additions & 9 deletions cypress/e2e/apps/vx-instances.cy.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
const createContainerAndNavigate = (to: string) => {
cy.visit("/app/containers");
cy.visit("/containers");
cy.request(
"POST",
"http://localhost:6130/api/service/postgres/install"
).then((res: any) => {
cy.visit(`/app/containers/${res.body.uuid}${to}`);
cy.visit(`/containers/${res.body.uuid}${to}`);
});
};

describe("The Vertex Containers app", () => {
it("loads", () => {
cy.visit("/app/containers");
cy.visit("/containers");
});

it("can create a new container", () => {
// Navigate to the create container page
cy.visit("/app/containers");
cy.visit("/containers");
cy.contains("Create container").click();
cy.url().should("include", "/app/containers/add");
cy.url().should("include", "/containers/add");

// Create an container
cy.contains("Postgres").click();
cy.get("button").contains("Create container").click();

// Go back
cy.visit("/app/containers");
cy.visit("/containers");
cy.contains("Postgres");
});

it("can navigate to an container", () => {
cy.request(
"POST",
"http://localhost:6130/api/app/containers/service/postgres/install"
"http://localhost:6130/api/containers/service/postgres/install"
);

// Navigate to
cy.visit("/app/containers");
cy.visit("/containers");
cy.contains("Postgres").click();
});

Expand Down Expand Up @@ -72,7 +72,7 @@ describe("The Vertex Containers app", () => {

it("can delete an container", () => {
// Go to the containers page
cy.visit("/app/containers");
cy.visit("/containers");

// Create an container
createContainerAndNavigate("/");
Expand Down
64 changes: 29 additions & 35 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,115 +113,109 @@ function AllRoutes() {
</Route>
<Route
path="/"
element={<Navigate to="/app/containers" />}
element={<Navigate to="/containers" />}
index
/>
<Route path="/containers" element={<ContainersApp />} />
<Route
path="/app/containers"
element={<ContainersApp />}
/>
<Route
path="/app/containers/add"
path="/containers/add"
element={<ContainersStore />}
/>
<Route
path="/app/devtools-service-editor"
path="/devtools-service-editor"
element={<ServiceEditor />}
/>
<Route path="/app/sql" element={<SqlApp />}>
<Route path="/sql" element={<SqlApp />}>
<Route
path="/app/sql/install"
path="/sql/install"
element={<SqlInstaller />}
/>
<Route
path="/app/sql/db/:uuid"
path="/sql/db/:uuid"
element={<SqlDatabase />}
/>
</Route>
<Route
path="/app/monitoring"
element={<MonitoringApp />}
>
<Route path="/monitoring" element={<MonitoringApp />}>
<Route
path="/app/monitoring/prometheus"
path="/monitoring/prometheus"
element={<Prometheus />}
/>
<Route
path="/app/monitoring/grafana"
path="/monitoring/grafana"
element={<Grafana />}
/>
</Route>
<Route path="/app/tunnels" element={<TunnelsApp />}>
<Route path="/tunnels" element={<TunnelsApp />}>
<Route
path="/app/tunnels/cloudflare"
path="/tunnels/cloudflare"
element={<CloudflareTunnels />}
/>
</Route>
<Route
path="/app/reverse-proxy"
path="/reverse-proxy"
element={<ReverseProxyApp />}
>
<Route
path="/app/reverse-proxy/vertex"
path="/reverse-proxy/vertex"
element={<VertexReverseProxy />}
/>
</Route>
<Route
path="/app/containers/:uuid/"
path="/containers/:uuid/"
element={<ContainerDetails />}
>
<Route
path="/app/containers/:uuid/home"
path="/containers/:uuid/home"
element={<ContainerHome />}
/>
<Route
path="/app/containers/:uuid/docker"
path="/containers/:uuid/docker"
element={<ContainerDocker />}
/>
<Route
path="/app/containers/:uuid/logs"
path="/containers/:uuid/logs"
element={<ContainerLogs />}
/>
<Route
path="/app/containers/:uuid/environment"
path="/containers/:uuid/environment"
element={<ContainerEnv />}
/>
<Route
path="/app/containers/:uuid/database"
path="/containers/:uuid/database"
element={<ContainerDetailsDatabase />}
/>
<Route
path="/app/containers/:uuid/update"
path="/containers/:uuid/update"
element={<ContainerUpdate />}
/>
<Route
path="/app/containers/:uuid/settings"
path="/containers/:uuid/settings"
element={<ContainerSettings />}
/>
</Route>
<Route path="/app/admin" element={<SettingsApp />}>
<Route path="/admin" element={<SettingsApp />}>
<Route
path="/app/admin/theme"
path="/admin/theme"
element={<SettingsTheme />}
/>
<Route
path="/app/admin/notifications"
path="/admin/notifications"
element={<SettingsNotifications />}
/>
<Route
path="/app/admin/database"
path="/admin/database"
element={<SettingsDb />}
/>
<Route
path="/app/admin/updates"
path="/admin/updates"
element={<SettingsUpdates />}
/>
<Route
path="/app/admin/checks"
path="/admin/checks"
element={<SettingsChecks />}
/>
<Route
path="/app/admin/about"
path="/admin/about"
element={<SettingsAbout />}
/>
</Route>
Expand Down
10 changes: 5 additions & 5 deletions src/apps/AdminSettings/SettingsApp/SettingsApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ export default function SettingsApp() {
<Sidebar.Item
label="Theme"
icon={<MaterialIcon icon="palette" />}
link={l("/app/admin/theme")}
link={l("/admin/theme")}
/>
</Sidebar.Group>
<Sidebar.Group title="Administration">
<Sidebar.Item
label="Notifications"
icon={<MaterialIcon icon="notifications" />}
link={l("/app/admin/notifications")}
link={l("/admin/notifications")}
/>
<Sidebar.Item
label="Updates"
icon={<MaterialIcon icon="update" />}
link={l("/app/admin/updates")}
link={l("/admin/updates")}
/>
<Sidebar.Item
label="Checks"
icon={<MaterialIcon icon="checklist" />}
link={l("/app/admin/checks")}
link={l("/admin/checks")}
/>
<Sidebar.Item
label="About"
icon={<MaterialIcon icon="info" />}
link={l("/app/admin/about")}
link={l("/admin/about")}
/>
</Sidebar.Group>
</Sidebar>
Expand Down
16 changes: 8 additions & 8 deletions src/apps/Containers/pages/Container/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function ContainerDetails() {

const mutationDeleteContainer = useMutation({
mutationFn: () => API.deleteContainer(uuid),
onSuccess: () => navigate("/app/containers"),
onSuccess: () => navigate("/containers"),
});
const {
isLoading: isDeleting,
Expand All @@ -78,46 +78,46 @@ export default function ContainerDetails() {
<Sidebar.Item
label="Home"
icon={<MaterialIcon icon="home" />}
link={l(`/app/containers/${uuid}/home`)}
link={l(`/containers/${uuid}/home`)}
/>
</Sidebar.Group>
<Sidebar.Group title="Analyze">
<Sidebar.Item
label="Logs"
icon={<MaterialIcon icon="terminal" />}
link={l(`/app/containers/${uuid}/logs`)}
link={l(`/containers/${uuid}/logs`)}
/>
<Sidebar.Item
label="Docker"
icon={<SiDocker size={20} />}
link={l(`/app/containers/${uuid}/docker`)}
link={l(`/containers/${uuid}/docker`)}
/>
</Sidebar.Group>
<Sidebar.Group title="Manage">
<Sidebar.Item
label="Environment"
icon={<MaterialIcon icon="tune" />}
link={l(`/app/containers/${uuid}/environment`)}
link={l(`/containers/${uuid}/environment`)}
/>
{container?.databases && (
<Sidebar.Item
label="Database"
icon={<MaterialIcon icon="database" />}
link={l(`/app/containers/${uuid}/database`)}
link={l(`/containers/${uuid}/database`)}
/>
)}
<Sidebar.Item
icon={<MaterialIcon icon="update" />}
label="Update"
link={l(`/app/containers/${uuid}/update`)}
link={l(`/containers/${uuid}/update`)}
notifications={
container?.service_update?.available ? 1 : undefined
}
/>
<Sidebar.Item
label="Settings"
icon={<MaterialIcon icon="settings" />}
link={l(`/app/containers/${uuid}/settings`)}
link={l(`/containers/${uuid}/settings`)}
/>
<Sidebar.Item
label="Delete"
Expand Down
4 changes: 2 additions & 2 deletions src/apps/Containers/pages/ContainersApp/ContainersApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ToolbarContainers = (props: ToolbarProps) => {
<Spacer />
<Button
variant="colored"
onClick={() => navigate("/app/containers/add")}
onClick={() => navigate("/containers/add")}
rightIcon={<MaterialIcon icon="add" />}
>
Create container
Expand Down Expand Up @@ -111,7 +111,7 @@ export default function ContainersApp() {
key={c.id}
container={{
value: c,
to: `/app/containers/${c.id}/`,
to: `/containers/${c.id}/`,
onPower: async () =>
mutationPower.mutate(c.id),
}}
Expand Down
4 changes: 2 additions & 2 deletions src/apps/Monitoring/MonitoringApp/MonitoringApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function MonitoringApp() {
<Sidebar.Item
label="Prometheus"
icon={<SiPrometheus size={20} />}
link={l("/app/monitoring/prometheus")}
link={l("/monitoring/prometheus")}
trailing={
prometheusContainer && (
<ContainerLed
Expand All @@ -57,7 +57,7 @@ export default function MonitoringApp() {
<Sidebar.Item
label="Grafana"
icon={<SiGrafana size={20} />}
link={l("/app/monitoring/grafana")}
link={l("/monitoring/grafana")}
trailing={
grafanaContainer && (
<ContainerLed
Expand Down
2 changes: 1 addition & 1 deletion src/apps/ReverseProxy/ReverseProxyApp/ReverseProxyApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function ReverseProxyApp() {
<Sidebar.Item
label="Vertex Reverse Proxy"
icon={<MaterialIcon icon="router" />}
link={l("/app/reverse-proxy/vertex")}
link={l("/reverse-proxy/vertex")}
/>
</Sidebar.Group>
</Sidebar>
Expand Down
4 changes: 2 additions & 2 deletions src/apps/Sql/SqlApp/SqlApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function SqlApp() {
key={c?.id}
label={c?.name}
icon={icon}
link={l(`/app/sql/db/${c?.id}`)}
link={l(`/sql/db/${c?.id}`)}
trailing={
c && (
<ContainerLed
Expand All @@ -54,7 +54,7 @@ export default function SqlApp() {
<Sidebar.Item
label="Installer"
icon={<MaterialIcon icon="download" />}
link={l("/app/sql/install")}
link={l("/sql/install")}
/>
</Sidebar.Group>
</Sidebar>
Expand Down
2 changes: 1 addition & 1 deletion src/apps/Sql/SqlDatabase/SqlDatabase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function SqlDatabase() {
value: container ?? {
id: uuidv4(),
},
to: `/app/containers/${container?.id}`,
to: `/containers/${container?.id}`,
onPower: () => onPower(container),
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/apps/Tunnels/TunnelsApp/TunnelsApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function TunnelsApp() {
<Sidebar.Item
label="Cloudflare Tunnel"
icon={<SiCloudflare size={20} />}
link={l("/app/tunnels/cloudflare")}
link={l("/tunnels/cloudflare")}
trailing={
container && (
<ContainerLed small status={container?.status} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/ContainerInstaller/ContainerInstaller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function ContainerInstaller(props: Readonly<Props>) {
container={{
value: container,
to: container?.id
? `/app/containers/${container?.id}`
? `/containers/${container?.id}`
: undefined,
onInstall: onInstall,
onPower: () => onPower(container),
Expand Down
Loading

0 comments on commit 1054e78

Please sign in to comment.