swirl/views/index.jet

145 lines
5.5 KiB
Go
Raw Normal View History

2017-09-26 12:50:09 +00:00
{{ extends "_layouts/default" }}
2018-03-22 08:13:54 +00:00
{{ block script() }}
<script src="/assets/chart/chart.bundle.min.js?v=2.7.2"></script>
<script>$(() => new Swirl.IndexPage())</script>
{{ end }}
2017-09-26 12:50:09 +00:00
{{ block infobox(style, icon, text, url, count) }}
<div class="column">
<div class="notification is-{{style}}">
<nav class="level is-mobile">
<div class="level-left">
<div class="level-item has-text-centered">
2018-01-26 05:10:38 +00:00
<span class="icon infobox"><i class="fas fa-{{icon}} fa-4x"></i></span>
2017-09-26 12:50:09 +00:00
</div>
</div>
<div class="level-right">
<div class="level-item has-text-centered">
<div>
<p class="heading">{{text}}</p>
<p class="title"><a href="{{url}}" style="text-decoration: none">{{count}}</a></p>
</div>
</div>
</div>
</nav>
</div>
</div>
{{end}}
{{ block progress(title, percent) }}
<span class="is-pulled-left is-size-7">{{title}}</span><span class="is-pulled-right is-size-7">{{percent}}%</span>
<progress class="progress is-narrow{{if percent >= 95}} is-success{{else if percent >= 50}} is-warning{{else if percent > 0}} is-danger{{end}}" value="{{percent}}" max="100">30%</progress>
{{end}}
{{ block body() }}
2018-03-22 08:13:54 +00:00
<section class="hero is-primary is-bold">
2017-09-26 12:50:09 +00:00
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title is-2">
SWIRL <span class="tag is-success">V{{ version }}</span>
</h1>
2017-10-12 03:04:27 +00:00
<h2 class="subtitle is-5">{{ i18n("description") }}</h2>
2017-09-26 12:50:09 +00:00
<p>
2018-03-22 08:13:54 +00:00
<a class="button is-primary" href="https://github.com/cuigh/swirl" target="_blank">
2017-09-26 12:50:09 +00:00
<span class="icon">
2018-01-26 05:10:38 +00:00
<i class="fab fa-github"></i>
2017-09-26 12:50:09 +00:00
</span>
2017-10-12 03:04:27 +00:00
<span>GitHub</span>
2017-09-26 12:50:09 +00:00
</a>
</p>
</div>
</div>
</section>
<section class="section">
<div class="notification is-warning is-hidden">
WARNING: Swirl is running on basic mode now, some features are disabled. You can enable full features by configuring database.
</div>
<div class="columns">
2018-03-16 08:50:03 +00:00
{{yield infobox(style="success", icon="cubes", text=i18n("home.node"), url="/node/", count=.NodeCount)}}
{{yield infobox(style="info", icon="globe", text=i18n("home.network"), url="/network/", count=.NetworkCount)}}
{{yield infobox(style="danger", icon="ticket-alt", text=i18n("home.service"), url="/service/", count=.ServiceCount)}}
{{yield infobox(style="primary", icon="server", text=i18n("home.stack"), url="/stack/task/", count=.StackCount)}}
2017-09-26 12:50:09 +00:00
</div>
<hr>
2018-03-22 08:13:54 +00:00
<nav class="level">
<div class="level-left">
<div class="level-item">
<p class="subtitle is-5">
<strong>{{ i18n("home.monitor") }}</strong>
</p>
2017-09-26 12:50:09 +00:00
</div>
</div>
2018-03-22 08:13:54 +00:00
<div class="level-right">
<div class="level-item">
<button id="btn-add" class="button is-success">
<span class="icon"><i class="fas fa-plus"></i></span><span>{{ i18n("button.add") }}</span>
</button>
</div>
<div class="level-item">
<button id="btn-save" class="button is-info">
<span class="icon"><i class="fas fa-save"></i></span><span>{{ i18n("button.save") }}</span>
</button>
2017-09-26 12:50:09 +00:00
</div>
2018-03-22 08:13:54 +00:00
</div>
</nav>
<div id="div-charts" class="columns is-multiline">
{{ range .Charts }}
<div class="column is-{{ .Width }}" data-chart-name="{{ .Name }}" data-chart-type="{{ .Type }}" data-chart-unit="{{ .Unit }}" data-chart-width="{{ .Width }}" data-chart-height="{{ .Height }}">
2018-03-22 08:13:54 +00:00
<div class="card">
2017-09-26 12:50:09 +00:00
<header class="card-header">
2018-03-22 08:13:54 +00:00
<p class="card-header-title">{{ .Title }}</p>
<a data-action="remove-chart" class="card-header-icon" aria-label="remove chart">
<span class="icon">
<i class="fas fa-times has-text-danger" aria-hidden="true"></i>
</span>
</a>
{*<a data-action="remove-chart" class="card-header-icon is-paddingless" aria-label="remove chart">*}
{*<span class="icon">*}
{*<i class="fas fa-times has-text-danger" aria-hidden="true"></i>*}
{*</span>*}
{*</a>*}
{*<a data-action="edit-options" class="card-header-icon" aria-label="edit options">*}
{*<span class="icon">*}
{*<i class="fas fa-ellipsis-h has-text-info" aria-hidden="true"></i>*}
{*</span>*}
{*</a>*}
2017-09-26 12:50:09 +00:00
</header>
<div class="card-content">
<div style="height: {{ .Height }}px">
<canvas id="canvas_{{ .Name }}"></canvas>
</div>
2017-09-26 12:50:09 +00:00
</div>
</div>
</div>
2018-03-22 08:13:54 +00:00
{{ end }}
2017-09-26 12:50:09 +00:00
</div>
</section>
<div id="dlg-add-chart" class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Add chart</p>
<button class="delete"></button>
</header>
<section class="modal-card-body" style="max-height: 400px; overflow-y: auto">
<nav id="nav-charts" class="panel">
<div class="panel-block">
<p class="control has-icons-left">
<input id="txt-query" class="input is-small" type="text" placeholder="Searching chart...">
<span class="icon is-small is-left">
<i class="fas fa-search"></i>
</span>
</p>
</div>
</nav>
</section>
<footer class="modal-card-foot">
<button id="btn-add-chart" type="button" class="button is-primary">{{ i18n("button.confirm") }}</button>
<button type="button" class="button dismiss">{{ i18n("button.cancel") }}</button>
</footer>
</div>
</div>
2017-09-26 12:50:09 +00:00
{{ end }}