add: 模型导航,直接打开项目对应 gitlab

This commit is contained in:
千反田丷 2021-12-13 11:49:44 +08:00
parent 38d92d6f51
commit b19a3b3203
7 changed files with 79 additions and 7 deletions

View File

@ -131,6 +131,12 @@
"dark": "resources/icon/dark/search-entity-view.svg"
}
},
{
"command": "ibiz-modeling-studio.gitlab.open-project",
"title": "%command.ibiz-modeling-studio.gitlab.open-project%",
"category": "%command.ibiz-modeling-studio.category%",
"icon": "resources/icon/gitlab.svg"
},
{
"command": "ibiz-modeling-studio.user.login-reply-path-handle",
"title": "处理粘贴板中的登录地址",
@ -145,15 +151,20 @@
"group": "navigation@10"
},
{
"command": "ibiz-modeling-studio.mos-fs.open-model-by-path",
"command": "ibiz-modeling-studio.gitlab.open-project",
"when": "view == iBizExplorer.ModelExpTree",
"group": "navigation@20"
},
{
"command": "ibiz-modeling-studio.mos-fs.search-entity",
"command": "ibiz-modeling-studio.mos-fs.open-model-by-path",
"when": "view == iBizExplorer.ModelExpTree",
"group": "navigation@30"
},
{
"command": "ibiz-modeling-studio.mos-fs.search-entity",
"when": "view == iBizExplorer.ModelExpTree",
"group": "navigation@40"
},
{
"command": "ibiz-modeling-studio.system-info-terminal.show",
"when": "view == iBizExplorer.ModelExpTree",

View File

@ -14,6 +14,7 @@
"command.ibiz-modeling-studio.mos-fs.open-model-by-path": "Open Model By Path",
"command.ibiz-modeling-studio.mos-fs.search-entity": "Search Entity",
"command.ibiz-modeling-studio.mos-fs.search-entity-view": "Search Entity View",
"command.ibiz-modeling-studio.gitlab.open-project": "Open Project GitLab",
"properties.ibiz-modeling-studio.ibiz-modeling-studio-domain": "Modeling Studio Domain",
"properties.ibiz-modeling-studio.console.auto-display": "After the message terminal is closed, the terminal is reopened when the message is received",
"properties.ibiz-modeling-studio.ibiz-modeling-link.enable": "Enable iBizModeling Link Recognition"

View File

@ -14,6 +14,7 @@
"command.ibiz-modeling-studio.mos-fs.open-model-by-path": "根据路径查找模型",
"command.ibiz-modeling-studio.mos-fs.search-entity": "查找实体",
"command.ibiz-modeling-studio.mos-fs.search-entity-view": "查找实体视图",
"command.ibiz-modeling-studio.gitlab.open-project": "打开项目 GitLab",
"properties.ibiz-modeling-studio.ibiz-modeling-studio-domain": "建模工场域",
"properties.ibiz-modeling-studio.console.auto-display": "消息终端关闭后,收到时消息重新打开终端",
"properties.ibiz-modeling-studio.ibiz-modeling-link.enable": "启用 iBizModeling 链接识别"

View File

@ -0,0 +1,27 @@
import { commands, Uri, window } from 'vscode';
import { CommandConst } from '../../constants';
import { ctx } from '../../context';
/**
* gitlab
*
* @author chitanda
* @date 2021-12-13 11:12:57
* @export
* @class OpenProjectCommand
*/
export class OpenProjectCommand {
constructor() {
commands.registerCommand(CommandConst.GITLAB.OPEN_PROJECT, this.execute.bind(this));
}
protected async execute(): Promise<void> {
const gitLab = ctx.get('gitRemote');
if (!gitLab) {
window.showErrorMessage('GitLab 地址不存在,请先在 .ibizproject 中配置');
return;
}
const uri = Uri.parse(gitLab);
commands.executeCommand(CommandConst.VSCODE.OPEN, uri);
}
}

View File

@ -1,4 +1,5 @@
import { ExtensionContext } from 'vscode';
import { OpenProjectCommand } from './gitlab/open-project';
import { OpenIBizModelingCommand } from './ibiz-modeling/open-ibiz-modeling';
import { CopyPathCommand } from './mos-fs/copy-path';
import { OpenFileCommand } from './mos-fs/open-file';
@ -22,6 +23,7 @@ import { UserLogoutCommand } from './user/logout';
* @param {ExtensionContext} _context
*/
export function installCommands(_context: ExtensionContext): void {
new OpenProjectCommand();
new OpenIBizModelingCommand();
// mos-fs 相关
{
@ -33,9 +35,18 @@ export function installCommands(_context: ExtensionContext): void {
new SearchEntityCommand();
new SearchEntityViewCommand();
}
new SystemPublishCommand();
new SystemInfoTerminalShowCommand();
new TemplatePublishCommand();
new UserLoginCommand();
new UserLogoutCommand();
// 系统相关
{
new SystemPublishCommand();
new SystemInfoTerminalShowCommand();
}
// 模板相关
{
new TemplatePublishCommand();
}
// 用户相关
{
new UserLoginCommand();
new UserLogoutCommand();
}
}

View File

@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { GitLabConst } from './gitlab/gitlab';
import { IBizModeling } from './ibiz-modeling/ibiz-modeling';
import { MosFSConst } from './mos-fs/mos-fs';
import { SystemInfoTerminalConst } from './system-info-terminal/system-info-terminal';
@ -33,4 +34,6 @@ export class CommandConst {
static readonly USER: UserConst = new UserConst();
static readonly MOS_FS: MosFSConst = new MosFSConst();
static readonly GITLAB: GitLabConst = new GitLabConst();
}

View File

@ -0,0 +1,18 @@
/* eslint-disable @typescript-eslint/naming-convention */
/**
* gitlab
*
* @author chitanda
* @date 2021-12-13 11:12:37
* @export
* @class GitLabConst
*/
export class GitLabConst {
/**
* gitlab
*
* @author chitanda
* @date 2021-12-13 11:12:47
*/
readonly OPEN_PROJECT = 'ibiz-modeling-studio.gitlab.open-project';
}