add: 上下文加入 package 文件内容
This commit is contained in:
parent
7ca40bea6d
commit
92938fb0a2
|
@ -2,6 +2,7 @@ import { commands, ExtensionContext, workspace, WorkspaceConfiguration } from 'v
|
|||
import { ConfigConst, RTContextConst } from '../constants';
|
||||
import { IBizMosFSCustom } from '../file-system';
|
||||
import { GlobalContextData } from '../interface';
|
||||
import { getPackageJson } from '../util';
|
||||
import { Websocket } from '../ws';
|
||||
|
||||
/**
|
||||
|
@ -63,6 +64,34 @@ export class GlobalContext {
|
|||
return this._mosFS;
|
||||
}
|
||||
|
||||
/**
|
||||
* package.json 内容
|
||||
*
|
||||
* @author chitanda
|
||||
* @date 2021-12-09 11:12:21
|
||||
* @private
|
||||
* @type {Record<string, any>}
|
||||
*/
|
||||
private _package?: Record<string, any>;
|
||||
get package(): Record<string, any> {
|
||||
if (!this._package) {
|
||||
this._package = getPackageJson();
|
||||
}
|
||||
return this._package;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前插件版本
|
||||
*
|
||||
* @author chitanda
|
||||
* @date 2021-12-09 11:12:42
|
||||
* @readonly
|
||||
* @type {string}
|
||||
*/
|
||||
get version(): string {
|
||||
return this.package.version;
|
||||
}
|
||||
|
||||
/**
|
||||
* 认证信息缓存标识
|
||||
*
|
||||
|
|
|
@ -23,7 +23,7 @@ export class IBizModelRuntimeEditorProvider extends CustomEditorBase {
|
|||
const resetCssUri = this.getResourcesUri('css/custom-editor-reset.css');
|
||||
const cssUri = this.getResourcesUri('css/custom-iframe-editor.css');
|
||||
const jsUri = this.getResourcesUri('js/custom-iframe-editor.js');
|
||||
const iframe = this.getIframeElement(`${address}/model-runtime/`);
|
||||
const iframe = this.getIframeElement(`${address}/model-runtime/?${ctx.version}`);
|
||||
return `<!DOCTYPE html>
|
||||
<html lang='en'>
|
||||
<head>
|
||||
|
|
|
@ -74,7 +74,7 @@ export class IBizModelUIEditorProvider extends CustomEditorBase {
|
|||
} else if (!url.endsWith('&')) {
|
||||
url += '&';
|
||||
}
|
||||
url += `platform=vscode`;
|
||||
url += `platform=vscode&version=${ctx.version}`;
|
||||
urls[0] = url;
|
||||
iframeUrl = urls.join('#');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue