add: 模型导航,直接打开项目对应 gitlab
This commit is contained in:
parent
38d92d6f51
commit
b19a3b3203
15
package.json
15
package.json
|
@ -131,6 +131,12 @@
|
||||||
"dark": "resources/icon/dark/search-entity-view.svg"
|
"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",
|
"command": "ibiz-modeling-studio.user.login-reply-path-handle",
|
||||||
"title": "处理粘贴板中的登录地址",
|
"title": "处理粘贴板中的登录地址",
|
||||||
|
@ -145,15 +151,20 @@
|
||||||
"group": "navigation@10"
|
"group": "navigation@10"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "ibiz-modeling-studio.mos-fs.open-model-by-path",
|
"command": "ibiz-modeling-studio.gitlab.open-project",
|
||||||
"when": "view == iBizExplorer.ModelExpTree",
|
"when": "view == iBizExplorer.ModelExpTree",
|
||||||
"group": "navigation@20"
|
"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",
|
"when": "view == iBizExplorer.ModelExpTree",
|
||||||
"group": "navigation@30"
|
"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",
|
"command": "ibiz-modeling-studio.system-info-terminal.show",
|
||||||
"when": "view == iBizExplorer.ModelExpTree",
|
"when": "view == iBizExplorer.ModelExpTree",
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"command.ibiz-modeling-studio.mos-fs.open-model-by-path": "Open Model By Path",
|
"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": "Search Entity",
|
||||||
"command.ibiz-modeling-studio.mos-fs.search-entity-view": "Search Entity View",
|
"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.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.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"
|
"properties.ibiz-modeling-studio.ibiz-modeling-link.enable": "Enable iBizModeling Link Recognition"
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"command.ibiz-modeling-studio.mos-fs.open-model-by-path": "根据路径查找模型",
|
"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": "查找实体",
|
||||||
"command.ibiz-modeling-studio.mos-fs.search-entity-view": "查找实体视图",
|
"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.ibiz-modeling-studio-domain": "建模工场域",
|
||||||
"properties.ibiz-modeling-studio.console.auto-display": "消息终端关闭后,收到时消息重新打开终端",
|
"properties.ibiz-modeling-studio.console.auto-display": "消息终端关闭后,收到时消息重新打开终端",
|
||||||
"properties.ibiz-modeling-studio.ibiz-modeling-link.enable": "启用 iBizModeling 链接识别"
|
"properties.ibiz-modeling-studio.ibiz-modeling-link.enable": "启用 iBizModeling 链接识别"
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
import { ExtensionContext } from 'vscode';
|
import { ExtensionContext } from 'vscode';
|
||||||
|
import { OpenProjectCommand } from './gitlab/open-project';
|
||||||
import { OpenIBizModelingCommand } from './ibiz-modeling/open-ibiz-modeling';
|
import { OpenIBizModelingCommand } from './ibiz-modeling/open-ibiz-modeling';
|
||||||
import { CopyPathCommand } from './mos-fs/copy-path';
|
import { CopyPathCommand } from './mos-fs/copy-path';
|
||||||
import { OpenFileCommand } from './mos-fs/open-file';
|
import { OpenFileCommand } from './mos-fs/open-file';
|
||||||
|
@ -22,6 +23,7 @@ import { UserLogoutCommand } from './user/logout';
|
||||||
* @param {ExtensionContext} _context
|
* @param {ExtensionContext} _context
|
||||||
*/
|
*/
|
||||||
export function installCommands(_context: ExtensionContext): void {
|
export function installCommands(_context: ExtensionContext): void {
|
||||||
|
new OpenProjectCommand();
|
||||||
new OpenIBizModelingCommand();
|
new OpenIBizModelingCommand();
|
||||||
// mos-fs 相关
|
// mos-fs 相关
|
||||||
{
|
{
|
||||||
|
@ -33,9 +35,18 @@ export function installCommands(_context: ExtensionContext): void {
|
||||||
new SearchEntityCommand();
|
new SearchEntityCommand();
|
||||||
new SearchEntityViewCommand();
|
new SearchEntityViewCommand();
|
||||||
}
|
}
|
||||||
|
// 系统相关
|
||||||
|
{
|
||||||
new SystemPublishCommand();
|
new SystemPublishCommand();
|
||||||
new SystemInfoTerminalShowCommand();
|
new SystemInfoTerminalShowCommand();
|
||||||
|
}
|
||||||
|
// 模板相关
|
||||||
|
{
|
||||||
new TemplatePublishCommand();
|
new TemplatePublishCommand();
|
||||||
|
}
|
||||||
|
// 用户相关
|
||||||
|
{
|
||||||
new UserLoginCommand();
|
new UserLoginCommand();
|
||||||
new UserLogoutCommand();
|
new UserLogoutCommand();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
|
|
||||||
|
import { GitLabConst } from './gitlab/gitlab';
|
||||||
import { IBizModeling } from './ibiz-modeling/ibiz-modeling';
|
import { IBizModeling } from './ibiz-modeling/ibiz-modeling';
|
||||||
import { MosFSConst } from './mos-fs/mos-fs';
|
import { MosFSConst } from './mos-fs/mos-fs';
|
||||||
import { SystemInfoTerminalConst } from './system-info-terminal/system-info-terminal';
|
import { SystemInfoTerminalConst } from './system-info-terminal/system-info-terminal';
|
||||||
|
@ -33,4 +34,6 @@ export class CommandConst {
|
||||||
static readonly USER: UserConst = new UserConst();
|
static readonly USER: UserConst = new UserConst();
|
||||||
|
|
||||||
static readonly MOS_FS: MosFSConst = new MosFSConst();
|
static readonly MOS_FS: MosFSConst = new MosFSConst();
|
||||||
|
|
||||||
|
static readonly GITLAB: GitLabConst = new GitLabConst();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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';
|
||||||
|
}
|
Loading…
Reference in New Issue