Skip to content

Commit b4b6ef2

Browse files
committed
feat: add depot list logic
1 parent 61275b5 commit b4b6ef2

File tree

18 files changed

+729
-320
lines changed

18 files changed

+729
-320
lines changed

out/extension.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const init_1 = __importDefault(require("./init"));
1717
const webview_1 = __importDefault(require("./webview"));
1818
const codingServer_1 = __importDefault(require("./services/codingServer"));
1919
const proxy_1 = require("./utils/proxy");
20+
const accessToken = '1b7fca3bd7594a89b0f5e2a0250c1147';
2021
function activate(context) {
2122
return __awaiter(this, void 0, void 0, function* () {
2223
const webviewProvider = new webview_1.default();
@@ -31,7 +32,7 @@ function activate(context) {
3132
path: 'string',
3233
team: 'string'
3334
},
34-
accessToken: '1b7fca3bd7594a89b0f5e2a0250c1147',
35+
accessToken,
3536
refreshToken: 'abc'
3637
}, repoInfo || {
3738
team: 'codingcorp',

out/init.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
return (mod && mod.__esModule) ? mod : { "default": mod };
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
6-
exports.registerTreeViews = exports.registerCommands = void 0;
6+
exports.createTreeViews = exports.registerCommands = void 0;
77
const hbuilderx_1 = __importDefault(require("hbuilderx"));
88
const depot_1 = __importDefault(require("./trees/depot"));
99
const mr_1 = __importDefault(require("./trees/mr"));
@@ -17,26 +17,26 @@ function registerCommands(context) {
1717
context.subscriptions.push(hbuilderx_1.default.commands.registerCommand('codingPlugin.mrTreeItemClick', function (param) {
1818
// hx.window.showInformationMessage('选中了TreeItem:' + param[0]);
1919
// webviewProvider.update(param[0]);
20-
hbuilderx_1.default.env.openExternal(repo_1.getMRUrl(repoInfo.team, param[0]));
20+
hbuilderx_1.default.env.openExternal(repo_1.getMRUrl(repoInfo.team, param));
21+
}));
22+
context.subscriptions.push(hbuilderx_1.default.commands.registerCommand('codingPlugin.depotTreeItemClick', function (param) {
23+
hbuilderx_1.default.env.openExternal(repo_1.getDepotUrl(repoInfo.team, param));
2124
}));
2225
}
2326
exports.registerCommands = registerCommands;
24-
function registerTreeViews(context) {
27+
function createTreeViews(context) {
2528
context.subscriptions.push(hbuilderx_1.default.window.createTreeView('codingPlugin.treeMR', {
2629
showCollapseAll: true,
2730
treeDataProvider: new mr_1.default(context)
2831
}));
2932
context.subscriptions.push(hbuilderx_1.default.window.createTreeView('codingPlugin.treeDepot', {
3033
showCollapseAll: true,
31-
treeDataProvider: new depot_1.default(context, [
32-
{ name: '仓库列表', children: [{ name: '111' }] },
33-
{ name: '创建仓库' }
34-
])
34+
treeDataProvider: new depot_1.default(context)
3535
}));
3636
}
37-
exports.registerTreeViews = registerTreeViews;
37+
exports.createTreeViews = createTreeViews;
3838
function init(context) {
3939
registerCommands(context);
40-
registerTreeViews(context);
40+
createTreeViews(context);
4141
}
4242
exports.default = init;

0 commit comments

Comments
 (0)