Skip to content

Commit

Permalink
Merge pull request #1 from starxg/dev
Browse files Browse the repository at this point in the history
1.0.1
  • Loading branch information
starxg committed Apr 5, 2021
2 parents a308dde + 407be3c commit 958aca2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 35 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "terminus-sync-config",
"version": "1.0.0",
"version": "1.0.1",
"description": "Sync configuration files to GitHub Gist or Gitee Gist",
"keywords": [
"terminus-plugin"
],
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"build": "webpack --progress --color",
"build": "webpack --progress --color --mode=production",
"watch": "webpack --progress --color --watch",
"prepublishOnly": "npm run build"
},
Expand All @@ -34,7 +34,6 @@
"pug": "^2.0.3",
"pug-loader": "^2.4.0",
"rxjs": "^6.2.1",
"sanitize-filename": "^1.6.3",
"sass-loader": "^11.0.1",
"strip-ansi": "^5.0.0",
"style-loader": "^2.0.0",
Expand Down
26 changes: 18 additions & 8 deletions src/settingsTab.component.pug
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,23 @@ h3 Sync Config
[(ngModel)]='config.store.syncConfig.token',
(ngModelChange)='config.save()',
)
.form-group
label Gist
input.form-control(
type='text',
placeholder="use existing gist id or automatic generation gist id",
[(ngModel)]='config.store.syncConfig.gist',
(ngModelChange)='config.save()',
)
.form-row
.form-group.col-md-9
label Gist
input.form-control(
type='text',
placeholder="use existing gist id or automatic generation gist id",
[(ngModel)]='config.store.syncConfig.gist',
(ngModelChange)='config.save()',
)
.form-group.col-md-3.d-none.d-md-block
label   
button.btn.btn-outline-secondary.form-control(
[disabled]='config.store.syncConfig.gist === "" || config.store.syncConfig.type !== "GitHub"',
(click)='viewGist(config.store.syncConfig.type,config.store.syncConfig.gist)'
)
div.fa.fa-fw.fa-eye
span.ml-2 View
.form-group
button.btn.btn-outline-primary.mr-3(
(click)='sync(true)',
Expand All @@ -38,6 +47,7 @@ h3 Sync Config
div.fa.fa-fw.fa-upload(*ngIf='!isUploading')
div.fa.fa-cog.fa-spin(*ngIf='isUploading')
span.ml-2 Upload config
.mt-3.d-sm-none
button.btn.btn-outline-warning(
(click)='sync(false)',
style={'margin-right':'10px'},
Expand Down
11 changes: 9 additions & 2 deletions src/settingsTab.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Component, OnInit } from '@angular/core'
import { ConfigService, } from 'terminus-core'
import { ConfigService, ElectronService, } from 'terminus-core'
import { ToastrService } from 'ngx-toastr'
import { getGist, syncGist } from 'api';

Expand All @@ -15,6 +14,7 @@ export class SyncConfigSettingsTabComponent implements OnInit {
constructor(
public config: ConfigService,
private toastr: ToastrService,
private electron: ElectronService,
) {
}

Expand Down Expand Up @@ -86,4 +86,11 @@ export class SyncConfigSettingsTabComponent implements OnInit {

}

viewGist(type: string, gist: string): void {
if (type === 'GitHub') {
this.electron.shell.openExternal('https://gist.github.com/' + gist)
}

}

}
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
filename: 'index.js',
pathinfo: true,
libraryTarget: 'umd',
devtoolModuleFilenameTemplate: 'webpack-terminus-save-output:///[resource-path]',
devtoolModuleFilenameTemplate: 'webpack-terminus-sync-config:///[resource-path]',
},
resolve: {
modules: ['.', 'src', 'node_modules'].map(x => path.join(__dirname, x)),
Expand Down
23 changes: 2 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3042,8 +3042,8 @@ run-script-os@^1.1.3:

rxjs@^6.2.1:
version "6.6.7"
resolved "https://registry.npm.taobao.org/rxjs/download/rxjs-6.6.7.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frxjs%2Fdownload%2Frxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
integrity sha1-kKwBisq/SRv2UEQjXVhjxNq4BMk=
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==
dependencies:
tslib "^1.9.0"

Expand All @@ -3069,13 +3069,6 @@ safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
resolved "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=

sanitize-filename@^1.6.3:
version "1.6.3"
resolved "https://registry.npm.taobao.org/sanitize-filename/download/sanitize-filename-1.6.3.tgz#755ebd752045931977e30b2025d340d7c9090378"
integrity sha1-dV69dSBFkxl34wsgJdNA18kJA3g=
dependencies:
truncate-utf8-bytes "^1.0.0"

sass-graph@2.2.5:
version "2.2.5"
resolved "https://registry.npm.taobao.org/sass-graph/download/sass-graph-2.2.5.tgz#a981c87446b8319d96dce0671e487879bd24c2e8"
Expand Down Expand Up @@ -3585,13 +3578,6 @@ trim-newlines@^1.0.0:
dependencies:
glob "^7.1.2"

truncate-utf8-bytes@^1.0.0:
version "1.0.2"
resolved "https://registry.npm.taobao.org/truncate-utf8-bytes/download/truncate-utf8-bytes-1.0.2.tgz#405923909592d56f78a5818434b0b78489ca5f2b"
integrity sha1-QFkjkJWS1W94pYGENLC3hInKXys=
dependencies:
utf8-byte-length "^1.0.1"

tslib@^1.9.0:
version "1.14.1"
resolved "https://registry.npm.taobao.org/tslib/download/tslib-1.14.1.tgz?cache=0&sync_timestamp=1609887438976&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
Expand Down Expand Up @@ -3706,11 +3692,6 @@ use@^3.1.0:
resolved "https://registry.npm.taobao.org/use/download/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
integrity sha1-1QyMrHmhn7wg8pEfVuuXP04QBw8=

utf8-byte-length@^1.0.1:
version "1.0.4"
resolved "https://registry.npm.taobao.org/utf8-byte-length/download/utf8-byte-length-1.0.4.tgz#f45f150c4c66eee968186505ab93fcbb8ad6bf61"
integrity sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=

util-deprecate@^1.0.2, util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
Expand Down

0 comments on commit 958aca2

Please sign in to comment.