Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
monitoring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cylab
monitoring
Commits
960af43f
Commit
960af43f
authored
1 year ago
by
Thibault Debatty
Browse files
Options
Downloads
Patches
Plain Diff
preserve organization when we update a server
parent
45724bde
No related branches found
No related tags found
No related merge requests found
Pipeline
#13796
failed
1 year ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Http/Controllers/ServerController.php
+4
-1
4 additions, 1 deletion
app/Http/Controllers/ServerController.php
resources/views/server/edit.blade.php
+3
-1
3 additions, 1 deletion
resources/views/server/edit.blade.php
with
7 additions
and
2 deletions
app/Http/Controllers/ServerController.php
+
4
−
1
View file @
960af43f
...
...
@@ -32,7 +32,10 @@ class ServerController extends Controller
public
function
create
()
{
$this
->
authorize
(
"create"
,
Server
::
class
);
return
view
(
"server.edit"
,
[
"server"
=>
new
Server
()]);
$server
=
new
Server
();
$server
->
organization
=
Auth
::
user
()
->
organizations
->
first
();
return
view
(
"server.edit"
,
[
"server"
=>
$server
]);
}
/**
...
...
This diff is collapsed.
Click to expand it.
resources/views/server/edit.blade.php
+
3
−
1
View file @
960af43f
...
...
@@ -26,8 +26,9 @@
class
=
"form-control{{
$errors->has
('organization_id') ? ' is-invalid' : '' }}"
name
=
"organization_id"
required
autofocus
>
<
option
value
=
"{{
$server->organization
->id }}"
>
{{
$server
->
organization
->
name
}}
</
option
>
@
foreach
(
Auth
::
user
()
->
organizations
as
$organization
)
<
option
value
=
"{{
$organization->id
}}"
{{
old
(
'organization_id'
,
$server
->
organization_id
)
==
$organization
->
id
?
"selected"
:
""
}}
">{{
$organization->name
}}</option>
<
option
value
=
"{{
$organization->id
}}"
>
{{
$organization
->
name
}}
</
option
>
@
endforeach
</
select
>
...
...
@@ -64,6 +65,7 @@
<
textarea
id
=
"description"
class
=
"form-control{{
$errors->has
('description') ? ' is-invalid' : '' }}"
name
=
"description"
placeholder
=
"You can use Markdown here..."
rows
=
"10"
>
{{
old
(
'description'
,
$server
->
description
)
}}
</
textarea
>
@
if
(
$errors
->
has
(
'description'
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment