mirror of https://github.com/rancher/ui.git
commit
7a147fb56e
|
|
@ -98,13 +98,7 @@ var Pod = Resource.extend(DisplayImage, {
|
||||||
return resource;
|
return resource;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
image: function () {
|
|
||||||
let containers = this.get('containers');
|
|
||||||
if(!containers.length){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return containers[0].image;
|
|
||||||
}.property('containers'),
|
|
||||||
isOn: function() {
|
isOn: function() {
|
||||||
return ['running','migrating','restarting'].indexOf(get(this,'state')) >= 0;
|
return ['running','migrating','restarting'].indexOf(get(this,'state')) >= 0;
|
||||||
}.property('state'),
|
}.property('state'),
|
||||||
|
|
|
||||||
|
|
@ -243,12 +243,16 @@ var Workload = Resource.extend(DisplayImage, StateCounts, EndpointPorts, {
|
||||||
}.property('canScale','scaleMin','scaleIncrement','scale'),
|
}.property('canScale','scaleMin','scaleIncrement','scale'),
|
||||||
|
|
||||||
displayScale: function() {
|
displayScale: function() {
|
||||||
|
let lcType = get(this, 'lcType');
|
||||||
|
if (lcType){
|
||||||
|
return get(this, 'intl').t('servicePage.multistat.daemonSetScale');
|
||||||
|
}
|
||||||
if ( get(this, 'isGlobalScale') ) {
|
if ( get(this, 'isGlobalScale') ) {
|
||||||
return get(this, 'intl').t('servicePage.globalScale', {scale: get(this, 'scale')});
|
return get(this, 'intl').t('servicePage.globalScale', {scale: get(this, 'scale')});
|
||||||
} else {
|
} else {
|
||||||
return get(this, 'scale');
|
return get(this, 'scale');
|
||||||
}
|
}
|
||||||
}.property('scale','isGlobalScale'),
|
}.property('scale','isGlobalScale', 'lcType'),
|
||||||
|
|
||||||
canHaveSidekicks: true,
|
canHaveSidekicks: true,
|
||||||
|
|
||||||
|
|
@ -259,7 +263,8 @@ var Workload = Resource.extend(DisplayImage, StateCounts, EndpointPorts, {
|
||||||
canUpgrade: true,
|
canUpgrade: true,
|
||||||
canHaveLabels: true,
|
canHaveLabels: true,
|
||||||
canScale: computed('lcType', function() {
|
canScale: computed('lcType', function() {
|
||||||
return get(this,'lcType') !== 'cronjob';
|
let lcType = get(this, 'lcType');
|
||||||
|
return lcType !== 'cronjob' && lcType !== 'daemonset';
|
||||||
}),
|
}),
|
||||||
realButNotLb: true,
|
realButNotLb: true,
|
||||||
canHaveLinks: true,
|
canHaveLinks: true,
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row banner bg-info basics mt-0" style="border-top: none;">
|
<div class="row banner bg-info basics mt-0" style="border-top: none;">
|
||||||
{{#if service.canScale}}
|
|
||||||
<div class="vertical-middle">
|
<div class="vertical-middle">
|
||||||
<label class="acc-label vertical-middle p-0">{{t 'servicePage.multistat.scale'}}</label>
|
<label class="acc-label vertical-middle p-0">{{t 'servicePage.multistat.scale'}}</label>
|
||||||
{{#if (eq service.type 'daemonSet')}}
|
|
||||||
{{t "servicePage.multistat.daemonSetScale"}}
|
|
||||||
{{else}}
|
|
||||||
<span class="pr-5">
|
<span class="pr-5">
|
||||||
{{service.displayScale}}
|
{{service.displayScale}}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -60,9 +56,7 @@
|
||||||
<button class="btn btn-xs bg-primary" {{action "scaleDown" target=service}} disabled={{not service.canScaleDown}}><i class="icon icon-minus icon-fw"/></button>
|
<button class="btn btn-xs bg-primary" {{action "scaleDown" target=service}} disabled={{not service.canScaleDown}}><i class="icon icon-minus icon-fw"/></button>
|
||||||
<button style="margin-left: -1px;" class="btn btn-xs bg-primary" {{action "scaleUp" target=service}} disabled={{not service.canScaleUp}}><i class="icon icon-plus icon-fw"/></button>
|
<button style="margin-left: -1px;" class="btn btn-xs bg-primary" {{action "scaleUp" target=service}} disabled={{not service.canScaleUp}}><i class="icon icon-plus icon-fw"/></button>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
|
||||||
<div class="vertical-middle">
|
<div class="vertical-middle">
|
||||||
<label class="acc-label vertical-middle p-0">{{t 'servicePage.multistat.created'}}</label>
|
<label class="acc-label vertical-middle p-0">{{t 'servicePage.multistat.created'}}</label>
|
||||||
{{date-calendar service.created}}
|
{{date-calendar service.created}}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import Component from 'ember-component';
|
import Component from 'ember-component';
|
||||||
import injectService from 'ember-service/inject';
|
import { inject as service } from '@ember/service';
|
||||||
import observer from 'ember-metal/observer';
|
import observer from 'ember-metal/observer';
|
||||||
import { bind, once, scheduleOnce } from 'ember-runloop';
|
import { bind, once, scheduleOnce } from 'ember-runloop';
|
||||||
import CodeMirror from 'codemirror';
|
import CodeMirror from 'codemirror';
|
||||||
|
|
@ -9,7 +9,7 @@ export default Component.extend({
|
||||||
layout,
|
layout,
|
||||||
tagName: 'textarea',
|
tagName: 'textarea',
|
||||||
|
|
||||||
codeMirror: injectService(),
|
codeMirror: service(),
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
@ -17,7 +17,6 @@ export default Component.extend({
|
||||||
var cur = editor.getCursor();
|
var cur = editor.getCursor();
|
||||||
var end = cur.ch, start = end;
|
var end = cur.ch, start = end;
|
||||||
var matched = this.get('codeMirror').getMatchedHint(editor.getValue(),editor);
|
var matched = this.get('codeMirror').getMatchedHint(editor.getValue(),editor);
|
||||||
console.log(matched);
|
|
||||||
return {list: matched.matchedArry, from: CodeMirror.Pos(cur.line, start - matched.index), to: CodeMirror.Pos(cur.line, end)};
|
return {list: matched.matchedArry, from: CodeMirror.Pos(cur.line, start - matched.index), to: CodeMirror.Pos(cur.line, end)};
|
||||||
});
|
});
|
||||||
this._codeMirror = this.get('codeMirror').fromTextArea(this.get('elementId'), this.get('element'));
|
this._codeMirror = this.get('codeMirror').fromTextArea(this.get('elementId'), this.get('element'));
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,14 @@
|
||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
|
import { singleton } from 'pipeline/utils/pipelineStep';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
hintAry: null,
|
hintAry: null,
|
||||||
matchedArry: null,
|
matchedArry: null,
|
||||||
positionX: 0,
|
positionX: 0,
|
||||||
positionY: 0,
|
positionY: 0,
|
||||||
|
activeIndex: 0,
|
||||||
codeMirror: service(),
|
codeMirror: service(),
|
||||||
didInsertElement(){
|
|
||||||
debugger
|
|
||||||
this.get('codeMirror').set('hintAry', this.get('hintAry'));
|
|
||||||
},
|
|
||||||
positionStyle: function(){
|
positionStyle: function(){
|
||||||
var positionX = this.get('positionX'), positionY=this.get('positionY');
|
var positionX = this.get('positionX'), positionY=this.get('positionY');
|
||||||
return [
|
return [
|
||||||
|
|
@ -31,6 +29,11 @@ export default Component.extend({
|
||||||
var hd = this.get('hidden');
|
var hd = this.get('hidden');
|
||||||
return hd?'hide':'';
|
return hd?'hide':'';
|
||||||
}.property('hidden'),
|
}.property('hidden'),
|
||||||
|
hiddenObserve: function () {
|
||||||
|
var hd = this.get('hidden');
|
||||||
|
let triggerInputEle = this.get('triggerInputEle');
|
||||||
|
hd&&this.$(triggerInputEle).focus()||this.$(triggerInputEle).blur();
|
||||||
|
}.observes('hidden'),
|
||||||
showHint(y,x){
|
showHint(y,x){
|
||||||
this.set('positionX',x);
|
this.set('positionX',x);
|
||||||
this.set('positionY',y);
|
this.set('positionY',y);
|
||||||
|
|
@ -98,8 +101,7 @@ export default Component.extend({
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
},
|
},
|
||||||
actions: {
|
setHint(val){
|
||||||
clickHint(val){
|
|
||||||
var triggerClickHint = this.get('triggerClickHint');
|
var triggerClickHint = this.get('triggerClickHint');
|
||||||
triggerClickHint&&triggerClickHint(val)
|
triggerClickHint&&triggerClickHint(val)
|
||||||
var triggerInputEle = this.get('triggerInputEle');
|
var triggerInputEle = this.get('triggerInputEle');
|
||||||
|
|
@ -115,6 +117,11 @@ export default Component.extend({
|
||||||
$(triggerInputEle).trigger('change',newVal);
|
$(triggerInputEle).trigger('change',newVal);
|
||||||
$(triggerInputEle).trigger('input',newVal);
|
$(triggerInputEle).trigger('input',newVal);
|
||||||
}
|
}
|
||||||
|
this.set('hidden',true);
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
clickHint(val){
|
||||||
|
this.setHint(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
didRender(){
|
didRender(){
|
||||||
|
|
@ -137,9 +144,7 @@ export default Component.extend({
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var clickHiden = ()=>{
|
|
||||||
this.set('hidden',true);
|
|
||||||
};
|
|
||||||
var scrollPosition = ()=>{
|
var scrollPosition = ()=>{
|
||||||
var hd = this.get('hidden');
|
var hd = this.get('hidden');
|
||||||
if(hd){
|
if(hd){
|
||||||
|
|
@ -148,17 +153,56 @@ export default Component.extend({
|
||||||
var originalCoordinates = this.get('originalCoordinates');
|
var originalCoordinates = this.get('originalCoordinates');
|
||||||
this.showHint(originalCoordinates.top-this.$(window).scrollTop(),originalCoordinates.left);
|
this.showHint(originalCoordinates.top-this.$(window).scrollTop(),originalCoordinates.left);
|
||||||
};
|
};
|
||||||
this.$(document).on('click.hint', clickHiden).on('scroll.hint', scrollPosition);
|
this.$(document).on('scroll.hint', scrollPosition);
|
||||||
},
|
},
|
||||||
willDestroyElement(){
|
willDestroyElement(){
|
||||||
this._super();
|
this._super();
|
||||||
this.$(document).off('click.hint');
|
this.$(document).off('click.hint');
|
||||||
this.$(document).off('scroll.hint');
|
this.$(document).off('scroll.hint');
|
||||||
|
this.$(document).off('keyup.hint');
|
||||||
|
this.$(document).off('keyup.hint-return');
|
||||||
},
|
},
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
this.$(document).on('keyup', 'input:not(.js-disable-hint)', (e) => {
|
singleton.hintAry = this.get('hintAry');
|
||||||
|
this.$(document).on('keyup.hint', 'input:not(.js-disable-hint)', (e) => {
|
||||||
$.fn.E_INPUT_HINT.startHint(e.target, ( /*hint*/ ) => {});
|
$.fn.E_INPUT_HINT.startHint(e.target, ( /*hint*/ ) => {});
|
||||||
})
|
})
|
||||||
|
let $dropdownEle = this.$('.js-hint-dropdown');
|
||||||
|
let $activeLi ;
|
||||||
|
this.$(document).on('keyup.hint-return', (e) => {
|
||||||
|
let hiddenClass = this.get('hidden');
|
||||||
|
let activeIndex = this.get('activeIndex');
|
||||||
|
let matchedArry = this.get('matchedArry');
|
||||||
|
if(!hiddenClass){
|
||||||
|
switch(e.which){
|
||||||
|
//down
|
||||||
|
case 40:
|
||||||
|
activeIndex +=1;
|
||||||
|
if(activeIndex >= matchedArry.length){
|
||||||
|
activeIndex = matchedArry.length - 1;
|
||||||
|
}
|
||||||
|
this.set('activeIndex', activeIndex);
|
||||||
|
$activeLi = this.$('.js-hint-dropdown>li.active')[0];
|
||||||
|
$dropdownEle.scrollTop($activeLi.offsetTop - $dropdownEle.height() + 2*$activeLi.offsetHeight);
|
||||||
|
break;
|
||||||
|
// up
|
||||||
|
case 38:
|
||||||
|
activeIndex -=1;
|
||||||
|
if(activeIndex < 0 ){
|
||||||
|
activeIndex = 0;
|
||||||
|
}
|
||||||
|
this.set('activeIndex', activeIndex);
|
||||||
|
$activeLi = this.$('.js-hint-dropdown>li.active')[0];
|
||||||
|
$dropdownEle.scrollTop($activeLi.offsetTop - $dropdownEle.height());
|
||||||
|
break;
|
||||||
|
// enter
|
||||||
|
case 13:
|
||||||
|
this.setHint(matchedArry[activeIndex]);
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<div style={{positionStyle}} class={{hiddenClass}} >
|
<div style={{positionStyle}} class={{hiddenClass}} >
|
||||||
<ul class="dropdown-menu" style="position: static;display:inline-block;max-height: 200px;overflow: scroll">
|
<ul class="dropdown-menu js-hint-dropdown" style="position: static;display:inline-block;max-height: 200px;overflow: scroll">
|
||||||
{{#if loading}}
|
{{#if loading}}
|
||||||
<li>loading...</li>
|
<li>loading...</li>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#each matchedArry as |hint|}}
|
{{#each matchedArry as |hint index|}}
|
||||||
<li {{action "clickHint" hint}}> <a href="#">{{hint}}</a> </li>
|
<li class="{{if (eq activeIndex index) 'active' ''}}" {{action "clickHint" hint}}> <a href="#">{{hint}}</a> </li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ export default Component.extend(ThrottledResize, {
|
||||||
showProtip: true,
|
showProtip: true,
|
||||||
status: 'connecting',
|
status: 'connecting',
|
||||||
socket: null,
|
socket: null,
|
||||||
pipeline: service(),
|
|
||||||
logHeight: 300,
|
logHeight: 300,
|
||||||
globalStore: service(),
|
globalStore: service(),
|
||||||
onlyCombinedLog: true,
|
onlyCombinedLog: true,
|
||||||
|
|
@ -74,31 +73,6 @@ export default Component.extend(ThrottledResize, {
|
||||||
inst = this.get('instance');
|
inst = this.get('instance');
|
||||||
var isFollow = ($body.scrollTop() + $body.outerHeight() + 10) >= body.scrollHeight;
|
var isFollow = ($body.scrollTop() + $body.outerHeight() + 10) >= body.scrollHeight;
|
||||||
|
|
||||||
|
|
||||||
// var logs = '';
|
|
||||||
// message.trim().split(/\n/).forEach((line) => {
|
|
||||||
// var match = line.match(/^\[?([^ \]]+)\]?\s?/);
|
|
||||||
// var dateStr, msg;
|
|
||||||
// if (match) {
|
|
||||||
// msg = line.substr(match[0].length);
|
|
||||||
// var date = new Date(match[1] * 1);
|
|
||||||
// dateStr = '<span class="log-date">' + Util.escapeHtml(date.toLocaleDateString()) + ' ' + Util.escapeHtml(date.toLocaleTimeString()) + ' </span>';
|
|
||||||
// } else {
|
|
||||||
// msg = line;
|
|
||||||
// dateStr = '<span class="log-date">Unknown Date</span>';
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // body.insertAdjacentHTML('beforeend',
|
|
||||||
// // '<div class="log-msg">' +
|
|
||||||
// // dateStr +
|
|
||||||
// // AnsiUp.ansi_to_html(Util.escapeHtml(msg)) +
|
|
||||||
// // '</div>'
|
|
||||||
// // );
|
|
||||||
// logs += '<div class="log-msg">' +
|
|
||||||
// dateStr +
|
|
||||||
// AnsiUp.ansi_to_html(Util.escapeHtml(msg)) +
|
|
||||||
// '</div>';
|
|
||||||
// });
|
|
||||||
var logs = message;
|
var logs = message;
|
||||||
|
|
||||||
var logsAry = inst.activityLogs;
|
var logsAry = inst.activityLogs;
|
||||||
|
|
@ -113,10 +87,7 @@ export default Component.extend(ThrottledResize, {
|
||||||
};
|
};
|
||||||
|
|
||||||
var activity = inst.activity;
|
var activity = inst.activity;
|
||||||
// var params = `?activityId=${activity.id}&stageOrdinal=${inst.stageIndex}&stepOrdinal=${inst.stepIndex}`;
|
|
||||||
// var url = ("ws://" + window.location.host + this.get('pipeline.pipelinesEndpoint') + '/ws/log' + params);
|
|
||||||
// var socket = new WebSocket(url);
|
|
||||||
// this.set('socket', socket);
|
|
||||||
let fetchLog = ()=>{
|
let fetchLog = ()=>{
|
||||||
if(inst.stageIndex===-1||inst.stepIndex===-1){
|
if(inst.stageIndex===-1||inst.stepIndex===-1){
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -22,15 +22,7 @@ export default Component.extend({
|
||||||
dragDom: null,
|
dragDom: null,
|
||||||
model: null,
|
model: null,
|
||||||
pipeline: null,
|
pipeline: null,
|
||||||
envvars: ['CICD_GIT_COMMIT',
|
envvars: '[]',
|
||||||
'CICD_GIT_REPO_NAME',
|
|
||||||
'CICD_GIT_BRANCH',
|
|
||||||
'CICD_GIT_URL',
|
|
||||||
'CICD_PIPELINE_ID',
|
|
||||||
'CICD_PIPELINE_NAME',
|
|
||||||
'CICD_TRIGGER_TYPE',
|
|
||||||
'CICD_EXECUTION_ID',
|
|
||||||
'CICD_EXECUTION_SEQUENCE'].map(ele=>`\${${ele}}`),
|
|
||||||
systemVars: null,
|
systemVars: null,
|
||||||
envvarsLoading: true,
|
envvarsLoading: true,
|
||||||
modalService: service('modal'),
|
modalService: service('modal'),
|
||||||
|
|
@ -39,6 +31,7 @@ export default Component.extend({
|
||||||
}.property('editable'),
|
}.property('editable'),
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
this.set('envvars', JSON.parse(this.get('envvars')).map(ele=>`\${${ele}}`));
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
dragStart: function(content, e) {
|
dragStart: function(content, e) {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export default Component.extend({
|
||||||
let runScriptConfig = this.get('runScriptConfig');
|
let runScriptConfig = this.get('runScriptConfig');
|
||||||
let routeState = this.get('routeState');
|
let routeState = this.get('routeState');
|
||||||
if(runScriptConfig.image){
|
if(runScriptConfig.image){
|
||||||
this.set('selectedType', 'Custom');
|
this.setLanguageEnvironment(runScriptConfig);
|
||||||
}else{
|
}else{
|
||||||
let label = this.get('languageToLabel')[routeState.language]|| 'Custom';
|
let label = this.get('languageToLabel')[routeState.language]|| 'Custom';
|
||||||
this.set('selectedType', label);
|
this.set('selectedType', label);
|
||||||
|
|
@ -37,6 +37,35 @@ export default Component.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
setLanguageEnvironment(runScriptConfig){
|
||||||
|
let image = runScriptConfig.image;
|
||||||
|
let selectedType = 'Custom';
|
||||||
|
if(runScriptConfig.isShell){
|
||||||
|
let splitedImage = image.split(':');
|
||||||
|
let imageName = splitedImage[0];
|
||||||
|
let imageTag = 'latest';
|
||||||
|
if(splitedImage[1]){
|
||||||
|
imageTag = splitedImage[1];
|
||||||
|
}
|
||||||
|
let environmentTypes = this.get('environmentTypes');
|
||||||
|
let shouldSelectedType = environmentTypes.find((ele)=>{
|
||||||
|
let eleImageName = ele.value.split(':')[0];
|
||||||
|
if(eleImageName === imageName){
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(shouldSelectedType){
|
||||||
|
selectedType = shouldSelectedType.label;
|
||||||
|
let selectedImage = shouldSelectedType.value.split(':');
|
||||||
|
this.set('customImage',{
|
||||||
|
selectableTags: shouldSelectedType.version,
|
||||||
|
repo: selectedImage[0],
|
||||||
|
tag: selectedImage[1]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.set('selectedType', selectedType);
|
||||||
|
},
|
||||||
selectedTypeObserve: function(){
|
selectedTypeObserve: function(){
|
||||||
let selectedType = this.get('selectedType');
|
let selectedType = this.get('selectedType');
|
||||||
if(selectedType !== 'Custom'){
|
if(selectedType !== 'Custom'){
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
<li {{action "changeTaskModel" true}}>
|
<li {{action "changeTaskModel" true}}>
|
||||||
<a href="javascript:void(0);" class="{{if (eq runScriptConfig.isShell true) 'active' (if (eq modalOpts.type 'review') 'hide')}} ember-view">{{t 'newPipelineStep.stepType.task.shellScript'}}</a>
|
<a href="javascript:void(0);" class="{{if (eq runScriptConfig.isShell true) 'active' (if (eq modalOpts.type 'review') 'hide')}} ember-view">{{t 'newPipelineStep.stepType.task.shellScript'}}</a>
|
||||||
</li>
|
</li>
|
||||||
{{#if (eq selectedType 'custom')}}
|
{{#if (eq selectedType 'Custom')}}
|
||||||
<li {{action "changeTaskModel" false}}>
|
<li {{action "changeTaskModel" false}}>
|
||||||
<a href="javascript:void(0);" class="{{if (eq runScriptConfig.isShell false) 'active' (if (eq modalOpts.type 'review') 'hide')}} ember-view">{{t 'newPipelineStep.stepType.task.customEntryPoint'}}</a>
|
<a href="javascript:void(0);" class="{{if (eq runScriptConfig.isShell false) 'active' (if (eq modalOpts.type 'review') 'hide')}} ember-view">{{t 'newPipelineStep.stepType.task.customEntryPoint'}}</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,13 @@ export default Route.extend({
|
||||||
let accounts = globalStore.findAll('sourceCodeCredential');
|
let accounts = globalStore.findAll('sourceCodeCredential');
|
||||||
let clusterPipeline = globalStore.find('clusterPipeline', `${clusterId}:${clusterId}`, {forceReload: true});
|
let clusterPipeline = globalStore.find('clusterPipeline', `${clusterId}:${clusterId}`, {forceReload: true});
|
||||||
let projectDockerCredentials = projectStore.all('dockerCredential');
|
let projectDockerCredentials = projectStore.all('dockerCredential');
|
||||||
return hash({accounts, clusterPipeline, projectDockerCredentials} ).then(({accounts, clusterPipeline, projectDockerCredentials})=>{
|
return clusterPipeline.then((pipeline)=>{
|
||||||
|
clusterPipeline = pipeline;
|
||||||
|
return clusterPipeline.followLink('envvars')
|
||||||
|
}).then((envvars)=>{
|
||||||
|
return hash({accounts, clusterPipeline, projectDockerCredentials,envvars})
|
||||||
|
})
|
||||||
|
.then(({accounts, clusterPipeline, projectDockerCredentials, envvars})=>{
|
||||||
let pipeline = globalStore.createRecord({type:'pipeline', projectId , stages: this.get('precanStages')});
|
let pipeline = globalStore.createRecord({type:'pipeline', projectId , stages: this.get('precanStages')});
|
||||||
if(!accounts.content.length){
|
if(!accounts.content.length){
|
||||||
return {
|
return {
|
||||||
|
|
@ -40,6 +46,7 @@ export default Route.extend({
|
||||||
accounts,
|
accounts,
|
||||||
clusterPipeline,
|
clusterPipeline,
|
||||||
projectDockerCredentials,
|
projectDockerCredentials,
|
||||||
|
envvars,
|
||||||
repositories: [],
|
repositories: [],
|
||||||
language: 'Custom'
|
language: 'Custom'
|
||||||
};
|
};
|
||||||
|
|
@ -50,6 +57,7 @@ export default Route.extend({
|
||||||
accounts,
|
accounts,
|
||||||
clusterPipeline,
|
clusterPipeline,
|
||||||
projectDockerCredentials,
|
projectDockerCredentials,
|
||||||
|
envvars,
|
||||||
repositories: res,
|
repositories: res,
|
||||||
language: 'Custom'
|
language: 'Custom'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
<section class="pipeline-container">
|
<section class="pipeline-container">
|
||||||
{{pipeline-stages
|
{{pipeline-stages
|
||||||
clusterPipeline=model.clusterPipeline
|
clusterPipeline=model.clusterPipeline
|
||||||
|
envvars=model.envvars
|
||||||
pipeline=model.pipeline
|
pipeline=model.pipeline
|
||||||
stagesDraggable=true
|
stagesDraggable=true
|
||||||
accounts=model.accounts
|
accounts=model.accounts
|
||||||
|
|
|
||||||
|
|
@ -24,18 +24,25 @@ export default Route.extend({
|
||||||
let accounts = globalStore.findAll('sourceCodeCredential');
|
let accounts = globalStore.findAll('sourceCodeCredential');
|
||||||
let clusterPipeline = globalStore.find('clusterPipeline', `${clusterId}:${clusterId}`);
|
let clusterPipeline = globalStore.find('clusterPipeline', `${clusterId}:${clusterId}`);
|
||||||
let projectDockerCredentials = projectStore.all('dockerCredential');
|
let projectDockerCredentials = projectStore.all('dockerCredential');
|
||||||
|
return clusterPipeline.then((cPipeline)=>{
|
||||||
|
clusterPipeline = cPipeline;
|
||||||
|
return clusterPipeline.followLink('envvars')
|
||||||
|
}).then((envvars)=>{
|
||||||
return hash({
|
return hash({
|
||||||
pipeline,
|
pipeline,
|
||||||
pipelineHistory,
|
pipelineHistory,
|
||||||
accounts,
|
accounts,
|
||||||
clusterPipeline,
|
clusterPipeline,
|
||||||
projectDockerCredentials,
|
projectDockerCredentials,
|
||||||
|
envvars
|
||||||
|
})
|
||||||
}).then(({
|
}).then(({
|
||||||
pipeline,
|
pipeline,
|
||||||
pipelineHistory,
|
pipelineHistory,
|
||||||
accounts,
|
accounts,
|
||||||
clusterPipeline,
|
clusterPipeline,
|
||||||
projectDockerCredentials,
|
projectDockerCredentials,
|
||||||
|
envvars
|
||||||
})=>{
|
})=>{
|
||||||
var piplineObj;
|
var piplineObj;
|
||||||
if(params.mode === 'duplicate'){
|
if(params.mode === 'duplicate'){
|
||||||
|
|
@ -61,6 +68,7 @@ export default Route.extend({
|
||||||
accounts,
|
accounts,
|
||||||
clusterPipeline,
|
clusterPipeline,
|
||||||
projectDockerCredentials,
|
projectDockerCredentials,
|
||||||
|
envvars,
|
||||||
repositories: [],
|
repositories: [],
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -73,6 +81,7 @@ export default Route.extend({
|
||||||
accounts,
|
accounts,
|
||||||
clusterPipeline,
|
clusterPipeline,
|
||||||
projectDockerCredentials,
|
projectDockerCredentials,
|
||||||
|
envvars,
|
||||||
repositories: res,
|
repositories: res,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
<section class="pipeline-container">
|
<section class="pipeline-container">
|
||||||
{{pipeline-stages
|
{{pipeline-stages
|
||||||
clusterPipeline=model.clusterPipeline
|
clusterPipeline=model.clusterPipeline
|
||||||
|
envvars=model.envvars
|
||||||
pipeline=model.pipeline
|
pipeline=model.pipeline
|
||||||
stagesDraggable=false
|
stagesDraggable=false
|
||||||
accounts=model.accounts
|
accounts=model.accounts
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,14 @@
|
||||||
import CodeMirror from 'codemirror';
|
import CodeMirror from 'codemirror';
|
||||||
import Service from 'ember-service';
|
import Service from 'ember-service';
|
||||||
|
import { singleton } from 'pipeline/utils/pipelineStep';
|
||||||
|
import { set, get } from '@ember/object';
|
||||||
|
|
||||||
export default Service.extend({
|
export default Service.extend({
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
this._instances = Object.create(null);
|
this._instances = Object.create(null);
|
||||||
},
|
},
|
||||||
hintAry: ['CICD_GIT_COMMIT',
|
|
||||||
'CICD_GIT_REPO_NAME',
|
|
||||||
'CICD_GIT_BRANCH',
|
|
||||||
'CICD_GIT_URL',
|
|
||||||
'CICD_PIPELINE_ID',
|
|
||||||
'CICD_PIPELINE_NAME',
|
|
||||||
'CICD_TRIGGER_TYPE',
|
|
||||||
'CICD_EXECUTION_ID',
|
|
||||||
'CICD_EXECUTION_SEQUENCE'].map(ele=>`\${${ele}}`),
|
|
||||||
fromTextArea(id, textarea) {
|
fromTextArea(id, textarea) {
|
||||||
return this.registerInstance(id, CodeMirror.fromTextArea(textarea));
|
return this.registerInstance(id, CodeMirror.fromTextArea(textarea));
|
||||||
},
|
},
|
||||||
|
|
@ -37,7 +31,7 @@ export default Service.extend({
|
||||||
delete this._instances[id];
|
delete this._instances[id];
|
||||||
},
|
},
|
||||||
getMatchedHint(value, editor) {
|
getMatchedHint(value, editor) {
|
||||||
var hintAry = this.get('hintAry');
|
var hintAry = singleton.hintAry;
|
||||||
var cur = editor.getCursor();
|
var cur = editor.getCursor();
|
||||||
var cursorPosition = cur.ch;
|
var cursorPosition = cur.ch;
|
||||||
var cursorValue = editor.getLine(cur.line).slice(0, cursorPosition);
|
var cursorValue = editor.getLine(cur.line).slice(0, cursorPosition);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import Service from '@ember/service';
|
import Service from '@ember/service';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
|
|
||||||
|
|
||||||
export default Service.extend({
|
export default Service.extend({
|
||||||
globalStore: service(),
|
globalStore: service(),
|
||||||
scope: service(),
|
scope: service(),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
const DEFAULT_REGISTRY = 'index.docker.io';
|
const DEFAULT_REGISTRY = 'index.docker.io';
|
||||||
|
|
||||||
|
export let singleton = {
|
||||||
|
hintAry: []
|
||||||
|
}
|
||||||
|
|
||||||
export function analyzeImageRepo (images) {
|
export function analyzeImageRepo (images) {
|
||||||
if(!images){
|
if(!images){
|
||||||
return '';
|
return '';
|
||||||
|
|
@ -35,6 +39,7 @@ export function analyzeImageRepo (images) {
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const environmentTypes = [{
|
export const environmentTypes = [{
|
||||||
label: 'C',
|
label: 'C',
|
||||||
value: 'gcc:latest',
|
value: 'gcc:latest',
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,12 @@ export default Component.extend(ManageLabels, {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'name',
|
name: 'name',
|
||||||
sort: ['key'],
|
sort: ['name'],
|
||||||
translationKey: 'generic.name',
|
translationKey: 'generic.name',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'image',
|
name: 'displayImage',
|
||||||
sort: ['value','key'],
|
sort: ['displayImage'],
|
||||||
translationKey: 'generic.image',
|
translationKey: 'generic.image',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@
|
||||||
<td data-title="{{dt.name}}">
|
<td data-title="{{dt.name}}">
|
||||||
{{inst.name}}
|
{{inst.name}}
|
||||||
</td>
|
</td>
|
||||||
<td data-title="{{dt.image}}">
|
<td data-title="{{dt.displayImage}}">
|
||||||
{{inst.image}}
|
{{inst.displayImage}}
|
||||||
</td>
|
</td>
|
||||||
<td data-title="{{dt.displayIp}}">
|
<td data-title="{{dt.displayIp}}">
|
||||||
{{inst.displayIp}}
|
{{inst.displayIp}}
|
||||||
|
|
|
||||||
|
|
@ -56,11 +56,6 @@
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{#if ary.length}}
|
|
||||||
<div class="protip mb-5">
|
|
||||||
{{t 'formKeyValue.protip'}}
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#unless editing}}
|
{{#unless editing}}
|
||||||
<div>{{t 'generic.none'}}</div>
|
<div>{{t 'generic.none'}}</div>
|
||||||
|
|
@ -68,6 +63,11 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if (and editing allowAdd)}}
|
{{#if (and editing allowAdd)}}
|
||||||
|
{{#if ary.length}}
|
||||||
|
<div class="protip mb-5">
|
||||||
|
{{t 'formKeyValue.protip'}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
<div>
|
<div>
|
||||||
<button class="btn bg-link icon-btn p-0" {{action "add"}}>
|
<button class="btn bg-link icon-btn p-0" {{action "add"}}>
|
||||||
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
||||||
|
|
|
||||||
|
|
@ -37,3 +37,7 @@ li.CodeMirror-hint-active {
|
||||||
background: #08f;
|
background: #08f;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
.CodeMirror-hints > li:hover {
|
||||||
|
background: #08f;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue