diff --git a/.compilerc b/.compilerc index 903e0e9..2bd01cc 100644 --- a/.compilerc +++ b/.compilerc @@ -16,7 +16,7 @@ "plugins": [ "transform-async-to-generator" ], - "sourceMaps": "inline" + "sourceMaps": "none" } }, "production": { diff --git a/.desktop b/.desktop deleted file mode 100644 index 8447f18..0000000 --- a/.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Name=gtt taskbar -GenericName=gitlab time tracker taskbar -Comment=A menubar application for GitLabs time tracking feature -Categories=Utility; -Exec=com.github.kriskbx.gitlab-time-tracker-taskbar -Icon=application-default-icon -Terminal=false -Type=Application -X-GNOME-Gettext-Domain=gtt -Keywords=Gitlab;Time;Tracking;Monitoring; diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 655832c..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,47 +0,0 @@ -variables: - GITLAB_CONTAINER_IMAGE: registry.gitlab.com/kriskbx/gitlab-time-tracker-taskbar:latest - -stages: - - build - -build:linux: - image: $GITLAB_CONTAINER_IMAGE - stage: build - dependencies: - - dependencies - artifacts: - paths: - - out/make - script: - - yarn install - - yarn run make - -build:win: - stage: build - dependencies: - - dependencies - artifacts: - paths: - - out/make - script: - - yarn install - - yarn run make - tags: - - windows - - electron-forge - - node - -build:osx: - stage: build - dependencies: - - dependencies - artifacts: - paths: - - out/make - script: - - yarn install - - yarn run make - tags: - - osx - - electron-forge - - node diff --git a/.travis.yml b/.travis.yml index 3595bf5..c685db0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,4 +40,4 @@ before_script: - yarn run production script: - - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then yarn run publish; else docker run --rm -it -e "GITHUB_TOKEN=$GITHUB_TOKEN" -v $(pwd):/code kriskbx/gtt-taskbar-builder ./build.sh; fi + - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then yarn run publish; else yarn run publish-docker; fi diff --git a/Dockerfile b/Dockerfile index ff25979..0a9cb1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN apt update && apt install -y \ ca-certificates \ rpm \ zip \ + libpng-dev \ snapcraft RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash && \ diff --git a/build.sh b/build.sh index 7fd62a3..345ca43 100755 --- a/build.sh +++ b/build.sh @@ -5,6 +5,6 @@ export DISPLAY=:99.0 export DEBUG=electron-installer-snap:snapcraft sleep 5 -yarn install +yarn install --force yarn run production -yarn run publish \ No newline at end of file +yarn run publish diff --git a/documentation.md b/documentation.md new file mode 100644 index 0000000..b4493f4 --- /dev/null +++ b/documentation.md @@ -0,0 +1,21 @@ +# gtt taskbar documentation + +Coming soon! + +## contents + +* [support further development 🍺](#support-further-development) +* [license](#license) + +## support further development + +gtt is an open source project, developed and maintained completely in my free time. + +If you enjoy using gtt you can support the project by [contributing](#) to the code base, +sharing it to your colleagues and co-workers or monetarily by [donating via PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TXL5G4BDN8JP6). +Every type of support is helpful and thank you very much if you consider supporting the project +or already have done so. 💜 + +## license + +GPL v2 diff --git a/package.json b/package.json index d5cc7a4..2a76ea3 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,24 @@ { "name": "gtt-taskbar", - "productName": "gitlab time tracker taskbar", + "productName": "gtt-taskbar", + "genericName": "GitLab menubar/taskbar application", "description": "A crossplatform menubar/taskbar application for GitLabs time tracking feature.", - "version": "0.3.4", + "homepage": "https://github.com/kriskbx/gitlab-time-tracker-taskbar", + "keywords": [ + "GitLab", + "Timetracking" + ], + "author": "Kris Siepert", + "private": true, + "license": "GPL-2.0", + "version": "0.3.10", "main": "src/index.js", "scripts": { "start": "electron-forge start", "package": "electron-forge package", "make": "electron-forge make", "publish": "electron-forge publish", + "publish-docker": "docker run --rm -it -e \"GITHUB_TOKEN=$GITHUB_TOKEN\" -v $(pwd):/code kriskbx/gtt-taskbar-builder ./build.sh", "lint": "eslint src", "dev": "NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "NODE_ENV=development webpack --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", @@ -16,10 +26,6 @@ "production": "NODE_ENV=production webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "production-windows": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, - "keywords": [], - "author": "Kris Siepert", - "private": true, - "license": "GPL-2.0", "config": { "forge": { "publish_targets": { @@ -41,7 +47,6 @@ "zip" ], "linux": [ - "snap", "deb", "rpm" ] @@ -51,40 +56,49 @@ ".idea", "resources", "out", - ".tresorit" + ".tresorit", + "appveyor.yml", + "build.sh", + "Dockerfile", + "documentation.md", + "Icon", + "LICENSE", + "mix-manifest.json", + "readme.md", + "webpack.mix.js", + "yarn.lock", + "yarn-error.log" ], "packageManager": "yarn", "icon": "./resources/images/icon/icon.png" }, - "electronInstallerSnap": { - "appPlugs": [ - "browser-support" - ], - "grade": "stable", - "desktopTemplate": "./.desktop" - }, "electronWinstallerConfig": { - "name": "gtt-taskbar", "setupIcon": "./resources/images/icon/icon.ico" }, "electronInstallerDebian": { - "icon": "./resources/images/icon/icon.png", + "depends": [ + "libappindicator1" + ], "categories": [ "Utility" ], - "homepage": "https://github.com/kriskbx/gitlab-time-tracker-taskbar" + "icon": "./resources/images/icon/icon.png" }, "electronInstallerRedhat": { - "license": "GPL-2.0", "requires": [ "lsb", - "libappindictor" + "libappindicator" ], "compressionLevel": 9, "categories": [ "Utility" ] }, + "electronInstallerSnap": { + "grade": "stable", + "confinement": "strict", + "icon": "./resources/images/icon/icon.png" + }, "snapStore": { "release": "stable" }, @@ -109,9 +123,9 @@ "chokidar": "^2.0.0", "electron": "2.0.8", "electron-compile": "^6.4.2", - "electron-log": "^2.2.14", + "electron-log": "^3.0.0-beta4", "electron-squirrel-startup": "^1.0.0", - "gitlab-time-tracker": "^1.7.21", + "gitlab-time-tracker": "^1.7.37", "moment": "^2.20.1", "raven": "^2.6.2", "write-yaml": "^1.0.0" @@ -133,10 +147,11 @@ "roboto": "^0.8.2", "stylus": "^0.54.5", "stylus-loader": "^3.0.1", + "url-parse": "^1.4.3", "vue": "^2.5.13", + "vue-datetime-2": "^0.6.1", "vue-js-toggle-button": "^1.2.2", "vue-resource": "^1.3.5", - "vue-select": "^2.4.0", - "vuejs-datetimepicker": "^1.1.3" + "vue-select": "^2.4.0" } } diff --git a/readme.md b/readme.md index c465ba3..c0a10df 100644 --- a/readme.md +++ b/readme.md @@ -1,10 +1,27 @@ -# ![gtt](https://raw.githubusercontent.com/kriskbx/gitlab-time-tracker-taskbar/master/src/icons/png/64x64.png) gtt taskbar +![gtt](https://raw.githubusercontent.com/kriskbx/gitlab-time-tracker-taskbar/master/resources/images/preview/preview.png) -[![Github All Releases](https://img.shields.io/github/downloads/kriskbx/gitlab-time-tracker-taskbar/total.svg?style=flat-square)](https://github.com/kriskbx/gitlab-time-tracker-taskbar/releases) -[![GitHub (pre-)release](https://img.shields.io/github/release/kriskbx/gitlab-time-tracker-taskbar/all.svg?style=flat-square)](https://github.com/kriskbx/gitlab-time-tracker-taskbar/releases) -[![Travis (Linux, Mac OS)](https://img.shields.io/travis/kriskbx/gitlab-time-tracker-taskbar/production.svg?style=flat-square)](https://travis-ci.org/kriskbx/gitlab-time-tracker-taskbar) -[![AppVeyor (Windows)](https://img.shields.io/appveyor/ci/kriskbx/gitlab-time-tracker-taskbar/production.svg?style=flat-square)](https://ci.appveyor.com/project/kriskbx/gitlab-time-tracker-taskbar) -[![GitHub](https://img.shields.io/github/license/kriskbx/gitlab-time-tracker-taskbar.svg?style=flat-square)](https://github.com/kriskbx/gitlab-time-tracker-taskbar/blob/master/LICENSE) +

+ + + + + +

-> An open source crossplatform menubar/taskbar application for GitLab's time tracking feature based on the [gtt command line interface](https://github.com/kriskbx/gitlab-time-tracker). +## introduction +gtt taskbar is an open source crossplatform (Linux, Mac OS, Windows) menubar/taskbar application for GitLab's time tracking feature based on the **[gtt command line interface](https://github.com/kriskbx/gitlab-time-tracker)**. + +![Linux, Mac OS, Windows](https://raw.githubusercontent.com/kriskbx/gitlab-time-tracker-taskbar/master/resources/images/preview/os.png) + +## documentation + +How to install and use gtt taskbar? You can find the documentation [here](https://github.com/kriskbx/gitlab-time-tracker-taskbar/blob/master/documentation.md). + +## support further development + +Please support the development of this free software by [donating or sharing](https://github.com/kriskbx/gitlab-time-tracker-taskbar/blob/master/documentation.md#support-further-development)! + +## license + +gtt taskbar is open-source software licensed under the [GPL V2 license](https://github.com/kriskbx/gitlab-time-tracker-taskbar/blob/master/LICENSE). diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index 611d7d5..a206191 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -4,9 +4,10 @@ const Frame = require('gitlab-time-tracker/src/models/baseFrame'); window.Vue = require('vue'); window.Vue.use(require('vue-resource')); const moment = require('moment'); +const URL = require('url-parse'); const _ = require('underscore'); import ToggleButton from 'vue-js-toggle-button'; -import datetime from 'vuejs-datetimepicker'; +import {Datetime} from 'vue-datetime-2'; window.Vue.use(ToggleButton); @@ -19,40 +20,60 @@ const app = new Vue({ components: { 'content-track': require('./components/track.vue'), 'panel-footer': require('./components/footer.vue'), - 'datetime': datetime + 'datetime': Datetime }, watch: { 'resourceType': function () { this.saveState(); }, - 'resource': function () { - this.saveState(); + 'resource': { + deep: true, + handler: function () { + this.saveState(); + } }, - 'mergeRequests': function () { - this.saveState(); + 'mergeRequests': { + deep: true, + handler: function () { + this.saveState(); + } }, - 'issues': function () { - this.saveState(); + 'issues': { + deep: true, + handler: function () { + this.saveState(); + } }, - 'projects': function () { - this.saveState(); + 'projects': { + deep: true, + handler: function () { + this.saveState(); + } }, - 'project': function () { - this.loadResource(); - this.saveState(); + 'project': { + deep: true, + handler: function () { + this.loadResource(); + this.saveState(); + } }, 'config': { deep: true, handler: function () { - if(this.loadingConfig) return; + if (this.loadingConfig) return; this.writeConfig(this.config) } } }, computed: { + gitlab() { + let url = new URL(this.config.get('url'), true); + return url.protocol + (url.slashes ? '//' : '') + url.host; + }, days() { + let tmp = this.config; return this.log && this.log.frames ? Object.keys(this.log.frames).sort().reverse() : []; }, frames() { @@ -66,6 +87,7 @@ const app = new Vue({ this.setConfig(ipc.sync('gtt-config', 'get')); this.version = ipc.sync('gtt-version', 'get'); this.platform = ipc.sync('gtt-platform', 'get'); + this.editing = false; // set ipc listeners ipc.on('gtt-last-sync', (event, lastSync) => this.lastSync = lastSync); @@ -73,8 +95,8 @@ const app = new Vue({ ipc.on('gtt-log', (event, data) => { this.loadingLog = false; let i; - for(i in data.frames) { - if(!data.frames.hasOwnProperty(i)) continue; + for (i in data.frames) { + if (!data.frames.hasOwnProperty(i)) continue; data.frames[i] = _.map(data.frames[i], frame => Frame.copy(frame)); } this.log = data; @@ -107,6 +129,8 @@ const app = new Vue({ ipc.on('gtt-stop', () => this.sync()); + this.ready = true; + if (this.$refs.log) this.loadLog(); if (!this.$refs.main) return; @@ -125,7 +149,7 @@ const app = new Vue({ methods: { synced(modified) { - if(!this.lastSync) return; + if (!this.lastSync) return false; return moment(modified).diff(this.lastSync) < 0; }, human(input) { @@ -204,10 +228,44 @@ const app = new Vue({ saveState() { let state = Object.assign({}, window.state.data); delete state.config; + delete state.editing; + delete state.entry; + delete state.currentEntry; ipc.send('cache-set', {key: 'state', data: state}); }, writeConfig(config) { ipc.send('gtt-config-write', config); + }, + timeFormat() { + return this.config ? this.config.get('dateFormat').replace(this.dayFormat(), "") : "HH:mm"; + }, + dayFormat() { + return this.config ? this.config.get('dateFormat').replace(/([k|h|H|m|s|S][:]?)/gm, "") : 'YYYY-MM-DD'; + }, + getTitleById(id, project) { + if (!this.issues[project]) return false; + + let filtered = this.issues[project].filter(issue => issue.iid == id); + if (!filtered[0]) return false; + + return filtered[0].title; + }, + edit(frame) { + this.editing = true; + this.currentEntry = frame; + this.entry = Frame.copy(frame); + }, + save() { + for (let key in this.entry) { + if (!this.entry.hasOwnProperty(key)) continue; + this.currentEntry[key] = this.entry[key]; + } + this.currentEntry.modified = moment().toISOString(); + ipc.send('gtt-edit', {frame: this.currentEntry}); + this.editing = false; + }, + dump(data) { + console.log(data); } } }); diff --git a/resources/assets/js/components/track.vue b/resources/assets/js/components/track.vue index b0ca524..c3c26fc 100644 --- a/resources/assets/js/components/track.vue +++ b/resources/assets/js/components/track.vue @@ -37,7 +37,7 @@ :options="resourceOptions"> -
+