Initial rewrite of the apps view

This commit is contained in:
Johannes Zellner
2024-12-29 00:36:48 +01:00
parent a42c7e4735
commit 55e0d734df
6 changed files with 164 additions and 14 deletions

View File

@@ -30,7 +30,7 @@
import { Button, InputDialog, TopBar, MainLayout } from 'pankow';
import LogsModel from '../models/LogsModel.js';
import AppModel from '../models/AppModel.js';
import AppsModel from '../models/AppsModel.js';
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
@@ -46,7 +46,7 @@ export default {
return {
accessToken: localStorage.token,
logsModel: null,
appModel: null,
appsModel: null,
busyRestart: false,
showRestart: false,
showFilemanager: false,
@@ -79,7 +79,7 @@ export default {
this.busyRestart = true;
await this.appModel.restart();
await this.appsModel.restart();
this.busyRestart = false;
}
@@ -126,10 +126,10 @@ export default {
this.logsModel = LogsModel.create(API_ORIGIN, this.accessToken, this.type, this.id);
if (this.type === 'app') {
this.appModel = AppModel.create(API_ORIGIN, this.accessToken, this.id);
this.appsModel = AppsModel.create(API_ORIGIN, this.accessToken, this.id);
try {
const app = await this.appModel.get();
const app = await this.appsModel.get();
this.name = `${app.label || app.fqdn} (${app.manifest.title})`;
this.showFilemanager = !!app.manifest.addons.localstorage;
this.showTerminal = app.manifest.id !== 'io.cloudron.builtin.appproxy';