repostats/templates/gitee.html

65 lines
3.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{define "gitee.html" -}}
{{template "header.html" .}}
{{template "admin-left-menu.html" .}}
<div id="admin-right-content">
<div class="ui basic segment">
<h3 class="ui header">Gitee 配置</h3>
<div class="ui content">
<div class="ui compact info message">
<div class="header">须知事项</div>
<p>RepoStats 使用 Oauth 授权码模式访问 Gitee 授权许可的接口并获取相关数据。</p>
<ul class="list">
<li>请根据 <a target="_blank" href="https://gitee.com/api/v5/oauth_doc#/">《Gitee Oauth 文档》</a> 指南在 Gitee 平台新建属于您的第三方应用 </li>
<li>将您的应用信息填入下列表格中并点击「应用授权」以获取 Gitee 平台授权 Code此过程将打开新窗口页面</li>
<li>将授权成功后转向页面 url 中的 code 信息填入下列表格,再点击「获取 Token」完成全过程</li>
<li>在此过程中RepoStats 不会保存任何第三方应用信息,只记录最终的 AccessToken 以备网络请求使用</li>
</ul>
</div>
<div class="ui two column stackable grid">
<div class="eight wide column">
<h3>应用信息</h3>
<form id="form-gitee-authorize" class="ui form">
<div class="ui field">
<label>Client ID</label>
<input type="text" name="client_id" placeholder="Client ID">
</div>
<div class="field">
<label>Client Secret</label>
<input type="text" name="client_secret" placeholder="Client Secret">
</div>
<div class="field">
<label>应用回调地址</label>
<input type="text" name="redirect_url" placeholder="应用回调地址">
</div>
<div class="field">
<label>权限</label>
<input type="text" name="scopes" readonly value="user_info projects pull_requests issues emails">
</div>
<div class="field">
<label>授权 Code</label>
<input type="text" name="code" placeholder="获取授权完成后,转向到回调地址 url 中携带的 code 值">
</div>
<div id="gitee-token-message" class="ui error message"></div>
{{if .oauth_info}}
<div class="ui bottom attached compact positive message">
<i class="close icon"></i>
<div class="header">Gitee AccessToken</div>
<p>当前 token 信息已存在,若无必要不必重新获取。</p>
<code style="word-break: break-word;">{{.oauth_info}}</code>
</div>
{{end}}
<button id="btn-gitee-authorize" class="ui button" type="button">应用授权</button>
<button id="btn-gitee-token" class="ui button" type="button">获取 Token</button>
</form>
</div>
<div class="eight wide column">
<h3>注意事项</h3>
<p>RepoStats 当前版本需要获取至少以下权限才能保证各项功能正常。</p>
<img src="/assets/imgs/scopes.jpg" />
</div>
</div>
</div><!--end of ui content-->
</div> <!--end of basic segment-->
</div><!--end of admin-right-content-->
{{template "footer.html" .}}
{{end -}}