Skip to content

Commit

Permalink
Merge pull request #656 from project-primera/develop
Browse files Browse the repository at this point in the history
Release 0.13.2
  • Loading branch information
slime-hatena committed Mar 6, 2024
2 parents eb7ef72 + 9e3a398 commit a99239e
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 61 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ ARG application_version=""
ARG commit_hash=""
ARG supervisor_version="4.2.1-r0"
ARG nginx_version="1.18.0-r15"
ARG nodejs_version="14.19.0-r0"
ARG npm_version="14.19.0-r0"
ARG nodejs_version="14.20.1-r0"
ARG npm_version="14.20.1-r0"
ARG npm_yarn_version="1.22.17"
COPY --from=composer /src /app
COPY docker/docker-entrypoint.sh /etc/
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dockle:
docker run --rm --disable-content-trust -v /var/run/docker.sock:/var/run/docker.sock goodwithtech/dockle:latest $(imageName):$(tagName) | tee .dockle-scan

trivy:
docker run --rm --disable-content-trust -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}/.cache:/root/.cache/ aquasec/trivy $(imageName):$(tagName) | tee .trivy-scan
docker run --rm --disable-content-trust -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}/.cache:/root/.cache/ aquasec/trivy image $(imageName):$(tagName) | tee .trivy-scan

local:
make build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function getIndex(int $music, string $difficulty){
$technicalGrades = ["P", "SSS+", "SSS", "SS", "S", "AAA", "AA", "A", "B"];

$rateKeys = [];
for ($i = 0; $i <= 16; ++$i) {
for ($i = 0; $i <= 17; ++$i) {
$rateKeys[] = $i . ".00";
$rateKeys[] = $i . ".25";
$rateKeys[] = $i . ".50";
Expand Down
3 changes: 3 additions & 0 deletions OngekiScoreLog/app/Http/Controllers/ViewUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ public function getUserPage($id, $mode = null){
"Lv.13+" => [],
"Lv.14" => [],
"Lv.14+" => [],
"Lv.15" => [],
"Lv.15+" => [],
"Lv.0" => [],
];

$stat['average'] = $stat['level'];
Expand Down
4 changes: 2 additions & 2 deletions OngekiScoreLog/resources/assets/js/bookmarklets/getScore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ import * as qs from 'qs';
}
}).then(result => {
if (result.data.message === void 0 || result.data.id === void 0 || result.data.name === void 0 || result.data.hash === void 0) {
throw new Error("不明なエラーが発生しました。<br>ブックマークレットの再生成をお試しください。");
throw new Error("不明なエラーが発生しました。");
} else if (result.data.message != "ok") {
throw new Error(result.data.message);
}
Expand All @@ -507,7 +507,7 @@ import * as qs from 'qs';
name = result.data.name;

}).catch(await function (error) {
throw new Error(error + "<br>スコアツールサーバーへの接続に失敗しました。<br>多くの場合メンテナンス中です。<br>予告のないメンテナンスは5分程度で終了します。<br>情報については<a href='https://twitter.com/ongeki_score' target='_blank' style='color:#222'>Twitter@ongeki_score</a>にてお知らせします。<br>長時間解決しない場合はブックマークレットの再生成をお試しください。");
throw new Error(error + "<br>スコアツールサーバーへの接続に失敗しました。<br><br>まずは以下の手順をお試しください。<br>1)ブックマークレットの生性を行い、現在ご利用のブックマークレットに上書きして再度実行してください。<br>2)メンテナンス情報をご確認ください。情報については<a href='https://twitter.com/ongeki_score' target='_blank' style='color:#222'>Twitter@ongeki_score</a>にてお知らせします。");
});

echo("ユーザー確認: " + name + "さん(id: " + userId + ")<hr>");
Expand Down
12 changes: 2 additions & 10 deletions OngekiScoreLog/resources/assets/js/userProgress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,14 @@ async function convert(element: HTMLElement, index: number) {
await pr.then(canvas => {
++renderingState
let base64 = canvas.toDataURL();
base64 = base64.substring(base64.indexOf(",") + 1);

$('form').append(
$('<input type="hidden" name="img[' + index + ']">').val(base64)
$('div#generate_images').append(
$("<img>").attr("src", base64)
);

$('.progress').val(renderingState / images * 100);
$(".progress-message").text("画像化中: " + renderingState + "/" + images + "(" + Math.round(renderingState / images * 100) + "%)");

if (images - 1 <= renderingState) {
// $('.user-progress').css('width','auto');
$('.progress').val(100);
$(".progress-message").text("ツイート中・・・");
$('.convert-to-image-button').prop("disabled", false);
}
}).catch((res) => {
$(".progress-message").text("エラーが発生しました。<br>" + JSON.stringify(res));
throw res;
Expand Down Expand Up @@ -55,6 +48,5 @@ $(function ($) {
}

$('.progress').removeClass("is-progress").removeAttr("value").removeAttr("max");
$('#tweet_form').submit();
})
});
9 changes: 9 additions & 0 deletions OngekiScoreLog/resources/assets/sass/_user_progress.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#generate_images {
img {
border: 1px solid #1fc8db;
width: 128px;
margin-left: 8px;
margin-top: 8px;
}
}

.user-progress{
.info{
width: 100%;
Expand Down
23 changes: 4 additions & 19 deletions OngekiScoreLog/resources/views/music_list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,12 @@
@section('content')
<article class="box">
<p>
各ユーザーごとのレート値は"ユーザーページ>Technical"からご確認いただけます。
</p>
<p>
譜面定数が灰斜体のものは推定値です。<br>
データをご提供頂ける場合は「ハンドルネーム, 楽曲名, 難易度, 譜面定数」を添えて、以下の連絡先からご連絡いただけますと幸いです。<br>
<a href="https://twitter.com/ongeki_score" target="_blank">Twitter@ongeki_score</a>
各ユーザーごとのレート値は"ユーザーページ>Technical"からご確認いただけます。<br>
譜面定数が灰斜体のものは推定値です。
</p>
<div class="notification">
<p>
掲載されている譜面定数データは<b>以下のデータ御提供者様の御名前を併記することを条件として</b>、誰でも利用することができます。但し、楽曲名などを始めとした著作物に対しての許諾ではございません。個人の判断でご利用ください。
</p>
譜面定数データは、<a href="https://twitter.com/ongeki_level" target="_blank">オンゲキ譜面定数部(Twitter@ongeki_level)</a>様のデータを活用しております。
</div>
<p>
<b>データ御提供者様(順不同 敬称略)</b><br>
<ul>
<li><a href="https://twitter.com/Rinsaku471" target="_blank">Twitter@Rinsaku471</a></li>
<li><a href="https://twitter.com/RKS49019722" target="_blank">Twitter@RKS49019722</a></li>
<li><a href="https://twitter.com/masa_9713" target="_blank">Twitter@masa_9713</a></li>
</ul>
以上の皆様から頂いた情報をもとにしております。御提供ありがとうございました。
</p>

<div id="sort_table" class="table_wrap">
<table class="table is-narrow user-progress-total-table music-list">
Expand Down Expand Up @@ -67,4 +52,4 @@
</table>
</div>
</article>
@endsection
@endsection
35 changes: 12 additions & 23 deletions OngekiScoreLog/resources/views/user_progress.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,18 @@

@section('content')
<article class="box">
@if (!$isLoggedIn)
<p>ツイート機能を使うにはログインしてください。<br><button class="button" disabled>以下を画像化してツイート</button></p>
@elseif (!$isTwitterEnabled)
<p>Twitter連携を行っていません。連携は<a href="/setting">こちら</a>。<br>
<button class="button" disabled>以下を画像化してツイート</button></p>
@else
<p>このアカウントでツイートします: {{$twitterScreenName}}</p>
<form id="tweet_form" action="/tweet/image" method="post" onsubmit="document.getElementById(\'submit_button\').disabled = true">
{{csrf_field()}}
<div class="field">
<label class="label">ツイートの内容(100文字まで)</label>
<div class="control">
<textarea name="status" class="textarea" maxlength="100">{{$status[0]->name}}さんの更新差分 https://ongeki-score.net/user/{{$id}} #OngekiScoreLog</textarea>
</div>
</div>
<button type="button" id="submit_button" class="button convert-to-image-button">以下を画像化してツイート</button>
</form><div style="padding: 0.75em 0">
<div class="progress-message"></div>
<progress class="progress is-progress is-link" value="0" max="100">0%</progress>
</div>
<p>全ての記録をツイートします。4枚に収まらない場合はインリプライに続きます。(1枚につき7曲)<br>
<b>初めてこの機能を使用する場合は大量のツイートがされる可能性があります。十分注意して使用いただくようお願いいたします。</b></p>
@endif
<p>
Twitter連携機能はAPIを利用制限されたため、提供を終了いたしました。<br>
必要に応じて画像を保存し、各種SNSにてご利用ください。
</p>
<button type="button" id="submit_button" class="button convert-to-image-button">以下を画像化</button>
<div style="padding: 0.75em 0">
<div class="progress-message"></div>
<progress class="progress is-progress is-link" value="0" max="100">0%</progress>
</div>

<div id="generate_images"></div>

<div class="field">
<label class="label">表示期間</label>
<div id="select-generation" class="select">
Expand Down
9 changes: 6 additions & 3 deletions OngekiScoreLog/routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
Route::get('/user/{id}/music/{music}', 'ViewUserMusicController@getRedirect')->where(['id' => '\d+', 'music' => '\d+']);
Route::get('/user/{id}/{mode?}', 'ViewUserController@getUserPage')->where(['id' => '\d+']);

Route::get('/music/{music}/{difficulty}', 'ViewMusicStatisticsController@getIndex')->where(['music' => '\d+', 'difficulty' => '\w+']);
Route::get('/music/{music}', 'ViewMusicStatisticsController@getRedirect')->where(['music' => '\d+']);
Route::middleware('throttle:3,1')->group(function () {
Route::get('/music/{music}/{difficulty}', 'ViewMusicStatisticsController@getIndex')->where(['music' => '\d+', 'difficulty' => '\w+']);
Route::get('/music/{music}', 'ViewMusicStatisticsController@getRedirect')->where(['music' => '\d+']);
});

Route::get('/music', 'ViewMusicExtraLevelController@getIndex');

Route::get('/random', 'ViewUserController@redirectRandomUserPage');
Expand Down Expand Up @@ -60,4 +63,4 @@
/* for debug
Route::get('/version/update', 'SimpleViewController@versionUpdate');
Route::get('/t/{s}', 'SimpleViewController@testTweet');
*/
*/

0 comments on commit a99239e

Please sign in to comment.