@@ -508,7 +512,7 @@ kixote.component('tab-generate', {
Filter:
@@ -545,6 +549,7 @@ kixote.component('tab-generate', {
{{ titleError }}
{{ bodyError }}
+
+
+
+
+
-
-
Mimic your tone tab content here.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -636,6 +712,8 @@ kixote.component('tab-generate', {
{
this.initAutosize();
+ this.createFlatNavi();
+
if(this.versions.length == 0)
{
this.initializeContent()
@@ -668,22 +746,27 @@ kixote.component('tab-generate', {
Object.entries(this.kixoteSettings?.promptlist || {}).filter(([key, prompt]) => !prompt.system)
);
},
- filteredPrompts()
- {
- if(this.currentFilter === 'system')
- {
- return this.promptlistsystem;
- }
- else if (this.currentFilter === 'user')
- {
- return this.promptlistuser;
- }
- else
- {
- return this.kixoteSettings.promptlist;
- }
- }
+ filteredPrompts()
+ {
+ const list =
+ this.currentFilter === 'system'
+ ? this.promptlistsystem
+ : this.currentFilter === 'user'
+ ? this.promptlistuser
+ : this.kixoteSettings.promptlist;
+ // Normalize `link` to `null` if not present
+ const normalized = {};
+ for (const [key, prompt] of Object.entries(list))
+ {
+ normalized[key] = {
+ ...prompt,
+ link: prompt.link ?? null
+ };
+ }
+
+ return normalized;
+ }
},
methods: {
initAutosize()
@@ -737,6 +820,25 @@ kixote.component('tab-generate', {
this.versions.push(markdown);
this.resizeAiEditor();
},
+ createFlatNavi() {
+ if (this.navigation && !this.flatnavi) {
+ const nestedNavi = [];
+
+ const recurse = (items) => {
+ items.forEach(item => {
+ if (item.urlRelWoF) {
+ nestedNavi.push(item.urlRelWoF);
+ }
+ if (item.folderContent && item.folderContent.length > 0) {
+ recurse(item.folderContent);
+ }
+ });
+ };
+
+ recurse(this.navigation);
+ this.flatnavi = nestedNavi;
+ }
+ },
resizeAiEditor()
{
this.$nextTick(() => {
@@ -760,6 +862,7 @@ kixote.component('tab-generate', {
usePrompt(index)
{
this.prompt = this.promptlistactive[index].content;
+ this.promptlink = this.promptlistactive[index].link;
this.resizePromptEditor();
},
switchVersion(index)
@@ -776,7 +879,8 @@ kixote.component('tab-generate', {
tmaxios.post('/api/v1/prompt',{
'prompt': this.prompt,
- 'article': this.versions[this.activeversion]
+ 'article': this.versions[this.activeversion],
+ 'link': this.promptlink
})
.then(function (response)
{
@@ -788,6 +892,7 @@ kixote.component('tab-generate', {
self.versions.push(answer);
self.activeversion = self.versions.length-1;
self.prompt = '';
+ self.promptlink = null;
self.resizePromptEditor();
self.resizeAiEditor();
}
@@ -997,6 +1102,10 @@ kixote.component('tab-generate', {
this.addNewPrompt = false;
this.updateSettings(promptlist);
eventBus.$emit('storeKixoteSettings');
+ },
+ getArticleMarkdown(url)
+ {
+
},
exit()
{