diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json index 20468a302..2fde2b6c8 100644 --- a/dashboard/package-lock.json +++ b/dashboard/package-lock.json @@ -25,7 +25,7 @@ "jquery": "^3.7.1", "marked": "^15.0.9", "moment-timezone": "^0.5.48", - "pankow": "^3.0.3", + "pankow": "^3.0.4", "sass": "^1.87.0", "vite": "^6.3.2", "vue": "^3.5.13", @@ -2365,9 +2365,9 @@ } }, "node_modules/pankow": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/pankow/-/pankow-3.0.3.tgz", - "integrity": "sha512-NiN/J/E/9XSa/rjzH/RBWLhdUXuF/YRqVAHIaVQUr7VoRJpEGiFveKhnJKRXaWgpZldkdu1QhxlpzwaKqz5WKg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/pankow/-/pankow-3.0.4.tgz", + "integrity": "sha512-iLUoMMok/fgr2uGwhkosgN9h8o/YHNr5yoiaG6KiU81tp2ZIN3V0BDAoL+5nDjneRz1XHxXqJdt6vHxOZdmL7g==", "license": "ISC", "dependencies": { "@fontsource/inter": "^5.2.5", @@ -4237,9 +4237,9 @@ } }, "pankow": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/pankow/-/pankow-3.0.3.tgz", - "integrity": "sha512-NiN/J/E/9XSa/rjzH/RBWLhdUXuF/YRqVAHIaVQUr7VoRJpEGiFveKhnJKRXaWgpZldkdu1QhxlpzwaKqz5WKg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/pankow/-/pankow-3.0.4.tgz", + "integrity": "sha512-iLUoMMok/fgr2uGwhkosgN9h8o/YHNr5yoiaG6KiU81tp2ZIN3V0BDAoL+5nDjneRz1XHxXqJdt6vHxOZdmL7g==", "requires": { "@fontsource/inter": "^5.2.5", "@fortawesome/fontawesome-free": "^6.7.2", diff --git a/dashboard/package.json b/dashboard/package.json index 151ea81a6..0cc5e3796 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -26,7 +26,7 @@ "jquery": "^3.7.1", "marked": "^15.0.9", "moment-timezone": "^0.5.48", - "pankow": "^3.0.3", + "pankow": "^3.0.4", "sass": "^1.87.0", "vite": "^6.3.2", "vue": "^3.5.13", diff --git a/dashboard/src/views/AppsView.vue b/dashboard/src/views/AppsView.vue index 4496f824f..b3c2e031a 100644 --- a/dashboard/src/views/AppsView.vue +++ b/dashboard/src/views/AppsView.vue @@ -50,9 +50,14 @@ const listColumns = { }, label: { label: 'Label', - sort: true + sort: (a, b, fullA, fullB) => { + if (!fullA || !fullA) return -1; + const checkA = fullA.label || fullA.subdomain || fullA.fqdn; + const checkB = fullB.label || fullB.subdomain || fullB.fqdn; + return checkA < checkB ? -1 : (checkA > checkB ? 1 : 0); + }, }, - domain: { + fqdn: { label: 'Location', sort: true, hideMobile: true, @@ -60,21 +65,34 @@ const listColumns = { status: { label: 'Status', hideMobile: true, - sort: (a, b) => { - // TODO we need pankow fix to pass full object a,b instead of just the property - if (!a || !b) return -1; - return a.installationState < b.installationState ? -1 : (a.installationState > b.installationState ? 1 : 0); + sort: (a, b, fullA, fullB) => { + if (!fullA || !fullA) return -1; + const checkA = fullA.installationState + '-' + fullA.runState + '-' + fullA.health; + const checkB = fullB.installationState + '-' + fullB.runState + '-' + fullB.health; + return checkA < checkB ? -1 : (checkA > checkB ? 1 : 0); }, }, appTitle: { label: 'App Title', - sort: true, hideMobile: true, + sort: (a, b, fullA, fullB) => { + if (!fullA || !fullA) return -1; + const checkA = fullA.manifest.title; + const checkB = fullB.manifest.title; + return checkA < checkB ? -1 : (checkA > checkB ? 1 : 0); + }, }, sso: { label: 'Login', - sort: true, hideMobile: true, + sort: (a, b, fullA, fullB) => { + if (!fullA || !fullA) return -1; + + const checkA = fullA.type === APP_TYPES.LINK ? 0 : (fullA.ssoAuth && fullA.manifest.addons.oidc ? 1 : (fullA.ssoAuth && (!fullA.manifest.addons.oidc && !fullA.manifest.addons.email) ? 2 : (!fullA.ssoAuth && !fullA.manifest.addons.email ? 3 : 4))); + const checkB = fullB.type === APP_TYPES.LINK ? 0 : (fullB.ssoAuth && fullB.manifest.addons.oidc ? 1 : (fullB.ssoAuth && (!fullB.manifest.addons.oidc && !fullB.manifest.addons.email) ? 2 : (!fullB.ssoAuth && !fullB.manifest.addons.email ? 3 : 4))); + + return checkA - checkB; + }, }, actions: {} }; @@ -253,7 +271,7 @@ onUnmounted(() => { -