aimeat 1.3.0 → 1.3.1
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 +32 -3
- 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
|
}
|
|
@@ -3290,6 +3293,31 @@
|
|
|
3290
3293
|
});
|
|
3291
3294
|
}
|
|
3292
3295
|
|
|
3296
|
+
function deleteServerApp(filename) {
|
|
3297
|
+
if (!confirm('Delete "' + filename + '" from the server?')) return;
|
|
3298
|
+
var config = loadConfig();
|
|
3299
|
+
var aimeatUrl = config.aimeatUrl.replace(/\/+$/, '');
|
|
3300
|
+
fetch(aimeatUrl + '/v1/auth/anonymous', { method: 'POST' })
|
|
3301
|
+
.then(function(resp) { return resp.json(); })
|
|
3302
|
+
.then(function(authJson) {
|
|
3303
|
+
var token = authJson.data && authJson.data.token;
|
|
3304
|
+
if (!token) throw new Error('Could not get auth token');
|
|
3305
|
+
return fetch(aimeatUrl + '/v1/apps/' + encodeURIComponent(filename), {
|
|
3306
|
+
method: 'DELETE',
|
|
3307
|
+
headers: { 'Authorization': 'Bearer ' + token }
|
|
3308
|
+
});
|
|
3309
|
+
})
|
|
3310
|
+
.then(function(resp) { return resp.json(); })
|
|
3311
|
+
.then(function(json) {
|
|
3312
|
+
if (json.ok) {
|
|
3313
|
+
loadPublishedApps();
|
|
3314
|
+
} else {
|
|
3315
|
+
alert('Failed to delete: ' + (json.error && json.error.message ? json.error.message : 'Unknown error'));
|
|
3316
|
+
}
|
|
3317
|
+
})
|
|
3318
|
+
.catch(function(err) { alert('Error: ' + (err.message || err)); });
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3293
3321
|
// ── Cortex Extensions Bar ─────────────────────────
|
|
3294
3322
|
|
|
3295
3323
|
var cortexToken = null;
|
|
@@ -4022,6 +4050,7 @@
|
|
|
4022
4050
|
loadPublishedApps: loadPublishedApps,
|
|
4023
4051
|
togglePublished: togglePublished,
|
|
4024
4052
|
unpublishApp: unpublishApp,
|
|
4053
|
+
deleteServerApp: deleteServerApp,
|
|
4025
4054
|
renderRecentlyOpened: renderRecentlyOpened,
|
|
4026
4055
|
loadCortexExtensions: loadCortexExtensions,
|
|
4027
4056
|
showCortexPopup: showCortexPopup,
|