feat: display s2oj version
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-09-21 13:27:01 +08:00
parent dac1c4bf51
commit d8bbc6f41c
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
4 changed files with 20 additions and 8 deletions

View File

@ -57,7 +57,12 @@ steps:
- name: tags
image: alpine
commands:
- echo -n "latest, $DRONE_BRANCH, ${DRONE_COMMIT_SHA:0:8}" > .tags
- echo -n "latest, $DRONE_BRANCH, ${DRONE_COMMIT_SHA:0:7}" > .tags
- name: version
image: alpine
commands:
- sed -i "s/'s2oj-version' => 'dev'/'s2oj-version' => '${DRONE_COMMIT_SHA:0:7}'/g" web/app/.default-config.php
- name: docker
image: plugins/docker

View File

@ -99,6 +99,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Replace version
run: |
sed -i "s/'s2oj-version' => 'dev'/'s2oj-version' => '$(echo "${{ github.sha }}" | cut -c1-7)'/g" web/app/.default-config.php
- name: Log in to the Container registry
uses: docker/login-action@v2.0.0
with:

View File

@ -6,7 +6,8 @@ return [
'administrator' => 'root',
'admin-email' => 'admin@sjzezoj.com',
'QQ-group' => '',
'ICP-license' => '冀ICP备2020028886号'
'ICP-license' => '冀ICP备2020028886号',
's2oj-version' => 'dev'
],
'database' => [
'database' => 'app_uoj233',

View File

@ -15,12 +15,14 @@
<a class="dropdown-item" href="<?= HTML::url(UOJContext::requestURI(), array('params' => array('locale' => 'en'))) ?>">English</a>
</div>
</div>
<ul class="list-inline"><li class="list-inline-item">Universal Online Judge</li></ul>
<?php if (UOJConfig::$data['profile']['ICP-license'] != ''): ?>
<p><a target="_blank" href="https://beian.miit.gov.cn" style="text-decoration:none;"><?= UOJConfig::$data['profile']['ICP-license'] ?></a></p>
<?php endif ?>
<p><?= UOJLocale::get('server time') ?>: <?= UOJTime::$time_now_str ?> | <a href="https://github.com/renbaoshuo/S2OJ" target="_blank"><?= UOJLocale::get('opensource project') ?></a></p>
<p><?= UOJLocale::get('server time') ?>: <?= UOJTime::$time_now_str ?></p>
<p>
<a href="https://github.com/renbaoshuo/S2OJ<?= UOJConfig::$data['profile']['s2oj-version'] == "dev" ? '' : '/tree/' . UOJConfig::$data['profile']['s2oj-version'] ?>">S2OJ (<?= UOJConfig::$data['profile']['s2oj-version'] ?>)</a>
<?php if (UOJConfig::$data['profile']['ICP-license'] != ''): ?>
| <a target="_blank" href="https://beian.miit.gov.cn" style="text-decoration:none;"><?= UOJConfig::$data['profile']['ICP-license'] ?></a>
<?php endif ?>
</p>
</div>
<?php endif ?>
</div>