Skip to content

Commit

Permalink
🔥feat: Add control words and title
Browse files Browse the repository at this point in the history
  • Loading branch information
D10S0VSkY-OSS committed Dec 9, 2023
1 parent c2b4171 commit 7edf040
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 34 deletions.
2 changes: 1 addition & 1 deletion sld-dashboard/app/base/static/assets/css/volt.css
Original file line number Diff line number Diff line change
Expand Up @@ -41851,7 +41851,7 @@ pre {
margin-right: 5px;
}

.squad-access {
.limit_words {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
Expand Down
12 changes: 6 additions & 6 deletions sld-dashboard/app/home/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class StackForm(FlaskForm):
name = StringField(
"Name",
[
validators.length(min=4, max=50, message="Name out of reange."),
validators.length(min=4, max=30, message="Name out of reange."),
validators.DataRequired(message="Name requerid."),
validators.Regexp('[\r\n\t\f\v ]', message="Username must contain only letters numbers or underscore"),
],
Expand Down Expand Up @@ -60,7 +60,7 @@ class StackForm(FlaskForm):
description = StringField(
"Description",
[
validators.length(min=1, max=10, message="Set short Description"),
validators.length(min=1, max=50, message="Set short Description"),
],
)
squad_access_edit = StringField(
Expand All @@ -76,7 +76,7 @@ class DeployForm(FlaskForm):
deploy_name = StringField(
"Deploy Name",
[
validators.length(min=4, max=50, message="Name out of reange."),
validators.length(min=4, max=30, message="Name out of reange."),
validators.DataRequired(message="Name requerid."),
],
)
Expand All @@ -97,7 +97,7 @@ class DeployForm(FlaskForm):
environment = StringField(
"Environment",
[
validators.length(min=2, max=250, message="Branch out of reange."),
validators.length(min=2, max=25, message="Branch out of reange."),
validators.DataRequired(message="Environment requerid."),
],
)
Expand Down Expand Up @@ -148,7 +148,7 @@ class UserForm(FlaskForm):
username = StringField(
"Username",
[
validators.length(min=4, max=50),
validators.length(min=4, max=20),
],
)
fullname = StringField(
Expand All @@ -160,7 +160,7 @@ class UserForm(FlaskForm):
email = EmailField(
"Email",
[
validators.length(min=6, max=100),
validators.length(min=6, max=50),
validators.DataRequired(message="The email is required."),
validators.Email(message="Enter a valid email."),
],
Expand Down
66 changes: 45 additions & 21 deletions sld-dashboard/app/home/templates/deploys-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,44 +147,71 @@ <h2 class="h4">All Deploys</h2>
{% endif %}
</td>
{% endif %}
{% if "azure" in deploy.stack_name %}
<td>
{% if deploy.icon_path %}
<img src="{{ deploy.icon_path }}" alt="Icono" width="40" height="40">
{% else %}
<img src="/static/assets/img/gallery/Providers/azure.svg" alt="Icono" width="40" height="40">
{% endif %}
</td>
{% endif %}
{% if "gcp" in deploy.stack_name %}
<td>
{% if deploy.icon_path %}
<img src="{{ deploy.icon_path }}" alt="Icono" width="40" height="40">
{% else %}
<img src="/static/assets/img/gallery/Providers/gcp.svg" alt="Icono" width="40" height="40">
{% endif %}
</td>
{% endif %}
{% if "custom" in deploy.stack_name %}
<td>
{% if deploy.icon_path %}
<img src="{{ deploy.icon_path }}" alt="Icono" width="40" height="40">
{% else %}
<img src="/static/assets/img/gallery/Providers/custom.svg" alt="Icono" width="40" height="40">
{% endif %}
</td>
{% endif %}

<td>
<span class="font-weight-normal">
<div style="font-size: 17px; font-weight: bold;">{{ deploy.name }}</div>
<div>
<div class="limit_words" title="{{ deploy.name }}" style="font-size: 17px; font-weight: bold;">{{ deploy.name }}</div>
<div class="limit_words" title="{{ deploy.stack_name }}">
<span style="font-size: 12px; font-weight: bold;">stack</span>
: {{ deploy.stack_name }}
</div>
<div>
<div class="limit_words" title="{{ deploy.stack_branch}}"></div>
<span style="font-size: 12px; font-weight: bold;">branch</span>
: {{deploy.stack_branch
}}
: {{deploy.stack_branch}}
</div>
<div>
<span class="copy-icon" onclick="copyToClipboard('id={{ deploy.id }} deploy_name={{ deploy.name }} environment={{ deploy.environment }} stack/branch={{deploy.stack_name}}/{{deploy.stack_branch}} task_id={{deploy.task_id}}')" title="Copy to clipboard">
<span style="font-size: 12px; font-weight: bold;">copy:</span>
<i class="far fa-copy"></i>
</span>
<span
class="download-icon"
data-variables="{{ deploy.variables }}"
onclick="downloadTFVars(this)"
title="Download tfvars"
>
|
<span class="download-icon" data-variables="{{ deploy.variables }}" onclick="downloadTFVars(this)" title="Download tfvars">
<span style="font-size: 12px; font-weight: bold;">tfvars:</span>
<i class="far fa-file"></i>
</span>
</div>
</span>
</td>
<td>
<div class="limit_words">
<span class="tag-style">{{ deploy.squad}}</span>
</div>
</td>
<td>
<td>
<div class="limit_words">
<span class="tag-style">{{ deploy.environment}}</span>
</div>
</td>
<td>
<div>
<span class="font-weight-normal">{{ deploy.username}}</span>
</div>
</td>
<td>
<div>
Expand Down Expand Up @@ -230,13 +257,17 @@ <h2 class="h4">All Deploys</h2>
<span class="fas fa-clone mr-2"></span>
Clone
</a>
<a title="Edit Schedule" class="dropdown-item" href="{{ url_for('.edit_schedule',deploy_id=deploy.id)}}">
<span class="far fa-clock mr-0"></span>
Schedule
</a>
<a class="dropdown-item text-danger" data-toggle="modal" data-target="#DestroyModalCenter-{{deploy.id}}">
<span class="fas fa-trash-alt mr-2"></span>
Destroy
</a>
<a class="dropdown-item text-danger" data-toggle="modal" data-target="#DeleteModalCenter-{{deploy.id}}">
<span class="fas fa-skull-crossbones mr-2"></span>
delete
Delete
</a>
</div>
{% else %}
Expand Down Expand Up @@ -294,13 +325,6 @@ <h2 class="h4">All Deploys</h2>
<span class="far fa-file-code mr-0"></span>
</a>
</span>
<!-- Schedule -->
<span class="icon icon-sm">
<a title="Edit Schedule" class="dropdown-item" href="{{ url_for('.edit_schedule',deploy_id=deploy.id)}}">
<span class="far fa-clock mr-0"></span>
</a>
</span>

</div>
</td>
</tr>
Expand Down
20 changes: 14 additions & 6 deletions sld-dashboard/app/home/templates/stacks-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,24 @@ <h2 class="h4">All Stacks</h2>
{% endif %}
<td><span class="font-weight-normal">{{ stack.id }}</span></td>
<td>
<div class="squad-access">
<div class="limit_words" title="{{stack.stack_name}}">
<span class="tag-style">{{ stack.stack_name }}</span>
</div>
</td>
{% if "yoda" in current_user.role or "darth_vader" in current_user.role %}
<td>
<div class="squad-access">
<span class="font-weight-normal">{{ stack.git_repo }}</span>
<div class="limit_words" title="{{ stack.git_repo }}">
<span style="font-size: 12px; font-weight: bold;">repo:</span>
<span class="font-weight-normal">{{ stack.git_repo.split('/')[-1] | replace('.git', '') }}</span>
</div>
<div class="squad-access">
<div class="limit_words" title="{{ stack.branch }}">
<span style="font-size: 12px; font-weight: bold;">branch:</span>
<span class="font-weight-normal">{{ stack.branch }}</span>
<div>
<span class="copy-icon" onclick="copyToClipboard('{{ stack.git_repo | replace('.git', '') }}/tree/{{ stack.branch }}')" title="Copy to clipboard">
<span style="font-size: 12px; font-weight: bold;">copy:</span>
<i class="far fa-copy"></i>
</div>
</div>
</td>
{% endif %}
Expand All @@ -113,7 +120,7 @@ <h2 class="h4">All Stacks</h2>
</span></td>
<td><span class="tag-style">{{ stack.tf_version }}</span></td>
<td>
<div class="squad-access">
<div class="limit_words">
{% if "*" in stack.squad_access %}
All Squad
{% else %}
Expand All @@ -123,7 +130,7 @@ <h2 class="h4">All Stacks</h2>
</td>

<td>
<div class="squad-access">
<div class="limit_words">
<span class="font-weight-normal">{{ stack.description}}</span>
</div>
</td>
Expand Down Expand Up @@ -239,5 +246,6 @@ <h5 class="modal-title" id="SyncModalLongTitle-{{stack.stack_name}}">Remove Repo

</script>
<script src="/static/assets/js/pagination_edit.js"></script>
<script src="/static/assets/js/copy_clipboard.js"></script>

{% endblock javascripts %}

0 comments on commit 7edf040

Please sign in to comment.