Skip to content

Commit a74f5eb

Browse files
committed
chore: merge
2 parents a463467 + af77f8e commit a74f5eb

File tree

8 files changed

+111
-26
lines changed

8 files changed

+111
-26
lines changed

db/sql/runner.go

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package sql
44

55
import (
6+
"github.com/Masterminds/squirrel"
67
"github.com/semaphoreui/semaphore/db"
78
)
89

@@ -21,6 +22,26 @@ func (d *SqlDb) DeleteRunner(projectID int, runnerID int) (err error) {
2122
return
2223
}
2324

24-
func (d *SqlDb) GetRunnerTags(projectID int) ([]db.RunnerTag, error) {
25-
return []db.RunnerTag{}, nil
25+
func (d *SqlDb) GetRunnerTags(projectID int) (res []db.RunnerTag, err error) {
26+
query, args, err := squirrel.Select("tag").
27+
From("runner as r").
28+
Where(squirrel.Eq{"r.project_id": projectID}).
29+
Where(squirrel.NotEq{"r.tag": ""}).
30+
ToSql()
31+
32+
if err != nil {
33+
return
34+
}
35+
36+
runners := make([]db.Runner, 0)
37+
_, err = d.selectAll(&runners, query, args...)
38+
39+
res = make([]db.RunnerTag, 0)
40+
for _, r := range runners {
41+
res = append(res, db.RunnerTag{
42+
Tag: r.Tag,
43+
})
44+
}
45+
46+
return
2647
}

services/tasks/TaskPool.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,17 @@ func (p *TaskPool) AddTask(
591591

592592
var job Job
593593

594-
if util.Config.UseRemoteRunner || taskRunner.Template.RunnerTag != nil {
594+
if util.Config.UseRemoteRunner ||
595+
taskRunner.Template.RunnerTag != nil ||
596+
taskRunner.Inventory.RunnerTag != nil {
597+
598+
tag := taskRunner.Template.RunnerTag
599+
if tag == nil {
600+
tag = taskRunner.Inventory.RunnerTag
601+
}
602+
595603
job = &RemoteJob{
596-
RunnerTag: taskRunner.Template.RunnerTag,
604+
RunnerTag: tag,
597605
Task: taskRunner.Task,
598606
taskPool: p,
599607
}

web/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@
485485
<v-list-item
486486
key="runners"
487487
to="/runners"
488-
v-if="user.admin && systemInfo.use_remote_runner"
488+
v-if="user.admin"
489489
>
490490
<v-list-item-icon>
491491
<v-icon>mdi-cogs</v-icon>

web/src/components/EditDialog.vue

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ Can use used in tandem with ItemFormBase.js. See KeyForm.vue for example.
1010
persistent
1111
:fullscreen="expandable && fullscreen"
1212
:transition="false"
13-
:content-class="`item-dialog item-dialog--${position} ${contentClass || ''}`"
13+
:content-class="
14+
`item-dialog ${ expandable ? 'item-dialog--expandable' : ''}
15+
item-dialog--${position} ${contentClass || ''}`
16+
"
1417
>
1518
<v-card :data-testid="testId">
1619
<v-card-title>
@@ -21,23 +24,26 @@ Can use used in tandem with ItemFormBase.js. See KeyForm.vue for example.
2124

2225
<v-spacer></v-spacer>
2326

24-
<v-btn
25-
icon
26-
@click="toggleHelp()"
27-
class="mr-3"
28-
:style="{opacity: needHelp ? 1 : 0.3}"
29-
v-if="helpButton"
30-
>
31-
<v-icon>mdi-help-box</v-icon>
32-
</v-btn>
27+
<div class="item-dialog__title-actions">
28+
<v-btn
29+
icon
30+
@click="toggleHelp()"
31+
class="mr-3"
32+
:style="{opacity: needHelp ? 1 : 0.3}"
33+
v-if="helpButton"
34+
>
35+
<v-icon>mdi-help-box</v-icon>
36+
</v-btn>
37+
38+
<v-btn icon @click="toggleFullscreen()" class="mr-3" v-if="expandable">
39+
<v-icon>mdi-arrow-{{ fullscreen ? 'collapse' : 'expand' }}</v-icon>
40+
</v-btn>
41+
42+
<v-btn icon @click="close()" data-testid="editDialog-close">
43+
<v-icon>mdi-close</v-icon>
44+
</v-btn>
45+
</div>
3346

34-
<v-btn icon @click="toggleFullscreen()" class="mr-3" v-if="expandable">
35-
<v-icon>mdi-arrow-{{ fullscreen ? 'collapse' : 'expand' }}</v-icon>
36-
</v-btn>
37-
38-
<v-btn icon @click="close()" style="margin-right: -6px;" data-testid="editDialog-close">
39-
<v-icon>mdi-close</v-icon>
40-
</v-btn>
4147
</v-card-title>
4248

4349
<v-card-text
@@ -87,7 +93,30 @@ Can use used in tandem with ItemFormBase.js. See KeyForm.vue for example.
8793
.item-dialog--top {
8894
align-self: flex-start;
8995
}
90-
.item-dialog--center {
96+
97+
.item-dialog__title-actions {
98+
position: absolute;
99+
right: 12px;
100+
}
101+
102+
.item-dialog {
103+
.v-card__title {
104+
white-space: nowrap;
105+
overflow: hidden;
106+
margin-right: 12px;
107+
}
108+
}
109+
110+
.theme--dark {
111+
.item-dialog__title-actions {
112+
background: #1E1E1E;
113+
}
114+
}
115+
116+
.theme--light {
117+
.item-dialog__title-actions {
118+
background: white;
119+
}
91120
}
92121
</style>
93122
<script>

web/src/components/InventoryForm.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
list-item-two-line,
99
list-item-two-line,
1010
list-item-two-line,
11+
<<<<<<< HEAD
1112
list-item-two-line,
1213
list-item-two-line,
1314
list-item-two-line,
15+
=======
16+
>>>>>>> inventory_runner
1417
list-item-two-line"
1518
></v-skeleton-loader>
1619
<v-form

web/src/components/NewTaskDialog.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
>
1010
<template v-slot:title={}>
1111
<v-icon small class="mr-4">{{ TEMPLATE_TYPE_ICONS[template?.type || ''] }}</v-icon>
12-
<span class="breadcrumbs__item">{{ template?.name || '' }}</span>
12+
<span class="breadcrumbs__item">{{ templateTitle }}</span>
1313
<v-icon>mdi-chevron-right</v-icon>
1414
<span class="breadcrumbs__item">{{ $t('newTask') }}</span>
1515
</template>
@@ -63,6 +63,17 @@ export default {
6363
},
6464
},
6565
66+
computed: {
67+
templateTitle() {
68+
let res = this.template?.name || '';
69+
if (res.length > 16) {
70+
res = `${res.substring(0, 14)}...`;
71+
}
72+
73+
return res;
74+
},
75+
},
76+
6677
methods: {
6778
closeDialog(e) {
6879
this.dialog = false;

web/src/views/Runners.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,26 @@
266266
<v-btn
267267
class="ml-2 pr-2"
268268
color="hsl(348deg, 86%, 61%)"
269-
href="https://semaphoreui.com/pro"
269+
href="https://semaphoreui.com/pro#runners"
270270
>
271271
{{ $t('learn_more_about_pro') }}
272272
<v-icon>mdi-chevron-right</v-icon>
273273
</v-btn>
274274
</v-alert>
275275

276+
<v-alert
277+
style="border-radius: 0;"
278+
type="info"
279+
text
280+
v-if="!systemInfo.use_remote_runner && projectId == null"
281+
>
282+
Global runners
283+
<a
284+
target="_blank"
285+
href="https://docs.semaphoreui.com/administration-guide/runners/#set-up-a-server"
286+
>disabled</a>.
287+
</v-alert>
288+
276289
<v-data-table
277290
:headers="headers"
278291
:items="items"

web/src/views/project/template/TemplateTerraformState.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
</span>
193193
<v-btn
194194
color="hsl(348deg, 86%, 61%)"
195-
href="https://semaphoreui.com/pro"
195+
href="https://semaphoreui.com/pro#runners"
196196
>
197197
Learn more
198198
<v-icon>mdi-chevron-right</v-icon>

0 commit comments

Comments
 (0)