Packages
ash_admin
0.13.18
1.1.0
1.0.0-rc.0
0.14.0
0.13.26
0.13.25
0.13.24
0.13.23
0.13.22
0.13.21
0.13.20
0.13.19
0.13.18
0.13.17
0.13.16
0.13.15
0.13.14
0.13.13
0.13.12
0.13.11
0.13.10
0.13.9
0.13.8
0.13.7
0.13.6
0.13.5
0.13.4
0.13.3
0.13.2
0.13.1
0.13.0
0.12.6
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.12.0
0.11.11
0.11.10
0.11.9
0.11.8
0.11.7
0.11.6
0.11.5
0.11.4
0.11.3
0.11.2
0.11.1
0.11.0
0.10.12
0.10.11
0.10.10
retired
0.10.10-rc.1
0.10.10-rc.0
0.10.9
0.10.8
0.10.7
0.10.6
0.10.5
0.10.4
0.10.3
0.10.2
0.10.1
0.10.0
0.9.8
0.9.7
0.9.6
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.1
0.8.0
0.7.1
0.7.0
0.6.2
0.6.1
0.6.0-rc.2
0.6.0-rc.1
0.6.0-rc.0
0.5.2
0.5.1-rc.0
0.5.0
0.4.5-rc.0
0.4.4
0.4.2
0.4.0
0.3.0-rc.0
0.2.22
0.2.21
0.2.20
0.2.19
0.2.18
0.2.17
0.2.16-rc.1
0.2.16-rc.0
0.2.15
0.2.14
0.2.13
0.2.12
0.2.11
0.2.10
0.2.9
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.1
0.1.6
0.1.5
0.1.3
0.1.2
0.1.0
A super-admin UI for Ash Framework, built with Phoenix LiveView.
Current section
Files
Jump to
Current section
Files
priv/static/assets/app.js
(()=>{var N=Object.create;var y=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var L=(e,a)=>()=>(a||e((a={exports:{}}).exports,a),a.exports);var q=(e,a,n,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let c of x(a))!O.call(e,c)&&c!==n&&y(e,c,{get:()=>a[c],enumerable:!(o=F(a,c))||o.enumerable});return e};var R=(e,a,n)=>(n=e!=null?N(J(e)):{},q(a||!e||!e.__esModule?y(n,"default",{value:e,enumerable:!0}):n,e));var T=L((A,g)=>{(function(e,a){"use strict";(function(){for(var t=0,i=["ms","moz","webkit","o"],s=0;s<i.length&&!e.requestAnimationFrame;++s)e.requestAnimationFrame=e[i[s]+"RequestAnimationFrame"],e.cancelAnimationFrame=e[i[s]+"CancelAnimationFrame"]||e[i[s]+"CancelRequestAnimationFrame"];e.requestAnimationFrame||(e.requestAnimationFrame=function(b,j){var v=new Date().getTime(),k=Math.max(0,16-(v-t)),I=e.setTimeout(function(){b(v+k)},k);return t=v+k,I}),e.cancelAnimationFrame||(e.cancelAnimationFrame=function(b){clearTimeout(b)})})();var n,o,c,h=null,m=null,p=null,w=function(t,i,s){t.addEventListener?t.addEventListener(i,s,!1):t.attachEvent?t.attachEvent("on"+i,s):t["on"+i]=s},r={autoRun:!0,barThickness:3,barColors:{0:"rgba(26, 188, 156, .9)",".25":"rgba(52, 152, 219, .9)",".50":"rgba(241, 196, 15, .9)",".75":"rgba(230, 126, 34, .9)","1.0":"rgba(211, 84, 0, .9)"},shadowBlur:10,shadowColor:"rgba(0, 0, 0, .6)",className:null},E=function(){n.width=e.innerWidth,n.height=r.barThickness*5;var t=n.getContext("2d");t.shadowBlur=r.shadowBlur,t.shadowColor=r.shadowColor;var i=t.createLinearGradient(0,0,n.width,0);for(var s in r.barColors)i.addColorStop(s,r.barColors[s]);t.lineWidth=r.barThickness,t.beginPath(),t.moveTo(0,r.barThickness/2),t.lineTo(Math.ceil(o*n.width),r.barThickness/2),t.strokeStyle=i,t.stroke()},S=function(){n=a.createElement("canvas");var t=n.style;t.position="fixed",t.top=t.left=t.right=t.margin=t.padding=0,t.zIndex=100001,t.display="none",r.className&&n.classList.add(r.className),a.body.appendChild(n),w(e,"resize",E)},l={config:function(t){for(var i in t)r.hasOwnProperty(i)&&(r[i]=t[i])},show:function(t){if(!c)if(t){if(p)return;p=setTimeout(()=>l.show(),t)}else c=!0,m!==null&&e.cancelAnimationFrame(m),n||S(),n.style.opacity=1,n.style.display="block",l.progress(0),r.autoRun&&function i(){h=e.requestAnimationFrame(i),l.progress("+"+.05*Math.pow(1-Math.sqrt(o),2))}()},progress:function(t){return typeof t=="undefined"||(typeof t=="string"&&(t=(t.indexOf("+")>=0||t.indexOf("-")>=0?o:0)+parseFloat(t)),o=t>1?1:t,E()),o},hide:function(){clearTimeout(p),p=null,c&&(c=!1,h!=null&&(e.cancelAnimationFrame(h),h=null),function t(){if(l.progress("+.1")>=1&&(n.style.opacity-=.05,n.style.opacity<=.05)){n.style.display="none",m=null;return}m=e.requestAnimationFrame(t)}())}};typeof g=="object"&&typeof g.exports=="object"?g.exports=l:typeof define=="function"&&define.amd?define(function(){return l}):this.topbar=l}).call(A,window,document)});var f=R(T()),M=document.querySelector("html").getAttribute("phx-socket")||"/live",U=document.querySelector("meta[name='csrf-token']").getAttribute("content"),u={},C={};u.JsonEditor={mounted(){let e=this.el.getAttribute("data-input-id"),a=this;this.editor=new JSONEditor(this.el,{onChangeText:n=>{let o=document.getElementById(e);try{JSON.parse(n),o.value=n,o.dispatchEvent(new Event("change",{bubbles:!0,target:this.el.name}))}catch(c){}},onChange:()=>{try{let n=document.getElementById(e);json=a.editor.get(),n.value=JSON.stringify(json),n.dispatchEvent(new Event("change",{bubbles:!0,target:this.el.name}))}catch(n){}},onModeChange:n=>{a.mode=n},modes:["text","tree"]},JSON.parse(document.getElementById(e).value)),C[this.el.id]=this.editor}};u.JsonEditorSource={updated(){try{let e=C[this.el.getAttribute("data-editor-id")];e.getMode()==="tree"?e.update(JSON.parse(this.el.value)):e.get()!==JSON.parse(this.el.value)&&e.setText(this.el.value)}catch(e){}}};u.JsonView={updated(){let e=JSON.parse(this.el.getAttribute("data-json"));this.editor=new JSONEditor(this.el,{mode:"preview"},e)},mounted(){let e=JSON.parse(this.el.getAttribute("data-json"));this.editor=new JSONEditor(this.el,{mode:"preview"},e)}};var z=e=>new EasyMDE({element:e,initialValue:e.getAttribute("value")});u.MarkdownEditor={mounted(){let e=this.el.getAttribute("data-target-id"),a=document.getElementById(e),n=z(a);n.codemirror.on("change",()=>{a.value=n.value(),a.dispatchEvent(new Event("change",{bubbles:!0}))})}};u.Actor={mounted(){this.handleEvent("set_actor",e=>{document.cookie="actor_resource="+encodeURIComponent(e.resource)+";path=/",document.cookie="actor_primary_key="+encodeURIComponent(e.primary_key)+";path=/",document.cookie="actor_action="+encodeURIComponent(e.action)+";path=/",document.cookie="actor_domain="+encodeURIComponent(e.domain)+";path=/",document.cookie="actor_tenant="+encodeURIComponent(e.tenant)+";path=/"}),this.handleEvent("clear_actor",()=>{document.cookie="actor_resource=;path=/",document.cookie="actor_primary_key=;path=/",document.cookie="actor_action=;path=/",document.cookie="actor_tenant=;path=/",document.cookie="actor_domain=;path=/",document.cookie="actor_authorizing=false;path=/",document.cookie="actor_paused=true;path=/"}),this.handleEvent("toggle_authorizing",e=>{document.cookie="actor_authorizing="+e.authorizing+";path=/"}),this.handleEvent("toggle_actor_paused",e=>{document.cookie="actor_paused="+e.actor_paused+";path=/"})}};u.Tenant={mounted(){this.handleEvent("set_tenant",e=>{document.cookie="tenant="+e.tenant+";path=/"}),this.handleEvent("clear_tenant",()=>{document.cookie="tenant=;path=/"})}};u.MaintainAttrs={attrs(){return this.el.getAttribute("data-attrs").split(", ")},beforeUpdate(){this.prevAttrs=this.attrs().map(e=>[e,this.el.getAttribute(e)])},updated(){this.prevAttrs.forEach(([e,a])=>this.el.setAttribute(e,a))}};u.Typeahead={mounted(){this.aborter=new AbortController;let e=this.aborter.signal,a=this.el.getAttribute("data-target-id"),n=document.getElementById(a);switch(this.el.tagName){case"INPUT":this.el.addEventListener("keydown",o=>{o.key==="Enter"&&o.preventDefault()},{signal:e}),this.el.addEventListener("keyup",o=>{switch(o.key){case"Enter":case"Escape":this.el.blur(),window.setTimeout(function(){n.dispatchEvent(new Event("input",{bubbles:!0}))},750);break}},{signal:e});break;case"LI":this.el.addEventListener("click",o=>{window.setTimeout(function(){n.dispatchEvent(new Event("input",{bubbles:!0}))},750)},{signal:e});break}},updated(){this.el.tagName==="INPUT"&&this.el.name.match(/suggest$/)&&this.el.value.length===0&&this.el.focus()},beforeDestroy(){this.aborter&&this.aborter.abort()}};function d(e){var a=new RegExp(e+"=([^;]+)"),n=a.exec(document.cookie);return n!=null?decodeURIComponent(n[1]):null}var B=()=>({_csrf_token:U,tenant:d("tenant"),actor_resource:d("actor_resource"),actor_primary_key:d("actor_primary_key"),actor_tenant:d("actor_tenant"),actor_action:d("actor_action"),actor_domain:d("actor_domain"),actor_authorizing:d("actor_authorizing"),actor_paused:d("actor_paused")}),_=new LiveView.LiveSocket(M,Phoenix.Socket,{params:B,hooks:u,dom:{onBeforeElUpdated(e,a){e._x_dataStack&&window.Alpine.clone(e,a)}}});f.default.config({barColors:{0:"#29d"},shadowColor:"rgba(0, 0, 0, .3)"});window.addEventListener("phx:page-loading-start",e=>f.default.show(300));window.addEventListener("phx:page-loading-stop",e=>f.default.hide());_.connect();_.enableDebug();window.liveSocket=_;})();
/**
* @license MIT
* topbar 2.0.0, 2023-02-04
* https://buunguyen.github.io/topbar
* Copyright (c) 2021 Buu Nguyen
*/