-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5641629
Showing
11 changed files
with
4,149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# OS File | ||
.DS_Store | ||
|
||
# Npm | ||
node_modules | ||
bundle.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2017 TablePlus Software Foundation (https://tableplus.io/) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# What is this | ||
|
||
This is a TablePlus Plugin, install OpenURL you will have a menu `Generate UUID` in context menu. | ||
|
||
![menu](https://github.com/TablePlus/OpenURL/blob/master/Resource/demo.gif "menu") | ||
|
||
# Support | ||
|
||
TablePlus build 272 and above. | ||
|
||
# Install | ||
|
||
### From release | ||
|
||
Download [release](https://github.com/TablePlus/uuid-generator/releases), unzip and double click on file plugin to install. | ||
|
||
### Build from source | ||
|
||
``` | ||
git clone [email protected]:TablePlus/uuid-generator.git | ||
cd uuid-generator/UUIDGenerator.tableplusplugin | ||
npm install | ||
npm run build | ||
open . | ||
``` | ||
|
||
# How to use | ||
|
||
1. Open a connection. | ||
2. Open a table. | ||
3. Click on a cell. | ||
4. Click on `Generate UUID` in menu. | ||
|
||
# License | ||
|
||
UUIDGenerator is released under the MIT license. See [LICENSE](https://github.com/TablePlus/DummiesData/blob/master/LICENSE) for details. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
import uuidv1 from 'uuid/v1'; | ||
|
||
var getUUID = function() { | ||
return uuidv1(); | ||
} | ||
|
||
export { getUUID }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use strict'; | ||
|
||
import { getUUID } from './library/helper'; | ||
|
||
var onRun = function(context) { | ||
// Get all the items | ||
var row = context.clickedRow(); | ||
var col = context.clickedColumn(); | ||
var item = context.currentItem(); | ||
|
||
if (row == null || col == null || item == null) { | ||
context.alert('Error', 'No item cliked'); | ||
return; | ||
} | ||
|
||
// Generate UUID | ||
let uuid = getUUID(); | ||
if (uuid == null) { | ||
context.alert('Error', 'Could not generate UUID'); | ||
return; | ||
} | ||
// Update row value | ||
row.update(col.name, uuid); | ||
|
||
// Add to update queue | ||
item.addUpdate(row); | ||
|
||
// Notify the change | ||
context.update(); | ||
}; | ||
|
||
global.onRun = onRun; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "UUID Generator", | ||
"identifier": "com.tableplus.TablePlus.UUIDGenerator", | ||
"version": "1.0", | ||
"detail": "This plugin helps you generate UUID", | ||
"author": "TablePlus", | ||
"authorEmail": "[email protected]", | ||
"scripts": [ | ||
{ | ||
"location": "data", | ||
"type": "separator" | ||
}, | ||
{ | ||
"location": "data", | ||
"type": "action", | ||
"script": "uuidGenerator.js", | ||
"name": "Generate UUID" | ||
} | ||
] | ||
} |
Oops, something went wrong.