Skip to content

Commit c169f1f

Browse files
authored
Merge pull request coollabsio#3467 from coollabsio/next
v4.0.0-beta.339
2 parents 6f57885 + 5ecf31d commit c169f1f

File tree

13 files changed

+100
-34
lines changed

13 files changed

+100
-34
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Remove Labels and Assignees on Issue Close
2+
3+
on:
4+
issues:
5+
types: [closed]
6+
pull_request:
7+
types: [closed]
8+
pull_request_target:
9+
types: [closed]
10+
11+
jobs:
12+
remove-labels-and-assignees:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Remove labels and assignees
16+
uses: actions/github-script@v7
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
script: |
20+
const { owner, repo } = context.repo;
21+
22+
async function processIssue(issueNumber) {
23+
try {
24+
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({
25+
owner,
26+
repo,
27+
issue_number: issueNumber
28+
});
29+
30+
const labelsToKeep = currentLabels
31+
.filter(label => label.name === '⏱︎ Stale')
32+
.map(label => label.name);
33+
34+
await github.rest.issues.setLabels({
35+
owner,
36+
repo,
37+
issue_number: issueNumber,
38+
labels: labelsToKeep
39+
});
40+
41+
const { data: issue } = await github.rest.issues.get({
42+
owner,
43+
repo,
44+
issue_number: issueNumber
45+
});
46+
47+
if (issue.assignees && issue.assignees.length > 0) {
48+
await github.rest.issues.removeAssignees({
49+
owner,
50+
repo,
51+
issue_number: issueNumber,
52+
assignees: issue.assignees.map(assignee => assignee.login)
53+
});
54+
}
55+
} catch (error) {
56+
if (error.status !== 404) {
57+
console.error(`Error processing issue ${issueNumber}:`, error);
58+
}
59+
}
60+
}
61+
62+
if (context.eventName === 'issues' || context.eventName === 'pull_request' || context.eventName === 'pull_request_target') {
63+
const issue = context.payload.issue || context.payload.pull_request;
64+
await processIssue(issue.number);
65+
}
66+
67+
if (context.eventName === 'pull_request' || context.eventName === 'pull_request_target') {
68+
const { data: closedIssues } = await github.rest.search.issuesAndPullRequests({
69+
q: `repo:${owner}/${repo} is:issue is:closed linked:${context.payload.pull_request.number}`,
70+
per_page: 100
71+
});
72+
for (const issue of closedIssues.items) {
73+
await processIssue(issue.number);
74+
}
75+
}

app/Livewire/Project/Service/Navbar.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class Navbar extends Component
2020

2121
public $isDeploymentProgress = false;
2222

23+
public $title = 'Configuration';
24+
2325
public function mount()
2426
{
2527
if (str($this->service->status())->contains('running') && is_null($this->service->config_hash)) {

app/Livewire/Project/Shared/ExecuteContainerCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class ExecuteContainerCommand extends Component
3333

3434
public function mount()
3535
{
36+
if (! auth()->user()->isAdmin()) {
37+
abort(403);
38+
}
3639
$this->parameters = get_route_parameters();
3740
$this->containers = collect();
3841
$this->servers = collect();
@@ -130,7 +133,6 @@ public function connectToContainer()
130133
{
131134
try {
132135
$container_name = data_get($this->container, 'container.Names');
133-
ray($this->container);
134136
if (is_null($container_name)) {
135137
throw new \RuntimeException('Container not found.');
136138
}

app/Livewire/Project/Shared/Terminal.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ public function sendTerminalCommand($isContainer, $identifier, $serverUuid)
1414

1515
$server = Server::ownedByCurrentTeam()->whereUuid($serverUuid)->firstOrFail();
1616

17-
// if (auth()->user()) {
18-
// $teams = auth()->user()->teams->pluck('id');
19-
// if (! $teams->contains($server->team_id) && ! $teams->contains(0)) {
20-
// throw new \Exception('User is not part of the team that owns this server');
21-
// }
22-
// }
23-
2417
if ($isContainer) {
2518
$status = getContainerStatus($server, $identifier);
2619
if ($status !== 'running') {

config/sentry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// The release version of your application
99
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
10-
'release' => '4.0.0-beta.338',
10+
'release' => '4.0.0-beta.339',
1111
// When left empty or `null` the Laravel environment will be used
1212
'environment' => config('app.env'),
1313

config/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
return '4.0.0-beta.338';
3+
return '4.0.0-beta.339';

other/nightly/versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"coolify": {
33
"v4": {
4-
"version": "4.0.0-beta.338"
4+
"version": "4.0.0-beta.339"
55
},
66
"nightly": {
7-
"version": "4.0.0-beta.339"
7+
"version": "4.0.0-beta.340"
88
},
99
"helper": {
1010
"version": "1.0.1"

resources/views/livewire/project/service/configuration.blade.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
@click.prevent="activeTab = 'scheduled-tasks'; window.location.hash = 'scheduled-tasks'"
2424
href="#">Scheduled Tasks
2525
</a>
26-
<a class="menu-item sm:min-w-fit" :class="activeTab === 'terminal' && 'menu-item-active'"
27-
@click.prevent="activeTab = 'terminal';
28-
window.location.hash = 'terminal'"
29-
href="#">Terminal</a>
3026
<a class="menu-item sm:min-w-fit" :class="activeTab === 'logs' && 'menu-item-active'"
3127
@click.prevent="activeTab = 'logs';
3228
window.location.hash = 'logs'"
@@ -191,9 +187,6 @@ class="w-4 h-4 dark:text-warning text-coollabs"
191187
<div x-cloak x-show="activeTab === 'logs'">
192188
<livewire:project.shared.logs :resource="$service" />
193189
</div>
194-
<div x-cloak x-show="activeTab === 'terminal'">
195-
<livewire:project.shared.execute-container-command :resource="$service" />
196-
</div>
197190
<div x-cloak x-show="activeTab === 'environment-variables'">
198191
<livewire:project.shared.environment-variable.all :resource="$service" />
199192
</div>

resources/views/livewire/project/service/navbar.blade.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@
66
<livewire:activity-monitor header="Logs" showWaiting fullHeight />
77
</x-slot:content>
88
</x-slide-over>
9-
<h1>Configuration</h1>
9+
<h1>{{ $title }}</h1>
1010
<x-resources.breadcrumbs :resource="$service" :parameters="$parameters" />
1111
<div class="navbar-main" x-data>
12-
<nav class="flex items-center flex-shrink-0 gap-6 scrollbar min-h-10 whitespace-nowrap">
12+
<nav class="flex flex-shrink-0 gap-6 items-center whitespace-nowrap scrollbar min-h-10">
1313
<a class="{{ request()->routeIs('project.service.configuration') ? 'dark:text-white' : '' }}"
1414
href="{{ route('project.service.configuration', $parameters) }}">
1515
<button>Configuration</button>
1616
</a>
17+
<a class="{{ request()->routeIs('project.service.command') ? 'dark:text-white' : '' }}"
18+
href="{{ route('project.service.command', $parameters) }}">
19+
<button>Terminal</button>
20+
</a>
1721
<x-services.links :service="$service" />
1822
</nav>
19-
<div class="flex flex-wrap items-center order-first gap-2 sm:order-last">
23+
<div class="flex flex-wrap order-first gap-2 items-center sm:order-last">
2024
@if (str($service->status())->contains('running'))
2125
<button @click="$wire.dispatch('restartEvent')" class="gap-2 button">
2226
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
@@ -71,7 +75,7 @@
7175
</x-modal-confirmation>
7276
@elseif (str($service->status())->contains('exited'))
7377
<button wire:click='stop(true)' class="gap-2 button">
74-
<svg class="w-5 h-5 " viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
78+
<svg class="w-5 h-5" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
7579
<path fill="red" d="M26 20h-6v-2h6zm4 8h-6v-2h6zm-2-4h-6v-2h6z" />
7680
<path fill="red"
7781
d="M17.003 20a4.895 4.895 0 0 0-2.404-4.173L22 3l-1.73-1l-7.577 13.126a5.699 5.699 0 0 0-5.243 1.503C3.706 20.24 3.996 28.682 4.01 29.04a1 1 0 0 0 1 .96h14.991a1 1 0 0 0 .6-1.8c-3.54-2.656-3.598-8.146-3.598-8.2Zm-5.073-3.003A3.11 3.11 0 0 1 15.004 20c0 .038.002.208.017.469l-5.9-2.624a3.8 3.8 0 0 1 2.809-.848ZM15.45 28A5.2 5.2 0 0 1 14 25h-2a6.5 6.5 0 0 0 .968 3h-2.223A16.617 16.617 0 0 1 10 24H8a17.342 17.342 0 0 0 .665 4H6c.031-1.836.29-5.892 1.803-8.553l7.533 3.35A13.025 13.025 0 0 0 17.596 28Z" />

resources/views/livewire/project/shared/execute-container-command.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<h1>Terminal</h1>
1111
<livewire:project.database.heading :database="$resource" />
1212
@elseif ($type === 'service')
13-
<h2>Terminal</h2>
13+
<livewire:project.service.navbar :service="$resource" :parameters="$parameters" title="Terminal" />
1414
@endif
1515
<div x-init="$wire.loadContainers">
1616
<div class="pt-4" wire:loading wire:target='loadContainers'>

0 commit comments

Comments
 (0)