irongit

A simpler way to view django projects

looking good

huncholanehuncholaneauthored
parent 6c336d7commit d508d6c9eb6813d219f5835fd4c764c73be79df7Browse files

6 files changed, +155 -66

+4-6package.json
@@ -24,14 +24,12 @@
2424 "views": {
2525 "django-overview": [
2626 {
27- "id": "settings",
28- "name": "Settings",
29- "icon": "resources/settings.svg"
27+ "id": "django-overview.project",
28+ "name": "Current Project"
3029 },
3130 {
32- "id": "django-overview",
33- "name": "Models",
34- "icon": "resources/models.svg"
31+ "id": "django-overview.commands",
32+ "name": "Commands"
3533 }
3634 ]
3735 }
+0-8resources/database.svg
@@ -1,8 +0,0 @@
1-<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
2-<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
3-<path d="M4 18V6" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"/>
4-<path d="M20 6V18" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"/>
5-<path d="M12 10C16.4183 10 20 8.20914 20 6C20 3.79086 16.4183 2 12 2C7.58172 2 4 3.79086 4 6C4 8.20914 7.58172 10 12 10Z" stroke="#1C274C" stroke-width="1.5"/>
6-<path d="M20 12C20 14.2091 16.4183 16 12 16C7.58172 16 4 14.2091 4 12" stroke="#1C274C" stroke-width="1.5"/>
7-<path d="M20 18C20 20.2091 16.4183 22 12 22C7.58172 22 4 20.2091 4 18" stroke="#1C274C" stroke-width="1.5"/>
8-</svg>
+68-0resources/models.svg
@@ -0,0 +1,68 @@
1+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
3+
4+<svg
5+ width="24"
6+ height="24"
7+ viewBox="0 0 0.72 0.72"
8+ fill="none"
9+ version="1.1"
10+ id="svg12"
11+ sodipodi:docname="models.svg"
12+ inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
13+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
14+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
15+ xmlns="http://www.w3.org/2000/svg"
16+ xmlns:svg="http://www.w3.org/2000/svg">
17+ <defs
18+ id="defs16" />
19+ <sodipodi:namedview
20+ id="namedview14"
21+ pagecolor="#ffffff"
22+ bordercolor="#666666"
23+ borderopacity="1.0"
24+ inkscape:pageshadow="2"
25+ inkscape:pageopacity="0.0"
26+ inkscape:pagecheckerboard="0"
27+ showgrid="false"
28+ inkscape:zoom="1.0125"
29+ inkscape:cx="400"
30+ inkscape:cy="320.98765"
31+ inkscape:window-width="1920"
32+ inkscape:window-height="988"
33+ inkscape:window-x="0"
34+ inkscape:window-y="24"
35+ inkscape:window-maximized="1"
36+ inkscape:current-layer="svg12" />
37+ <g
38+ id="g31"
39+ transform="matrix(0.03348837,0,0,0.03348837,-0.04186044,-0.04186044)">
40+ <path
41+ d="M 4,18 V 6"
42+ stroke="#1c274c"
43+ stroke-width="1.5"
44+ stroke-linecap="round"
45+ id="path2" />
46+ <path
47+ d="M 20,6 V 18"
48+ stroke="#1c274c"
49+ stroke-width="1.5"
50+ stroke-linecap="round"
51+ id="path4" />
52+ <path
53+ d="M 12,10 C 16.4183,10 20,8.20914 20,6 20,3.79086 16.4183,2 12,2 7.58172,2 4,3.79086 4,6 c 0,2.20914 3.58172,4 8,4 z"
54+ stroke="#1c274c"
55+ stroke-width="1.5"
56+ id="path6" />
57+ <path
58+ d="m 20,12 c 0,2.2091 -3.5817,4 -8,4 -4.41828,0 -8,-1.7909 -8,-4"
59+ stroke="#1c274c"
60+ stroke-width="1.5"
61+ id="path8" />
62+ <path
63+ d="m 20,18 c 0,2.2091 -3.5817,4 -8,4 -4.41828,0 -8,-1.7909 -8,-4"
64+ stroke="#1c274c"
65+ stroke-width="1.5"
66+ id="path10" />
67+ </g>
68+</svg>
+46-32resources/settings.svg
@@ -1,32 +1,46 @@
1-<?xml version="1.0" encoding="iso-8859-1"?>
2-<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
3-<svg fill="#000000" height="800px" width="800px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
4- viewBox="0 0 54 54" xml:space="preserve">
5-<g>
6- <path d="M51.22,21h-5.052c-0.812,0-1.481-0.447-1.792-1.197s-0.153-1.54,0.42-2.114l3.572-3.571
7- c0.525-0.525,0.814-1.224,0.814-1.966c0-0.743-0.289-1.441-0.814-1.967l-4.553-4.553c-1.05-1.05-2.881-1.052-3.933,0l-3.571,3.571
8- c-0.574,0.573-1.366,0.733-2.114,0.421C33.447,9.313,33,8.644,33,7.832V2.78C33,1.247,31.753,0,30.22,0H23.78
9- C22.247,0,21,1.247,21,2.78v5.052c0,0.812-0.447,1.481-1.197,1.792c-0.748,0.313-1.54,0.152-2.114-0.421l-3.571-3.571
10- c-1.052-1.052-2.883-1.05-3.933,0l-4.553,4.553c-0.525,0.525-0.814,1.224-0.814,1.967c0,0.742,0.289,1.44,0.814,1.966l3.572,3.571
11- c0.573,0.574,0.73,1.364,0.42,2.114S8.644,21,7.832,21H2.78C1.247,21,0,22.247,0,23.78v6.439C0,31.753,1.247,33,2.78,33h5.052
12- c0.812,0,1.481,0.447,1.792,1.197s0.153,1.54-0.42,2.114l-3.572,3.571c-0.525,0.525-0.814,1.224-0.814,1.966
13- c0,0.743,0.289,1.441,0.814,1.967l4.553,4.553c1.051,1.051,2.881,1.053,3.933,0l3.571-3.572c0.574-0.573,1.363-0.731,2.114-0.42
14- c0.75,0.311,1.197,0.98,1.197,1.792v5.052c0,1.533,1.247,2.78,2.78,2.78h6.439c1.533,0,2.78-1.247,2.78-2.78v-5.052
15- c0-0.812,0.447-1.481,1.197-1.792c0.751-0.312,1.54-0.153,2.114,0.42l3.571,3.572c1.052,1.052,2.883,1.05,3.933,0l4.553-4.553
16- c0.525-0.525,0.814-1.224,0.814-1.967c0-0.742-0.289-1.44-0.814-1.966l-3.572-3.571c-0.573-0.574-0.73-1.364-0.42-2.114
17- S45.356,33,46.168,33h5.052c1.533,0,2.78-1.247,2.78-2.78V23.78C54,22.247,52.753,21,51.22,21z M52,30.22
18- C52,30.65,51.65,31,51.22,31h-5.052c-1.624,0-3.019,0.932-3.64,2.432c-0.622,1.5-0.295,3.146,0.854,4.294l3.572,3.571
19- c0.305,0.305,0.305,0.8,0,1.104l-4.553,4.553c-0.304,0.304-0.799,0.306-1.104,0l-3.571-3.572c-1.149-1.149-2.794-1.474-4.294-0.854
20- c-1.5,0.621-2.432,2.016-2.432,3.64v5.052C31,51.65,30.65,52,30.22,52H23.78C23.35,52,23,51.65,23,51.22v-5.052
21- c0-1.624-0.932-3.019-2.432-3.64c-0.503-0.209-1.021-0.311-1.533-0.311c-1.014,0-1.997,0.4-2.761,1.164l-3.571,3.572
22- c-0.306,0.306-0.801,0.304-1.104,0l-4.553-4.553c-0.305-0.305-0.305-0.8,0-1.104l3.572-3.571c1.148-1.148,1.476-2.794,0.854-4.294
23- C10.851,31.932,9.456,31,7.832,31H2.78C2.35,31,2,30.65,2,30.22V23.78C2,23.35,2.35,23,2.78,23h5.052
24- c1.624,0,3.019-0.932,3.64-2.432c0.622-1.5,0.295-3.146-0.854-4.294l-3.572-3.571c-0.305-0.305-0.305-0.8,0-1.104l4.553-4.553
25- c0.304-0.305,0.799-0.305,1.104,0l3.571,3.571c1.147,1.147,2.792,1.476,4.294,0.854C22.068,10.851,23,9.456,23,7.832V2.78
26- C23,2.35,23.35,2,23.78,2h6.439C30.65,2,31,2.35,31,2.78v5.052c0,1.624,0.932,3.019,2.432,3.64
27- c1.502,0.622,3.146,0.294,4.294-0.854l3.571-3.571c0.306-0.305,0.801-0.305,1.104,0l4.553,4.553c0.305,0.305,0.305,0.8,0,1.104
28- l-3.572,3.571c-1.148,1.148-1.476,2.794-0.854,4.294c0.621,1.5,2.016,2.432,3.64,2.432h5.052C51.65,23,52,23.35,52,23.78V30.22z"/>
29- <path d="M27,18c-4.963,0-9,4.037-9,9s4.037,9,9,9s9-4.037,9-9S31.963,18,27,18z M27,34c-3.859,0-7-3.141-7-7s3.141-7,7-7
30- s7,3.141,7,7S30.859,34,27,34z"/>
31-</g>
32-</svg>
1+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
3+
4+<svg
5+ fill="#000000"
6+ height="24"
7+ width="24"
8+ version="1.1"
9+ id="Capa_1"
10+ viewBox="0 0 1.62 1.62"
11+ xml:space="preserve"
12+ sodipodi:docname="settings.svg"
13+ inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
14+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
15+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
16+ xmlns="http://www.w3.org/2000/svg"
17+ xmlns:svg="http://www.w3.org/2000/svg"><defs
18+ id="defs11" /><sodipodi:namedview
19+ id="namedview9"
20+ pagecolor="#ffffff"
21+ bordercolor="#666666"
22+ borderopacity="1.0"
23+ inkscape:pageshadow="2"
24+ inkscape:pageopacity="0.0"
25+ inkscape:pagecheckerboard="0"
26+ showgrid="false"
27+ inkscape:zoom="32.416667"
28+ inkscape:cx="12"
29+ inkscape:cy="12"
30+ inkscape:window-width="1920"
31+ inkscape:window-height="988"
32+ inkscape:window-x="0"
33+ inkscape:window-y="24"
34+ inkscape:window-maximized="1"
35+ inkscape:current-layer="Capa_1" />
36+<g
37+ id="g6"
38+ transform="scale(0.03)">
39+ <path
40+ d="m 51.22,21 h -5.052 c -0.812,0 -1.481,-0.447 -1.792,-1.197 -0.311,-0.75 -0.153,-1.54 0.42,-2.114 l 3.572,-3.571 c 0.525,-0.525 0.814,-1.224 0.814,-1.966 0,-0.743 -0.289,-1.441 -0.814,-1.967 L 43.815,5.632 c -1.05,-1.05 -2.881,-1.052 -3.933,0 L 36.311,9.203 C 35.737,9.776 34.945,9.936 34.197,9.624 33.447,9.313 33,8.644 33,7.832 V 2.78 C 33,1.247 31.753,0 30.22,0 H 23.78 C 22.247,0 21,1.247 21,2.78 v 5.052 c 0,0.812 -0.447,1.481 -1.197,1.792 -0.748,0.313 -1.54,0.152 -2.114,-0.421 L 14.118,5.632 c -1.052,-1.052 -2.883,-1.05 -3.933,0 l -4.553,4.553 c -0.525,0.525 -0.814,1.224 -0.814,1.967 0,0.742 0.289,1.44 0.814,1.966 l 3.572,3.571 c 0.573,0.574 0.73,1.364 0.42,2.114 C 9.314,20.553 8.644,21 7.832,21 H 2.78 C 1.247,21 0,22.247 0,23.78 v 6.439 C 0,31.753 1.247,33 2.78,33 h 5.052 c 0.812,0 1.481,0.447 1.792,1.197 0.311,0.75 0.153,1.54 -0.42,2.114 l -3.572,3.571 c -0.525,0.525 -0.814,1.224 -0.814,1.966 0,0.743 0.289,1.441 0.814,1.967 l 4.553,4.553 c 1.051,1.051 2.881,1.053 3.933,0 l 3.571,-3.572 c 0.574,-0.573 1.363,-0.731 2.114,-0.42 0.75,0.311 1.197,0.98 1.197,1.792 v 5.052 c 0,1.533 1.247,2.78 2.78,2.78 h 6.439 c 1.533,0 2.78,-1.247 2.78,-2.78 v -5.052 c 0,-0.812 0.447,-1.481 1.197,-1.792 0.751,-0.312 1.54,-0.153 2.114,0.42 l 3.571,3.572 c 1.052,1.052 2.883,1.05 3.933,0 l 4.553,-4.553 c 0.525,-0.525 0.814,-1.224 0.814,-1.967 0,-0.742 -0.289,-1.44 -0.814,-1.966 L 44.795,36.311 C 44.222,35.737 44.065,34.947 44.375,34.197 44.685,33.447 45.356,33 46.168,33 H 51.22 C 52.753,33 54,31.753 54,30.22 V 23.78 C 54,22.247 52.753,21 51.22,21 Z M 52,30.22 C 52,30.65 51.65,31 51.22,31 h -5.052 c -1.624,0 -3.019,0.932 -3.64,2.432 -0.622,1.5 -0.295,3.146 0.854,4.294 l 3.572,3.571 c 0.305,0.305 0.305,0.8 0,1.104 l -4.553,4.553 c -0.304,0.304 -0.799,0.306 -1.104,0 L 37.726,43.382 C 36.577,42.233 34.932,41.908 33.432,42.528 31.932,43.149 31,44.544 31,46.168 V 51.22 C 31,51.65 30.65,52 30.22,52 H 23.78 C 23.35,52 23,51.65 23,51.22 v -5.052 c 0,-1.624 -0.932,-3.019 -2.432,-3.64 -0.503,-0.209 -1.021,-0.311 -1.533,-0.311 -1.014,0 -1.997,0.4 -2.761,1.164 l -3.571,3.572 c -0.306,0.306 -0.801,0.304 -1.104,0 L 7.046,42.4 c -0.305,-0.305 -0.305,-0.8 0,-1.104 l 3.572,-3.571 c 1.148,-1.148 1.476,-2.794 0.854,-4.294 C 10.851,31.932 9.456,31 7.832,31 H 2.78 C 2.35,31 2,30.65 2,30.22 V 23.78 C 2,23.35 2.35,23 2.78,23 h 5.052 c 1.624,0 3.019,-0.932 3.64,-2.432 0.622,-1.5 0.295,-3.146 -0.854,-4.294 L 7.046,12.703 c -0.305,-0.305 -0.305,-0.8 0,-1.104 l 4.553,-4.553 c 0.304,-0.305 0.799,-0.305 1.104,0 l 3.571,3.571 c 1.147,1.147 2.792,1.476 4.294,0.854 C 22.068,10.851 23,9.456 23,7.832 V 2.78 C 23,2.35 23.35,2 23.78,2 h 6.439 C 30.65,2 31,2.35 31,2.78 v 5.052 c 0,1.624 0.932,3.019 2.432,3.64 1.502,0.622 3.146,0.294 4.294,-0.854 l 3.571,-3.571 c 0.306,-0.305 0.801,-0.305 1.104,0 l 4.553,4.553 c 0.305,0.305 0.305,0.8 0,1.104 l -3.572,3.571 c -1.148,1.148 -1.476,2.794 -0.854,4.294 0.621,1.5 2.016,2.432 3.64,2.432 H 51.22 C 51.65,23 52,23.35 52,23.78 Z"
41+ id="path2" />
42+ <path
43+ d="m 27,18 c -4.963,0 -9,4.037 -9,9 0,4.963 4.037,9 9,9 4.963,0 9,-4.037 9,-9 0,-4.963 -4.037,-9 -9,-9 z m 0,16 c -3.859,0 -7,-3.141 -7,-7 0,-3.859 3.141,-7 7,-7 3.859,0 7,3.141 7,7 0,3.859 -3.141,7 -7,7 z"
44+ id="path4" />
45+</g>
46+</svg>
+10-20src/extension.ts
@@ -1,25 +1,15 @@
1-// The module 'vscode' contains the VS Code extensibility API
2-// Import the module and reference it with the alias vscode in your code below
3-import * as vscode from 'vscode';
1+import * as vscode from "vscode";
2+import ProjectDataProvider from "./providers/project";
43
5-// This method is called when your extension is activated
6-// Your extension is activated the very first time the command is executed
74 export function activate(context: vscode.ExtensionContext) {
8-
9- // Use the console to output diagnostic information (console.log) and errors (console.error)
10- // This line of code will only be executed once when your extension is activated
11- console.log('Congratulations, your extension "django-overview" is now active!');
12-
13- // The command has been defined in the package.json file
14- // Now provide the implementation of the command with registerCommand
15- // The commandId parameter must match the command field in package.json
16- let disposable = vscode.commands.registerCommand('django-overview.helloWorld', () => {
17- // The code you place here will be executed every time your command is executed
18- // Display a message box to the user
19- vscode.window.showInformationMessage('Hello World from django-overview!');
20- });
21-
22- context.subscriptions.push(disposable);
5+ const settingsDataProvider = new ProjectDataProvider();
6+ [
7+ vscode.window.registerTreeDataProvider(
8+ "django-overview.project",
9+ settingsDataProvider
10+ ),
11+ ].forEach((disposable) => context.subscriptions.push(disposable));
12+ console.log("Added the providers");
2313 }
2414
2515 // This method is called when your extension is deactivated
+27-0src/providers/project.ts
@@ -0,0 +1,27 @@
1+import * as vscode from "vscode";
2+
3+export default class ProjectDataProvider
4+ implements vscode.TreeDataProvider<number>
5+{
6+ private _onDidChangeTreeData: vscode.EventEmitter<
7+ number | undefined | null | void
8+ > = new vscode.EventEmitter<number | undefined | null | void>();
9+ readonly onDidChangeTreeData: vscode.Event<number | undefined | null | void> =
10+ this._onDidChangeTreeData.event;
11+
12+ getTreeItem(element: number): vscode.TreeItem {
13+ return {
14+ label: `Number: ${element}`,
15+ iconPath: new vscode.ThemeIcon("gear"),
16+ // collapsibleState: vscode.TreeItemCollapsibleState.Collapsed,
17+ };
18+ }
19+
20+ getChildren(element?: number): Thenable<number[]> {
21+ if (element === undefined) {
22+ return Promise.resolve([1, 2, 3, 4, 5]);
23+ } else {
24+ return Promise.resolve([]);
25+ }
26+ }
27+}