",{"class":this.config.wrapper.substr(1,this.config.wrapper.length)+" "+this.config.position}).appendTo("body"),s=t("
",{"class":"amaran-wrapper-inner"}).appendTo(c)),"object"==typeof this.config.content?r=null!=this.config.themeTemplate?this.config.themeTemplate(this.config.content):a[this.config.theme.split(" ")[0]+"Theme"](this.config.content):(this.config.content={},this.config.content.message=this.config.message,this.config.content.color="#47b1f3",r=a.defaultTheme(this.config.content)),i={"class":this.config.themeTemplate?"amaran "+this.config.content.themeName:this.config.theme&&!this.config.themeTemplate?"amaran "+this.config.theme:"amaran",html:this.buildHTML(r)},this.config.clearAll&&t(".amaran,.amaran-overlay").remove(),o=t("
",i).appendTo(s),"center"===n[0]&&this.centerCalculate(c,s),this.animation(this.config.inEffect,o,"show"),this.config.onClick&&(e=this,t(o).css({cursor:"default"}),t(o).on("click",function(i){return t(i.target).is(".amaran-close")||t(i.target).is(".amaran-sticky")?void i.preventDefault():void e.config.onClick()})),this.config.resetTimeout&&(e=this,t(o).on("mouseenter",function(){return e.resetTimeout()}),t(o).on("mouseleave",function(){return e.resumeTimeout(o)})),this.config.overlay&&t(".amaran-overlay").length<=0&&t("body").prepend('
'),this.config.stickyButton&&(e=this,t(o).find(".amaran-sticky").on("click",function(){return t(this).hasClass("sticky")?(e.resumeTimeout(o),t(this).removeClass("sticky")):(e.resetTimeout(),t(this).addClass("sticky"))})),this.config.sticky!==!0&&this.hideDiv(o)},resetTimeout:function(){var t;return t=this,clearTimeout(t.timeout)},resumeTimeout:function(t){var i;return i=this,i.timeout=setTimeout(function(){return i.animation(i.config.outEffect,t,"hide")},i.config.delay)},buildHTML:function(t){return this.config.closeButton&&(t='
'+t),this.config.stickyButton&&(t='
'+t),t},centerCalculate:function(t,i){var e,n,o;n=i.find(".amaran").length,o=i.height(),e=(t.height()-o)/2,i.find(".amaran:first-child").animate({"margin-top":e},200)},animation:function(t,i,e){return"fadeIn"===t||"fadeOut"===t?this.fade(i,e):"show"===t?this.cssanimate(i,e):this.slide(t,i,e)},fade:function(t,i){var e;return this.removeOverlay(),e=this,"show"===i?this.config.cssanimationIn?t.addClass("animated "+this.config.cssanimationIn).show():t.fadeIn():this.config.cssanimationOut?(t.addClass("animated "+this.config.cssanimationOut),t.css({"min-height":0,height:t.outerHeight()}),void t.animate({opacity:0},function(){t.animate({height:0},function(){e.removeIt(t)})})):(t.css({"min-height":0,height:t.outerHeight()}),void t.animate({opacity:0},function(){t.animate({height:0},function(){e.removeIt(t)})}))},removeIt:function(i){var e,n;clearTimeout(this.timeout),i.remove(),n=t(this.config.wrapper+"."+this.config.position.split(" ")[0]+"."+this.config.position.split(" ")[1]),e=n.find(".amaran-wrapper-inner"),"center"===this.config.position.split(" ")[0]&&this.centerCalculate(n,e),this.config.afterEnd()},getWidth:function(t){var i,e;return i=t.clone().hide().appendTo("body"),e=i.outerWidth()+i.outerWidth()/2,i.remove(),e},getInfo:function(i){var e,n;return e=i.offset(),n=t(this.config.wrapper).offset(),{t:e.top,l:e.left,h:i.height(),w:i.outerWidth(),wT:n.top,wL:n.left,wH:t(this.config.wrapper).outerHeight(),wW:t(this.config.wrapper).outerWidth()}},getPosition:function(e,n){var o,a,s;return o=this.getInfo(e),a=this.config.position.split(" ")[1],s={slideTop:{start:{top:-(o.wT+o.wH+2*o.h)},move:{top:0},hide:{top:-(o.t+2*o.h)},height:o.h},slideBottom:{start:{top:t(i).height()-o.wH+2*o.h},move:{top:0},hide:{top:t(i).height()-o.wH+2*o.h},height:o.h},slideLeft:{start:{left:"left"===a?1.5*-o.w:-t(i).width()},move:{left:0},hide:{left:"left"===a?1.5*-o.w:-t(i).width()},height:o.h},slideRight:{start:{left:"right"===a?1.5*o.w:t(i).width()},move:{left:0},hide:{left:"right"===a?1.5*o.w:t(i).width()},height:o.h}},s[n]?s[n]:0},slide:function(t,i,e){var n,o;return this.removeOverlay(),o=this.getPosition(i,t),"show"!==e?(n=this,i.animate(o.hide,function(){i.css({"min-height":0,height:o.height},function(){i.html(" ")})}).animate({height:0},function(){return n.removeIt(i)})):void i.show().css(o.start).animate(o.move)},removeOverlay:function(){return this.config.overlay&&t(".amaran").length<=1?t(".amaran-overlay").remove():void 0},close:function(){var i;return i=this,t("[data-amaran-close]").on("click",function(){i.animation(i.config.outEffect,t(this).closest("div.amaran"),"hide")}),!this.config.closeOnClick&&this.config.closeButton?void i.animation(i.config.outEffect,t(this).parent("div.amaran"),"hide"):void(this.config.closeOnClick&&t(".amaran").on("click",function(){i.animation(i.config.outEffect,t(this),"hide")}))},hideDiv:function(t){var i;i=this,i.timeout=setTimeout(function(){i.animation(i.config.outEffect,t,"hide")},i.config.delay)}},a={defaultTheme:function(t){var i;return i="","undefined"!=typeof t.color&&(i=t.color),"
"+t.message+"
"},awesomeTheme:function(t){return'
'+t.title+"
"+t.message+' '+t.info+"
"},userTheme:function(t){return'
'+t.user+" "+t.message+"
"},colorfulTheme:function(t){var i,e;return"undefined"!=typeof t.color&&(e=t.color),"undefined"!=typeof t.bgcolor&&(i=t.bgcolor),"
"+t.message+"
"},tumblrTheme:function(t){return'
'+t.title+'
'+t.message+"
"}},t.amaran=function(t){var i;return i=new o(t)},t.amaran.close=function(){return t(".amaran-wrapper").remove(),!1}}(jQuery,window,document)}).call(this);
diff --git a/libs/vue.min.js b/libs/vue.min.js
deleted file mode 100755
index 9ac23c4..0000000
--- a/libs/vue.min.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*!
- * Vue.js v2.1.10
- * (c) 2014-2017 Evan You
- * Released under the MIT License.
- */
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";function e(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function t(e){var t=parseFloat(e);return isNaN(t)?e:t}function n(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i
-1)return e.splice(n,1)}}function i(e,t){return ii.call(e,t)}function o(e){return"string"==typeof e||"number"==typeof e}function a(e){var t=Object.create(null);return function(n){var r=t[n];return r||(t[n]=e(n))}}function s(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function c(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function u(e,t){for(var n in t)e[n]=t[n];return e}function l(e){return null!==e&&"object"==typeof e}function f(e){return li.call(e)===fi}function p(e){for(var t={},n=0;n1?c(n):n;for(var r=c(arguments,1),i=0,o=n.length;i=0&&Gi[n].id>e.id;)n--;Gi.splice(Math.max(n,eo)+1,0,e)}else Gi.push(e);Qi||(Qi=!0,Ai(xe))}}function Ae(e){ro.clear(),Oe(e,ro)}function Oe(e,t){var n,r,i=Array.isArray(e);if((i||l(e))&&Object.isExtensible(e)){if(e.__ob__){var o=e.__ob__.dep.id;if(t.has(o))return;t.add(o)}if(i)for(n=e.length;n--;)Oe(e[n],t);else for(r=Object.keys(e),n=r.length;n--;)Oe(e[r[n]],t)}}function Se(e){e._watchers=[];var t=e.$options;t.props&&Te(e,t.props),t.methods&&Ne(e,t.methods),t.data?Ee(e):k(e._data={},!0),t.computed&&Ie(e,t.computed),t.watch&&Le(e,t.watch)}function Te(e,t){var n=e.$options.propsData||{},r=e.$options._propKeys=Object.keys(t),i=!e.$parent;Mi.shouldConvert=i;for(var o=function(i){var o=r[i];A(e,o,P(o,t,n,e))},a=0;a-1:e.test(t)}function We(e,t){for(var n in e){var r=e[n];if(r){var i=Ke(r.componentOptions);i&&!t(i)&&(Ze(r),e[n]=null)}}}function Ze(e){e&&(e.componentInstance._inactive||we(e.componentInstance,"deactivated"),e.componentInstance.$destroy())}function Ge(e){var t={};t.get=function(){return vi},Object.defineProperty(e,"config",t),e.util=Fi,e.set=O,e.delete=S,e.nextTick=Ai,e.options=Object.create(null),vi._assetTypes.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,u(e.options.components,co),Be(e),ze(e),Ve(e),Je(e)}function Ye(e){for(var t=e.data,n=e,r=e;r.componentInstance;)r=r.componentInstance._vnode,r.data&&(t=Qe(r.data,t));for(;n=n.parent;)n.data&&(t=Qe(t,n.data));return Xe(t)}function Qe(e,t){return{staticClass:et(e.staticClass,t.staticClass),class:e.class?[e.class,t.class]:t.class}}function Xe(e){var t=e.class,n=e.staticClass;return n||t?et(n,tt(t)):""}function et(e,t){return e?t?e+" "+t:e:t||""}function tt(e){var t="";if(!e)return t;if("string"==typeof e)return e;if(Array.isArray(e)){for(var n,r=0,i=e.length;r-1?ko[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:ko[e]=/HTMLUnknownElement/.test(t.toString())}function it(e){if("string"==typeof e){if(e=document.querySelector(e),!e)return document.createElement("div")}return e}function ot(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&"multiple"in t.data.attrs&&n.setAttribute("multiple","multiple"),n)}function at(e,t){return document.createElementNS(bo[e],t)}function st(e){return document.createTextNode(e)}function ct(e){return document.createComment(e)}function ut(e,t,n){e.insertBefore(t,n)}function lt(e,t){e.removeChild(t)}function ft(e,t){e.appendChild(t)}function pt(e){return e.parentNode}function dt(e){return e.nextSibling}function vt(e){return e.tagName}function ht(e,t){e.textContent=t}function mt(e,t,n){e.setAttribute(t,n)}function gt(e,t){var n=e.data.ref;if(n){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[n])?r(a[n],o):a[n]===o&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])&&a[n].indexOf(o)<0?a[n].push(o):a[n]=[o]:a[n]=o}}function yt(e){return null==e}function _t(e){return null!=e}function bt(e,t){return e.key===t.key&&e.tag===t.tag&&e.isComment===t.isComment&&!e.data==!t.data}function $t(e,t,n){var r,i,o={};for(r=t;r<=n;++r)i=e[r].key,_t(i)&&(o[i]=r);return o}function wt(e){function t(e){return new Hi(O.tagName(e).toLowerCase(),{},[],void 0,e)}function r(e,t){function n(){0===--n.listeners&&i(e)}return n.listeners=t,n}function i(e){var t=O.parentNode(e);t&&O.removeChild(t,e)}function a(e,t,n,r,i){if(e.isRootInsert=!i,!s(e,t,n,r)){var o=e.data,a=e.children,c=e.tag;_t(c)?(e.elm=e.ns?O.createElementNS(e.ns,c):O.createElement(c,e),v(e),f(e,a,t),_t(o)&&d(e,t),l(n,e.elm,r)):e.isComment?(e.elm=O.createComment(e.text),l(n,e.elm,r)):(e.elm=O.createTextNode(e.text),l(n,e.elm,r))}}function s(e,t,n,r){var i=e.data;if(_t(i)){var o=_t(e.componentInstance)&&i.keepAlive;if(_t(i=i.hook)&&_t(i=i.init)&&i(e,!1,n,r),_t(e.componentInstance))return c(e,t),o&&u(e,t,n,r),!0}}function c(e,t){e.data.pendingInsert&&t.push.apply(t,e.data.pendingInsert),e.elm=e.componentInstance.$el,p(e)?(d(e,t),v(e)):(gt(e),t.push(e))}function u(e,t,n,r){for(var i,o=e;o.componentInstance;)if(o=o.componentInstance._vnode,_t(i=o.data)&&_t(i=i.transition)){for(i=0;ip?(u=yt(n[m+1])?null:n[m+1].elm,h(e,u,n,f,m,r)):f>m&&g(e,t,l,p)}function b(e,t,n,r){if(e!==t){if(t.isStatic&&e.isStatic&&t.key===e.key&&(t.isCloned||t.isOnce))return t.elm=e.elm,void(t.componentInstance=e.componentInstance);var i,o=t.data,a=_t(o);a&&_t(i=o.hook)&&_t(i=i.prepatch)&&i(e,t);var s=t.elm=e.elm,c=e.children,u=t.children;if(a&&p(t)){for(i=0;i-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+e.getAttribute("class")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function zt(e,t){if(t&&t.trim())if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t);else{for(var n=" "+e.getAttribute("class")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");e.setAttribute("class",n.trim())}}function Vt(e){Yo(function(){Yo(e)})}function Jt(e,t){(e._transitionClasses||(e._transitionClasses=[])).push(t),Bt(e,t)}function Kt(e,t){e._transitionClasses&&r(e._transitionClasses,t),zt(e,t)}function qt(e,t,n){var r=Wt(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Jo?Wo:Go,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=Jo,l=a,f=o.length):t===Ko?u>0&&(n=Ko,l=u,f=c.length):(l=Math.max(a,u),n=l>0?a>u?Jo:Ko:null,f=n?n===Jo?o.length:c.length:0);var p=n===Jo&&Qo.test(r[qo+"Property"]);return{type:n,timeout:l,propCount:f,hasTransform:p}}function Zt(e,t){for(;e.length1,j=n._enterCb=en(function(){E&&(Kt(n,k),Kt(n,x)),j.cancelled?(E&&Kt(n,C),T&&T(n)):S&&S(n),n._enterCb=null});e.data.show||ne(e.data.hook||(e.data.hook={}),"insert",function(){var t=n.parentNode,r=t&&t._pending&&t._pending[e.key];r&&r.tag===e.tag&&r.elm._leaveCb&&r.elm._leaveCb(),O&&O(n,j)},"transition-insert"),A&&A(n),E&&(Jt(n,C),Jt(n,x),Vt(function(){Jt(n,k),Kt(n,C),j.cancelled||I||qt(n,o,j)})),e.data.show&&(t&&t(),O&&O(n,j)),E||I||j()}}}function Qt(e,t){function n(){g.cancelled||(e.data.show||((r.parentNode._pending||(r.parentNode._pending={}))[e.key]=e),l&&l(r),h&&(Jt(r,s),Jt(r,u),Vt(function(){Jt(r,c),Kt(r,s),g.cancelled||m||qt(r,a,g)})),f&&f(r,g),h||m||g())}var r=e.elm;r._enterCb&&(r._enterCb.cancelled=!0,r._enterCb());var i=Xt(e.data.transition);if(!i)return t();if(!r._leaveCb&&1===r.nodeType){var o=i.css,a=i.type,s=i.leaveClass,c=i.leaveToClass,u=i.leaveActiveClass,l=i.beforeLeave,f=i.leave,p=i.afterLeave,d=i.leaveCancelled,v=i.delayLeave,h=o!==!1&&!bi,m=f&&(f._length||f.length)>1,g=r._leaveCb=en(function(){r.parentNode&&r.parentNode._pending&&(r.parentNode._pending[e.key]=null),h&&(Kt(r,c),Kt(r,u)),g.cancelled?(h&&Kt(r,s),d&&d(r)):(t(),p&&p(r)),r._leaveCb=null});v?v(n):n()}}function Xt(e){if(e){if("object"==typeof e){var t={};return e.css!==!1&&u(t,Xo(e.name||"v")),u(t,e),t}return"string"==typeof e?Xo(e):void 0}}function en(e){var t=!1;return function(){t||(t=!0,e())}}function tn(e,t){t.data.show||Yt(t)}function nn(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s-1,a.selected!==o&&(a.selected=o);else if(h(on(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function rn(e,t){for(var n=0,r=t.length;n',n.innerHTML.indexOf(t)>0}function _n(e){return pa=pa||document.createElement("div"),pa.innerHTML=e,pa.textContent}function bn(e,t){return t&&(e=e.replace(os,"\n")),e.replace(rs,"<").replace(is,">").replace(as,"&").replace(ss,'"')}function $n(e,t){function n(t){f+=t,e=e.substring(t)}function r(){var t=e.match(Ca);if(t){var r={tagName:t[1],attrs:[],start:f};n(t[0].length);for(var i,o;!(i=e.match(xa))&&(o=e.match(ba));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=f,r}}function i(e){var n=e.tagName,r=e.unarySlash;u&&("p"===s&&ma(n)&&o(s),ha(n)&&s===n&&o(n));for(var i=l(n)||"html"===n&&"head"===s||!!r,a=e.attrs.length,f=new Array(a),p=0;p=0&&c[i].lowerCasedTag!==o;i--);else i=0;if(i>=0){for(var a=c.length-1;a>=i;a--)t.end&&t.end(c[a].tag,n,r);c.length=i,s=i&&c[i-1].tag}else"br"===o?t.start&&t.start(e,[],!0,n,r):"p"===o&&(t.start&&t.start(e,[],!1,n,r),t.end&&t.end(e,n,r))}for(var a,s,c=[],u=t.expectHTML,l=t.isUnaryTag||pi,f=0;e;){if(a=e,s&&ts(s)){var p=s.toLowerCase(),d=ns[p]||(ns[p]=new RegExp("([\\s\\S]*?)("+p+"[^>]*>)","i")),v=0,h=e.replace(d,function(e,n,r){return v=r.length,"script"!==p&&"style"!==p&&"noscript"!==p&&(n=n.replace(//g,"$1").replace(//g,"$1")),t.chars&&t.chars(n),""});f+=e.length-h.length,e=h,o(p,f-v,f)}else{var m=e.indexOf("<");if(0===m){if(Oa.test(e)){var g=e.indexOf("-->");if(g>=0){n(g+3);continue}}if(Sa.test(e)){var y=e.indexOf("]>");if(y>=0){n(y+2);continue}}var _=e.match(Aa);if(_){n(_[0].length);continue}var b=e.match(ka);if(b){var $=f;n(b[0].length),o(b[1],$,f);continue}var w=r();if(w){i(w);continue}}var C=void 0,x=void 0,k=void 0;if(m>0){for(x=e.slice(m);!(ka.test(x)||Ca.test(x)||Oa.test(x)||Sa.test(x)||(k=x.indexOf("<",1),k<0));)m+=k,x=e.slice(m);C=e.substring(0,m),n(m)}m<0&&(C=e,e=""),t.chars&&C&&t.chars(C)}if(e===a&&t.chars){t.chars(e);break}}o()}function wn(e){function t(){(a||(a=[])).push(e.slice(v,i).trim()),v=i+1}var n,r,i,o,a,s=!1,c=!1,u=!1,l=!1,f=0,p=0,d=0,v=0;for(i=0;i=0&&(m=e.charAt(h)," "===m);h--);m&&/[\w$]/.test(m)||(l=!0)}}else void 0===o?(v=i+1,o=e.slice(0,i).trim()):t();if(void 0===o?o=e.slice(0,i).trim():0!==v&&t(),a)for(i=0;ia&&o.push(JSON.stringify(e.slice(a,i)));var s=wn(r[1].trim());o.push("_s("+s+")"),a=i+r[0].length}return a=Ea}function Dn(e){return 34===e||39===e}function Pn(e){var t=1;for(La=Na;!Mn();)if(e=Ln(),Dn(e))Rn(e);else if(91===e&&t++,93===e&&t--,0===t){Ma=Na;break}}function Rn(e){for(var t=e;!Mn()&&(e=Ln(),e!==t););}function Fn(e,t){Da=t.warn||kn,Pa=t.getTagNamespace||pi,Ra=t.mustUseProp||pi,Fa=t.isPreTag||pi,Ha=An(t.modules,"preTransformNode"),Ua=An(t.modules,"transformNode"),Ba=An(t.modules,"postTransformNode"),za=t.delimiters;var n,r,i=[],o=t.preserveWhitespace!==!1,a=!1,s=!1;return $n(e,{expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,shouldDecodeNewlines:t.shouldDecodeNewlines,start:function(e,o,c){function u(e){}var l=r&&r.ns||Pa(e);_i&&"svg"===l&&(o=rr(o));var f={type:1,tag:e,attrsList:o,attrsMap:tr(o),parent:r,children:[]};l&&(f.ns=l),nr(f)&&!xi()&&(f.forbidden=!0);for(var p=0;p-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),En(e,"click","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+t+"=$$a.concat($$v))}else{$$i>-1&&("+t+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+t+"=$$c}",null,!0)}function Jr(e,t,n){var r=n&&n.number,i=In(e,"value")||"null";i=r?"_n("+i+")":i,On(e,"checked","_q("+t+","+i+")"),En(e,"click",Wr(t,i),null,!0)}function Kr(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=o||_i&&"range"===r?"change":"input",u=!o&&"range"!==r,l="input"===e.tag||"textarea"===e.tag,f=l?"$event.target.value"+(s?".trim()":""):s?"(typeof $event === 'string' ? $event.trim() : $event)":"$event";f=a||"number"===r?"_n("+f+")":f;var p=Wr(t,f);l&&u&&(p="if($event.target.composing)return;"+p),On(e,"value",l?"_s("+t+")":"("+t+")"),En(e,c,p,null,!0),(s||a||"number"===r)&&En(e,"blur","$forceUpdate()")}function qr(e,t,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})"+(null==e.attrsMap.multiple?"[0]":""),o=Wr(t,i);En(e,"change",o,null,!0)}function Wr(e,t){var n=Nn(e);return null===n.idx?e+"="+t:"var $$exp = "+n.exp+", $$idx = "+n.idx+";if (!Array.isArray($$exp)){"+e+"="+t+"}else{$$exp.splice($$idx, 1, "+t+")}"}function Zr(e,t){t.value&&On(e,"textContent","_s("+t.value+")")}function Gr(e,t){t.value&&On(e,"innerHTML","_s("+t.value+")")}function Yr(e,t){return t=t?u(u({},js),t):js,Rr(e,t)}function Qr(e,t,n){var r=(t&&t.warn||Si,t&&t.delimiters?String(t.delimiters)+e:e);if(Is[r])return Is[r];var i={},o=Yr(e,t);i.render=Xr(o.render);var a=o.staticRenderFns.length;i.staticRenderFns=new Array(a);for(var s=0;s0,$i=yi&&yi.indexOf("edge/")>0,wi=yi&&yi.indexOf("android")>0,Ci=yi&&/iphone|ipad|ipod|ios/.test(yi),xi=function(){return void 0===ti&&(ti=!gi&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),ti},ki=gi&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Ai=function(){function e(){r=!1;var e=n.slice(0);n.length=0;for(var t=0;t1&&(t[n[0].trim()]=n[1].trim())}}),t}),Ro=/^--/,Fo=/\s*!important$/,Ho=function(e,t,n){Ro.test(t)?e.style.setProperty(t,n):Fo.test(n)?e.style.setProperty(t,n.replace(Fo,""),"important"):e.style[Bo(t)]=n},Uo=["Webkit","Moz","ms"],Bo=a(function(e){if(lo=lo||document.createElement("div"),e=ai(e),"filter"!==e&&e in lo.style)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n\/=]+)/,ya=/(?:=)/,_a=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],ba=new RegExp("^\\s*"+ga.source+"(?:\\s*("+ya.source+")\\s*(?:"+_a.join("|")+"))?"),$a="[a-zA-Z_][\\w\\-\\.]*",wa="((?:"+$a+"\\:)?"+$a+")",Ca=new RegExp("^<"+wa),xa=/^\s*(\/?)>/,ka=new RegExp("^<\\/"+wa+"[^>]*>"),Aa=/^]+>/i,Oa=/^
-
-
Loading...
-
-
-
-
-
-
-
-
-
-
- `,
- data() {
- return ({
- activeNav: 1
- })
- },
- components: {
- 'dashboard': Dashboard,
- 'system-cleaner': SystemCleaner,
- 'startup-apps': StartupApps,
- 'services': Services,
- 'process': Process,
- 'uninstaller': Uninstaller,
- 'resources': Resources,
- 'settings': Settings,
- },
- methods: {
- isActiveNav(val) {
- return this.activeNav == val ? 'nav-active' : ''
- }
- }
-}
\ No newline at end of file
diff --git a/src/components/dashboard/CircleBar.js b/src/components/dashboard/CircleBar.js
deleted file mode 100644
index 2d075f7..0000000
--- a/src/components/dashboard/CircleBar.js
+++ /dev/null
@@ -1,11 +0,0 @@
-export default {
- template: `
-
{{ title }}
-
-
-
-
-
{{ text }}
-
`,
- props: ['stroke', 'text', 'idd', 'img', 'title']
-}
\ No newline at end of file
diff --git a/src/components/dashboard/CpuBar.js b/src/components/dashboard/CpuBar.js
deleted file mode 100644
index 65e2ceb..0000000
--- a/src/components/dashboard/CpuBar.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import {
- Path
-} from 'progressbar.js'
-import si from 'systeminformation'
-import CircleBar from './CircleBar'
-
-export default {
- template: `
`,
- components: {
- 'circle-bar': CircleBar
- },
- data() {
- return ({
- cpuValue: 0
- })
- },
- mounted() {
- let cpuBar = new Path('#cpu-cont', {
- duration: 1000
- })
-
- setInterval(() => {
- si.currentLoad(val => {
- this.cpuValue = val.currentload.toFixed(0)
- cpuBar.animate(this.cpuValue / 100)
- })
- }, 1000)
- }
-}
\ No newline at end of file
diff --git a/src/components/dashboard/Dashboard.js b/src/components/dashboard/Dashboard.js
deleted file mode 100644
index b065e28..0000000
--- a/src/components/dashboard/Dashboard.js
+++ /dev/null
@@ -1,67 +0,0 @@
-import {
- shell
-} from 'electron'
-import si from 'systeminformation'
-//Components
-import SystemInfo from './SystemInfo'
-import UpBar from './UpBar'
-import DownBar from './DownBar'
-import CpuBar from './CpuBar'
-import MemoryBar from './MemoryBar'
-import DiskBar from './DiskBar'
-
-export default {
- template: `
-
-
-
-
-
-
-
-
-
-
-
-
- {{ lang('updateMsg') }}
-
- {{ lang('downloadUpdate') }}
-
-
-
-
- `,
- data() {
- return ({
- update_check: false
- })
- },
- components: {
- 'system-info': SystemInfo,
- 'up-bar': UpBar,
- 'down-bar': DownBar,
- 'cpu-bar': CpuBar,
- 'memory-bar': MemoryBar,
- 'disk-bar': DiskBar
- },
- methods: {
- // open the link on browser
- download_update() {
- shell.openExternal('https://github.com/oguzhaninan/Stacer/releases/latest')
- }
- },
- created() {
- // Update check
- try {
- $.getJSON('https://api.github.com/repos/oguzhaninan/Stacer/releases/latest', data => {
- let currentVersion = require('../../../package.json').version.toString()
- let releaseVersion = data.tag_name.substr(1).toString()
-
- this.update_check = (currentVersion != releaseVersion)
- })
- } catch (err) {
- logger.error('Update Check', err)
- }
- }
-}
\ No newline at end of file
diff --git a/src/components/dashboard/DiskBar.js b/src/components/dashboard/DiskBar.js
deleted file mode 100644
index e2601c8..0000000
--- a/src/components/dashboard/DiskBar.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import {
- Path
-} from 'progressbar.js'
-import si from 'systeminformation'
-import helpers from '../../utils/helpers'
-import CircleBar from './CircleBar'
-
-export default {
- template: `
`,
- components: {
- 'circle-bar': CircleBar
- },
- data() {
- return ({
- diskUsed: 0,
- diskTotal: 0,
- diskBar: null
- })
- },
- mounted() {
- this.diskBar = new Path('#disk-cont', {
- duration: 5000
- })
-
- this.diskInfo()
- setInterval(this.diskInfo, 5000)
- },
- methods: {
- diskInfo() {
- si.fsSize(disk => {
- this.diskUsed = helpers.prettyDiskSize(disk[0].used)
- this.diskTotal = helpers.prettyDiskSize(disk[0].size)
- this.diskBar.animate(disk[0].use / 100)
- })}
- }
-}
\ No newline at end of file
diff --git a/src/components/dashboard/DownBar.js b/src/components/dashboard/DownBar.js
deleted file mode 100644
index 3b20f9c..0000000
--- a/src/components/dashboard/DownBar.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import {
- Line
-} from 'progressbar.js'
-import si from 'systeminformation'
-
-export default {
- template: `
-
{{ lang('download') }}
-
-
{{ downSpeed + ' kB/s' }}
-
`,
- data() {
- return ({
- downSpeed: 0
- })
- },
- mounted() {
- let downBar = new Line('#down-bar', {
- strokeWidth: 5,
- duration: 1000,
- color: '#3498db',
- trailColor: '#202b33'
- })
-
- let max = 1000
- // Get network name
- si.networkInterfaceDefault(defaultNetwork => {
- setInterval(() => {
- // get down speed
- si.networkStats(defaultNetwork, data => {
- let speed = Math.abs(data.rx_sec / 1024).toFixed(2)
- this.downSpeed = speed > 0 ? speed : 0
- // down bar update
- max = max < this.downSpeed ? this.downSpeed : max
- let percent = this.downSpeed / max < 1 ? this.downSpeed / max : 1
- downBar.animate(percent)
- })
- }, 1000)
- })
- }
-}
diff --git a/src/components/dashboard/MemoryBar.js b/src/components/dashboard/MemoryBar.js
deleted file mode 100644
index 8783fa9..0000000
--- a/src/components/dashboard/MemoryBar.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import {
- Path
-} from 'progressbar.js'
-import si from 'systeminformation'
-import helpers from '../../utils/helpers'
-import CircleBar from './CircleBar'
-
-export default {
- template: `
`,
- components: {
- 'circle-bar': CircleBar
- },
- data() {
- return ({
- memoryValue: 0
- })
- },
- mounted() {
- let memoryBar = new Path('#mem-cont', {
- duration: 1500
- })
-
- setInterval(() => {
- si.mem(ram => {
- let usedMem = ram.total - ram.available
- let totalMem = ram.total
- this.memoryValue = helpers.prettyMemSize(usedMem) + ' / ' + helpers.prettyMemSize(totalMem) + 'GB'
- memoryBar.animate(usedMem / totalMem)
- })
- }, 1500)
- }
-}
\ No newline at end of file
diff --git a/src/components/dashboard/SystemInfo.js b/src/components/dashboard/SystemInfo.js
deleted file mode 100644
index 64c4de0..0000000
--- a/src/components/dashboard/SystemInfo.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import si from 'systeminformation'
-
-export default {
- template: `
-
{{ lang('systemInfo') }}
-
-
`,
- data() {
- return {
- information: []
- }
- },
- created() {
- si.osInfo(o => {
- this.information.push(lang('hostname') + ': ' + isUndefined(o.hostname))
- this.information.push(lang('platform') + ': ' + isUndefined(o.platform) + " " + isUndefined(o.arch))
- this.information.push(lang('distribution') + ': ' + isUndefined(o.distro) + " " + isUndefined(o.release))
- this.information.push(lang('kernelRel') + ': ' + isUndefined(o.kernel))
- si.cpu(c => {
- this.information.push(lang('cpuModel') + ': ' + isUndefined(c.manufacturer) + " " + isUndefined(c.brand))
- this.information.push(lang('cpuSpeed') + ': ' + isUndefined(c.speed) + "GHz")
- this.information.push(lang('cpuCores') + ': ' + c.cores)
- })
- })
- }
-}
-
-function isUndefined(o) {
- if(typeof o == 'string') return o
- else return 'Undefined'
-}
\ No newline at end of file
diff --git a/src/components/dashboard/UpBar.js b/src/components/dashboard/UpBar.js
deleted file mode 100644
index c074858..0000000
--- a/src/components/dashboard/UpBar.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import {
- Line
-} from 'progressbar.js'
-import si from 'systeminformation'
-
-export default {
- template: `
-
{{ lang('upload') }}
-
-
{{ this.upSpeed + ' kB/s' }}
-
`,
- data() {
- return ({
- upSpeed: 0
- })
- },
- mounted() {
- let upBar = new Line('#up-bar', {
- strokeWidth: 5,
- duration: 1000,
- color: '#3498db',
- trailColor: '#202b33'
- })
-
- let max = 1000
- // Get network name
- si.networkInterfaceDefault(defaultNetwork => {
- setInterval(() => {
- // get upload speed
- si.networkStats(defaultNetwork, data => {
- let speed = Math.abs(data.tx_sec / 1024).toFixed(2)
- this.upSpeed = speed > 0 ? speed : 0
- // up bar update
- max = max < this.upSpeed ? this.upSpeed : max
- let percent = this.upSpeed / max < 1 ? this.upSpeed / max : 1
- upBar.animate(percent)
- })
- }, 1000)
- })
- }
-}
\ No newline at end of file
diff --git a/src/components/process/Process.js b/src/components/process/Process.js
deleted file mode 100644
index a3f198b..0000000
--- a/src/components/process/Process.js
+++ /dev/null
@@ -1,170 +0,0 @@
-import {
- spawnSync
-} from 'child_process'
-import {
- showMessage
-} from '../../utils/helpers.js'
-
-import ProcessesList from './ProcessesList'
-
-export default {
- template: `
-
-
-
-
-
{{ lang('process') }} ({{ processes.length }})
-
-
-
-
-
-
- PID
-
-
- %CPU
-
-
- %MEM
-
-
- RSS
-
-
- VSIZE
-
-
- User
-
-
- Process
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ p.pid }}
- {{ p.pcpu }}
- {{ p.pmem }}
- {{ p.rss }}
- {{ p.vsize }}
- {{ p.uname }}
- {{ p.cmd }}
-
-
-
-
-
- {{ lang('refresh') }} ({{ refreshInterval }})
-
-
-
{{ lang('endProcess') }}
-
-
- `,
- data() {
- return ({
- processes: [],
- sPid: 0,
- sMem: 0,
- sRss: 0,
- sVSize: 0,
- sUser: 0,
- sCmd: 0,
- sCpu: 1,
- sort: ['--sort', '-pcpu'],
- searchString: '',
- selectedPid: 0,
- refreshInterval: 2,
- interval: null
- })
- },
- created() {
- this.interval = setInterval(() => this.processes = ProcessesList(this.searchString, this.sort), this.refreshInterval * 1000)
- },
- watch: {
- refreshInterval(val) {
- clearInterval(this.interval)
- this.interval = setInterval(() => this.processes = ProcessesList(this.searchString, this.sort), val * 1000)
- }
- },
- methods: {
- selectPid(pid) {
- if (this.selectedPid == pid)
- this.selectedPid = 0
- else
- this.selectedPid = pid
- },
- sortPid() {
- this.sPid = this.changeAmount(this.sPid)
- this.changeSort(this.sPid, 'pid')
- },
- sortCpu() {
- this.sCpu = this.changeAmount(this.sCpu)
- this.changeSort(this.sCpu, 'pcpu')
- },
- sortMem() {
- this.sMem = this.changeAmount(this.sMem)
- this.changeSort(this.sMem, 'pmem')
- },
- sortRss() {
- this.sRss = this.changeAmount(this.sRss)
- this.changeSort(this.sRss, 'rss')
- },
- sortVSize() {
- this.sVSize = this.changeAmount(this.sVSize)
- this.changeSort(this.sVSize, 'vsize')
- },
- sortUser() {
- this.sUser = this.changeAmount(this.sUser)
- this.changeSort(this.sUser, 'uname')
- },
- sortCmd() {
- this.sCmd = this.changeAmount(this.sCmd)
- this.changeSort(this.sCmd, 'cmd')
- },
- sortAmount(s) {
- switch (s) {
- case 1:
- return 'icon-sort-desc'
- case -1:
- return 'icon-sort-asc'
- default:
- return ''
- }
- },
- changeSort(column, header) {
- this.sort = column == 0 ? [] : ['--sort', column == 1 ? '-' + header : header]
- },
- changeAmount(column) {
- this.sPid = this.sMem = this.sRss = this.sVSize = this.sUser = this.sCmd = this.sCpu = 0
- return column == 1 ? -1 : (column == 0 ? 1 : 0)
- },
- endProcess() {
- if (this.selectedPid != 0) {
- var kill = spawnSync('kill', [this.selectedPid])
-
- if (kill.stderr.toString().indexOf('permitted') !== -1)
- showMessage(lang('permitted'), 'error')
- else
- logger.error('Process Kill', kill.stderr.toString())
- }
- this.selectedPid = 0
- }
- }
-}
\ No newline at end of file
diff --git a/src/components/process/ProcessesList.js b/src/components/process/ProcessesList.js
deleted file mode 100644
index 220f92a..0000000
--- a/src/components/process/ProcessesList.js
+++ /dev/null
@@ -1,38 +0,0 @@
-import {
- spawnSync
-} from 'child_process'
-import {
- formatBytes
-} from '../../utils/helpers'
-import fs from 'fs'
-
-export default (search = '', sort = []) => {
- search = search.toLowerCase()
-
- let ps = spawnSync('ps', ['ax', '-o', 'pid,rss,pmem,vsize,uname,pcpu,cmd', ...sort, '--no-headings'])
-
- if (ps.stderr.toString())
- logger.error('List Processes', ps.stderr.toString())
-
- if ( search )
- return ps.stdout.toString().split('\n')
- .filter(p => p.toLowerCase().indexOf(search) !== -1)
- .map(p => procParse(p.trim())).slice(0, -1)
- else
- return ps.stdout.toString().split('\n')
- .map(p => procParse(p.trim())).slice(0, -1)
-}
-
-function procParse(data) {
- let columns = data.split(/\s+/)
-
- return {
- pid: columns[0],
- rss: formatBytes(columns[1] * 1024),
- pmem: columns[2],
- vsize: formatBytes(columns[3] * 1024),
- uname: columns[4],
- pcpu: columns[5],
- cmd: columns.slice(6).join(' ')
- }
-}
\ No newline at end of file
diff --git a/src/components/resources/CpuHistory.js b/src/components/resources/CpuHistory.js
deleted file mode 100644
index f0838bc..0000000
--- a/src/components/resources/CpuHistory.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import si from 'systeminformation'
-import Chartkick from 'chartkick'
-
-export default {
- template: `
-
{{ lang('cpuHistory') }}
-
-
`,
- props: ['fheight'],
- data() {
- return ({
- cpuValues: [],
- cpuData: [],
- seconds: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
- ]
- })
- },
- mounted() {
- si.currentLoad(val => {
- let cpuCount = val.cpus.length
-
- for (var i = 0; i < cpuCount; i++)
- this.cpuValues.push([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- ])
-
- let cpuChart = new Chartkick.LineChart('cpus-chart', this.cpuData, {
- colors: ['#2ecc71', '#e74c3c', '#3498db', '#f1c40f', '#9b59b6', '#34495e',
- '#1abc9c', '#e67e22', '#46f0f0', '#f032e6', '#fabebe', '#008080',
- '#e6beff', '#aa6e28', '#d2f53c', '#800000', '#aaffc3', '#808000',
- '#000080', '#808080'],
- legend: true,
- min: 0,
- max: 100,
- points: false
- })
-
- setInterval(() => {
- si.currentLoad(val => {
- this.cpuValues.forEach((cpu, i) => this.cpuValues[i].splice(0, 1))
- this.cpuValues.forEach((cpu, i) => this.cpuValues[i].push(val.cpus[i].load.toFixed(1)))
-
- this.cpuData = []
-
- this.cpuValues.forEach((cpu, i) => {
- let name = 'CPU' + (i + 1) + ' ' + val.cpus[i].load.toFixed(1) + '%'
- this.cpuData.push({
- name: name,
- data: this.cpuValues[i].map((d, i) => [this.seconds[i], d])
- })
- })
-
- cpuChart.updateData(this.cpuData)
- })
- }, 1000)
- })
- }
-}
diff --git a/src/components/resources/MemoryHistory.js b/src/components/resources/MemoryHistory.js
deleted file mode 100644
index b8ce3ac..0000000
--- a/src/components/resources/MemoryHistory.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import helpers from '../../utils/helpers'
-import si from 'systeminformation'
-import Chartkick from 'chartkick'
-
-export default {
- template: `
-
{{ lang('memHistory') }}
-
-
`,
- props: ['fheight'],
- data() {
- return ({
- memoryValues: [],
- memoryData: [],
- seconds: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
- ]
- })
- },
- mounted() {
- si.mem(ram => {
- let totalMem = helpers.prettyMemSize(ram.total)
- let totalSwap = helpers.prettyMemSize(ram.swaptotal)
-
- for (var i = 0; i < 2; i++)
- this.memoryValues.push([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- ])
-
- let memoryChart = new Chartkick.LineChart('memory-chart', this.memoryData, {
- colors: ['#2ecc71', '#e74c3c', '#3498db', '#f1c40f', '#9b59b6', '#34495e', '#1abc9c', '#e67e22'],
- min: 0,
- max: Math.max(totalMem, totalSwap),
- legend: true,
- points: false
- })
-
- setInterval(() => {
- si.mem(ram => {
- let usedMem = helpers.prettyMemSize(ram.total - ram.available)
- let usedSwap = helpers.prettyMemSize(ram.swapused)
-
- this.memoryValues.forEach((m, i) => this.memoryValues[i].splice(0, 1))
-
- this.memoryValues[0].push(usedMem)
- this.memoryValues[1].push(usedSwap)
-
- this.memoryData = []
-
- this.memoryData.push({
- name: lang('memory'),
- data: this.memoryValues[0].map((d, i) => [this.seconds[i], d])
- })
-
- this.memoryData.push({
- name: lang('swap').toString().toUpperCase(),
- data: this.memoryValues[1].map((d, i) => [this.seconds[i], d])
- })
-
- memoryChart.updateData(this.memoryData)
- })
- }, 1000)
- })
- }
-}
\ No newline at end of file
diff --git a/src/components/resources/NetworkHistory.js b/src/components/resources/NetworkHistory.js
deleted file mode 100644
index a7c715d..0000000
--- a/src/components/resources/NetworkHistory.js
+++ /dev/null
@@ -1,62 +0,0 @@
-import helpers from '../../utils/helpers'
-import si from 'systeminformation'
-import Chartkick from 'chartkick'
-
-export default {
- template: `
-
{{ lang('networkHistory') }}
-
-
`,
- props: ['fheight'],
- data() {
- return ({
- networkValues: [],
- networkData: [],
- seconds: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
- ]
- })
- },
- mounted() {
- si.networkInterfaceDefault(defaultNetwork => {
-
- for (var i = 0; i < 2; i++)
- this.networkValues.push([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- ])
-
- let networkChart = new Chartkick.LineChart('network-chart', this.networkData, {
- colors: ['#2ecc71', '#e74c3c', '#3498db', '#f1c40f', '#9b59b6', '#34495e', '#1abc9c', '#e67e22'],
- legend: true,
- min: 0,
- points: false
- })
-
- setInterval(() => {
- si.networkStats(defaultNetwork, data => {
- let downSpeed = Math.abs(data.rx_sec / 1024).toFixed(2) || 0.00
- let upSpeed = Math.abs(data.tx_sec / 1024).toFixed(2) || 0.00
-
- this.networkValues.forEach((n, i) => this.networkValues[i].splice(0, 1))
-
- this.networkValues[0].push(downSpeed > 0 ? downSpeed : 0)
- this.networkValues[1].push(upSpeed > 0 ? upSpeed : 0)
-
- this.networkData = []
-
- this.networkData.push({
- name: lang('download'),
- data: this.networkValues[0].map((d, i) => [this.seconds[i], d])
- })
-
- this.networkData.push({
- name: lang('upload'),
- data: this.networkValues[1].map((d, i) => [this.seconds[i], d])
- })
-
- networkChart.updateData(this.networkData)
- })
- }, 1000)
- })
- }
-}
\ No newline at end of file
diff --git a/src/components/resources/Resources.js b/src/components/resources/Resources.js
deleted file mode 100644
index f3a0211..0000000
--- a/src/components/resources/Resources.js
+++ /dev/null
@@ -1,50 +0,0 @@
-import 'chart.js'
-Chart.defaults.global.defaultFontColor = '#aaa'
-Chart.defaults.global.defaultFontFamily = 'Ubuntu'
-// Components
-import CpuHistory from './CpuHistory'
-import MemoryHistory from './MemoryHistory'
-import NetworkHistory from './NetworkHistory'
-
-export default {
- template: `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- `,
- components: {
- 'cpu-history': CpuHistory,
- 'memory-history': MemoryHistory,
- 'network-history': NetworkHistory
- },
- data() {
- return ({
- fitChart: 0,
- fitHeight: '125px',
- isFit: false
- })
- },
- methods: {
- fit(val) {
- if (this.fitChart == val) {
- this.fitChart = 0
- this.isFit = false
- } else {
- this.fitChart = val
- this.isFit = true
- }
- this.fitHeight = this.fitChart == 0 ? '125px' : '500px'
- }
- }
-}
\ No newline at end of file
diff --git a/src/components/services/Service.js b/src/components/services/Service.js
deleted file mode 100644
index f746896..0000000
--- a/src/components/services/Service.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import {
- command,
- showMessage
-} from '../../utils/helpers'
-import sudo from 'sudo-prompt'
-
-export default {
- template: `
- {{ name }}
-
-
- `,
- props: ['name', 'is-run'],
- data() {
- return ({
- isBusy: false
- })
- },
- methods: {
- statusChange(e) {
- let serviceName = e.target.id.substr(2)
- let isChecked = e.target.checked
- let status = isChecked ? 'start' : 'stop'
-
- if (!this.isBusy) {
- this.isBusy = true
- sudo.exec(command(`systemctl ${status} ${serviceName}`), {
- name: 'Stacer'
- },
- (error, stdout, stderr) => {
- if (stderr) {
- e.target.checked = ! isChecked
- showMessage(lang('opFail'), 'error')
- logger.error('Service Status Change', stderr)
- } else {
- showMessage(serviceName + lang('service').toLowerCase() + status + (e.target.checked ? 'ed' : 'ped'), 'success')
- }
-
- this.isBusy = false
- })
- } else {
- showMessage(lang('anotherProc'), 'error')
- e.target.checked = ! isChecked
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/components/services/Services.js b/src/components/services/Services.js
deleted file mode 100644
index d7074ed..0000000
--- a/src/components/services/Services.js
+++ /dev/null
@@ -1,70 +0,0 @@
-import {
- spawnSync
-} from 'child_process'
-import {
- command,
- showMessage
-} from '../../utils/helpers'
-import si from 'systeminformation'
-// components
-import Service from './Service'
-
-export default {
- template: `
-
-
-
-
-
{{ lang('serviceTitle') }} ({{ filteredServices.length }})
-
-
-
-
- {{ lang('noService') }}
-
-
-
- `,
- components: {
- 'service': Service
- },
- data() {
- return ({
- servicesList: [],
- searchString: ''
- })
- },
- created() {
- const services = spawnSync('bash', ['-c', localStorage.getAllService])
-
- let serviceNames = services.stdout.toString().trim().split('\n')
-
- serviceNames.forEach(serviceName => {
- const isActive = spawnSync('systemctl', ['is-active', serviceName]).stdout.toString().trim()
-
- let checked = isActive === 'active' ? 'checked' : ''
-
- this.servicesList.push({
- name: serviceName,
- isRun: checked
- })
- })
- },
- computed: {
- // Search services
- filteredServices() {
- let tempServicesList = this.servicesList,
- searchString = this.searchString
-
- if (!searchString) return tempServicesList
-
- searchString = searchString.toString().trim().toLowerCase()
-
- return tempServicesList.filter(item =>
- item.name.toString().trim().toLowerCase().indexOf(searchString) !== -1
- )
- }
- }
-}
\ No newline at end of file
diff --git a/src/components/settings/Settings.js b/src/components/settings/Settings.js
deleted file mode 100644
index d98e629..0000000
--- a/src/components/settings/Settings.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import LanguageList from '../../languages/lang-list'
-import ThemeList from './theme-list'
-import { showMessage } from '../../utils/helpers'
-
-export default {
- template: `
-
-
-
- {{ lang('appLanguage') }}
-
- {{v}}
-
-
-
- {{ lang('appTheme') }}
-
- {{v}}
-
-
-
- `,
- data() {
- return({
- langList: LanguageList,
- selectedLang: '',
-
- themeList: ThemeList,
- selectedTheme: ''
- })
- },
- created() {
- this.selectedLang = localStorage.getItem('appLanguage') || 'en'
- this.selectedTheme = localStorage.getItem('appTheme') || 'dark'
- },
- methods: {
- langChange() {
- localStorage.setItem('appLanguage', this.selectedLang)
- showMessage(lang('changedLang'), 'warning')
- },
- themeChange() {
- localStorage.setItem('appTheme', this.selectedTheme)
- document.body.classList = [this.selectedTheme]
- }
- }
-}
diff --git a/src/components/settings/theme-list.js b/src/components/settings/theme-list.js
deleted file mode 100644
index 823159e..0000000
--- a/src/components/settings/theme-list.js
+++ /dev/null
@@ -1,4 +0,0 @@
-export default {
- "dark": "Dark",
- "light": "Light"
-}
\ No newline at end of file
diff --git a/src/components/startup-apps/STApp.js b/src/components/startup-apps/STApp.js
deleted file mode 100644
index ceceea3..0000000
--- a/src/components/startup-apps/STApp.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import fs from 'fs'
-import {
- showMessage
-} from '../../utils/helpers'
-
-export default {
- template: `
- {{ name }}
-
-
-
-
- `,
- props: ['name', 'file', 'is-start'],
- methods: {
- removeApp(e) {
- fs.unlinkSync(localStorage.autostartApps + e.target.name)
- },
- editApp(){
- //Emit an event to startupApps
- this.$emit('edit',this.name)
- },
- statusChange(e) {
- let fileName = e.target.id
- let isStart = e.target.checked
-
- try {
- let data = fs.readFileSync(localStorage.autostartApps + '/' + fileName).toString()
- let check = data.match(/\X-GNOME-Autostart-enabled=.*/g)
-
- if (check)
- data = data.replace(/\X-GNOME-Autostart-enabled=.*/gi, 'X-GNOME-Autostart-enabled=' + isStart)
- else
- data += ('X-GNOME-Autostart-enabled=' + isStart + '\n')
-
- fs.writeFileSync(localStorage.autostartApps + '/' + fileName, data)
- } catch (err) {
- logger.error('StartupApps Status Change', stderr)
- showMessage(lang('opFail'), 'error')
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/components/startup-apps/StartupApps.js b/src/components/startup-apps/StartupApps.js
deleted file mode 100644
index f3e0697..0000000
--- a/src/components/startup-apps/StartupApps.js
+++ /dev/null
@@ -1,139 +0,0 @@
-import {
- showMessage
-} from '../../utils/helpers'
-import properties from 'properties-reader'
-import chokidar from 'chokidar'
-import fs from 'fs'
-import STApp from './STApp'
-
-export default {
- template: `
-
-
-
-
{{ lang('startupTitle') }} ({{ apps.length }})
-
-
- {{ lang('noStartup') }}
-
-
-
{{ lang('addStartup') }}
-
-
-
- `,
-
- components: {
- 'app': STApp
- },
- data() {
- return ({
- apps: [],
- showPrompt: false,
- appName: '',
- appComment: '',
- appExec: '',
- modeEdit:false
- })
- },
- created() {
- this.getApps()
-
- chokidar.watch(localStorage.autostartApps, {
- persistent: true,
- ignoreInitial: true
- })
- .on('add', path => this.getApps())
- .on('unlink', path => this.getApps())
- .on('change', path => this.getApps())
- },
- methods: {
- saveApp() {
- if (this.appName && this.appComment && this.appExec) {
- let desktopFile = `[Desktop Entry]
- \rName=${this.appName}
- \rExec=${this.appExec}
- \rComment=${this.appComment}
- \rType=Application
- \rTerminal=false
- \rX-GNOME-Autostart-enabled=true`
- try {
- if (!fs.existsSync(localStorage.autostartApps)) {
- fs.mkdirSync(localStorage.autostartApps)
- }
- fs.writeFileSync(localStorage.autostartApps + this.appName + '.desktop', desktopFile)
- } catch (err) {
- logger.error('StartupApps Save App', err)
- showMessage('Operation not successfully', 'error')
- } finally {
- this.cancelPrompt()
- }
- } else {
- showMessage('Do not leave required fields blank.', 'error')
- }
- },
- cancelPrompt() {
- this.showPrompt = false
- this.appName = this.appComment = this.appExec = ''
- this.modeEdit= false
- },
- getApps() {
- fs.readdir(localStorage.autostartApps, (err, files) => {
- if (!err) {
- this.apps.splice(0, this.apps.length) // array clear
- files.filter(file => file.endsWith('.desktop')).forEach(file => {
- try {
- var entry = properties(localStorage.autostartApps + '/' + file)
- if (entry.get('Desktop Entry.Name') != null) {
- let appName = entry.get('Desktop Entry.Name')
- let isStart = entry.get('Desktop Entry.X-GNOME-Autostart-enabled')
- let appComment = entry.get('Desktop Entry.Comment')
- let appExec = entry.get('Desktop Entry.Exec')
-
- if (appName != null) {
- this.apps.push({
- name: appName,
- Exec:appExec,
- comment:appComment,
- file: file,
- isStart: (isStart != null ? isStart : true)
- })
- }
- }
- } catch (error) {
- logger.error('StartupApps Get Apps', error)
- }
- })
- } else {
- logger.error('StartupApps Read Directory', err)
- }
- })
- },
-
- editApp(name){
- this.modeEdit = true
- for(let app of this.apps){
- if(app.name == name){
- this.appName = app.name
- this.appExec = app.Exec
- this.appComment = app.comment
- this.showPrompt = true
- break;
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/components/system-cleaner/SidebarItem.js b/src/components/system-cleaner/SidebarItem.js
deleted file mode 100644
index 3a21572..0000000
--- a/src/components/system-cleaner/SidebarItem.js
+++ /dev/null
@@ -1,10 +0,0 @@
-export default {
- template: `
-
-
-
- {{text}} ({{length}})
-
- `,
- props: ['length', 'text']
-}
\ No newline at end of file
diff --git a/src/components/system-cleaner/SystemCleaner.js b/src/components/system-cleaner/SystemCleaner.js
deleted file mode 100644
index ffd9009..0000000
--- a/src/components/system-cleaner/SystemCleaner.js
+++ /dev/null
@@ -1,285 +0,0 @@
-import {
- spawn
-} from 'child_process'
-
-import {
- command,
- showMessage,
- formatBytes
-} from '../../utils/helpers'
-import fs from 'fs'
-import sudo from 'sudo-prompt'
-// Components
-import SidebarItem from './SidebarItem'
-import TableTitle from './TableTitle'
-import TableItems from './TableItems'
-
-export default {
- template: `
-
-
- `,
- components: {
- 'sidebar-item': SidebarItem,
- 'table-title': TableTitle,
- 'table-items': TableItems
- },
- data() {
- return {
- pkgCacheSelect: false,
- crashReportsSelect: false,
- systemLogsSelect: false,
- appCacheSelect: false,
- trashSelect: false,
-
- pkgCachesList: [],
- crashReportsList: [],
- systemLogsList: [],
- appCachesList: [],
-
- checkedPkgCaches: [],
- checkedCrashReports: [],
- checkedSystemLogs: [],
- checkedAppCaches: [],
-
- trashSize: '0 Bytes'
- }
- },
- methods: {
- systemScan() {
- // Lists cleaning
- this.pkgCachesList = []
- this.crashReportsList = []
- this.systemLogsList = []
- this.appCachesList = []
- this.trashSize = '0 Bytes'
-
- if (this.pkgCacheSelect) {
- fs.readdir(localStorage.pkgCachePath, 'utf8', (err, files) => {
- if (!err)
- files.filter(file => file)
- .forEach(file => {
- let stat = fs.statSync(localStorage.pkgCachePath + file)
- if (stat.isFile())
- this.pkgCachesList.push(file)
- })
- else
- logger.error('System Cleaner Get Package Caches', err)
- })
- } else {
- this.checkedPkgCaches = []
- }
-
- if (this.crashReportsSelect) {
- fs.readdir(localStorage.crashReportsPath, 'utf8', (err, files) => {
- if (!err)
- files.forEach(file => this.crashReportsList.push(file))
- else
- logger.error('System Cleaner Get Crash Reports', err)
- })
- } else {
- this.checkedCrashReports = []
- }
-
- if (this.systemLogsSelect) {
- fs.readdir(localStorage.systemLogsPath, 'utf8', (err, files) => {
- if (!err)
- files.forEach(file => this.systemLogsList.push(file))
- else
- logger.error('System Cleaner Get System Logs', err)
- })
- } else {
- this.checkedSystemLogs = []
- }
-
- if (this.appCacheSelect) {
- fs.readdir(localStorage.appCachePath, 'utf8', (err, files) => {
- if (!err)
- files.forEach(file => this.appCachesList.push(file))
- else
- logger.error('System Cleaner Get App Caches', err)
- })
- } else {
- this.checkedAppCaches = []
- }
-
- if (this.trashSelect) {
- function getSize(path = '') {
- path += '/'
- let totalSize = 0
- try {
- let trashFiles = fs.readdirSync(localStorage.trashPath + path)
- trashFiles.forEach(fileName => {
-
- let stats = fs.statSync(localStorage.trashPath + path + fileName)
- if (!stats.isDirectory())
- totalSize += stats.size
- else
- totalSize += getSize(path + fileName)
- })
- } catch (err) {
- logger.error('System Cleaner Get Trash Size', err)
- }
- return totalSize
- }
-
- if (fs.existsSync(localStorage.trashPath))
- this.trashSize = formatBytes(getSize(), 0)
- }
- },
- // System clean
- systemClean() {
- let filesToRemove = ''
-
- if (this.checkedPkgCaches) {
- this.checkedPkgCaches.forEach(file => {
- filesToRemove += `rm -rf ${localStorage.pkgCachePath}${file}; `
- })
- }
-
- if (this.checkedCrashReports) {
- this.checkedCrashReports.forEach(file => {
- filesToRemove += `rm -rf ${localStorage.crashReportsPath}${file}; `
- })
- }
-
- if (this.checkedSystemLogs) {
- this.checkedSystemLogs.forEach(file => {
- filesToRemove += `rm -rf ${localStorage.systemLogsPath}${file}; `
- })
- }
-
- if (this.checkedAppCaches) {
- this.checkedAppCaches.forEach(file => {
- filesToRemove += `rm -rf ${localStorage.appCachePath}${file}; `
- })
- }
-
- if (this.trashSelect) {
- filesToRemove += `rm -rf ${localStorage.trashPath};`
- filesToRemove += `rm -rf ${localStorage.trashInfoPath};`
- }
-
- if (filesToRemove) {
- sudo.exec(command(filesToRemove), {
- name: 'Stacer'
- },
- (error, stdout, stderr) => {
- if (stderr) {
- showMessage(lang('sysCleanFail'), 'error')
- logger.error('System Cleaner Files Remove', err)
- }
- else {
- this.pkgCachesList = this.pkgCachesList.filter(item => this.checkedPkgCaches.indexOf(item) == -1)
- this.crashReportsList = this.crashReportsList.filter(item => this.checkedCrashReports.indexOf(item) == -1)
- this.systemLogsList = this.systemLogsList.filter(item => this.checkedSystemLogs.indexOf(item) == -1)
- this.appCachesList = this.appCachesList.filter(item => this.checkedAppCaches.indexOf(item) == -1)
-
- this.checkedPkgCaches = []
- this.checkedCrashReports = []
- this.checkedSystemLogs = []
- this.checkedAppCaches = []
- this.trashSize = '0 Bytes'
-
- showMessage(lang('sysCleanSuc'), 'success')
- }
- })
- }
- },
- // Check all items
- checkAllPkgCaches(e) {
- this.checkedPkgCaches = []
- if (e.target.checked)
- this.checkedPkgCaches.push(...this.pkgCachesList)
- },
- checkAllCrashReports(e) {
- this.checkedCrashReports = []
- if (e.target.checked)
- this.checkedCrashReports.push(...this.crashReportsList)
- },
- checkAllSystemLogs(e) {
- this.checkedSystemLogs = []
- if (e.target.checked)
- this.checkedSystemLogs.push(...this.systemLogsList)
- },
- checkAllAppCaches(e) {
- this.checkedAppCaches = []
- if (e.target.checked)
- this.checkedAppCaches.push(...this.appCachesList)
- }
- },
- watch: {
- appCacheSelect: checked => {
- if (checked)
- showMessage(lang('appCacheWarning'), 'warning')
- }
- }
-}
\ No newline at end of file
diff --git a/src/components/system-cleaner/TableItems.js b/src/components/system-cleaner/TableItems.js
deleted file mode 100644
index a59f162..0000000
--- a/src/components/system-cleaner/TableItems.js
+++ /dev/null
@@ -1,10 +0,0 @@
-export default {
- template: `
`,
- props: ['text']
-}
\ No newline at end of file
diff --git a/src/components/system-cleaner/TableTitle.js b/src/components/system-cleaner/TableTitle.js
deleted file mode 100644
index 7776e9a..0000000
--- a/src/components/system-cleaner/TableTitle.js
+++ /dev/null
@@ -1,10 +0,0 @@
-export default {
- template: `
`,
- props: ['length', 'text']
-}
\ No newline at end of file
diff --git a/src/components/uninstaller/Uninstaller.js b/src/components/uninstaller/Uninstaller.js
deleted file mode 100644
index be11997..0000000
--- a/src/components/uninstaller/Uninstaller.js
+++ /dev/null
@@ -1,104 +0,0 @@
-import {
- spawnSync
-} from 'child_process'
-import sudo from 'sudo-prompt'
-
-import {
- command,
- showMessage
-} from '../../utils/helpers'
-
-export default {
- template: `
`,
- data() {
- return ({
- packagesList: [],
- selectedPackages: [],
- searchString: '',
- isBusy: false
- })
- },
- created() {
- const packages = spawnSync('bash', ['-c', localStorage.getInstalledPackages])
-
- if (packages.stderr)
- logger.error('Uninstaller Get Packages', packages.stderr.toString())
-
- let data = packages.stdout.toString().split('\n').filter(s => s != '')
- this.packagesList.push(...data)
- },
- methods: {
- uninstallSelected() {
- if (this.selectedPackages) {
- if (!this.isBusy) {
- this.isBusy = true
-
- let sPackages = this.selectedPackages.join(' ')
-
- sudo.exec(command(localStorage.removePackage + sPackages), {
- name: 'Stacer'
- },
- (error, stdout, stderr) => {
- if (stderr) {
- logger.error('Uninstaller Uninstall Selected', stderr)
- showMessage(lang('uninstallFail'), 'error')
- } else {
- this.packagesList = this.packagesList
- .filter(p => this.selectedPackages.indexOf(p) === -1)
-
- showMessage(sPackages.split(' ').join('
') + lang('packageUninstalled'), 'success')
- this.searchString = ''
- }
- this.isBusy = false
- this.selectedPackages = []
- })
- } else {
- showMessage(lang('anotherProc'), 'error')
- }
- }
- }
- },
- computed: {
- filteredPackages() {
- let tempPackagesList = this.packagesList,
- searchString = this.searchString
-
- if (!searchString) return tempPackagesList
-
- searchString = searchString.toString().trim().toLowerCase()
-
- return tempPackagesList.filter(item =>
- item.trim().toLowerCase().indexOf(searchString) !== -1
- )
- }
- }
-}
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
deleted file mode 100755
index f211e8f..0000000
--- a/src/index.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import App from './components/App'
-import Language from './languages/Language'
-import config from './utils/config'
-import winston from 'winston'
-
-const userData = require('electron').remote.app.getPath('userData')
-
-window.vm = new Vue({
- el: 'app',
- components: {
- 'app': App
- },
- beforeCreate() {
- // Set configs
- config()
- // Check Language
- let appLanguage = localStorage.appLanguage || 'en'
- let language = new Language(appLanguage)
- window.lang = (key) => language.get(key)
- // Check Theme
- let appTheme = localStorage.appTheme || 'dark'
- document.body.classList = [appTheme]
-
- // Logger settings
- window.logger = new(winston.Logger)({
- transports: [
- new(winston.transports.File)({
- filename: userData + '/stacer.log'
- })
- ]
- })
- },
- mounted() {
- setTimeout(() => document.getElementById('loading').remove(), 2500)
- }
-})
\ No newline at end of file
diff --git a/src/languages/Language.js b/src/languages/Language.js
deleted file mode 100644
index 0260ab1..0000000
--- a/src/languages/Language.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import langList from './lang-list'
-export default class Language {
-
- constructor(lang) {
- if (Object.keys(langList).indexOf(lang) !== -1) {
- this.lang = require(`./langs/lang.${lang}`)
- } else {
- this.lang = require('./langs/lang.en')
- }
- }
-
- get(key) {
- return this.lang.default[key]
- }
-}
\ No newline at end of file
diff --git a/src/languages/lang-list.js b/src/languages/lang-list.js
deleted file mode 100644
index 56b213a..0000000
--- a/src/languages/lang-list.js
+++ /dev/null
@@ -1,22 +0,0 @@
-export default {
- "ar": "العربية",
- "ca-es": "Catalan",
- "cs": "Czech",
- "de": "Deutsch (German)",
- "en": "English",
- "es": "Spanish",
- "fa": "Persian",
- "fr": "French",
- "hu": "Hungarian",
- "it": "Italiano",
- "kan": "Kannada",
- "oc": "Occitan",
- "pl": "Polish",
- "pt": "Portuguese",
- "ru": "Russian",
- "sv": "Swedish",
- "tr": "Turkish",
- "uk": "Ukrainian",
- "zh-cn": "Chinese Simplified",
- "zh-tw": "Traditional Chinese",
-}
diff --git a/src/languages/lang.de.js b/src/languages/lang.de.js
deleted file mode 100644
index 54cb636..0000000
--- a/src/languages/lang.de.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- Adrian Feld