Skip to content

Commit

Permalink
Merge pull request #361 from Progress1/enter_mew_item
Browse files Browse the repository at this point in the history
Use text format in Content for manually entered news items
  • Loading branch information
Progress1 authored Aug 30, 2024
2 parents d00c55d + fe6c6a3 commit 719042d
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 57 deletions.
1 change: 1 addition & 0 deletions src/gui/src/i18n/cs/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const messages_cs = {
review: "Souhrn",
source: "Zdroj",
link: "Odkaz",
content: "Obsah",
successful: "Novinka byla vytvořena",
},

Expand Down
1 change: 1 addition & 0 deletions src/gui/src/i18n/en/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const messages_en = {
review: "Review",
source: "Source",
link: "Link",
content: "Content",
successful: "News item was successfully created"
},

Expand Down
52 changes: 46 additions & 6 deletions src/gui/src/i18n/sk/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,68 @@ const messages_sk = {

user_menu: {
settings: "Nastavenia profilu",
logout: "Odhlásiť sa"
logout: "Odhlásiť sa",
dark_theme: "Tmavý motiv",
},

main_menu: {
assess: "Zistiť",
enter: "Vložiť",
assess: "Vyhodnotiť",
analyze: "Analyzovať",
publish: "Publikovať",
config: "Konfigurácia",
dashboard: "Dashboard"
dashboard: "Dashboard",
my_assets: "Aktíva"
},

nav_menu: {
newsitems: "Nové zistenia",
enter: "Vytvoriť novinku",
newsitems: "Novinky",
products: "Produkty",
publications: "Publikácie",
recent: "Najnovšie",
popular: "Populárne",
favourites: "Obľúbené",
configuration: "Konfigurácia",
collectors_nodes: "Server zberačov údajov",
collectors_nodes: "Inštancie zberačov",
presenters_nodes: "Inštancie prezenterov",
publishers_nodes: "Inštancie publikateľov",
bots_nodes: "Inštancie robotov",
osint_sources: "OSINT zdroje",
osint_source_groups: "OSINT skupiny",
publisher_presets: "Publikačné kanály",
bot_presets: "Roboti",
collectors: "Zberače údajov",
report_items: "Analýzy",
attributes: "Atribúty",
report_types: "Typy analýz",
product_types: "Typy produktov",
roles: "Role",
acls: "ACL",
users: "Užívatelia",
organizations: "Organizácie",
word_lists: "Slovníky",
asset_groups: "Skupiny aktív",
notification_templates: "Šablóny oznámení",
remote_access: "Vzdialený prístup",
remote_nodes: "Vzdialené inštancie",
local: "Lokálne"
},

notification: {
close: "Zavrieť"
},

enter: {
create: "Vytvoriť",
validation_error: "Prosím vyplňte všetky povinné polia",
error: "Novinku sa nepodarilo vytvoriť",
title: "Názov",
review: "Súhrn",
source: "Zdroj",
link: "Odkaz",
content: "Obsah",
successful: "Novinka bola úspešne vytvorená",
},

collectors_node: {
Expand All @@ -81,7 +121,7 @@ const messages_sk = {
add: "Pridať",
cancel: "Zrušiť",
validation_error: "Prosím vyplňte všetky povinné polia",
error: "Nepodarilo sa vytvoriť zadaný zdroj.",
error: "Nepodarilo sa vytvoriť zadaný zdroj",
name: "Meno",
description: "Popis",
last_attempt: "Posledný pokus",
Expand Down
73 changes: 22 additions & 51 deletions src/gui/src/views/users/EnterView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,36 @@
<v-form @submit.prevent="add" id="form" ref="form" style="width: 100%; padding: 8px">
<v-card>
<v-card-text>
<v-text-field
:label="$t('enter.title')"
name="title"
type="text"
v-model="news_item.title"
v-validate="'required'"
data-vv-name="title"
:error-messages="errors.collect('title')"
<v-text-field :label="$t('enter.title')"
name="title"
type="text"
v-model="news_item.title"
v-validate="'required'"
data-vv-name="title"
:error-messages="errors.collect('title')"
></v-text-field>

<v-textarea
:label="$t('enter.review')"
name="review"
v-model="news_item.review"
<v-textarea :label="$t('enter.review')"
name="review"
v-model="news_item.review"
></v-textarea>

<v-text-field
:label="$t('enter.source')"
name="source"
type="text"
v-model="news_item.source"
<v-text-field :label="$t('enter.source')"
name="source"
type="text"
v-model="news_item.source"
></v-text-field>

<v-text-field
:label="$t('enter.link')"
name="link"
type="text"
v-model="news_item.link"
<v-text-field :label="$t('enter.link')"
name="link"
type="text"
v-model="news_item.link"
></v-text-field>

<vue-editor
ref="assessEnter"
v-model="editorData"
:editorOptions="editorOptionVue2"
></vue-editor>
<v-textarea :label="$t('enter.content')"
name="content"
v-model="news_item.content"
></v-textarea>

</v-card-text>
</v-card>
Expand All @@ -67,37 +62,17 @@

<script>
import ViewLayout from "../../components/layouts/ViewLayout";
import { VueEditor } from 'vue2-editor';
import {addNewsItem} from "@/api/assess";
const toolbarOptions = [
['bold', 'italic', 'underline', 'strike', { 'script': 'sub' }, { 'script': 'super' },
'blockquote', 'code-block', 'clean'],
[{ align: "" }, { align: "center" }, { align: "right" }, { align: "justify" }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }, { 'indent': '-1' }, { 'indent': '+1' }],
[{ 'size': ['small', false, 'large', 'huge'] }, { 'header': [1, 2, 3, 4, 5, 6, false] },
{ 'color': [] }, { 'background': [] }],
['link', 'image'],
];
export default {
name: "Enter",
components: {
ViewLayout,
VueEditor,
},
data: () => ({
show_error: false,
show_validation_error: false,
editorOptionVue2: {
theme: 'snow',
modules: {
toolbar: toolbarOptions
}
},
editorData: "",
news_item: {
id: "",
title: "",
Expand All @@ -121,8 +96,6 @@
if (!this.$validator.errors.any()) {
this.news_item.content = this.editorData;
let i = window.location.pathname.indexOf("/source/");
let len = window.location.pathname.length;
this.news_item.osint_source_id = window.location.pathname.substring(i + 8, len);
Expand Down Expand Up @@ -153,8 +126,6 @@
this.$validator.reset();
this.editorData = '<p></p>';
this.$root.$emit('notification',
{
type: 'success',
Expand Down

0 comments on commit 719042d

Please sign in to comment.