1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-08-01 00:45:18 +02:00

update default order ID for docker and kubernetes apps to allow custom order before apps without the order attribute

This commit is contained in:
François Darveau 2021-08-26 10:49:02 -04:00
parent 064ec83c12
commit cb794daf73
2 changed files with 5 additions and 18 deletions

View file

@ -161,7 +161,7 @@ labels:
- flame.url=https://example.com
- flame.category=My category # Optional, default is "Docker"
- flame.icon=icon-name # Optional, default is "docker"
- flame.order=1 # Optional, default is 1; lower number is first in the list
- flame.order=1 # Optional, default is 500; lower number is first in the list
```
And you must have activated the Docker sync option in the settings panel.
@ -211,7 +211,7 @@ metadata:
- flame.pawelmalak/url=https://example.com
- flame.pawelmalak/category=My category # Optional, default is "Kubernetes"
- flame.pawelmalak/icon=icon-name # Optional, default is "kubernetes"
- flame.pawelmalak/order=1 # Optional, default is 1; lower number is first in the list
- flame.pawelmalak/order=1 # Optional, default is 500; lower number is first in the list
```
And you must have activated the Kubernetes sync option in the settings panel.

View file

@ -223,7 +223,7 @@ async function retrieveDockerApps(apps, orderType, unpinStoppedApps) {
url: urls[i] || urls[0],
icon: icons[i] || 'docker',
category: category.id,
orderId: orders[i] || 1,
orderId: orders[i] || 500,
});
}
}
@ -288,27 +288,14 @@ async function retrieveKubernetesApps(apps, orderType, unpinStoppedApps) {
for (let i = 0; i < names.length; i++) {
const category = categoriesLabels[i] ? categories.find(category => category.name.toUpperCase() === categoriesLabels[i].toUpperCase()) : dockerDefaultCategory;
dockerApps.push({
kubernetesApps.push({
name: names[i] || names[0],
url: urls[i] || urls[0],
icon: icons[i] || 'docker',
category: category.id,
orderId: orders[i] || 1,
orderId: orders[i] || 500,
});
}
const app = {
name: annotations['flame.pawelmalak/name'],
url: annotations['flame.pawelmalak/url'],
icon: annotations['flame.pawelmalak/icon'] || 'kubernetes',
categoryId: kubernetesDefaultCategory.id,
orderId: annotations['flame.pawelmalak/order'] || 1,
};
if (annotations['flame.pawelmalak/category']) {
const category = categories.find(category => category.name.toUpperCase() === annotations['flame.pawelmalak/category'].toUpperCase());
app.categoryId = category ? category.id : dockerDefaultCategory.id;
}
kubernetesApps.push(app);
}
}