Skip to content

Commit

Permalink
feat: use webui API in NMS (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
patriciareinoso authored Aug 2, 2024
1 parent 9d699a0 commit 672d7f5
Show file tree
Hide file tree
Showing 41 changed files with 359 additions and 1,198 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# SD-Core NMS
# Aether SD-Core NMS

A Network Management System for managing the SD-Core 5G core network.
A Network Management System for managing the Aether SD-Core 5G core network.

![Screenshot](images/nms_screenshot.png)

## Usage

NMS needs to be configured with the following environment variables:
- `WEBUI_ENDPOINT`: The endpoint of the webui. This is used to redirect the user to the webui.
- `UPF_CONFIG_PATH`: The path to the UPF configuration file. An example of this file can be seen in the `examples/` directory.
- `GNB_CONFIG_PATH`: The path to the gNodeB configuration file. An example of this file can be seen in the `examples/` directory.
- `WEBUI_ENDPOINT`: The endpoint of the webui. This is used to redirect the swagger operations to the webui.

```console
export WEBUI_ENDPOINT=http://10.1.182.28:5000
export UPF_CONFIG_PATH=/path/to/upf_config.json
export GNB_CONFIG_PATH=/path/to/gnb_config.json
export WEBUI_ENDPOINT=10.1.182.28:5000

docker pull ghcr.io/canonical/sdcore-nms:0.2.0
docker run -it --env UPF_CONFIG_PATH --env GNB_CONFIG_PATH --env WEBUI_ENDPOINT ghcr.io/canonical/sdcore-nms:0.2.0
docker run -it --env WEBUI_ENDPOINT ghcr.io/canonical/sdcore-nms:0.2.0
```
2 changes: 1 addition & 1 deletion app/(api)/api/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function IndexPage() {

useEffect(() => {
async function fetchSpecs() {
const response = await fetch("/api/getSwaggerDocs");
const response = await fetch("swagger/doc.json");

if (response.ok) {
const fetchedSpec = await response.json();
Expand Down
2 changes: 1 addition & 1 deletion app/(network)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function RootLayout({
return (
<html lang="en">
<head>
<title>SD Core</title>
<title>Aether SD-Core</title>
<link
rel="shortcut icon"
href="https://assets.ubuntu.com/v1/49a1a858-favicon-32x32.png"
Expand Down
4 changes: 2 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "SD Core",
description: "SD Core NMS",
title: "Aether SD-Core",
description: "Aether SD-Core NMS",
};

export default function RootLayout({
Expand Down
15 changes: 14 additions & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
export default function Page() {}
'use client';

import { useEffect } from 'react';
import { useRouter } from 'next/navigation';

export default function Home() {
const router = useRouter();

useEffect(() => {
router.replace('/network-configuration');
}, [router]);

return null;
}
52 changes: 0 additions & 52 deletions components/DeleteSubscriberButton.tsx

This file was deleted.

5 changes: 2 additions & 3 deletions components/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, MouseEvent, useEffect, useState } from "react";
import React, { FC, MouseEvent, useState } from "react";
import { Button, Icon } from "@canonical/react-components";
import classnames from "classnames";
import Logo from "./Logo";
Expand Down Expand Up @@ -103,8 +103,7 @@ const Navigation: FC = () => {
<li className="p-side-navigation__item">
<a
className="p-side-navigation__link"
href="/api"
target="_blank"
href="#"
rel="noreferrer"
title="API"
>
Expand Down
15 changes: 0 additions & 15 deletions examples/gnb_config.json

This file was deleted.

15 changes: 0 additions & 15 deletions examples/upf_config.json

This file was deleted.

20 changes: 5 additions & 15 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
module.exports = {
async redirects() {
return [
{
source: '/',
destination: '/network-configuration',
permanent: true,
},
];
},
env: {
UPF_CONFIG_PATH: process.env.UPF_CONFIG_PATH,
GNB_CONFIG_PATH: process.env.GNB_CONFIG_PATH,
WEBUI_ENDPOINT: process.env.WEBUI_ENDPOINT,
},
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
};

module.exports = nextConfig;
138 changes: 0 additions & 138 deletions pages/api/device-group/[name].ts

This file was deleted.

53 changes: 0 additions & 53 deletions pages/api/device-group/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions pages/api/getSwaggerDocs.ts

This file was deleted.

Loading

0 comments on commit 672d7f5

Please sign in to comment.