From 908493179dbab16519e2871f675525be333ab6dd Mon Sep 17 00:00:00 2001 From: Oguzhan Inan Date: Thu, 23 Mar 2017 00:45:29 +0300 Subject: [PATCH] update dist --- .gitignore | 3 +- dist/components/App.js | 44 -------- dist/components/CpuBar.js | 48 -------- dist/components/Dashboard.js | 82 -------------- dist/components/DiskBar.js | 70 ------------ dist/components/DownBar.js | 56 ---------- dist/components/MemoryBar.js | 62 ----------- dist/components/Services.js | 89 --------------- dist/components/StartupApps.js | 127 --------------------- dist/components/SystemCleaner.js | 186 ------------------------------- dist/components/SystemInfo.js | 35 ------ dist/components/Uninstaller.js | 90 --------------- dist/components/UpBar.js | 56 ---------- 13 files changed, 1 insertion(+), 947 deletions(-) delete mode 100644 dist/components/App.js delete mode 100644 dist/components/CpuBar.js delete mode 100644 dist/components/Dashboard.js delete mode 100644 dist/components/DiskBar.js delete mode 100644 dist/components/DownBar.js delete mode 100644 dist/components/MemoryBar.js delete mode 100644 dist/components/Services.js delete mode 100644 dist/components/StartupApps.js delete mode 100644 dist/components/SystemCleaner.js delete mode 100644 dist/components/SystemInfo.js delete mode 100644 dist/components/Uninstaller.js delete mode 100644 dist/components/UpBar.js diff --git a/.gitignore b/.gitignore index 983d83e6..e0b8b1bc 100755 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,4 @@ node_modules/ release-builds/ dest/ dist/*.js -dist/components/*.js -dist/utils/*.js \ No newline at end of file +dist/**/*.js \ No newline at end of file diff --git a/dist/components/App.js b/dist/components/App.js deleted file mode 100644 index e3fc3d12..00000000 --- a/dist/components/App.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Dashboard = require('./Dashboard'); - -var _Dashboard2 = _interopRequireDefault(_Dashboard); - -var _StartupApps = require('./StartupApps'); - -var _StartupApps2 = _interopRequireDefault(_StartupApps); - -var _Services = require('./Services'); - -var _Services2 = _interopRequireDefault(_Services); - -var _Uninstaller = require('./Uninstaller'); - -var _Uninstaller2 = _interopRequireDefault(_Uninstaller); - -var _SystemCleaner = require('./SystemCleaner'); - -var _SystemCleaner2 = _interopRequireDefault(_SystemCleaner); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - template: '
\n\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t
\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t Loading... \n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
', - data: function data() { - return { - activeNav: 1 - }; - }, - - components: { - 'dashboard': _Dashboard2.default, - 'system-cleaner': _SystemCleaner2.default, - 'startup-apps': _StartupApps2.default, - 'services': _Services2.default, - 'uninstaller': _Uninstaller2.default - } -}; \ No newline at end of file diff --git a/dist/components/CpuBar.js b/dist/components/CpuBar.js deleted file mode 100644 index 795de176..00000000 --- a/dist/components/CpuBar.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _systeminformation = require('systeminformation'); - -var _systeminformation2 = _interopRequireDefault(_systeminformation); - -var _progressbar = require('progressbar.js'); - -var _config = require('../utils/config'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - template: '
CPU
', - mounted: function mounted() { - var cpuBar = new _progressbar.SemiCircle('#cpu-cont', { - strokeWidth: 12, - color: _config.prop.cpuBarColor, - trailColor: _config.prop.trailColor, - easing: 'easeInOut', - duration: _config.prop.cpuDuration, - svgStyle: { - marginTop: '10px' - }, - text: { - style: { - color: '#fff', - paddingBottom: '20px', - position: 'absolute', - left: '50%' - } - }, - step: function step(state, bar) { - bar.setText(Math.round(bar.value() * 100) + "%"); - } - }); - - setInterval(function () { - _systeminformation2.default.currentLoad(function (val) { - cpuBar.animate(val.currentload / 100); - }); - }, _config.prop.cpuDuration); - } -}; \ No newline at end of file diff --git a/dist/components/Dashboard.js b/dist/components/Dashboard.js deleted file mode 100644 index 4f2833ff..00000000 --- a/dist/components/Dashboard.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _systeminformation = require('systeminformation'); - -var _systeminformation2 = _interopRequireDefault(_systeminformation); - -var _progressbar = require('progressbar.js'); - -var _electron = require('electron'); - -var _config = require('../utils/config'); - -var _helpers = require('../utils/helpers'); - -var _helpers2 = _interopRequireDefault(_helpers); - -var _SystemInfo = require('./SystemInfo'); - -var _SystemInfo2 = _interopRequireDefault(_SystemInfo); - -var _UpBar = require('./UpBar'); - -var _UpBar2 = _interopRequireDefault(_UpBar); - -var _DownBar = require('./DownBar'); - -var _DownBar2 = _interopRequireDefault(_DownBar); - -var _CpuBar = require('./CpuBar'); - -var _CpuBar2 = _interopRequireDefault(_CpuBar); - -var _MemoryBar = require('./MemoryBar'); - -var _MemoryBar2 = _interopRequireDefault(_MemoryBar); - -var _DiskBar = require('./DiskBar'); - -var _DiskBar2 = _interopRequireDefault(_DiskBar); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - template: '
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tThere are updates currently available.\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
', - data: function data() { - return { - update_check: false - }; - }, - - components: { - 'system-info': _SystemInfo2.default, - 'up-bar': _UpBar2.default, - 'down-bar': _DownBar2.default, - 'cpu-bar': _CpuBar2.default, - 'memory-bar': _MemoryBar2.default, - 'disk-bar': _DiskBar2.default - }, - methods: { - download_update: function download_update() { - _electron.shell.openExternal('https://github.com/oguzhaninan/Stacer/releases/latest'); - } - }, - created: function created() { - var _this = this; - - try { - $.getJSON('https://api.github.com/repos/oguzhaninan/Stacer/releases/latest', function (data) { - var currentVersion = require('../../package.json').version.toString(); - var releaseVersion = data.tag_name.substr(1).toString(); - - _this.update_check = currentVersion != releaseVersion; - }); - } catch (error) { - console.log(error); - } - } -}; \ No newline at end of file diff --git a/dist/components/DiskBar.js b/dist/components/DiskBar.js deleted file mode 100644 index 02c0972a..00000000 --- a/dist/components/DiskBar.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _systeminformation = require('systeminformation'); - -var _systeminformation2 = _interopRequireDefault(_systeminformation); - -var _progressbar = require('progressbar.js'); - -var _config = require('../utils/config'); - -var _helpers = require('../utils/helpers'); - -var _helpers2 = _interopRequireDefault(_helpers); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - template: '
DISK
', - data: function data() { - return { - dUsed: 0, - dTotal: 0, - diskBar: null - }; - }, - mounted: function mounted() { - var _this = this; - - this.diskBar = new _progressbar.SemiCircle('#disk-cont', { - strokeWidth: 12, - color: _config.prop.diskBarColor, - trailColor: _config.prop.trailColor, - easing: 'easeInOut', - duration: _config.prop.diskDuration, - svgStyle: { - marginTop: '10px' - }, - text: { - style: { - color: '#fff', - paddingBottom: '20px', - position: 'absolute', - left: '50%' - } - }, - step: function step(state, bar) { - bar.setText(_this.dUsed + ' / ' + _this.dTotal + 'GB'); - } - }); - - this.diskInfo(); - setInterval(this.diskInfo, _config.prop.diskDuration); - }, - - methods: { - diskInfo: function diskInfo() { - var _this2 = this; - - _systeminformation2.default.fsSize(function (disk) { - _this2.dUsed = _helpers2.default.prettyDiskSize(disk[0].used); - _this2.dTotal = _helpers2.default.prettyDiskSize(disk[0].size); - _this2.diskBar.animate(disk[0].use / 100); - }); - } - } -}; \ No newline at end of file diff --git a/dist/components/DownBar.js b/dist/components/DownBar.js deleted file mode 100644 index 45cd952f..00000000 --- a/dist/components/DownBar.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _systeminformation = require('systeminformation'); - -var _systeminformation2 = _interopRequireDefault(_systeminformation); - -var _progressbar = require('progressbar.js'); - -var _config = require('../utils/config'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - template: '
\n\t\t\t\t\tDOWNLOAD\n\t\t\t\t\t
\n\t\t\t\t
', - data: function data() { - return { - downSpeed: 0 - }; - }, - mounted: function mounted() { - var _this = this; - - var downBar = new _progressbar.Line('#down-bar', { - strokeWidth: 5, - easing: 'easeInOut', - duration: _config.prop.networkBarsDuration, - color: _config.prop.networkBarColor, - trailColor: _config.prop.trailColor, - text: { - style: { - color: '#999', - position: 'absolute', - right: '0', - marginTop: '5px' - } - }, - step: function step(state, bar) { - bar.setText(_this.downSpeed.toString() + ' kB/s'); - } - }); - - _systeminformation2.default.networkInterfaceDefault(function (defaultNetwork) { - setInterval(function () { - _systeminformation2.default.networkStats(defaultNetwork, function (data) { - _this.downSpeed = Math.abs(data.rx_sec / 1024).toFixed(2); - - downBar.animate(_this.downSpeed / 2000); - }); - }, _config.prop.networkBarsDuration); - }); - } -}; \ No newline at end of file diff --git a/dist/components/MemoryBar.js b/dist/components/MemoryBar.js deleted file mode 100644 index 94fa9c10..00000000 --- a/dist/components/MemoryBar.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _systeminformation = require('systeminformation'); - -var _systeminformation2 = _interopRequireDefault(_systeminformation); - -var _progressbar = require('progressbar.js'); - -var _config = require('../utils/config'); - -var _helpers = require('../utils/helpers'); - -var _helpers2 = _interopRequireDefault(_helpers); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - template: '
MEMORY
', - data: function data() { - return { - memInfo: 0 - }; - }, - mounted: function mounted() { - var _this = this; - - var memBar = new _progressbar.SemiCircle('#mem-cont', { - strokeWidth: 12, - color: _config.prop.memBarColor, - trailColor: _config.prop.trailColor, - easing: 'easeInOut', - duration: _config.prop.memDuration, - svgStyle: { - marginTop: '10px' - }, - text: { - style: { - color: '#fff', - paddingBottom: '20px', - position: 'absolute', - left: '50%' - } - }, - step: function step(state, bar) { - bar.setText(_this.memInfo); - } - }); - - setInterval(function () { - _systeminformation2.default.mem(function (ram) { - var usedMem = ram.total - ram.available; - var totalMem = ram.total; - _this.memInfo = _helpers2.default.prettyMemSize(usedMem) + ' / ' + _helpers2.default.prettyMemSize(totalMem) + 'GB'; - memBar.animate(usedMem / totalMem); - }); - }, _config.prop.memDuration); - } -}; \ No newline at end of file diff --git a/dist/components/Services.js b/dist/components/Services.js deleted file mode 100644 index 9fdd8485..00000000 --- a/dist/components/Services.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _child_process = require('child_process'); - -var _sudoPrompt = require('sudo-prompt'); - -var _sudoPrompt2 = _interopRequireDefault(_sudoPrompt); - -var _config = require('../utils/config'); - -var _helpers = require('../utils/helpers'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - template: '
\n\t\t\t\t
\n\t\t\t\t\tSystem Services ({{ filteredServices.length }})\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\tNo service found.\n\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t{{ service.name }}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
  • \n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
', - data: function data() { - return { - servicesList: [], - searchString: '', - isBusy: false - }; - }, - created: function created() { - var _this = this; - - var services = (0, _child_process.spawn)('bash', ['-c', _config.commands.getAllService]); - - services.stdout.on('data', function (data) { - data = data.toString().split('\n').filter(function (s) { - return s != ''; - }); - - data.forEach(function (service) { - var serviceName = service.substring(1); - var isRun = service.substring(0, 1) == '+' ? 'checked' : ''; - _this.servicesList.push({ - name: serviceName, - isRun: isRun - }); - }); - }); - }, - - methods: { - statusChange: function statusChange(e) { - var _this2 = this; - - var serviceName = e.target.id; - var status = e.target.checked ? 'start' : 'stop'; - - if (!this.isBusy) { - this.isBusy = true; - _sudoPrompt2.default.exec((0, _helpers.command)('service ' + serviceName + ' ' + status), { - name: 'Stacer' - }, function (error, stdout, stderr) { - if (stderr) { - e.target.checked = !status; - (0, _helpers.showMessage)('Operation not successful.', 'error'); - } else { - (0, _helpers.showMessage)(serviceName + ' service ' + status + (e.target.checked ? 'ed' : 'ped'), 'success'); - } - - _this2.isBusy = false; - }); - } else { - (0, _helpers.showMessage)('Another process continues.', 'error'); - } - } - }, - computed: { - filteredServices: function filteredServices() { - var tempServicesList = this.servicesList, - searchString = this.searchString; - - if (!searchString) return tempServicesList; - - searchString = searchString.toString().trim().toLowerCase(); - - return tempServicesList.filter(function (item) { - return item.name.toString().trim().toLowerCase().indexOf(searchString) !== -1; - }); - } - } -}; \ No newline at end of file diff --git a/dist/components/StartupApps.js b/dist/components/StartupApps.js deleted file mode 100644 index dff4616a..00000000 --- a/dist/components/StartupApps.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _config = require('../utils/config'); - -var _helpers = require('../utils/helpers'); - -var _chokidar = require('chokidar'); - -var _chokidar2 = _interopRequireDefault(_chokidar); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _propertiesReader = require('properties-reader'); - -var _propertiesReader2 = _interopRequireDefault(_propertiesReader); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - template: '
\n\t\t\t\t\t
\n\t\t\t\t\t\tSystem Startup Applications ({{apps.length}})\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tNo startup apps found.\n\t\t\t\t\t\t\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t{{ app.name }}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tApplication\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
', - data: function data() { - return { - apps: [], - showPrompt: false, - appName: '', - appComment: '', - appExec: '' - }; - }, - created: function created() { - var _this = this; - - this.getApps(); - - _chokidar2.default.watch(_config.commands.autostartApps, { - persistent: true, - ignoreInitial: true - }).on('add', function (path) { - return _this.getApps(); - }).on('unlink', function (path) { - return _this.getApps(); - }); - }, - - methods: { - removeApp: function removeApp(e) { - _fs2.default.unlinkSync(_config.commands.autostartApps + e.target.name); - }, - saveApp: function saveApp() { - if (this.appName && this.appComment && this.appExec) { - var desktopFile = '[Desktop Entry]\n\t\t\t\t\t\t\t\t\t\rName=' + this.appName + '\n\t\t\t\t\t\t\t\t\t\rExec=' + this.appExec + '\n\t\t\t\t\t\t\t\t\t\rComment=' + this.appComment + '\n\t\t\t\t\t\t\t\t\t\rType=ApplicationR\n\t\t\t\t\t\t\t\t\t\rTerminal=false\n\t\t\t\t\t\t\t\t\t\rX-GNOME-Autostart-enabled=true'; - - try { - _fs2.default.writeFileSync(_config.commands.autostartApps + this.appName + '.desktop', desktopFile); - } catch (err) {} finally { - this.cancelPrompt(); - } - } else { - (0, _helpers.showMessage)('Do not leave required fields blank.', 'error'); - } - }, - cancelPrompt: function cancelPrompt() { - this.showPrompt = false; - this.appName = this.appComment = this.appExec = ''; - }, - getApps: function getApps() { - var _this2 = this; - - try { - _fs2.default.readdir(_config.commands.autostartApps, function (err, files) { - if (!err) { - _this2.apps.splice(0, _this2.apps.length); - files.filter(function (file) { - return file.endsWith('.desktop'); - }).forEach(function (file) { - try { - var entry = (0, _propertiesReader2.default)(_config.commands.autostartApps + '/' + file); - - if (entry.get('Desktop Entry.Name') != null) { - var appName = entry.get('Desktop Entry.Name'); - var isStart = entry.get('Desktop Entry.X-GNOME-Autostart-enabled'); - - if (appName != null) { - _this2.apps.push({ - name: appName, - file: file, - isStart: isStart != null ? isStart : true - }); - } - } - } catch (err) {} - }); - } - }); - } catch (error) { - console.log(error); - } - }, - statusChange: function statusChange(e) { - var fileName = e.target.id; - var isStart = e.target.checked; - - try { - var data = _fs2.default.readFileSync(_config.commands.autostartApps + '/' + fileName).toString(); - var 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'; - } - - _fs2.default.writeFileSync(_config.commands.autostartApps + '/' + fileName, data); - } catch (err) { - console.log(err); - (0, _helpers.showMessage)('Operation failed.', 'error'); - } - } - } - -}; \ No newline at end of file diff --git a/dist/components/SystemCleaner.js b/dist/components/SystemCleaner.js deleted file mode 100644 index 8113a192..00000000 --- a/dist/components/SystemCleaner.js +++ /dev/null @@ -1,186 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _child_process = require('child_process'); - -var _sudoPrompt = require('sudo-prompt'); - -var _sudoPrompt2 = _interopRequireDefault(_sudoPrompt); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _config = require('../utils/config'); - -var _helpers = require('../utils/helpers'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -exports.default = { - template: '
\n\t\t\t\t
\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • \n\n\t\t\t\t\t\t
  • \n\n\t\t\t\t\t\t
  • \n\n\t\t\t\t\t\t
  • \n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
  • \n\n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
  • \n\n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
  • \n\n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
', - data: function data() { - return { - aptCacheSelect: false, - crashReportsSelect: false, - systemLogsSelect: false, - appCacheSelect: false, - - aptCachesList: [], - crashReportsList: [], - systemLogsList: [], - appCachesList: [], - - checkedAptCaches: [], - checkedCrashReports: [], - checkedSystemLogs: [], - checkedAppCaches: [] - }; - }, - - methods: { - systemScan: function systemScan() { - var _this = this; - - this.aptCachesList = []; - this.crashReportsList = []; - this.systemLogsList = []; - this.appCachesList = []; - - if (this.aptCacheSelect) { - _fs2.default.readdir(_config.commands.aptCachePath, 'utf8', function (err, files) { - if (!err) files.filter(function (file) { - return file.endsWith('.deb'); - }).forEach(function (file) { - return _this.aptCachesList.push(file); - });else console.log(err); - }); - } else { - this.checkedAptCaches = []; - } - - if (this.crashReportsSelect) { - _fs2.default.readdir(_config.commands.crashReportsPath, 'utf8', function (err, files) { - if (!err) files.forEach(function (file) { - return _this.crashReportsList.push(file); - });else console.log(err); - }); - } else { - this.checkedCrashReports = []; - } - - if (this.systemLogsSelect) { - _fs2.default.readdir(_config.commands.systemLogsPath, 'utf8', function (err, files) { - if (!err) files.forEach(function (file) { - return _this.systemLogsList.push(file); - });else console.log(err); - }); - } else { - this.checkedSystemLogs = []; - } - - if (this.appCacheSelect) { - _fs2.default.readdir(_config.commands.appCachePath, 'utf8', function (err, files) { - if (!err) files.forEach(function (file) { - return _this.appCachesList.push(file); - });else console.log(err); - }); - } else { - this.checkedAppCaches = []; - } - }, - systemClean: function systemClean() { - var _this2 = this; - - var filesToRemove = ''; - - if (this.checkedAptCaches) { - this.checkedAptCaches.forEach(function (file) { - filesToRemove += 'rm -rf ' + _config.commands.aptCachePath + file + '; '; - }); - } - - if (this.checkedCrashReports) { - this.checkedCrashReports.forEach(function (file) { - filesToRemove += 'rm -rf ' + _config.commands.crashReportsPath + file + '; '; - }); - } - - if (this.checkedSystemLogs) { - this.checkedSystemLogs.forEach(function (file) { - filesToRemove += 'rm -rf ' + _config.commands.systemLogsPath + file + '; '; - }); - } - - if (this.checkedAppCaches) { - this.checkedAppCaches.forEach(function (file) { - filesToRemove += 'rm -rf ' + _config.commands.appCachePath + file + '; '; - }); - } - - if (filesToRemove) { - _sudoPrompt2.default.exec((0, _helpers.command)(filesToRemove), { - name: 'Stacer' - }, function (error, stdout, stderr) { - if (stderr) (0, _helpers.showMessage)('System cleaning failed.', 'error');else { - _this2.aptCachesList = _this2.aptCachesList.filter(function (item) { - return _this2.checkedAptCaches.indexOf(item) == -1; - }); - _this2.crashReportsList = _this2.crashReportsList.filter(function (item) { - return _this2.checkedCrashReports.indexOf(item) == -1; - }); - _this2.systemLogsList = _this2.systemLogsList.filter(function (item) { - return _this2.checkedSystemLogs.indexOf(item) == -1; - }); - _this2.appCachesList = _this2.appCachesList.filter(function (item) { - return _this2.checkedAppCaches.indexOf(item) == -1; - }); - - _this2.checkedAptCaches = []; - _this2.checkedCrashReports = []; - _this2.checkedSystemLogs = []; - _this2.checkedAppCaches = []; - - (0, _helpers.showMessage)('System cleaned.', 'success'); - } - }); - } - }, - checkAllAptCaches: function checkAllAptCaches(e) { - var _checkedAptCaches; - - this.checkedAptCaches = []; - if (e.target.checked) (_checkedAptCaches = this.checkedAptCaches).push.apply(_checkedAptCaches, _toConsumableArray(this.aptCachesList)); - }, - checkAllCrashReports: function checkAllCrashReports(e) { - var _checkedCrashReports; - - this.checkedCrashReports = []; - if (e.target.checked) (_checkedCrashReports = this.checkedCrashReports).push.apply(_checkedCrashReports, _toConsumableArray(this.crashReportsList)); - }, - checkAllSystemLogs: function checkAllSystemLogs(e) { - var _checkedSystemLogs; - - this.checkedSystemLogs = []; - if (e.target.checked) (_checkedSystemLogs = this.checkedSystemLogs).push.apply(_checkedSystemLogs, _toConsumableArray(this.systemLogsList)); - }, - checkAllAppCaches: function checkAllAppCaches(e) { - var _checkedAppCaches; - - this.checkedAppCaches = []; - if (e.target.checked) (_checkedAppCaches = this.checkedAppCaches).push.apply(_checkedAppCaches, _toConsumableArray(this.appCachesList)); - } - }, - watch: { - appCacheSelect: function appCacheSelect(checked) { - if (checked) { - (0, _helpers.showMessage)('Deleting applications\' caches can cause problems. Please be careful.', 'warning'); - } - } - } -}; \ No newline at end of file diff --git a/dist/components/SystemInfo.js b/dist/components/SystemInfo.js deleted file mode 100644 index 03835ecf..00000000 --- a/dist/components/SystemInfo.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _systeminformation = require("systeminformation"); - -var _systeminformation2 = _interopRequireDefault(_systeminformation); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - template: "
SYSTEM INFO\n \n
", - data: function data() { - return { - information: [] - }; - }, - created: function created() { - var _this = this; - - _systeminformation2.default.osInfo(function (o) { - _this.information.push("Hostname: " + o.hostname); - _this.information.push("Platform: " + o.platform + " " + o.arch); - _this.information.push("Distribution: " + o.distro + " " + o.release); - _this.information.push("Kernel Release: " + o.kernel); - _systeminformation2.default.cpu(function (c) { - _this.information.push("Cpu Model: " + c.manufacturer + " " + c.brand); - _this.information.push("Cpu Speed: " + c.speed + "GHz"); - _this.information.push("Cpu Cores: " + c.cores); - }); - }); - } -}; \ No newline at end of file diff --git a/dist/components/Uninstaller.js b/dist/components/Uninstaller.js deleted file mode 100644 index 49b14080..00000000 --- a/dist/components/Uninstaller.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _child_process = require('child_process'); - -var _sudoPrompt = require('sudo-prompt'); - -var _sudoPrompt2 = _interopRequireDefault(_sudoPrompt); - -var _config = require('../utils/config'); - -var _helpers = require('../utils/helpers'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -exports.default = { - template: '
\n\t\t\t\t
\n\t\t\t\t\tSystem Installed Packages ({{ filteredPackages.length }})\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n \n\t\t\t\t\t\tNo package found.\n\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • {{ package }}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
  • \n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
', - data: function data() { - return { - packagesList: [], - searchString: '', - isBusy: false - }; - }, - created: function created() { - var _this = this; - - var packages = (0, _child_process.spawn)('bash', ['-c', _config.commands.getInstalledPackages]); - - packages.stdout.on('data', function (data) { - var _packagesList; - - _this.packagesList.splice(0, _this.packagesList.length); - data = data.toString().split('\n').filter(function (s) { - return s != ''; - }); - - (_packagesList = _this.packagesList).push.apply(_packagesList, _toConsumableArray(data)); - }); - }, - - methods: { - removePackage: function removePackage(e) { - var _this2 = this; - - if (!this.isBusy) { - this.isBusy = true; - e.target.className += 'loader'; - var packageName = e.target.name; - - _sudoPrompt2.default.exec((0, _helpers.command)(_config.commands.removePackage + packageName), { - name: 'Stacer' - }, function (error, stdout, stderr) { - if (stderr) { - e.target.className = ''; - (0, _helpers.showMessage)('Operation not successful.', 'error'); - } else { - _this2.searchString = e.target.className = ''; - var i = _this2.packagesList.indexOf(packageName); - if (i != -1) _this2.packagesList.splice(i, 1); - - (0, _helpers.showMessage)(packageName + ' package uninstalled.', 'success'); - } - _this2.isBusy = false; - }); - } else { - (0, _helpers.showMessage)('Another process continues.', 'error'); - } - } - }, - computed: { - filteredPackages: function filteredPackages() { - var tempPackagesList = this.packagesList, - searchString = this.searchString; - - if (!searchString) return tempPackagesList; - - searchString = searchString.toString().trim().toLowerCase(); - - return tempPackagesList.filter(function (item) { - return item.trim().toLowerCase().indexOf(searchString) !== -1; - }); - } - } -}; \ No newline at end of file diff --git a/dist/components/UpBar.js b/dist/components/UpBar.js deleted file mode 100644 index 0e0a3b72..00000000 --- a/dist/components/UpBar.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _systeminformation = require('systeminformation'); - -var _systeminformation2 = _interopRequireDefault(_systeminformation); - -var _progressbar = require('progressbar.js'); - -var _config = require('../utils/config'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - template: '
\n\t\t\t\t\tUPLOAD\n\t\t\t\t\t
\n\t\t\t\t
', - data: function data() { - return { - upSpeed: 0 - }; - }, - mounted: function mounted() { - var _this = this; - - var upBar = new _progressbar.Line('#up-bar', { - strokeWidth: 5, - easing: 'easeInOut', - duration: _config.prop.networkBarsDuration, - color: _config.prop.networkBarColor, - trailColor: _config.prop.trailColor, - text: { - style: { - color: '#999', - position: 'absolute', - right: '0', - marginTop: '5px' - } - }, - step: function step(state, bar) { - bar.setText(Math.abs(_this.upSpeed).toString() + ' kB/s'); - } - }); - - _systeminformation2.default.networkInterfaceDefault(function (defaultNetwork) { - setInterval(function () { - _systeminformation2.default.networkStats(defaultNetwork, function (data) { - _this.upSpeed = (data.tx_sec / 1024).toFixed(2); - - upBar.animate(_this.upSpeed / 2000); - }); - }, _config.prop.networkBarsDuration); - }); - } -}; \ No newline at end of file