-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
217 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...nit/plugins/packages/openc3-vue-common/src/tools/admin/tabs/settings/NewsFeedSettings.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!-- | ||
# 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. | ||
--> | ||
|
||
<template> | ||
<v-card> | ||
<v-card-title>News Feed Settings</v-card-title> | ||
<v-alert v-model="errorLoading" type="error" closable density="compact"> | ||
Error loading previous configuration due to {{ errorText }} | ||
</v-alert> | ||
<v-alert v-model="errorSaving" type="error" closable density="compact"> | ||
Error saving due to {{ errorText }} | ||
</v-alert> | ||
<v-alert v-model="successSaving" type="success" closable density="compact"> | ||
Saved! (Refresh the page to see changes) | ||
</v-alert> | ||
<v-card-text class="pb-0"> | ||
<v-switch | ||
label="Allow COSMOS backend to pull the news feed from the COSMOS external news site. | ||
This is a low bandwidth poll which only happens every 12 hrs. To immediately update the news feed, click the 'Refresh' in the User Menu." | ||
v-model="newsFeed" | ||
color="primary" | ||
/> | ||
</v-card-text> | ||
<v-card-actions> | ||
<v-btn | ||
@click="save" | ||
color="success" | ||
variant="text" | ||
data-test="save-news-feed" | ||
> | ||
Save | ||
</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</template> | ||
|
||
<script> | ||
import Settings from './settings.js' | ||
|
||
const settingName = 'news_feed' | ||
export default { | ||
mixins: [Settings], | ||
data() { | ||
return { | ||
newsFeed: true, | ||
} | ||
}, | ||
created() { | ||
this.loadSetting(settingName) | ||
}, | ||
methods: { | ||
save() { | ||
console.log('save news feed', this.newsFeed) | ||
this.saveSetting(settingName, this.newsFeed) | ||
if (this.newsFeed) { | ||
this.api.update_news() | ||
} | ||
}, | ||
parseSetting: function (response) { | ||
console.log('parseSetting response', response) | ||
this.newsFeed = response | ||
}, | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.