diff --git a/dashboard/index.html b/dashboard/index.html index c4b56d098..a26060d14 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -15,6 +15,8 @@ + + diff --git a/dashboard/public/js/index.js b/dashboard/public/js/index.js index 3cf0ca324..3a9302367 100644 --- a/dashboard/public/js/index.js +++ b/dashboard/public/js/index.js @@ -56,8 +56,8 @@ app.config(['$routeProvider', function ($routeProvider) { controller: 'AppController', templateUrl: 'views/app.html?' + window.VITE_CACHE_ID }).when('/appstore', { - controller: 'AppStoreController', - templateUrl: 'views/appstore.html?' + window.VITE_CACHE_ID + // controller: 'AppStoreController', + // templateUrl: 'views/appstore.html?' + window.VITE_CACHE_ID }).when('/appstore/:appId', { controller: 'AppStoreController', templateUrl: 'views/appstore.html?' + window.VITE_CACHE_ID diff --git a/dashboard/src/components/AppInstallDialog.vue b/dashboard/src/components/AppInstallDialog.vue new file mode 100644 index 000000000..5787e8263 --- /dev/null +++ b/dashboard/src/components/AppInstallDialog.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/dashboard/src/components/AppstoreView.vue b/dashboard/src/components/AppstoreView.vue new file mode 100644 index 000000000..5c5e89205 --- /dev/null +++ b/dashboard/src/components/AppstoreView.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/dashboard/src/components/Index.vue b/dashboard/src/components/Index.vue index 5b567573c..8e7dcd7d4 100644 --- a/dashboard/src/components/Index.vue +++ b/dashboard/src/components/Index.vue @@ -2,6 +2,7 @@
+
@@ -12,6 +13,7 @@ import { Notification } from 'pankow'; import AppsView from './AppsView.vue'; +import AppstoreView from './AppstoreView.vue'; import SupportView from './SupportView.vue'; import VolumesView from './VolumesView.vue'; @@ -21,6 +23,7 @@ const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_OR const VIEWS = { APPS: 'apps', + APPSTORE: 'appstore', SUPPORT: 'support', VOLUMES: 'volumes', }; @@ -29,6 +32,7 @@ export default { name: 'Index', components: { AppsView, + AppstoreView, Notification, SupportView, VolumesView, @@ -58,6 +62,8 @@ export default { if (view === VIEWS.APPS) { that.view = VIEWS.APPS; + } else if (view === VIEWS.APPSTORE) { + that.view = VIEWS.APPSTORE; } else if (view === VIEWS.SUPPORT) { that.view = VIEWS.SUPPORT; } else if (view === VIEWS.VOLUMES) { diff --git a/dashboard/src/models/AppstoreModel.js b/dashboard/src/models/AppstoreModel.js new file mode 100644 index 000000000..b67b48b87 --- /dev/null +++ b/dashboard/src/models/AppstoreModel.js @@ -0,0 +1,27 @@ + +import { fetcher } from 'pankow'; + +function create(origin, accessToken) { + return { + name: 'AppstoreModel', + async list() { + let error, result; + try { + result = await fetcher.get(`${origin}/api/v1/appstore/apps`, { access_token: accessToken }); + } catch (e) { + error = e; + } + + if (error || result.status !== 200) { + console.error('Failed to list apps.', error || result.status); + return []; + } + + return result.body.apps; + }, + }; +} + +export default { + create, +};