diff --git a/public/assets/monitoring.svg b/public/assets/monitoring.svg
new file mode 100644
index 0000000..fa93808
--- /dev/null
+++ b/public/assets/monitoring.svg
@@ -0,0 +1,57 @@
+
+
+
diff --git a/src/components/UserModal/consts.ts b/src/components/UserModal/consts.ts
index b0b0dea..8f2aa98 100644
--- a/src/components/UserModal/consts.ts
+++ b/src/components/UserModal/consts.ts
@@ -5,28 +5,24 @@ export const appAccessList = [
name: 'wekan',
image: '/assets/wekan.svg',
label: 'Wekan',
- defaultSubdomain: 'wekan.{domain}',
documentationUrl: 'https://github.com/wekan/wekan/wiki',
},
{
name: 'wordpress',
image: '/assets/wordpress.svg',
label: 'Wordpress',
- defaultSubdomain: 'www.{domain}',
documentationUrl: 'https://wordpress.org/support/',
},
{
name: 'nextcloud',
image: '/assets/nextcloud.svg',
label: 'Nextcloud',
- defaultSubdomain: 'files.{domain}',
documentationUrl: 'https://docs.nextcloud.com/server/latest/user_manual/en/',
},
{
name: 'zulip',
image: '/assets/zulip.svg',
label: 'Zulip',
- defaultSubdomain: 'zulip.{domain}',
documentationUrl: 'https://docs.zulip.com/help/',
},
];
diff --git a/src/modules/apps/components/AppInstallModal/AppInstallModal.tsx b/src/modules/apps/components/AppInstallModal/AppInstallModal.tsx
index 57bca8a..14e0b1a 100644
--- a/src/modules/apps/components/AppInstallModal/AppInstallModal.tsx
+++ b/src/modules/apps/components/AppInstallModal/AppInstallModal.tsx
@@ -4,7 +4,6 @@ import _ from 'lodash';
import { App, useApps } from 'src/services/apps';
import { Modal } from 'src/components';
import { Input } from 'src/components/Form';
-import { appAccessList } from 'src/components/UserModal/consts';
import { AppInstallModalProps } from './types';
import { initialAppForm, initialCode } from './consts';
@@ -16,8 +15,6 @@ export const AppInstallModal = ({ open, onClose, appSlug }: AppInstallModalProps
defaultValues: initialAppForm,
});
- const getDefaultSubdomain = () => _.get(_.find(appAccessList, ['name', appSlug]), 'defaultSubdomain', '');
-
useEffect(() => {
if (appSlug) {
loadApp(appSlug);
@@ -32,11 +29,11 @@ export const AppInstallModal = ({ open, onClose, appSlug }: AppInstallModalProps
useEffect(() => {
if (!_.isEmpty(app)) {
setAppName(app.name);
- reset({ subdomain: getDefaultSubdomain(), configuration: initialCode, slug: appSlug ?? '' });
+ reset({ url: app.url, configuration: initialCode, slug: appSlug ?? '' });
}
return () => {
- reset({ subdomain: getDefaultSubdomain(), configuration: initialCode, slug: appSlug ?? '' });
+ reset({ url: initialAppForm.url, configuration: initialCode, slug: appSlug ?? '' });
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [app, reset, open]);
@@ -73,13 +70,7 @@ export const AppInstallModal = ({ open, onClose, appSlug }: AppInstallModalProps
diff --git a/src/modules/apps/components/AppInstallModal/consts.ts b/src/modules/apps/components/AppInstallModal/consts.ts
index c3d5fa9..22a30bc 100644
--- a/src/modules/apps/components/AppInstallModal/consts.ts
+++ b/src/modules/apps/components/AppInstallModal/consts.ts
@@ -23,5 +23,5 @@ search:
great: stomach`;
export const initialAppForm = {
- subdomain: '',
+ url: '',
} as App;
diff --git a/src/modules/dashboard/Dashboard.tsx b/src/modules/dashboard/Dashboard.tsx
index 959b99f..612cc39 100644
--- a/src/modules/dashboard/Dashboard.tsx
+++ b/src/modules/dashboard/Dashboard.tsx
@@ -1,13 +1,22 @@
-import React from 'react';
+/* eslint-disable react-hooks/exhaustive-deps */
+import React, { useEffect } from 'react';
import clsx from 'clsx';
-import { DASHBOARD_APPS, DASHBOARD_QUICK_ACCESS } from './consts';
+import { useApps } from 'src/services/apps';
+// import { DASHBOARD_QUICK_ACCESS } from './consts';
import { DashboardCard } from './components';
export const Dashboard: React.FC = () => {
const host = window.location.hostname;
const splitedDomain = host.split('.');
splitedDomain.shift();
- const rootDomain = splitedDomain.join('.');
+ const { apps, appTableLoading, loadApps } = useApps();
+
+ // Tell React to load the apps
+ useEffect(() => {
+ loadApps();
+
+ return () => {};
+ }, []);
return (
@@ -19,37 +28,11 @@ export const Dashboard: React.FC = () => {
- {DASHBOARD_APPS(rootDomain!).map((app) => (
-
- ))}
-
-
-
diff --git a/src/modules/dashboard/components/DashboardCard/DashboardCard.tsx b/src/modules/dashboard/components/DashboardCard/DashboardCard.tsx
index d8142e0..1b9b820 100644
--- a/src/modules/dashboard/components/DashboardCard/DashboardCard.tsx
+++ b/src/modules/dashboard/components/DashboardCard/DashboardCard.tsx
@@ -25,7 +25,7 @@ export const DashboardCard: React.FC = ({ app }: { app: any }) => {
diff --git a/src/services/apps/redux/reducers.ts b/src/services/apps/redux/reducers.ts
index e303153..26736ae 100644
--- a/src/services/apps/redux/reducers.ts
+++ b/src/services/apps/redux/reducers.ts
@@ -1,13 +1,13 @@
import { AppActionTypes } from './actions';
-const initialUsersState: any = {
- users: [],
- user: {},
- userModalLoading: false,
- usersLoading: false,
+const initialAppsState: any = {
+ apps: [],
+ app: {},
+ appModalLoading: false,
+ appsLoading: false,
};
-const appsReducer = (state: any = initialUsersState, action: any) => {
+const appsReducer = (state: any = initialAppsState, action: any) => {
switch (action.type) {
case AppActionTypes.FETCH_APPS:
return {
diff --git a/src/services/apps/transformations.ts b/src/services/apps/transformations.ts
index aa4f0ed..6542336 100644
--- a/src/services/apps/transformations.ts
+++ b/src/services/apps/transformations.ts
@@ -2,14 +2,14 @@ import { App, AppStatus } from './types';
const transformAppStatus = (status: string) => {
switch (status) {
- case 'installed':
+ case 'App installed and running':
return AppStatus.Installed;
- case 'installing':
- return AppStatus.Installing;
- case 'not_installed':
+ case 'Not installed':
return AppStatus.NotInstalled;
+ // For now default to "Installing" status for any app that isn't installed
+ // or not installed. Could also mean "upgrading", or "broken"...
default:
- return AppStatus.NotInstalled;
+ return AppStatus.Installing;
}
};
@@ -19,8 +19,10 @@ export const transformApp = (response: any): App => {
name: response.name ?? '',
slug: response.slug ?? '',
status: transformAppStatus(response.status),
- subdomain: response.subdomain,
+ url: response.url,
automaticUpdates: response.automatic_updates,
+ assetSrc: `/assets/${response.slug}.svg`,
+ markdownSrc: `/markdown/${response.slug}.md`,
};
};
@@ -33,7 +35,7 @@ export const transformAppRequest = (data: App) => {
export const transformInstallAppRequest = (data: App) => {
return {
- subdomain: data.subdomain,
+ url: data.url,
configuration: data.configuration,
};
};
diff --git a/src/services/apps/types.ts b/src/services/apps/types.ts
index 317f171..17708b1 100644
--- a/src/services/apps/types.ts
+++ b/src/services/apps/types.ts
@@ -3,9 +3,11 @@ export interface App {
name: string;
slug: string;
status?: AppStatus;
- subdomain?: string;
+ url: string;
automaticUpdates: boolean;
configuration?: string;
+ assetSrc?: string;
+ markdownSrc?: string;
}
export interface DisableAppForm {
diff --git a/yarn.lock b/yarn.lock
index 7eefd82..b8d82ca 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1862,6 +1862,11 @@
jest-diff "^26.0.0"
pretty-format "^26.0.0"
+"@types/js-yaml@^4.0.5":
+ version "4.0.5"
+ resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.5.tgz#738dd390a6ecc5442f35e7f03fa1431353f7e138"
+ integrity sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA==
+
"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8":
version "7.0.9"
resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz"