diff --git a/src/fireedge/etc/sunstone/tab-manifest.yaml b/src/fireedge/etc/sunstone/tab-manifest.yaml deleted file mode 100644 index 5277fb2707..0000000000 --- a/src/fireedge/etc/sunstone/tab-manifest.yaml +++ /dev/null @@ -1,307 +0,0 @@ -- title: Instances - icon: GridAdd - routes: - - title: VMs - path: /vm - sidebar: true - icon: ModernTv - Component: VirtualMachines - - title: Create VM - path: /vm/create - Component: CreateVm - - title: Virtual Routers - path: /vrouter - sidebar: true - icon: Shuffle - Component: VirtualRouters - - title: Instantiate Virtual Router - path: /vrouter/instantiate - Component: InstantiateVrTemplate - - title: Virtual Routers - path: /vrouter/:id - Component: VirtualRouterDetail - - title: Services - path: /service - sidebar: true - icon: Packages - Component: Services - - title: Instantiate Service Template - path: /service/instantiate/ - Component: InstantiateServiceTemplate - - title: Service - path: /service/:id - Component: ServiceDetail -- title: Templates - icon: ViewStructureDown - routes: - - title: VM Templates - path: /vm-template - sidebar: true - icon: EmptyPage - Component: VmTemplates - - title: Instantiate VM Template - path: /vm-template/instantiate - Component: InstantiateVmTemplate - - title: Create VM Template - path: /vm-template/create - Component: CreateVmTemplate - - title: Update VM Template - path: /vm-template/update - Component: CreateVmTemplate - - title: VM Template - path: /vm-template/:id - Component: VmTemplateDetail - - title: Instantiate Service Template - path: /service-template/instantiate/ - Component: InstantiateServiceTemplate - - title: Service Templates - path: /service-template - sidebar: true - icon: MultiplePagesEmpty - Component: ServiceTemplates - - title: Create Service Template - path: /service-template/create - Component: CreateServiceTemplate - - title: Service Template - path: /service-template/:id - Component: ServiceTemplateDetail - - title: Instantiate VR Template - path: /vrouter-template/instantiate/ - Component: InstantiateVrTemplate - - title: Virtual Routers - path: /vrouter-template - sidebar: true - icon: Shuffle - Component: VrTemplates - - title: Create VR Template - path: /vrouter-template/create - Component: CreateVrTemplate - - title: Update VR Template - path: /vrouter-template/update - Component: CreateVrTemplate - - title: VR Template - path: /vrouter-template/:id - Component: VrTemplateDetail - - title: Create VM group - path: /vm-group/create - Component: CreateVmGroup - - title: VM Groups - path: /vm-group - icon: Folder - sidebar: true - Component: VmGroups -- title: Storage - icon: DatabaseStats - routes: - - title: Datastores - path: /datastore - sidebar: true - icon: Db - Component: Datastores - - title: Create Datastore - path: /datastore/create - Component: CreateDatastore - - title: Update Datastore - path: /datastore/update - Component: CreateDatastore - - title: Datastore - path: /datastore/:id - Component: DatastoreDetail - - title: Images - path: /image - sidebar: true - icon: BoxIso - Component: Images - - title: Create Image - path: /image/create - Component: CreateImage - - title: Files - path: /file - sidebar: true - icon: Archive - Component: Files - - title: Create File - path: /file/create - Component: CreateFile - - title: Backups - path: /backup - sidebar: true - icon: RefreshDouble - Component: Backups - - title: Backup - path: /backup/:id - Component: BackupDetail - - title: Marketplaces - path: /marketplace - sidebar: true - icon: SimpleCart - Component: Marketplaces - - title: Create Marketplace - path: /marketplace/create - Component: CreateMarketplace - - title: Marketplace - path: /marketplace/:id - Component: MarketplaceDetail - - title: Apps - path: /marketplace-app - sidebar: true - icon: CloudDownload - Component: MarketplaceApps - - title: Create Marketplace App - path: /marketplace-app/create - Component: CreateMarketplaceApp - - title: App - path: /marketplace-app/:id - Component: MarketplaceAppDetail - - title: Create BackupJob - path: /backupjobs/create - Component: CreateBackupJob - - title: BackupJobs - path: /backupjobs - sidebar: true - icon: Clock - Component: BackupJobs - - title: BackupJob - path: /backupjobs/:id - Component: BackupJobDetail -- title: Networks - icon: Network - routes: - - title: Virtual networks - path: /virtual-network - sidebar: true - icon: NetworkAlt - Component: VirtualNetworks - - title: Instantiate Network Template - path: /network-template/instantiate - Component: InstantiateVnTemplate - - title: Create Virtual Network - path: /virtual-network/create - Component: CreateVirtualNetwork - - title: Update Virtual Network - path: /virtual-network/update - Component: CreateVirtualNetwork - - title: Virtual networks - path: /virtual-network/:id - Component: VirtualNetworkDetail - - title: Network Templates - path: /network-template - sidebar: true - icon: KeyframesCouple - Component: VnTemplates - - title: Create Virtual Network Template - path: /network-template/create - Component: CreateVnTemplate - - title: Security groups - path: /security-group - sidebar: true - icon: HistoricShield - Component: SecurityGroups - - title: Create Security Group - path: /security-group/create - Component: CreateSecurityGroup -- title: Infrastructure - icon: Cloud - routes: - - title: Drivers - path: /driver - sidebar: false - icon: DataTransferUp - Component: Drivers - - title: Providers - path: /provider - sidebar: true - icon: SettingsProfiles - Component: Providers - - title: Create Provider - path: /provider/create - Component: CreateProvider - - title: Clusters - path: /cluster - sidebar: true - icon: Server - Component: Clusters - - title: Create Cluster - path: /cluster/create - Component: CreateCluster - - title: Create Cluster - path: /cluster/create_cloud - Component: CreateClusterCloud - - title: Cluster Logs - path: /cluster/create_cloud_logs/:id - Component: CreateClusterCloudLogs - - title: Cluster - path: /cluster/:id - Component: ClusterDetail - - title: Hosts - path: /host - sidebar: true - icon: HardDrive - Component: Hosts - - title: Create Host - path: /host/create - Component: CreateHost - - title: Host - path: /host/:id - Component: HostDetail - - title: Zones - path: /zone - sidebar: true - icon: MinusPinAlt - Component: Zones -- title: System - icon: Tools - routes: - - title: Create User - path: /user/create - Component: CreateUser - - title: Users - path: /user - sidebar: true - icon: User - Component: Users - - title: User - path: /user/:id - Component: UserDetail - - title: Create Group - path: /group/create - Component: CreateGroup - - title: Groups - path: /group - sidebar: true - icon: Group - Component: Groups - - title: Group - path: /group/:id - Component: GroupDetail - - title: Create VDC - path: /virtual-data-center/create - Component: CreateVDC - - title: VDCs - path: /virtual-data-center - sidebar: true - icon: List - Component: VDCs - - title: VDC - path: /virtual-data-center/:id - Component: VDCDetail - - title: Create ACL - path: /acl/create - Component: CreateACL - - title: ACLs - path: /acl - sidebar: true - icon: KeyAlt - Component: ACLs -- title: Support - path: /support - sidebar: true - icon: HeadsetHelp - Component: Support -- title: Create Ticket - path: /support/create - Component: CreateTicket -- title: Guacamole - path: /guacamole/:id/:type - sidebar: false - Component: Guacamole diff --git a/src/fireedge/etc/sunstone/tabs/10-instances-tab.yaml b/src/fireedge/etc/sunstone/tabs/10-instances-tab.yaml new file mode 100644 index 0000000000..17d44abad5 --- /dev/null +++ b/src/fireedge/etc/sunstone/tabs/10-instances-tab.yaml @@ -0,0 +1,33 @@ +- title: Instances + icon: GridAdd + routes: + - title: VMs + path: /vm + sidebar: true + icon: ModernTv + Component: VirtualMachines + - title: Create VM + path: /vm/create + Component: CreateVm + - title: Virtual Routers + path: /vrouter + sidebar: true + icon: Shuffle + Component: VirtualRouters + - title: Instantiate Virtual Router + path: /vrouter/instantiate + Component: InstantiateVrTemplate + - title: Virtual Routers + path: /vrouter/:id + Component: VirtualRouterDetail + - title: Services + path: /service + sidebar: true + icon: Packages + Component: Services + - title: Instantiate Service Template + path: /service/instantiate/ + Component: InstantiateServiceTemplate + - title: Service + path: /service/:id + Component: ServiceDetail diff --git a/src/fireedge/etc/sunstone/tabs/20-templates-tab.yaml b/src/fireedge/etc/sunstone/tabs/20-templates-tab.yaml new file mode 100644 index 0000000000..058d9eb63a --- /dev/null +++ b/src/fireedge/etc/sunstone/tabs/20-templates-tab.yaml @@ -0,0 +1,59 @@ +- title: Templates + icon: ViewStructureDown + routes: + - title: VM Templates + path: /vm-template + sidebar: true + icon: EmptyPage + Component: VmTemplates + - title: Instantiate VM Template + path: /vm-template/instantiate + Component: InstantiateVmTemplate + - title: Create VM Template + path: /vm-template/create + Component: CreateVmTemplate + - title: Update VM Template + path: /vm-template/update + Component: CreateVmTemplate + - title: VM Template + path: /vm-template/:id + Component: VmTemplateDetail + - title: Instantiate Service Template + path: /service-template/instantiate/ + Component: InstantiateServiceTemplate + - title: Service Templates + path: /service-template + sidebar: true + icon: MultiplePagesEmpty + Component: ServiceTemplates + - title: Create Service Template + path: /service-template/create + Component: CreateServiceTemplate + - title: Service Template + path: /service-template/:id + Component: ServiceTemplateDetail + - title: Instantiate VR Template + path: /vrouter-template/instantiate/ + Component: InstantiateVrTemplate + - title: Virtual Routers + path: /vrouter-template + sidebar: true + icon: Shuffle + Component: VrTemplates + - title: Create VR Template + path: /vrouter-template/create + Component: CreateVrTemplate + - title: Update VR Template + path: /vrouter-template/update + Component: CreateVrTemplate + - title: VR Template + path: /vrouter-template/:id + Component: VrTemplateDetail + - title: Create VM group + path: /vm-group/create + Component: CreateVmGroup + - title: VM Groups + path: /vm-group + icon: Folder + sidebar: true + Component: VmGroups diff --git a/src/fireedge/etc/sunstone/tabs/30-storage-tab.yaml b/src/fireedge/etc/sunstone/tabs/30-storage-tab.yaml new file mode 100644 index 0000000000..bb0971d75b --- /dev/null +++ b/src/fireedge/etc/sunstone/tabs/30-storage-tab.yaml @@ -0,0 +1,74 @@ +- title: Storage + icon: DatabaseStats + routes: + - title: Datastores + path: /datastore + sidebar: true + icon: Db + Component: Datastores + - title: Create Datastore + path: /datastore/create + Component: CreateDatastore + - title: Update Datastore + path: /datastore/update + Component: CreateDatastore + - title: Datastore + path: /datastore/:id + Component: DatastoreDetail + - title: Images + path: /image + sidebar: true + icon: BoxIso + Component: Images + - title: Create Image + path: /image/create + Component: CreateImage + - title: Files + path: /file + sidebar: true + icon: Archive + Component: Files + - title: Create File + path: /file/create + Component: CreateFile + - title: Backups + path: /backup + sidebar: true + icon: RefreshDouble + Component: Backups + - title: Backup + path: /backup/:id + Component: BackupDetail + - title: Marketplaces + path: /marketplace + sidebar: true + icon: SimpleCart + Component: Marketplaces + - title: Create Marketplace + path: /marketplace/create + Component: CreateMarketplace + - title: Marketplace + path: /marketplace/:id + Component: MarketplaceDetail + - title: Apps + path: /marketplace-app + sidebar: true + icon: CloudDownload + Component: MarketplaceApps + - title: Create Marketplace App + path: /marketplace-app/create + Component: CreateMarketplaceApp + - title: App + path: /marketplace-app/:id + Component: MarketplaceAppDetail + - title: Create BackupJob + path: /backupjobs/create + Component: CreateBackupJob + - title: BackupJobs + path: /backupjobs + sidebar: true + icon: Clock + Component: BackupJobs + - title: BackupJob + path: /backupjobs/:id + Component: BackupJobDetail diff --git a/src/fireedge/etc/sunstone/tabs/40-networks-tab.yaml b/src/fireedge/etc/sunstone/tabs/40-networks-tab.yaml new file mode 100644 index 0000000000..086158ee35 --- /dev/null +++ b/src/fireedge/etc/sunstone/tabs/40-networks-tab.yaml @@ -0,0 +1,36 @@ +- title: Networks + icon: Network + routes: + - title: Virtual networks + path: /virtual-network + sidebar: true + icon: NetworkAlt + Component: VirtualNetworks + - title: Instantiate Network Template + path: /network-template/instantiate + Component: InstantiateVnTemplate + - title: Create Virtual Network + path: /virtual-network/create + Component: CreateVirtualNetwork + - title: Update Virtual Network + path: /virtual-network/update + Component: CreateVirtualNetwork + - title: Virtual networks + path: /virtual-network/:id + Component: VirtualNetworkDetail + - title: Network Templates + path: /network-template + sidebar: true + icon: KeyframesCouple + Component: VnTemplates + - title: Create Virtual Network Template + path: /network-template/create + Component: CreateVnTemplate + - title: Security groups + path: /security-group + sidebar: true + icon: HistoricShield + Component: SecurityGroups + - title: Create Security Group + path: /security-group/create + Component: CreateSecurityGroup diff --git a/src/fireedge/etc/sunstone/tabs/50-infrastructure-tab.yaml b/src/fireedge/etc/sunstone/tabs/50-infrastructure-tab.yaml new file mode 100644 index 0000000000..a35845b7f6 --- /dev/null +++ b/src/fireedge/etc/sunstone/tabs/50-infrastructure-tab.yaml @@ -0,0 +1,49 @@ +- title: Infrastructure + icon: Cloud + routes: + - title: Drivers + path: /driver + sidebar: false + icon: DataTransferUp + Component: Drivers + - title: Providers + path: /provider + sidebar: true + icon: SettingsProfiles + Component: Providers + - title: Create Provider + path: /provider/create + Component: CreateProvider + - title: Clusters + path: /cluster + sidebar: true + icon: Server + Component: Clusters + - title: Create Cluster + path: /cluster/create + Component: CreateCluster + - title: Create Cluster + path: /cluster/create_cloud + Component: CreateClusterCloud + - title: Cluster Logs + path: /cluster/create_cloud_logs/:id + Component: CreateClusterCloudLogs + - title: Cluster + path: /cluster/:id + Component: ClusterDetail + - title: Hosts + path: /host + sidebar: true + icon: HardDrive + Component: Hosts + - title: Create Host + path: /host/create + Component: CreateHost + - title: Host + path: /host/:id + Component: HostDetail + - title: Zones + path: /zone + sidebar: true + icon: MinusPinAlt + Component: Zones diff --git a/src/fireedge/etc/sunstone/tabs/60-system-tab.yaml b/src/fireedge/etc/sunstone/tabs/60-system-tab.yaml new file mode 100644 index 0000000000..52d8bded9a --- /dev/null +++ b/src/fireedge/etc/sunstone/tabs/60-system-tab.yaml @@ -0,0 +1,44 @@ +- title: System + icon: Tools + routes: + - title: Create User + path: /user/create + Component: CreateUser + - title: Users + path: /user + sidebar: true + icon: User + Component: Users + - title: User + path: /user/:id + Component: UserDetail + - title: Create Group + path: /group/create + Component: CreateGroup + - title: Groups + path: /group + sidebar: true + icon: Group + Component: Groups + - title: Group + path: /group/:id + Component: GroupDetail + - title: Create VDC + path: /virtual-data-center/create + Component: CreateVDC + - title: VDCs + path: /virtual-data-center + sidebar: true + icon: List + Component: VDCs + - title: VDC + path: /virtual-data-center/:id + Component: VDCDetail + - title: Create ACL + path: /acl/create + Component: CreateACL + - title: ACLs + path: /acl + sidebar: true + icon: KeyAlt + Component: ACLs diff --git a/src/fireedge/etc/sunstone/tabs/70-support-tab.yaml b/src/fireedge/etc/sunstone/tabs/70-support-tab.yaml new file mode 100644 index 0000000000..ce0e645eb0 --- /dev/null +++ b/src/fireedge/etc/sunstone/tabs/70-support-tab.yaml @@ -0,0 +1,8 @@ +- title: Support + path: /support + sidebar: true + icon: HeadsetHelp + Component: Support +- title: Create Ticket + path: /support/create + Component: CreateTicket diff --git a/src/fireedge/etc/sunstone/tabs/80-guacamole-tab.yaml b/src/fireedge/etc/sunstone/tabs/80-guacamole-tab.yaml new file mode 100644 index 0000000000..f874ffa20f --- /dev/null +++ b/src/fireedge/etc/sunstone/tabs/80-guacamole-tab.yaml @@ -0,0 +1,4 @@ +- title: Guacamole + path: /guacamole/:id/:type + sidebar: false + Component: Guacamole diff --git a/src/fireedge/etc/sunstone/tabs/oneks-tab.yaml b/src/fireedge/etc/sunstone/tabs/90-oneks-tab.yaml similarity index 93% rename from src/fireedge/etc/sunstone/tabs/oneks-tab.yaml rename to src/fireedge/etc/sunstone/tabs/90-oneks-tab.yaml index f6d28a87c2..4a1c8b1467 100644 --- a/src/fireedge/etc/sunstone/tabs/oneks-tab.yaml +++ b/src/fireedge/etc/sunstone/tabs/90-oneks-tab.yaml @@ -14,4 +14,4 @@ Component: OneKs - title: k8S Clusters path: /kubernetes/:id - Component: OneKsDetail \ No newline at end of file + Component: OneKsDetail diff --git a/src/fireedge/src/modules/features/OneApi/system.js b/src/fireedge/src/modules/features/OneApi/system.js index 93dfaff9fa..28999d58c7 100644 --- a/src/fireedge/src/modules/features/OneApi/system.js +++ b/src/fireedge/src/modules/features/OneApi/system.js @@ -68,7 +68,7 @@ const systemApi = oneApi.injectEndpoints({ /** * Returns the Tab Manifest configuration. * - * @returns {object} The loaded tab-manifest.yaml file + * @returns {object[]} The loaded tab manifest entries * @throws Fails when response isn't code 200 */ query: () => { diff --git a/src/fireedge/src/server/utils/constants/defaults.js b/src/fireedge/src/server/utils/constants/defaults.js index c8021a13cc..e68d8a97e2 100644 --- a/src/fireedge/src/server/utils/constants/defaults.js +++ b/src/fireedge/src/server/utils/constants/defaults.js @@ -170,7 +170,6 @@ const defaults = { ], /** CONFIGURATION FILE */ - defaultTabManifestFilename: 'tab-manifest.yaml', defaultRemoteModulesConfigFilename: 'remotes-config.yaml', defaultConfigFile: `${appName}-server.conf`, defaultSunstoneViews: `${appNameSunstone}-views.yaml`, diff --git a/src/fireedge/src/server/utils/remoteModules.js b/src/fireedge/src/server/utils/remoteModules.js index a16f6d839a..92974699f0 100644 --- a/src/fireedge/src/server/utils/remoteModules.js +++ b/src/fireedge/src/server/utils/remoteModules.js @@ -22,24 +22,19 @@ const { defaultRemoteModules } = defaults const path = require('path') /** - * Reads the tab-manifest.yaml file from disk. + * Reads and joins the Sunstone tab manifest files from disk. * - * @returns {Promise} - The parsed JSON object from the file. - * @throws {Error} - Throws if the file cannot be read or parsed. + * @returns {Promise} - The parsed tab manifest entries. + * @throws {Error} - Throws if the directory cannot be read or a file parsed. */ const getTabManifest = async () => { try { const tabManifestConfigDirectory = global?.paths?.TAB_MANIFEST_DIR - const tabManifestConfigPath = global?.paths?.TAB_MANIFEST_CONFIG - if (!(await fs.pathExists(tabManifestConfigPath))) { - throw new Error(`Configuration file not found: ${tabManifestConfigPath}`) - } - - let overlayFiles = [] + let tabFiles = [] try { const yamlExtNames = ['.yaml', '.yml'] - overlayFiles = ( + tabFiles = ( await fs.readdir(tabManifestConfigDirectory, { encoding: 'utf8', withFileTypes: true, @@ -59,15 +54,13 @@ const getTabManifest = async () => { const manifest = ( await Promise.all( - [tabManifestConfigPath, ...overlayFiles]?.map(async (p) => - yamlToJson(await fs.readFile(p, 'utf8')) - ) + tabFiles?.map(async (p) => yamlToJson(await fs.readFile(p, 'utf8'))) ) )?.flat() return manifest } catch (error) { - throw new Error('Failed to load tab-manifest.yaml') + throw new Error('Failed to load tab manifest') } } diff --git a/src/fireedge/src/server/utils/server.js b/src/fireedge/src/server/utils/server.js index 8cc9e6533a..b63a33f073 100644 --- a/src/fireedge/src/server/utils/server.js +++ b/src/fireedge/src/server/utils/server.js @@ -71,7 +71,6 @@ const { defaultSunstoneConfig, defaultDownloader, defaultEmptyFunction, - defaultTabManifestFilename, defaultRemoteModulesConfigFilename, } = defaults @@ -657,9 +656,6 @@ const genPathResources = () => { if (!global.paths.OS_PROFILES) { global.paths.OS_PROFILES = `${MODULES_LOCATION}/profiles` } - if (!global.paths.TAB_MANIFEST_CONFIG) { - global.paths.TAB_MANIFEST_CONFIG = `${MODULES_LOCATION}/${defaultTabManifestFilename}` - } if (!global.paths.TAB_MANIFEST_DIR) { global.paths.TAB_MANIFEST_DIR = `${MODULES_LOCATION}/tabs` }