diff --git a/openc3-cosmos-cmd-tlm-api/app/controllers/news_controller.rb b/openc3-cosmos-cmd-tlm-api/app/controllers/news_controller.rb new file mode 100644 index 0000000000..05009585d1 --- /dev/null +++ b/openc3-cosmos-cmd-tlm-api/app/controllers/news_controller.rb @@ -0,0 +1,25 @@ +# encoding: ascii-8bit + +# Copyright 2025 OpenC3, Inc. +# All Rights Reserved. +# +# This program is free software; you can modify and/or redistribute it +# under the terms of the GNU Affero General Public License +# as published by the Free Software Foundation; version 3 with +# attribution addendums as found in the LICENSE.txt +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. + +# This file may also be used under the terms of a commercial license +# if purchased from OpenC3, Inc. + +require 'openc3/models/news_model' + +class NewsController < ApplicationController + def index + render json: OpenC3::NewsModel.all() + end +end diff --git a/openc3-cosmos-cmd-tlm-api/config/routes.rb b/openc3-cosmos-cmd-tlm-api/config/routes.rb index c97d94bc9d..7123b3e518 100644 --- a/openc3-cosmos-cmd-tlm-api/config/routes.rb +++ b/openc3-cosmos-cmd-tlm-api/config/routes.rb @@ -196,6 +196,7 @@ get "/internal/metrics" => "internal_metrics#index" get "/internal/status" => "internal_status#status" + get "/news" => "news#index" get "/time" => "time#get_current" get "map.json" => "tools#importmap" get "auth.js" => "tools#auth" diff --git a/openc3-cosmos-init/plugins/README.md b/openc3-cosmos-init/plugins/README.md index c24f3aa02c..78a53c13c4 100644 --- a/openc3-cosmos-init/plugins/README.md +++ b/openc3-cosmos-init/plugins/README.md @@ -39,7 +39,7 @@ applications, described in the steps above. ## Developing OpenC3 Common Packages There are two packages that contain shared code between OpenC3 frontend applications: openc3-js-common and -openc3-vue-common. openc3-js-common contains framework-agnostic JavaScript code such as the API and Action Cable +openc3-vue-common. openc3-js-common contains framework-agnostic JavaScript code such as the API and Action Cable adapters, and openc3-vue-common contains Vue components, plugins, and mixins. In previous versions of COSMOS, this code was in a package called openc3-tool-common, and you would @@ -52,11 +52,11 @@ To see changes while developing one of these common packages, you must serve it 1. Open a second terminal and repeat that process for openc3-js-common or openc3-vue-common - a. You may omit the final single SPA override step, as it will have no affect for the common package + a. You may omit the final single SPA override step, as it will have no affect for the common package 1. If you are making style/layout changes, you must also open a third terminal and repeat the process for openc3-tool-base - a. **Do** complete the single SPA override step for openc3-tool-common + a. **Do** complete the single SPA override step for openc3-tool-base We are currently working on externalizing the common packages, which will greatly simplify this process (you'd only need to serve and override openc3-js-common or openc3-vue-common). This ability will come in a later release of COSMOS. diff --git a/openc3-cosmos-init/plugins/packages/openc3-js-common/src/services/openc3Api.js b/openc3-cosmos-init/plugins/packages/openc3-js-common/src/services/openc3Api.js index f2512a95d2..524f4dd9b4 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-js-common/src/services/openc3Api.js +++ b/openc3-cosmos-init/plugins/packages/openc3-js-common/src/services/openc3Api.js @@ -13,7 +13,7 @@ # GNU Affero General Public License for more details. # Modified by OpenC3, Inc. -# All changes Copyright 2024, OpenC3, Inc. +# All changes Copyright 2025, OpenC3, Inc. # All Rights Reserved # # This file may also be used under the terms of a commercial license @@ -683,6 +683,10 @@ export default class OpenC3Api { return this.exec('set_setting', [name, data]) } + update_news() { + return this.exec('update_news', []) + } + // DEPRECATED for set_setting save_setting(name, data) { return this.exec('set_setting', [name, data]) diff --git a/openc3-cosmos-init/plugins/packages/openc3-vue-common/src/tools/admin/tabs/SettingsTab.vue b/openc3-cosmos-init/plugins/packages/openc3-vue-common/src/tools/admin/tabs/SettingsTab.vue index af93340257..d5e813650a 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-vue-common/src/tools/admin/tabs/SettingsTab.vue +++ b/openc3-cosmos-init/plugins/packages/openc3-vue-common/src/tools/admin/tabs/SettingsTab.vue @@ -1,5 +1,5 @@ + + + + diff --git a/openc3-cosmos-init/plugins/packages/openc3-vue-common/src/tools/admin/tabs/settings/SuppressedSettings.vue b/openc3-cosmos-init/plugins/packages/openc3-vue-common/src/tools/admin/tabs/settings/SuppressedSettings.vue index 3ce45a704a..625d1f9f1e 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-vue-common/src/tools/admin/tabs/settings/SuppressedSettings.vue +++ b/openc3-cosmos-init/plugins/packages/openc3-vue-common/src/tools/admin/tabs/settings/SuppressedSettings.vue @@ -1,5 +1,5 @@