From fb57b8c0a5b610d127d4d602eee4b35d62de8b62 Mon Sep 17 00:00:00 2001 From: Stephanie Gredell Date: Mon, 9 Jun 2025 23:48:45 -0700 Subject: [PATCH] add microservice and cdn plugins --- static/app.js | 2 ++ static/game.html | 54 ++++++++++++++++++++++++++++++++++ static/plugins/cdn.js | 34 +++++++++++++++++++++ static/plugins/microservice.js | 34 +++++++++++++++++++++ 4 files changed, 124 insertions(+) create mode 100644 static/plugins/cdn.js create mode 100644 static/plugins/microservice.js diff --git a/static/app.js b/static/app.js index 9d484a7..d6dbe4e 100644 --- a/static/app.js +++ b/static/app.js @@ -6,6 +6,8 @@ import './plugins/cache.js'; import './plugins/loadbalancer.js'; import './plugins/database.js'; import './plugins/messageQueue.js'; +import './plugins/cdn.js'; +import './plugins/microservice.js'; import { PluginRegistry } from './pluginRegistry.js'; export class CanvasApp { diff --git a/static/game.html b/static/game.html index 271c27d..0284e85 100644 --- a/static/game.html +++ b/static/game.html @@ -758,6 +758,60 @@ +
+ + + + + + + + + + + + + + +
+
+ + + + + + + + + + + +
+ +
diff --git a/static/plugins/cdn.js b/static/plugins/cdn.js new file mode 100644 index 0000000..ea62842 --- /dev/null +++ b/static/plugins/cdn.js @@ -0,0 +1,34 @@ +import { PluginRegistry } from "../pluginRegistry.js"; + +PluginRegistry.register('cdn', { + type: 'cdn', + label: 'CDN', + props: [ + { name: 'label', type: 'string', default: 'CDN', group: 'label-group' }, + { name: 'ttl', type: 'number', default: 3600, group: 'cdn-group' }, + { + name: 'geoReplication', + type: 'string', + default: 'global', + group: 'cdn-group' + }, + { + name: 'cachingStrategy', + type: 'string', + default: 'cache-first', + group: 'cdn-group' + }, + { + name: 'compression', + type: 'string', + default: 'brotli', + group: 'cdn-group' + }, + { + name: 'http2', + type: 'string', + default: 'enabled', + group: 'cdn-group' + } + ] +}); diff --git a/static/plugins/microservice.js b/static/plugins/microservice.js new file mode 100644 index 0000000..707a33b --- /dev/null +++ b/static/plugins/microservice.js @@ -0,0 +1,34 @@ +import { PluginRegistry } from "../pluginRegistry.js"; + +PluginRegistry.register('microservice', { + type: 'microservice', + label: 'Microservice', + props: [ + { name: 'label', type: 'string', default: 'Service', group: 'label-group' }, + { + name: 'instanceCount', + type: 'number', + default: 3, + group: 'microservice-group' + }, + { + name: 'instanceSize', + type: 'string', + default: 'medium', + group: 'microservice-group' + }, + { + name: 'scalingStrategy', + type: 'string', + default: 'auto', + group: 'microservice-group' + }, + { + name: 'apiVersion', + type: 'string', + default: 'v1', + group: 'microservice-group' + } + ] +}); +