diff --git a/app/Http/Controllers/Web/Nasa/V1/FuNodeActionController.php b/app/Http/Controllers/Web/Nasa/V1/FuNodeActionController.php new file mode 100644 index 00000000..ed5743ff --- /dev/null +++ b/app/Http/Controllers/Web/Nasa/V1/FuNodeActionController.php @@ -0,0 +1,26 @@ +input('site_www'); + + $oResponse = Http::nasa($sSiteWww)->get('/node/action/fly'); + + return $oResponse->json(); + + } + +} diff --git a/app/Http/Controllers/Web/Nasa/V1/FuNodeBaseController.php b/app/Http/Controllers/Web/Nasa/V1/FuNodeBaseController.php index 1265ebc4..43bfe6f1 100644 --- a/app/Http/Controllers/Web/Nasa/V1/FuNodeBaseController.php +++ b/app/Http/Controllers/Web/Nasa/V1/FuNodeBaseController.php @@ -14,7 +14,7 @@ class FuNodeBaseController extends ListController protected string $sApiPath = 'node/base'; protected string $sView = 'nasa._commons.list'; protected string $sSiteWww; - protected string $sHeaderActionView = 'nasa.v1._actions.list'; + protected string $sHeaderActionView = 'nasa.v1._actions.node'; public function __construct() { diff --git a/public/build/assets/app-BcB1rdwa.js b/public/build/assets/app-zmCj5tAh.js similarity index 99% rename from public/build/assets/app-BcB1rdwa.js rename to public/build/assets/app-zmCj5tAh.js index ad7e0d3d..b50dde27 100644 --- a/public/build/assets/app-BcB1rdwa.js +++ b/public/build/assets/app-zmCj5tAh.js @@ -225,4 +225,4 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="

An error `),S=T[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),C=S?S[2]:"";let I=[];if(T.length>1&&T.slice(1).join(` `).trim()){const B=T.slice(1),z=B.filter(b=>b.trim());if(z.length>0){const b=Math.min(...z.map(H=>H.length-H.trimStart().length)),q=B.map(H=>H.trim()?H.slice(b):"").join(` `).trim();q&&(I=this.markedInstance.lexer(`${q} -`))}}y={type:"taskItem",raw:"",mainContent:C,indentLevel:p,checked:d??!1,text:C,tokens:this.tokenizeInline(C),nestedTokens:I}}const g=u?"taskList":"list";s!==g?(i.length>0&&r.push({type:s,items:i}),i=[y],s=g):i.push(y)}i.length>0&&r.push({type:s,items:i});const o=[];for(let a=0;a0?o:null}parseTokenWithHandlers(n){if(!n.type)return null;const e=this.getHandlersForToken(n.type),t=this.createParseHelpers();if(e.find(i=>{if(!i.parseMarkdown)return!1;const s=i.parseMarkdown(n,t),o=this.normalizeParseResult(s);return o&&(!Array.isArray(o)||o.length>0)?(this.lastParseResult=o,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(n)}createParseHelpers(){return{parseInline:n=>this.parseInlineTokens(n),tokenizeInline:n=>this.tokenizeInline(n),parseChildren:n=>this.parseTokens(n),parseBlockChildren:n=>this.parseTokens(n,!0),createTextNode:(n,e)=>({type:"text",text:n,marks:e||void 0}),createNode:(n,e,t)=>{const r={type:n,attrs:e||void 0,content:t||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},applyMark:(n,e,t)=>({mark:n,content:e,attrs:t&&Object.keys(t).length>0?t:void 0})}}escapeRegex(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(n){var e,t,r,i;const s=[];for(let o=0;o|\/|$)/i);if(!u&&d&&!/\/>$/.test(c)){const y=d[1],g=this.escapeRegex(y),w=new RegExp(`^<\\/\\s*${g}\\b`,"i");let T=-1;const S=[c];for(let C=o+1;C0;o-=1){const a=s[o],c=s[o-1];if(a.type==="text"&&c.type==="text"){const u=a.marks||[],d=c.marks||[];R1(u,d)&&(c.text=(c.text||"")+(a.text||""),s.splice(o,1))}}return s}applyMarkToContent(n,e,t){return e.map(r=>{if(r.type==="text"){const i=r.marks||[],s=t?{type:n,attrs:t}:{type:n};return{...r,marks:[...i,s]}}return{...r,content:r.content?this.applyMarkToContent(n,r.content,t):void 0}})}isMarkResult(n){return n&&typeof n=="object"&&"mark"in n}normalizeParseResult(n){return n?this.isMarkResult(n)?n.content:n:null}parseFallbackToken(n,e=!1){switch(n.type){case"paragraph":return{type:"paragraph",content:n.tokens?this.parseInlineTokens(n.tokens):[]};case"heading":return{type:"heading",attrs:{level:n.depth||1},content:n.tokens?this.parseInlineTokens(n.tokens):[]};case"text":return{type:"text",text:If(n.text||"")};case"html":return this.parseHTMLToken(n);case"escape":return{type:"text",text:n.text||""};case"space":return null;default:return n.tokens?this.parseTokens(n.tokens,e):null}}parseHTMLToken(n){const e=n.text||n.raw||"";if(!e.trim())return null;if(typeof window>"u")return n.block?{type:"paragraph",content:[{type:"text",text:e}]}:{type:"text",text:e};if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!n.block);try{const t=Ew(e,this.baseExtensions);return t.type==="doc"&&t.content?n.block?t.content:t.content.length===1&&t.content[0].type==="paragraph"&&t.content[0].content?t.content[0].content:t.content:t}catch(t){throw new Error(`Failed to parse HTML in markdown: ${t}`)}}isUnrecognizedHtml(n){if(typeof window>"u"||typeof window.DOMParser>"u")return!1;const t=new window.DOMParser().parseFromString(`${n}`,"text/html").body.querySelectorAll("*");if(t.length===0)return!1;const r=this.getSchemaParseDomTags();return Array.from(t).some(i=>{if(!Ev(i))return!1;const s=i.tagName.toLowerCase();return!r.has(s)})}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const n=new Set;try{const e=pp(this.baseExtensions),t=r=>{const i=r==null?void 0:r.parseDOM;Array.isArray(i)&&i.forEach(s=>{if(typeof(s==null?void 0:s.tag)=="string"){const o=s.tag.match(/^[a-zA-Z][\w-]*/);o&&n.add(o[0].toLowerCase())}})};Object.values(e.nodes).forEach(r=>t(r.spec)),Object.values(e.marks).forEach(r=>t(r.spec))}catch{}return this.schemaParseDomTagsCache=n,n}htmlAsLiteralText(n,e){const t=n.replace(/\s+$/,"");return t?e?{type:"paragraph",content:[{type:"text",text:t}]}:{type:"text",text:t}:null}encodeTextForMarkdown(n,e,t){return(t==null?void 0:t.type)!=null&&this.codeTypes.has(t.type)||(e.marks||[]).some(i=>this.codeTypes.has(typeof i=="string"?i:i.type))?n:this.escapeMarkdownSyntax(S1(n))}escapeMarkdownSyntax(n){return n.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(n,e,t=0,r=0,i={}){var s;if(n.type==="text")return this.encodeTextForMarkdown(n.text||"",n,e);if(!n.type)return"";const o=this.getHandlerForToken(n.type);if(!o)return"";const a=Array.isArray(e==null?void 0:e.content)&&t>0?e.content[t-1]:void 0,c={renderChildren:(p,y)=>{const g=o.isIndenting?r+1:r;return!Array.isArray(p)&&p.content?this.renderNodes(p.content,n,y||"",t,g):this.renderNodes(p,n,y||"",t,g)},renderChild:(p,y)=>{const g=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(p,n,y,g)},indent:p=>this.indentString+p,wrapInBlock:xv},u={index:t,level:r,parentType:e==null?void 0:e.type,previousNode:a,meta:{parentAttrs:e==null?void 0:e.attrs,...i}};return((s=o.renderMarkdown)==null?void 0:s.call(o,n,c,u))||""}renderNodes(n,e,t="",r=0,i=0){return Array.isArray(n)?this.renderNodesWithMarkBoundaries(n,e,t,i):n.type?this.renderNodeToMarkdown(n,e,r,i):""}renderNodesWithMarkBoundaries(n,e,t="",r=0){const i=[],s=new Map,o=new Set,a=new Map;return n.forEach((c,u)=>{const d=u[z.type,z])),g=this.getMarksToOpenForSerialization(s,y,d),w=wv(y,d),T=w.filter(z=>s.has(z)),S=T.length>0&&g.length>0;let C="";if(w.length>0&&!S){const z=p.match(/(\s+)$/);z&&(C=z[1],p=p.slice(0,-C.length))}S||w.slice().reverse().forEach(z=>{if(!s.has(z))return;const b=y.get(z),$=this.getMarkClosing(z,b,a.get(z));$&&(p+=$),s.has(z)&&(s.delete(z),a.delete(z))});let I="";if(g.length>0){const z=p.match(/^(\s+)/);z&&(I=z[1],p=p.slice(I.length))}g.forEach(({type:z,mark:b})=>{const $=o.has(z)?"html":"markdown",q=this.getMarkOpening(z,b,$);q&&(p=q+p),a.set(z,$),o.delete(z)}),S||g.slice().reverse().forEach(({type:z,mark:b})=>{s.set(z,b)}),p=I+p;let _;if(S){const z=new Set(((d==null?void 0:d.marks)||[]).map(q=>q.type));g.forEach(({type:q})=>{z.has(q)&&this.getHtmlReopenTags(q)&&o.add(q)});const b=Array.from(s.keys()),$=T.slice().sort((q,H)=>b.indexOf(H)-b.indexOf(q));_=[...g.map(q=>q.type),...$]}else _=Sv(s,y,d,this.markSetsEqual.bind(this));let B="";if(_.length>0){const z=p.match(/(\s+)$/);z&&(B=z[1],p=p.slice(0,-B.length))}_.forEach(z=>{var b;const $=(b=s.get(z))!=null?b:y.get(z),q=this.getMarkClosing(z,$,a.get(z));q&&(p+=q),s.delete(z),a.delete(z)}),p+=B,p+=C,i.push(p)}else{const p=new Set((c.marks||[]).map(C=>C.type)),y=new Map,g=new Map;s.forEach((C,I)=>{var _;p.has(I)&&(y.set(I,C),g.set(I,(_=a.get(I))!=null?_:"markdown"))});const w=vv(s,(C,I)=>this.getMarkClosing(C,I,a.get(C)));a.clear();const T=this.renderNodeToMarkdown(c,e,u,r),S=c.type==="hardBreak"?"":Cv(y,s,(C,I)=>{var _;const B=(_=g.get(C))!=null?_:"markdown";return a.set(C,B),this.getMarkOpening(C,I,B)});i.push(w+T+S)}}),i.join(t)}getMarkOpening(n,e,t="markdown"){var r;if(t==="html")return((r=this.getHtmlReopenTags(n))==null?void 0:r.open)||"";const i=this.getHandlersForNodeType(n),s=i.length>0?i[0]:void 0;if(!s||!s.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",a={type:n,attrs:e.attrs||{},content:[{type:"text",text:o}]};try{const c=s.renderMarkdown(a,{renderChildren:()=>o,renderChild:()=>o,indent:d=>d,wrapInBlock:(d,p)=>d+p},{index:0,level:0,parentType:"text",meta:{}}),u=c.indexOf(o);return u>=0?c.substring(0,u):""}catch(c){throw new Error(`Failed to get mark opening for ${n}: ${c}`)}}getMarkClosing(n,e,t="markdown"){var r;if(t==="html")return((r=this.getHtmlReopenTags(n))==null?void 0:r.close)||"";const i=this.getHandlersForNodeType(n),s=i.length>0?i[0]:void 0;if(!s||!s.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",a={type:n,attrs:e.attrs||{},content:[{type:"text",text:o}]};try{const c=s.renderMarkdown(a,{renderChildren:()=>o,renderChild:()=>o,indent:p=>p,wrapInBlock:(p,y)=>p+y},{index:0,level:0,parentType:"text",meta:{}}),u=c.indexOf(o),d=u+o.length;return u>=0?c.substring(d):""}catch(c){throw new Error(`Failed to get mark closing for ${n}: ${c}`)}}getHtmlReopenTags(n){const e=this.getHandlersForNodeType(n),t=e.length>0?e[0]:void 0;return t==null?void 0:t.htmlReopen}markSetsEqual(n,e){return n.size!==e.size?!1:Array.from(n.entries()).every(([t,r])=>{const i=e.get(t);return i&&Ar(r.attrs,i.attrs)})}getMarksToOpenForSerialization(n,e,t){const r=Tv(n,e);if(r.length<=1)return r;const i=(t==null?void 0:t.marks)||[],s=(u,d)=>i.some(p=>p.type===u&&Ar(p.attrs,d)),o=(u,d)=>{var p,y;const g=(p=this.extensionRanks.get(u.type))!=null?p:Number.MAX_SAFE_INTEGER,w=(y=this.extensionRanks.get(d.type))!=null?y:Number.MAX_SAFE_INTEGER;return g!==w?w-g:u.type.localeCompare(d.type)},a=r.filter(u=>!s(u.type,u.mark.attrs)).sort(o),c=r.filter(u=>s(u.type,u.mark.attrs)).sort(o);return[...a,...c]}},id=Mv,Av=xe.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(n,e)=>{if(!(e!=null&&e.contentType)||is(n,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return vt.setContent(n,e);const r=this.editor.markdown.parse(n);return vt.setContent(r,e)},insertContent:(n,e)=>{if(!(e!=null&&e.contentType)||is(n,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return vt.insertContent(n,e);const r=this.editor.markdown.parse(n);return vt.insertContent(r,e)},insertContentAt:(n,e,t)=>{if(!(t!=null&&t.contentType)||is(e,t==null?void 0:t.contentType)!=="markdown"||!this.editor.markdown)return vt.insertContentAt(n,e,t);const i=this.editor.markdown.parse(e);return vt.insertContentAt(n,i,t)}}},addStorage(){return{manager:new id({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var n;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new id({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||is(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const t=this.editor.markdown.parse(this.editor.options.content);(n=t.content)!=null&&n.length&&(this.editor.options.content=t)}});D.ajaxSetup({headers:{"X-CSRF-TOKEN":D('meta[name="csrf-token"]').attr("content")}});window.oModalEditor=null;window.initModalEditor=function(n=""){const e=document.querySelector("#div-modal-editor");if(e){if(window.oModalEditor){window.oModalEditor.commands.setContent(n,!1);return}window.oModalEditor=new x1({element:e,extensions:[DS,Av.configure({html:!1}),Highlight],content:n}),D(document).on("click",".js-tiptap-btn",function(t){t.preventDefault();const r=D(this).data("action"),i=window.oModalEditor.chain().focus();switch(r){case"bold":i.toggleBold().run();break;case"italic":i.toggleItalic().run();break;case"heading":i.toggleHeading({level:1}).run();break;case"highlight":i.toggleHighlight().run();break}})}}; +`))}}y={type:"taskItem",raw:"",mainContent:C,indentLevel:p,checked:d??!1,text:C,tokens:this.tokenizeInline(C),nestedTokens:I}}const g=u?"taskList":"list";s!==g?(i.length>0&&r.push({type:s,items:i}),i=[y],s=g):i.push(y)}i.length>0&&r.push({type:s,items:i});const o=[];for(let a=0;a0?o:null}parseTokenWithHandlers(n){if(!n.type)return null;const e=this.getHandlersForToken(n.type),t=this.createParseHelpers();if(e.find(i=>{if(!i.parseMarkdown)return!1;const s=i.parseMarkdown(n,t),o=this.normalizeParseResult(s);return o&&(!Array.isArray(o)||o.length>0)?(this.lastParseResult=o,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(n)}createParseHelpers(){return{parseInline:n=>this.parseInlineTokens(n),tokenizeInline:n=>this.tokenizeInline(n),parseChildren:n=>this.parseTokens(n),parseBlockChildren:n=>this.parseTokens(n,!0),createTextNode:(n,e)=>({type:"text",text:n,marks:e||void 0}),createNode:(n,e,t)=>{const r={type:n,attrs:e||void 0,content:t||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},applyMark:(n,e,t)=>({mark:n,content:e,attrs:t&&Object.keys(t).length>0?t:void 0})}}escapeRegex(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(n){var e,t,r,i;const s=[];for(let o=0;o|\/|$)/i);if(!u&&d&&!/\/>$/.test(c)){const y=d[1],g=this.escapeRegex(y),w=new RegExp(`^<\\/\\s*${g}\\b`,"i");let T=-1;const S=[c];for(let C=o+1;C0;o-=1){const a=s[o],c=s[o-1];if(a.type==="text"&&c.type==="text"){const u=a.marks||[],d=c.marks||[];R1(u,d)&&(c.text=(c.text||"")+(a.text||""),s.splice(o,1))}}return s}applyMarkToContent(n,e,t){return e.map(r=>{if(r.type==="text"){const i=r.marks||[],s=t?{type:n,attrs:t}:{type:n};return{...r,marks:[...i,s]}}return{...r,content:r.content?this.applyMarkToContent(n,r.content,t):void 0}})}isMarkResult(n){return n&&typeof n=="object"&&"mark"in n}normalizeParseResult(n){return n?this.isMarkResult(n)?n.content:n:null}parseFallbackToken(n,e=!1){switch(n.type){case"paragraph":return{type:"paragraph",content:n.tokens?this.parseInlineTokens(n.tokens):[]};case"heading":return{type:"heading",attrs:{level:n.depth||1},content:n.tokens?this.parseInlineTokens(n.tokens):[]};case"text":return{type:"text",text:If(n.text||"")};case"html":return this.parseHTMLToken(n);case"escape":return{type:"text",text:n.text||""};case"space":return null;default:return n.tokens?this.parseTokens(n.tokens,e):null}}parseHTMLToken(n){const e=n.text||n.raw||"";if(!e.trim())return null;if(typeof window>"u")return n.block?{type:"paragraph",content:[{type:"text",text:e}]}:{type:"text",text:e};if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!n.block);try{const t=Ew(e,this.baseExtensions);return t.type==="doc"&&t.content?n.block?t.content:t.content.length===1&&t.content[0].type==="paragraph"&&t.content[0].content?t.content[0].content:t.content:t}catch(t){throw new Error(`Failed to parse HTML in markdown: ${t}`)}}isUnrecognizedHtml(n){if(typeof window>"u"||typeof window.DOMParser>"u")return!1;const t=new window.DOMParser().parseFromString(`${n}`,"text/html").body.querySelectorAll("*");if(t.length===0)return!1;const r=this.getSchemaParseDomTags();return Array.from(t).some(i=>{if(!Ev(i))return!1;const s=i.tagName.toLowerCase();return!r.has(s)})}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const n=new Set;try{const e=pp(this.baseExtensions),t=r=>{const i=r==null?void 0:r.parseDOM;Array.isArray(i)&&i.forEach(s=>{if(typeof(s==null?void 0:s.tag)=="string"){const o=s.tag.match(/^[a-zA-Z][\w-]*/);o&&n.add(o[0].toLowerCase())}})};Object.values(e.nodes).forEach(r=>t(r.spec)),Object.values(e.marks).forEach(r=>t(r.spec))}catch{}return this.schemaParseDomTagsCache=n,n}htmlAsLiteralText(n,e){const t=n.replace(/\s+$/,"");return t?e?{type:"paragraph",content:[{type:"text",text:t}]}:{type:"text",text:t}:null}encodeTextForMarkdown(n,e,t){return(t==null?void 0:t.type)!=null&&this.codeTypes.has(t.type)||(e.marks||[]).some(i=>this.codeTypes.has(typeof i=="string"?i:i.type))?n:this.escapeMarkdownSyntax(S1(n))}escapeMarkdownSyntax(n){return n.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(n,e,t=0,r=0,i={}){var s;if(n.type==="text")return this.encodeTextForMarkdown(n.text||"",n,e);if(!n.type)return"";const o=this.getHandlerForToken(n.type);if(!o)return"";const a=Array.isArray(e==null?void 0:e.content)&&t>0?e.content[t-1]:void 0,c={renderChildren:(p,y)=>{const g=o.isIndenting?r+1:r;return!Array.isArray(p)&&p.content?this.renderNodes(p.content,n,y||"",t,g):this.renderNodes(p,n,y||"",t,g)},renderChild:(p,y)=>{const g=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(p,n,y,g)},indent:p=>this.indentString+p,wrapInBlock:xv},u={index:t,level:r,parentType:e==null?void 0:e.type,previousNode:a,meta:{parentAttrs:e==null?void 0:e.attrs,...i}};return((s=o.renderMarkdown)==null?void 0:s.call(o,n,c,u))||""}renderNodes(n,e,t="",r=0,i=0){return Array.isArray(n)?this.renderNodesWithMarkBoundaries(n,e,t,i):n.type?this.renderNodeToMarkdown(n,e,r,i):""}renderNodesWithMarkBoundaries(n,e,t="",r=0){const i=[],s=new Map,o=new Set,a=new Map;return n.forEach((c,u)=>{const d=u[z.type,z])),g=this.getMarksToOpenForSerialization(s,y,d),w=wv(y,d),T=w.filter(z=>s.has(z)),S=T.length>0&&g.length>0;let C="";if(w.length>0&&!S){const z=p.match(/(\s+)$/);z&&(C=z[1],p=p.slice(0,-C.length))}S||w.slice().reverse().forEach(z=>{if(!s.has(z))return;const b=y.get(z),$=this.getMarkClosing(z,b,a.get(z));$&&(p+=$),s.has(z)&&(s.delete(z),a.delete(z))});let I="";if(g.length>0){const z=p.match(/^(\s+)/);z&&(I=z[1],p=p.slice(I.length))}g.forEach(({type:z,mark:b})=>{const $=o.has(z)?"html":"markdown",q=this.getMarkOpening(z,b,$);q&&(p=q+p),a.set(z,$),o.delete(z)}),S||g.slice().reverse().forEach(({type:z,mark:b})=>{s.set(z,b)}),p=I+p;let _;if(S){const z=new Set(((d==null?void 0:d.marks)||[]).map(q=>q.type));g.forEach(({type:q})=>{z.has(q)&&this.getHtmlReopenTags(q)&&o.add(q)});const b=Array.from(s.keys()),$=T.slice().sort((q,H)=>b.indexOf(H)-b.indexOf(q));_=[...g.map(q=>q.type),...$]}else _=Sv(s,y,d,this.markSetsEqual.bind(this));let B="";if(_.length>0){const z=p.match(/(\s+)$/);z&&(B=z[1],p=p.slice(0,-B.length))}_.forEach(z=>{var b;const $=(b=s.get(z))!=null?b:y.get(z),q=this.getMarkClosing(z,$,a.get(z));q&&(p+=q),s.delete(z),a.delete(z)}),p+=B,p+=C,i.push(p)}else{const p=new Set((c.marks||[]).map(C=>C.type)),y=new Map,g=new Map;s.forEach((C,I)=>{var _;p.has(I)&&(y.set(I,C),g.set(I,(_=a.get(I))!=null?_:"markdown"))});const w=vv(s,(C,I)=>this.getMarkClosing(C,I,a.get(C)));a.clear();const T=this.renderNodeToMarkdown(c,e,u,r),S=c.type==="hardBreak"?"":Cv(y,s,(C,I)=>{var _;const B=(_=g.get(C))!=null?_:"markdown";return a.set(C,B),this.getMarkOpening(C,I,B)});i.push(w+T+S)}}),i.join(t)}getMarkOpening(n,e,t="markdown"){var r;if(t==="html")return((r=this.getHtmlReopenTags(n))==null?void 0:r.open)||"";const i=this.getHandlersForNodeType(n),s=i.length>0?i[0]:void 0;if(!s||!s.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",a={type:n,attrs:e.attrs||{},content:[{type:"text",text:o}]};try{const c=s.renderMarkdown(a,{renderChildren:()=>o,renderChild:()=>o,indent:d=>d,wrapInBlock:(d,p)=>d+p},{index:0,level:0,parentType:"text",meta:{}}),u=c.indexOf(o);return u>=0?c.substring(0,u):""}catch(c){throw new Error(`Failed to get mark opening for ${n}: ${c}`)}}getMarkClosing(n,e,t="markdown"){var r;if(t==="html")return((r=this.getHtmlReopenTags(n))==null?void 0:r.close)||"";const i=this.getHandlersForNodeType(n),s=i.length>0?i[0]:void 0;if(!s||!s.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",a={type:n,attrs:e.attrs||{},content:[{type:"text",text:o}]};try{const c=s.renderMarkdown(a,{renderChildren:()=>o,renderChild:()=>o,indent:p=>p,wrapInBlock:(p,y)=>p+y},{index:0,level:0,parentType:"text",meta:{}}),u=c.indexOf(o),d=u+o.length;return u>=0?c.substring(d):""}catch(c){throw new Error(`Failed to get mark closing for ${n}: ${c}`)}}getHtmlReopenTags(n){const e=this.getHandlersForNodeType(n),t=e.length>0?e[0]:void 0;return t==null?void 0:t.htmlReopen}markSetsEqual(n,e){return n.size!==e.size?!1:Array.from(n.entries()).every(([t,r])=>{const i=e.get(t);return i&&Ar(r.attrs,i.attrs)})}getMarksToOpenForSerialization(n,e,t){const r=Tv(n,e);if(r.length<=1)return r;const i=(t==null?void 0:t.marks)||[],s=(u,d)=>i.some(p=>p.type===u&&Ar(p.attrs,d)),o=(u,d)=>{var p,y;const g=(p=this.extensionRanks.get(u.type))!=null?p:Number.MAX_SAFE_INTEGER,w=(y=this.extensionRanks.get(d.type))!=null?y:Number.MAX_SAFE_INTEGER;return g!==w?w-g:u.type.localeCompare(d.type)},a=r.filter(u=>!s(u.type,u.mark.attrs)).sort(o),c=r.filter(u=>s(u.type,u.mark.attrs)).sort(o);return[...a,...c]}},id=Mv,Av=xe.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(n,e)=>{if(!(e!=null&&e.contentType)||is(n,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return vt.setContent(n,e);const r=this.editor.markdown.parse(n);return vt.setContent(r,e)},insertContent:(n,e)=>{if(!(e!=null&&e.contentType)||is(n,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return vt.insertContent(n,e);const r=this.editor.markdown.parse(n);return vt.insertContent(r,e)},insertContentAt:(n,e,t)=>{if(!(t!=null&&t.contentType)||is(e,t==null?void 0:t.contentType)!=="markdown"||!this.editor.markdown)return vt.insertContentAt(n,e,t);const i=this.editor.markdown.parse(e);return vt.insertContentAt(n,i,t)}}},addStorage(){return{manager:new id({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var n;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new id({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||is(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const t=this.editor.markdown.parse(this.editor.options.content);(n=t.content)!=null&&n.length&&(this.editor.options.content=t)}});D.ajaxSetup({headers:{"X-CSRF-TOKEN":D('meta[name="csrf-token"]').attr("content")}});window.oModalEditor=null;window.initModalEditor=function(n=""){const e=document.querySelector("#div-modal-editor");if(e){if(window.oModalEditor){window.oModalEditor.commands.setContent(n,!1);return}window.oModalEditor=new x1({element:e,extensions:[DS,Av.configure({html:!1}),Highlight],content:n}),D(document).on("click",".js-tiptap-btn",function(t){t.preventDefault();const r=D(this).data("action"),i=window.oModalEditor.chain().focus();switch(r){case"bold":i.toggleBold().run();break;case"italic":i.toggleItalic().run();break;case"heading":i.toggleHeading({level:1}).run();break;case"highlight":i.toggleHighlight().run();break}})}};window.$=window.jQuery=D; diff --git a/public/build/manifest.json b/public/build/manifest.json index 371e56ac..6ad26a47 100644 --- a/public/build/manifest.json +++ b/public/build/manifest.json @@ -25,7 +25,7 @@ "isEntry": true }, "resources/js/app.js": { - "file": "assets/app-BcB1rdwa.js", + "file": "assets/app-zmCj5tAh.js", "name": "app", "src": "resources/js/app.js", "isEntry": true diff --git a/resources/js/app.js b/resources/js/app.js index a546b408..0570cb1e 100755 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -14,37 +14,11 @@ $.ajaxSetup({ } });// ajax携带都携带某个参数 -//import './bootstrap'; import { Editor } from '@tiptap/core'; import StarterKit from '@tiptap/starter-kit'; import { Markdown } from '@tiptap/markdown'; import axios from 'axios'; -//$(document).ajaxSend(function (oEvent, oXhr, oSettings) { -// -// let aGlobalParams = { -// web_path: $('#web-path').val(), -// api_path: 'xcvxcvcv' -// }; -// -// let sParamString = $.param(aGlobalParams); -// -//// if (oSettings.type === "POST" || oSettings.type === "PUT" || oSettings.type === "DELETE") { -// -//// if (oSettings.data) { -//// if (typeof oSettings.data === "string") { -//// oSettings.data += "&" + sParamString; -//// } -//// } else { -// oSettings.data = sParamString; -//// } -// -//// } else if (oSettings.type === "GET") { -//// oSettings.url += (oSettings.url.indexOf('?') === -1 ? '?' : '&') + sParamString; -//// } -// -//}); - window.oModalEditor = null; @@ -87,3 +61,5 @@ window.initModalEditor = function(sInitialContent = '') { } }); }; + +window.$ = window.jQuery = $; // 可是这里这样写了,blade不就应该可以调吗 diff --git a/resources/views/nasa/v1/_actions/node.blade.php b/resources/views/nasa/v1/_actions/node.blade.php new file mode 100644 index 00000000..4f2ebdb5 --- /dev/null +++ b/resources/views/nasa/v1/_actions/node.blade.php @@ -0,0 +1,37 @@ +

+ + +
+ + diff --git a/routes/web.php b/routes/web.php index aac9cb94..7a24541e 100755 --- a/routes/web.php +++ b/routes/web.php @@ -29,6 +29,7 @@ use App\Http\Controllers\Web\Nasa\V1\Base\ListController as NasaListController; use App\Http\Controllers\Web\Nasa\V1\AuthController; use App\Http\Controllers\Web\Nasa\V1\MasterPanelNavController as NasaMasterPanelNavController; use App\Http\Controllers\Web\Nasa\V1\FuNodeBaseController as NasaFuNodeBaseController; +use App\Http\Controllers\Web\Nasa\V1\FuNodeActionController as NasaFuNodeActionController; use App\Http\Controllers\Web\Nasa\V1\FuEnvConfigController as NasaFuEnvConfigController; use App\Http\Controllers\Web\Nasa\V1\FuMailMustlogController as NasaFuMailMustlogController; @@ -60,26 +61,10 @@ Route::prefix('nasa')->middleware(['auth'])->group(function () { Route::prefix('stats')->group(function() { Route::get('dashboard/total', [NasaStatsDashboardTotalController::class, 'index'])->name('nasa.stats.dashboard.total'); }); - -// Route::get('setting')->name('nasa.setting'); -// Route::get('setting/master')->name('nasa.setting.master'); -// Route::prefix('setting/master')->group(function() { -// Route::get('nav', [NasaSettingMasterNavController::class, 'index'])->name('nasa.setting.master.nav'); -// }); -// Route::get('sites')->name('nasa.sites'); -// Route::get('sites/master')->name('nasa.sites.master); -// Route::prefix('/master')->group(function() { -// Route::get('/master/panel/nav', [NasaMasterPanelNavController::class, 'index'])->name('nasa.master.panel.nav'); -// }); - -// Route::get('node')->name('nasa.node'); -// Route::get('node/fu')->name('nasa.node.fu'); -// Route::prefix('node/fu')->group(function() { -// Route::get('node', [NasaNodeFuNodeController::class, 'index'])->name('nasa.node.fu.node'); -// }); Route::get('/master/panel/nav', [NasaMasterPanelNavController::class, 'index'])->name('nasa.master.panel.nav'); Route::get('/fu/node/base', [NasaFuNodeBaseController::class, 'index'])->name('nasa.fu.node.base'); + Route::get('/fu/node/action/fly', [NasaFuNodeActionController::class, 'fly']); Route::get('/fu/env/config', [NasaFuEnvConfigController::class, 'index'])->name('nasa.fu.env.config'); Route::get('/fu/mail/mustlog', [NasaFuMailMustlogController::class, 'index'])->name('nasa.fu.mail.mustlog');