aimeat 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/static/app-catalog.html +34 -14
- package/package.json +1 -1
|
@@ -3190,11 +3190,13 @@
|
|
|
3190
3190
|
merged.push({
|
|
3191
3191
|
name: (sa.manifest && sa.manifest.name) ? sa.manifest.name : filename,
|
|
3192
3192
|
filename: filename,
|
|
3193
|
+
owner: sa.owner || '',
|
|
3193
3194
|
version: sa.version_number ? 'v' + sa.version_number : '',
|
|
3194
3195
|
date: sa.created_at ? new Date(sa.created_at).toLocaleDateString() : '',
|
|
3195
3196
|
viewUrl: aimeatUrl + '/v1/apps/' + encodeURIComponent(sa.owner || '') + '/' + encodeURIComponent(filename),
|
|
3196
3197
|
source: source,
|
|
3197
|
-
localId: localMatch ? localMatch.id : null
|
|
3198
|
+
localId: localMatch ? localMatch.id : null,
|
|
3199
|
+
isOwn: true
|
|
3198
3200
|
});
|
|
3199
3201
|
}
|
|
3200
3202
|
|
|
@@ -3227,7 +3229,7 @@
|
|
|
3227
3229
|
for (var i = 0; i < merged.length; i++) {
|
|
3228
3230
|
var app = merged[i];
|
|
3229
3231
|
var badgeClass = app.source === 'both' ? 'both' : (app.source === 'server' ? 'server' : 'local');
|
|
3230
|
-
var badgeLabel = app.source === 'both' ? '
|
|
3232
|
+
var badgeLabel = app.source === 'both' ? 'PORTAL + MCP' : (app.source === 'server' ? 'MCP' : 'PORTAL');
|
|
3231
3233
|
html +=
|
|
3232
3234
|
'<div class="published-card">' +
|
|
3233
3235
|
'<div class="published-card-name">' + escapeHtml(app.name) + (app.version ? ' <span style="opacity:.5;font-size:.85em">' + escapeHtml(app.version) + '</span>' : '') +
|
|
@@ -3239,7 +3241,8 @@
|
|
|
3239
3241
|
'</div>' +
|
|
3240
3242
|
'<div class="published-card-actions">' +
|
|
3241
3243
|
(app.viewUrl ? '<button onclick="window.open(\'' + escapeHtml(app.viewUrl) + '?mode=inline\', \'_blank\')">👁 View</button>' : '') +
|
|
3242
|
-
(app.localId ? '<button onclick="window._launcher.unpublishApp(\'' + escapeHtml(app.localId) + '\')" class="danger">🗑 Remove</button>' :
|
|
3244
|
+
(app.localId ? '<button onclick="window._launcher.unpublishApp(\'' + escapeHtml(app.localId) + '\')" class="danger">🗑 Remove</button>' :
|
|
3245
|
+
app.isOwn ? '<button onclick="window._launcher.deleteServerApp(\'' + escapeHtml(app.filename) + '\')" class="danger">🗑 Remove</button>' : '') +
|
|
3243
3246
|
'</div>' +
|
|
3244
3247
|
'</div>';
|
|
3245
3248
|
}
|
|
@@ -3258,17 +3261,12 @@
|
|
|
3258
3261
|
var config = loadConfig();
|
|
3259
3262
|
var aimeatUrl = config.aimeatUrl.replace(/\/+$/, '');
|
|
3260
3263
|
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
return fetch(aimeatUrl + '/v1/apps/' + encodeURIComponent(app.publishedFilename), {
|
|
3268
|
-
method: 'DELETE',
|
|
3269
|
-
headers: { 'Authorization': 'Bearer ' + token }
|
|
3270
|
-
});
|
|
3271
|
-
})
|
|
3264
|
+
var token = getCortexOwnerToken();
|
|
3265
|
+
if (!token) { alert('You must be logged in to delete apps. Sign in first.'); return; }
|
|
3266
|
+
fetch(aimeatUrl + '/v1/apps/' + encodeURIComponent(app.publishedFilename), {
|
|
3267
|
+
method: 'DELETE',
|
|
3268
|
+
headers: { 'Authorization': 'Bearer ' + token }
|
|
3269
|
+
})
|
|
3272
3270
|
.then(function(resp) { return resp.json(); })
|
|
3273
3271
|
.then(function(json) {
|
|
3274
3272
|
if (json.ok) {
|
|
@@ -3290,6 +3288,27 @@
|
|
|
3290
3288
|
});
|
|
3291
3289
|
}
|
|
3292
3290
|
|
|
3291
|
+
function deleteServerApp(filename) {
|
|
3292
|
+
if (!confirm('Delete "' + filename + '" from the server?')) return;
|
|
3293
|
+
var config = loadConfig();
|
|
3294
|
+
var aimeatUrl = config.aimeatUrl.replace(/\/+$/, '');
|
|
3295
|
+
var token = getCortexOwnerToken();
|
|
3296
|
+
if (!token) { alert('You must be logged in to delete apps. Sign in first.'); return; }
|
|
3297
|
+
fetch(aimeatUrl + '/v1/apps/' + encodeURIComponent(filename), {
|
|
3298
|
+
method: 'DELETE',
|
|
3299
|
+
headers: { 'Authorization': 'Bearer ' + token }
|
|
3300
|
+
})
|
|
3301
|
+
.then(function(resp) { return resp.json(); })
|
|
3302
|
+
.then(function(json) {
|
|
3303
|
+
if (json.ok) {
|
|
3304
|
+
loadPublishedApps();
|
|
3305
|
+
} else {
|
|
3306
|
+
alert('Failed to delete: ' + (json.error && json.error.message ? json.error.message : 'Unknown error'));
|
|
3307
|
+
}
|
|
3308
|
+
})
|
|
3309
|
+
.catch(function(err) { alert('Error: ' + (err.message || err)); });
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3293
3312
|
// ── Cortex Extensions Bar ─────────────────────────
|
|
3294
3313
|
|
|
3295
3314
|
var cortexToken = null;
|
|
@@ -4022,6 +4041,7 @@
|
|
|
4022
4041
|
loadPublishedApps: loadPublishedApps,
|
|
4023
4042
|
togglePublished: togglePublished,
|
|
4024
4043
|
unpublishApp: unpublishApp,
|
|
4044
|
+
deleteServerApp: deleteServerApp,
|
|
4025
4045
|
renderRecentlyOpened: renderRecentlyOpened,
|
|
4026
4046
|
loadCortexExtensions: loadCortexExtensions,
|
|
4027
4047
|
showCortexPopup: showCortexPopup,
|