Что-то пошло не так :(
@@ -52,7 +53,8 @@
};
try {
// eslint-disable-next-line no-debugger
- if (this.src.substr(0, 1) === '@') {
+ const source = this.src.toLowerCase();
+ if (source.startsWith('@')) {
const url = new URL(this.src.replace('@', '/'), requests.getSourceRoot());
const path = url.pathname.split('/');
result.type = path[1];
@@ -65,6 +67,9 @@
// Иначе воспринимаем как презентацию
result.presentation = path[3];
}
+ } else if (source.startsWith('https://www.youtube.com/') || source.startsWith('https://youtu.be/')) {
+ result.type = 'youtube';
+ result.subject = this.src;
}
} catch (e) {
// eslint-disable-next-line no-console
@@ -112,11 +117,13 @@
isEntity() {
return this.srcStruct?.type.toLowerCase() === 'entity';
},
+ isYoutube() {
+ return this.srcStruct?.type.toLowerCase() === 'youtube';
+ },
documentPath() {
const path = this.src.split('?')[0].replaceAll('@document/', '');
return `/docs/${path}`;
}
-
}
};
diff --git a/src/frontend/components/Docs/DocMarkdown.vue b/src/frontend/components/Docs/DocMarkdown.vue
index 83710b6f..128c74fc 100644
--- a/src/frontend/components/Docs/DocMarkdown.vue
+++ b/src/frontend/components/Docs/DocMarkdown.vue
@@ -7,7 +7,7 @@
v-if="(markdown !== null)"
toc
v-bind:breaks="false"
- v-bind:html="false"
+ v-bind:html="isHTMLSupport"
v-bind:postrender="rendered"
v-on:toc-rendered="tocRendered">
{{ markdown }}
@@ -90,6 +90,10 @@
};
},
computed: {
+ // Определяет поддерживаются ли HTML тэги в markdown
+ isHTMLSupport() {
+ return (process.env.VUE_APP_DOCHUB_MARKDOWN_HTML || 'off').toLocaleLowerCase() === 'on';
+ },
// Возвращает URL документа с учетом истории переходов
currentURL() {
return this.redirectURL ? this.redirectURL : this.url;
diff --git a/src/frontend/components/Schema/DHSchema/DHSchema.vue b/src/frontend/components/Schema/DHSchema/DHSchema.vue
index 51856b18..f4bcbc7d 100644
--- a/src/frontend/components/Schema/DHSchema/DHSchema.vue
+++ b/src/frontend/components/Schema/DHSchema/DHSchema.vue
@@ -100,9 +100,16 @@
{{ error }}
+ v-bind:y="landscape.viewBox.top + 30"
+ class="error">
+
+ {{ line }}
+
+
Тут должны была быть схема, но что-то пошло не так...
@@ -199,6 +206,7 @@
const OPACITY = 0.3;
const IS_DEBUG = false;
+ const CHAR_WIDTH = 16;
export default {
name: 'DHSchema',
@@ -285,6 +293,26 @@
};
},
computed: {
+ errorLineLength() {
+ return +this.viewBox.split(' ')[2] / CHAR_WIDTH;
+ },
+ // Разбиваем error message на строки
+ errorLines() {
+ const lines = [];
+ let curLineLength = 0;
+ let curLineString = '';
+ this.error.split(' ').forEach(word => {
+ curLineLength += word.length;
+ curLineString = `${curLineString} ${word} `;
+ if(curLineLength > this.errorLineLength) {
+ lines.push(curLineString);
+ curLineLength = 0;
+ curLineString = '';
+ }
+ });
+ lines.push(curLineString);
+ return lines;
+ },
// Проверяем что в Firefox
isFirefox() {
return navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
diff --git a/src/frontend/components/Tools/Youtube.vue b/src/frontend/components/Tools/Youtube.vue
new file mode 100644
index 00000000..88c4d5af
--- /dev/null
+++ b/src/frontend/components/Tools/Youtube.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/frontend/index.js b/src/frontend/index.js
index 8dfe6358..df844aa2 100644
--- a/src/frontend/index.js
+++ b/src/frontend/index.js
@@ -27,6 +27,7 @@ import Radar from '@front/components/Techradar/Main.vue';
import Technology from '@front/components/Techradar/Technology.vue';
import Anchor from '@front/components/Tools/Anchor.vue';
import Image from '@front/components/Tools/Image.vue';
+import Youtube from '@front/components/Tools/Youtube.vue';
import Entity from '@front/components/Entities/Entity.vue';
import DocHubObject from '@front/components/Docs/DocHubObject';
import GlobalMixin from '@front/mixins/global';
@@ -71,6 +72,7 @@ Vue.component('DochubComponent', Component);
Vue.component('DochubAspect', Aspect);
Vue.component('DochubAnchor', Anchor);
Vue.component('DochubImage', Image);
+Vue.component('DochubYoutube', Youtube);
Vue.component('DochubTechnology', Technology);
Vue.component('DochubRadar', Radar);
Vue.component('DochubPlantuml', PlantUML);
diff --git a/src/frontend/storage/gitlab.js b/src/frontend/storage/gitlab.js
index 62afa7fa..00129d5c 100644
--- a/src/frontend/storage/gitlab.js
+++ b/src/frontend/storage/gitlab.js
@@ -144,12 +144,12 @@ export default {
// Обновляем манифест и фризим объекты
context.commit('setManifest', manifest);
context.commit('setSources', parser.mergeMap);
- context.commit('setIsReloading', false);
if (!Object.keys(context.state.manifest || {}).length) {
context.commit('setCriticalError', true);
}
entities(manifest);
+ context.commit('setIsReloading', false);
rules(manifest,
(problems) => context.commit('appendProblems', problems),
(error) => {
@@ -252,6 +252,7 @@ export default {
errors.net.items.push(item);
}
+ // Может не надо?
context.commit('setIsReloading', false);
}
};
diff --git a/src/ide/idea/papi.js b/src/ide/idea/papi.js
index 7ac9117f..da5c11fd 100644
--- a/src/ide/idea/papi.js
+++ b/src/ide/idea/papi.js
@@ -70,6 +70,14 @@ const PAPI = {
},
getSettings() {
return this.request({ url: 'plugin:/idea/settings/get' });
+ },
+ // Сохраняет файл в проекте
+ pushFile(source, content) {
+ return this.request({ url: 'plugin:/idea/code/push/file', source, content });
+ },
+ // TBD
+ pushCode(code, metadata) {
+ return this.request({ url: 'plugin:/idea/code/push/code', code, metadata });
}
};