ダッシュボードの確認済み
This commit is contained in:
@@ -71,6 +71,19 @@ a.op-button-edit:hover {
|
|||||||
color: #fcfcfc;
|
color: #fcfcfc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.op-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-auto-flow: column;
|
||||||
|
margin: 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.op-grid-item {
|
||||||
|
margin: 4px;
|
||||||
|
padding: 2px;
|
||||||
|
border: 1px solid #fcfcfc;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
tr.status-free { background-color: #34860e; color: #fff; }
|
tr.status-free { background-color: #34860e; color: #fff; }
|
||||||
tr.status-reserved { background-color: #c59e1d; color: #fff; }
|
tr.status-reserved { background-color: #c59e1d; color: #fff; }
|
||||||
tr.status-use { background-color: #850000; color: #fff; }
|
tr.status-use { background-color: #850000; color: #fff; }
|
||||||
|
|||||||
@@ -78,6 +78,10 @@ class Op {
|
|||||||
$this->tmpl->assign('pagetit', $this->pagetit);
|
$this->tmpl->assign('pagetit', $this->pagetit);
|
||||||
|
|
||||||
if (!$this->user || $this->user->role !== Roles::ADMIN) goto noaccess;
|
if (!$this->user || $this->user->role !== Roles::ADMIN) goto noaccess;
|
||||||
|
$data = $this->op->getReseller(['with_statistics' => true]);
|
||||||
|
$domain = $this->op->listDomains(['order_by.renewal_date' => 'asc', 'status' => 'ACT']);
|
||||||
|
$this->tmpl->assign('data', $data->data);
|
||||||
|
$this->tmpl->assign('domain', $domain->data);
|
||||||
$this->tmpl->render('index');
|
$this->tmpl->render('index');
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ class Curl {
|
|||||||
if ($method === 'POST' || $method === 'PUT') {
|
if ($method === 'POST' || $method === 'PUT') {
|
||||||
if (!empty($this->postRaw)) {
|
if (!empty($this->postRaw)) {
|
||||||
$httpData = $this->postRaw;
|
$httpData = $this->postRaw;
|
||||||
} elseif (!empty($this->postFields)) {
|
} else if (!empty($this->postFields)) {
|
||||||
$httpData = http_build_query($this->postFields);
|
$httpData = http_build_query($this->postFields);
|
||||||
if (!isset($this->headers['Content-Type'])) {
|
if (!isset($this->headers['Content-Type'])) {
|
||||||
$this->headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
$this->headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ class Openprovider {
|
|||||||
private string $ip = '';
|
private string $ip = '';
|
||||||
private int $resellerId = 0;
|
private int $resellerId = 0;
|
||||||
private int $lastAuth = 0;
|
private int $lastAuth = 0;
|
||||||
// private string $BASEURL = 'https://api.openprovider.eu/v1beta';
|
private string $BASEURL = 'https://api.openprovider.eu/v1beta';
|
||||||
private string $BASEURL = DEBUG_MODE ? 'http://api.sandbox.openprovider.nl:8480/v1beta'
|
// private string $BASEURL = DEBUG_MODE ? 'http://api.sandbox.openprovider.nl:8480/v1beta'
|
||||||
: 'https://api.openprovider.eu/v1beta';
|
// : 'https://api.openprovider.eu/v1beta';
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
if (!OPENPROVIDER_ENABLED) return;
|
if (!OPENPROVIDER_ENABLED) return;
|
||||||
@@ -64,6 +64,10 @@ class Openprovider {
|
|||||||
$this->cache = new Cache($this->cacheDir);
|
$this->cache = new Cache($this->cacheDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function deleteCache(string $name): void {
|
||||||
|
$this->cache->murder($name);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* トークンの受け取り。
|
* トークンの受け取り。
|
||||||
* このライブリリーを使ったら、一回「login()」を実行する事が必須となります。
|
* このライブリリーを使ったら、一回「login()」を実行する事が必須となります。
|
||||||
@@ -147,7 +151,6 @@ class Openprovider {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ドメイン一覧。
|
* ドメイン一覧。
|
||||||
* @todo テスト
|
|
||||||
*
|
*
|
||||||
* @return Result 結果。
|
* @return Result 結果。
|
||||||
*/
|
*/
|
||||||
@@ -157,11 +160,12 @@ class Openprovider {
|
|||||||
$cache = $this->cache->get($cacheName);
|
$cache = $this->cache->get($cacheName);
|
||||||
if ($this->cache->resurrect($cache, $query)) return Result::Success('', $cache);
|
if ($this->cache->resurrect($cache, $query)) return Result::Success('', $cache);
|
||||||
|
|
||||||
$curl = $this->setupCurl('/domains');
|
$uri = "/domains?".http_build_query($query, '', '&', PHP_QUERY_RFC3986);
|
||||||
|
$curl = $this->setupCurl($uri);
|
||||||
$res = $this->curlResult($curl);
|
$res = $this->curlResult($curl);
|
||||||
if (isset($res['data']['results'])) {
|
if (isset($res->data['data']['results'])) {
|
||||||
$this->cache->set($cacheName, $res->data);
|
$this->cache->set($cacheName, $res->data);
|
||||||
return Result::Success('', $res['data']['results']);
|
return Result::Success('', $res->data['data']['results']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Result::Error('ドメインの確認に失敗。');
|
return Result::Error('ドメインの確認に失敗。');
|
||||||
@@ -213,7 +217,8 @@ class Openprovider {
|
|||||||
'autorenew' => $autorenew,
|
'autorenew' => $autorenew,
|
||||||
];
|
];
|
||||||
|
|
||||||
$curl = $this->setupCurl('/domains/', 'POST', $payload);
|
$uri = '/domains/';
|
||||||
|
$curl = $this->setupCurl($uri, 'POST', $payload);
|
||||||
kys('TODO');
|
kys('TODO');
|
||||||
$res = $this->curlResult($curl);
|
$res = $this->curlResult($curl);
|
||||||
if (isset($res['data'])) return Result::Success('', $res);
|
if (isset($res['data'])) return Result::Success('', $res);
|
||||||
@@ -250,7 +255,8 @@ class Openprovider {
|
|||||||
'with_price' => $with_price,
|
'with_price' => $with_price,
|
||||||
];
|
];
|
||||||
|
|
||||||
$curl = $this->setupCurl('/domains/check', 'POST', $payload);
|
$uri = '/domains/check';
|
||||||
|
$curl = $this->setupCurl($uri, 'POST', $payload);
|
||||||
$res = $this->curlResult($curl);
|
$res = $this->curlResult($curl);
|
||||||
if (isset($res->data['data']['results'])) return Result::Success('', $res->data['data']['results']);
|
if (isset($res->data['data']['results'])) return Result::Success('', $res->data['data']['results']);
|
||||||
|
|
||||||
@@ -267,7 +273,8 @@ class Openprovider {
|
|||||||
public function suggestDomainname(array $payload = []): Result {
|
public function suggestDomainname(array $payload = []): Result {
|
||||||
if (!OPENPROVIDER_ENABLED) return Result::error('エラー:OpenProviderは無効です。');
|
if (!OPENPROVIDER_ENABLED) return Result::error('エラー:OpenProviderは無効です。');
|
||||||
|
|
||||||
$curl = $this->setupCurl('/domains/suggest-name', 'POST', $payload);
|
$uri = '/domains/suggest-name';
|
||||||
|
$curl = $this->setupCurl($uri, 'POST', $payload);
|
||||||
$res = $this->curlResult($curl);
|
$res = $this->curlResult($curl);
|
||||||
if (isset($res->data['data']['results'])) {
|
if (isset($res->data['data']['results'])) {
|
||||||
return Result::Success('ドメインを勧められる事に成功。', $res->data['data']['results']);
|
return Result::Success('ドメインを勧められる事に成功。', $res->data['data']['results']);
|
||||||
@@ -286,7 +293,8 @@ class Openprovider {
|
|||||||
public function tradeDomainname(array $payload = []): Result {
|
public function tradeDomainname(array $payload = []): Result {
|
||||||
if (!OPENPROVIDER_ENABLED) return Result::error('エラー:OpenProviderは無効です。');
|
if (!OPENPROVIDER_ENABLED) return Result::error('エラー:OpenProviderは無効です。');
|
||||||
|
|
||||||
$curl = $this->setupCurl('/domains/trade', 'POST', $payload);
|
$uri = '/domains/trade';
|
||||||
|
$curl = $this->setupCurl($uri, 'POST', $payload);
|
||||||
$res = $this->curlResult($curl);
|
$res = $this->curlResult($curl);
|
||||||
if (isset($res->data['data']['results'])) {
|
if (isset($res->data['data']['results'])) {
|
||||||
$this->cache->murder('listdomains');
|
$this->cache->murder('listdomains');
|
||||||
@@ -306,7 +314,8 @@ class Openprovider {
|
|||||||
public function transferDomainname(array $payload = []): Result {
|
public function transferDomainname(array $payload = []): Result {
|
||||||
if (!OPENPROVIDER_ENABLED) return Result::error('エラー:OpenProviderは無効です。');
|
if (!OPENPROVIDER_ENABLED) return Result::error('エラー:OpenProviderは無効です。');
|
||||||
|
|
||||||
$curl = $this->setupCurl('/domains/transfer', 'POST', $payload);
|
$uri = '/domains/transfer';
|
||||||
|
$curl = $this->setupCurl($uri, 'POST', $payload);
|
||||||
$res = $this->curlResult($curl);
|
$res = $this->curlResult($curl);
|
||||||
if (isset($res->data['data']['results'])) {
|
if (isset($res->data['data']['results'])) {
|
||||||
$this->cache->murder('listdomains');
|
$this->cache->murder('listdomains');
|
||||||
@@ -2084,7 +2093,6 @@ class Openprovider {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* リセラーの受け取り
|
* リセラーの受け取り
|
||||||
* @todo テスト
|
|
||||||
*
|
*
|
||||||
* @param array $query 検索クエリー
|
* @param array $query 検索クエリー
|
||||||
* @return Result
|
* @return Result
|
||||||
@@ -2160,7 +2168,6 @@ class Openprovider {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 統計の受け取り
|
* 統計の受け取り
|
||||||
* @todo テスト
|
|
||||||
*
|
*
|
||||||
* @return Result
|
* @return Result
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{@ include(common/header) @}
|
{@ include(common/header) @}
|
||||||
<h1>{{ $description }}</h1>
|
<h1>お帰り、{{ $data['data']['name']['full_name'] }}様</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<li>請求</li>
|
<li>請求</li>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -23,4 +23,39 @@
|
|||||||
<li><a href="/openprovider/listdnszones">DNSゾーン一覧</a></li>
|
<li><a href="/openprovider/listdnszones">DNSゾーン一覧</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<div class="op-grid">
|
||||||
|
<div class="op-grid-item">
|
||||||
|
<div style="color: #00bb00; font-size: 24px;">利用可能な残高: € {{ $data['data']['balance'] }}</div>
|
||||||
|
<div style="color: #777; font-size: 11px;">使用残高: € {{ $data['data']['reserved_balance'] }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="op-grid-item">
|
||||||
|
<a href="/openprovider/listdomains">ドメイン名</a>数:{{ $data['data']['statistics']['domain']['by_status']['ACT'] }}
|
||||||
|
</div>
|
||||||
|
<div class="op-grid-item">
|
||||||
|
<a href="/openprovider/listsslorders">SSL証明書</a>数:{{ $data['data']['statistics']['ssl']['by_status']['ACT'] }}
|
||||||
|
</div>
|
||||||
|
<div class="op-grid-item">
|
||||||
|
<a href="/openprovider/listlicenses">ライセンス</a>数:{{ $data['data']['statistics']['license']['total'] }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>間もなく更新が必要なドメイン名</h2>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ドメイン名</th>
|
||||||
|
<th>更新日</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{@ foreach ($domain as $d) @}
|
||||||
|
<tr>
|
||||||
|
{$ $dom = $d['domain']['name'].'.'.$d['domain']['extension'] $}
|
||||||
|
<td><a href="/openprovider/getdomain/{{ $dom }}">{{ $dom }}</a></td>
|
||||||
|
<td>{{ $d['renewal_date'] }}</td>
|
||||||
|
</tr>
|
||||||
|
{@ endforeach @}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
{@ include(common/footer) @}
|
{@ include(common/footer) @}
|
||||||
Reference in New Issue
Block a user